iris-gantt 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Gantt/Gantt.d.ts +2 -2
- package/dist/Gantt/Gantt.d.ts.map +1 -1
- package/dist/Gantt/types.d.ts +5 -0
- package/dist/Gantt/types.d.ts.map +1 -1
- package/dist/iris-gantt.js +962 -956
- package/dist/iris-gantt.umd.cjs +12 -12
- package/package.json +2 -2
package/dist/iris-gantt.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Typography as Ht, Select as
|
|
1
|
+
import re, { useState as z, memo as dr, forwardRef as Ot, useCallback as $e, useEffect as Je, useRef as Qe } from "react";
|
|
2
|
+
import { Typography as Ht, Select as xe, InputNumber as Ye, Button as he, Popover as cr, Tooltip as _e, Input as He, Space as Rt, Divider as Ut, Form as le, Modal as wt, DatePicker as Vt, ColorPicker as Xt, Alert as ur, Card as _t, List as Ft, Tag as pr, Menu as hr } from "antd";
|
|
3
3
|
import { FontAwesomeIcon as de } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { faChevronDown as Yt, faPlus as Ct, faGripVertical as Jt, faChevronRight as fr, faTimesCircle as mr, faSearchMinus as xr, faSearchPlus as yr, faRotateLeft as qt, faFileCsv as gr, faFileExcel as br, faFileCode as wr, faFilePdf as vr, faExclamationTriangle as jr, faLink as Gt, faTrash as Zt, faInfoCircle as Sr, faEdit as Tr, faCopy as Dr, faFlag as kr, faTasks as
|
|
4
|
+
import { faChevronDown as Yt, faPlus as Ct, faGripVertical as Jt, faChevronRight as fr, faTimesCircle as mr, faSearchMinus as xr, faSearchPlus as yr, faRotateLeft as qt, faFileCsv as gr, faFileExcel as br, faFileCode as wr, faFilePdf as vr, faExclamationTriangle as jr, faLink as Gt, faTrash as Zt, faInfoCircle as Sr, faEdit as Tr, faCopy as Dr, faFlag as kr, faTasks as Mr, faFolder as Lr } from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import Kt from "dayjs";
|
|
6
|
-
var gt = { exports: {} },
|
|
6
|
+
var gt = { exports: {} }, lt = {};
|
|
7
7
|
var At;
|
|
8
8
|
function Er() {
|
|
9
|
-
if (At) return
|
|
9
|
+
if (At) return lt;
|
|
10
10
|
At = 1;
|
|
11
|
-
var t =
|
|
12
|
-
function
|
|
11
|
+
var t = re, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
12
|
+
function m(i, s, y) {
|
|
13
13
|
var c, g = {}, j = null, u = null;
|
|
14
14
|
y !== void 0 && (j = "" + y), s.key !== void 0 && (j = "" + s.key), s.ref !== void 0 && (u = s.ref);
|
|
15
|
-
for (c in s) l.call(s, c) && !
|
|
15
|
+
for (c in s) l.call(s, c) && !x.hasOwnProperty(c) && (g[c] = s[c]);
|
|
16
16
|
if (i && i.defaultProps) for (c in s = i.defaultProps, s) g[c] === void 0 && (g[c] = s[c]);
|
|
17
17
|
return { $$typeof: o, type: i, key: j, ref: u, props: g, _owner: r.current };
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return lt.Fragment = a, lt.jsx = m, lt.jsxs = m, lt;
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var dt = {};
|
|
22
22
|
var It;
|
|
23
23
|
function $r() {
|
|
24
24
|
return It || (It = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
25
|
-
var t =
|
|
25
|
+
var t = re, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.portal"), l = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), m = /* @__PURE__ */ Symbol.for("react.provider"), i = /* @__PURE__ */ Symbol.for("react.context"), s = /* @__PURE__ */ Symbol.for("react.forward_ref"), y = /* @__PURE__ */ Symbol.for("react.suspense"), c = /* @__PURE__ */ Symbol.for("react.suspense_list"), g = /* @__PURE__ */ Symbol.for("react.memo"), j = /* @__PURE__ */ Symbol.for("react.lazy"), u = /* @__PURE__ */ Symbol.for("react.offscreen"), p = Symbol.iterator, b = "@@iterator";
|
|
26
26
|
function w(n) {
|
|
27
27
|
if (n === null || typeof n != "object")
|
|
28
28
|
return null;
|
|
@@ -30,46 +30,46 @@ function $r() {
|
|
|
30
30
|
return typeof f == "function" ? f : null;
|
|
31
31
|
}
|
|
32
32
|
var S = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
33
|
-
function
|
|
33
|
+
function L(n) {
|
|
34
34
|
{
|
|
35
|
-
for (var f = arguments.length, T = new Array(f > 1 ? f - 1 : 0),
|
|
36
|
-
T[
|
|
37
|
-
|
|
35
|
+
for (var f = arguments.length, T = new Array(f > 1 ? f - 1 : 0), E = 1; E < f; E++)
|
|
36
|
+
T[E - 1] = arguments[E];
|
|
37
|
+
$("error", n, T);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $(n, f, T) {
|
|
41
41
|
{
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
return String(
|
|
42
|
+
var E = S.ReactDebugCurrentFrame, C = E.getStackAddendum();
|
|
43
|
+
C !== "" && (f += "%s", T = T.concat([C]));
|
|
44
|
+
var V = T.map(function(_) {
|
|
45
|
+
return String(_);
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
V.unshift("Warning: " + f), Function.prototype.apply.call(console[n], console, V);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var B = !1, ne = !1, X = !1, pe = !1, M = !1, q;
|
|
51
51
|
q = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
52
|
-
function
|
|
53
|
-
return !!(typeof n == "string" || typeof n == "function" || n === l || n ===
|
|
52
|
+
function H(n) {
|
|
53
|
+
return !!(typeof n == "string" || typeof n == "function" || n === l || n === x || M || n === r || n === y || n === c || pe || n === u || B || ne || X || typeof n == "object" && n !== null && (n.$$typeof === j || n.$$typeof === g || n.$$typeof === m || n.$$typeof === i || n.$$typeof === s || // This needs to include all possible module reference object
|
|
54
54
|
// types supported by any Flight configuration anywhere since
|
|
55
55
|
// we don't know which Flight build this will end up being used
|
|
56
56
|
// with.
|
|
57
57
|
n.$$typeof === q || n.getModuleId !== void 0));
|
|
58
58
|
}
|
|
59
59
|
function D(n, f, T) {
|
|
60
|
-
var
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
var
|
|
64
|
-
return
|
|
60
|
+
var E = n.displayName;
|
|
61
|
+
if (E)
|
|
62
|
+
return E;
|
|
63
|
+
var C = f.displayName || f.name || "";
|
|
64
|
+
return C !== "" ? T + "(" + C + ")" : T;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function W(n) {
|
|
67
67
|
return n.displayName || "Context";
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ae(n) {
|
|
70
70
|
if (n == null)
|
|
71
71
|
return null;
|
|
72
|
-
if (typeof n.tag == "number" &&
|
|
72
|
+
if (typeof n.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
73
73
|
return n.displayName || n.name || null;
|
|
74
74
|
if (typeof n == "string")
|
|
75
75
|
return n;
|
|
@@ -78,7 +78,7 @@ function $r() {
|
|
|
78
78
|
return "Fragment";
|
|
79
79
|
case a:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case x:
|
|
82
82
|
return "Profiler";
|
|
83
83
|
case r:
|
|
84
84
|
return "StrictMode";
|
|
@@ -91,19 +91,19 @@ function $r() {
|
|
|
91
91
|
switch (n.$$typeof) {
|
|
92
92
|
case i:
|
|
93
93
|
var f = n;
|
|
94
|
-
return
|
|
95
|
-
case
|
|
94
|
+
return W(f) + ".Consumer";
|
|
95
|
+
case m:
|
|
96
96
|
var T = n;
|
|
97
|
-
return
|
|
97
|
+
return W(T._context) + ".Provider";
|
|
98
98
|
case s:
|
|
99
99
|
return D(n, n.render, "ForwardRef");
|
|
100
100
|
case g:
|
|
101
|
-
var
|
|
102
|
-
return
|
|
101
|
+
var E = n.displayName || null;
|
|
102
|
+
return E !== null ? E : ae(n.type) || "Memo";
|
|
103
103
|
case j: {
|
|
104
|
-
var
|
|
104
|
+
var C = n, V = C._payload, _ = C._init;
|
|
105
105
|
try {
|
|
106
|
-
return
|
|
106
|
+
return ae(_(V));
|
|
107
107
|
} catch {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
@@ -111,14 +111,14 @@ function $r() {
|
|
|
111
111
|
}
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
114
|
-
var J = Object.assign, me = 0,
|
|
114
|
+
var J = Object.assign, me = 0, Fe, ke, N, Y, ce, K, Q;
|
|
115
115
|
function G() {
|
|
116
116
|
}
|
|
117
117
|
G.__reactDisabledLog = !0;
|
|
118
118
|
function h() {
|
|
119
119
|
{
|
|
120
120
|
if (me === 0) {
|
|
121
|
-
|
|
121
|
+
Fe = console.log, ke = console.info, N = console.warn, Y = console.error, ce = console.group, K = console.groupCollapsed, Q = console.groupEnd;
|
|
122
122
|
var n = {
|
|
123
123
|
configurable: !0,
|
|
124
124
|
enumerable: !0,
|
|
@@ -148,187 +148,187 @@ function $r() {
|
|
|
148
148
|
};
|
|
149
149
|
Object.defineProperties(console, {
|
|
150
150
|
log: J({}, n, {
|
|
151
|
-
value:
|
|
151
|
+
value: Fe
|
|
152
152
|
}),
|
|
153
153
|
info: J({}, n, {
|
|
154
|
-
value:
|
|
154
|
+
value: ke
|
|
155
155
|
}),
|
|
156
156
|
warn: J({}, n, {
|
|
157
|
-
value:
|
|
157
|
+
value: N
|
|
158
158
|
}),
|
|
159
159
|
error: J({}, n, {
|
|
160
|
-
value:
|
|
160
|
+
value: Y
|
|
161
161
|
}),
|
|
162
162
|
group: J({}, n, {
|
|
163
163
|
value: ce
|
|
164
164
|
}),
|
|
165
165
|
groupCollapsed: J({}, n, {
|
|
166
|
-
value:
|
|
166
|
+
value: K
|
|
167
167
|
}),
|
|
168
168
|
groupEnd: J({}, n, {
|
|
169
|
-
value:
|
|
169
|
+
value: Q
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
me < 0 &&
|
|
173
|
+
me < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
176
|
+
var F = S.ReactCurrentDispatcher, P;
|
|
177
|
+
function A(n, f, T) {
|
|
178
178
|
{
|
|
179
179
|
if (P === void 0)
|
|
180
180
|
try {
|
|
181
181
|
throw Error();
|
|
182
|
-
} catch (
|
|
183
|
-
var
|
|
184
|
-
P =
|
|
182
|
+
} catch (C) {
|
|
183
|
+
var E = C.stack.trim().match(/\n( *(at )?)/);
|
|
184
|
+
P = E && E[1] || "";
|
|
185
185
|
}
|
|
186
186
|
return `
|
|
187
187
|
` + P + n;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
190
|
+
var oe = !1, ee;
|
|
191
191
|
{
|
|
192
|
-
var
|
|
193
|
-
|
|
192
|
+
var Re = typeof WeakMap == "function" ? WeakMap : Map;
|
|
193
|
+
ee = new Re();
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
if (!n ||
|
|
195
|
+
function se(n, f) {
|
|
196
|
+
if (!n || oe)
|
|
197
197
|
return "";
|
|
198
198
|
{
|
|
199
|
-
var T =
|
|
199
|
+
var T = ee.get(n);
|
|
200
200
|
if (T !== void 0)
|
|
201
201
|
return T;
|
|
202
202
|
}
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
var
|
|
203
|
+
var E;
|
|
204
|
+
oe = !0;
|
|
205
|
+
var C = Error.prepareStackTrace;
|
|
206
206
|
Error.prepareStackTrace = void 0;
|
|
207
|
-
var
|
|
208
|
-
|
|
207
|
+
var V;
|
|
208
|
+
V = F.current, F.current = null, h();
|
|
209
209
|
try {
|
|
210
210
|
if (f) {
|
|
211
|
-
var
|
|
211
|
+
var _ = function() {
|
|
212
212
|
throw Error();
|
|
213
213
|
};
|
|
214
|
-
if (Object.defineProperty(
|
|
214
|
+
if (Object.defineProperty(_.prototype, "props", {
|
|
215
215
|
set: function() {
|
|
216
216
|
throw Error();
|
|
217
217
|
}
|
|
218
218
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
219
219
|
try {
|
|
220
|
-
Reflect.construct(
|
|
221
|
-
} catch (
|
|
222
|
-
|
|
220
|
+
Reflect.construct(_, []);
|
|
221
|
+
} catch (je) {
|
|
222
|
+
E = je;
|
|
223
223
|
}
|
|
224
|
-
Reflect.construct(n, [],
|
|
224
|
+
Reflect.construct(n, [], _);
|
|
225
225
|
} else {
|
|
226
226
|
try {
|
|
227
|
-
|
|
228
|
-
} catch (
|
|
229
|
-
|
|
227
|
+
_.call();
|
|
228
|
+
} catch (je) {
|
|
229
|
+
E = je;
|
|
230
230
|
}
|
|
231
|
-
n.call(
|
|
231
|
+
n.call(_.prototype);
|
|
232
232
|
}
|
|
233
233
|
} else {
|
|
234
234
|
try {
|
|
235
235
|
throw Error();
|
|
236
|
-
} catch (
|
|
237
|
-
|
|
236
|
+
} catch (je) {
|
|
237
|
+
E = je;
|
|
238
238
|
}
|
|
239
239
|
n();
|
|
240
240
|
}
|
|
241
|
-
} catch (
|
|
242
|
-
if (
|
|
243
|
-
for (var
|
|
244
|
-
`),
|
|
245
|
-
`),
|
|
241
|
+
} catch (je) {
|
|
242
|
+
if (je && E && typeof je.stack == "string") {
|
|
243
|
+
for (var O = je.stack.split(`
|
|
244
|
+
`), be = E.stack.split(`
|
|
245
|
+
`), Z = O.length - 1, ue = be.length - 1; Z >= 1 && ue >= 0 && O[Z] !== be[ue]; )
|
|
246
246
|
ue--;
|
|
247
|
-
for (;
|
|
248
|
-
if (
|
|
249
|
-
if (
|
|
247
|
+
for (; Z >= 1 && ue >= 0; Z--, ue--)
|
|
248
|
+
if (O[Z] !== be[ue]) {
|
|
249
|
+
if (Z !== 1 || ue !== 1)
|
|
250
250
|
do
|
|
251
|
-
if (
|
|
252
|
-
var
|
|
253
|
-
` +
|
|
254
|
-
return n.displayName &&
|
|
251
|
+
if (Z--, ue--, ue < 0 || O[Z] !== be[ue]) {
|
|
252
|
+
var De = `
|
|
253
|
+
` + O[Z].replace(" at new ", " at ");
|
|
254
|
+
return n.displayName && De.includes("<anonymous>") && (De = De.replace("<anonymous>", n.displayName)), typeof n == "function" && ee.set(n, De), De;
|
|
255
255
|
}
|
|
256
|
-
while (
|
|
256
|
+
while (Z >= 1 && ue >= 0);
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
} finally {
|
|
261
|
-
|
|
261
|
+
oe = !1, F.current = V, k(), Error.prepareStackTrace = C;
|
|
262
262
|
}
|
|
263
|
-
var
|
|
264
|
-
return typeof n == "function" &&
|
|
263
|
+
var Ke = n ? n.displayName || n.name : "", Ve = Ke ? A(Ke) : "";
|
|
264
|
+
return typeof n == "function" && ee.set(n, Ve), Ve;
|
|
265
265
|
}
|
|
266
266
|
function Me(n, f, T) {
|
|
267
|
-
return
|
|
267
|
+
return se(n, !1);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ae(n) {
|
|
270
270
|
var f = n.prototype;
|
|
271
271
|
return !!(f && f.isReactComponent);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Pe(n, f, T) {
|
|
274
274
|
if (n == null)
|
|
275
275
|
return "";
|
|
276
276
|
if (typeof n == "function")
|
|
277
|
-
return
|
|
277
|
+
return se(n, Ae(n));
|
|
278
278
|
if (typeof n == "string")
|
|
279
|
-
return
|
|
279
|
+
return A(n);
|
|
280
280
|
switch (n) {
|
|
281
281
|
case y:
|
|
282
|
-
return
|
|
282
|
+
return A("Suspense");
|
|
283
283
|
case c:
|
|
284
|
-
return
|
|
284
|
+
return A("SuspenseList");
|
|
285
285
|
}
|
|
286
286
|
if (typeof n == "object")
|
|
287
287
|
switch (n.$$typeof) {
|
|
288
288
|
case s:
|
|
289
289
|
return Me(n.render);
|
|
290
290
|
case g:
|
|
291
|
-
return
|
|
291
|
+
return Pe(n.type, f, T);
|
|
292
292
|
case j: {
|
|
293
|
-
var
|
|
293
|
+
var E = n, C = E._payload, V = E._init;
|
|
294
294
|
try {
|
|
295
|
-
return
|
|
295
|
+
return Pe(V(C), f, T);
|
|
296
296
|
} catch {
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
return "";
|
|
301
301
|
}
|
|
302
|
-
var
|
|
303
|
-
function
|
|
302
|
+
var Te = Object.prototype.hasOwnProperty, Oe = {}, at = S.ReactDebugCurrentFrame;
|
|
303
|
+
function Ue(n) {
|
|
304
304
|
if (n) {
|
|
305
|
-
var f = n._owner, T =
|
|
306
|
-
|
|
305
|
+
var f = n._owner, T = Pe(n.type, n._source, f ? f.type : null);
|
|
306
|
+
at.setExtraStackFrame(T);
|
|
307
307
|
} else
|
|
308
|
-
|
|
308
|
+
at.setExtraStackFrame(null);
|
|
309
309
|
}
|
|
310
|
-
function jt(n, f, T,
|
|
310
|
+
function jt(n, f, T, E, C) {
|
|
311
311
|
{
|
|
312
|
-
var
|
|
313
|
-
for (var
|
|
314
|
-
if (
|
|
315
|
-
var
|
|
312
|
+
var V = Function.call.bind(Te);
|
|
313
|
+
for (var _ in n)
|
|
314
|
+
if (V(n, _)) {
|
|
315
|
+
var O = void 0;
|
|
316
316
|
try {
|
|
317
|
-
if (typeof n[
|
|
318
|
-
var
|
|
319
|
-
throw
|
|
317
|
+
if (typeof n[_] != "function") {
|
|
318
|
+
var be = Error((E || "React class") + ": " + T + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
319
|
+
throw be.name = "Invariant Violation", be;
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
323
|
-
|
|
321
|
+
O = n[_](f, _, E, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
322
|
+
} catch (Z) {
|
|
323
|
+
O = Z;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
O && !(O instanceof Error) && (Ue(C), L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", T, _, typeof O), Ue(null)), O instanceof Error && !(O.message in Oe) && (Oe[O.message] = !0, Ue(C), L("Failed %s type: %s", T, O.message), Ue(null));
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
var
|
|
330
|
-
function
|
|
331
|
-
return
|
|
329
|
+
var ut = Array.isArray;
|
|
330
|
+
function Ce(n) {
|
|
331
|
+
return ut(n);
|
|
332
332
|
}
|
|
333
333
|
function St(n) {
|
|
334
334
|
{
|
|
@@ -336,28 +336,28 @@ function $r() {
|
|
|
336
336
|
return T;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function Ie(n) {
|
|
340
340
|
try {
|
|
341
|
-
return
|
|
341
|
+
return Le(n), !1;
|
|
342
342
|
} catch {
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Le(n) {
|
|
347
347
|
return "" + n;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
if (
|
|
351
|
-
return
|
|
349
|
+
function ve(n) {
|
|
350
|
+
if (Ie(n))
|
|
351
|
+
return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", St(n)), Le(n);
|
|
352
352
|
}
|
|
353
|
-
var
|
|
353
|
+
var pt = S.ReactCurrentOwner, Nt = {
|
|
354
354
|
key: !0,
|
|
355
355
|
ref: !0,
|
|
356
356
|
__self: !0,
|
|
357
357
|
__source: !0
|
|
358
|
-
},
|
|
358
|
+
}, ht, ft;
|
|
359
359
|
function Tt(n) {
|
|
360
|
-
if (
|
|
360
|
+
if (Te.call(n, "ref")) {
|
|
361
361
|
var f = Object.getOwnPropertyDescriptor(n, "ref").get;
|
|
362
362
|
if (f && f.isReactWarning)
|
|
363
363
|
return !1;
|
|
@@ -365,20 +365,20 @@ function $r() {
|
|
|
365
365
|
return n.ref !== void 0;
|
|
366
366
|
}
|
|
367
367
|
function Dt(n) {
|
|
368
|
-
if (
|
|
368
|
+
if (Te.call(n, "key")) {
|
|
369
369
|
var f = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
370
370
|
if (f && f.isReactWarning)
|
|
371
371
|
return !1;
|
|
372
372
|
}
|
|
373
373
|
return n.key !== void 0;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
typeof n.ref == "string" &&
|
|
375
|
+
function ot(n, f) {
|
|
376
|
+
typeof n.ref == "string" && pt.current;
|
|
377
377
|
}
|
|
378
378
|
function kt(n, f) {
|
|
379
379
|
{
|
|
380
380
|
var T = function() {
|
|
381
|
-
|
|
381
|
+
ht || (ht = !0, L("%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://reactjs.org/link/special-props)", f));
|
|
382
382
|
};
|
|
383
383
|
T.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
384
384
|
get: T,
|
|
@@ -386,10 +386,10 @@ function $r() {
|
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Mt(n, f) {
|
|
390
390
|
{
|
|
391
391
|
var T = function() {
|
|
392
|
-
|
|
392
|
+
ft || (ft = !0, L("%s: `ref` 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://reactjs.org/link/special-props)", f));
|
|
393
393
|
};
|
|
394
394
|
T.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
395
395
|
get: T,
|
|
@@ -397,70 +397,70 @@ function $r() {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
var
|
|
401
|
-
var
|
|
400
|
+
var st = function(n, f, T, E, C, V, _) {
|
|
401
|
+
var O = {
|
|
402
402
|
// This tag allows us to uniquely identify this as a React Element
|
|
403
403
|
$$typeof: o,
|
|
404
404
|
// Built-in properties that belong on the element
|
|
405
405
|
type: n,
|
|
406
406
|
key: f,
|
|
407
407
|
ref: T,
|
|
408
|
-
props:
|
|
408
|
+
props: _,
|
|
409
409
|
// Record the component responsible for creating this element.
|
|
410
|
-
_owner:
|
|
410
|
+
_owner: V
|
|
411
411
|
};
|
|
412
|
-
return
|
|
412
|
+
return O._store = {}, Object.defineProperty(O._store, "validated", {
|
|
413
413
|
configurable: !1,
|
|
414
414
|
enumerable: !1,
|
|
415
415
|
writable: !0,
|
|
416
416
|
value: !1
|
|
417
|
-
}), Object.defineProperty(
|
|
417
|
+
}), Object.defineProperty(O, "_self", {
|
|
418
418
|
configurable: !1,
|
|
419
419
|
enumerable: !1,
|
|
420
420
|
writable: !1,
|
|
421
|
-
value:
|
|
422
|
-
}), Object.defineProperty(
|
|
421
|
+
value: E
|
|
422
|
+
}), Object.defineProperty(O, "_source", {
|
|
423
423
|
configurable: !1,
|
|
424
424
|
enumerable: !1,
|
|
425
425
|
writable: !1,
|
|
426
|
-
value:
|
|
427
|
-
}), Object.freeze && (Object.freeze(
|
|
426
|
+
value: C
|
|
427
|
+
}), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
|
|
428
428
|
};
|
|
429
|
-
function
|
|
429
|
+
function Lt(n, f, T, E, C) {
|
|
430
430
|
{
|
|
431
|
-
var
|
|
432
|
-
T !== void 0 && (
|
|
433
|
-
for (
|
|
434
|
-
|
|
431
|
+
var V, _ = {}, O = null, be = null;
|
|
432
|
+
T !== void 0 && (ve(T), O = "" + T), Dt(f) && (ve(f.key), O = "" + f.key), Tt(f) && (be = f.ref, ot(f, C));
|
|
433
|
+
for (V in f)
|
|
434
|
+
Te.call(f, V) && !Nt.hasOwnProperty(V) && (_[V] = f[V]);
|
|
435
435
|
if (n && n.defaultProps) {
|
|
436
|
-
var
|
|
437
|
-
for (
|
|
438
|
-
|
|
436
|
+
var Z = n.defaultProps;
|
|
437
|
+
for (V in Z)
|
|
438
|
+
_[V] === void 0 && (_[V] = Z[V]);
|
|
439
439
|
}
|
|
440
|
-
if (
|
|
440
|
+
if (O || be) {
|
|
441
441
|
var ue = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
442
|
-
|
|
442
|
+
O && kt(_, ue), be && Mt(_, ue);
|
|
443
443
|
}
|
|
444
|
-
return
|
|
444
|
+
return st(n, O, be, C, E, pt.current, _);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
var
|
|
448
|
-
function
|
|
447
|
+
var qe = S.ReactCurrentOwner, mt = S.ReactDebugCurrentFrame;
|
|
448
|
+
function Ee(n) {
|
|
449
449
|
if (n) {
|
|
450
|
-
var f = n._owner, T =
|
|
451
|
-
|
|
450
|
+
var f = n._owner, T = Pe(n.type, n._source, f ? f.type : null);
|
|
451
|
+
mt.setExtraStackFrame(T);
|
|
452
452
|
} else
|
|
453
|
-
|
|
453
|
+
mt.setExtraStackFrame(null);
|
|
454
454
|
}
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
function
|
|
455
|
+
var Ge;
|
|
456
|
+
Ge = !1;
|
|
457
|
+
function Ze(n) {
|
|
458
458
|
return typeof n == "object" && n !== null && n.$$typeof === o;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function it() {
|
|
461
461
|
{
|
|
462
|
-
if (
|
|
463
|
-
var n =
|
|
462
|
+
if (qe.current) {
|
|
463
|
+
var n = ae(qe.current.type);
|
|
464
464
|
if (n)
|
|
465
465
|
return `
|
|
466
466
|
|
|
@@ -472,10 +472,10 @@ Check the render method of \`` + n + "`.";
|
|
|
472
472
|
function Et(n) {
|
|
473
473
|
return "";
|
|
474
474
|
}
|
|
475
|
-
var
|
|
475
|
+
var xt = {};
|
|
476
476
|
function d(n) {
|
|
477
477
|
{
|
|
478
|
-
var f =
|
|
478
|
+
var f = it();
|
|
479
479
|
if (!f) {
|
|
480
480
|
var T = typeof n == "string" ? n : n.displayName || n.name;
|
|
481
481
|
T && (f = `
|
|
@@ -491,33 +491,33 @@ Check the top-level render call using <` + T + ">.");
|
|
|
491
491
|
return;
|
|
492
492
|
n._store.validated = !0;
|
|
493
493
|
var T = d(f);
|
|
494
|
-
if (
|
|
494
|
+
if (xt[T])
|
|
495
495
|
return;
|
|
496
|
-
|
|
497
|
-
var
|
|
498
|
-
n && n._owner && n._owner !==
|
|
496
|
+
xt[T] = !0;
|
|
497
|
+
var E = "";
|
|
498
|
+
n && n._owner && n._owner !== qe.current && (E = " It was passed a child from " + ae(n._owner.type) + "."), Ee(n), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, E), Ee(null);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function R(n, f) {
|
|
502
502
|
{
|
|
503
503
|
if (typeof n != "object")
|
|
504
504
|
return;
|
|
505
|
-
if (
|
|
505
|
+
if (Ce(n))
|
|
506
506
|
for (var T = 0; T < n.length; T++) {
|
|
507
|
-
var
|
|
508
|
-
|
|
507
|
+
var E = n[T];
|
|
508
|
+
Ze(E) && v(E, f);
|
|
509
509
|
}
|
|
510
|
-
else if (
|
|
510
|
+
else if (Ze(n))
|
|
511
511
|
n._store && (n._store.validated = !0);
|
|
512
512
|
else if (n) {
|
|
513
|
-
var
|
|
514
|
-
if (typeof
|
|
515
|
-
for (var
|
|
516
|
-
|
|
513
|
+
var C = w(n);
|
|
514
|
+
if (typeof C == "function" && C !== n.entries)
|
|
515
|
+
for (var V = C.call(n), _; !(_ = V.next()).done; )
|
|
516
|
+
Ze(_.value) && v(_.value, f);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function I(n) {
|
|
521
521
|
{
|
|
522
522
|
var f = n.type;
|
|
523
523
|
if (f == null || typeof f == "string")
|
|
@@ -532,82 +532,82 @@ Check the top-level render call using <` + T + ">.");
|
|
|
532
532
|
else
|
|
533
533
|
return;
|
|
534
534
|
if (T) {
|
|
535
|
-
var
|
|
536
|
-
jt(T, n.props, "prop",
|
|
537
|
-
} else if (f.PropTypes !== void 0 && !
|
|
538
|
-
|
|
539
|
-
var
|
|
540
|
-
|
|
535
|
+
var E = ae(f);
|
|
536
|
+
jt(T, n.props, "prop", E, n);
|
|
537
|
+
} else if (f.PropTypes !== void 0 && !Ge) {
|
|
538
|
+
Ge = !0;
|
|
539
|
+
var C = ae(f);
|
|
540
|
+
L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
|
|
541
541
|
}
|
|
542
|
-
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved &&
|
|
542
|
+
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
function ie(n) {
|
|
546
546
|
{
|
|
547
547
|
for (var f = Object.keys(n.props), T = 0; T < f.length; T++) {
|
|
548
|
-
var
|
|
549
|
-
if (
|
|
550
|
-
|
|
548
|
+
var E = f[T];
|
|
549
|
+
if (E !== "children" && E !== "key") {
|
|
550
|
+
Ee(n), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), Ee(null);
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
n.ref !== null && (
|
|
554
|
+
n.ref !== null && (Ee(n), L("Invalid attribute `ref` supplied to `React.Fragment`."), Ee(null));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
var
|
|
558
|
-
function
|
|
557
|
+
var U = {};
|
|
558
|
+
function ye(n, f, T, E, C, V) {
|
|
559
559
|
{
|
|
560
|
-
var
|
|
561
|
-
if (!
|
|
562
|
-
var
|
|
563
|
-
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (
|
|
564
|
-
var
|
|
565
|
-
|
|
566
|
-
var
|
|
567
|
-
n === null ?
|
|
560
|
+
var _ = H(n);
|
|
561
|
+
if (!_) {
|
|
562
|
+
var O = "";
|
|
563
|
+
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
564
|
+
var be = Et();
|
|
565
|
+
be ? O += be : O += it();
|
|
566
|
+
var Z;
|
|
567
|
+
n === null ? Z = "null" : Ce(n) ? Z = "array" : n !== void 0 && n.$$typeof === o ? (Z = "<" + (ae(n.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof n, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, O);
|
|
568
568
|
}
|
|
569
|
-
var ue =
|
|
569
|
+
var ue = Lt(n, f, T, C, V);
|
|
570
570
|
if (ue == null)
|
|
571
571
|
return ue;
|
|
572
|
-
if (
|
|
573
|
-
var
|
|
574
|
-
if (
|
|
575
|
-
if (
|
|
576
|
-
if (
|
|
577
|
-
for (var
|
|
578
|
-
|
|
579
|
-
Object.freeze && Object.freeze(
|
|
572
|
+
if (_) {
|
|
573
|
+
var De = f.children;
|
|
574
|
+
if (De !== void 0)
|
|
575
|
+
if (E)
|
|
576
|
+
if (Ce(De)) {
|
|
577
|
+
for (var Ke = 0; Ke < De.length; Ke++)
|
|
578
|
+
R(De[Ke], n);
|
|
579
|
+
Object.freeze && Object.freeze(De);
|
|
580
580
|
} else
|
|
581
|
-
|
|
581
|
+
L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
582
582
|
else
|
|
583
|
-
|
|
583
|
+
R(De, n);
|
|
584
584
|
}
|
|
585
|
-
if (
|
|
586
|
-
var
|
|
585
|
+
if (Te.call(f, "key")) {
|
|
586
|
+
var Ve = ae(n), je = Object.keys(f).filter(function(lr) {
|
|
587
587
|
return lr !== "key";
|
|
588
|
-
}), $t =
|
|
589
|
-
if (!
|
|
590
|
-
var ir =
|
|
591
|
-
|
|
588
|
+
}), $t = je.length > 0 ? "{key: someKey, " + je.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
589
|
+
if (!U[Ve + $t]) {
|
|
590
|
+
var ir = je.length > 0 ? "{" + je.join(": ..., ") + ": ...}" : "{}";
|
|
591
|
+
L(`A props object containing a "key" prop is being spread into JSX:
|
|
592
592
|
let props = %s;
|
|
593
593
|
<%s {...props} />
|
|
594
594
|
React keys must be passed directly to JSX without using spread:
|
|
595
595
|
let props = %s;
|
|
596
|
-
<%s key={someKey} {...props} />`, $t,
|
|
596
|
+
<%s key={someKey} {...props} />`, $t, Ve, ir, Ve), U[Ve + $t] = !0;
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
return n === l ? ie(ue) :
|
|
599
|
+
return n === l ? ie(ue) : I(ue), ue;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
602
|
+
function te(n, f, T) {
|
|
603
|
+
return ye(n, f, T, !0);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
return
|
|
605
|
+
function ge(n, f, T) {
|
|
606
|
+
return ye(n, f, T, !1);
|
|
607
607
|
}
|
|
608
|
-
var
|
|
609
|
-
|
|
610
|
-
})()),
|
|
608
|
+
var ze = ge, yt = te;
|
|
609
|
+
dt.Fragment = l, dt.jsx = ze, dt.jsxs = yt;
|
|
610
|
+
})()), dt;
|
|
611
611
|
}
|
|
612
612
|
var zt;
|
|
613
613
|
function Fr() {
|
|
@@ -644,7 +644,7 @@ const fe = (t, o, a) => {
|
|
|
644
644
|
const a = o.getTime() - t.getTime();
|
|
645
645
|
return Math.ceil(a / (1e3 * 60 * 60));
|
|
646
646
|
}, we = (t, o) => {
|
|
647
|
-
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], l = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
647
|
+
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], l = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], x = {
|
|
648
648
|
YYYY: t.getFullYear().toString(),
|
|
649
649
|
YY: t.getFullYear().toString().slice(-2),
|
|
650
650
|
MMMM: l[t.getMonth()],
|
|
@@ -659,13 +659,13 @@ const fe = (t, o, a) => {
|
|
|
659
659
|
mm: String(t.getMinutes()).padStart(2, "0"),
|
|
660
660
|
m: String(t.getMinutes())
|
|
661
661
|
};
|
|
662
|
-
return o.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (
|
|
662
|
+
return o.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (m) => x[m]);
|
|
663
663
|
}, Bt = (t) => {
|
|
664
664
|
const o = t.getDay();
|
|
665
665
|
return o === 0 || o === 6;
|
|
666
666
|
}, Wt = (t, o) => o.some(
|
|
667
667
|
(a) => a.getFullYear() === t.getFullYear() && a.getMonth() === t.getMonth() && a.getDate() === t.getDate()
|
|
668
|
-
),
|
|
668
|
+
), rt = (t) => {
|
|
669
669
|
const o = new Date(t);
|
|
670
670
|
return o.setHours(0, 0, 0, 0), o;
|
|
671
671
|
}, bn = (t) => {
|
|
@@ -689,11 +689,11 @@ function Pr(t) {
|
|
|
689
689
|
if (!t || typeof t != "string") return null;
|
|
690
690
|
const o = t.trim(), a = /^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i, l = o.match(a);
|
|
691
691
|
if (!l) return null;
|
|
692
|
-
const r = parseInt(l[1], 10),
|
|
693
|
-
let
|
|
692
|
+
const r = parseInt(l[1], 10), x = l[2].toUpperCase();
|
|
693
|
+
let m = 0, i = "day";
|
|
694
694
|
if (l[3]) {
|
|
695
695
|
const s = l[4] === "-" ? -1 : 1;
|
|
696
|
-
switch (
|
|
696
|
+
switch (m = parseInt(l[5], 10) * s, l[6].toLowerCase()) {
|
|
697
697
|
case "d":
|
|
698
698
|
i = "day";
|
|
699
699
|
break;
|
|
@@ -708,7 +708,7 @@ function Pr(t) {
|
|
|
708
708
|
break;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
return { taskNumber: r, type:
|
|
711
|
+
return { taskNumber: r, type: x, lag: m, lagUnit: i };
|
|
712
712
|
}
|
|
713
713
|
function Pt(t, o) {
|
|
714
714
|
switch (o) {
|
|
@@ -734,7 +734,7 @@ function Or(t, o) {
|
|
|
734
734
|
}[t.type];
|
|
735
735
|
let r = `${o}${l}`;
|
|
736
736
|
if (t.lag && t.lag !== 0) {
|
|
737
|
-
const
|
|
737
|
+
const x = t.lag > 0 ? "+" : "", i = (t.lagUnit || "day").charAt(0);
|
|
738
738
|
let s = t.lag;
|
|
739
739
|
if (t.lagUnit && t.lagUnit !== "day")
|
|
740
740
|
switch (t.lagUnit) {
|
|
@@ -748,7 +748,7 @@ function Or(t, o) {
|
|
|
748
748
|
s = t.lag / 30;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
|
-
r += `${
|
|
751
|
+
r += `${x}${Math.round(s)}${i}`;
|
|
752
752
|
}
|
|
753
753
|
return r;
|
|
754
754
|
}
|
|
@@ -760,7 +760,7 @@ function Cr(t) {
|
|
|
760
760
|
SF: "s2e"
|
|
761
761
|
}[t];
|
|
762
762
|
}
|
|
763
|
-
const
|
|
763
|
+
const nt = (t) => t ? {
|
|
764
764
|
// Popover styles
|
|
765
765
|
popover: {
|
|
766
766
|
backgroundColor: t.popoverBackground || "#fff",
|
|
@@ -837,49 +837,49 @@ const at = (t) => t ? {
|
|
|
837
837
|
lineHeight: t.lineHeight || 1.5714285714285714,
|
|
838
838
|
color: t.fontColor || "rgba(0, 0, 0, 0.88)"
|
|
839
839
|
}
|
|
840
|
-
} : {}, { Text:
|
|
840
|
+
} : {}, { Text: Se, Paragraph: Nr } = Ht, { Option: Be } = xe, _r = ({
|
|
841
841
|
task: t,
|
|
842
842
|
allTasks: o,
|
|
843
843
|
links: a,
|
|
844
844
|
onAddDependency: l,
|
|
845
845
|
onRemoveDependency: r,
|
|
846
|
-
onTaskUpdate:
|
|
847
|
-
children:
|
|
846
|
+
onTaskUpdate: x,
|
|
847
|
+
children: m,
|
|
848
848
|
styleConfig: i
|
|
849
849
|
}) => {
|
|
850
|
-
const s =
|
|
850
|
+
const s = nt(i), [y, c] = z(!1), [g, j] = z(null), [u, p] = z("e2s"), [b, w] = z("lag"), [S, L] = z(0), [$, B] = z(t.duration), [ne, X] = z(!0), pe = "day", M = a.find((N) => N.target === t.id), q = !!M, H = re.useMemo(() => o.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...o.map((N) => N.start.getTime()))), [o]), D = () => {
|
|
851
851
|
if (g) {
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const ce = fe(new Date(t.start),
|
|
855
|
-
|
|
852
|
+
const N = b === "lag" ? S : -S, Y = Pt(N, pe);
|
|
853
|
+
if ($ !== t.duration && x) {
|
|
854
|
+
const ce = fe(new Date(t.start), $, "day");
|
|
855
|
+
x({
|
|
856
856
|
...t,
|
|
857
|
-
duration:
|
|
857
|
+
duration: $,
|
|
858
858
|
end: ce
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
l(g, t.id, u,
|
|
862
|
-
}
|
|
863
|
-
},
|
|
864
|
-
j(null), p("e2s"), w("lag"),
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
}, J = (
|
|
868
|
-
if (c(
|
|
869
|
-
if (
|
|
870
|
-
j(
|
|
871
|
-
const
|
|
872
|
-
|
|
861
|
+
l(g, t.id, u, Y), c(!1), W();
|
|
862
|
+
}
|
|
863
|
+
}, W = () => {
|
|
864
|
+
j(null), p("e2s"), w("lag"), L(0), B(t.duration);
|
|
865
|
+
}, ae = () => {
|
|
866
|
+
M && r && (r(M.id), c(!1), W());
|
|
867
|
+
}, J = (N) => {
|
|
868
|
+
if (c(N), N) {
|
|
869
|
+
if (X(!0), M) {
|
|
870
|
+
j(M.source), p(M.type);
|
|
871
|
+
const Y = M.lag || 0;
|
|
872
|
+
Y >= 0 ? (w("lag"), L(Y)) : (w("lead"), L(Math.abs(Y)));
|
|
873
873
|
} else
|
|
874
|
-
|
|
875
|
-
|
|
874
|
+
W();
|
|
875
|
+
B(t.duration);
|
|
876
876
|
}
|
|
877
877
|
}, me = () => {
|
|
878
|
-
if (!
|
|
879
|
-
const
|
|
880
|
-
let
|
|
881
|
-
|
|
882
|
-
const P = g === "gantt-start-date",
|
|
878
|
+
if (!ne) return null;
|
|
879
|
+
const N = u === "e2s", Y = u === "s2s", ce = u === "e2e", K = u === "s2e";
|
|
880
|
+
let Q = 0, G = 0, h = "", k = 0, F = -1;
|
|
881
|
+
N ? (Q = 50, G = 350, k = 250, F = 350, h = "M 250 60 L 300 60 L 300 140 L 348 140") : ce ? (Q = 100, G = 100, k = 300, F = -1, h = "M 300 60 L 350 60 L 350 140 L 302 140") : Y ? (Q = 250, G = 250, k = 250, F = -1, h = "M 250 60 L 200 60 L 200 140 L 248 140") : K && (Q = 350, G = 50, k = 350, F = 250, h = "M 350 60 L 300 60 L 300 140 L 252 140");
|
|
882
|
+
const P = g === "gantt-start-date", A = o.find((oe) => oe.id === g);
|
|
883
883
|
return /* @__PURE__ */ e.jsx("div", { style: {
|
|
884
884
|
width: "100%",
|
|
885
885
|
height: 90,
|
|
@@ -893,9 +893,9 @@ const at = (t) => t ? {
|
|
|
893
893
|
}, children: /* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 600 200", style: { width: "100%", height: "100%" }, preserveAspectRatio: "xMidYMid meet", children: [
|
|
894
894
|
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("marker", { id: "arrowhead", markerWidth: "12", markerHeight: "9", refX: "12", refY: "4.5", orient: "auto", children: /* @__PURE__ */ e.jsx("polygon", { points: "0 0, 12 4.5, 0 9", fill: "#8c8c8c" }) }) }),
|
|
895
895
|
/* @__PURE__ */ e.jsx("line", { x1: k, x2: k, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
896
|
-
|
|
897
|
-
/* @__PURE__ */ e.jsx("rect", { x:
|
|
898
|
-
/* @__PURE__ */ e.jsx("text", { x:
|
|
896
|
+
F !== -1 && /* @__PURE__ */ e.jsx("line", { x1: F, x2: F, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
897
|
+
/* @__PURE__ */ e.jsx("rect", { x: Q, y: "35", width: "200", height: "50", rx: "4", fill: "#e6f4ff", stroke: "#91caff", strokeWidth: "2" }),
|
|
898
|
+
/* @__PURE__ */ e.jsx("text", { x: Q + 100, y: "66", fontSize: "15", textAnchor: "middle", fill: "#003a8c", fontWeight: "600", children: P ? "Start Date" : A ? `Stage ${o.indexOf(A) + 1}` : "Predecessor" }),
|
|
899
899
|
/* @__PURE__ */ e.jsx("rect", { x: G, y: "115", width: "200", height: "50", rx: "4", fill: "#e6f4ff", stroke: "#91caff", strokeWidth: "2" }),
|
|
900
900
|
/* @__PURE__ */ e.jsxs("text", { x: G + 100, y: "146", fontSize: "15", textAnchor: "middle", fill: "#003a8c", fontWeight: "600", children: [
|
|
901
901
|
"Stage ",
|
|
@@ -903,31 +903,31 @@ const at = (t) => t ? {
|
|
|
903
903
|
] }),
|
|
904
904
|
/* @__PURE__ */ e.jsx("path", { d: h, fill: "none", stroke: "#8c8c8c", strokeWidth: "2.5", markerEnd: "url(#arrowhead)" })
|
|
905
905
|
] }) });
|
|
906
|
-
},
|
|
907
|
-
const
|
|
906
|
+
}, Fe = () => {
|
|
907
|
+
const N = g === "gantt-start-date", Y = o.find((G) => G.id === g);
|
|
908
908
|
if (!g) return "Select a checklist from the list to see how it will relate to the current stage.";
|
|
909
|
-
const ce = o.indexOf(t) + 1,
|
|
910
|
-
let
|
|
909
|
+
const ce = o.indexOf(t) + 1, K = N ? "Start Date" : `Stage ${o.indexOf(Y) + 1}`;
|
|
910
|
+
let Q = "";
|
|
911
911
|
switch (u) {
|
|
912
912
|
case "e2s":
|
|
913
|
-
|
|
913
|
+
Q = `Stage ${ce} starts after ${K} finishes`;
|
|
914
914
|
break;
|
|
915
915
|
case "s2s":
|
|
916
|
-
|
|
916
|
+
Q = `Stage ${ce} starts when ${K} starts`;
|
|
917
917
|
break;
|
|
918
918
|
case "e2e":
|
|
919
|
-
|
|
919
|
+
Q = `Stage ${ce} finishes when ${K} finishes`;
|
|
920
920
|
break;
|
|
921
921
|
case "s2e":
|
|
922
|
-
|
|
922
|
+
Q = `Stage ${ce} finishes when ${K} starts`;
|
|
923
923
|
break;
|
|
924
924
|
}
|
|
925
925
|
if (S > 0) {
|
|
926
926
|
const G = `${S} ${pe}${S > 1 ? "s" : ""}`;
|
|
927
|
-
b === "lag" ?
|
|
927
|
+
b === "lag" ? Q += ` + ${G} delay` : Q += ` - ${G} overlap`;
|
|
928
928
|
}
|
|
929
|
-
return
|
|
930
|
-
},
|
|
929
|
+
return Q + ".";
|
|
930
|
+
}, ke = /* @__PURE__ */ e.jsxs("div", { style: {
|
|
931
931
|
width: 550,
|
|
932
932
|
backgroundColor: s.popover?.backgroundColor || "#fff",
|
|
933
933
|
borderRadius: s.popover?.borderRadius || "8px",
|
|
@@ -935,83 +935,83 @@ const at = (t) => t ? {
|
|
|
935
935
|
boxShadow: s.popover?.boxShadow,
|
|
936
936
|
fontFamily: s.popover?.fontFamily
|
|
937
937
|
}, children: [
|
|
938
|
-
/* @__PURE__ */ e.jsx(
|
|
938
|
+
/* @__PURE__ */ e.jsx(Se, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color: s.font?.color }, children: "Add Dependency" }),
|
|
939
939
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
|
|
940
940
|
/* @__PURE__ */ e.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(
|
|
941
|
-
|
|
941
|
+
xe,
|
|
942
942
|
{
|
|
943
943
|
showSearch: !0,
|
|
944
944
|
placeholder: "Select checklist",
|
|
945
945
|
value: g,
|
|
946
946
|
onChange: j,
|
|
947
947
|
style: { width: "100%" },
|
|
948
|
-
filterOption: (
|
|
949
|
-
if (
|
|
950
|
-
return "start date".includes(
|
|
951
|
-
const ce = o.find((
|
|
948
|
+
filterOption: (N, Y) => {
|
|
949
|
+
if (Y?.value === "gantt-start-date")
|
|
950
|
+
return "start date".includes(N.toLowerCase());
|
|
951
|
+
const ce = o.find((Q) => Q.id === Y?.value);
|
|
952
952
|
if (!ce) return !1;
|
|
953
|
-
const
|
|
954
|
-
return ce.text.toLowerCase().includes(
|
|
953
|
+
const K = o.indexOf(ce) + 1;
|
|
954
|
+
return ce.text.toLowerCase().includes(N.toLowerCase()) || K.toString().includes(N);
|
|
955
955
|
},
|
|
956
956
|
optionLabelProp: "label",
|
|
957
957
|
children: [
|
|
958
|
-
o.filter((
|
|
959
|
-
/* @__PURE__ */ e.jsxs(
|
|
960
|
-
o.indexOf(
|
|
958
|
+
o.filter((N) => N.id !== t.id).map((N) => /* @__PURE__ */ e.jsx(Be, { value: N.id, label: N.text, children: /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0" }, children: [
|
|
959
|
+
/* @__PURE__ */ e.jsxs(Se, { style: { fontSize: "13px" }, children: [
|
|
960
|
+
o.indexOf(N) + 1,
|
|
961
961
|
". ",
|
|
962
|
-
|
|
962
|
+
N.text
|
|
963
963
|
] }),
|
|
964
|
-
/* @__PURE__ */ e.jsxs(
|
|
964
|
+
/* @__PURE__ */ e.jsxs(Se, { type: "secondary", style: { fontSize: "11px" }, children: [
|
|
965
965
|
"Start: ",
|
|
966
|
-
we(
|
|
966
|
+
we(N.start, "MMM D, YYYY")
|
|
967
967
|
] })
|
|
968
|
-
] }) },
|
|
969
|
-
/* @__PURE__ */ e.jsx(
|
|
970
|
-
/* @__PURE__ */ e.jsx(
|
|
971
|
-
/* @__PURE__ */ e.jsx(
|
|
968
|
+
] }) }, N.id)),
|
|
969
|
+
/* @__PURE__ */ e.jsx(Be, { value: "gantt-start-date", label: "Start Date", children: /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0", borderTop: "1px solid #f0f0f0", marginTop: "4px", paddingTop: "8px" }, children: [
|
|
970
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "13px", fontWeight: 600 }, children: "Start Date" }),
|
|
971
|
+
/* @__PURE__ */ e.jsx(Se, { type: "secondary", style: { fontSize: "11px" }, children: we(H, "MMM D, YYYY") })
|
|
972
972
|
] }) }, "gantt-start-date")
|
|
973
973
|
]
|
|
974
974
|
}
|
|
975
975
|
) }),
|
|
976
976
|
/* @__PURE__ */ e.jsx("div", { style: { width: 100 }, children: /* @__PURE__ */ e.jsxs(
|
|
977
|
-
|
|
977
|
+
xe,
|
|
978
978
|
{
|
|
979
979
|
value: u,
|
|
980
980
|
onChange: p,
|
|
981
981
|
style: { width: "100%" },
|
|
982
982
|
children: [
|
|
983
|
-
/* @__PURE__ */ e.jsx(
|
|
984
|
-
/* @__PURE__ */ e.jsx(
|
|
985
|
-
/* @__PURE__ */ e.jsx(
|
|
986
|
-
/* @__PURE__ */ e.jsx(
|
|
983
|
+
/* @__PURE__ */ e.jsx(Be, { value: "e2s", children: "FS" }),
|
|
984
|
+
/* @__PURE__ */ e.jsx(Be, { value: "e2e", children: "FF" }),
|
|
985
|
+
/* @__PURE__ */ e.jsx(Be, { value: "s2s", children: "SS" }),
|
|
986
|
+
/* @__PURE__ */ e.jsx(Be, { value: "s2e", children: "SF" })
|
|
987
987
|
]
|
|
988
988
|
}
|
|
989
989
|
) })
|
|
990
990
|
] }),
|
|
991
991
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
|
|
992
992
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
993
|
-
/* @__PURE__ */ e.jsx(
|
|
993
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: s.font?.color }, children: "Delay type" }),
|
|
994
994
|
/* @__PURE__ */ e.jsxs(
|
|
995
|
-
|
|
995
|
+
xe,
|
|
996
996
|
{
|
|
997
997
|
value: b,
|
|
998
998
|
onChange: w,
|
|
999
999
|
style: { width: "100%" },
|
|
1000
1000
|
children: [
|
|
1001
|
-
/* @__PURE__ */ e.jsx(
|
|
1002
|
-
/* @__PURE__ */ e.jsx(
|
|
1001
|
+
/* @__PURE__ */ e.jsx(Be, { value: "lag", children: "Lag by" }),
|
|
1002
|
+
/* @__PURE__ */ e.jsx(Be, { value: "lead", children: "Lead by" })
|
|
1003
1003
|
]
|
|
1004
1004
|
}
|
|
1005
1005
|
)
|
|
1006
1006
|
] }),
|
|
1007
1007
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
1008
|
-
/* @__PURE__ */ e.jsx(
|
|
1008
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: s.font?.color }, children: "Days" }),
|
|
1009
1009
|
/* @__PURE__ */ e.jsx(
|
|
1010
|
-
|
|
1010
|
+
Ye,
|
|
1011
1011
|
{
|
|
1012
1012
|
min: 0,
|
|
1013
1013
|
value: S,
|
|
1014
|
-
onChange: (
|
|
1014
|
+
onChange: (N) => L(N || 0),
|
|
1015
1015
|
style: { width: "100%" },
|
|
1016
1016
|
placeholder: "0"
|
|
1017
1017
|
}
|
|
@@ -1019,13 +1019,13 @@ const at = (t) => t ? {
|
|
|
1019
1019
|
] })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: 14 }, children: [
|
|
1022
|
-
/* @__PURE__ */ e.jsx(
|
|
1022
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: s.font?.color }, children: "Duration (days)" }),
|
|
1023
1023
|
/* @__PURE__ */ e.jsx(
|
|
1024
|
-
|
|
1024
|
+
Ye,
|
|
1025
1025
|
{
|
|
1026
1026
|
min: 1,
|
|
1027
|
-
value:
|
|
1028
|
-
onChange: (
|
|
1027
|
+
value: $,
|
|
1028
|
+
onChange: (N) => B(N || 1),
|
|
1029
1029
|
style: { width: "100%" },
|
|
1030
1030
|
placeholder: "Duration"
|
|
1031
1031
|
}
|
|
@@ -1037,42 +1037,42 @@ const at = (t) => t ? {
|
|
|
1037
1037
|
borderRadius: "4px",
|
|
1038
1038
|
marginBottom: 14
|
|
1039
1039
|
}, children: /* @__PURE__ */ e.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
|
|
1040
|
-
/* @__PURE__ */ e.jsx(
|
|
1041
|
-
/* @__PURE__ */ e.jsx(
|
|
1042
|
-
/* @__PURE__ */ e.jsx(
|
|
1043
|
-
/* @__PURE__ */ e.jsx(
|
|
1040
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "11px", color: s.font?.color }, children: "FS: Finish to Start" }),
|
|
1041
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "11px", color: s.font?.color }, children: "SS: Start to Start" }),
|
|
1042
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "11px", color: s.font?.color }, children: "FF: Finish to Finish" }),
|
|
1043
|
+
/* @__PURE__ */ e.jsx(Se, { style: { fontSize: "11px", color: s.font?.color }, children: "SF: Start to Finish" })
|
|
1044
1044
|
] }) }),
|
|
1045
1045
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
|
|
1046
|
-
/* @__PURE__ */ e.jsx(
|
|
1046
|
+
/* @__PURE__ */ e.jsx(Se, { strong: !0, style: { fontSize: "13px", color: s.font?.color }, children: "Dependency preview" }),
|
|
1047
1047
|
/* @__PURE__ */ e.jsx(
|
|
1048
1048
|
"a",
|
|
1049
1049
|
{
|
|
1050
|
-
onClick: () =>
|
|
1050
|
+
onClick: () => X(!ne),
|
|
1051
1051
|
style: {
|
|
1052
1052
|
fontSize: "12px",
|
|
1053
1053
|
color: "#1890ff",
|
|
1054
1054
|
cursor: "pointer",
|
|
1055
1055
|
textDecoration: "none"
|
|
1056
1056
|
},
|
|
1057
|
-
children:
|
|
1057
|
+
children: ne ? "Hide preview" : "Show preview"
|
|
1058
1058
|
}
|
|
1059
1059
|
)
|
|
1060
1060
|
] }),
|
|
1061
|
-
|
|
1061
|
+
ne && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1062
1062
|
me(),
|
|
1063
1063
|
/* @__PURE__ */ e.jsx(Nr, { style: {
|
|
1064
1064
|
fontSize: "12px",
|
|
1065
1065
|
color: s.font?.color || "#262626",
|
|
1066
1066
|
marginBottom: 14,
|
|
1067
1067
|
lineHeight: "1.5"
|
|
1068
|
-
}, children:
|
|
1068
|
+
}, children: Fe() })
|
|
1069
1069
|
] }),
|
|
1070
1070
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 10 }, children: [
|
|
1071
1071
|
q && /* @__PURE__ */ e.jsx(
|
|
1072
1072
|
he,
|
|
1073
1073
|
{
|
|
1074
1074
|
danger: !0,
|
|
1075
|
-
onClick:
|
|
1075
|
+
onClick: ae,
|
|
1076
1076
|
style: {
|
|
1077
1077
|
...s.buttonDanger
|
|
1078
1078
|
},
|
|
@@ -1097,72 +1097,72 @@ const at = (t) => t ? {
|
|
|
1097
1097
|
return /* @__PURE__ */ e.jsx(
|
|
1098
1098
|
cr,
|
|
1099
1099
|
{
|
|
1100
|
-
content:
|
|
1100
|
+
content: ke,
|
|
1101
1101
|
trigger: "click",
|
|
1102
1102
|
open: y,
|
|
1103
1103
|
onOpenChange: J,
|
|
1104
1104
|
placement: "bottomLeft",
|
|
1105
1105
|
overlayClassName: "dependency-popover",
|
|
1106
1106
|
overlayInnerStyle: { padding: 0 },
|
|
1107
|
-
children:
|
|
1107
|
+
children: m
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
1110
|
}, Qt = dr(Ot(
|
|
1111
|
-
({ tasks: t, allTasks: o = [], columns: a, selectedTask: l, onTaskClick: r, onTaskContextMenu:
|
|
1112
|
-
const w =
|
|
1113
|
-
|
|
1114
|
-
const [S,
|
|
1115
|
-
if (!
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1118
|
-
},
|
|
1119
|
-
if (q ===
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1122
|
-
...
|
|
1111
|
+
({ tasks: t, allTasks: o = [], columns: a, selectedTask: l, onTaskClick: r, onTaskContextMenu: x, onTaskUpdate: m, onTaskDragStart: i, onAddTask: s, onAddDependency: y, onRemoveDependency: c, links: g = [], dropIndicator: j, reorderTask: u, styleConfig: p }, b) => {
|
|
1112
|
+
const w = re.useRef(null);
|
|
1113
|
+
re.useImperativeHandle(b, () => w.current);
|
|
1114
|
+
const [S, L] = re.useState(null), [$, B] = re.useState(0), ne = (M, q = 0) => {
|
|
1115
|
+
if (!M.parent) return q;
|
|
1116
|
+
const H = t.find((D) => D.id === M.parent);
|
|
1117
|
+
return H ? ne(H, q + 1) : q;
|
|
1118
|
+
}, X = (M, q) => {
|
|
1119
|
+
if (q === M.duration) return;
|
|
1120
|
+
const H = fe(new Date(M.start), q, "day");
|
|
1121
|
+
m?.({
|
|
1122
|
+
...M,
|
|
1123
1123
|
duration: q,
|
|
1124
|
-
end:
|
|
1124
|
+
end: H
|
|
1125
1125
|
});
|
|
1126
|
-
}, pe = (
|
|
1126
|
+
}, pe = (M, q) => {
|
|
1127
1127
|
if (q.template)
|
|
1128
|
-
return q.template(
|
|
1128
|
+
return q.template(M);
|
|
1129
1129
|
switch (q.name) {
|
|
1130
1130
|
case "text": {
|
|
1131
|
-
const
|
|
1132
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft:
|
|
1131
|
+
const H = ne(M);
|
|
1132
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft: H * 14 }, children: [
|
|
1133
1133
|
/* @__PURE__ */ e.jsx(
|
|
1134
1134
|
"div",
|
|
1135
1135
|
{
|
|
1136
1136
|
className: "gantt-row-drag-handle",
|
|
1137
1137
|
onMouseDown: (D) => {
|
|
1138
|
-
D.preventDefault(), i?.(
|
|
1138
|
+
D.preventDefault(), i?.(M.id, D.clientX, D.clientY, "reorder");
|
|
1139
1139
|
},
|
|
1140
1140
|
children: /* @__PURE__ */ e.jsx(de, { icon: Jt })
|
|
1141
1141
|
}
|
|
1142
1142
|
),
|
|
1143
|
-
|
|
1144
|
-
D.stopPropagation(),
|
|
1145
|
-
}, children: /* @__PURE__ */ e.jsx(de, { icon:
|
|
1146
|
-
/* @__PURE__ */ e.jsx("span", { className: "gantt-task-name-text", children:
|
|
1143
|
+
M.type === "project" ? /* @__PURE__ */ e.jsx("span", { className: "gantt-tree-icon", onClick: (D) => {
|
|
1144
|
+
D.stopPropagation(), m?.({ ...M, open: !M.open });
|
|
1145
|
+
}, children: /* @__PURE__ */ e.jsx(de, { icon: M.open ? Yt : fr }) }) : /* @__PURE__ */ e.jsx("span", { style: { width: 16, display: "inline-block" } }),
|
|
1146
|
+
/* @__PURE__ */ e.jsx("span", { className: "gantt-task-name-text", children: M.text })
|
|
1147
1147
|
] });
|
|
1148
1148
|
}
|
|
1149
1149
|
case "start":
|
|
1150
|
-
return we(
|
|
1150
|
+
return we(M.start, "DD-MM-YYYY");
|
|
1151
1151
|
case "end":
|
|
1152
|
-
return we(
|
|
1152
|
+
return we(M.end, "DD-MM-YYYY");
|
|
1153
1153
|
case "duration":
|
|
1154
|
-
return S ===
|
|
1155
|
-
|
|
1154
|
+
return S === M.id ? /* @__PURE__ */ e.jsx(
|
|
1155
|
+
Ye,
|
|
1156
1156
|
{
|
|
1157
1157
|
size: "small",
|
|
1158
1158
|
min: 1,
|
|
1159
|
-
value:
|
|
1160
|
-
onChange: (D) =>
|
|
1159
|
+
value: $,
|
|
1160
|
+
onChange: (D) => B(D || 1),
|
|
1161
1161
|
onBlur: () => {
|
|
1162
|
-
|
|
1162
|
+
X(M, $), L(null);
|
|
1163
1163
|
},
|
|
1164
1164
|
onPressEnter: () => {
|
|
1165
|
-
|
|
1165
|
+
X(M, $), L(null);
|
|
1166
1166
|
},
|
|
1167
1167
|
autoFocus: !0,
|
|
1168
1168
|
style: { width: "100%", fontSize: "12px" }
|
|
@@ -1171,7 +1171,7 @@ const at = (t) => t ? {
|
|
|
1171
1171
|
"div",
|
|
1172
1172
|
{
|
|
1173
1173
|
onClick: (D) => {
|
|
1174
|
-
D.stopPropagation(), M
|
|
1174
|
+
D.stopPropagation(), L(M.id), B(M.duration);
|
|
1175
1175
|
},
|
|
1176
1176
|
style: {
|
|
1177
1177
|
backgroundColor: "#fff7e6",
|
|
@@ -1185,23 +1185,23 @@ const at = (t) => t ? {
|
|
|
1185
1185
|
cursor: "text"
|
|
1186
1186
|
},
|
|
1187
1187
|
children: [
|
|
1188
|
-
|
|
1188
|
+
M.duration,
|
|
1189
1189
|
" day",
|
|
1190
|
-
|
|
1190
|
+
M.duration !== 1 ? "s" : ""
|
|
1191
1191
|
]
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
case "predecessors": {
|
|
1195
|
-
const D = g.filter((
|
|
1195
|
+
const D = g.filter((W) => W.target === M.id)[0];
|
|
1196
1196
|
return /* @__PURE__ */ e.jsx(
|
|
1197
1197
|
_r,
|
|
1198
1198
|
{
|
|
1199
|
-
task:
|
|
1199
|
+
task: M,
|
|
1200
1200
|
allTasks: o,
|
|
1201
1201
|
links: g,
|
|
1202
|
-
onAddDependency: (
|
|
1203
|
-
onRemoveDependency: (
|
|
1204
|
-
onTaskUpdate:
|
|
1202
|
+
onAddDependency: (W, ae, J, me) => y?.(W, ae, J, me),
|
|
1203
|
+
onRemoveDependency: (W) => c?.(W),
|
|
1204
|
+
onTaskUpdate: m,
|
|
1205
1205
|
styleConfig: p,
|
|
1206
1206
|
children: /* @__PURE__ */ e.jsx(
|
|
1207
1207
|
"div",
|
|
@@ -1215,7 +1215,7 @@ const at = (t) => t ? {
|
|
|
1215
1215
|
gap: "4px"
|
|
1216
1216
|
},
|
|
1217
1217
|
children: D ? (() => {
|
|
1218
|
-
const
|
|
1218
|
+
const W = o.find((J) => J.id === D.source), ae = W ? o.indexOf(W) + 1 : 0;
|
|
1219
1219
|
return /* @__PURE__ */ e.jsx(
|
|
1220
1220
|
"span",
|
|
1221
1221
|
{
|
|
@@ -1228,7 +1228,7 @@ const at = (t) => t ? {
|
|
|
1228
1228
|
borderRadius: "4px",
|
|
1229
1229
|
whiteSpace: "nowrap"
|
|
1230
1230
|
},
|
|
1231
|
-
children: Or(D,
|
|
1231
|
+
children: Or(D, ae)
|
|
1232
1232
|
}
|
|
1233
1233
|
);
|
|
1234
1234
|
})() : /* @__PURE__ */ e.jsx(
|
|
@@ -1240,8 +1240,8 @@ const at = (t) => t ? {
|
|
|
1240
1240
|
textDecoration: "none",
|
|
1241
1241
|
fontWeight: 500
|
|
1242
1242
|
},
|
|
1243
|
-
onMouseEnter: (
|
|
1244
|
-
onMouseLeave: (
|
|
1243
|
+
onMouseEnter: (W) => W.currentTarget.style.textDecoration = "underline",
|
|
1244
|
+
onMouseLeave: (W) => W.currentTarget.style.textDecoration = "none",
|
|
1245
1245
|
children: "Add"
|
|
1246
1246
|
}
|
|
1247
1247
|
)
|
|
@@ -1257,8 +1257,8 @@ const at = (t) => t ? {
|
|
|
1257
1257
|
type: "primary",
|
|
1258
1258
|
size: "small",
|
|
1259
1259
|
icon: /* @__PURE__ */ e.jsx(de, { icon: Ct, style: { fontSize: 12 } }),
|
|
1260
|
-
onClick: (
|
|
1261
|
-
|
|
1260
|
+
onClick: (H) => {
|
|
1261
|
+
H.stopPropagation(), s?.(M.id);
|
|
1262
1262
|
},
|
|
1263
1263
|
title: "Add Subtask",
|
|
1264
1264
|
style: {
|
|
@@ -1279,46 +1279,46 @@ const at = (t) => t ? {
|
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
1281
|
className: "gantt-progress-bar-fill",
|
|
1282
|
-
style: { width: `${
|
|
1282
|
+
style: { width: `${M.progress}%` }
|
|
1283
1283
|
}
|
|
1284
1284
|
) }),
|
|
1285
1285
|
/* @__PURE__ */ e.jsxs("span", { className: "gantt-progress-text", children: [
|
|
1286
|
-
|
|
1286
|
+
M.progress,
|
|
1287
1287
|
"%"
|
|
1288
1288
|
] })
|
|
1289
1289
|
] });
|
|
1290
1290
|
case "index":
|
|
1291
|
-
return /* @__PURE__ */ e.jsx("span", { style: { color: "#8c8c8c" }, children: o.indexOf(
|
|
1291
|
+
return /* @__PURE__ */ e.jsx("span", { style: { color: "#8c8c8c" }, children: o.indexOf(M) + 1 });
|
|
1292
1292
|
default:
|
|
1293
|
-
return
|
|
1293
|
+
return M[q.name] || "";
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid", ref: w, children: [
|
|
1297
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%" }, children: a.map((
|
|
1297
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%" }, children: a.map((M) => /* @__PURE__ */ e.jsx(
|
|
1298
1298
|
"div",
|
|
1299
1299
|
{
|
|
1300
1300
|
className: "gantt-grid-header-cell",
|
|
1301
1301
|
style: {
|
|
1302
|
-
width:
|
|
1303
|
-
minWidth:
|
|
1302
|
+
width: M.width,
|
|
1303
|
+
minWidth: M.width,
|
|
1304
1304
|
/* Ensure column maintains width */
|
|
1305
|
-
justifyContent:
|
|
1305
|
+
justifyContent: M.align === "center" ? "center" : "flex-start"
|
|
1306
1306
|
},
|
|
1307
|
-
children:
|
|
1308
|
-
|
|
1309
|
-
|
|
1307
|
+
children: M.name === "add" ? /* @__PURE__ */ e.jsx("span", { style: { fontSize: 11, color: "#64748b", fontWeight: 600, whiteSpace: "nowrap" }, children: "Add" }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1308
|
+
M.label,
|
|
1309
|
+
M.name === "start" && /* @__PURE__ */ e.jsx(de, { icon: Yt, style: { marginLeft: 8, fontSize: 10, color: "#64748b" } })
|
|
1310
1310
|
] })
|
|
1311
1311
|
},
|
|
1312
|
-
|
|
1312
|
+
M.name
|
|
1313
1313
|
)) }),
|
|
1314
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-body", children: t.map((
|
|
1315
|
-
const q = u?.id ===
|
|
1314
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-body", children: t.map((M) => {
|
|
1315
|
+
const q = u?.id === M.id, H = u?.descendantIds.includes(M.id);
|
|
1316
1316
|
return /* @__PURE__ */ e.jsxs(
|
|
1317
1317
|
"div",
|
|
1318
1318
|
{
|
|
1319
|
-
className: `gantt-grid-row ${l ===
|
|
1320
|
-
onClick: () => r(
|
|
1321
|
-
onContextMenu: (D) =>
|
|
1319
|
+
className: `gantt-grid-row ${l === M.id ? "selected" : ""} ${q ? "dragging-row" : ""} ${H ? "descendant-dragging-row" : ""} ${j?.taskId === M.id ? `drop-target-${j.position}` : ""}`,
|
|
1320
|
+
onClick: () => r(M.id),
|
|
1321
|
+
onContextMenu: (D) => x?.(D, M.id),
|
|
1322
1322
|
style: {
|
|
1323
1323
|
display: "flex",
|
|
1324
1324
|
minWidth: "100%"
|
|
@@ -1326,7 +1326,7 @@ const at = (t) => t ? {
|
|
|
1326
1326
|
},
|
|
1327
1327
|
children: [
|
|
1328
1328
|
a.map((D) => {
|
|
1329
|
-
const
|
|
1329
|
+
const W = D.name === "add";
|
|
1330
1330
|
return /* @__PURE__ */ e.jsx(
|
|
1331
1331
|
"div",
|
|
1332
1332
|
{
|
|
@@ -1338,21 +1338,21 @@ const at = (t) => t ? {
|
|
|
1338
1338
|
textAlign: D.align || "left",
|
|
1339
1339
|
display: "flex",
|
|
1340
1340
|
alignItems: "center",
|
|
1341
|
-
justifyContent:
|
|
1341
|
+
justifyContent: W ? "center" : D.name === "text" ? "flex-start" : D.align === "center" ? "center" : D.align === "right" ? "flex-end" : "flex-start",
|
|
1342
1342
|
visibility: "visible",
|
|
1343
1343
|
/* Ensure column is visible */
|
|
1344
1344
|
opacity: 1
|
|
1345
1345
|
/* Ensure column is not transparent */
|
|
1346
1346
|
},
|
|
1347
|
-
children: pe(
|
|
1347
|
+
children: pe(M, D)
|
|
1348
1348
|
},
|
|
1349
|
-
`${
|
|
1349
|
+
`${M.id}-${D.name}`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
j?.taskId ===
|
|
1352
|
+
j?.taskId === M.id && /* @__PURE__ */ e.jsx("div", { className: `gantt-drop-indicator ${j.position}` })
|
|
1353
1353
|
]
|
|
1354
1354
|
},
|
|
1355
|
-
|
|
1355
|
+
M.id
|
|
1356
1356
|
);
|
|
1357
1357
|
}) })
|
|
1358
1358
|
] });
|
|
@@ -1365,19 +1365,19 @@ const Yr = ({
|
|
|
1365
1365
|
selected: a,
|
|
1366
1366
|
dragging: l,
|
|
1367
1367
|
onClick: r,
|
|
1368
|
-
onDragStart:
|
|
1369
|
-
dragDeltaX:
|
|
1368
|
+
onDragStart: x,
|
|
1369
|
+
dragDeltaX: m = 0,
|
|
1370
1370
|
dragType: i = null,
|
|
1371
1371
|
readonly: s = !1
|
|
1372
1372
|
}) => {
|
|
1373
1373
|
const y = (p, b) => {
|
|
1374
|
-
s || (p.preventDefault(), p.stopPropagation(),
|
|
1374
|
+
s || (p.preventDefault(), p.stopPropagation(), x(p.clientX, p.clientY, b));
|
|
1375
1375
|
}, c = () => {
|
|
1376
1376
|
const p = ["gantt-task-bar"];
|
|
1377
1377
|
return t.type === "milestone" && p.push("milestone"), t.type === "project" && p.push("project"), a && p.push("selected"), l && p.push("dragging"), t.status && p.push(`status-${t.status}`), p.join(" ");
|
|
1378
1378
|
}, g = () => {
|
|
1379
1379
|
let p = o.left, b = o.width;
|
|
1380
|
-
return l && i && (i === "move" ? p +=
|
|
1380
|
+
return l && i && (i === "move" ? p += m : i === "resize-left" ? (p += m, b -= m) : i === "resize-right" && (b += m)), {
|
|
1381
1381
|
left: `${p}px`,
|
|
1382
1382
|
width: `${Math.max(b, 0)}px`,
|
|
1383
1383
|
// Color handled by CSS classes (.project, .milestone) or task.color override
|
|
@@ -1441,7 +1441,7 @@ const Yr = ({
|
|
|
1441
1441
|
},
|
|
1442
1442
|
`hold-${S}`
|
|
1443
1443
|
)),
|
|
1444
|
-
b.map((w, S) => /* @__PURE__ */ e.jsx(
|
|
1444
|
+
b.map((w, S) => /* @__PURE__ */ e.jsx(_e, { title: u, mouseEnterDelay: 0.5, children: /* @__PURE__ */ e.jsx(
|
|
1445
1445
|
"div",
|
|
1446
1446
|
{
|
|
1447
1447
|
className: c() + " segment",
|
|
@@ -1451,13 +1451,13 @@ const Yr = ({
|
|
|
1451
1451
|
backgroundColor: t.color || void 0
|
|
1452
1452
|
},
|
|
1453
1453
|
onClick: r,
|
|
1454
|
-
onMouseDown: (
|
|
1454
|
+
onMouseDown: (L) => y(L, "move"),
|
|
1455
1455
|
children: j(S > 0)
|
|
1456
1456
|
}
|
|
1457
1457
|
) }, `seg-${S}`))
|
|
1458
1458
|
] });
|
|
1459
1459
|
}
|
|
1460
|
-
return /* @__PURE__ */ e.jsx(
|
|
1460
|
+
return /* @__PURE__ */ e.jsx(_e, { title: u, mouseEnterDelay: 0.5, children: /* @__PURE__ */ e.jsx(
|
|
1461
1461
|
"div",
|
|
1462
1462
|
{
|
|
1463
1463
|
className: c(),
|
|
@@ -1468,7 +1468,7 @@ const Yr = ({
|
|
|
1468
1468
|
}
|
|
1469
1469
|
) });
|
|
1470
1470
|
}, Ar = ({ links: t, tasks: o, getTaskPosition: a }) => {
|
|
1471
|
-
const l = (i) => o.find((s) => s.id === i), r =
|
|
1471
|
+
const l = (i) => o.find((s) => s.id === i), r = re.useMemo(() => {
|
|
1472
1472
|
let i = 0, s = 0;
|
|
1473
1473
|
return o.forEach((y) => {
|
|
1474
1474
|
try {
|
|
@@ -1481,7 +1481,7 @@ const Yr = ({
|
|
|
1481
1481
|
width: Math.max(i, 1e3),
|
|
1482
1482
|
height: Math.max(s, 100)
|
|
1483
1483
|
};
|
|
1484
|
-
}, [o, a]),
|
|
1484
|
+
}, [o, a]), x = (i) => {
|
|
1485
1485
|
const s = l(i.source), y = l(i.target);
|
|
1486
1486
|
if (!s || !y) return "";
|
|
1487
1487
|
const c = a(s), g = a(y), j = c.top + c.height / 2, u = g.top + g.height / 2;
|
|
@@ -1500,31 +1500,31 @@ const Yr = ({
|
|
|
1500
1500
|
p = c.left, b = g.left + g.width;
|
|
1501
1501
|
break;
|
|
1502
1502
|
}
|
|
1503
|
-
const w = b - p, S = u - j,
|
|
1503
|
+
const w = b - p, S = u - j, L = 20;
|
|
1504
1504
|
if (i.type === "e2s")
|
|
1505
|
-
if (w >=
|
|
1506
|
-
const
|
|
1507
|
-
return `M ${p},${j} L ${
|
|
1505
|
+
if (w >= L) {
|
|
1506
|
+
const $ = p + w / 2;
|
|
1507
|
+
return `M ${p},${j} L ${$},${j} L ${$},${u} L ${b},${u}`;
|
|
1508
1508
|
} else {
|
|
1509
|
-
const
|
|
1510
|
-
return `M ${p},${j} L ${p +
|
|
1509
|
+
const $ = L / 2, B = j + S / 2;
|
|
1510
|
+
return `M ${p},${j} L ${p + $},${j} L ${p + $},${B} L ${b - $},${B} L ${b - $},${u} L ${b},${u}`;
|
|
1511
1511
|
}
|
|
1512
1512
|
else if (i.type === "s2s") {
|
|
1513
|
-
const
|
|
1514
|
-
return `M ${p},${j} L ${
|
|
1513
|
+
const $ = Math.min(p, b) - L / 2;
|
|
1514
|
+
return `M ${p},${j} L ${$},${j} L ${$},${u} L ${b},${u}`;
|
|
1515
1515
|
} else if (i.type === "e2e") {
|
|
1516
|
-
const
|
|
1517
|
-
return `M ${p},${j} L ${
|
|
1516
|
+
const $ = Math.max(p, b) + L / 2;
|
|
1517
|
+
return `M ${p},${j} L ${$},${j} L ${$},${u} L ${b},${u}`;
|
|
1518
1518
|
} else if (i.type === "s2e")
|
|
1519
|
-
if (w <= -
|
|
1520
|
-
const
|
|
1521
|
-
return `M ${p},${j} L ${
|
|
1519
|
+
if (w <= -L) {
|
|
1520
|
+
const $ = p + w / 2;
|
|
1521
|
+
return `M ${p},${j} L ${$},${j} L ${$},${u} L ${b},${u}`;
|
|
1522
1522
|
} else {
|
|
1523
|
-
const
|
|
1524
|
-
return `M ${p},${j} L ${p -
|
|
1523
|
+
const $ = L / 2, B = j + S / 2;
|
|
1524
|
+
return `M ${p},${j} L ${p - $},${j} L ${p - $},${B} L ${b + $},${B} L ${b + $},${u} L ${b},${u}`;
|
|
1525
1525
|
}
|
|
1526
1526
|
return "";
|
|
1527
|
-
},
|
|
1527
|
+
}, m = (i) => {
|
|
1528
1528
|
const s = l(i.target);
|
|
1529
1529
|
if (!s) return "";
|
|
1530
1530
|
const y = a(s), c = y.top + y.height / 2, g = 8, j = 6;
|
|
@@ -1547,7 +1547,7 @@ const Yr = ({
|
|
|
1547
1547
|
children: t.map((i) => {
|
|
1548
1548
|
const s = l(i.source), y = l(i.target);
|
|
1549
1549
|
if (!s || !y) return null;
|
|
1550
|
-
const c =
|
|
1550
|
+
const c = x(i), g = m(i);
|
|
1551
1551
|
return !c || !g ? null : /* @__PURE__ */ e.jsxs("g", { className: "gantt-link", children: [
|
|
1552
1552
|
/* @__PURE__ */ e.jsx(
|
|
1553
1553
|
"path",
|
|
@@ -1570,7 +1570,7 @@ const Yr = ({
|
|
|
1570
1570
|
}
|
|
1571
1571
|
);
|
|
1572
1572
|
}, Ir = (t, o, a = 60, l = "day", r = 1) => {
|
|
1573
|
-
const [
|
|
1573
|
+
const [x, m] = z({
|
|
1574
1574
|
taskId: null,
|
|
1575
1575
|
initialX: 0,
|
|
1576
1576
|
initialY: 0,
|
|
@@ -1579,9 +1579,9 @@ const Yr = ({
|
|
|
1579
1579
|
type: null,
|
|
1580
1580
|
dragDeltaX: 0,
|
|
1581
1581
|
dragDeltaY: 0
|
|
1582
|
-
}), i =
|
|
1582
|
+
}), i = $e((c, g, j, u) => {
|
|
1583
1583
|
const p = t.find((b) => b.id === c);
|
|
1584
|
-
p &&
|
|
1584
|
+
p && m({
|
|
1585
1585
|
taskId: c,
|
|
1586
1586
|
initialX: g,
|
|
1587
1587
|
initialY: j,
|
|
@@ -1591,42 +1591,42 @@ const Yr = ({
|
|
|
1591
1591
|
dragDeltaX: 0,
|
|
1592
1592
|
dragDeltaY: 0
|
|
1593
1593
|
});
|
|
1594
|
-
}, [t]), s =
|
|
1595
|
-
if (!
|
|
1596
|
-
const j = c -
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1594
|
+
}, [t]), s = $e((c, g) => {
|
|
1595
|
+
if (!x.taskId || !x.type) return null;
|
|
1596
|
+
const j = c - x.initialX, u = g - x.initialY;
|
|
1597
|
+
if (m(($) => ({
|
|
1598
|
+
...$,
|
|
1599
1599
|
dragDeltaX: j,
|
|
1600
1600
|
dragDeltaY: u
|
|
1601
|
-
})),
|
|
1602
|
-
const p = t.find((
|
|
1601
|
+
})), x.type === "reorder") return null;
|
|
1602
|
+
const p = t.find(($) => $.id === x.taskId);
|
|
1603
1603
|
if (!p) return null;
|
|
1604
1604
|
const b = Math.round(j / a);
|
|
1605
|
-
let w = new Date(
|
|
1606
|
-
switch (
|
|
1605
|
+
let w = new Date(x.initialStart), S = new Date(x.initialEnd);
|
|
1606
|
+
switch (x.type) {
|
|
1607
1607
|
case "move":
|
|
1608
|
-
w = fe(
|
|
1608
|
+
w = fe(x.initialStart, b * r, l), S = fe(x.initialEnd, b * r, l);
|
|
1609
1609
|
break;
|
|
1610
1610
|
case "resize-left":
|
|
1611
|
-
w = fe(
|
|
1611
|
+
w = fe(x.initialStart, b * r, l), w >= S && (w = fe(S, -r, l));
|
|
1612
1612
|
break;
|
|
1613
1613
|
case "resize-right":
|
|
1614
|
-
S = fe(
|
|
1614
|
+
S = fe(x.initialEnd, b * r, l), S <= w && (S = fe(w, r, l));
|
|
1615
1615
|
break;
|
|
1616
1616
|
}
|
|
1617
|
-
const
|
|
1617
|
+
const L = bt(w, S);
|
|
1618
1618
|
return {
|
|
1619
1619
|
...p,
|
|
1620
1620
|
start: w,
|
|
1621
1621
|
end: S,
|
|
1622
|
-
duration:
|
|
1622
|
+
duration: L
|
|
1623
1623
|
};
|
|
1624
|
-
}, [
|
|
1624
|
+
}, [x, t, a, r, l]), y = $e((c) => {
|
|
1625
1625
|
if (c && o) {
|
|
1626
1626
|
const { id: g, ...j } = c;
|
|
1627
1627
|
o(g, j);
|
|
1628
1628
|
}
|
|
1629
|
-
|
|
1629
|
+
m({
|
|
1630
1630
|
taskId: null,
|
|
1631
1631
|
initialX: 0,
|
|
1632
1632
|
initialY: 0,
|
|
@@ -1638,7 +1638,7 @@ const Yr = ({
|
|
|
1638
1638
|
});
|
|
1639
1639
|
}, [o]);
|
|
1640
1640
|
return {
|
|
1641
|
-
dragState:
|
|
1641
|
+
dragState: x,
|
|
1642
1642
|
handleDragStart: i,
|
|
1643
1643
|
handleDrag: s,
|
|
1644
1644
|
handleDragEnd: y
|
|
@@ -1650,38 +1650,38 @@ const Yr = ({
|
|
|
1650
1650
|
range: a,
|
|
1651
1651
|
scales: l,
|
|
1652
1652
|
config: r,
|
|
1653
|
-
selectedTask:
|
|
1654
|
-
onTaskClick:
|
|
1653
|
+
selectedTask: x,
|
|
1654
|
+
onTaskClick: m,
|
|
1655
1655
|
onTaskDragStart: i,
|
|
1656
1656
|
onTaskDragEnd: s,
|
|
1657
1657
|
onTaskUpdate: y,
|
|
1658
1658
|
zoomLevel: c,
|
|
1659
1659
|
baselines: g
|
|
1660
1660
|
}, j) => {
|
|
1661
|
-
const [u, p] =
|
|
1661
|
+
const [u, p] = z(t), b = (r.columnWidth || 60) * c, w = r.baselines && g && g.size > 0, { dragState: S, handleDragStart: L, handleDrag: $, handleDragEnd: B } = Ir(
|
|
1662
1662
|
u,
|
|
1663
1663
|
y,
|
|
1664
1664
|
b,
|
|
1665
1665
|
l[1].unit,
|
|
1666
1666
|
l[1].step
|
|
1667
1667
|
);
|
|
1668
|
-
|
|
1669
|
-
(t.length !== u.length || t.some((k,
|
|
1670
|
-
const P = u[
|
|
1668
|
+
re.useEffect(() => {
|
|
1669
|
+
(t.length !== u.length || t.some((k, F) => {
|
|
1670
|
+
const P = u[F];
|
|
1671
1671
|
return !P || k.id !== P.id || k.start.getTime() !== P.start.getTime() || k.end.getTime() !== P.end.getTime();
|
|
1672
1672
|
})) && p(t);
|
|
1673
1673
|
}, [t]);
|
|
1674
|
-
const
|
|
1674
|
+
const ne = re.useCallback((h) => {
|
|
1675
1675
|
const k = [];
|
|
1676
|
-
let
|
|
1677
|
-
for (;
|
|
1676
|
+
let F = new Date(a.start);
|
|
1677
|
+
for (; F <= a.end; )
|
|
1678
1678
|
k.push({
|
|
1679
|
-
date: new Date(
|
|
1680
|
-
label: we(
|
|
1681
|
-
}),
|
|
1679
|
+
date: new Date(F),
|
|
1680
|
+
label: we(F, h.format || "D")
|
|
1681
|
+
}), F = fe(F, h.step, h.unit);
|
|
1682
1682
|
return k;
|
|
1683
|
-
}, [a.start, a.end]),
|
|
1684
|
-
const k = l[1],
|
|
1683
|
+
}, [a.start, a.end]), X = re.useCallback((h) => {
|
|
1684
|
+
const k = l[1], F = a.start.getTime(), A = h.getTime() - F, ee = {
|
|
1685
1685
|
hour: 36e5,
|
|
1686
1686
|
day: 864e5,
|
|
1687
1687
|
week: 6048e5,
|
|
@@ -1689,84 +1689,84 @@ const Yr = ({
|
|
|
1689
1689
|
quarter: 7776e6,
|
|
1690
1690
|
year: 31536e6
|
|
1691
1691
|
}[k.unit] || 864e5;
|
|
1692
|
-
return
|
|
1692
|
+
return A / (ee * k.step) * b;
|
|
1693
1693
|
}, [l, a.start, b]), pe = (h) => {
|
|
1694
|
-
const k =
|
|
1694
|
+
const k = X(h.start), F = X(h.end);
|
|
1695
1695
|
return {
|
|
1696
1696
|
left: k,
|
|
1697
|
-
width: Math.max(
|
|
1697
|
+
width: Math.max(F - k, 0)
|
|
1698
1698
|
};
|
|
1699
|
-
},
|
|
1700
|
-
const k =
|
|
1699
|
+
}, M = (h) => {
|
|
1700
|
+
const k = X(h.start), F = X(h.end);
|
|
1701
1701
|
return {
|
|
1702
1702
|
left: k,
|
|
1703
|
-
width: Math.max(
|
|
1703
|
+
width: Math.max(F - k, 0)
|
|
1704
1704
|
};
|
|
1705
1705
|
}, q = (h) => {
|
|
1706
|
-
const k = pe(h),
|
|
1706
|
+
const k = pe(h), F = u.findIndex((ee) => ee.id === h.id), P = r.rowHeight || 48, A = 32, oe = (P - A) / 2;
|
|
1707
1707
|
return {
|
|
1708
1708
|
left: k.left,
|
|
1709
1709
|
width: k.width,
|
|
1710
|
-
top:
|
|
1711
|
-
height:
|
|
1710
|
+
top: F * P + oe,
|
|
1711
|
+
height: A
|
|
1712
1712
|
};
|
|
1713
|
-
},
|
|
1714
|
-
S.taskId && S.type && (
|
|
1715
|
-
const k =
|
|
1713
|
+
}, H = re.useRef(null), D = $e((h) => {
|
|
1714
|
+
S.taskId && S.type && (H.current && cancelAnimationFrame(H.current), H.current = requestAnimationFrame(() => {
|
|
1715
|
+
const k = $(h.clientX, h.clientY);
|
|
1716
1716
|
k && p(
|
|
1717
|
-
(
|
|
1717
|
+
(F) => F.map((P) => P.id === k.id ? k : P)
|
|
1718
1718
|
);
|
|
1719
1719
|
}));
|
|
1720
|
-
}, [S,
|
|
1720
|
+
}, [S, $]), W = $e(() => {
|
|
1721
1721
|
if (S.taskId) {
|
|
1722
1722
|
const h = u.find((k) => k.id === S.taskId);
|
|
1723
|
-
|
|
1723
|
+
B(h || null), s();
|
|
1724
1724
|
}
|
|
1725
|
-
}, [S, u,
|
|
1725
|
+
}, [S, u, B, s]), ae = l[1], J = re.useMemo(() => ne(ae), [ne, ae]), me = re.useCallback(() => {
|
|
1726
1726
|
const h = [];
|
|
1727
|
-
let k = -1,
|
|
1728
|
-
return J.forEach((
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
}), k !== -1 && h.push({ label:
|
|
1732
|
-
}, [J, b]),
|
|
1727
|
+
let k = -1, F = -1, P = 0, A = "";
|
|
1728
|
+
return J.forEach((oe) => {
|
|
1729
|
+
const ee = oe.date.getMonth(), Re = oe.date.getFullYear(), se = we(oe.date, "MMM YYYY");
|
|
1730
|
+
ee !== k || Re !== F ? (k !== -1 && h.push({ label: A, width: P }), k = ee, F = Re, P = b, A = se) : P += b;
|
|
1731
|
+
}), k !== -1 && h.push({ label: A, width: P }), h;
|
|
1732
|
+
}, [J, b]), Fe = re.useCallback(() => {
|
|
1733
1733
|
const h = [];
|
|
1734
|
-
let k = -1,
|
|
1735
|
-
return J.forEach((
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1738
|
-
}), k !== -1 && h.push({ label:
|
|
1739
|
-
}, [J, b]),
|
|
1734
|
+
let k = -1, F = 0, P = -1, A = -1, oe = "";
|
|
1735
|
+
return J.forEach((ee) => {
|
|
1736
|
+
const se = ee.date.getDate() <= 15 ? 0 : 1, Me = ee.date.getMonth(), Ae = ee.date.getFullYear(), Pe = we(ee.date, "MMM"), Te = new Date(Ae, Me + 1, 0).getDate(), Oe = se === 0 ? `${Pe} 1 - 15` : `${Pe} 16 - ${Te}`;
|
|
1737
|
+
se !== k || Me !== P || Ae !== A ? (k !== -1 && h.push({ label: oe, width: F }), k = se, P = Me, A = Ae, F = b, oe = Oe) : F += b;
|
|
1738
|
+
}), k !== -1 && h.push({ label: oe, width: F }), h;
|
|
1739
|
+
}, [J, b]), ke = re.useMemo(() => me(), [me]), N = re.useMemo(() => Fe(), [Fe]), Y = re.useMemo(() => J.length * b, [J.length, b]), ce = re.useMemo(() => {
|
|
1740
1740
|
const h = /* @__PURE__ */ new Date();
|
|
1741
1741
|
return h.setHours(0, 0, 0, 0), h;
|
|
1742
|
-
}, []),
|
|
1742
|
+
}, []), K = re.useMemo(() => {
|
|
1743
1743
|
if (!r.showTodayLine) return null;
|
|
1744
|
-
const h =
|
|
1745
|
-
return h >= -b && h <=
|
|
1746
|
-
}, [r.showTodayLine, ce,
|
|
1744
|
+
const h = X(ce);
|
|
1745
|
+
return h >= -b && h <= Y + b ? Math.max(0, Math.min(h, Y)) : null;
|
|
1746
|
+
}, [r.showTodayLine, ce, Y, b, X]), Q = re.useMemo(() => {
|
|
1747
1747
|
if (r.projectStartDate)
|
|
1748
|
-
return
|
|
1748
|
+
return rt(r.projectStartDate);
|
|
1749
1749
|
if (t.length > 0) {
|
|
1750
1750
|
const h = t.map((k) => k.start.getTime());
|
|
1751
|
-
return
|
|
1751
|
+
return rt(new Date(Math.min(...h)));
|
|
1752
1752
|
}
|
|
1753
1753
|
return null;
|
|
1754
|
-
}, [r.projectStartDate, t]), G =
|
|
1755
|
-
if (!r.showProjectStartLine || !
|
|
1756
|
-
const h =
|
|
1757
|
-
return h >= -b && h <=
|
|
1758
|
-
}, [r.showProjectStartLine,
|
|
1754
|
+
}, [r.projectStartDate, t]), G = re.useMemo(() => {
|
|
1755
|
+
if (!r.showProjectStartLine || !Q) return null;
|
|
1756
|
+
const h = X(Q);
|
|
1757
|
+
return h >= -b && h <= Y + b ? Math.max(0, Math.min(h, Y)) : null;
|
|
1758
|
+
}, [r.showProjectStartLine, Q, Y, b, X]);
|
|
1759
1759
|
return /* @__PURE__ */ e.jsxs(
|
|
1760
1760
|
"div",
|
|
1761
1761
|
{
|
|
1762
1762
|
className: "gantt-timeline-container",
|
|
1763
1763
|
ref: j,
|
|
1764
1764
|
onMouseMove: D,
|
|
1765
|
-
onMouseUp:
|
|
1766
|
-
style: { width:
|
|
1765
|
+
onMouseUp: W,
|
|
1766
|
+
style: { width: Y, position: "relative" },
|
|
1767
1767
|
children: [
|
|
1768
|
-
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-header", style: { width:
|
|
1769
|
-
|
|
1768
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-header", style: { width: Y, minWidth: Y, position: "relative" }, children: [
|
|
1769
|
+
K !== null && r.showTodayLine && r.todayLineLabel && r.todayLineLabel !== "" && /* @__PURE__ */ e.jsx(
|
|
1770
1770
|
"div",
|
|
1771
1771
|
{
|
|
1772
1772
|
className: "gantt-today-line-label",
|
|
@@ -1774,7 +1774,7 @@ const Yr = ({
|
|
|
1774
1774
|
position: "absolute",
|
|
1775
1775
|
top: "calc(var(--gantt-scale-height, 24px) * 2)",
|
|
1776
1776
|
// Position at the start of the day row (after month and range rows)
|
|
1777
|
-
left: `${
|
|
1777
|
+
left: `${K}px`,
|
|
1778
1778
|
transform: "translateX(-50%)",
|
|
1779
1779
|
backgroundColor: r.todayLineColor || "#ff4d4f",
|
|
1780
1780
|
color: "#ffffff",
|
|
@@ -1820,7 +1820,7 @@ const Yr = ({
|
|
|
1820
1820
|
children: r.projectStartLineLabel
|
|
1821
1821
|
}
|
|
1822
1822
|
),
|
|
1823
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width:
|
|
1823
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width: Y }, children: ke.map((h, k) => /* @__PURE__ */ e.jsx(
|
|
1824
1824
|
"div",
|
|
1825
1825
|
{
|
|
1826
1826
|
className: "gantt-timeline-cell",
|
|
@@ -1828,13 +1828,13 @@ const Yr = ({
|
|
|
1828
1828
|
width: h.width,
|
|
1829
1829
|
minWidth: h.width,
|
|
1830
1830
|
maxWidth: h.width,
|
|
1831
|
-
borderRight: k ===
|
|
1831
|
+
borderRight: k === ke.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
1832
1832
|
},
|
|
1833
1833
|
children: h.label
|
|
1834
1834
|
},
|
|
1835
1835
|
`top-${k}`
|
|
1836
1836
|
)) }),
|
|
1837
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width:
|
|
1837
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width: Y }, children: N.map((h, k) => /* @__PURE__ */ e.jsx(
|
|
1838
1838
|
"div",
|
|
1839
1839
|
{
|
|
1840
1840
|
className: "gantt-timeline-cell",
|
|
@@ -1842,18 +1842,18 @@ const Yr = ({
|
|
|
1842
1842
|
width: h.width,
|
|
1843
1843
|
minWidth: h.width,
|
|
1844
1844
|
maxWidth: h.width,
|
|
1845
|
-
borderRight: k ===
|
|
1845
|
+
borderRight: k === N.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
1846
1846
|
},
|
|
1847
1847
|
children: h.label
|
|
1848
1848
|
},
|
|
1849
1849
|
`mid-${k}`
|
|
1850
1850
|
)) }),
|
|
1851
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width:
|
|
1852
|
-
const
|
|
1851
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: Y }, children: J.map((h, k) => {
|
|
1852
|
+
const F = r.weekends && Bt(h.date), P = r.holidays && Wt(h.date, r.holidays);
|
|
1853
1853
|
return /* @__PURE__ */ e.jsx(
|
|
1854
1854
|
"div",
|
|
1855
1855
|
{
|
|
1856
|
-
className: `gantt-timeline-cell ${
|
|
1856
|
+
className: `gantt-timeline-cell ${F ? "weekend" : ""} ${P ? "holiday" : ""}`,
|
|
1857
1857
|
style: {
|
|
1858
1858
|
width: b,
|
|
1859
1859
|
minWidth: b,
|
|
@@ -1866,17 +1866,17 @@ const Yr = ({
|
|
|
1866
1866
|
);
|
|
1867
1867
|
}) })
|
|
1868
1868
|
] }),
|
|
1869
|
-
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-body", style: { width:
|
|
1870
|
-
|
|
1869
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-body", style: { width: Y, position: "relative" }, children: [
|
|
1870
|
+
K !== null && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1871
1871
|
r.showTodayLineMarker !== !1 && (() => {
|
|
1872
|
-
const h = r.todayLineMarkerSize || 8, k = r.todayLineColor || "#ff4d4f",
|
|
1873
|
-
return
|
|
1872
|
+
const h = r.todayLineMarkerSize || 8, k = r.todayLineColor || "#ff4d4f", F = r.todayLineMarkerStyle || "triangle", P = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
|
|
1873
|
+
return F === "triangle" ? /* @__PURE__ */ e.jsx(
|
|
1874
1874
|
"div",
|
|
1875
1875
|
{
|
|
1876
1876
|
className: "gantt-today-line-marker",
|
|
1877
1877
|
style: {
|
|
1878
1878
|
position: "absolute",
|
|
1879
|
-
left: `${
|
|
1879
|
+
left: `${K}px`,
|
|
1880
1880
|
top: "-4px",
|
|
1881
1881
|
transform: "translateX(-50%)",
|
|
1882
1882
|
width: 0,
|
|
@@ -1889,13 +1889,13 @@ const Yr = ({
|
|
|
1889
1889
|
opacity: P
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
|
-
) :
|
|
1892
|
+
) : F === "arrow" ? /* @__PURE__ */ e.jsx(
|
|
1893
1893
|
"div",
|
|
1894
1894
|
{
|
|
1895
1895
|
className: "gantt-today-line-marker",
|
|
1896
1896
|
style: {
|
|
1897
1897
|
position: "absolute",
|
|
1898
|
-
left: `${
|
|
1898
|
+
left: `${K}px`,
|
|
1899
1899
|
top: "-6px",
|
|
1900
1900
|
transform: "translateX(-50%)",
|
|
1901
1901
|
width: 0,
|
|
@@ -1908,13 +1908,13 @@ const Yr = ({
|
|
|
1908
1908
|
opacity: P
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
|
-
) :
|
|
1911
|
+
) : F === "dot" ? /* @__PURE__ */ e.jsx(
|
|
1912
1912
|
"div",
|
|
1913
1913
|
{
|
|
1914
1914
|
className: "gantt-today-line-marker",
|
|
1915
1915
|
style: {
|
|
1916
1916
|
position: "absolute",
|
|
1917
|
-
left: `${
|
|
1917
|
+
left: `${K}px`,
|
|
1918
1918
|
top: `-${h / 2}px`,
|
|
1919
1919
|
transform: "translateX(-50%)",
|
|
1920
1920
|
width: `${h}px`,
|
|
@@ -1934,7 +1934,7 @@ const Yr = ({
|
|
|
1934
1934
|
className: "gantt-today-line",
|
|
1935
1935
|
style: {
|
|
1936
1936
|
position: "absolute",
|
|
1937
|
-
left: `${
|
|
1937
|
+
left: `${K}px`,
|
|
1938
1938
|
top: 0,
|
|
1939
1939
|
bottom: 0,
|
|
1940
1940
|
width: `${r.todayLineWidth || 1}px`,
|
|
@@ -1951,8 +1951,8 @@ const Yr = ({
|
|
|
1951
1951
|
] }),
|
|
1952
1952
|
G !== null && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1953
1953
|
r.showProjectStartLineMarker !== !1 && (() => {
|
|
1954
|
-
const h = r.projectStartLineMarkerSize || 8, k = r.projectStartLineColor || "#40a9ff",
|
|
1955
|
-
return
|
|
1954
|
+
const h = r.projectStartLineMarkerSize || 8, k = r.projectStartLineColor || "#40a9ff", F = r.projectStartLineMarkerStyle || "triangle", P = r.projectStartLineOpacity !== void 0 ? r.projectStartLineOpacity : 1;
|
|
1955
|
+
return F === "triangle" ? /* @__PURE__ */ e.jsx(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
1958
1958
|
className: "gantt-project-start-line-marker",
|
|
@@ -1971,7 +1971,7 @@ const Yr = ({
|
|
|
1971
1971
|
opacity: P
|
|
1972
1972
|
}
|
|
1973
1973
|
}
|
|
1974
|
-
) :
|
|
1974
|
+
) : F === "arrow" ? /* @__PURE__ */ e.jsx(
|
|
1975
1975
|
"div",
|
|
1976
1976
|
{
|
|
1977
1977
|
className: "gantt-project-start-line-marker",
|
|
@@ -1990,7 +1990,7 @@ const Yr = ({
|
|
|
1990
1990
|
opacity: P
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
) :
|
|
1993
|
+
) : F === "dot" ? /* @__PURE__ */ e.jsx(
|
|
1994
1994
|
"div",
|
|
1995
1995
|
{
|
|
1996
1996
|
className: "gantt-project-start-line-marker",
|
|
@@ -2032,11 +2032,11 @@ const Yr = ({
|
|
|
2032
2032
|
)
|
|
2033
2033
|
] }),
|
|
2034
2034
|
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-grid", children: J.map((h, k) => {
|
|
2035
|
-
const
|
|
2035
|
+
const F = r.weekends && Bt(h.date), P = r.holidays && Wt(h.date, r.holidays);
|
|
2036
2036
|
return /* @__PURE__ */ e.jsx(
|
|
2037
2037
|
"div",
|
|
2038
2038
|
{
|
|
2039
|
-
className: `gantt-timeline-grid-column ${
|
|
2039
|
+
className: `gantt-timeline-grid-column ${F ? "weekend" : ""} ${P ? "holiday" : ""}`,
|
|
2040
2040
|
style: { width: b, minWidth: b }
|
|
2041
2041
|
},
|
|
2042
2042
|
k
|
|
@@ -2050,14 +2050,14 @@ const Yr = ({
|
|
|
2050
2050
|
getTaskPosition: q
|
|
2051
2051
|
}
|
|
2052
2052
|
),
|
|
2053
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-tasks", style: { width:
|
|
2054
|
-
const k = pe(h),
|
|
2053
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-tasks", style: { width: Y }, children: u.map((h) => {
|
|
2054
|
+
const k = pe(h), F = w ? g?.get(h.id) : void 0, P = F ? M(F) : void 0;
|
|
2055
2055
|
return /* @__PURE__ */ e.jsxs(
|
|
2056
2056
|
"div",
|
|
2057
2057
|
{
|
|
2058
2058
|
className: "gantt-timeline-row",
|
|
2059
2059
|
children: [
|
|
2060
|
-
|
|
2060
|
+
F && P && /* @__PURE__ */ e.jsx(
|
|
2061
2061
|
"div",
|
|
2062
2062
|
{
|
|
2063
2063
|
className: `gantt-baseline-bar ${h.type === "milestone" ? "milestone" : ""}`,
|
|
@@ -2065,7 +2065,7 @@ const Yr = ({
|
|
|
2065
2065
|
left: `${P.left}px`,
|
|
2066
2066
|
width: `${P.width}px`
|
|
2067
2067
|
},
|
|
2068
|
-
title: `Baseline: ${
|
|
2068
|
+
title: `Baseline: ${F.start.toLocaleDateString()} - ${F.end.toLocaleDateString()}`
|
|
2069
2069
|
}
|
|
2070
2070
|
),
|
|
2071
2071
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2073,13 +2073,13 @@ const Yr = ({
|
|
|
2073
2073
|
{
|
|
2074
2074
|
task: h,
|
|
2075
2075
|
position: k,
|
|
2076
|
-
selected:
|
|
2076
|
+
selected: x === h.id,
|
|
2077
2077
|
dragging: S.taskId === h.id,
|
|
2078
2078
|
dragDeltaX: S.dragDeltaX,
|
|
2079
2079
|
dragType: S.type,
|
|
2080
|
-
onClick: () =>
|
|
2081
|
-
onDragStart: (
|
|
2082
|
-
|
|
2080
|
+
onClick: () => m(h.id),
|
|
2081
|
+
onDragStart: (A, oe, ee) => {
|
|
2082
|
+
L(h.id, A, oe, ee), i(h.id, A, oe);
|
|
2083
2083
|
},
|
|
2084
2084
|
readonly: r.readonly
|
|
2085
2085
|
}
|
|
@@ -2098,16 +2098,16 @@ const Yr = ({
|
|
|
2098
2098
|
er.displayName = "Timeline";
|
|
2099
2099
|
const tr = Ot((t, o) => /* @__PURE__ */ e.jsx("div", { className: "gantt-chart-wrapper", style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ e.jsx(er, { ...t, ref: o }) }));
|
|
2100
2100
|
tr.displayName = "Chart";
|
|
2101
|
-
const { Search: zr } =
|
|
2102
|
-
const [l, r] =
|
|
2101
|
+
const { Search: zr } = He, Br = ({ onFilterChange: t, owners: o = [], uiConfig: a = {} }) => {
|
|
2102
|
+
const [l, r] = z({
|
|
2103
2103
|
searchText: "",
|
|
2104
2104
|
status: "all",
|
|
2105
2105
|
priority: "all",
|
|
2106
2106
|
owner: ""
|
|
2107
|
-
}),
|
|
2107
|
+
}), x = (s) => {
|
|
2108
2108
|
const y = { ...l, ...s };
|
|
2109
2109
|
r(y), t(y);
|
|
2110
|
-
},
|
|
2110
|
+
}, m = () => {
|
|
2111
2111
|
const s = {
|
|
2112
2112
|
searchText: "",
|
|
2113
2113
|
status: "all",
|
|
@@ -2122,7 +2122,7 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2122
2122
|
{
|
|
2123
2123
|
placeholder: a.searchPlaceholder || "Search stages...",
|
|
2124
2124
|
value: l.searchText,
|
|
2125
|
-
onChange: (s) =>
|
|
2125
|
+
onChange: (s) => x({ searchText: s.target.value }),
|
|
2126
2126
|
allowClear: !0,
|
|
2127
2127
|
className: "gantt-search-antd",
|
|
2128
2128
|
style: { width: 250 }
|
|
@@ -2130,10 +2130,10 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2130
2130
|
) }),
|
|
2131
2131
|
/* @__PURE__ */ e.jsxs("div", { className: "gantt-filter-right", children: [
|
|
2132
2132
|
/* @__PURE__ */ e.jsx(
|
|
2133
|
-
|
|
2133
|
+
xe,
|
|
2134
2134
|
{
|
|
2135
2135
|
value: l.status,
|
|
2136
|
-
onChange: (s) =>
|
|
2136
|
+
onChange: (s) => x({ status: s }),
|
|
2137
2137
|
className: "gantt-filter-select-antd",
|
|
2138
2138
|
style: { width: 140 },
|
|
2139
2139
|
options: [
|
|
@@ -2145,10 +2145,10 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2145
2145
|
}
|
|
2146
2146
|
),
|
|
2147
2147
|
/* @__PURE__ */ e.jsx(
|
|
2148
|
-
|
|
2148
|
+
xe,
|
|
2149
2149
|
{
|
|
2150
2150
|
value: l.priority,
|
|
2151
|
-
onChange: (s) =>
|
|
2151
|
+
onChange: (s) => x({ priority: s }),
|
|
2152
2152
|
className: "gantt-filter-select-antd",
|
|
2153
2153
|
style: { width: 130 },
|
|
2154
2154
|
options: [
|
|
@@ -2160,10 +2160,10 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2160
2160
|
}
|
|
2161
2161
|
),
|
|
2162
2162
|
/* @__PURE__ */ e.jsx(
|
|
2163
|
-
|
|
2163
|
+
xe,
|
|
2164
2164
|
{
|
|
2165
2165
|
value: l.owner || void 0,
|
|
2166
|
-
onChange: (s) =>
|
|
2166
|
+
onChange: (s) => x({ owner: s || "" }),
|
|
2167
2167
|
className: "gantt-filter-select-antd",
|
|
2168
2168
|
style: { width: 130 },
|
|
2169
2169
|
placeholder: a.allOwnersText || "All Owners",
|
|
@@ -2180,59 +2180,59 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2180
2180
|
type: "default",
|
|
2181
2181
|
danger: !0,
|
|
2182
2182
|
icon: /* @__PURE__ */ e.jsx(de, { icon: mr }),
|
|
2183
|
-
onClick:
|
|
2183
|
+
onClick: m,
|
|
2184
2184
|
className: "gantt-filter-clear-antd",
|
|
2185
2185
|
children: a.clearFiltersText || "Clear"
|
|
2186
2186
|
}
|
|
2187
2187
|
)
|
|
2188
2188
|
] })
|
|
2189
2189
|
] }) });
|
|
2190
|
-
},
|
|
2190
|
+
}, We = (t, o) => t ? typeof t == "string" ? /* @__PURE__ */ e.jsx(de, { icon: o }) : t : /* @__PURE__ */ e.jsx(de, { icon: o }), Wr = ({
|
|
2191
2191
|
zoomLevel: t,
|
|
2192
2192
|
setZoomLevel: o,
|
|
2193
2193
|
onExport: a,
|
|
2194
2194
|
onFilterChange: l,
|
|
2195
2195
|
owners: r,
|
|
2196
|
-
onAddTask:
|
|
2197
|
-
uiConfig:
|
|
2196
|
+
onAddTask: x,
|
|
2197
|
+
uiConfig: m,
|
|
2198
2198
|
iconConfig: i = {},
|
|
2199
2199
|
styleConfig: s
|
|
2200
2200
|
}) => {
|
|
2201
|
-
const y =
|
|
2201
|
+
const y = nt(s), c = m.showZoomButtons !== !1, g = m.showExportButtons !== !1, j = c && g;
|
|
2202
2202
|
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
|
|
2203
2203
|
/* @__PURE__ */ e.jsxs("div", { className: "gantt-toolbar", children: [
|
|
2204
|
-
/* @__PURE__ */ e.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ e.jsx(Rt, { size: 8, children:
|
|
2204
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ e.jsx(Rt, { size: 8, children: m.showAddTaskButton !== !1 && /* @__PURE__ */ e.jsx(
|
|
2205
2205
|
he,
|
|
2206
2206
|
{
|
|
2207
2207
|
type: "primary",
|
|
2208
|
-
icon:
|
|
2209
|
-
onClick: () =>
|
|
2208
|
+
icon: We(i.addTask, Ct),
|
|
2209
|
+
onClick: () => x?.(),
|
|
2210
2210
|
style: y.buttonPrimary,
|
|
2211
|
-
children:
|
|
2211
|
+
children: m.addTaskButtonText || "New Stage"
|
|
2212
2212
|
}
|
|
2213
2213
|
) }) }),
|
|
2214
2214
|
/* @__PURE__ */ e.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ e.jsxs(Rt, { size: 4, children: [
|
|
2215
2215
|
c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2216
|
-
/* @__PURE__ */ e.jsx(
|
|
2216
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.zoomOutTooltip || "Zoom Out", children: /* @__PURE__ */ e.jsx(
|
|
2217
2217
|
he,
|
|
2218
2218
|
{
|
|
2219
|
-
icon:
|
|
2219
|
+
icon: We(i.zoomOut, xr),
|
|
2220
2220
|
onClick: () => o(Math.max(0.5, t - 0.25)),
|
|
2221
2221
|
style: y.buttonSecondary
|
|
2222
2222
|
}
|
|
2223
2223
|
) }),
|
|
2224
|
-
/* @__PURE__ */ e.jsx(
|
|
2224
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ e.jsx(
|
|
2225
2225
|
he,
|
|
2226
2226
|
{
|
|
2227
|
-
icon:
|
|
2227
|
+
icon: We(i.zoomIn, yr),
|
|
2228
2228
|
onClick: () => o(Math.min(2, t + 0.25)),
|
|
2229
2229
|
style: y.buttonSecondary
|
|
2230
2230
|
}
|
|
2231
2231
|
) }),
|
|
2232
|
-
/* @__PURE__ */ e.jsx(
|
|
2232
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ e.jsx(
|
|
2233
2233
|
he,
|
|
2234
2234
|
{
|
|
2235
|
-
icon:
|
|
2235
|
+
icon: We(i.resetZoom, qt),
|
|
2236
2236
|
onClick: () => o(1),
|
|
2237
2237
|
style: y.buttonSecondary
|
|
2238
2238
|
}
|
|
@@ -2240,34 +2240,34 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2240
2240
|
] }),
|
|
2241
2241
|
j && /* @__PURE__ */ e.jsx(Ut, { type: "vertical", style: { height: 24, margin: "0 4px" } }),
|
|
2242
2242
|
g && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2243
|
-
/* @__PURE__ */ e.jsx(
|
|
2243
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.exportCSVTooltip || "Export to CSV", children: /* @__PURE__ */ e.jsx(
|
|
2244
2244
|
he,
|
|
2245
2245
|
{
|
|
2246
|
-
icon:
|
|
2246
|
+
icon: We(i.exportCSV, gr),
|
|
2247
2247
|
onClick: () => a("csv"),
|
|
2248
2248
|
style: y.buttonSecondary
|
|
2249
2249
|
}
|
|
2250
2250
|
) }),
|
|
2251
|
-
/* @__PURE__ */ e.jsx(
|
|
2251
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ e.jsx(
|
|
2252
2252
|
he,
|
|
2253
2253
|
{
|
|
2254
|
-
icon:
|
|
2254
|
+
icon: We(i.exportExcel, br),
|
|
2255
2255
|
onClick: () => a("excel"),
|
|
2256
2256
|
style: y.buttonSecondary
|
|
2257
2257
|
}
|
|
2258
2258
|
) }),
|
|
2259
|
-
/* @__PURE__ */ e.jsx(
|
|
2259
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ e.jsx(
|
|
2260
2260
|
he,
|
|
2261
2261
|
{
|
|
2262
|
-
icon:
|
|
2262
|
+
icon: We(i.exportJSON, wr),
|
|
2263
2263
|
onClick: () => a("json"),
|
|
2264
2264
|
style: y.buttonSecondary
|
|
2265
2265
|
}
|
|
2266
2266
|
) }),
|
|
2267
|
-
/* @__PURE__ */ e.jsx(
|
|
2267
|
+
/* @__PURE__ */ e.jsx(_e, { title: m.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ e.jsx(
|
|
2268
2268
|
he,
|
|
2269
2269
|
{
|
|
2270
|
-
icon:
|
|
2270
|
+
icon: We(i.exportPDF, vr),
|
|
2271
2271
|
onClick: () => a("pdf"),
|
|
2272
2272
|
style: y.buttonSecondary
|
|
2273
2273
|
}
|
|
@@ -2275,17 +2275,17 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2275
2275
|
] })
|
|
2276
2276
|
] }) })
|
|
2277
2277
|
] }),
|
|
2278
|
-
|
|
2278
|
+
m.showFilterSearch !== !1 && /* @__PURE__ */ e.jsx(
|
|
2279
2279
|
Br,
|
|
2280
2280
|
{
|
|
2281
2281
|
onFilterChange: l,
|
|
2282
2282
|
owners: r,
|
|
2283
|
-
uiConfig:
|
|
2283
|
+
uiConfig: m
|
|
2284
2284
|
}
|
|
2285
2285
|
)
|
|
2286
2286
|
] });
|
|
2287
|
-
}, { Option:
|
|
2288
|
-
const [
|
|
2287
|
+
}, { Option: et } = xe, { TextArea: Hr } = He, Ur = ({ onCreateTask: t, onClose: o, uiConfig: a = {}, parentId: l, parentTaskName: r, styleConfig: x }) => {
|
|
2288
|
+
const [m] = le.useForm(), i = nt(x), s = (y) => {
|
|
2289
2289
|
const c = y.start.toDate(), g = new Date(c);
|
|
2290
2290
|
g.setDate(g.getDate() + (y.duration || 1)), t({
|
|
2291
2291
|
text: y.text,
|
|
@@ -2308,7 +2308,7 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2308
2308
|
title: l ? (a.taskCreatorTitle || "Create Checklist") + (r ? ` for "${r}"` : "") : a.taskCreatorTitle || "Create New Stage",
|
|
2309
2309
|
open: !0,
|
|
2310
2310
|
onCancel: o,
|
|
2311
|
-
onOk: () =>
|
|
2311
|
+
onOk: () => m.submit(),
|
|
2312
2312
|
okText: a.taskCreatorOkText || "Create Stage",
|
|
2313
2313
|
cancelText: a.taskCreatorCancelText || "Cancel",
|
|
2314
2314
|
width: 600,
|
|
@@ -2320,9 +2320,9 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2320
2320
|
okButtonProps: { style: i.buttonPrimary },
|
|
2321
2321
|
cancelButtonProps: { style: i.buttonSecondary },
|
|
2322
2322
|
children: /* @__PURE__ */ e.jsxs(
|
|
2323
|
-
|
|
2323
|
+
le,
|
|
2324
2324
|
{
|
|
2325
|
-
form:
|
|
2325
|
+
form: m,
|
|
2326
2326
|
layout: "vertical",
|
|
2327
2327
|
onFinish: s,
|
|
2328
2328
|
initialValues: {
|
|
@@ -2335,43 +2335,43 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2335
2335
|
},
|
|
2336
2336
|
children: [
|
|
2337
2337
|
/* @__PURE__ */ e.jsx(
|
|
2338
|
-
|
|
2338
|
+
le.Item,
|
|
2339
2339
|
{
|
|
2340
2340
|
name: "text",
|
|
2341
2341
|
label: a.taskNameLabel || "Stage Name",
|
|
2342
2342
|
rules: [{ required: !0, message: a.taskNameRequired || "Please enter stage name" }],
|
|
2343
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2343
|
+
children: /* @__PURE__ */ e.jsx(He, { placeholder: a.taskNamePlaceholder || "Enter stage name", autoFocus: !0, style: i.input })
|
|
2344
2344
|
}
|
|
2345
2345
|
),
|
|
2346
2346
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2347
|
-
/* @__PURE__ */ e.jsx(
|
|
2348
|
-
/* @__PURE__ */ e.jsx(
|
|
2349
|
-
/* @__PURE__ */ e.jsx(
|
|
2350
|
-
/* @__PURE__ */ e.jsx(
|
|
2347
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "type", label: a.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(xe, { style: i.input, children: [
|
|
2348
|
+
/* @__PURE__ */ e.jsx(et, { value: "task", children: a.taskTypeOptions?.task || "Stage" }),
|
|
2349
|
+
/* @__PURE__ */ e.jsx(et, { value: "milestone", children: a.taskTypeOptions?.milestone || "Milestone" }),
|
|
2350
|
+
/* @__PURE__ */ e.jsx(et, { value: "project", children: a.taskTypeOptions?.project || "Project" })
|
|
2351
2351
|
] }) }),
|
|
2352
|
-
/* @__PURE__ */ e.jsx(
|
|
2353
|
-
/* @__PURE__ */ e.jsx(
|
|
2354
|
-
/* @__PURE__ */ e.jsx(
|
|
2355
|
-
/* @__PURE__ */ e.jsx(
|
|
2352
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "priority", label: a.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(xe, { style: i.input, children: [
|
|
2353
|
+
/* @__PURE__ */ e.jsx(et, { value: "low", children: a.priorityOptions?.low || "Low" }),
|
|
2354
|
+
/* @__PURE__ */ e.jsx(et, { value: "medium", children: a.priorityOptions?.medium || "Medium" }),
|
|
2355
|
+
/* @__PURE__ */ e.jsx(et, { value: "high", children: a.priorityOptions?.high || "High" })
|
|
2356
2356
|
] }) })
|
|
2357
2357
|
] }),
|
|
2358
2358
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2359
|
-
/* @__PURE__ */ e.jsx(
|
|
2360
|
-
/* @__PURE__ */ e.jsx(
|
|
2359
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "start", label: a.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Vt, { style: { width: "100%", ...i.input } }) }),
|
|
2360
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "duration", label: a.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Ye, { min: 0, style: { width: "100%", ...i.input } }) })
|
|
2361
2361
|
] }),
|
|
2362
2362
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2363
|
-
/* @__PURE__ */ e.jsx(
|
|
2364
|
-
/* @__PURE__ */ e.jsx(
|
|
2363
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "color", label: a.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Xt, { showText: !0 }) }),
|
|
2364
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "progress", label: a.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Ye, { min: 0, max: 100, style: { width: "100%", ...i.input } }) })
|
|
2365
2365
|
] }),
|
|
2366
|
-
/* @__PURE__ */ e.jsx(
|
|
2367
|
-
/* @__PURE__ */ e.jsx(
|
|
2366
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "owner", label: a.ownerLabel || "Owner", children: /* @__PURE__ */ e.jsx(He, { placeholder: a.ownerPlaceholder || "Assign to...", style: i.input }) }),
|
|
2367
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "details", label: a.detailsLabel || "Details", children: /* @__PURE__ */ e.jsx(Hr, { placeholder: a.detailsPlaceholder || "Add stage description...", rows: 3, style: i.input }) })
|
|
2368
2368
|
]
|
|
2369
2369
|
}
|
|
2370
2370
|
)
|
|
2371
2371
|
}
|
|
2372
2372
|
);
|
|
2373
|
-
}, { Option:
|
|
2374
|
-
const [
|
|
2373
|
+
}, { Option: tt } = xe, { TextArea: Vr } = He, { confirm: Xr } = wt, Jr = ({ task: t, onUpdate: o, onDelete: a, onClose: l, uiConfig: r = {}, styleConfig: x }) => {
|
|
2374
|
+
const [m] = le.useForm(), i = nt(x), s = (c) => {
|
|
2375
2375
|
const g = c.start.toDate(), j = new Date(g);
|
|
2376
2376
|
j.setDate(j.getDate() + (c.duration || 1)), o({
|
|
2377
2377
|
...t,
|
|
@@ -2408,7 +2408,7 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2408
2408
|
footer: [
|
|
2409
2409
|
/* @__PURE__ */ e.jsx(he, { danger: !0, onClick: y, style: { float: "left", ...i.buttonDanger }, children: r.taskEditorDeleteText || "Delete" }, "delete"),
|
|
2410
2410
|
/* @__PURE__ */ e.jsx(he, { onClick: l, style: i.buttonSecondary, children: r.taskEditorCancelText || "Cancel" }, "cancel"),
|
|
2411
|
-
/* @__PURE__ */ e.jsx(he, { type: "primary", onClick: () =>
|
|
2411
|
+
/* @__PURE__ */ e.jsx(he, { type: "primary", onClick: () => m.submit(), style: i.buttonPrimary, children: r.taskEditorSaveText || "Save Changes" }, "submit")
|
|
2412
2412
|
],
|
|
2413
2413
|
width: 600,
|
|
2414
2414
|
className: "gantt-modal-antd",
|
|
@@ -2417,9 +2417,9 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2417
2417
|
header: { borderBottom: `1px solid ${i.modal?.borderColor || "#f0f0f0"}`, marginBottom: 16 }
|
|
2418
2418
|
},
|
|
2419
2419
|
children: /* @__PURE__ */ e.jsxs(
|
|
2420
|
-
|
|
2420
|
+
le,
|
|
2421
2421
|
{
|
|
2422
|
-
form:
|
|
2422
|
+
form: m,
|
|
2423
2423
|
layout: "vertical",
|
|
2424
2424
|
onFinish: s,
|
|
2425
2425
|
initialValues: {
|
|
@@ -2435,79 +2435,79 @@ const { Search: zr } = Ue, Br = ({ onFilterChange: t, owners: o = [], uiConfig:
|
|
|
2435
2435
|
},
|
|
2436
2436
|
children: [
|
|
2437
2437
|
/* @__PURE__ */ e.jsx(
|
|
2438
|
-
|
|
2438
|
+
le.Item,
|
|
2439
2439
|
{
|
|
2440
2440
|
name: "text",
|
|
2441
2441
|
label: r.taskNameLabel || "Stage Name",
|
|
2442
2442
|
rules: [{ required: !0, message: r.taskNameRequired || "Please enter stage name" }],
|
|
2443
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2443
|
+
children: /* @__PURE__ */ e.jsx(He, { placeholder: r.taskNamePlaceholder || "Enter stage name", style: i.input })
|
|
2444
2444
|
}
|
|
2445
2445
|
),
|
|
2446
2446
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2447
|
-
/* @__PURE__ */ e.jsx(
|
|
2448
|
-
/* @__PURE__ */ e.jsx(
|
|
2449
|
-
/* @__PURE__ */ e.jsx(
|
|
2450
|
-
/* @__PURE__ */ e.jsx(
|
|
2447
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(xe, { style: i.input, children: [
|
|
2448
|
+
/* @__PURE__ */ e.jsx(tt, { value: "task", children: r.taskTypeOptions?.task || "Stage" }),
|
|
2449
|
+
/* @__PURE__ */ e.jsx(tt, { value: "milestone", children: r.taskTypeOptions?.milestone || "Milestone" }),
|
|
2450
|
+
/* @__PURE__ */ e.jsx(tt, { value: "project", children: r.taskTypeOptions?.project || "Project" })
|
|
2451
2451
|
] }) }),
|
|
2452
|
-
/* @__PURE__ */ e.jsx(
|
|
2453
|
-
/* @__PURE__ */ e.jsx(
|
|
2454
|
-
/* @__PURE__ */ e.jsx(
|
|
2455
|
-
/* @__PURE__ */ e.jsx(
|
|
2452
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(xe, { style: i.input, children: [
|
|
2453
|
+
/* @__PURE__ */ e.jsx(tt, { value: "low", children: r.priorityOptions?.low || "Low" }),
|
|
2454
|
+
/* @__PURE__ */ e.jsx(tt, { value: "medium", children: r.priorityOptions?.medium || "Medium" }),
|
|
2455
|
+
/* @__PURE__ */ e.jsx(tt, { value: "high", children: r.priorityOptions?.high || "High" })
|
|
2456
2456
|
] }) })
|
|
2457
2457
|
] }),
|
|
2458
2458
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2459
|
-
/* @__PURE__ */ e.jsx(
|
|
2460
|
-
/* @__PURE__ */ e.jsx(
|
|
2459
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "start", label: r.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Vt, { style: { width: "100%", ...i.input } }) }),
|
|
2460
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "duration", label: r.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Ye, { min: 0, style: { width: "100%", ...i.input } }) })
|
|
2461
2461
|
] }),
|
|
2462
2462
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2463
|
-
/* @__PURE__ */ e.jsx(
|
|
2464
|
-
/* @__PURE__ */ e.jsx(
|
|
2463
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "color", label: r.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Xt, { showText: !0 }) }),
|
|
2464
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "progress", label: r.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(Ye, { min: 0, max: 100, style: { width: "100%", ...i.input } }) })
|
|
2465
2465
|
] }),
|
|
2466
|
-
/* @__PURE__ */ e.jsx(
|
|
2467
|
-
/* @__PURE__ */ e.jsx(
|
|
2466
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "owner", label: r.ownerLabel || "Owner", children: /* @__PURE__ */ e.jsx(He, { placeholder: r.ownerPlaceholder || "Assign to...", style: i.input }) }),
|
|
2467
|
+
/* @__PURE__ */ e.jsx(le.Item, { name: "details", label: r.detailsLabel || "Details", children: /* @__PURE__ */ e.jsx(Vr, { placeholder: r.detailsPlaceholder || "Add stage description...", rows: 3, style: i.input }) })
|
|
2468
2468
|
]
|
|
2469
2469
|
}
|
|
2470
2470
|
)
|
|
2471
2471
|
}
|
|
2472
2472
|
);
|
|
2473
|
-
}, { Title:
|
|
2473
|
+
}, { Title: ct, Text: Xe, Paragraph: qr } = Ht, { Option: Ne } = xe, Gr = ({
|
|
2474
2474
|
task: t,
|
|
2475
2475
|
allTasks: o,
|
|
2476
2476
|
links: a,
|
|
2477
2477
|
onAddDependency: l,
|
|
2478
2478
|
onRemoveDependency: r,
|
|
2479
|
-
onTaskUpdate:
|
|
2480
|
-
onClose:
|
|
2479
|
+
onTaskUpdate: x,
|
|
2480
|
+
onClose: m,
|
|
2481
2481
|
styleConfig: i
|
|
2482
2482
|
}) => {
|
|
2483
|
-
const s =
|
|
2483
|
+
const s = nt(i), [y, c] = z(""), [g, j] = z("e2s"), [u, p] = z(0), [b, w] = z("day"), [S, L] = z(t.duration), [$, B] = z(""), ne = a.filter((D) => D.target === t.id), X = o.filter((D) => D.id !== t.id && D.id !== t.parent), pe = () => {
|
|
2484
2484
|
if (y) {
|
|
2485
2485
|
const D = Pt(u, b);
|
|
2486
|
-
if (S !== t.duration &&
|
|
2487
|
-
const
|
|
2488
|
-
|
|
2486
|
+
if (S !== t.duration && x) {
|
|
2487
|
+
const W = fe(new Date(t.start), S, "day");
|
|
2488
|
+
x({
|
|
2489
2489
|
...t,
|
|
2490
2490
|
duration: S,
|
|
2491
|
-
end:
|
|
2491
|
+
end: W
|
|
2492
2492
|
});
|
|
2493
2493
|
}
|
|
2494
2494
|
l(y, t.id, g, D), c(""), p(0), w("day");
|
|
2495
2495
|
}
|
|
2496
|
-
},
|
|
2497
|
-
if (
|
|
2498
|
-
const D = Pr(
|
|
2496
|
+
}, M = () => {
|
|
2497
|
+
if (!$.trim()) return;
|
|
2498
|
+
const D = Pr($.trim());
|
|
2499
2499
|
if (!D) {
|
|
2500
2500
|
alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
2501
2501
|
Example: 3FS+10d`);
|
|
2502
2502
|
return;
|
|
2503
2503
|
}
|
|
2504
|
-
const
|
|
2505
|
-
if (!
|
|
2504
|
+
const W = D.taskNumber - 1, ae = o[W];
|
|
2505
|
+
if (!ae) {
|
|
2506
2506
|
alert(`Task ${D.taskNumber} not found`);
|
|
2507
2507
|
return;
|
|
2508
2508
|
}
|
|
2509
2509
|
const J = Cr(D.type), me = Pt(D.lag, D.lagUnit);
|
|
2510
|
-
l(
|
|
2510
|
+
l(ae.id, t.id, J, me), B("");
|
|
2511
2511
|
}, q = (D) => {
|
|
2512
2512
|
switch (D) {
|
|
2513
2513
|
case "e2s":
|
|
@@ -2519,7 +2519,7 @@ Example: 3FS+10d`);
|
|
|
2519
2519
|
case "s2e":
|
|
2520
2520
|
return "Start-to-Finish (SF)";
|
|
2521
2521
|
}
|
|
2522
|
-
},
|
|
2522
|
+
}, H = (D) => {
|
|
2523
2523
|
switch (D) {
|
|
2524
2524
|
case "e2s":
|
|
2525
2525
|
return "blue";
|
|
@@ -2534,9 +2534,9 @@ Example: 3FS+10d`);
|
|
|
2534
2534
|
return /* @__PURE__ */ e.jsx(
|
|
2535
2535
|
wt,
|
|
2536
2536
|
{
|
|
2537
|
-
title: /* @__PURE__ */ e.jsx(
|
|
2537
|
+
title: /* @__PURE__ */ e.jsx(ct, { level: 4, style: { margin: 0, color: s.font?.color }, children: "Dependency Editor" }),
|
|
2538
2538
|
open: !0,
|
|
2539
|
-
onCancel:
|
|
2539
|
+
onCancel: m,
|
|
2540
2540
|
footer: null,
|
|
2541
2541
|
width: 700,
|
|
2542
2542
|
styles: {
|
|
@@ -2557,15 +2557,15 @@ Example: 3FS+10d`);
|
|
|
2557
2557
|
/* @__PURE__ */ e.jsx(
|
|
2558
2558
|
_t,
|
|
2559
2559
|
{
|
|
2560
|
-
title: /* @__PURE__ */ e.jsx(
|
|
2560
|
+
title: /* @__PURE__ */ e.jsx(ct, { level: 5, style: { margin: 0, fontSize: 14, color: s.font?.color }, children: "Settings" }),
|
|
2561
2561
|
size: "small",
|
|
2562
2562
|
style: { flex: 1, ...s.modal },
|
|
2563
2563
|
headStyle: { borderBottom: `1px solid ${s.modal?.borderColor || "#f0f0f0"}` },
|
|
2564
2564
|
children: /* @__PURE__ */ e.jsxs(Rt, { direction: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
2565
2565
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2566
|
-
/* @__PURE__ */ e.jsx(
|
|
2566
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { display: "block", marginBottom: 8, fontSize: 13, color: s.font?.color }, children: "Predecessor" }),
|
|
2567
2567
|
/* @__PURE__ */ e.jsx(
|
|
2568
|
-
|
|
2568
|
+
xe,
|
|
2569
2569
|
{
|
|
2570
2570
|
showSearch: !0,
|
|
2571
2571
|
placeholder: "Select a task",
|
|
@@ -2573,7 +2573,7 @@ Example: 3FS+10d`);
|
|
|
2573
2573
|
style: { width: "100%", ...s.input },
|
|
2574
2574
|
value: y,
|
|
2575
2575
|
onChange: c,
|
|
2576
|
-
children:
|
|
2576
|
+
children: X.map((D) => /* @__PURE__ */ e.jsxs(Ne, { value: D.id, children: [
|
|
2577
2577
|
"[",
|
|
2578
2578
|
o.indexOf(D) + 1,
|
|
2579
2579
|
"] ",
|
|
@@ -2583,27 +2583,27 @@ Example: 3FS+10d`);
|
|
|
2583
2583
|
)
|
|
2584
2584
|
] }),
|
|
2585
2585
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2586
|
-
/* @__PURE__ */ e.jsx(
|
|
2586
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { display: "block", marginBottom: 8, fontSize: 13, color: s.font?.color }, children: "Type" }),
|
|
2587
2587
|
/* @__PURE__ */ e.jsxs(
|
|
2588
|
-
|
|
2588
|
+
xe,
|
|
2589
2589
|
{
|
|
2590
2590
|
style: { width: "100%", ...s.input },
|
|
2591
2591
|
value: g,
|
|
2592
2592
|
onChange: j,
|
|
2593
2593
|
children: [
|
|
2594
|
-
/* @__PURE__ */ e.jsx(
|
|
2595
|
-
/* @__PURE__ */ e.jsx(
|
|
2596
|
-
/* @__PURE__ */ e.jsx(
|
|
2597
|
-
/* @__PURE__ */ e.jsx(
|
|
2594
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "e2s", children: "Finish-to-Start (FS)" }),
|
|
2595
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "s2s", children: "Start-to-Start (SS)" }),
|
|
2596
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "e2e", children: "Finish-to-Finish (FF)" }),
|
|
2597
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "s2e", children: "Start-to-Finish (SF)" })
|
|
2598
2598
|
]
|
|
2599
2599
|
}
|
|
2600
2600
|
)
|
|
2601
2601
|
] }),
|
|
2602
2602
|
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 12 }, children: [
|
|
2603
2603
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
2604
|
-
/* @__PURE__ */ e.jsx(
|
|
2604
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { display: "block", marginBottom: 8, fontSize: 13, color: s.font?.color }, children: "Lag/Lead" }),
|
|
2605
2605
|
/* @__PURE__ */ e.jsx(
|
|
2606
|
-
|
|
2606
|
+
Ye,
|
|
2607
2607
|
{
|
|
2608
2608
|
style: { width: "100%", ...s.input },
|
|
2609
2609
|
value: u,
|
|
@@ -2612,32 +2612,32 @@ Example: 3FS+10d`);
|
|
|
2612
2612
|
)
|
|
2613
2613
|
] }),
|
|
2614
2614
|
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
2615
|
-
/* @__PURE__ */ e.jsx(
|
|
2615
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { display: "block", marginBottom: 8, fontSize: 13, color: s.font?.color }, children: "Units" }),
|
|
2616
2616
|
/* @__PURE__ */ e.jsxs(
|
|
2617
|
-
|
|
2617
|
+
xe,
|
|
2618
2618
|
{
|
|
2619
2619
|
style: { width: "100%", ...s.input },
|
|
2620
2620
|
value: b,
|
|
2621
2621
|
onChange: w,
|
|
2622
2622
|
children: [
|
|
2623
|
-
/* @__PURE__ */ e.jsx(
|
|
2624
|
-
/* @__PURE__ */ e.jsx(
|
|
2625
|
-
/* @__PURE__ */ e.jsx(
|
|
2626
|
-
/* @__PURE__ */ e.jsx(
|
|
2623
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "day", children: "Days" }),
|
|
2624
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "hour", children: "Hours" }),
|
|
2625
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "week", children: "Weeks" }),
|
|
2626
|
+
/* @__PURE__ */ e.jsx(Ne, { value: "month", children: "Months" })
|
|
2627
2627
|
]
|
|
2628
2628
|
}
|
|
2629
2629
|
)
|
|
2630
2630
|
] })
|
|
2631
2631
|
] }),
|
|
2632
2632
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2633
|
-
/* @__PURE__ */ e.jsx(
|
|
2633
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { display: "block", marginBottom: 8, fontSize: 13, color: s.font?.color }, children: "Duration (days)" }),
|
|
2634
2634
|
/* @__PURE__ */ e.jsx(
|
|
2635
|
-
|
|
2635
|
+
Ye,
|
|
2636
2636
|
{
|
|
2637
2637
|
style: { width: "100%", ...s.input },
|
|
2638
2638
|
min: 1,
|
|
2639
2639
|
value: S,
|
|
2640
|
-
onChange: (D) =>
|
|
2640
|
+
onChange: (D) => L(D || 1)
|
|
2641
2641
|
}
|
|
2642
2642
|
)
|
|
2643
2643
|
] }),
|
|
@@ -2663,7 +2663,7 @@ Example: 3FS+10d`);
|
|
|
2663
2663
|
/* @__PURE__ */ e.jsxs(
|
|
2664
2664
|
_t,
|
|
2665
2665
|
{
|
|
2666
|
-
title: /* @__PURE__ */ e.jsx(
|
|
2666
|
+
title: /* @__PURE__ */ e.jsx(ct, { level: 5, style: { margin: 0, fontSize: 14, color: s.font?.color }, children: "Quick Add" }),
|
|
2667
2667
|
size: "small",
|
|
2668
2668
|
style: { width: 250, ...s.modal },
|
|
2669
2669
|
headStyle: { borderBottom: `1px solid ${s.modal?.borderColor || "#f0f0f0"}` },
|
|
@@ -2674,12 +2674,12 @@ Example: 3FS+10d`);
|
|
|
2674
2674
|
"Example: 3FS+10d"
|
|
2675
2675
|
] }),
|
|
2676
2676
|
/* @__PURE__ */ e.jsx(
|
|
2677
|
-
|
|
2677
|
+
He,
|
|
2678
2678
|
{
|
|
2679
2679
|
placeholder: "e.g. 5FS+2d",
|
|
2680
|
-
value:
|
|
2681
|
-
onChange: (D) =>
|
|
2682
|
-
onPressEnter:
|
|
2680
|
+
value: $,
|
|
2681
|
+
onChange: (D) => B(D.target.value),
|
|
2682
|
+
onPressEnter: M,
|
|
2683
2683
|
style: {
|
|
2684
2684
|
marginBottom: 16,
|
|
2685
2685
|
height: 40,
|
|
@@ -2691,7 +2691,7 @@ Example: 3FS+10d`);
|
|
|
2691
2691
|
he,
|
|
2692
2692
|
{
|
|
2693
2693
|
block: !0,
|
|
2694
|
-
onClick:
|
|
2694
|
+
onClick: M,
|
|
2695
2695
|
style: {
|
|
2696
2696
|
height: 40,
|
|
2697
2697
|
...s.buttonSecondary
|
|
@@ -2705,14 +2705,14 @@ Example: 3FS+10d`);
|
|
|
2705
2705
|
] }),
|
|
2706
2706
|
/* @__PURE__ */ e.jsx(Ut, { style: { margin: "0 0 24px 0", borderColor: s.modal?.borderColor } }),
|
|
2707
2707
|
/* @__PURE__ */ e.jsxs("div", { style: { maxHeight: 300, overflowY: "auto" }, children: [
|
|
2708
|
-
/* @__PURE__ */ e.jsx(
|
|
2708
|
+
/* @__PURE__ */ e.jsx(ct, { level: 5, style: { fontSize: 14, marginBottom: 16, color: s.font?.color }, children: "Current Dependencies" }),
|
|
2709
2709
|
/* @__PURE__ */ e.jsx(
|
|
2710
2710
|
Ft,
|
|
2711
2711
|
{
|
|
2712
|
-
dataSource:
|
|
2713
|
-
locale: { emptyText: /* @__PURE__ */ e.jsx(
|
|
2712
|
+
dataSource: ne,
|
|
2713
|
+
locale: { emptyText: /* @__PURE__ */ e.jsx(Xe, { type: "secondary", style: { color: s.font?.color, opacity: 0.5 }, children: "No dependencies added yet." }) },
|
|
2714
2714
|
renderItem: (D) => {
|
|
2715
|
-
const
|
|
2715
|
+
const W = o.find((ae) => ae.id === D.source);
|
|
2716
2716
|
return /* @__PURE__ */ e.jsx(
|
|
2717
2717
|
Ft.Item,
|
|
2718
2718
|
{
|
|
@@ -2749,10 +2749,10 @@ Example: 3FS+10d`);
|
|
|
2749
2749
|
color: "#fff",
|
|
2750
2750
|
fontSize: 12,
|
|
2751
2751
|
fontWeight: "bold"
|
|
2752
|
-
}, children:
|
|
2752
|
+
}, children: W ? o.indexOf(W) + 1 : "?" }),
|
|
2753
2753
|
title: /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
2754
|
-
/* @__PURE__ */ e.jsx("span", { style: { fontWeight: 600, color: s.font?.color }, children:
|
|
2755
|
-
/* @__PURE__ */ e.jsx(pr, { color:
|
|
2754
|
+
/* @__PURE__ */ e.jsx("span", { style: { fontWeight: 600, color: s.font?.color }, children: W?.text || "Unknown Task" }),
|
|
2755
|
+
/* @__PURE__ */ e.jsx(pr, { color: H(D.type), style: { margin: 0 }, children: q(D.type) })
|
|
2756
2756
|
] }),
|
|
2757
2757
|
description: /* @__PURE__ */ e.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ e.jsxs("span", { style: { fontSize: 12, color: s.font?.color, opacity: 0.7 }, children: [
|
|
2758
2758
|
/* @__PURE__ */ e.jsx(de, { icon: Gt, style: { marginRight: 6 } }),
|
|
@@ -2769,11 +2769,11 @@ Example: 3FS+10d`);
|
|
|
2769
2769
|
)
|
|
2770
2770
|
] }),
|
|
2771
2771
|
/* @__PURE__ */ e.jsxs("div", { style: { marginTop: 24, padding: "16px", background: "#fff7e6", borderRadius: 8, border: "1px solid #ffe7ba" }, children: [
|
|
2772
|
-
/* @__PURE__ */ e.jsxs(
|
|
2772
|
+
/* @__PURE__ */ e.jsxs(ct, { level: 5, style: { fontSize: 13, marginBottom: 8, display: "flex", alignItems: "center" }, children: [
|
|
2773
2773
|
/* @__PURE__ */ e.jsx(de, { icon: Sr, style: { marginRight: 8, color: "#fa8c16" } }),
|
|
2774
2774
|
"Coming soon"
|
|
2775
2775
|
] }),
|
|
2776
|
-
/* @__PURE__ */ e.jsx(
|
|
2776
|
+
/* @__PURE__ */ e.jsx(Xe, { style: { fontSize: 12, color: "rgba(0,0,0,0.65)" }, children: "Dependency visualization on the chart and automatic lag calculations based on working hours." })
|
|
2777
2777
|
] })
|
|
2778
2778
|
] })
|
|
2779
2779
|
}
|
|
@@ -2784,8 +2784,8 @@ Example: 3FS+10d`);
|
|
|
2784
2784
|
task: a,
|
|
2785
2785
|
onEdit: l,
|
|
2786
2786
|
onDelete: r,
|
|
2787
|
-
onCopy:
|
|
2788
|
-
onDependencies:
|
|
2787
|
+
onCopy: x,
|
|
2788
|
+
onDependencies: m,
|
|
2789
2789
|
onConvertToMilestone: i,
|
|
2790
2790
|
onConvertToTask: s,
|
|
2791
2791
|
onConvertToProject: y,
|
|
@@ -2793,7 +2793,7 @@ Example: 3FS+10d`);
|
|
|
2793
2793
|
onClose: g,
|
|
2794
2794
|
styleConfig: j
|
|
2795
2795
|
}) => {
|
|
2796
|
-
const u =
|
|
2796
|
+
const u = nt(j);
|
|
2797
2797
|
if (!a) return null;
|
|
2798
2798
|
const p = [
|
|
2799
2799
|
{
|
|
@@ -2809,7 +2809,7 @@ Example: 3FS+10d`);
|
|
|
2809
2809
|
label: "Copy",
|
|
2810
2810
|
icon: /* @__PURE__ */ e.jsx(de, { icon: Dr }),
|
|
2811
2811
|
onClick: () => {
|
|
2812
|
-
|
|
2812
|
+
x(), g();
|
|
2813
2813
|
}
|
|
2814
2814
|
},
|
|
2815
2815
|
{
|
|
@@ -2817,7 +2817,7 @@ Example: 3FS+10d`);
|
|
|
2817
2817
|
label: "Dependencies",
|
|
2818
2818
|
icon: /* @__PURE__ */ e.jsx(de, { icon: Gt }),
|
|
2819
2819
|
onClick: () => {
|
|
2820
|
-
|
|
2820
|
+
m(), g();
|
|
2821
2821
|
}
|
|
2822
2822
|
},
|
|
2823
2823
|
{
|
|
@@ -2840,7 +2840,7 @@ Example: 3FS+10d`);
|
|
|
2840
2840
|
{
|
|
2841
2841
|
key: "task",
|
|
2842
2842
|
label: "Task",
|
|
2843
|
-
icon: /* @__PURE__ */ e.jsx(de, { icon:
|
|
2843
|
+
icon: /* @__PURE__ */ e.jsx(de, { icon: Mr }),
|
|
2844
2844
|
disabled: a.type === "task",
|
|
2845
2845
|
onClick: () => {
|
|
2846
2846
|
s(), g();
|
|
@@ -2849,7 +2849,7 @@ Example: 3FS+10d`);
|
|
|
2849
2849
|
{
|
|
2850
2850
|
key: "project",
|
|
2851
2851
|
label: "Project",
|
|
2852
|
-
icon: /* @__PURE__ */ e.jsx(de, { icon:
|
|
2852
|
+
icon: /* @__PURE__ */ e.jsx(de, { icon: Lr }),
|
|
2853
2853
|
disabled: a.type === "project",
|
|
2854
2854
|
onClick: () => {
|
|
2855
2855
|
y(), g();
|
|
@@ -2906,40 +2906,40 @@ Example: 3FS+10d`);
|
|
|
2906
2906
|
}
|
|
2907
2907
|
);
|
|
2908
2908
|
}, Kr = (t, o = []) => {
|
|
2909
|
-
const [a, l] =
|
|
2910
|
-
|
|
2909
|
+
const [a, l] = z([]), [r, x] = z(-1), [m, i] = z(t), [s, y] = z(o);
|
|
2910
|
+
Je(() => {
|
|
2911
2911
|
i(t);
|
|
2912
|
-
}, [t]),
|
|
2912
|
+
}, [t]), Je(() => {
|
|
2913
2913
|
y(o);
|
|
2914
2914
|
}, [o]);
|
|
2915
|
-
const c =
|
|
2916
|
-
const
|
|
2917
|
-
type:
|
|
2918
|
-
before:
|
|
2919
|
-
after:
|
|
2915
|
+
const c = $e((L, $, B) => {
|
|
2916
|
+
const ne = {
|
|
2917
|
+
type: L,
|
|
2918
|
+
before: $,
|
|
2919
|
+
after: B,
|
|
2920
2920
|
timestamp: Date.now()
|
|
2921
|
-
},
|
|
2922
|
-
|
|
2923
|
-
}, [a, r]), g =
|
|
2921
|
+
}, X = a.slice(0, r + 1);
|
|
2922
|
+
X.push(ne), X.length > 50 ? X.shift() : x(r + 1), l(X);
|
|
2923
|
+
}, [a, r]), g = $e(() => {
|
|
2924
2924
|
if (r < 0) return;
|
|
2925
|
-
const
|
|
2926
|
-
i(
|
|
2927
|
-
}, [a, r]), j =
|
|
2925
|
+
const L = a[r];
|
|
2926
|
+
i(L.before.tasks), y(L.before.links), x(r - 1);
|
|
2927
|
+
}, [a, r]), j = $e(() => {
|
|
2928
2928
|
if (r >= a.length - 1) return;
|
|
2929
|
-
const
|
|
2930
|
-
i(
|
|
2931
|
-
}, [a, r]), u = r >= 0, p = r < a.length - 1, b =
|
|
2932
|
-
const
|
|
2933
|
-
c("task_update",
|
|
2934
|
-
}, [
|
|
2935
|
-
const
|
|
2936
|
-
c("task_create",
|
|
2937
|
-
}, [
|
|
2938
|
-
const
|
|
2939
|
-
c("task_delete",
|
|
2940
|
-
}, [
|
|
2929
|
+
const L = a[r + 1];
|
|
2930
|
+
i(L.after.tasks), y(L.after.links), x(r + 1);
|
|
2931
|
+
}, [a, r]), u = r >= 0, p = r < a.length - 1, b = $e((L) => {
|
|
2932
|
+
const $ = { tasks: m, links: s }, B = m.map((X) => X.id === L.id ? L : X);
|
|
2933
|
+
c("task_update", $, { tasks: B, links: s }), i(B);
|
|
2934
|
+
}, [m, s, c]), w = $e((L) => {
|
|
2935
|
+
const $ = { tasks: m, links: s }, B = [...m, L];
|
|
2936
|
+
c("task_create", $, { tasks: B, links: s }), i(B);
|
|
2937
|
+
}, [m, s, c]), S = $e((L) => {
|
|
2938
|
+
const $ = { tasks: m, links: s }, B = m.filter((pe) => pe.id !== L), ne = s.filter((pe) => pe.source !== L && pe.target !== L);
|
|
2939
|
+
c("task_delete", $, { tasks: B, links: ne }), i(B), y(ne);
|
|
2940
|
+
}, [m, s, c]);
|
|
2941
2941
|
return {
|
|
2942
|
-
tasks:
|
|
2942
|
+
tasks: m,
|
|
2943
2943
|
links: s,
|
|
2944
2944
|
setTasks: i,
|
|
2945
2945
|
setLinks: y,
|
|
@@ -2955,19 +2955,19 @@ Example: 3FS+10d`);
|
|
|
2955
2955
|
};
|
|
2956
2956
|
}, rr = (t, o, a = { mode: "forward" }) => {
|
|
2957
2957
|
const l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2958
|
-
return t.forEach((
|
|
2959
|
-
l.set(
|
|
2960
|
-
}), o.forEach((
|
|
2961
|
-
|
|
2958
|
+
return t.forEach((x) => {
|
|
2959
|
+
l.set(x.id, []), r.set(x.id, []);
|
|
2960
|
+
}), o.forEach((x) => {
|
|
2961
|
+
x.type === "e2s" && (l.get(x.target)?.push(x.source), r.get(x.source)?.push(x.target));
|
|
2962
2962
|
}), a.mode === "forward" ? Qr(t, l, a) : en(t, r, a);
|
|
2963
2963
|
}, Qr = (t, o, a) => {
|
|
2964
|
-
const l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(),
|
|
2964
|
+
const l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), x = a.projectStart || /* @__PURE__ */ new Date(), m = (i) => {
|
|
2965
2965
|
if (r.has(i)) return;
|
|
2966
2966
|
const s = t.find((p) => p.id === i);
|
|
2967
2967
|
if (!s) return;
|
|
2968
2968
|
const y = o.get(i) || [];
|
|
2969
|
-
y.forEach((p) =>
|
|
2970
|
-
let c =
|
|
2969
|
+
y.forEach((p) => m(p));
|
|
2970
|
+
let c = x;
|
|
2971
2971
|
y.forEach((p) => {
|
|
2972
2972
|
const b = l.get(p);
|
|
2973
2973
|
b && b.end > c && (c = new Date(b.end));
|
|
@@ -2979,17 +2979,17 @@ Example: 3FS+10d`);
|
|
|
2979
2979
|
};
|
|
2980
2980
|
l.set(i, u), r.add(i);
|
|
2981
2981
|
};
|
|
2982
|
-
return t.forEach((i) =>
|
|
2982
|
+
return t.forEach((i) => m(i.id)), t.map((i) => l.get(i.id) || i);
|
|
2983
2983
|
}, en = (t, o, a) => {
|
|
2984
|
-
const l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(),
|
|
2984
|
+
const l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), x = a.projectEnd || new Date(
|
|
2985
2985
|
Math.max(...t.map((i) => i.end.getTime()))
|
|
2986
|
-
),
|
|
2986
|
+
), m = (i) => {
|
|
2987
2987
|
if (r.has(i)) return;
|
|
2988
2988
|
const s = t.find((p) => p.id === i);
|
|
2989
2989
|
if (!s) return;
|
|
2990
2990
|
const y = o.get(i) || [];
|
|
2991
|
-
y.forEach((p) =>
|
|
2992
|
-
let c =
|
|
2991
|
+
y.forEach((p) => m(p));
|
|
2992
|
+
let c = x;
|
|
2993
2993
|
y.forEach((p) => {
|
|
2994
2994
|
const b = l.get(p);
|
|
2995
2995
|
b && b.start < c && (c = new Date(b.start));
|
|
@@ -3001,7 +3001,7 @@ Example: 3FS+10d`);
|
|
|
3001
3001
|
};
|
|
3002
3002
|
l.set(i, u), r.add(i);
|
|
3003
3003
|
};
|
|
3004
|
-
return t.forEach((i) =>
|
|
3004
|
+
return t.forEach((i) => m(i.id)), t.map((i) => l.get(i.id) || i);
|
|
3005
3005
|
}, tn = (t) => {
|
|
3006
3006
|
const o = /* @__PURE__ */ new Map();
|
|
3007
3007
|
t.forEach((l) => {
|
|
@@ -3009,15 +3009,15 @@ Example: 3FS+10d`);
|
|
|
3009
3009
|
});
|
|
3010
3010
|
const a = [...t];
|
|
3011
3011
|
return o.forEach((l) => {
|
|
3012
|
-
const r = l.sort((
|
|
3013
|
-
for (let
|
|
3014
|
-
const
|
|
3015
|
-
if (
|
|
3016
|
-
const s = a.findIndex((y) => y.id ===
|
|
3012
|
+
const r = l.sort((x, m) => x.start.getTime() - m.start.getTime());
|
|
3013
|
+
for (let x = 1; x < r.length; x++) {
|
|
3014
|
+
const m = r[x], i = r[x - 1];
|
|
3015
|
+
if (m.start < i.end) {
|
|
3016
|
+
const s = a.findIndex((y) => y.id === m.id);
|
|
3017
3017
|
if (s >= 0) {
|
|
3018
|
-
const y = new Date(i.end), c = fe(y,
|
|
3018
|
+
const y = new Date(i.end), c = fe(y, m.duration, "day");
|
|
3019
3019
|
a[s] = {
|
|
3020
|
-
...
|
|
3020
|
+
...m,
|
|
3021
3021
|
start: y,
|
|
3022
3022
|
end: c
|
|
3023
3023
|
};
|
|
@@ -3051,7 +3051,7 @@ Example: 3FS+10d`);
|
|
|
3051
3051
|
r.priority || "medium"
|
|
3052
3052
|
]), l = [
|
|
3053
3053
|
o.join(","),
|
|
3054
|
-
...a.map((r) => r.map((
|
|
3054
|
+
...a.map((r) => r.map((x) => `"${x}"`).join(","))
|
|
3055
3055
|
].join(`
|
|
3056
3056
|
`);
|
|
3057
3057
|
vt(l, "gantt-tasks.csv", "text/csv");
|
|
@@ -3070,7 +3070,7 @@ Example: 3FS+10d`);
|
|
|
3070
3070
|
]), l = "\uFEFF" + [
|
|
3071
3071
|
// BOM for UTF-8
|
|
3072
3072
|
o.join(" "),
|
|
3073
|
-
...a.map((r) => r.map((
|
|
3073
|
+
...a.map((r) => r.map((x) => x.replace(/\t/g, " ")).join(" "))
|
|
3074
3074
|
].join(`
|
|
3075
3075
|
`);
|
|
3076
3076
|
vt(l, "gantt-tasks.xls", "application/vnd.ms-excel");
|
|
@@ -3119,12 +3119,12 @@ ${l + 1}. ${a.text}
|
|
|
3119
3119
|
const l = new FileReader();
|
|
3120
3120
|
l.onload = (r) => {
|
|
3121
3121
|
try {
|
|
3122
|
-
const
|
|
3122
|
+
const x = r.target?.result, m = JSON.parse(x), i = m.tasks.map((s) => ({
|
|
3123
3123
|
...s,
|
|
3124
3124
|
start: new Date(s.start),
|
|
3125
3125
|
end: new Date(s.end)
|
|
3126
3126
|
}));
|
|
3127
|
-
o({ tasks: i, links:
|
|
3127
|
+
o({ tasks: i, links: m.links || [] });
|
|
3128
3128
|
} catch {
|
|
3129
3129
|
a(new Error("Invalid JSON file"));
|
|
3130
3130
|
}
|
|
@@ -3139,15 +3139,15 @@ ${l + 1}. ${a.text}
|
|
|
3139
3139
|
importFromJSON: on
|
|
3140
3140
|
}, Symbol.toStringTag, { value: "Module" })), sn = (t, o) => t.filter((a) => {
|
|
3141
3141
|
if (o.searchText) {
|
|
3142
|
-
const l = o.searchText.toLowerCase(), r = a.text.toLowerCase().includes(l),
|
|
3143
|
-
if (!r && !
|
|
3142
|
+
const l = o.searchText.toLowerCase(), r = a.text.toLowerCase().includes(l), x = a.owner?.toLowerCase().includes(l), m = a.details?.toLowerCase().includes(l);
|
|
3143
|
+
if (!r && !x && !m)
|
|
3144
3144
|
return !1;
|
|
3145
3145
|
}
|
|
3146
3146
|
if (o.status !== "all" && (a.progress === 0 ? "not-started" : a.progress === 100 ? "completed" : "in-progress") !== o.status || o.priority !== "all" && a.priority !== o.priority || o.owner && a.owner !== o.owner)
|
|
3147
3147
|
return !1;
|
|
3148
3148
|
if (o.dateRange) {
|
|
3149
|
-
const l = a.start.getTime(), r = o.dateRange.start.getTime(),
|
|
3150
|
-
if (l < r || l >
|
|
3149
|
+
const l = a.start.getTime(), r = o.dateRange.start.getTime(), x = o.dateRange.end.getTime();
|
|
3150
|
+
if (l < r || l > x)
|
|
3151
3151
|
return !1;
|
|
3152
3152
|
}
|
|
3153
3153
|
return !0;
|
|
@@ -3245,40 +3245,40 @@ ${l + 1}. ${a.text}
|
|
|
3245
3245
|
config: a = {},
|
|
3246
3246
|
uiConfig: l = {},
|
|
3247
3247
|
styleConfig: r = {},
|
|
3248
|
-
iconConfig:
|
|
3249
|
-
onTaskUpdate:
|
|
3248
|
+
iconConfig: x = {},
|
|
3249
|
+
onTaskUpdate: m,
|
|
3250
3250
|
onTaskCreate: i,
|
|
3251
3251
|
onTaskDelete: s,
|
|
3252
3252
|
onLinkCreate: y,
|
|
3253
3253
|
onLinkDelete: c,
|
|
3254
3254
|
baselines: g
|
|
3255
3255
|
}) => {
|
|
3256
|
-
const j = { ...cn, ...l }, u =
|
|
3256
|
+
const j = { ...cn, ...l }, u = re.useMemo(() => {
|
|
3257
3257
|
const d = {};
|
|
3258
|
-
return r.primary && (d["--wx-gantt-primary"] = r.primary), r.primarySelected && (d["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (d["--wx-gantt-success"] = r.success), r.warning && (d["--wx-gantt-warning"] = r.warning), r.danger && (d["--wx-gantt-danger"] = r.danger), r.background && (d["--wx-gantt-background"] = r.background), r.backgroundAlt && (d["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (d["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (d["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (d["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (d["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (d["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (d["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (d["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (d["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (d["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (d["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (d["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (d["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (d["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (d["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (d["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (d["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (d["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (d["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (d["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([v,
|
|
3259
|
-
d[v.startsWith("--") ? v : `--${v}`] =
|
|
3258
|
+
return r.primary && (d["--wx-gantt-primary"] = r.primary), r.primarySelected && (d["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (d["--wx-gantt-success"] = r.success), r.warning && (d["--wx-gantt-warning"] = r.warning), r.danger && (d["--wx-gantt-danger"] = r.danger), r.background && (d["--wx-gantt-background"] = r.background), r.backgroundAlt && (d["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (d["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (d["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (d["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (d["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (d["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (d["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (d["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (d["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (d["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (d["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (d["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (d["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (d["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (d["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (d["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (d["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (d["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (d["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (d["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([v, R]) => {
|
|
3259
|
+
d[v.startsWith("--") ? v : `--${v}`] = R;
|
|
3260
3260
|
}), d;
|
|
3261
3261
|
}, [r]), p = Array.isArray(t) ? t : [], b = Array.isArray(o) ? o : [], {
|
|
3262
3262
|
tasks: w,
|
|
3263
3263
|
links: S,
|
|
3264
|
-
setTasks:
|
|
3265
|
-
setLinks:
|
|
3266
|
-
undo:
|
|
3267
|
-
redo:
|
|
3268
|
-
updateTask:
|
|
3264
|
+
setTasks: L,
|
|
3265
|
+
setLinks: $,
|
|
3266
|
+
undo: B,
|
|
3267
|
+
redo: ne,
|
|
3268
|
+
updateTask: X,
|
|
3269
3269
|
createTask: pe,
|
|
3270
|
-
deleteTask:
|
|
3270
|
+
deleteTask: M,
|
|
3271
3271
|
saveState: q
|
|
3272
|
-
} = Kr(p, b), [
|
|
3273
|
-
|
|
3274
|
-
g && g.size > 0 &&
|
|
3272
|
+
} = Kr(p, b), [H, D] = z(w), [W, ae] = z(null), [J, me] = z(null), [Fe, ke] = z(!1), [N, Y] = z(void 0), [ce, K] = z(void 0), [Q, G] = z(!1), [h, k] = z(null), [F, P] = z(null), [A, oe] = z(null), [ee, Re] = z(null), [se, Me] = z(null), [Ae, Pe] = z(1), [Te, Oe] = z(() => g && g.size > 0 ? g : p.length > 0 ? rn(p) : /* @__PURE__ */ new Map());
|
|
3273
|
+
Je(() => {
|
|
3274
|
+
g && g.size > 0 && Oe(g);
|
|
3275
3275
|
}, [g]);
|
|
3276
|
-
const [
|
|
3276
|
+
const [at] = z(a.theme || "light"), [Ue, jt] = z({
|
|
3277
3277
|
searchText: "",
|
|
3278
3278
|
status: "all",
|
|
3279
3279
|
priority: "all",
|
|
3280
3280
|
owner: ""
|
|
3281
|
-
}),
|
|
3281
|
+
}), ut = Qe(null), Ce = Qe(null), St = Qe(null), Ie = Qe(!1), Le = Qe(null), ve = {
|
|
3282
3282
|
columns: a.columns || ln(l),
|
|
3283
3283
|
scales: dn,
|
|
3284
3284
|
readonly: !1,
|
|
@@ -3294,7 +3294,7 @@ ${l + 1}. ${a.text}
|
|
|
3294
3294
|
// Always enabled
|
|
3295
3295
|
weekends: !0,
|
|
3296
3296
|
holidays: [],
|
|
3297
|
-
theme:
|
|
3297
|
+
theme: at,
|
|
3298
3298
|
locale: "en",
|
|
3299
3299
|
// Today and Project Start lines - enabled by default, labels visible by default
|
|
3300
3300
|
showTodayLine: a.showTodayLine !== !1,
|
|
@@ -3341,50 +3341,50 @@ ${l + 1}. ${a.text}
|
|
|
3341
3341
|
// Marker style
|
|
3342
3342
|
...a
|
|
3343
3343
|
};
|
|
3344
|
-
|
|
3345
|
-
const d = sn(w,
|
|
3346
|
-
D(((
|
|
3347
|
-
const
|
|
3348
|
-
if (!
|
|
3349
|
-
const
|
|
3350
|
-
return
|
|
3344
|
+
Je(() => {
|
|
3345
|
+
const d = sn(w, Ue);
|
|
3346
|
+
D(((R) => {
|
|
3347
|
+
const I = [], ie = (U) => {
|
|
3348
|
+
if (!U) return !1;
|
|
3349
|
+
const ye = R.find((te) => te.id === U);
|
|
3350
|
+
return ye && !ye.open && ye.type === "project" ? !0 : ie(ye?.parent);
|
|
3351
3351
|
};
|
|
3352
|
-
return
|
|
3353
|
-
ie(
|
|
3354
|
-
}),
|
|
3352
|
+
return R.forEach((U) => {
|
|
3353
|
+
ie(U.parent) || I.push(U);
|
|
3354
|
+
}), I;
|
|
3355
3355
|
})(d));
|
|
3356
|
-
}, [w,
|
|
3357
|
-
const
|
|
3356
|
+
}, [w, Ue]);
|
|
3357
|
+
const pt = re.useMemo(() => {
|
|
3358
3358
|
if (!w || !Array.isArray(w)) return [];
|
|
3359
3359
|
try {
|
|
3360
3360
|
return Array.from(new Set(w.map((d) => d?.owner).filter(Boolean)));
|
|
3361
3361
|
} catch (d) {
|
|
3362
3362
|
return console.warn("Error extracting owners:", d), [];
|
|
3363
3363
|
}
|
|
3364
|
-
}, [w]),
|
|
3365
|
-
const d =
|
|
3364
|
+
}, [w]), ht = (() => {
|
|
3365
|
+
const d = H.length > 0 ? H : w;
|
|
3366
3366
|
if (d.length === 0) {
|
|
3367
|
-
const
|
|
3367
|
+
const U = /* @__PURE__ */ new Date();
|
|
3368
3368
|
return {
|
|
3369
|
-
start:
|
|
3370
|
-
end:
|
|
3369
|
+
start: rt(fe(U, -30, "day")),
|
|
3370
|
+
end: rt(fe(U, 60, "day"))
|
|
3371
3371
|
};
|
|
3372
3372
|
}
|
|
3373
|
-
const v = d.map((
|
|
3373
|
+
const v = d.map((U) => U.start.getTime()), R = d.map((U) => U.end.getTime()), I = new Date(Math.min(...v)), ie = new Date(Math.max(...R));
|
|
3374
3374
|
return {
|
|
3375
|
-
start:
|
|
3376
|
-
end:
|
|
3375
|
+
start: rt(fe(I, -7, "day")),
|
|
3376
|
+
end: rt(ie)
|
|
3377
3377
|
};
|
|
3378
|
-
})(),
|
|
3379
|
-
|
|
3378
|
+
})(), ft = (d) => {
|
|
3379
|
+
ae(d);
|
|
3380
3380
|
}, Tt = (d, v) => {
|
|
3381
|
-
if (
|
|
3381
|
+
if (ve.readonly) return;
|
|
3382
3382
|
d.preventDefault();
|
|
3383
|
-
const
|
|
3384
|
-
|
|
3383
|
+
const R = w.find((I) => I.id === v);
|
|
3384
|
+
R && Me({ x: d.clientX, y: d.clientY, task: R });
|
|
3385
3385
|
}, Dt = () => {
|
|
3386
|
-
if (!
|
|
3387
|
-
const d =
|
|
3386
|
+
if (!se?.task) return;
|
|
3387
|
+
const d = se.task, v = {
|
|
3388
3388
|
...d,
|
|
3389
3389
|
id: `task-${Date.now()}`,
|
|
3390
3390
|
text: `${d.text} (Copy)`,
|
|
@@ -3392,222 +3392,228 @@ ${l + 1}. ${a.text}
|
|
|
3392
3392
|
end: fe(d.end, 7, "day")
|
|
3393
3393
|
};
|
|
3394
3394
|
pe(v), i && i(v);
|
|
3395
|
-
},
|
|
3396
|
-
if (!
|
|
3397
|
-
const v = { ...
|
|
3398
|
-
|
|
3399
|
-
}, kt = (d, v,
|
|
3400
|
-
if (!
|
|
3401
|
-
if (
|
|
3402
|
-
const ie =
|
|
3403
|
-
let
|
|
3404
|
-
return
|
|
3405
|
-
|
|
3406
|
-
}),
|
|
3407
|
-
},
|
|
3408
|
-
|
|
3395
|
+
}, ot = (d) => {
|
|
3396
|
+
if (!se?.task) return;
|
|
3397
|
+
const v = { ...se.task, type: d };
|
|
3398
|
+
X(v), m && m(v);
|
|
3399
|
+
}, kt = (d, v, R, I) => {
|
|
3400
|
+
if (!ve.readonly)
|
|
3401
|
+
if (I === "reorder") {
|
|
3402
|
+
const ie = H.findIndex((te) => te.id === d), U = (te, ge) => {
|
|
3403
|
+
let ze = [];
|
|
3404
|
+
return ge.filter((n) => n.parent === te).forEach((n) => {
|
|
3405
|
+
ze.push(n.id), ze = [...ze, ...U(n.id, ge)];
|
|
3406
|
+
}), ze;
|
|
3407
|
+
}, ye = U(d, w);
|
|
3408
|
+
oe({ id: d, initialIndex: ie, currentY: R, descendantIds: ye }), document.body.classList.add("gantt-dragging");
|
|
3409
3409
|
} else
|
|
3410
3410
|
P(d);
|
|
3411
|
-
},
|
|
3412
|
-
if (
|
|
3413
|
-
const d = w.find((
|
|
3411
|
+
}, Mt = () => {
|
|
3412
|
+
if (A && ee) {
|
|
3413
|
+
const d = w.find((R) => R.id === A.id), v = w.find((R) => R.id === ee.taskId);
|
|
3414
3414
|
if (d && v && d.id !== v.id) {
|
|
3415
|
-
const
|
|
3416
|
-
if (!
|
|
3417
|
-
const
|
|
3418
|
-
|
|
3419
|
-
const
|
|
3420
|
-
let
|
|
3421
|
-
if (
|
|
3422
|
-
const
|
|
3423
|
-
|
|
3424
|
-
} else if (
|
|
3425
|
-
const
|
|
3426
|
-
let
|
|
3427
|
-
return
|
|
3428
|
-
|
|
3429
|
-
}),
|
|
3430
|
-
},
|
|
3431
|
-
|
|
3415
|
+
const R = [d.id, ...A.descendantIds];
|
|
3416
|
+
if (!R.includes(v.id)) {
|
|
3417
|
+
const I = [...w], ie = ee.position === "inside" ? v.id : v.parent, U = I.findIndex((E) => E.id === d.id);
|
|
3418
|
+
U !== -1 && (I[U] = { ...I[U], parent: ie });
|
|
3419
|
+
const ye = I.filter((E) => R.includes(E.id)), te = I.filter((E) => !R.includes(E.id));
|
|
3420
|
+
let ge = te.findIndex((E) => E.id === v.id);
|
|
3421
|
+
if (ee.position === "inside") {
|
|
3422
|
+
const E = te.filter((C) => C.parent === v.id);
|
|
3423
|
+
E.length > 0 ? ge = te.findIndex((C) => C.id === E[E.length - 1].id) + 1 : ge++;
|
|
3424
|
+
} else if (ee.position === "below") {
|
|
3425
|
+
const E = (V, _) => {
|
|
3426
|
+
let O = [];
|
|
3427
|
+
return _.filter((Z) => Z.parent === V).forEach((Z) => {
|
|
3428
|
+
O.push(Z.id), O = [...O, ...E(Z.id, _)];
|
|
3429
|
+
}), O;
|
|
3430
|
+
}, C = E(v.id, te);
|
|
3431
|
+
C.length > 0 ? ge = te.findIndex((V) => V.id === C[C.length - 1]) + 1 : ge++;
|
|
3432
3432
|
}
|
|
3433
|
-
const
|
|
3434
|
-
|
|
3433
|
+
const ze = { tasks: [...w], links: [...S] };
|
|
3434
|
+
te.splice(ge, 0, ...ye), L(te), q("task_update", ze, { tasks: te, links: S });
|
|
3435
|
+
const yt = U + 1, n = te.findIndex((E) => E.id === d.id) + 1, f = {
|
|
3436
|
+
currentSequenceId: yt,
|
|
3437
|
+
targetSequenceId: n,
|
|
3438
|
+
targetStageId: ie ?? null
|
|
3439
|
+
}, T = te.find((E) => E.id === d.id);
|
|
3440
|
+
T && m && m(T, f);
|
|
3435
3441
|
}
|
|
3436
3442
|
}
|
|
3437
3443
|
}
|
|
3438
|
-
P(null),
|
|
3439
|
-
},
|
|
3440
|
-
|
|
3441
|
-
const v =
|
|
3442
|
-
if (!
|
|
3443
|
-
const
|
|
3444
|
-
let
|
|
3445
|
-
|
|
3446
|
-
const
|
|
3447
|
-
if (
|
|
3448
|
-
const
|
|
3449
|
-
let
|
|
3450
|
-
|
|
3444
|
+
P(null), oe(null), Re(null), document.body.classList.remove("gantt-dragging");
|
|
3445
|
+
}, st = Qe(null), Lt = re.useCallback((d) => {
|
|
3446
|
+
A && (st.current && cancelAnimationFrame(st.current), st.current = requestAnimationFrame(() => {
|
|
3447
|
+
const v = ve.rowHeight || 44, R = Ce.current?.querySelector(".gantt-grid-body");
|
|
3448
|
+
if (!R) return;
|
|
3449
|
+
const I = R.getBoundingClientRect(), ie = d.clientY - I.top;
|
|
3450
|
+
let U = Math.floor(ie / v);
|
|
3451
|
+
U = Math.max(0, Math.min(U, H.length - 1));
|
|
3452
|
+
const ye = H[U];
|
|
3453
|
+
if (ye) {
|
|
3454
|
+
const te = ie - U * v;
|
|
3455
|
+
let ge = "above";
|
|
3456
|
+
ye.type === "project" ? te < v * 0.3 ? ge = "above" : te > v * 0.7 ? ge = "below" : ge = "inside" : ge = te < v / 2 ? "above" : "below", ye.id !== A.id ? Re({ taskId: ye.id, position: ge }) : Re(null);
|
|
3451
3457
|
}
|
|
3452
|
-
|
|
3458
|
+
oe((te) => te ? { ...te, currentY: d.clientY } : null);
|
|
3453
3459
|
}));
|
|
3454
|
-
}, [
|
|
3455
|
-
|
|
3456
|
-
},
|
|
3457
|
-
const
|
|
3460
|
+
}, [A, H, ve.rowHeight]), qe = () => {
|
|
3461
|
+
A && Mt();
|
|
3462
|
+
}, mt = (d, v) => {
|
|
3463
|
+
const R = {
|
|
3458
3464
|
...d,
|
|
3459
3465
|
id: `task-${Date.now()}`,
|
|
3460
3466
|
parent: v
|
|
3461
3467
|
// Set parent if provided (for subtasks)
|
|
3462
3468
|
};
|
|
3463
|
-
pe(
|
|
3464
|
-
const
|
|
3465
|
-
taskId:
|
|
3466
|
-
start: new Date(
|
|
3469
|
+
pe(R);
|
|
3470
|
+
const I = {
|
|
3471
|
+
taskId: R.id,
|
|
3472
|
+
start: new Date(R.start),
|
|
3467
3473
|
// Capture original start date
|
|
3468
|
-
end: new Date(
|
|
3474
|
+
end: new Date(R.end)
|
|
3469
3475
|
// Capture original end date
|
|
3470
3476
|
};
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
return
|
|
3474
|
-
}), i && i(
|
|
3475
|
-
},
|
|
3476
|
-
|
|
3477
|
-
},
|
|
3478
|
-
|
|
3479
|
-
const
|
|
3480
|
-
return
|
|
3477
|
+
Oe((ie) => {
|
|
3478
|
+
const U = new Map(ie);
|
|
3479
|
+
return U.set(R.id, I), U;
|
|
3480
|
+
}), i && i(R);
|
|
3481
|
+
}, Ee = (d) => {
|
|
3482
|
+
X(d), m && m(d);
|
|
3483
|
+
}, Ge = (d) => {
|
|
3484
|
+
M(d), Oe((v) => {
|
|
3485
|
+
const R = new Map(v);
|
|
3486
|
+
return R.delete(d), R;
|
|
3481
3487
|
}), s && s(d);
|
|
3482
|
-
},
|
|
3483
|
-
const ie = { id: `link-${Date.now()}`, source: d, target: v, type:
|
|
3484
|
-
|
|
3485
|
-
},
|
|
3486
|
-
const v = S.filter((
|
|
3487
|
-
|
|
3488
|
+
}, Ze = (d, v, R, I) => {
|
|
3489
|
+
const ie = { id: `link-${Date.now()}`, source: d, target: v, type: R, lag: I };
|
|
3490
|
+
$([...S, ie]), y && y(ie);
|
|
3491
|
+
}, it = (d) => {
|
|
3492
|
+
const v = S.filter((R) => R.id !== d);
|
|
3493
|
+
$(v), c && c(d);
|
|
3488
3494
|
};
|
|
3489
|
-
|
|
3490
|
-
const d = new Map(
|
|
3495
|
+
Je(() => {
|
|
3496
|
+
const d = new Map(Te);
|
|
3491
3497
|
let v = !1;
|
|
3492
|
-
w.forEach((
|
|
3493
|
-
|
|
3494
|
-
taskId:
|
|
3495
|
-
start: new Date(
|
|
3498
|
+
w.forEach((I) => {
|
|
3499
|
+
Te.has(I.id) || (d.set(I.id, {
|
|
3500
|
+
taskId: I.id,
|
|
3501
|
+
start: new Date(I.start),
|
|
3496
3502
|
// Capture original start date
|
|
3497
|
-
end: new Date(
|
|
3503
|
+
end: new Date(I.end)
|
|
3498
3504
|
// Capture original end date
|
|
3499
3505
|
}), v = !0);
|
|
3500
3506
|
});
|
|
3501
|
-
const
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
}), v &&
|
|
3505
|
-
}, [w]),
|
|
3507
|
+
const R = new Set(w.map((I) => I.id));
|
|
3508
|
+
Te.forEach((I, ie) => {
|
|
3509
|
+
R.has(ie) || (d.delete(ie), v = !0);
|
|
3510
|
+
}), v && Oe(d);
|
|
3511
|
+
}, [w]), Je(() => {
|
|
3506
3512
|
const d = (v) => {
|
|
3507
|
-
(v.ctrlKey || v.metaKey) && (v.key === "z" && !v.shiftKey ? (v.preventDefault(),
|
|
3513
|
+
(v.ctrlKey || v.metaKey) && (v.key === "z" && !v.shiftKey ? (v.preventDefault(), B()) : (v.key === "y" || v.key === "z" && v.shiftKey) && (v.preventDefault(), ne()));
|
|
3508
3514
|
};
|
|
3509
3515
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3510
|
-
}, [
|
|
3511
|
-
const d =
|
|
3516
|
+
}, [B, ne]), Je(() => {
|
|
3517
|
+
const d = Ce.current?.querySelector(".gantt-grid-body"), v = ut.current?.querySelector(".gantt-timeline-body");
|
|
3512
3518
|
if (!d || !v) return;
|
|
3513
|
-
const
|
|
3514
|
-
|
|
3515
|
-
|
|
3519
|
+
const R = () => {
|
|
3520
|
+
Ie.current || (Ie.current = !0, v.scrollTop = d.scrollTop, Le.current && clearTimeout(Le.current), Le.current = window.setTimeout(() => {
|
|
3521
|
+
Ie.current = !1;
|
|
3516
3522
|
}, 150));
|
|
3517
|
-
},
|
|
3518
|
-
|
|
3519
|
-
|
|
3523
|
+
}, I = () => {
|
|
3524
|
+
Ie.current || (Ie.current = !0, d.scrollTop = v.scrollTop, Le.current && clearTimeout(Le.current), Le.current = window.setTimeout(() => {
|
|
3525
|
+
Ie.current = !1;
|
|
3520
3526
|
}, 150));
|
|
3521
3527
|
};
|
|
3522
|
-
return d.addEventListener("scroll",
|
|
3523
|
-
d.removeEventListener("scroll",
|
|
3528
|
+
return d.addEventListener("scroll", R, { passive: !0 }), v.addEventListener("scroll", I, { passive: !0 }), () => {
|
|
3529
|
+
d.removeEventListener("scroll", R), v.removeEventListener("scroll", I), Le.current && clearTimeout(Le.current);
|
|
3524
3530
|
};
|
|
3525
|
-
}, [
|
|
3531
|
+
}, [H]);
|
|
3526
3532
|
const Et = {
|
|
3527
3533
|
height: a.containerHeight || "100%",
|
|
3528
3534
|
minHeight: a.containerMinHeight || "400px"
|
|
3529
|
-
},
|
|
3535
|
+
}, xt = a.gridWidth ? { "--gantt-grid-width": a.gridWidth } : {};
|
|
3530
3536
|
return /* @__PURE__ */ e.jsxs(
|
|
3531
3537
|
"div",
|
|
3532
3538
|
{
|
|
3533
|
-
className: `gantt-page-wrapper theme-${
|
|
3539
|
+
className: `gantt-page-wrapper theme-${at}`,
|
|
3534
3540
|
style: { ...Et, ...u },
|
|
3535
3541
|
children: [
|
|
3536
3542
|
j.showHeader && /* @__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: j.headerTitle }) }) }),
|
|
3537
3543
|
/* @__PURE__ */ e.jsxs(
|
|
3538
3544
|
"div",
|
|
3539
3545
|
{
|
|
3540
|
-
className: `gantt-container theme-${
|
|
3541
|
-
style:
|
|
3546
|
+
className: `gantt-container theme-${ve.theme}`,
|
|
3547
|
+
style: xt,
|
|
3542
3548
|
children: [
|
|
3543
3549
|
/* @__PURE__ */ e.jsx(
|
|
3544
3550
|
Wr,
|
|
3545
3551
|
{
|
|
3546
|
-
zoomLevel:
|
|
3547
|
-
setZoomLevel:
|
|
3552
|
+
zoomLevel: Ae,
|
|
3553
|
+
setZoomLevel: Pe,
|
|
3548
3554
|
onExport: (d) => {
|
|
3549
3555
|
d === "csv" && nr(w), d === "excel" && ar(w), d === "json" && or(w, S), d === "pdf" && sr(w);
|
|
3550
3556
|
},
|
|
3551
3557
|
onFilterChange: (d) => jt(d),
|
|
3552
|
-
owners:
|
|
3558
|
+
owners: pt || [],
|
|
3553
3559
|
onAddTask: (d) => {
|
|
3554
3560
|
if (d) {
|
|
3555
|
-
const v = w.find((
|
|
3556
|
-
|
|
3561
|
+
const v = w.find((R) => R.id === d);
|
|
3562
|
+
Y(d), K(v?.text);
|
|
3557
3563
|
} else
|
|
3558
|
-
|
|
3559
|
-
|
|
3564
|
+
Y(void 0), K(void 0);
|
|
3565
|
+
ke(!0);
|
|
3560
3566
|
},
|
|
3561
3567
|
uiConfig: j,
|
|
3562
|
-
iconConfig:
|
|
3568
|
+
iconConfig: x,
|
|
3563
3569
|
styleConfig: r
|
|
3564
3570
|
}
|
|
3565
3571
|
),
|
|
3566
|
-
/* @__PURE__ */ e.jsxs("div", { className: "gantt-layout", ref: St, onMouseMove:
|
|
3572
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-layout", ref: St, onMouseMove: Lt, onMouseUp: qe, onMouseLeave: qe, children: [
|
|
3567
3573
|
/* @__PURE__ */ e.jsx(
|
|
3568
3574
|
Qt,
|
|
3569
3575
|
{
|
|
3570
|
-
ref:
|
|
3571
|
-
tasks:
|
|
3572
|
-
columns:
|
|
3573
|
-
selectedTask:
|
|
3574
|
-
onTaskClick:
|
|
3576
|
+
ref: Ce,
|
|
3577
|
+
tasks: H,
|
|
3578
|
+
columns: ve.columns || [],
|
|
3579
|
+
selectedTask: W,
|
|
3580
|
+
onTaskClick: ft,
|
|
3575
3581
|
onTaskContextMenu: Tt,
|
|
3576
|
-
onTaskUpdate:
|
|
3582
|
+
onTaskUpdate: Ee,
|
|
3577
3583
|
onTaskDragStart: kt,
|
|
3578
3584
|
onAddTask: (d) => {
|
|
3579
3585
|
if (d) {
|
|
3580
|
-
const v = w.find((
|
|
3581
|
-
|
|
3586
|
+
const v = w.find((R) => R.id === d);
|
|
3587
|
+
Y(d), K(v?.text);
|
|
3582
3588
|
} else
|
|
3583
|
-
|
|
3584
|
-
|
|
3589
|
+
Y(void 0), K(void 0);
|
|
3590
|
+
ke(!0);
|
|
3585
3591
|
},
|
|
3586
|
-
onAddDependency:
|
|
3587
|
-
onRemoveDependency:
|
|
3592
|
+
onAddDependency: Ze,
|
|
3593
|
+
onRemoveDependency: it,
|
|
3588
3594
|
onDependencyClick: (d) => {
|
|
3589
|
-
const v = w.find((
|
|
3595
|
+
const v = w.find((R) => R.id === d);
|
|
3590
3596
|
v && (k(v), G(!0));
|
|
3591
3597
|
},
|
|
3592
3598
|
links: S,
|
|
3593
3599
|
allTasks: w,
|
|
3594
|
-
dropIndicator:
|
|
3595
|
-
reorderTask:
|
|
3596
|
-
iconConfig:
|
|
3600
|
+
dropIndicator: ee,
|
|
3601
|
+
reorderTask: A,
|
|
3602
|
+
iconConfig: x,
|
|
3597
3603
|
styleConfig: r
|
|
3598
3604
|
}
|
|
3599
3605
|
),
|
|
3600
3606
|
/* @__PURE__ */ e.jsx(
|
|
3601
3607
|
tr,
|
|
3602
3608
|
{
|
|
3603
|
-
ref:
|
|
3604
|
-
tasks:
|
|
3609
|
+
ref: ut,
|
|
3610
|
+
tasks: H,
|
|
3605
3611
|
links: S,
|
|
3606
|
-
range:
|
|
3607
|
-
scales:
|
|
3608
|
-
config:
|
|
3609
|
-
selectedTask:
|
|
3610
|
-
draggedTask:
|
|
3612
|
+
range: ht,
|
|
3613
|
+
scales: ve.scales,
|
|
3614
|
+
config: ve,
|
|
3615
|
+
selectedTask: W,
|
|
3616
|
+
draggedTask: F,
|
|
3611
3617
|
onTaskClick: () => {
|
|
3612
3618
|
},
|
|
3613
3619
|
onTaskDragStart: () => {
|
|
@@ -3615,96 +3621,96 @@ ${l + 1}. ${a.text}
|
|
|
3615
3621
|
onTaskDragEnd: () => {
|
|
3616
3622
|
},
|
|
3617
3623
|
onTaskUpdate: (d, v) => {
|
|
3618
|
-
const
|
|
3619
|
-
|
|
3624
|
+
const R = w.find((I) => I.id === d);
|
|
3625
|
+
R && Ee({ ...R, ...v });
|
|
3620
3626
|
},
|
|
3621
|
-
zoomLevel:
|
|
3622
|
-
baselines:
|
|
3627
|
+
zoomLevel: Ae,
|
|
3628
|
+
baselines: Te
|
|
3623
3629
|
}
|
|
3624
3630
|
)
|
|
3625
3631
|
] }),
|
|
3626
|
-
|
|
3632
|
+
Fe && /* @__PURE__ */ e.jsx(
|
|
3627
3633
|
Ur,
|
|
3628
3634
|
{
|
|
3629
|
-
onCreateTask:
|
|
3635
|
+
onCreateTask: mt,
|
|
3630
3636
|
onClose: () => {
|
|
3631
|
-
|
|
3637
|
+
ke(!1), Y(void 0), K(void 0);
|
|
3632
3638
|
},
|
|
3633
3639
|
uiConfig: j,
|
|
3634
|
-
parentId:
|
|
3640
|
+
parentId: N,
|
|
3635
3641
|
parentTaskName: ce,
|
|
3636
3642
|
styleConfig: r
|
|
3637
3643
|
}
|
|
3638
3644
|
),
|
|
3639
|
-
J && /* @__PURE__ */ e.jsx(Jr, { task: J, onUpdate:
|
|
3640
|
-
|
|
3645
|
+
J && /* @__PURE__ */ e.jsx(Jr, { task: J, onUpdate: Ee, onDelete: Ge, onClose: () => me(null), uiConfig: j, styleConfig: r }),
|
|
3646
|
+
Q && h && /* @__PURE__ */ e.jsx(
|
|
3641
3647
|
Gr,
|
|
3642
3648
|
{
|
|
3643
3649
|
task: h,
|
|
3644
3650
|
allTasks: w,
|
|
3645
3651
|
links: S,
|
|
3646
|
-
onAddDependency:
|
|
3647
|
-
onRemoveDependency:
|
|
3648
|
-
onTaskUpdate:
|
|
3652
|
+
onAddDependency: Ze,
|
|
3653
|
+
onRemoveDependency: it,
|
|
3654
|
+
onTaskUpdate: Ee,
|
|
3649
3655
|
onClose: () => {
|
|
3650
3656
|
G(!1), k(null);
|
|
3651
3657
|
},
|
|
3652
3658
|
styleConfig: r
|
|
3653
3659
|
}
|
|
3654
3660
|
),
|
|
3655
|
-
|
|
3661
|
+
se && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3656
3662
|
/* @__PURE__ */ e.jsx("div", { className: "gantt-context-menu-overlay", onClick: () => Me(null), onContextMenu: (d) => {
|
|
3657
3663
|
d.preventDefault(), Me(null);
|
|
3658
3664
|
} }),
|
|
3659
3665
|
/* @__PURE__ */ e.jsx(
|
|
3660
3666
|
Zr,
|
|
3661
3667
|
{
|
|
3662
|
-
x:
|
|
3663
|
-
y:
|
|
3664
|
-
task:
|
|
3668
|
+
x: se.x,
|
|
3669
|
+
y: se.y,
|
|
3670
|
+
task: se.task,
|
|
3665
3671
|
onEdit: () => {
|
|
3666
|
-
|
|
3672
|
+
se.task && me(se.task);
|
|
3667
3673
|
},
|
|
3668
3674
|
onDelete: () => {
|
|
3669
|
-
|
|
3675
|
+
se.task && Ge(se.task.id);
|
|
3670
3676
|
},
|
|
3671
3677
|
onCopy: Dt,
|
|
3672
3678
|
onDependencies: () => {
|
|
3673
|
-
|
|
3679
|
+
se.task && (k(se.task), G(!0));
|
|
3674
3680
|
},
|
|
3675
|
-
onConvertToMilestone: () =>
|
|
3676
|
-
onConvertToTask: () =>
|
|
3677
|
-
onConvertToProject: () =>
|
|
3681
|
+
onConvertToMilestone: () => ot("milestone"),
|
|
3682
|
+
onConvertToTask: () => ot("task"),
|
|
3683
|
+
onConvertToProject: () => ot("project"),
|
|
3678
3684
|
onClose: () => Me(null),
|
|
3679
3685
|
onAutoSchedule: () => {
|
|
3680
3686
|
const d = rr(w, S, { mode: "forward" });
|
|
3681
|
-
|
|
3687
|
+
L(d), Me(null);
|
|
3682
3688
|
},
|
|
3683
|
-
iconConfig:
|
|
3689
|
+
iconConfig: x,
|
|
3684
3690
|
styleConfig: r
|
|
3685
3691
|
}
|
|
3686
3692
|
)
|
|
3687
3693
|
] }),
|
|
3688
|
-
|
|
3694
|
+
A && /* @__PURE__ */ e.jsx(
|
|
3689
3695
|
"div",
|
|
3690
3696
|
{
|
|
3691
3697
|
className: "gantt-grid-row ghost-row",
|
|
3692
3698
|
style: {
|
|
3693
|
-
height:
|
|
3694
|
-
top:
|
|
3695
|
-
left:
|
|
3699
|
+
height: ve.rowHeight,
|
|
3700
|
+
top: A.currentY - (ve.rowHeight || 48) / 2,
|
|
3701
|
+
left: Ce.current?.getBoundingClientRect().left,
|
|
3696
3702
|
position: "fixed",
|
|
3697
3703
|
pointerEvents: "none",
|
|
3698
3704
|
opacity: 0.8,
|
|
3699
3705
|
zIndex: 9999,
|
|
3700
|
-
width:
|
|
3706
|
+
width: Ce.current?.offsetWidth,
|
|
3701
3707
|
backgroundColor: "#ffffff",
|
|
3702
3708
|
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
3703
3709
|
border: "1px solid #2196F3",
|
|
3704
3710
|
display: "flex"
|
|
3705
3711
|
},
|
|
3706
|
-
children:
|
|
3707
|
-
const v = w.find((
|
|
3712
|
+
children: ve.columns?.map((d) => /* @__PURE__ */ e.jsx("div", { className: "gantt-grid-cell", style: { width: d.width, textAlign: d.align || "left" }, children: (() => {
|
|
3713
|
+
const v = w.find((R) => R.id === A.id);
|
|
3708
3714
|
if (!v) return null;
|
|
3709
3715
|
if (d.template) return d.template(v);
|
|
3710
3716
|
switch (d.name) {
|
|
@@ -3713,9 +3719,9 @@ ${l + 1}. ${a.text}
|
|
|
3713
3719
|
/* @__PURE__ */ e.jsx(de, { icon: Jt, style: { marginRight: 8, color: "#adb5bd" } }),
|
|
3714
3720
|
/* @__PURE__ */ e.jsxs("span", { className: "gantt-task-name-text", children: [
|
|
3715
3721
|
v.text,
|
|
3716
|
-
|
|
3722
|
+
A.descendantIds.length > 0 && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
3717
3723
|
" +",
|
|
3718
|
-
|
|
3724
|
+
A.descendantIds.length,
|
|
3719
3725
|
" subtasks"
|
|
3720
3726
|
] })
|
|
3721
3727
|
] })
|
|
@@ -3737,27 +3743,27 @@ ${l + 1}. ${a.text}
|
|
|
3737
3743
|
}
|
|
3738
3744
|
);
|
|
3739
3745
|
}, un = (t, o) => {
|
|
3740
|
-
const a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(),
|
|
3746
|
+
const a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
3741
3747
|
t.forEach((u) => {
|
|
3742
|
-
r.set(u.id, []),
|
|
3748
|
+
r.set(u.id, []), x.set(u.id, []);
|
|
3743
3749
|
}), o.forEach((u) => {
|
|
3744
|
-
u.type === "e2s" && (r.get(u.source)?.push(u.target),
|
|
3750
|
+
u.type === "e2s" && (r.get(u.source)?.push(u.target), x.get(u.target)?.push(u.source));
|
|
3745
3751
|
});
|
|
3746
|
-
const
|
|
3752
|
+
const m = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = (u, p = /* @__PURE__ */ new Set()) => {
|
|
3747
3753
|
if (p.has(u)) return;
|
|
3748
3754
|
p.add(u);
|
|
3749
3755
|
const b = t.find((S) => S.id === u);
|
|
3750
3756
|
if (!b) return;
|
|
3751
|
-
const w =
|
|
3757
|
+
const w = x.get(u) || [];
|
|
3752
3758
|
if (w.length === 0)
|
|
3753
|
-
|
|
3759
|
+
m.set(u, 0), i.set(u, b.duration);
|
|
3754
3760
|
else {
|
|
3755
3761
|
let S = 0;
|
|
3756
|
-
w.forEach((
|
|
3757
|
-
s(
|
|
3758
|
-
const
|
|
3759
|
-
S = Math.max(S,
|
|
3760
|
-
}),
|
|
3762
|
+
w.forEach((L) => {
|
|
3763
|
+
s(L, p);
|
|
3764
|
+
const $ = i.get(L) || 0;
|
|
3765
|
+
S = Math.max(S, $);
|
|
3766
|
+
}), m.set(u, S), i.set(u, S + b.duration);
|
|
3761
3767
|
}
|
|
3762
3768
|
};
|
|
3763
3769
|
t.forEach((u) => s(u.id));
|
|
@@ -3771,15 +3777,15 @@ ${l + 1}. ${a.text}
|
|
|
3771
3777
|
c.set(u, g), y.set(u, g - b.duration);
|
|
3772
3778
|
else {
|
|
3773
3779
|
let S = 1 / 0;
|
|
3774
|
-
w.forEach((
|
|
3775
|
-
j(
|
|
3776
|
-
const
|
|
3777
|
-
S = Math.min(S,
|
|
3780
|
+
w.forEach((L) => {
|
|
3781
|
+
j(L, p);
|
|
3782
|
+
const $ = y.get(L) || 0;
|
|
3783
|
+
S = Math.min(S, $);
|
|
3778
3784
|
}), c.set(u, S), y.set(u, S - b.duration);
|
|
3779
3785
|
}
|
|
3780
3786
|
};
|
|
3781
3787
|
return t.forEach((u) => j(u.id)), t.forEach((u) => {
|
|
3782
|
-
const p =
|
|
3788
|
+
const p = m.get(u.id) || 0, w = (y.get(u.id) || 0) - p;
|
|
3783
3789
|
l.set(u.id, w), Math.abs(w) < 0.01 && a.add(u.id);
|
|
3784
3790
|
}), {
|
|
3785
3791
|
criticalTasks: a,
|
|
@@ -3814,7 +3820,7 @@ export {
|
|
|
3814
3820
|
bt as getDaysBetween,
|
|
3815
3821
|
bn as getEndOfDay,
|
|
3816
3822
|
Rr as getHoursBetween,
|
|
3817
|
-
|
|
3823
|
+
rt as getStartOfDay,
|
|
3818
3824
|
Wt as isHoliday,
|
|
3819
3825
|
Bt as isWeekend,
|
|
3820
3826
|
Kr as useUndoRedo
|