iris-gantt 1.6.1 → 1.6.2
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/DATE_FORMATTING_GUIDE.md +4 -0
- package/README.md +7 -6
- package/dist/Gantt/Timeline.d.ts.map +1 -1
- package/dist/Gantt/utils/dateUtils.d.ts.map +1 -1
- package/dist/iris-gantt.js +1013 -1016
- package/dist/iris-gantt.umd.cjs +10 -10
- package/package.json +1 -1
package/dist/iris-gantt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import A, { useState as
|
|
2
|
-
import { Typography as br, Select as
|
|
1
|
+
import A, { useState as J, memo as Ir, forwardRef as wr, useCallback as Je, useEffect as ut, useRef as ft } from "react";
|
|
2
|
+
import { Typography as br, Select as Oe, InputNumber as at, Button as Pe, Popover as zr, Tooltip as nt, Input as pt, Space as er, Segmented as Br, Divider as tr, Form as je, Modal as At, DatePicker as Sr, ColorPicker as vr, Alert as Hr, Card as dr, List as Jt, Tag as Wr, Menu as Vr } from "antd";
|
|
3
3
|
import { FontAwesomeIcon as Ee } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { faChevronDown as cr, faPlus as ar, faGripVertical as Xr, faChevronRight as Ur, faTimesCircle as qr, faSearchMinus as Gr, faSearchPlus as Jr, faRotateLeft as jr, faFileCsv as Kr, faFileExcel as Zr, faFileCode as Qr, faFilePdf as en, faExclamationTriangle as tn, faLink as Tr, faTrash as Dr, faInfoCircle as rn, faEdit as nn, faCopy as an, faFlag as on, faTasks as sn, faFolder as ln } from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import Mr from "dayjs";
|
|
@@ -9,12 +9,12 @@ function dn() {
|
|
|
9
9
|
if (ur) return Ft;
|
|
10
10
|
ur = 1;
|
|
11
11
|
var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
12
|
-
function b(u, d,
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
for (
|
|
16
|
-
if (u && u.defaultProps) for (
|
|
17
|
-
return { $$typeof: a, type: u, key:
|
|
12
|
+
function b(u, d, h) {
|
|
13
|
+
var p, S = {}, y = null, m = null;
|
|
14
|
+
h !== void 0 && (y = "" + h), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (m = d.ref);
|
|
15
|
+
for (p in d) s.call(d, p) && !c.hasOwnProperty(p) && (S[p] = d[p]);
|
|
16
|
+
if (u && u.defaultProps) for (p in d = u.defaultProps, d) S[p] === void 0 && (S[p] = d[p]);
|
|
17
|
+
return { $$typeof: a, type: u, key: y, ref: m, props: S, _owner: r.current };
|
|
18
18
|
}
|
|
19
19
|
return Ft.Fragment = n, Ft.jsx = b, Ft.jsxs = b, Ft;
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ var Rt = {};
|
|
|
22
22
|
var pr;
|
|
23
23
|
function cn() {
|
|
24
24
|
return pr || (pr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
25
|
-
var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.provider"), u = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"),
|
|
25
|
+
var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.provider"), u = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), h = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), S = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), m = /* @__PURE__ */ Symbol.for("react.offscreen"), E = Symbol.iterator, F = "@@iterator";
|
|
26
26
|
function N(o) {
|
|
27
27
|
if (o === null || typeof o != "object")
|
|
28
28
|
return null;
|
|
@@ -30,7 +30,7 @@ function cn() {
|
|
|
30
30
|
return typeof x == "function" ? x : null;
|
|
31
31
|
}
|
|
32
32
|
var M = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
33
|
-
function
|
|
33
|
+
function v(o) {
|
|
34
34
|
{
|
|
35
35
|
for (var x = arguments.length, L = new Array(x > 1 ? x - 1 : 0), _ = 1; _ < x; _++)
|
|
36
36
|
L[_ - 1] = arguments[_];
|
|
@@ -41,16 +41,16 @@ function cn() {
|
|
|
41
41
|
{
|
|
42
42
|
var _ = M.ReactDebugCurrentFrame, te = _.getStackAddendum();
|
|
43
43
|
te !== "" && (x += "%s", L = L.concat([te]));
|
|
44
|
-
var oe = L.map(function(
|
|
45
|
-
return String(
|
|
44
|
+
var oe = L.map(function(Q) {
|
|
45
|
+
return String(Q);
|
|
46
46
|
});
|
|
47
47
|
oe.unshift("Warning: " + x), Function.prototype.apply.call(console[o], console, oe);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
var C = !1, Z = !1, W = !1, re = !1, le = !1, j;
|
|
51
51
|
j = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
52
|
-
function
|
|
53
|
-
return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o ===
|
|
52
|
+
function X(o) {
|
|
53
|
+
return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o === h || o === p || re || o === m || C || Z || W || typeof o == "object" && o !== null && (o.$$typeof === y || o.$$typeof === S || o.$$typeof === b || o.$$typeof === u || o.$$typeof === d || // 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.
|
|
@@ -63,13 +63,13 @@ function cn() {
|
|
|
63
63
|
var te = x.displayName || x.name || "";
|
|
64
64
|
return te !== "" ? L + "(" + te + ")" : L;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function k(o) {
|
|
67
67
|
return o.displayName || "Context";
|
|
68
68
|
}
|
|
69
69
|
function B(o) {
|
|
70
70
|
if (o == null)
|
|
71
71
|
return null;
|
|
72
|
-
if (typeof o.tag == "number" &&
|
|
72
|
+
if (typeof o.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
|
|
73
73
|
return o.displayName || o.name || null;
|
|
74
74
|
if (typeof o == "string")
|
|
75
75
|
return o;
|
|
@@ -82,28 +82,28 @@ function cn() {
|
|
|
82
82
|
return "Profiler";
|
|
83
83
|
case r:
|
|
84
84
|
return "StrictMode";
|
|
85
|
-
case p:
|
|
86
|
-
return "Suspense";
|
|
87
85
|
case h:
|
|
86
|
+
return "Suspense";
|
|
87
|
+
case p:
|
|
88
88
|
return "SuspenseList";
|
|
89
89
|
}
|
|
90
90
|
if (typeof o == "object")
|
|
91
91
|
switch (o.$$typeof) {
|
|
92
92
|
case u:
|
|
93
93
|
var x = o;
|
|
94
|
-
return
|
|
94
|
+
return k(x) + ".Consumer";
|
|
95
95
|
case b:
|
|
96
96
|
var L = o;
|
|
97
|
-
return
|
|
97
|
+
return k(L._context) + ".Provider";
|
|
98
98
|
case d:
|
|
99
99
|
return R(o, o.render, "ForwardRef");
|
|
100
|
-
case
|
|
100
|
+
case S:
|
|
101
101
|
var _ = o.displayName || null;
|
|
102
102
|
return _ !== null ? _ : B(o.type) || "Memo";
|
|
103
|
-
case
|
|
104
|
-
var te = o, oe = te._payload,
|
|
103
|
+
case y: {
|
|
104
|
+
var te = o, oe = te._payload, Q = te._init;
|
|
105
105
|
try {
|
|
106
|
-
return B(
|
|
106
|
+
return B(Q(oe));
|
|
107
107
|
} catch {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
@@ -111,14 +111,14 @@ function cn() {
|
|
|
111
111
|
}
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
114
|
-
var Y = Object.assign,
|
|
114
|
+
var Y = Object.assign, O = 0, De, Se, V, I, ne, de, se;
|
|
115
115
|
function ue() {
|
|
116
116
|
}
|
|
117
117
|
ue.__reactDisabledLog = !0;
|
|
118
118
|
function z() {
|
|
119
119
|
{
|
|
120
|
-
if (
|
|
121
|
-
De = console.log,
|
|
120
|
+
if (O === 0) {
|
|
121
|
+
De = console.log, Se = console.info, V = console.warn, I = console.error, ne = console.group, de = console.groupCollapsed, se = console.groupEnd;
|
|
122
122
|
var o = {
|
|
123
123
|
configurable: !0,
|
|
124
124
|
enumerable: !0,
|
|
@@ -135,12 +135,12 @@ function cn() {
|
|
|
135
135
|
groupEnd: o
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
O++;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ye() {
|
|
142
142
|
{
|
|
143
|
-
if (
|
|
143
|
+
if (O--, O === 0) {
|
|
144
144
|
var o = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
@@ -151,7 +151,7 @@ function cn() {
|
|
|
151
151
|
value: De
|
|
152
152
|
}),
|
|
153
153
|
info: Y({}, o, {
|
|
154
|
-
value:
|
|
154
|
+
value: Se
|
|
155
155
|
}),
|
|
156
156
|
warn: Y({}, o, {
|
|
157
157
|
value: V
|
|
@@ -170,7 +170,7 @@ function cn() {
|
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
O < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
var Le = M.ReactCurrentDispatcher, Ie;
|
|
@@ -187,16 +187,16 @@ function cn() {
|
|
|
187
187
|
` + Ie + o;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var $ = !1,
|
|
190
|
+
var $ = !1, q;
|
|
191
191
|
{
|
|
192
|
-
var
|
|
193
|
-
|
|
192
|
+
var xe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
193
|
+
q = new xe();
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Qe(o, x) {
|
|
196
196
|
if (!o || $)
|
|
197
197
|
return "";
|
|
198
198
|
{
|
|
199
|
-
var L =
|
|
199
|
+
var L = q.get(o);
|
|
200
200
|
if (L !== void 0)
|
|
201
201
|
return L;
|
|
202
202
|
}
|
|
@@ -208,63 +208,63 @@ function cn() {
|
|
|
208
208
|
oe = Le.current, Le.current = null, z();
|
|
209
209
|
try {
|
|
210
210
|
if (x) {
|
|
211
|
-
var
|
|
211
|
+
var Q = function() {
|
|
212
212
|
throw Error();
|
|
213
213
|
};
|
|
214
|
-
if (Object.defineProperty(
|
|
214
|
+
if (Object.defineProperty(Q.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(Q, []);
|
|
221
|
+
} catch (Ne) {
|
|
222
|
+
_ = Ne;
|
|
223
223
|
}
|
|
224
|
-
Reflect.construct(o, [],
|
|
224
|
+
Reflect.construct(o, [], Q);
|
|
225
225
|
} else {
|
|
226
226
|
try {
|
|
227
|
-
|
|
228
|
-
} catch (
|
|
229
|
-
_ =
|
|
227
|
+
Q.call();
|
|
228
|
+
} catch (Ne) {
|
|
229
|
+
_ = Ne;
|
|
230
230
|
}
|
|
231
|
-
o.call(
|
|
231
|
+
o.call(Q.prototype);
|
|
232
232
|
}
|
|
233
233
|
} else {
|
|
234
234
|
try {
|
|
235
235
|
throw Error();
|
|
236
|
-
} catch (
|
|
237
|
-
_ =
|
|
236
|
+
} catch (Ne) {
|
|
237
|
+
_ = Ne;
|
|
238
238
|
}
|
|
239
239
|
o();
|
|
240
240
|
}
|
|
241
|
-
} catch (
|
|
242
|
-
if (
|
|
243
|
-
for (var K =
|
|
241
|
+
} catch (Ne) {
|
|
242
|
+
if (Ne && _ && typeof Ne.stack == "string") {
|
|
243
|
+
for (var K = Ne.stack.split(`
|
|
244
244
|
`), Re = _.stack.split(`
|
|
245
|
-
`),
|
|
246
|
-
|
|
247
|
-
for (;
|
|
248
|
-
if (K[
|
|
249
|
-
if (
|
|
245
|
+
`), we = K.length - 1, be = Re.length - 1; we >= 1 && be >= 0 && K[we] !== Re[be]; )
|
|
246
|
+
be--;
|
|
247
|
+
for (; we >= 1 && be >= 0; we--, be--)
|
|
248
|
+
if (K[we] !== Re[be]) {
|
|
249
|
+
if (we !== 1 || be !== 1)
|
|
250
250
|
do
|
|
251
|
-
if (
|
|
251
|
+
if (we--, be--, be < 0 || K[we] !== Re[be]) {
|
|
252
252
|
var Be = `
|
|
253
|
-
` + K[
|
|
254
|
-
return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" &&
|
|
253
|
+
` + K[we].replace(" at new ", " at ");
|
|
254
|
+
return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" && q.set(o, Be), Be;
|
|
255
255
|
}
|
|
256
|
-
while (
|
|
256
|
+
while (we >= 1 && be >= 0);
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
} finally {
|
|
261
|
-
$ = !1, Le.current = oe,
|
|
261
|
+
$ = !1, Le.current = oe, ye(), Error.prepareStackTrace = te;
|
|
262
262
|
}
|
|
263
|
-
var
|
|
264
|
-
return typeof o == "function" &&
|
|
263
|
+
var Ge = o ? o.displayName || o.name : "", Ze = Ge ? Ye(Ge) : "";
|
|
264
|
+
return typeof o == "function" && q.set(o, Ze), Ze;
|
|
265
265
|
}
|
|
266
266
|
function ce(o, x, L) {
|
|
267
|
-
return
|
|
267
|
+
return Qe(o, !1);
|
|
268
268
|
}
|
|
269
269
|
function me(o) {
|
|
270
270
|
var x = o.prototype;
|
|
@@ -274,22 +274,22 @@ function cn() {
|
|
|
274
274
|
if (o == null)
|
|
275
275
|
return "";
|
|
276
276
|
if (typeof o == "function")
|
|
277
|
-
return
|
|
277
|
+
return Qe(o, me(o));
|
|
278
278
|
if (typeof o == "string")
|
|
279
279
|
return Ye(o);
|
|
280
280
|
switch (o) {
|
|
281
|
-
case p:
|
|
282
|
-
return Ye("Suspense");
|
|
283
281
|
case h:
|
|
282
|
+
return Ye("Suspense");
|
|
283
|
+
case p:
|
|
284
284
|
return Ye("SuspenseList");
|
|
285
285
|
}
|
|
286
286
|
if (typeof o == "object")
|
|
287
287
|
switch (o.$$typeof) {
|
|
288
288
|
case d:
|
|
289
289
|
return ce(o.render);
|
|
290
|
-
case
|
|
290
|
+
case S:
|
|
291
291
|
return Fe(o.type, x, L);
|
|
292
|
-
case
|
|
292
|
+
case y: {
|
|
293
293
|
var _ = o, te = _._payload, oe = _._init;
|
|
294
294
|
try {
|
|
295
295
|
return Fe(oe(te), x, L);
|
|
@@ -299,86 +299,86 @@ function cn() {
|
|
|
299
299
|
}
|
|
300
300
|
return "";
|
|
301
301
|
}
|
|
302
|
-
var
|
|
303
|
-
function
|
|
302
|
+
var pe = Object.prototype.hasOwnProperty, et = {}, _e = M.ReactDebugCurrentFrame;
|
|
303
|
+
function Xe(o) {
|
|
304
304
|
if (o) {
|
|
305
305
|
var x = o._owner, L = Fe(o.type, o._source, x ? x.type : null);
|
|
306
|
-
|
|
306
|
+
_e.setExtraStackFrame(L);
|
|
307
307
|
} else
|
|
308
|
-
|
|
308
|
+
_e.setExtraStackFrame(null);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Ue(o, x, L, _, te) {
|
|
311
311
|
{
|
|
312
|
-
var oe = Function.call.bind(
|
|
313
|
-
for (var
|
|
314
|
-
if (oe(o,
|
|
312
|
+
var oe = Function.call.bind(pe);
|
|
313
|
+
for (var Q in o)
|
|
314
|
+
if (oe(o, Q)) {
|
|
315
315
|
var K = void 0;
|
|
316
316
|
try {
|
|
317
|
-
if (typeof o[
|
|
318
|
-
var Re = Error((_ || "React class") + ": " + L + " type `" +
|
|
317
|
+
if (typeof o[Q] != "function") {
|
|
318
|
+
var Re = Error((_ || "React class") + ": " + L + " type `" + Q + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[Q] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
319
319
|
throw Re.name = "Invariant Violation", Re;
|
|
320
320
|
}
|
|
321
|
-
K = o[
|
|
322
|
-
} catch (
|
|
323
|
-
K =
|
|
321
|
+
K = o[Q](x, Q, _, L, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
322
|
+
} catch (we) {
|
|
323
|
+
K = we;
|
|
324
324
|
}
|
|
325
|
-
K && !(K instanceof Error) && (
|
|
325
|
+
K && !(K instanceof Error) && (Xe(te), v("%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).", _ || "React class", L, Q, typeof K), Xe(null)), K instanceof Error && !(K.message in et) && (et[K.message] = !0, Xe(te), v("Failed %s type: %s", L, K.message), Xe(null));
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
var
|
|
330
|
-
function at(o) {
|
|
331
|
-
return We(o);
|
|
332
|
-
}
|
|
329
|
+
var ot = Array.isArray;
|
|
333
330
|
function i(o) {
|
|
331
|
+
return ot(o);
|
|
332
|
+
}
|
|
333
|
+
function g(o) {
|
|
334
334
|
{
|
|
335
335
|
var x = typeof Symbol == "function" && Symbol.toStringTag, L = x && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
336
336
|
return L;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function D(o) {
|
|
340
340
|
try {
|
|
341
|
-
return
|
|
341
|
+
return f(o), !1;
|
|
342
342
|
} catch {
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function f(o) {
|
|
347
347
|
return "" + o;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
if (
|
|
351
|
-
return
|
|
349
|
+
function U(o) {
|
|
350
|
+
if (D(o))
|
|
351
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", g(o)), f(o);
|
|
352
352
|
}
|
|
353
|
-
var
|
|
353
|
+
var G = M.ReactCurrentOwner, ee = {
|
|
354
354
|
key: !0,
|
|
355
355
|
ref: !0,
|
|
356
356
|
__self: !0,
|
|
357
357
|
__source: !0
|
|
358
|
-
},
|
|
359
|
-
function
|
|
360
|
-
if (
|
|
358
|
+
}, ie, $e;
|
|
359
|
+
function ze(o) {
|
|
360
|
+
if (pe.call(o, "ref")) {
|
|
361
361
|
var x = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
362
362
|
if (x && x.isReactWarning)
|
|
363
363
|
return !1;
|
|
364
364
|
}
|
|
365
365
|
return o.ref !== void 0;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
367
|
+
function ge(o) {
|
|
368
|
+
if (pe.call(o, "key")) {
|
|
369
369
|
var x = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
370
370
|
if (x && x.isReactWarning)
|
|
371
371
|
return !1;
|
|
372
372
|
}
|
|
373
373
|
return o.key !== void 0;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
typeof o.ref == "string" &&
|
|
375
|
+
function tt(o, x) {
|
|
376
|
+
typeof o.ref == "string" && G.current;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Ke(o, x) {
|
|
379
379
|
{
|
|
380
380
|
var L = function() {
|
|
381
|
-
|
|
381
|
+
ie || (ie = !0, v("%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)", x));
|
|
382
382
|
};
|
|
383
383
|
L.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
384
384
|
get: L,
|
|
@@ -386,10 +386,10 @@ function cn() {
|
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function st(o, x) {
|
|
390
390
|
{
|
|
391
391
|
var L = function() {
|
|
392
|
-
|
|
392
|
+
$e || ($e = !0, v("%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)", x));
|
|
393
393
|
};
|
|
394
394
|
L.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
395
395
|
get: L,
|
|
@@ -397,7 +397,7 @@ function cn() {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
var
|
|
400
|
+
var Ce = function(o, x, L, _, te, oe, Q) {
|
|
401
401
|
var K = {
|
|
402
402
|
// This tag allows us to uniquely identify this as a React Element
|
|
403
403
|
$$typeof: a,
|
|
@@ -405,7 +405,7 @@ function cn() {
|
|
|
405
405
|
type: o,
|
|
406
406
|
key: x,
|
|
407
407
|
ref: L,
|
|
408
|
-
props:
|
|
408
|
+
props: Q,
|
|
409
409
|
// Record the component responsible for creating this element.
|
|
410
410
|
_owner: oe
|
|
411
411
|
};
|
|
@@ -428,32 +428,32 @@ function cn() {
|
|
|
428
428
|
};
|
|
429
429
|
function ht(o, x, L, _, te) {
|
|
430
430
|
{
|
|
431
|
-
var oe,
|
|
432
|
-
L !== void 0 && (
|
|
431
|
+
var oe, Q = {}, K = null, Re = null;
|
|
432
|
+
L !== void 0 && (U(L), K = "" + L), ge(x) && (U(x.key), K = "" + x.key), ze(x) && (Re = x.ref, tt(x, te));
|
|
433
433
|
for (oe in x)
|
|
434
|
-
|
|
434
|
+
pe.call(x, oe) && !ee.hasOwnProperty(oe) && (Q[oe] = x[oe]);
|
|
435
435
|
if (o && o.defaultProps) {
|
|
436
|
-
var
|
|
437
|
-
for (oe in
|
|
438
|
-
|
|
436
|
+
var we = o.defaultProps;
|
|
437
|
+
for (oe in we)
|
|
438
|
+
Q[oe] === void 0 && (Q[oe] = we[oe]);
|
|
439
439
|
}
|
|
440
440
|
if (K || Re) {
|
|
441
|
-
var
|
|
442
|
-
K &&
|
|
441
|
+
var be = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
442
|
+
K && Ke(Q, be), Re && st(Q, be);
|
|
443
443
|
}
|
|
444
|
-
return
|
|
444
|
+
return Ce(o, K, Re, te, _, G.current, Q);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
var xt = M.ReactCurrentOwner,
|
|
448
|
-
function
|
|
447
|
+
var xt = M.ReactCurrentOwner, kt = M.ReactDebugCurrentFrame;
|
|
448
|
+
function qe(o) {
|
|
449
449
|
if (o) {
|
|
450
450
|
var x = o._owner, L = Fe(o.type, o._source, x ? x.type : null);
|
|
451
|
-
|
|
451
|
+
kt.setExtraStackFrame(L);
|
|
452
452
|
} else
|
|
453
|
-
|
|
453
|
+
kt.setExtraStackFrame(null);
|
|
454
454
|
}
|
|
455
|
-
var
|
|
456
|
-
|
|
455
|
+
var it;
|
|
456
|
+
it = !1;
|
|
457
457
|
function wt(o) {
|
|
458
458
|
return typeof o == "object" && o !== null && o.$$typeof === a;
|
|
459
459
|
}
|
|
@@ -485,7 +485,7 @@ Check the top-level render call using <` + L + ">.");
|
|
|
485
485
|
return x;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Ot(o, x) {
|
|
489
489
|
{
|
|
490
490
|
if (!o._store || o._store.validated || o.key != null)
|
|
491
491
|
return;
|
|
@@ -495,29 +495,29 @@ Check the top-level render call using <` + L + ">.");
|
|
|
495
495
|
return;
|
|
496
496
|
Dt[L] = !0;
|
|
497
497
|
var _ = "";
|
|
498
|
-
o && o._owner && o._owner !== xt.current && (_ = " It was passed a child from " + B(o._owner.type) + "."),
|
|
498
|
+
o && o._owner && o._owner !== xt.current && (_ = " It was passed a child from " + B(o._owner.type) + "."), qe(o), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', L, _), qe(null);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
function Et(o, x) {
|
|
502
502
|
{
|
|
503
503
|
if (typeof o != "object")
|
|
504
504
|
return;
|
|
505
|
-
if (
|
|
505
|
+
if (i(o))
|
|
506
506
|
for (var L = 0; L < o.length; L++) {
|
|
507
507
|
var _ = o[L];
|
|
508
|
-
wt(_) &&
|
|
508
|
+
wt(_) && Ot(_, x);
|
|
509
509
|
}
|
|
510
510
|
else if (wt(o))
|
|
511
511
|
o._store && (o._store.validated = !0);
|
|
512
512
|
else if (o) {
|
|
513
513
|
var te = N(o);
|
|
514
514
|
if (typeof te == "function" && te !== o.entries)
|
|
515
|
-
for (var oe = te.call(o),
|
|
516
|
-
wt(
|
|
515
|
+
for (var oe = te.call(o), Q; !(Q = oe.next()).done; )
|
|
516
|
+
wt(Q.value) && Ot(Q.value, x);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function lt(o) {
|
|
521
521
|
{
|
|
522
522
|
var x = o.type;
|
|
523
523
|
if (x == null || typeof x == "string")
|
|
@@ -527,19 +527,19 @@ Check the top-level render call using <` + L + ">.");
|
|
|
527
527
|
L = x.propTypes;
|
|
528
528
|
else if (typeof x == "object" && (x.$$typeof === d || // Note: Memo only checks outer props here.
|
|
529
529
|
// Inner props are checked in the reconciler.
|
|
530
|
-
x.$$typeof ===
|
|
530
|
+
x.$$typeof === S))
|
|
531
531
|
L = x.propTypes;
|
|
532
532
|
else
|
|
533
533
|
return;
|
|
534
534
|
if (L) {
|
|
535
535
|
var _ = B(x);
|
|
536
|
-
|
|
537
|
-
} else if (x.PropTypes !== void 0 && !
|
|
538
|
-
|
|
536
|
+
Ue(L, o.props, "prop", _, o);
|
|
537
|
+
} else if (x.PropTypes !== void 0 && !it) {
|
|
538
|
+
it = !0;
|
|
539
539
|
var te = B(x);
|
|
540
|
-
|
|
540
|
+
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", te || "Unknown");
|
|
541
541
|
}
|
|
542
|
-
typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved &&
|
|
542
|
+
typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
function $t(o) {
|
|
@@ -547,56 +547,56 @@ Check the top-level render call using <` + L + ">.");
|
|
|
547
547
|
for (var x = Object.keys(o.props), L = 0; L < x.length; L++) {
|
|
548
548
|
var _ = x[L];
|
|
549
549
|
if (_ !== "children" && _ !== "key") {
|
|
550
|
-
|
|
550
|
+
qe(o), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), qe(null);
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
o.ref !== null && (
|
|
554
|
+
o.ref !== null && (qe(o), v("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
var Bt = {};
|
|
558
558
|
function Ae(o, x, L, _, te, oe) {
|
|
559
559
|
{
|
|
560
|
-
var
|
|
561
|
-
if (!
|
|
560
|
+
var Q = X(o);
|
|
561
|
+
if (!Q) {
|
|
562
562
|
var K = "";
|
|
563
563
|
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (K += " 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
564
|
var Re = zt();
|
|
565
565
|
Re ? K += Re : K += Tt();
|
|
566
|
-
var
|
|
567
|
-
o === null ?
|
|
566
|
+
var we;
|
|
567
|
+
o === null ? we = "null" : i(o) ? we = "array" : o !== void 0 && o.$$typeof === a ? (we = "<" + (B(o.type) || "Unknown") + " />", K = " Did you accidentally export a JSX literal instead of a component?") : we = typeof o, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", we, K);
|
|
568
568
|
}
|
|
569
|
-
var
|
|
570
|
-
if (
|
|
571
|
-
return
|
|
572
|
-
if (
|
|
569
|
+
var be = ht(o, x, L, te, oe);
|
|
570
|
+
if (be == null)
|
|
571
|
+
return be;
|
|
572
|
+
if (Q) {
|
|
573
573
|
var Be = x.children;
|
|
574
574
|
if (Be !== void 0)
|
|
575
575
|
if (_)
|
|
576
|
-
if (
|
|
577
|
-
for (var
|
|
578
|
-
Et(Be[
|
|
576
|
+
if (i(Be)) {
|
|
577
|
+
for (var Ge = 0; Ge < Be.length; Ge++)
|
|
578
|
+
Et(Be[Ge], o);
|
|
579
579
|
Object.freeze && Object.freeze(Be);
|
|
580
580
|
} else
|
|
581
|
-
|
|
581
|
+
v("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
|
Et(Be, o);
|
|
584
584
|
}
|
|
585
|
-
if (
|
|
586
|
-
var
|
|
585
|
+
if (pe.call(x, "key")) {
|
|
586
|
+
var Ze = B(o), Ne = Object.keys(x).filter(function(Ut) {
|
|
587
587
|
return Ut !== "key";
|
|
588
|
-
}), bt =
|
|
589
|
-
if (!Bt[
|
|
590
|
-
var Xt =
|
|
591
|
-
|
|
588
|
+
}), bt = Ne.length > 0 ? "{key: someKey, " + Ne.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
589
|
+
if (!Bt[Ze + bt]) {
|
|
590
|
+
var Xt = Ne.length > 0 ? "{" + Ne.join(": ..., ") + ": ...}" : "{}";
|
|
591
|
+
v(`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} />`, bt,
|
|
596
|
+
<%s key={someKey} {...props} />`, bt, Ze, Xt, Ze), Bt[Ze + bt] = !0;
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
return o === s ? $t(
|
|
599
|
+
return o === s ? $t(be) : lt(be), be;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
function Ht(o, x, L) {
|
|
@@ -658,8 +658,8 @@ const Te = (e, a, n) => {
|
|
|
658
658
|
H: String(e.getHours()),
|
|
659
659
|
mm: String(e.getMinutes()).padStart(2, "0"),
|
|
660
660
|
m: String(e.getMinutes())
|
|
661
|
-
};
|
|
662
|
-
return a.replace(/
|
|
661
|
+
}, b = /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, u = [];
|
|
662
|
+
return a.replace(/\[([^\]]*)\]/g, (p, S) => (u.push(S), `${u.length - 1}`)).replace(b, (p) => c[p]).replace(/\uE000(\d+)\uE001/g, (p, S) => u[Number(S)]);
|
|
663
663
|
}, Kt = (e) => {
|
|
664
664
|
const a = e.getDay();
|
|
665
665
|
return a === 0 || a === 6;
|
|
@@ -668,10 +668,10 @@ const Te = (e, a, n) => {
|
|
|
668
668
|
), yt = (e) => {
|
|
669
669
|
const a = new Date(e);
|
|
670
670
|
return a.setHours(0, 0, 0, 0), a;
|
|
671
|
-
},
|
|
671
|
+
}, la = (e) => {
|
|
672
672
|
const a = new Date(e);
|
|
673
673
|
return a.setHours(23, 59, 59, 999), a;
|
|
674
|
-
},
|
|
674
|
+
}, da = (e, a, n = "day") => {
|
|
675
675
|
switch (n) {
|
|
676
676
|
case "hour":
|
|
677
677
|
return pn(e, a);
|
|
@@ -837,7 +837,7 @@ const jt = (e) => e ? {
|
|
|
837
837
|
lineHeight: e.lineHeight || 1.5714285714285714,
|
|
838
838
|
color: e.fontColor || "rgba(0, 0, 0, 0.88)"
|
|
839
839
|
}
|
|
840
|
-
} : {}, { Text:
|
|
840
|
+
} : {}, { Text: We, Paragraph: gn } = br, { Option: dt } = Oe, yn = ({
|
|
841
841
|
task: e,
|
|
842
842
|
allTasks: a,
|
|
843
843
|
links: n,
|
|
@@ -847,8 +847,8 @@ const jt = (e) => e ? {
|
|
|
847
847
|
children: b,
|
|
848
848
|
styleConfig: u
|
|
849
849
|
}) => {
|
|
850
|
-
const d = jt(u), [
|
|
851
|
-
if (
|
|
850
|
+
const d = jt(u), [h, p] = J(!1), [S, y] = J(null), [m, E] = J("e2s"), [F, N] = J("lag"), [M, v] = J(0), [w, C] = J(e.duration), [Z, W] = J(!0), re = "day", le = n.find((V) => V.target === e.id), j = !!le, X = A.useMemo(() => a.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...a.map((V) => V.start.getTime()))), [a]), R = () => {
|
|
851
|
+
if (S) {
|
|
852
852
|
const V = F === "lag" ? M : -M, I = rr(V, re);
|
|
853
853
|
if (w !== e.duration && c) {
|
|
854
854
|
const ne = Te(new Date(e.start), w, "day");
|
|
@@ -858,28 +858,28 @@ const jt = (e) => e ? {
|
|
|
858
858
|
end: ne
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
s(
|
|
861
|
+
s(S, e.id, m, I), p(!1), k();
|
|
862
862
|
}
|
|
863
|
-
},
|
|
864
|
-
|
|
863
|
+
}, k = () => {
|
|
864
|
+
y(null), E("e2s"), N("lag"), v(0), C(e.duration);
|
|
865
865
|
}, B = () => {
|
|
866
|
-
le && r && (r(le.id),
|
|
866
|
+
le && r && (r(le.id), p(!1), k());
|
|
867
867
|
}, Y = (V) => {
|
|
868
|
-
if (
|
|
868
|
+
if (p(V), V) {
|
|
869
869
|
if (W(!0), le) {
|
|
870
|
-
|
|
870
|
+
y(le.source), E(le.type);
|
|
871
871
|
const I = le.lag || 0;
|
|
872
|
-
I >= 0 ? (N("lag"),
|
|
872
|
+
I >= 0 ? (N("lag"), v(I)) : (N("lead"), v(Math.abs(I)));
|
|
873
873
|
} else
|
|
874
|
-
|
|
874
|
+
k();
|
|
875
875
|
C(e.duration);
|
|
876
876
|
}
|
|
877
|
-
},
|
|
877
|
+
}, O = () => {
|
|
878
878
|
if (!Z) return null;
|
|
879
879
|
const V = m === "e2s", I = m === "s2s", ne = m === "e2e", de = m === "s2e";
|
|
880
|
-
let se = 0, ue = 0, z = "",
|
|
881
|
-
V ? (se = 50, ue = 350,
|
|
882
|
-
const Ie =
|
|
880
|
+
let se = 0, ue = 0, z = "", ye = 0, Le = -1;
|
|
881
|
+
V ? (se = 50, ue = 350, ye = 250, Le = 350, z = "M 250 60 L 300 60 L 300 140 L 348 140") : ne ? (se = 100, ue = 100, ye = 300, Le = -1, z = "M 300 60 L 350 60 L 350 140 L 302 140") : I ? (se = 250, ue = 250, ye = 250, Le = -1, z = "M 250 60 L 200 60 L 200 140 L 248 140") : de && (se = 350, ue = 50, ye = 350, Le = 250, z = "M 350 60 L 300 60 L 300 140 L 252 140");
|
|
882
|
+
const Ie = S === "gantt-start-date", Ye = a.find(($) => $.id === S);
|
|
883
883
|
return /* @__PURE__ */ t.jsx("div", { style: {
|
|
884
884
|
width: "100%",
|
|
885
885
|
height: 90,
|
|
@@ -892,7 +892,7 @@ const jt = (e) => e ? {
|
|
|
892
892
|
flexShrink: 0
|
|
893
893
|
}, children: /* @__PURE__ */ t.jsxs("svg", { viewBox: "0 0 600 200", style: { width: "100%", height: "100%" }, preserveAspectRatio: "xMidYMid meet", children: [
|
|
894
894
|
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("marker", { id: "arrowhead", markerWidth: "12", markerHeight: "9", refX: "12", refY: "4.5", orient: "auto", children: /* @__PURE__ */ t.jsx("polygon", { points: "0 0, 12 4.5, 0 9", fill: "#8c8c8c" }) }) }),
|
|
895
|
-
/* @__PURE__ */ t.jsx("line", { x1:
|
|
895
|
+
/* @__PURE__ */ t.jsx("line", { x1: ye, x2: ye, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
896
896
|
Le !== -1 && /* @__PURE__ */ t.jsx("line", { x1: Le, x2: Le, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
897
897
|
/* @__PURE__ */ t.jsx("rect", { x: se, y: "35", width: "200", height: "50", rx: "4", fill: "#e6f4ff", stroke: "#91caff", strokeWidth: "2" }),
|
|
898
898
|
/* @__PURE__ */ t.jsx("text", { x: se + 100, y: "66", fontSize: "15", textAnchor: "middle", fill: "#003a8c", fontWeight: "600", children: Ie ? "Start Date" : Ye ? `Stage ${a.indexOf(Ye) + 1}` : "Predecessor" }),
|
|
@@ -904,8 +904,8 @@ const jt = (e) => e ? {
|
|
|
904
904
|
/* @__PURE__ */ t.jsx("path", { d: z, fill: "none", stroke: "#8c8c8c", strokeWidth: "2.5", markerEnd: "url(#arrowhead)" })
|
|
905
905
|
] }) });
|
|
906
906
|
}, De = () => {
|
|
907
|
-
const V =
|
|
908
|
-
if (!
|
|
907
|
+
const V = S === "gantt-start-date", I = a.find((ue) => ue.id === S);
|
|
908
|
+
if (!S) return "Select a checklist from the list to see how it will relate to the current stage.";
|
|
909
909
|
const ne = a.indexOf(e) + 1, de = V ? "Start Date" : `Stage ${a.indexOf(I) + 1}`;
|
|
910
910
|
let se = "";
|
|
911
911
|
switch (m) {
|
|
@@ -927,7 +927,7 @@ const jt = (e) => e ? {
|
|
|
927
927
|
F === "lag" ? se += ` + ${ue} delay` : se += ` - ${ue} overlap`;
|
|
928
928
|
}
|
|
929
929
|
return se + ".";
|
|
930
|
-
},
|
|
930
|
+
}, Se = /* @__PURE__ */ t.jsxs("div", { style: {
|
|
931
931
|
width: 550,
|
|
932
932
|
backgroundColor: d.popover?.backgroundColor || "#fff",
|
|
933
933
|
borderRadius: d.popover?.borderRadius || "8px",
|
|
@@ -935,15 +935,15 @@ const jt = (e) => e ? {
|
|
|
935
935
|
boxShadow: d.popover?.boxShadow,
|
|
936
936
|
fontFamily: d.popover?.fontFamily
|
|
937
937
|
}, children: [
|
|
938
|
-
/* @__PURE__ */ t.jsx(
|
|
938
|
+
/* @__PURE__ */ t.jsx(We, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color: d.font?.color }, children: "Add Dependency" }),
|
|
939
939
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
|
|
940
940
|
/* @__PURE__ */ t.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
941
|
-
|
|
941
|
+
Oe,
|
|
942
942
|
{
|
|
943
943
|
showSearch: !0,
|
|
944
944
|
placeholder: "Select checklist",
|
|
945
|
-
value:
|
|
946
|
-
onChange:
|
|
945
|
+
value: S,
|
|
946
|
+
onChange: y,
|
|
947
947
|
style: { width: "100%" },
|
|
948
948
|
filterOption: (V, I) => {
|
|
949
949
|
if (I?.value === "gantt-start-date")
|
|
@@ -955,63 +955,63 @@ const jt = (e) => e ? {
|
|
|
955
955
|
},
|
|
956
956
|
optionLabelProp: "label",
|
|
957
957
|
children: [
|
|
958
|
-
a.filter((V) => V.id !== e.id).map((V) => /* @__PURE__ */ t.jsx(
|
|
959
|
-
/* @__PURE__ */ t.jsxs(
|
|
958
|
+
a.filter((V) => V.id !== e.id).map((V) => /* @__PURE__ */ t.jsx(dt, { value: V.id, label: V.text, children: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0" }, children: [
|
|
959
|
+
/* @__PURE__ */ t.jsxs(We, { style: { fontSize: "13px" }, children: [
|
|
960
960
|
a.indexOf(V) + 1,
|
|
961
961
|
". ",
|
|
962
962
|
V.text
|
|
963
963
|
] }),
|
|
964
|
-
/* @__PURE__ */ t.jsxs(
|
|
964
|
+
/* @__PURE__ */ t.jsxs(We, { type: "secondary", style: { fontSize: "11px" }, children: [
|
|
965
965
|
"Start: ",
|
|
966
966
|
ke(V.start, "MMM D, YYYY")
|
|
967
967
|
] })
|
|
968
968
|
] }) }, V.id)),
|
|
969
|
-
/* @__PURE__ */ t.jsx(
|
|
970
|
-
/* @__PURE__ */ t.jsx(
|
|
971
|
-
/* @__PURE__ */ t.jsx(
|
|
969
|
+
/* @__PURE__ */ t.jsx(dt, { value: "gantt-start-date", label: "Start Date", children: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0", borderTop: "1px solid #f0f0f0", marginTop: "4px", paddingTop: "8px" }, children: [
|
|
970
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "13px", fontWeight: 600 }, children: "Start Date" }),
|
|
971
|
+
/* @__PURE__ */ t.jsx(We, { type: "secondary", style: { fontSize: "11px" }, children: ke(X, "MMM D, YYYY") })
|
|
972
972
|
] }) }, "gantt-start-date")
|
|
973
973
|
]
|
|
974
974
|
}
|
|
975
975
|
) }),
|
|
976
976
|
/* @__PURE__ */ t.jsx("div", { style: { width: 100 }, children: /* @__PURE__ */ t.jsxs(
|
|
977
|
-
|
|
977
|
+
Oe,
|
|
978
978
|
{
|
|
979
979
|
value: m,
|
|
980
980
|
onChange: E,
|
|
981
981
|
style: { width: "100%" },
|
|
982
982
|
children: [
|
|
983
|
-
/* @__PURE__ */ t.jsx(
|
|
984
|
-
/* @__PURE__ */ t.jsx(
|
|
985
|
-
/* @__PURE__ */ t.jsx(
|
|
986
|
-
/* @__PURE__ */ t.jsx(
|
|
983
|
+
/* @__PURE__ */ t.jsx(dt, { value: "e2s", children: "FS" }),
|
|
984
|
+
/* @__PURE__ */ t.jsx(dt, { value: "e2e", children: "FF" }),
|
|
985
|
+
/* @__PURE__ */ t.jsx(dt, { value: "s2s", children: "SS" }),
|
|
986
|
+
/* @__PURE__ */ t.jsx(dt, { value: "s2e", children: "SF" })
|
|
987
987
|
]
|
|
988
988
|
}
|
|
989
989
|
) })
|
|
990
990
|
] }),
|
|
991
991
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
|
|
992
992
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
993
|
-
/* @__PURE__ */ t.jsx(
|
|
993
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: d.font?.color }, children: "Delay type" }),
|
|
994
994
|
/* @__PURE__ */ t.jsxs(
|
|
995
|
-
|
|
995
|
+
Oe,
|
|
996
996
|
{
|
|
997
997
|
value: F,
|
|
998
998
|
onChange: N,
|
|
999
999
|
style: { width: "100%" },
|
|
1000
1000
|
children: [
|
|
1001
|
-
/* @__PURE__ */ t.jsx(
|
|
1002
|
-
/* @__PURE__ */ t.jsx(
|
|
1001
|
+
/* @__PURE__ */ t.jsx(dt, { value: "lag", children: "Lag by" }),
|
|
1002
|
+
/* @__PURE__ */ t.jsx(dt, { value: "lead", children: "Lead by" })
|
|
1003
1003
|
]
|
|
1004
1004
|
}
|
|
1005
1005
|
)
|
|
1006
1006
|
] }),
|
|
1007
1007
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
1008
|
-
/* @__PURE__ */ t.jsx(
|
|
1008
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: d.font?.color }, children: "Days" }),
|
|
1009
1009
|
/* @__PURE__ */ t.jsx(
|
|
1010
|
-
|
|
1010
|
+
at,
|
|
1011
1011
|
{
|
|
1012
1012
|
min: 0,
|
|
1013
1013
|
value: M,
|
|
1014
|
-
onChange: (V) =>
|
|
1014
|
+
onChange: (V) => v(V || 0),
|
|
1015
1015
|
style: { width: "100%" },
|
|
1016
1016
|
placeholder: "0"
|
|
1017
1017
|
}
|
|
@@ -1019,9 +1019,9 @@ const jt = (e) => e ? {
|
|
|
1019
1019
|
] })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ t.jsxs("div", { style: { marginBottom: 14 }, children: [
|
|
1022
|
-
/* @__PURE__ */ t.jsx(
|
|
1022
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: d.font?.color }, children: "Duration (days)" }),
|
|
1023
1023
|
/* @__PURE__ */ t.jsx(
|
|
1024
|
-
|
|
1024
|
+
at,
|
|
1025
1025
|
{
|
|
1026
1026
|
min: 1,
|
|
1027
1027
|
value: w,
|
|
@@ -1037,13 +1037,13 @@ const jt = (e) => e ? {
|
|
|
1037
1037
|
borderRadius: "4px",
|
|
1038
1038
|
marginBottom: 14
|
|
1039
1039
|
}, children: /* @__PURE__ */ t.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
|
|
1040
|
-
/* @__PURE__ */ t.jsx(
|
|
1041
|
-
/* @__PURE__ */ t.jsx(
|
|
1042
|
-
/* @__PURE__ */ t.jsx(
|
|
1043
|
-
/* @__PURE__ */ t.jsx(
|
|
1040
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "11px", color: d.font?.color }, children: "FS: Finish to Start" }),
|
|
1041
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "11px", color: d.font?.color }, children: "SS: Start to Start" }),
|
|
1042
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "11px", color: d.font?.color }, children: "FF: Finish to Finish" }),
|
|
1043
|
+
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "11px", color: d.font?.color }, children: "SF: Start to Finish" })
|
|
1044
1044
|
] }) }),
|
|
1045
1045
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
|
|
1046
|
-
/* @__PURE__ */ t.jsx(
|
|
1046
|
+
/* @__PURE__ */ t.jsx(We, { strong: !0, style: { fontSize: "13px", color: d.font?.color }, children: "Dependency preview" }),
|
|
1047
1047
|
/* @__PURE__ */ t.jsx(
|
|
1048
1048
|
"a",
|
|
1049
1049
|
{
|
|
@@ -1059,7 +1059,7 @@ const jt = (e) => e ? {
|
|
|
1059
1059
|
)
|
|
1060
1060
|
] }),
|
|
1061
1061
|
Z && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1062
|
-
|
|
1062
|
+
O(),
|
|
1063
1063
|
/* @__PURE__ */ t.jsx(gn, { style: {
|
|
1064
1064
|
fontSize: "12px",
|
|
1065
1065
|
color: d.font?.color || "#262626",
|
|
@@ -1069,7 +1069,7 @@ const jt = (e) => e ? {
|
|
|
1069
1069
|
] }),
|
|
1070
1070
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 10 }, children: [
|
|
1071
1071
|
j && /* @__PURE__ */ t.jsx(
|
|
1072
|
-
|
|
1072
|
+
Pe,
|
|
1073
1073
|
{
|
|
1074
1074
|
danger: !0,
|
|
1075
1075
|
onClick: B,
|
|
@@ -1080,11 +1080,11 @@ const jt = (e) => e ? {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
),
|
|
1082
1082
|
/* @__PURE__ */ t.jsx(
|
|
1083
|
-
|
|
1083
|
+
Pe,
|
|
1084
1084
|
{
|
|
1085
1085
|
type: "primary",
|
|
1086
1086
|
onClick: R,
|
|
1087
|
-
disabled: !
|
|
1087
|
+
disabled: !S,
|
|
1088
1088
|
style: {
|
|
1089
1089
|
...d.buttonPrimary,
|
|
1090
1090
|
minWidth: 100
|
|
@@ -1097,9 +1097,9 @@ const jt = (e) => e ? {
|
|
|
1097
1097
|
return /* @__PURE__ */ t.jsx(
|
|
1098
1098
|
zr,
|
|
1099
1099
|
{
|
|
1100
|
-
content:
|
|
1100
|
+
content: Se,
|
|
1101
1101
|
trigger: "click",
|
|
1102
|
-
open:
|
|
1102
|
+
open: h,
|
|
1103
1103
|
onOpenChange: Y,
|
|
1104
1104
|
placement: "bottomLeft",
|
|
1105
1105
|
overlayClassName: "dependency-popover",
|
|
@@ -1108,25 +1108,25 @@ const jt = (e) => e ? {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
1110
|
}, Er = Ir(wr(
|
|
1111
|
-
({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency:
|
|
1111
|
+
({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency: h, onRemoveDependency: p, links: S = [], dropIndicator: y, reorderTask: m, styleConfig: E, headerHeight: F }, N) => {
|
|
1112
1112
|
const M = A.useRef(null);
|
|
1113
1113
|
A.useImperativeHandle(N, () => M.current);
|
|
1114
|
-
const [
|
|
1115
|
-
if (!j.parent) return
|
|
1116
|
-
const R = e.find((
|
|
1117
|
-
return R ? W(R,
|
|
1118
|
-
}, re = (j,
|
|
1119
|
-
if (
|
|
1120
|
-
const R = Te(new Date(j.start),
|
|
1114
|
+
const [v, w] = A.useState(null), [C, Z] = A.useState(0), W = (j, X = 0) => {
|
|
1115
|
+
if (!j.parent) return X;
|
|
1116
|
+
const R = e.find((k) => k.id === j.parent);
|
|
1117
|
+
return R ? W(R, X + 1) : X;
|
|
1118
|
+
}, re = (j, X) => {
|
|
1119
|
+
if (X === j.duration) return;
|
|
1120
|
+
const R = Te(new Date(j.start), X, "day");
|
|
1121
1121
|
b?.({
|
|
1122
1122
|
...j,
|
|
1123
|
-
duration:
|
|
1123
|
+
duration: X,
|
|
1124
1124
|
end: R
|
|
1125
1125
|
});
|
|
1126
|
-
}, le = (j,
|
|
1127
|
-
if (
|
|
1128
|
-
return
|
|
1129
|
-
switch (
|
|
1126
|
+
}, le = (j, X) => {
|
|
1127
|
+
if (X.template)
|
|
1128
|
+
return X.template(j);
|
|
1129
|
+
switch (X.name) {
|
|
1130
1130
|
case "text": {
|
|
1131
1131
|
const R = W(j);
|
|
1132
1132
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft: R * 14 }, children: [
|
|
@@ -1134,14 +1134,14 @@ const jt = (e) => e ? {
|
|
|
1134
1134
|
"div",
|
|
1135
1135
|
{
|
|
1136
1136
|
className: "gantt-row-drag-handle",
|
|
1137
|
-
onMouseDown: (
|
|
1138
|
-
|
|
1137
|
+
onMouseDown: (k) => {
|
|
1138
|
+
k.preventDefault(), u?.(j.id, k.clientX, k.clientY, "reorder");
|
|
1139
1139
|
},
|
|
1140
1140
|
children: /* @__PURE__ */ t.jsx(Ee, { icon: Xr })
|
|
1141
1141
|
}
|
|
1142
1142
|
),
|
|
1143
|
-
j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (
|
|
1144
|
-
|
|
1143
|
+
j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (k) => {
|
|
1144
|
+
k.stopPropagation(), b?.({ ...j, open: !j.open });
|
|
1145
1145
|
}, children: /* @__PURE__ */ t.jsx(Ee, { icon: j.open ? cr : Ur }) }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, display: "inline-block" } }),
|
|
1146
1146
|
/* @__PURE__ */ t.jsx("span", { className: "gantt-task-name-text", children: j.text })
|
|
1147
1147
|
] });
|
|
@@ -1151,13 +1151,13 @@ const jt = (e) => e ? {
|
|
|
1151
1151
|
case "end":
|
|
1152
1152
|
return ke(j.end, "DD-MM-YYYY");
|
|
1153
1153
|
case "duration":
|
|
1154
|
-
return
|
|
1155
|
-
|
|
1154
|
+
return v === j.id ? /* @__PURE__ */ t.jsx(
|
|
1155
|
+
at,
|
|
1156
1156
|
{
|
|
1157
1157
|
size: "small",
|
|
1158
1158
|
min: 1,
|
|
1159
1159
|
value: C,
|
|
1160
|
-
onChange: (
|
|
1160
|
+
onChange: (k) => Z(k || 1),
|
|
1161
1161
|
onBlur: () => {
|
|
1162
1162
|
re(j, C), w(null);
|
|
1163
1163
|
},
|
|
@@ -1170,8 +1170,8 @@ const jt = (e) => e ? {
|
|
|
1170
1170
|
) : /* @__PURE__ */ t.jsxs(
|
|
1171
1171
|
"div",
|
|
1172
1172
|
{
|
|
1173
|
-
onClick: (
|
|
1174
|
-
|
|
1173
|
+
onClick: (k) => {
|
|
1174
|
+
k.stopPropagation(), w(j.id), Z(j.duration);
|
|
1175
1175
|
},
|
|
1176
1176
|
style: {
|
|
1177
1177
|
backgroundColor: "#fff7e6",
|
|
@@ -1192,15 +1192,15 @@ const jt = (e) => e ? {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
case "predecessors": {
|
|
1195
|
-
const
|
|
1195
|
+
const k = S.filter((B) => B.target === j.id)[0];
|
|
1196
1196
|
return /* @__PURE__ */ t.jsx(
|
|
1197
1197
|
yn,
|
|
1198
1198
|
{
|
|
1199
1199
|
task: j,
|
|
1200
1200
|
allTasks: a,
|
|
1201
|
-
links:
|
|
1202
|
-
onAddDependency: (B, Y,
|
|
1203
|
-
onRemoveDependency: (B) =>
|
|
1201
|
+
links: S,
|
|
1202
|
+
onAddDependency: (B, Y, O, De) => h?.(B, Y, O, De),
|
|
1203
|
+
onRemoveDependency: (B) => p?.(B),
|
|
1204
1204
|
onTaskUpdate: b,
|
|
1205
1205
|
styleConfig: E,
|
|
1206
1206
|
children: /* @__PURE__ */ t.jsx(
|
|
@@ -1214,8 +1214,8 @@ const jt = (e) => e ? {
|
|
|
1214
1214
|
alignItems: "center",
|
|
1215
1215
|
gap: "4px"
|
|
1216
1216
|
},
|
|
1217
|
-
children:
|
|
1218
|
-
const B = a.find((
|
|
1217
|
+
children: k ? (() => {
|
|
1218
|
+
const B = a.find((O) => O.id === k.source), Y = B ? a.indexOf(B) + 1 : 0;
|
|
1219
1219
|
return /* @__PURE__ */ t.jsx(
|
|
1220
1220
|
"span",
|
|
1221
1221
|
{
|
|
@@ -1228,7 +1228,7 @@ const jt = (e) => e ? {
|
|
|
1228
1228
|
borderRadius: "4px",
|
|
1229
1229
|
whiteSpace: "nowrap"
|
|
1230
1230
|
},
|
|
1231
|
-
children: mn(
|
|
1231
|
+
children: mn(k, Y)
|
|
1232
1232
|
}
|
|
1233
1233
|
);
|
|
1234
1234
|
})() : /* @__PURE__ */ t.jsx(
|
|
@@ -1252,7 +1252,7 @@ const jt = (e) => e ? {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
case "add":
|
|
1254
1254
|
return /* @__PURE__ */ t.jsx(
|
|
1255
|
-
|
|
1255
|
+
Pe,
|
|
1256
1256
|
{
|
|
1257
1257
|
type: "primary",
|
|
1258
1258
|
size: "small",
|
|
@@ -1290,7 +1290,7 @@ const jt = (e) => e ? {
|
|
|
1290
1290
|
case "index":
|
|
1291
1291
|
return /* @__PURE__ */ t.jsx("span", { style: { color: "#8c8c8c" }, children: a.indexOf(j) + 1 });
|
|
1292
1292
|
default:
|
|
1293
|
-
return j[
|
|
1293
|
+
return j[X.name] || "";
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid", ref: M, children: [
|
|
@@ -1312,44 +1312,44 @@ const jt = (e) => e ? {
|
|
|
1312
1312
|
j.name
|
|
1313
1313
|
)) }),
|
|
1314
1314
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-body", children: e.map((j) => {
|
|
1315
|
-
const
|
|
1315
|
+
const X = m?.id === j.id, R = m?.descendantIds.includes(j.id);
|
|
1316
1316
|
return /* @__PURE__ */ t.jsxs(
|
|
1317
1317
|
"div",
|
|
1318
1318
|
{
|
|
1319
|
-
className: `gantt-grid-row ${s === j.id ? "selected" : ""} ${
|
|
1319
|
+
className: `gantt-grid-row ${s === j.id ? "selected" : ""} ${X ? "dragging-row" : ""} ${R ? "descendant-dragging-row" : ""} ${y?.taskId === j.id ? `drop-target-${y.position}` : ""}`,
|
|
1320
1320
|
onClick: () => r(j.id),
|
|
1321
|
-
onContextMenu: (
|
|
1321
|
+
onContextMenu: (k) => c?.(k, j.id),
|
|
1322
1322
|
style: {
|
|
1323
1323
|
display: "flex",
|
|
1324
1324
|
minWidth: "100%"
|
|
1325
1325
|
/* Ensure row spans all columns */
|
|
1326
1326
|
},
|
|
1327
1327
|
children: [
|
|
1328
|
-
n.map((
|
|
1329
|
-
const B =
|
|
1328
|
+
n.map((k) => {
|
|
1329
|
+
const B = k.name === "add";
|
|
1330
1330
|
return /* @__PURE__ */ t.jsx(
|
|
1331
1331
|
"div",
|
|
1332
1332
|
{
|
|
1333
1333
|
className: "gantt-grid-cell",
|
|
1334
1334
|
style: {
|
|
1335
|
-
width:
|
|
1336
|
-
minWidth:
|
|
1335
|
+
width: k.width,
|
|
1336
|
+
minWidth: k.width,
|
|
1337
1337
|
/* Ensure column maintains width */
|
|
1338
|
-
textAlign:
|
|
1338
|
+
textAlign: k.align || "left",
|
|
1339
1339
|
display: "flex",
|
|
1340
1340
|
alignItems: "center",
|
|
1341
|
-
justifyContent: B ? "center" :
|
|
1341
|
+
justifyContent: B ? "center" : k.name === "text" ? "flex-start" : k.align === "center" ? "center" : k.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: le(j,
|
|
1347
|
+
children: le(j, k)
|
|
1348
1348
|
},
|
|
1349
|
-
`${j.id}-${
|
|
1349
|
+
`${j.id}-${k.name}`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
|
|
1352
|
+
y?.taskId === j.id && /* @__PURE__ */ t.jsx("div", { className: `gantt-drop-indicator ${y.position}` })
|
|
1353
1353
|
]
|
|
1354
1354
|
},
|
|
1355
1355
|
j.id
|
|
@@ -1369,35 +1369,35 @@ const xn = ({
|
|
|
1369
1369
|
dragDeltaX: b = 0,
|
|
1370
1370
|
dragType: u = null,
|
|
1371
1371
|
readonly: d = !1,
|
|
1372
|
-
baseline:
|
|
1373
|
-
dependencyRuleDescriptions:
|
|
1374
|
-
tooltipConfig:
|
|
1372
|
+
baseline: h,
|
|
1373
|
+
dependencyRuleDescriptions: p = [],
|
|
1374
|
+
tooltipConfig: S
|
|
1375
1375
|
}) => {
|
|
1376
|
-
const
|
|
1377
|
-
d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY,
|
|
1376
|
+
const y = e.ShowHandle !== void 0 ? e.ShowHandle : !0, m = ($, q) => {
|
|
1377
|
+
d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY, q));
|
|
1378
1378
|
}, E = () => {
|
|
1379
1379
|
const $ = ["gantt-task-bar"];
|
|
1380
1380
|
if (e.type === "milestone" && $.push("milestone"), e.type === "project" && $.push("project"), n && $.push("selected"), s && $.push("dragging"), e.status) {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1381
|
+
const q = String(e.status).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
1382
|
+
q && $.push(`status-${q}`);
|
|
1383
1383
|
}
|
|
1384
1384
|
return $.join(" ");
|
|
1385
1385
|
}, F = () => {
|
|
1386
|
-
let $ = a.left,
|
|
1387
|
-
s && u && (u === "move" ? $ += b : u === "resize-left" ? ($ += b,
|
|
1388
|
-
const
|
|
1389
|
-
return e.type === "milestone" &&
|
|
1386
|
+
let $ = a.left, q = a.width;
|
|
1387
|
+
s && u && (u === "move" ? $ += b : u === "resize-left" ? ($ += b, q -= b) : u === "resize-right" && (q += b));
|
|
1388
|
+
const xe = 20;
|
|
1389
|
+
return e.type === "milestone" && q < xe && ($ -= (xe - q) / 2, q = xe), {
|
|
1390
1390
|
left: `${$}px`,
|
|
1391
|
-
width: `${Math.max(
|
|
1391
|
+
width: `${Math.max(q, 0)}px`,
|
|
1392
1392
|
// Color handled by CSS classes (.project, .milestone) or task.color override
|
|
1393
1393
|
backgroundColor: e.color || void 0
|
|
1394
1394
|
};
|
|
1395
1395
|
}, N = ($ = !1) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1396
|
-
!d &&
|
|
1396
|
+
!d && y && !$ && /* @__PURE__ */ t.jsx(
|
|
1397
1397
|
"div",
|
|
1398
1398
|
{
|
|
1399
1399
|
className: "gantt-task-resize-handle gantt-task-resize-left",
|
|
1400
|
-
onMouseDown: (
|
|
1400
|
+
onMouseDown: (q) => m(q, "resize-left")
|
|
1401
1401
|
}
|
|
1402
1402
|
),
|
|
1403
1403
|
!$ && e.type !== "milestone" && /* @__PURE__ */ t.jsx(
|
|
@@ -1412,50 +1412,50 @@ const xn = ({
|
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
1414
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-task-content", children: !$ && /* @__PURE__ */ t.jsx("span", { className: "gantt-task-text", children: e.text }) }),
|
|
1415
|
-
!d &&
|
|
1415
|
+
!d && y && !$ && /* @__PURE__ */ t.jsx(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
1418
1418
|
className: "gantt-task-resize-handle gantt-task-resize-right",
|
|
1419
|
-
onMouseDown: (
|
|
1419
|
+
onMouseDown: (q) => m(q, "resize-right")
|
|
1420
1420
|
}
|
|
1421
1421
|
)
|
|
1422
|
-
] }), M = ($,
|
|
1422
|
+
] }), M = ($, q) => {
|
|
1423
1423
|
if ($ instanceof Date)
|
|
1424
|
-
return Number.isNaN($.getTime()) ?
|
|
1424
|
+
return Number.isNaN($.getTime()) ? q : $;
|
|
1425
1425
|
if (typeof $ == "string" || typeof $ == "number") {
|
|
1426
|
-
const
|
|
1427
|
-
return Number.isNaN(
|
|
1426
|
+
const xe = new Date($);
|
|
1427
|
+
return Number.isNaN(xe.getTime()) ? q : xe;
|
|
1428
1428
|
}
|
|
1429
|
-
return
|
|
1430
|
-
},
|
|
1429
|
+
return q;
|
|
1430
|
+
}, v = ($) => {
|
|
1431
1431
|
if (Array.isArray($)) {
|
|
1432
|
-
const
|
|
1433
|
-
return
|
|
1432
|
+
const q = $.map((xe) => String(xe).trim()).filter(Boolean);
|
|
1433
|
+
return q.length > 0 ? q : void 0;
|
|
1434
1434
|
}
|
|
1435
1435
|
if (typeof $ == "string") {
|
|
1436
|
-
const
|
|
1437
|
-
return
|
|
1436
|
+
const q = $.split(/\r?\n|\|/).map((xe) => xe.trim()).filter(Boolean);
|
|
1437
|
+
return q.length > 0 ? q : void 0;
|
|
1438
1438
|
}
|
|
1439
|
-
}, w = e.tooltipConfig ? { ...
|
|
1440
|
-
w?.plannedStartAccessor?.(e) ?? e.plannedStart ??
|
|
1439
|
+
}, w = e.tooltipConfig ? { ...S, ...e.tooltipConfig } : S, C = w?.dateFormat || "MMM D, YYYY", Z = w?.taskNameAccessor?.(e) ?? e.text, W = String(Z ?? "").trim() || `Task ${e.id}`, re = w?.taskNameFormatter ? w.taskNameFormatter(W, e) : W, le = M(
|
|
1440
|
+
w?.plannedStartAccessor?.(e) ?? e.plannedStart ?? h?.start ?? e.start,
|
|
1441
1441
|
e.start
|
|
1442
1442
|
), j = M(
|
|
1443
|
-
w?.plannedEndAccessor?.(e) ?? e.plannedEnd ??
|
|
1443
|
+
w?.plannedEndAccessor?.(e) ?? e.plannedEnd ?? h?.end ?? e.end,
|
|
1444
1444
|
e.end
|
|
1445
|
-
),
|
|
1445
|
+
), X = w?.plannedDatesFormatter ? w.plannedDatesFormatter(le, j, e) : `${ke(le, C)} - ${ke(j, C)}`, R = M(
|
|
1446
1446
|
w?.actualStartAccessor?.(e) ?? e.actualStart ?? e.start,
|
|
1447
1447
|
e.start
|
|
1448
|
-
),
|
|
1448
|
+
), k = M(
|
|
1449
1449
|
w?.actualEndAccessor?.(e) ?? e.actualEnd ?? e.end,
|
|
1450
1450
|
e.end
|
|
1451
|
-
), B = w?.actualDatesFormatter ? w.actualDatesFormatter(R,
|
|
1451
|
+
), B = w?.actualDatesFormatter ? w.actualDatesFormatter(R, k, e) : `${ke(R, C)} - ${ke(k, C)}`, Y = w?.statusAccessor?.(e) ?? e.status, O = Y != null ? String(Y) : "", De = w?.statusFormatter ? w.statusFormatter(O, e) : O ? O.replace(/-/g, " ") : w?.emptyStatusText || "Not set", Se = w?.ownerAccessor?.(e) ?? e.owner, V = Se != null ? String(Se).trim() : "", I = V ? w?.ownerFormatter ? w.ownerFormatter(V, e) : V : w?.emptyOwnerText || "", ne = p.length > 0 ? p : e.dependencyRule || [], se = v(
|
|
1452
1452
|
w?.dependencyRuleAccessor?.(e, ne)
|
|
1453
|
-
) || ne, ue = se.length > 0 ? se.map(($) => w?.dependencyRuleFormatter ? w.dependencyRuleFormatter($, e) : $).join(w?.dependencySeparator || " | ") : w?.emptyDependencyRuleText || "No dependency rule", z = w?.progressAccessor?.(e) ?? e.progress,
|
|
1453
|
+
) || ne, ue = se.length > 0 ? se.map(($) => w?.dependencyRuleFormatter ? w.dependencyRuleFormatter($, e) : $).join(w?.dependencySeparator || " | ") : w?.emptyDependencyRuleText || "No dependency rule", z = w?.progressAccessor?.(e) ?? e.progress, ye = typeof z == "number" ? z : Number(z), Le = Number.isFinite(ye) ? ye : e.progress, Ie = w?.progressFormatter ? w.progressFormatter(Le, e) : `${Le}%`, Ye = /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip", children: [
|
|
1454
1454
|
w?.showTaskName !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-tooltip-title", children: re }),
|
|
1455
1455
|
w?.showPlannedDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1456
1456
|
w?.plannedLabel || "Planned",
|
|
1457
1457
|
": ",
|
|
1458
|
-
|
|
1458
|
+
X
|
|
1459
1459
|
] }),
|
|
1460
1460
|
w?.showActualDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1461
1461
|
w?.actualLabel || "Actual",
|
|
@@ -1485,15 +1485,15 @@ const xn = ({
|
|
|
1485
1485
|
] });
|
|
1486
1486
|
if (e.segments && e.segments.length > 0 || e.onHoldPeriods && e.onHoldPeriods.length > 0) {
|
|
1487
1487
|
console.log("[TaskBar] " + e.text + " onHold:", e.onHoldPeriods);
|
|
1488
|
-
const $ = e.end.getTime() - e.start.getTime(),
|
|
1488
|
+
const $ = e.end.getTime() - e.start.getTime(), q = (e.onHoldPeriods || []).map((ce) => ({
|
|
1489
1489
|
startMs: Math.max(ce.start.getTime(), e.start.getTime()),
|
|
1490
1490
|
endMs: Math.min(ce.end.getTime(), e.end.getTime())
|
|
1491
1491
|
})).filter((ce) => ce.endMs > ce.startMs).sort((ce, me) => ce.startMs - me.startMs).reduce((ce, me) => {
|
|
1492
1492
|
const Fe = ce[ce.length - 1];
|
|
1493
1493
|
return !Fe || me.startMs > Fe.endMs ? (ce.push({ ...me }), ce) : (Fe.endMs = Math.max(Fe.endMs, me.endMs), ce);
|
|
1494
|
-
}, []),
|
|
1494
|
+
}, []), xe = !!(e.segments && e.segments.length > 0), Qe = xe ? e.segments : [{ start: e.start, end: e.end, duration: e.duration || 0 }];
|
|
1495
1495
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-task-group", children: [
|
|
1496
|
-
|
|
1496
|
+
Qe.map((ce, me) => /* @__PURE__ */ t.jsx(nt, { title: Ye, mouseEnterDelay: 0.5, children: /* @__PURE__ */ t.jsx(
|
|
1497
1497
|
"div",
|
|
1498
1498
|
{
|
|
1499
1499
|
className: E() + " segment",
|
|
@@ -1507,21 +1507,21 @@ const xn = ({
|
|
|
1507
1507
|
children: N(me > 0)
|
|
1508
1508
|
}
|
|
1509
1509
|
) }, `seg-${me}`)),
|
|
1510
|
-
|
|
1511
|
-
const Fe = $ > 0 ? $ : 864e5,
|
|
1512
|
-
if (
|
|
1513
|
-
const
|
|
1510
|
+
q.map((ce, me) => {
|
|
1511
|
+
const Fe = $ > 0 ? $ : 864e5, pe = ce.endMs - ce.startMs;
|
|
1512
|
+
if (pe <= 0) return null;
|
|
1513
|
+
const et = a.left + (ce.startMs - e.start.getTime()) / Fe * a.width, _e = pe / Fe * a.width;
|
|
1514
1514
|
return /* @__PURE__ */ t.jsx(
|
|
1515
1515
|
"div",
|
|
1516
1516
|
{
|
|
1517
1517
|
className: "gantt-on-hold-period",
|
|
1518
1518
|
style: {
|
|
1519
|
-
left: `${
|
|
1520
|
-
width: `${
|
|
1519
|
+
left: `${et}px`,
|
|
1520
|
+
width: `${_e}px`,
|
|
1521
1521
|
// z-index 101: above hover state (100)
|
|
1522
1522
|
// Always rendered on top regardless of status-* colour
|
|
1523
1523
|
zIndex: 101,
|
|
1524
|
-
opacity:
|
|
1524
|
+
opacity: xe ? 0.9 : 0.75,
|
|
1525
1525
|
pointerEvents: "none"
|
|
1526
1526
|
}
|
|
1527
1527
|
},
|
|
@@ -1530,7 +1530,7 @@ const xn = ({
|
|
|
1530
1530
|
})
|
|
1531
1531
|
] });
|
|
1532
1532
|
}
|
|
1533
|
-
return /* @__PURE__ */ t.jsx(
|
|
1533
|
+
return /* @__PURE__ */ t.jsx(nt, { title: Ye, mouseEnterDelay: 0.5, children: /* @__PURE__ */ t.jsx(
|
|
1534
1534
|
"div",
|
|
1535
1535
|
{
|
|
1536
1536
|
className: E(),
|
|
@@ -1542,45 +1542,45 @@ const xn = ({
|
|
|
1542
1542
|
) });
|
|
1543
1543
|
}, wn = ({ links: e, tasks: a, getTaskPosition: n }) => {
|
|
1544
1544
|
const s = A.useMemo(() => {
|
|
1545
|
-
const
|
|
1546
|
-
return a.forEach((
|
|
1547
|
-
}, [a]), r = (
|
|
1548
|
-
const
|
|
1545
|
+
const h = /* @__PURE__ */ new Map();
|
|
1546
|
+
return a.forEach((p) => h.set(p.id, p)), h;
|
|
1547
|
+
}, [a]), r = (h) => s.get(h), c = A.useMemo(() => {
|
|
1548
|
+
const h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
1549
1549
|
e.forEach((F) => {
|
|
1550
|
-
|
|
1550
|
+
h.set(F.source, (h.get(F.source) || 0) + 1), p.set(F.target, (p.get(F.target) || 0) + 1);
|
|
1551
1551
|
});
|
|
1552
1552
|
const m = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
1553
1553
|
return e.forEach((F) => {
|
|
1554
1554
|
const N = m.get(F.source) || 0;
|
|
1555
|
-
|
|
1555
|
+
S.set(F.id, N), m.set(F.source, N + 1);
|
|
1556
1556
|
const M = E.get(F.target) || 0;
|
|
1557
|
-
|
|
1557
|
+
y.set(F.id, M), E.set(F.target, M + 1);
|
|
1558
1558
|
}), {
|
|
1559
|
-
outgoingCountByTaskId:
|
|
1560
|
-
incomingCountByTaskId:
|
|
1561
|
-
outgoingIndexByLinkId:
|
|
1562
|
-
incomingIndexByLinkId:
|
|
1559
|
+
outgoingCountByTaskId: h,
|
|
1560
|
+
incomingCountByTaskId: p,
|
|
1561
|
+
outgoingIndexByLinkId: S,
|
|
1562
|
+
incomingIndexByLinkId: y
|
|
1563
1563
|
};
|
|
1564
1564
|
}, [e]), b = A.useMemo(() => {
|
|
1565
|
-
let
|
|
1566
|
-
return a.forEach((
|
|
1565
|
+
let h = 0, p = 0;
|
|
1566
|
+
return a.forEach((S) => {
|
|
1567
1567
|
try {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
} catch (
|
|
1571
|
-
console.warn("Failed to position task for link rendering:",
|
|
1568
|
+
const y = n(S);
|
|
1569
|
+
y && typeof y.left == "number" && typeof y.width == "number" && (h = Math.max(h, y.left + y.width)), y && typeof y.top == "number" && typeof y.height == "number" && (p = Math.max(p, y.top + y.height));
|
|
1570
|
+
} catch (y) {
|
|
1571
|
+
console.warn("Failed to position task for link rendering:", S.id, y);
|
|
1572
1572
|
}
|
|
1573
1573
|
}), {
|
|
1574
|
-
width: Math.max(
|
|
1575
|
-
height: Math.max(
|
|
1574
|
+
width: Math.max(h, 1e3),
|
|
1575
|
+
height: Math.max(p, 100)
|
|
1576
1576
|
};
|
|
1577
|
-
}, [a, n]), u = (
|
|
1578
|
-
const
|
|
1579
|
-
return Math.min((
|
|
1580
|
-
}, d = (
|
|
1581
|
-
const
|
|
1582
|
-
if (!
|
|
1583
|
-
const
|
|
1577
|
+
}, [a, n]), u = (h, p) => {
|
|
1578
|
+
const S = Math.max(3, Math.round(p / 7)), y = Math.max(2, p / 2 - 2);
|
|
1579
|
+
return Math.min((h + 1) * S, y);
|
|
1580
|
+
}, d = (h) => {
|
|
1581
|
+
const p = r(h.source), S = r(h.target);
|
|
1582
|
+
if (!p || !S) return { path: "", arrow: "" };
|
|
1583
|
+
const y = n(p), m = n(S), E = (c.outgoingCountByTaskId.get(p.id) || 0) > 0 && (c.incomingCountByTaskId.get(p.id) || 0) > 0, F = (c.outgoingCountByTaskId.get(S.id) || 0) > 0 && (c.incomingCountByTaskId.get(S.id) || 0) > 0, N = y.top + y.height / 2 + (E ? u(c.outgoingIndexByLinkId.get(h.id) || 0, y.height) : 0), M = m.top + m.height / 2 - (F ? u(c.incomingIndexByLinkId.get(h.id) || 0, m.height) : 0), v = {
|
|
1584
1584
|
sourceStub: 14,
|
|
1585
1585
|
targetStub: 8,
|
|
1586
1586
|
detourPadding: 24,
|
|
@@ -1592,49 +1592,49 @@ const xn = ({
|
|
|
1592
1592
|
chevronNotchDepth: 5
|
|
1593
1593
|
};
|
|
1594
1594
|
let w = 0, C = 0, Z = 1, W = 1;
|
|
1595
|
-
switch (
|
|
1595
|
+
switch (h.type) {
|
|
1596
1596
|
case "e2s":
|
|
1597
|
-
w =
|
|
1597
|
+
w = y.left + y.width, C = m.left, Z = 1, W = 1;
|
|
1598
1598
|
break;
|
|
1599
1599
|
case "s2s":
|
|
1600
|
-
w =
|
|
1600
|
+
w = y.left, C = m.left, Z = -1, W = 1;
|
|
1601
1601
|
break;
|
|
1602
1602
|
case "e2e":
|
|
1603
|
-
w =
|
|
1603
|
+
w = y.left + y.width, C = m.left + m.width, Z = 1, W = -1;
|
|
1604
1604
|
break;
|
|
1605
1605
|
case "s2e":
|
|
1606
|
-
w =
|
|
1606
|
+
w = y.left, C = m.left + m.width, Z = -1, W = -1;
|
|
1607
1607
|
break;
|
|
1608
1608
|
}
|
|
1609
|
-
const re = w + Z *
|
|
1609
|
+
const re = w + Z * v.sourceStub, le = C - W * v.arrowGap, j = le - W * v.arrowLength, X = j + W * v.chevronNotchDepth, R = X - W * v.targetStub, k = X + W * v.arrowStemOverlap, B = Math.abs(M - N) > 1;
|
|
1610
1610
|
let Y;
|
|
1611
1611
|
if (B) {
|
|
1612
1612
|
const ne = M > N;
|
|
1613
|
-
let de = ne ? Math.min(
|
|
1613
|
+
let de = ne ? Math.min(y.top + y.height + 6, m.top - 6) : Math.max(y.top - 6, m.top + m.height + 6);
|
|
1614
1614
|
Math.abs(de - N) < 2 && (de = N + (ne ? 2 : -2)), Math.abs(de - M) < 2 && (de = M + (ne ? -2 : 2)), Y = [
|
|
1615
1615
|
{ x: w, y: N },
|
|
1616
1616
|
{ x: re, y: N },
|
|
1617
1617
|
{ x: re, y: de },
|
|
1618
1618
|
{ x: R, y: de },
|
|
1619
1619
|
{ x: R, y: M },
|
|
1620
|
-
{ x:
|
|
1620
|
+
{ x: k, y: M }
|
|
1621
1621
|
];
|
|
1622
1622
|
} else {
|
|
1623
1623
|
let I;
|
|
1624
|
-
Z === W && (Z === 1 ? R - re >=
|
|
1624
|
+
Z === W && (Z === 1 ? R - re >= v.minHorizontalSpan : re - R >= v.minHorizontalSpan) ? I = (re + R) / 2 : I = Z === 1 ? Math.max(w, C) + v.detourPadding : Math.min(w, C) - v.detourPadding, Y = [
|
|
1625
1625
|
{ x: w, y: N },
|
|
1626
1626
|
{ x: re, y: N },
|
|
1627
1627
|
{ x: I, y: N },
|
|
1628
1628
|
{ x: I, y: M },
|
|
1629
1629
|
{ x: R, y: M },
|
|
1630
|
-
{ x:
|
|
1630
|
+
{ x: k, y: M }
|
|
1631
1631
|
];
|
|
1632
1632
|
}
|
|
1633
|
-
const
|
|
1633
|
+
const O = Y.filter((I, ne) => {
|
|
1634
1634
|
if (ne === 0) return !0;
|
|
1635
1635
|
const de = Y[ne - 1];
|
|
1636
1636
|
return Math.abs(I.x - de.x) > 0.5 || Math.abs(I.y - de.y) > 0.5;
|
|
1637
|
-
}), De =
|
|
1637
|
+
}), De = O.length > 0 ? O.map((I, ne) => `${ne === 0 ? "M" : "L"} ${I.x},${I.y}`).join(" ") : "", Se = v.arrowWidth / 2, V = `M ${j},${M - Se} L ${le},${M} L ${j},${M + Se} L ${X},${M} Z`;
|
|
1638
1638
|
return { path: De, arrow: V };
|
|
1639
1639
|
};
|
|
1640
1640
|
return e.length === 0 ? null : /* @__PURE__ */ t.jsx(
|
|
@@ -1650,10 +1650,10 @@ const xn = ({
|
|
|
1650
1650
|
left: 0,
|
|
1651
1651
|
pointerEvents: "none"
|
|
1652
1652
|
},
|
|
1653
|
-
children: e.map((
|
|
1654
|
-
const
|
|
1655
|
-
if (!
|
|
1656
|
-
const
|
|
1653
|
+
children: e.map((h) => {
|
|
1654
|
+
const p = r(h.source), S = r(h.target);
|
|
1655
|
+
if (!p || !S) return null;
|
|
1656
|
+
const y = d(h), m = y.path, E = y.arrow;
|
|
1657
1657
|
return !m || !E ? null : /* @__PURE__ */ t.jsxs("g", { className: "gantt-link", children: [
|
|
1658
1658
|
/* @__PURE__ */ t.jsx(
|
|
1659
1659
|
"path",
|
|
@@ -1671,12 +1671,12 @@ const xn = ({
|
|
|
1671
1671
|
className: "gantt-link-arrow"
|
|
1672
1672
|
}
|
|
1673
1673
|
)
|
|
1674
|
-
] },
|
|
1674
|
+
] }, h.id);
|
|
1675
1675
|
})
|
|
1676
1676
|
}
|
|
1677
1677
|
);
|
|
1678
1678
|
}, bn = (e, a, n = 60, s = "day", r = 1) => {
|
|
1679
|
-
const [c, b] =
|
|
1679
|
+
const [c, b] = J({
|
|
1680
1680
|
taskId: null,
|
|
1681
1681
|
initialX: 0,
|
|
1682
1682
|
initialY: 0,
|
|
@@ -1685,52 +1685,52 @@ const xn = ({
|
|
|
1685
1685
|
type: null,
|
|
1686
1686
|
dragDeltaX: 0,
|
|
1687
1687
|
dragDeltaY: 0
|
|
1688
|
-
}), u =
|
|
1689
|
-
const E = e.find((F) => F.id ===
|
|
1688
|
+
}), u = Je((p, S, y, m) => {
|
|
1689
|
+
const E = e.find((F) => F.id === p);
|
|
1690
1690
|
E && b({
|
|
1691
|
-
taskId:
|
|
1692
|
-
initialX:
|
|
1693
|
-
initialY:
|
|
1691
|
+
taskId: p,
|
|
1692
|
+
initialX: S,
|
|
1693
|
+
initialY: y,
|
|
1694
1694
|
initialStart: new Date(E.start),
|
|
1695
1695
|
initialEnd: new Date(E.end),
|
|
1696
1696
|
type: m,
|
|
1697
1697
|
dragDeltaX: 0,
|
|
1698
1698
|
dragDeltaY: 0
|
|
1699
1699
|
});
|
|
1700
|
-
}, [e]), d =
|
|
1700
|
+
}, [e]), d = Je((p, S) => {
|
|
1701
1701
|
if (!c.taskId || !c.type) return null;
|
|
1702
|
-
const
|
|
1702
|
+
const y = p - c.initialX, m = S - c.initialY;
|
|
1703
1703
|
if (b((C) => ({
|
|
1704
1704
|
...C,
|
|
1705
|
-
dragDeltaX:
|
|
1705
|
+
dragDeltaX: y,
|
|
1706
1706
|
dragDeltaY: m
|
|
1707
1707
|
})), c.type === "reorder") return null;
|
|
1708
1708
|
const E = e.find((C) => C.id === c.taskId);
|
|
1709
1709
|
if (!E) return null;
|
|
1710
1710
|
let F = 0, N = s;
|
|
1711
|
-
s === "week" ? (F = Math.round(
|
|
1712
|
-
let M = new Date(c.initialStart),
|
|
1711
|
+
s === "week" ? (F = Math.round(y / n * 7), N = "day") : s === "month" ? (F = Math.round(y / n * 30), N = "day") : (F = Math.round(y / n) * r, N = s);
|
|
1712
|
+
let M = new Date(c.initialStart), v = new Date(c.initialEnd);
|
|
1713
1713
|
switch (c.type) {
|
|
1714
1714
|
case "move":
|
|
1715
|
-
M = Te(c.initialStart, F, N),
|
|
1715
|
+
M = Te(c.initialStart, F, N), v = Te(c.initialEnd, F, N);
|
|
1716
1716
|
break;
|
|
1717
1717
|
case "resize-left":
|
|
1718
|
-
M = Te(c.initialStart, F, N), M >=
|
|
1718
|
+
M = Te(c.initialStart, F, N), M >= v && (M = Te(v, N === "day" ? -1 : -r, N));
|
|
1719
1719
|
break;
|
|
1720
1720
|
case "resize-right":
|
|
1721
|
-
|
|
1721
|
+
v = Te(c.initialEnd, F, N), v <= M && (v = Te(M, N === "day" ? 1 : r, N));
|
|
1722
1722
|
break;
|
|
1723
1723
|
}
|
|
1724
|
-
const w = Nt(M,
|
|
1724
|
+
const w = Nt(M, v);
|
|
1725
1725
|
return {
|
|
1726
1726
|
...E,
|
|
1727
1727
|
start: M,
|
|
1728
|
-
end:
|
|
1728
|
+
end: v,
|
|
1729
1729
|
duration: w
|
|
1730
1730
|
};
|
|
1731
|
-
}, [c, e, n, r, s]),
|
|
1732
|
-
if (
|
|
1733
|
-
const { id:
|
|
1731
|
+
}, [c, e, n, r, s]), h = Je((p) => {
|
|
1732
|
+
if (p && a) {
|
|
1733
|
+
const { id: S, ...y } = p, m = c.type;
|
|
1734
1734
|
if (m && m !== "reorder") {
|
|
1735
1735
|
const E = {
|
|
1736
1736
|
dragType: m,
|
|
@@ -1738,9 +1738,9 @@ const xn = ({
|
|
|
1738
1738
|
previousEnd: new Date(c.initialEnd),
|
|
1739
1739
|
previousDuration: Nt(c.initialStart, c.initialEnd)
|
|
1740
1740
|
};
|
|
1741
|
-
a(
|
|
1741
|
+
a(S, y, E);
|
|
1742
1742
|
} else
|
|
1743
|
-
a(
|
|
1743
|
+
a(S, y);
|
|
1744
1744
|
}
|
|
1745
1745
|
b({
|
|
1746
1746
|
taskId: null,
|
|
@@ -1757,12 +1757,12 @@ const xn = ({
|
|
|
1757
1757
|
dragState: c,
|
|
1758
1758
|
handleDragStart: u,
|
|
1759
1759
|
handleDrag: d,
|
|
1760
|
-
handleDragEnd:
|
|
1760
|
+
handleDragEnd: h
|
|
1761
1761
|
};
|
|
1762
1762
|
}, mr = (e) => {
|
|
1763
1763
|
const a = new Date(e.getFullYear(), e.getMonth(), 1);
|
|
1764
1764
|
return Math.ceil((e.getDate() + a.getDay()) / 7);
|
|
1765
|
-
}, fr = (e) => Math.floor(e.getMonth() / 3) + 1,
|
|
1765
|
+
}, fr = (e) => Math.floor(e.getMonth() / 3) + 1, Qt = (e, a, n) => a.unit === "week" ? a.format?.includes("W") ? a.format.replace(/\bW\b/g, String(mr(e))) : `Week ${mr(e)}` : a.unit === "quarter" ? a.format?.includes("Q") ? a.format.replace(/\bQ\b/g, String(fr(e))) : `Q${fr(e)}` : ke(e, a.format || n), Sn = (e, a) => {
|
|
1766
1766
|
const n = new Date(e);
|
|
1767
1767
|
switch (n.setMinutes(0, 0, 0), a.unit) {
|
|
1768
1768
|
case "hour": {
|
|
@@ -1792,226 +1792,223 @@ const xn = ({
|
|
|
1792
1792
|
}
|
|
1793
1793
|
}, Lr = A.memo(
|
|
1794
1794
|
A.forwardRef(
|
|
1795
|
-
({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate:
|
|
1795
|
+
({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate: h, zoomLevel: p, baselines: S, allowBaselineOnlyMode: y, taskTooltipConfig: m, headerHeight: E }, F) => {
|
|
1796
1796
|
const N = A.useRef(null), M = A.useCallback((i) => {
|
|
1797
1797
|
N.current = i, typeof F == "function" ? F(i) : F && (F.current = i);
|
|
1798
|
-
}, [F]), [
|
|
1799
|
-
() => Math.max((r.columnWidth || 60) *
|
|
1800
|
-
[r.columnWidth, r.minColumnWidth,
|
|
1801
|
-
), j = r.baselines &&
|
|
1798
|
+
}, [F]), [v, w] = J(e), [C, Z] = J(a), [W, re] = J(0), le = A.useMemo(
|
|
1799
|
+
() => Math.max((r.columnWidth || 60) * p, r.minColumnWidth || 0),
|
|
1800
|
+
[r.columnWidth, r.minColumnWidth, p]
|
|
1801
|
+
), j = r.baselines && S && S.size > 0, X = A.useMemo(() => {
|
|
1802
1802
|
const i = /* @__PURE__ */ new Map();
|
|
1803
|
-
return
|
|
1804
|
-
}, [
|
|
1805
|
-
const i = /* @__PURE__ */ new Map(),
|
|
1803
|
+
return v.forEach((g) => i.set(g.id, g)), i;
|
|
1804
|
+
}, [v]), R = A.useMemo(() => {
|
|
1805
|
+
const i = /* @__PURE__ */ new Map(), g = {
|
|
1806
1806
|
e2s: "Finish-to-Start",
|
|
1807
1807
|
s2s: "Start-to-Start",
|
|
1808
1808
|
e2e: "Finish-to-Finish",
|
|
1809
1809
|
s2e: "Start-to-Finish"
|
|
1810
|
-
},
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1810
|
+
}, D = (f, U) => {
|
|
1811
|
+
const ee = [...i.get(f) || [], ...U.map((ie) => ie.trim()).filter(Boolean)];
|
|
1812
|
+
ee.length > 0 && i.set(f, Array.from(new Set(ee)));
|
|
1813
1813
|
};
|
|
1814
|
-
return
|
|
1815
|
-
f.dependencyRule && f.dependencyRule.length > 0 &&
|
|
1814
|
+
return v.forEach((f) => {
|
|
1815
|
+
f.dependencyRule && f.dependencyRule.length > 0 && D(f.id, f.dependencyRule);
|
|
1816
1816
|
}), C.forEach((f) => {
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1817
|
+
const U = X.get(f.source), G = X.get(f.target), ee = U?.text || `Task ${f.source}`, ie = G?.text || `Task ${f.target}`, $e = g[f.type], ze = typeof f.lag == "number" && f.lag !== 0 ? ` (${f.lag > 0 ? "+" : ""}${f.lag} ${f.lagUnit || "day"})` : "", ge = `${ie} depends on ${ee} [${$e}]${ze}`;
|
|
1818
|
+
D(f.target, [ge]);
|
|
1819
1819
|
}), i;
|
|
1820
|
-
}, [C,
|
|
1820
|
+
}, [C, v, X]);
|
|
1821
1821
|
A.useEffect(() => {
|
|
1822
|
-
(e.length !==
|
|
1823
|
-
const f =
|
|
1824
|
-
return !f ||
|
|
1822
|
+
(e.length !== v.length || e.some((g, D) => {
|
|
1823
|
+
const f = v[D];
|
|
1824
|
+
return !f || g.id !== f.id || g.start.getTime() !== f.start.getTime() || g.end.getTime() !== f.end.getTime() || g.duration !== f.duration;
|
|
1825
1825
|
})) && w(e);
|
|
1826
1826
|
}, [e]), A.useEffect(() => {
|
|
1827
|
-
(a.length !== C.length || a.some((
|
|
1828
|
-
const f = C[
|
|
1829
|
-
return !f ||
|
|
1827
|
+
(a.length !== C.length || a.some((g, D) => {
|
|
1828
|
+
const f = C[D];
|
|
1829
|
+
return !f || g.id !== f.id || g.source !== f.source || g.target !== f.target || g.type !== f.type;
|
|
1830
1830
|
})) && Z(a);
|
|
1831
1831
|
}, [a]), A.useEffect(() => {
|
|
1832
1832
|
const i = N.current?.parentElement;
|
|
1833
1833
|
if (!i) return;
|
|
1834
|
-
const
|
|
1835
|
-
let
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1834
|
+
const g = () => {
|
|
1835
|
+
let U = i.clientWidth;
|
|
1836
|
+
const G = i.closest(".gantt-layout"), ee = G?.querySelector(".gantt-grid");
|
|
1837
|
+
G && ee && (U = Math.max(0, G.clientWidth - ee.offsetWidth)), re((ie) => ie === U ? ie : U);
|
|
1838
1838
|
};
|
|
1839
|
-
|
|
1840
|
-
const
|
|
1839
|
+
g();
|
|
1840
|
+
const D = i.closest(".gantt-layout") || i;
|
|
1841
1841
|
if (typeof ResizeObserver > "u")
|
|
1842
|
-
return window.addEventListener("resize",
|
|
1842
|
+
return window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
|
|
1843
1843
|
const f = new ResizeObserver(() => {
|
|
1844
|
-
|
|
1844
|
+
g();
|
|
1845
1845
|
});
|
|
1846
|
-
return f.observe(
|
|
1846
|
+
return f.observe(D), () => f.disconnect();
|
|
1847
1847
|
}, []);
|
|
1848
|
-
const
|
|
1849
|
-
const
|
|
1850
|
-
let
|
|
1851
|
-
for (;
|
|
1848
|
+
const k = A.useCallback((i) => {
|
|
1849
|
+
const g = [];
|
|
1850
|
+
let D = new Date(n.start);
|
|
1851
|
+
for (; D <= n.end; ) {
|
|
1852
1852
|
let f = Qt(
|
|
1853
|
-
|
|
1853
|
+
D,
|
|
1854
1854
|
i,
|
|
1855
1855
|
i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM" : i.unit === "hour" ? "HH" : "D"
|
|
1856
1856
|
);
|
|
1857
1857
|
if (r.relativeDayNumbering && i.unit === "day") {
|
|
1858
|
-
const
|
|
1859
|
-
f = String(
|
|
1858
|
+
const U = D.getTime() - n.start.getTime(), G = Math.floor(U / (1e3 * 60 * 60 * 24)) + 1;
|
|
1859
|
+
f = String(G);
|
|
1860
1860
|
}
|
|
1861
|
-
|
|
1862
|
-
date: new Date(
|
|
1861
|
+
g.push({
|
|
1862
|
+
date: new Date(D),
|
|
1863
1863
|
label: f
|
|
1864
|
-
}),
|
|
1864
|
+
}), D = Te(D, i.step, i.unit);
|
|
1865
1865
|
}
|
|
1866
1866
|
if (W > 0) {
|
|
1867
1867
|
const f = Math.floor(W / le);
|
|
1868
|
-
for (;
|
|
1869
|
-
let
|
|
1870
|
-
|
|
1868
|
+
for (; g.length < f; ) {
|
|
1869
|
+
let U = Qt(
|
|
1870
|
+
D,
|
|
1871
1871
|
i,
|
|
1872
1872
|
i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM" : i.unit === "hour" ? "HH" : "D"
|
|
1873
1873
|
);
|
|
1874
1874
|
if (r.relativeDayNumbering && i.unit === "day") {
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1875
|
+
const G = D.getTime() - n.start.getTime(), ee = Math.floor(G / (1e3 * 60 * 60 * 24)) + 1;
|
|
1876
|
+
U = String(ee);
|
|
1877
1877
|
}
|
|
1878
|
-
|
|
1879
|
-
date: new Date(
|
|
1880
|
-
label:
|
|
1881
|
-
}),
|
|
1878
|
+
g.push({
|
|
1879
|
+
date: new Date(D),
|
|
1880
|
+
label: U
|
|
1881
|
+
}), D = Te(D, i.step, i.unit);
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
|
-
return
|
|
1885
|
-
}, [n.start, n.end, W, le]), B = s[s.length - 1] || s[0], Y = A.useMemo(() =>
|
|
1884
|
+
return g;
|
|
1885
|
+
}, [n.start, n.end, W, le]), B = s[s.length - 1] || s[0], Y = A.useMemo(() => k(B), [k, B]), O = A.useMemo(() => Y.length === 0 || W <= 0 ? le : Math.max(le, W / Y.length), [le, Y.length, W]), De = y && v.length === 0 && j, Se = !!r.timelineView || !!r.timelineViews?.length, V = A.useMemo(() => {
|
|
1886
1886
|
if (r.showTimelineHeader === !1) return 0;
|
|
1887
|
-
let i =
|
|
1887
|
+
let i = Se ? Math.max(s.length - 1, 0) : 2;
|
|
1888
1888
|
if (r.showMonthHeading === !1 && (i = Math.max(0, i - 1)), r.showRangeHeading === !1) {
|
|
1889
|
-
const
|
|
1890
|
-
i = Math.max(0, i -
|
|
1889
|
+
const g = Se ? Math.max(0, s.length - 2) : 1;
|
|
1890
|
+
i = Math.max(0, i - g);
|
|
1891
1891
|
}
|
|
1892
1892
|
return i;
|
|
1893
|
-
}, [r.showTimelineHeader, r.showMonthHeading, r.showRangeHeading,
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1893
|
+
}, [r.showTimelineHeader, r.showMonthHeading, r.showRangeHeading, Se, s.length]), { dragState: I, handleDragStart: ne, handleDrag: de, handleDragEnd: se } = bn(
|
|
1894
|
+
v,
|
|
1895
|
+
h,
|
|
1896
|
+
O,
|
|
1897
1897
|
B.unit,
|
|
1898
1898
|
B.step
|
|
1899
1899
|
), ue = A.useCallback((i) => {
|
|
1900
1900
|
if (Y.length === 0) return 0;
|
|
1901
|
-
const
|
|
1902
|
-
for (let f = 0; f <=
|
|
1903
|
-
const
|
|
1904
|
-
if (
|
|
1905
|
-
return f *
|
|
1906
|
-
if (
|
|
1907
|
-
const
|
|
1908
|
-
return (f +
|
|
1901
|
+
const g = i.getTime(), D = Y.length - 1;
|
|
1902
|
+
for (let f = 0; f <= D; f++) {
|
|
1903
|
+
const U = Y[f], G = U.date.getTime(), ie = (f < D ? Y[f + 1].date : Te(U.date, B.step, B.unit)).getTime(), $e = Math.max(ie - G, 1);
|
|
1904
|
+
if (g < G)
|
|
1905
|
+
return f * O;
|
|
1906
|
+
if (g <= ie) {
|
|
1907
|
+
const ze = Math.max(0, Math.min((g - G) / $e, 1));
|
|
1908
|
+
return (f + ze) * O;
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
|
-
return Y.length *
|
|
1912
|
-
}, [Y, B,
|
|
1913
|
-
const
|
|
1911
|
+
return Y.length * O;
|
|
1912
|
+
}, [Y, B, O]), z = (i) => {
|
|
1913
|
+
const g = ue(i.start), D = ue(i.end);
|
|
1914
1914
|
return {
|
|
1915
|
-
left:
|
|
1916
|
-
width: Math.max(
|
|
1915
|
+
left: g,
|
|
1916
|
+
width: Math.max(D - g, 0)
|
|
1917
1917
|
};
|
|
1918
|
-
},
|
|
1919
|
-
const
|
|
1918
|
+
}, ye = (i) => {
|
|
1919
|
+
const g = ue(i.start), D = ue(i.end);
|
|
1920
1920
|
return {
|
|
1921
|
-
left:
|
|
1922
|
-
width: Math.max(
|
|
1921
|
+
left: g,
|
|
1922
|
+
width: Math.max(D - g, 0)
|
|
1923
1923
|
};
|
|
1924
1924
|
}, Le = A.useCallback((i) => {
|
|
1925
|
-
const
|
|
1925
|
+
const g = z(i), D = v.findIndex((ee) => ee.id === i.id);
|
|
1926
1926
|
let f = r.rowHeight || 48;
|
|
1927
1927
|
if (N.current) {
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
1930
|
-
const
|
|
1931
|
-
!isNaN(
|
|
1928
|
+
const ee = getComputedStyle(N.current).getPropertyValue("--gantt-row-height");
|
|
1929
|
+
if (ee) {
|
|
1930
|
+
const ie = parseFloat(ee);
|
|
1931
|
+
!isNaN(ie) && ie > 0 && (f = ie);
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
|
-
const
|
|
1934
|
+
const U = r.taskHeight || 28, G = (f - U) / 2;
|
|
1935
1935
|
return {
|
|
1936
|
-
left:
|
|
1937
|
-
width:
|
|
1938
|
-
top:
|
|
1939
|
-
height:
|
|
1936
|
+
left: g.left,
|
|
1937
|
+
width: g.width,
|
|
1938
|
+
top: D * f + G,
|
|
1939
|
+
height: U
|
|
1940
1940
|
};
|
|
1941
|
-
}, [z,
|
|
1941
|
+
}, [z, v, r.rowHeight, r.taskHeight]), Ie = A.useRef(null), Ye = Je((i) => {
|
|
1942
1942
|
I.taskId && I.type && (Ie.current && cancelAnimationFrame(Ie.current), Ie.current = requestAnimationFrame(() => {
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
(
|
|
1943
|
+
const g = de(i.clientX, i.clientY);
|
|
1944
|
+
g && w(
|
|
1945
|
+
(D) => D.map((f) => f.id === g.id ? g : f)
|
|
1946
1946
|
);
|
|
1947
1947
|
}));
|
|
1948
|
-
}, [I, de]), $ =
|
|
1948
|
+
}, [I, de]), $ = Je(() => {
|
|
1949
1949
|
if (I.taskId) {
|
|
1950
|
-
const i =
|
|
1950
|
+
const i = v.find((g) => g.id === I.taskId);
|
|
1951
1951
|
se(i || null), d();
|
|
1952
1952
|
}
|
|
1953
|
-
}, [I,
|
|
1954
|
-
const
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
}), T && y.push({ key: T, label: f, width: X }), y;
|
|
1963
|
-
}, [Y, k, r.timelineView, G]), qe = A.useMemo(() => {
|
|
1964
|
-
if (!we) return [];
|
|
1953
|
+
}, [I, v, se, d]), q = A.useCallback((i) => {
|
|
1954
|
+
const g = [];
|
|
1955
|
+
let D = "", f = "", U = 0;
|
|
1956
|
+
return Y.forEach((G) => {
|
|
1957
|
+
const ee = Sn(G.date, i), ie = ee.toISOString(), $e = i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM YYYY" : i.unit === "day" ? "MMM D" : "D", ze = Qt(ee, i, $e);
|
|
1958
|
+
ie !== D ? (D && g.push({ key: D, label: f, width: U }), D = ie, f = ze, U = O) : U += O;
|
|
1959
|
+
}), D && g.push({ key: D, label: f, width: U }), g;
|
|
1960
|
+
}, [Y, O]), xe = A.useMemo(() => {
|
|
1961
|
+
if (!Se) return [];
|
|
1965
1962
|
const i = [];
|
|
1966
|
-
if (s.slice(0, -1).forEach((
|
|
1967
|
-
const f =
|
|
1963
|
+
if (s.slice(0, -1).forEach((D) => {
|
|
1964
|
+
const f = q(D);
|
|
1968
1965
|
f.length > 0 && i.push(f);
|
|
1969
1966
|
}), r.timelineView === "day" && i.length === 0) {
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1967
|
+
const D = q({ unit: "month", step: 1, format: "MMM YYYY" });
|
|
1968
|
+
D.length > 0 && i.push(D);
|
|
1972
1969
|
}
|
|
1973
1970
|
return i.push(
|
|
1974
|
-
Y.map((
|
|
1971
|
+
Y.map((D, f) => ({
|
|
1975
1972
|
key: `secondary-${f}`,
|
|
1976
|
-
label:
|
|
1977
|
-
width:
|
|
1978
|
-
date:
|
|
1973
|
+
label: D.label,
|
|
1974
|
+
width: O,
|
|
1975
|
+
date: D.date
|
|
1979
1976
|
}))
|
|
1980
1977
|
), i;
|
|
1981
|
-
}, [
|
|
1978
|
+
}, [q, O, Se, s, Y]), Qe = A.useCallback(() => {
|
|
1982
1979
|
const i = [];
|
|
1983
|
-
let
|
|
1984
|
-
return Y.forEach((
|
|
1985
|
-
const
|
|
1986
|
-
|
|
1987
|
-
}),
|
|
1988
|
-
}, [Y,
|
|
1980
|
+
let g = -1, D = -1, f = 0, U = "";
|
|
1981
|
+
return Y.forEach((G) => {
|
|
1982
|
+
const ee = G.date.getMonth(), ie = G.date.getFullYear(), $e = ke(G.date, "MMM YYYY");
|
|
1983
|
+
ee !== g || ie !== D ? (g !== -1 && i.push({ label: U, width: f }), g = ee, D = ie, f = O, U = $e) : f += O;
|
|
1984
|
+
}), g !== -1 && i.push({ label: U, width: f }), i;
|
|
1985
|
+
}, [Y, O]), ce = A.useCallback(() => {
|
|
1989
1986
|
const i = [];
|
|
1990
|
-
let
|
|
1991
|
-
return Y.forEach((
|
|
1992
|
-
const
|
|
1993
|
-
|
|
1994
|
-
}),
|
|
1995
|
-
}, [Y,
|
|
1987
|
+
let g = -1, D = 0, f = -1, U = -1, G = "";
|
|
1988
|
+
return Y.forEach((ee) => {
|
|
1989
|
+
const $e = ee.date.getDate() <= 15 ? 0 : 1, ze = ee.date.getMonth(), ge = ee.date.getFullYear(), tt = ke(ee.date, "MMM"), Ke = new Date(ge, ze + 1, 0).getDate(), st = $e === 0 ? `${tt} 1 - 15` : `${tt} 16 - ${Ke}`;
|
|
1990
|
+
$e !== g || ze !== f || ge !== U ? (g !== -1 && i.push({ label: G, width: D }), g = $e, f = ze, U = ge, D = O, G = st) : D += O;
|
|
1991
|
+
}), g !== -1 && i.push({ label: G, width: D }), i;
|
|
1992
|
+
}, [Y, O]), me = A.useMemo(() => Qe(), [Qe]), Fe = A.useMemo(() => ce(), [ce]), pe = A.useMemo(() => Y.length * O, [Y.length, O]), et = A.useMemo(() => {
|
|
1996
1993
|
const i = /* @__PURE__ */ new Date();
|
|
1997
1994
|
return i.setHours(0, 0, 0, 0), i;
|
|
1998
1995
|
}, []), _e = A.useMemo(() => {
|
|
1999
1996
|
if (!r.showTodayLine) return null;
|
|
2000
|
-
const i = ue(
|
|
2001
|
-
return i >= -
|
|
2002
|
-
}, [r.showTodayLine,
|
|
1997
|
+
const i = ue(et);
|
|
1998
|
+
return i >= -O && i <= pe + O ? Math.max(0, Math.min(i, pe)) : null;
|
|
1999
|
+
}, [r.showTodayLine, et, pe, O, ue]), Xe = A.useMemo(() => {
|
|
2003
2000
|
if (r.projectStartDate)
|
|
2004
2001
|
return yt(r.projectStartDate);
|
|
2005
|
-
if (
|
|
2006
|
-
const i =
|
|
2002
|
+
if (v.length > 0) {
|
|
2003
|
+
const i = v.map((g) => g.start.getTime());
|
|
2007
2004
|
return yt(new Date(Math.min(...i)));
|
|
2008
2005
|
}
|
|
2009
2006
|
return null;
|
|
2010
|
-
}, [r.projectStartDate,
|
|
2011
|
-
if (!r.showProjectStartLine || !
|
|
2012
|
-
const i = ue(
|
|
2013
|
-
return i >= -
|
|
2014
|
-
}, [r.showProjectStartLine,
|
|
2007
|
+
}, [r.projectStartDate, v]), Ue = A.useMemo(() => {
|
|
2008
|
+
if (!r.showProjectStartLine || !Xe) return null;
|
|
2009
|
+
const i = ue(Xe);
|
|
2010
|
+
return i >= -O && i <= pe + O ? Math.max(0, Math.min(i, pe)) : null;
|
|
2011
|
+
}, [r.showProjectStartLine, Xe, pe, O, ue]), ot = `calc(var(--gantt-scale-height, 24px) * ${V})`;
|
|
2015
2012
|
return /* @__PURE__ */ t.jsxs(
|
|
2016
2013
|
"div",
|
|
2017
2014
|
{
|
|
@@ -2019,16 +2016,16 @@ const xn = ({
|
|
|
2019
2016
|
ref: M,
|
|
2020
2017
|
onMouseMove: Ye,
|
|
2021
2018
|
onMouseUp: $,
|
|
2022
|
-
style: { width:
|
|
2019
|
+
style: { width: pe, position: "relative" },
|
|
2023
2020
|
children: [
|
|
2024
|
-
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-header", style: { width:
|
|
2021
|
+
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-header", style: { width: pe, minWidth: pe, position: "relative", height: E }, children: [
|
|
2025
2022
|
_e !== null && r.showTodayLine && r.todayLineLabel && r.todayLineLabel !== "" && /* @__PURE__ */ t.jsx(
|
|
2026
2023
|
"div",
|
|
2027
2024
|
{
|
|
2028
2025
|
className: "gantt-today-line-label",
|
|
2029
2026
|
style: {
|
|
2030
2027
|
position: "absolute",
|
|
2031
|
-
top:
|
|
2028
|
+
top: ot,
|
|
2032
2029
|
left: `${_e}px`,
|
|
2033
2030
|
transform: "translateX(-50%)",
|
|
2034
2031
|
backgroundColor: r.todayLineColor || "#ff4d4f",
|
|
@@ -2048,14 +2045,14 @@ const xn = ({
|
|
|
2048
2045
|
children: r.todayLineLabel
|
|
2049
2046
|
}
|
|
2050
2047
|
),
|
|
2051
|
-
|
|
2048
|
+
Ue !== null && r.showProjectStartLine && r.projectStartLineLabel && r.projectStartLineLabel !== "" && /* @__PURE__ */ t.jsx(
|
|
2052
2049
|
"div",
|
|
2053
2050
|
{
|
|
2054
2051
|
className: "gantt-project-start-line-label",
|
|
2055
2052
|
style: {
|
|
2056
2053
|
position: "absolute",
|
|
2057
|
-
top:
|
|
2058
|
-
left: `${
|
|
2054
|
+
top: ot,
|
|
2055
|
+
left: `${Ue}px`,
|
|
2059
2056
|
transform: "translateX(-50%)",
|
|
2060
2057
|
backgroundColor: r.projectStartLineColor || "#40a9ff",
|
|
2061
2058
|
color: "#ffffff",
|
|
@@ -2074,24 +2071,24 @@ const xn = ({
|
|
|
2074
2071
|
children: r.projectStartLineLabel
|
|
2075
2072
|
}
|
|
2076
2073
|
),
|
|
2077
|
-
r.showTimelineHeader !== !1 && (
|
|
2078
|
-
const
|
|
2074
|
+
r.showTimelineHeader !== !1 && (Se ? xe.map((i, g) => {
|
|
2075
|
+
const D = g === 0 ? "gantt-timeline-scale-month" : g === xe.length - 1 ? "gantt-timeline-scale-day" : "gantt-timeline-scale-range";
|
|
2079
2076
|
return /* @__PURE__ */ t.jsx(
|
|
2080
2077
|
"div",
|
|
2081
2078
|
{
|
|
2082
|
-
className: `gantt-timeline-scale ${
|
|
2083
|
-
style: { width:
|
|
2084
|
-
children: i.map((f,
|
|
2085
|
-
const
|
|
2079
|
+
className: `gantt-timeline-scale ${D}`,
|
|
2080
|
+
style: { width: pe, display: g === 0 && r.showMonthHeading === !1 || g !== 0 && g !== xe.length - 1 && r.showRangeHeading === !1 ? "none" : "flex" },
|
|
2081
|
+
children: i.map((f, U) => {
|
|
2082
|
+
const G = g === xe.length - 1, ee = G && f.date ? r.weekends && Kt(f.date) : !1, ie = G && f.date ? r.holidays && Zt(f.date, r.holidays) : !1;
|
|
2086
2083
|
return /* @__PURE__ */ t.jsx(
|
|
2087
2084
|
"div",
|
|
2088
2085
|
{
|
|
2089
|
-
className: `gantt-timeline-cell ${
|
|
2086
|
+
className: `gantt-timeline-cell ${ee ? "weekend" : ""} ${ie ? "holiday" : ""}`,
|
|
2090
2087
|
style: {
|
|
2091
2088
|
width: f.width,
|
|
2092
2089
|
minWidth: f.width,
|
|
2093
2090
|
maxWidth: f.width,
|
|
2094
|
-
borderRight:
|
|
2091
|
+
borderRight: U === i.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
2095
2092
|
},
|
|
2096
2093
|
children: f.label
|
|
2097
2094
|
},
|
|
@@ -2099,10 +2096,10 @@ const xn = ({
|
|
|
2099
2096
|
);
|
|
2100
2097
|
})
|
|
2101
2098
|
},
|
|
2102
|
-
`dynamic-row-${
|
|
2099
|
+
`dynamic-row-${g}`
|
|
2103
2100
|
);
|
|
2104
2101
|
}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2105
|
-
r.showMonthHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width:
|
|
2102
|
+
r.showMonthHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width: pe }, children: me.map((i, g) => /* @__PURE__ */ t.jsx(
|
|
2106
2103
|
"div",
|
|
2107
2104
|
{
|
|
2108
2105
|
className: "gantt-timeline-cell",
|
|
@@ -2110,13 +2107,13 @@ const xn = ({
|
|
|
2110
2107
|
width: i.width,
|
|
2111
2108
|
minWidth: i.width,
|
|
2112
2109
|
maxWidth: i.width,
|
|
2113
|
-
borderRight:
|
|
2110
|
+
borderRight: g === me.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
2114
2111
|
},
|
|
2115
2112
|
children: i.label
|
|
2116
2113
|
},
|
|
2117
|
-
`top-${
|
|
2114
|
+
`top-${g}`
|
|
2118
2115
|
)) }),
|
|
2119
|
-
r.showRangeHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width:
|
|
2116
|
+
r.showRangeHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width: pe }, children: Fe.map((i, g) => /* @__PURE__ */ t.jsx(
|
|
2120
2117
|
"div",
|
|
2121
2118
|
{
|
|
2122
2119
|
className: "gantt-timeline-cell",
|
|
@@ -2124,36 +2121,36 @@ const xn = ({
|
|
|
2124
2121
|
width: i.width,
|
|
2125
2122
|
minWidth: i.width,
|
|
2126
2123
|
maxWidth: i.width,
|
|
2127
|
-
borderRight:
|
|
2124
|
+
borderRight: g === Fe.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
2128
2125
|
},
|
|
2129
2126
|
children: i.label
|
|
2130
2127
|
},
|
|
2131
|
-
`mid-${
|
|
2128
|
+
`mid-${g}`
|
|
2132
2129
|
)) }),
|
|
2133
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width:
|
|
2134
|
-
const
|
|
2130
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: pe }, children: Y.map((i, g) => {
|
|
2131
|
+
const D = r.weekends && Kt(i.date), f = r.holidays && Zt(i.date, r.holidays);
|
|
2135
2132
|
return /* @__PURE__ */ t.jsx(
|
|
2136
2133
|
"div",
|
|
2137
2134
|
{
|
|
2138
|
-
className: `gantt-timeline-cell ${
|
|
2135
|
+
className: `gantt-timeline-cell ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
|
|
2139
2136
|
style: {
|
|
2140
|
-
width:
|
|
2141
|
-
minWidth:
|
|
2142
|
-
maxWidth:
|
|
2143
|
-
borderRight:
|
|
2137
|
+
width: O,
|
|
2138
|
+
minWidth: O,
|
|
2139
|
+
maxWidth: O,
|
|
2140
|
+
borderRight: g === Y.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
2144
2141
|
},
|
|
2145
2142
|
children: i.label
|
|
2146
2143
|
},
|
|
2147
|
-
`day-${
|
|
2144
|
+
`day-${g}`
|
|
2148
2145
|
);
|
|
2149
2146
|
}) })
|
|
2150
2147
|
] }))
|
|
2151
2148
|
] }),
|
|
2152
|
-
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-body", style: { width:
|
|
2149
|
+
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-body", style: { width: pe, position: "relative" }, children: [
|
|
2153
2150
|
_e !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2154
2151
|
r.showTodayLineMarker !== !1 && (() => {
|
|
2155
|
-
const i = r.todayLineMarkerSize || 8,
|
|
2156
|
-
return
|
|
2152
|
+
const i = r.todayLineMarkerSize || 8, g = r.todayLineColor || "#ff4d4f", D = r.todayLineMarkerStyle || "triangle", f = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
|
|
2153
|
+
return D === "triangle" ? /* @__PURE__ */ t.jsx(
|
|
2157
2154
|
"div",
|
|
2158
2155
|
{
|
|
2159
2156
|
className: "gantt-today-line-marker",
|
|
@@ -2166,13 +2163,13 @@ const xn = ({
|
|
|
2166
2163
|
height: 0,
|
|
2167
2164
|
borderLeft: `${i}px solid transparent`,
|
|
2168
2165
|
borderRight: `${i}px solid transparent`,
|
|
2169
|
-
borderBottom: `${i}px solid ${
|
|
2166
|
+
borderBottom: `${i}px solid ${g}`,
|
|
2170
2167
|
zIndex: 7,
|
|
2171
2168
|
pointerEvents: "none",
|
|
2172
2169
|
opacity: f
|
|
2173
2170
|
}
|
|
2174
2171
|
}
|
|
2175
|
-
) :
|
|
2172
|
+
) : D === "arrow" ? /* @__PURE__ */ t.jsx(
|
|
2176
2173
|
"div",
|
|
2177
2174
|
{
|
|
2178
2175
|
className: "gantt-today-line-marker",
|
|
@@ -2185,13 +2182,13 @@ const xn = ({
|
|
|
2185
2182
|
height: 0,
|
|
2186
2183
|
borderLeft: `${i}px solid transparent`,
|
|
2187
2184
|
borderRight: `${i}px solid transparent`,
|
|
2188
|
-
borderBottom: `${i * 0.7}px solid ${
|
|
2185
|
+
borderBottom: `${i * 0.7}px solid ${g}`,
|
|
2189
2186
|
zIndex: 7,
|
|
2190
2187
|
pointerEvents: "none",
|
|
2191
2188
|
opacity: f
|
|
2192
2189
|
}
|
|
2193
2190
|
}
|
|
2194
|
-
) :
|
|
2191
|
+
) : D === "dot" ? /* @__PURE__ */ t.jsx(
|
|
2195
2192
|
"div",
|
|
2196
2193
|
{
|
|
2197
2194
|
className: "gantt-today-line-marker",
|
|
@@ -2203,7 +2200,7 @@ const xn = ({
|
|
|
2203
2200
|
width: `${i}px`,
|
|
2204
2201
|
height: `${i}px`,
|
|
2205
2202
|
borderRadius: "50%",
|
|
2206
|
-
backgroundColor:
|
|
2203
|
+
backgroundColor: g,
|
|
2207
2204
|
zIndex: 7,
|
|
2208
2205
|
pointerEvents: "none",
|
|
2209
2206
|
opacity: f
|
|
@@ -2232,60 +2229,60 @@ const xn = ({
|
|
|
2232
2229
|
}
|
|
2233
2230
|
)
|
|
2234
2231
|
] }),
|
|
2235
|
-
|
|
2232
|
+
Ue !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2236
2233
|
r.showProjectStartLineMarker !== !1 && (() => {
|
|
2237
|
-
const i = r.projectStartLineMarkerSize || 8,
|
|
2238
|
-
return
|
|
2234
|
+
const i = r.projectStartLineMarkerSize || 8, g = r.projectStartLineColor || "#40a9ff", D = r.projectStartLineMarkerStyle || "triangle", f = r.projectStartLineOpacity !== void 0 ? r.projectStartLineOpacity : 1;
|
|
2235
|
+
return D === "triangle" ? /* @__PURE__ */ t.jsx(
|
|
2239
2236
|
"div",
|
|
2240
2237
|
{
|
|
2241
2238
|
className: "gantt-project-start-line-marker",
|
|
2242
2239
|
style: {
|
|
2243
2240
|
position: "absolute",
|
|
2244
|
-
left: `${
|
|
2241
|
+
left: `${Ue}px`,
|
|
2245
2242
|
top: "-4px",
|
|
2246
2243
|
transform: "translateX(-50%)",
|
|
2247
2244
|
width: 0,
|
|
2248
2245
|
height: 0,
|
|
2249
2246
|
borderLeft: `${i}px solid transparent`,
|
|
2250
2247
|
borderRight: `${i}px solid transparent`,
|
|
2251
|
-
borderBottom: `${i}px solid ${
|
|
2248
|
+
borderBottom: `${i}px solid ${g}`,
|
|
2252
2249
|
zIndex: 7,
|
|
2253
2250
|
pointerEvents: "none",
|
|
2254
2251
|
opacity: f
|
|
2255
2252
|
}
|
|
2256
2253
|
}
|
|
2257
|
-
) :
|
|
2254
|
+
) : D === "arrow" ? /* @__PURE__ */ t.jsx(
|
|
2258
2255
|
"div",
|
|
2259
2256
|
{
|
|
2260
2257
|
className: "gantt-project-start-line-marker",
|
|
2261
2258
|
style: {
|
|
2262
2259
|
position: "absolute",
|
|
2263
|
-
left: `${
|
|
2260
|
+
left: `${Ue}px`,
|
|
2264
2261
|
top: "-6px",
|
|
2265
2262
|
transform: "translateX(-50%)",
|
|
2266
2263
|
width: 0,
|
|
2267
2264
|
height: 0,
|
|
2268
2265
|
borderLeft: `${i}px solid transparent`,
|
|
2269
2266
|
borderRight: `${i}px solid transparent`,
|
|
2270
|
-
borderBottom: `${i * 0.7}px solid ${
|
|
2267
|
+
borderBottom: `${i * 0.7}px solid ${g}`,
|
|
2271
2268
|
zIndex: 7,
|
|
2272
2269
|
pointerEvents: "none",
|
|
2273
2270
|
opacity: f
|
|
2274
2271
|
}
|
|
2275
2272
|
}
|
|
2276
|
-
) :
|
|
2273
|
+
) : D === "dot" ? /* @__PURE__ */ t.jsx(
|
|
2277
2274
|
"div",
|
|
2278
2275
|
{
|
|
2279
2276
|
className: "gantt-project-start-line-marker",
|
|
2280
2277
|
style: {
|
|
2281
2278
|
position: "absolute",
|
|
2282
|
-
left: `${
|
|
2279
|
+
left: `${Ue}px`,
|
|
2283
2280
|
top: `-${i / 2}px`,
|
|
2284
2281
|
transform: "translateX(-50%)",
|
|
2285
2282
|
width: `${i}px`,
|
|
2286
2283
|
height: `${i}px`,
|
|
2287
2284
|
borderRadius: "50%",
|
|
2288
|
-
backgroundColor:
|
|
2285
|
+
backgroundColor: g,
|
|
2289
2286
|
zIndex: 7,
|
|
2290
2287
|
pointerEvents: "none",
|
|
2291
2288
|
opacity: f
|
|
@@ -2299,7 +2296,7 @@ const xn = ({
|
|
|
2299
2296
|
className: "gantt-project-start-line",
|
|
2300
2297
|
style: {
|
|
2301
2298
|
position: "absolute",
|
|
2302
|
-
left: `${
|
|
2299
|
+
left: `${Ue}px`,
|
|
2303
2300
|
top: 0,
|
|
2304
2301
|
bottom: 0,
|
|
2305
2302
|
width: `${r.projectStartLineWidth || 1}px`,
|
|
@@ -2314,27 +2311,27 @@ const xn = ({
|
|
|
2314
2311
|
}
|
|
2315
2312
|
)
|
|
2316
2313
|
] }),
|
|
2317
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-grid", children: Y.map((i,
|
|
2318
|
-
const
|
|
2314
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-grid", children: Y.map((i, g) => {
|
|
2315
|
+
const D = r.weekends && Kt(i.date), f = r.holidays && Zt(i.date, r.holidays);
|
|
2319
2316
|
return /* @__PURE__ */ t.jsx(
|
|
2320
2317
|
"div",
|
|
2321
2318
|
{
|
|
2322
|
-
className: `gantt-timeline-grid-column ${
|
|
2323
|
-
style: { width:
|
|
2319
|
+
className: `gantt-timeline-grid-column ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
|
|
2320
|
+
style: { width: O, minWidth: O }
|
|
2324
2321
|
},
|
|
2325
|
-
|
|
2322
|
+
g
|
|
2326
2323
|
);
|
|
2327
2324
|
}) }),
|
|
2328
2325
|
C.length > 0 && /* @__PURE__ */ t.jsx(
|
|
2329
2326
|
wn,
|
|
2330
2327
|
{
|
|
2331
2328
|
links: C,
|
|
2332
|
-
tasks:
|
|
2329
|
+
tasks: v,
|
|
2333
2330
|
getTaskPosition: Le
|
|
2334
2331
|
}
|
|
2335
2332
|
),
|
|
2336
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width:
|
|
2337
|
-
const
|
|
2333
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width: pe }, children: De ? Array.from(S?.values() || []).map((i) => {
|
|
2334
|
+
const g = ye(i);
|
|
2338
2335
|
return /* @__PURE__ */ t.jsx(
|
|
2339
2336
|
"div",
|
|
2340
2337
|
{
|
|
@@ -2344,8 +2341,8 @@ const xn = ({
|
|
|
2344
2341
|
{
|
|
2345
2342
|
className: "gantt-baseline-bar baseline-only",
|
|
2346
2343
|
style: {
|
|
2347
|
-
left: `${
|
|
2348
|
-
width: `${
|
|
2344
|
+
left: `${g.left}px`,
|
|
2345
|
+
width: `${g.width}px`
|
|
2349
2346
|
},
|
|
2350
2347
|
title: `Baseline: ${i.start.toLocaleDateString()} - ${i.end.toLocaleDateString()}`
|
|
2351
2348
|
}
|
|
@@ -2353,14 +2350,14 @@ const xn = ({
|
|
|
2353
2350
|
},
|
|
2354
2351
|
`baseline-only-${i.taskId}`
|
|
2355
2352
|
);
|
|
2356
|
-
}) :
|
|
2357
|
-
const
|
|
2353
|
+
}) : v.map((i) => {
|
|
2354
|
+
const g = z(i), D = j ? S?.get(i.id) : void 0, f = D ? ye(D) : void 0;
|
|
2358
2355
|
return /* @__PURE__ */ t.jsxs(
|
|
2359
2356
|
"div",
|
|
2360
2357
|
{
|
|
2361
2358
|
className: "gantt-timeline-row",
|
|
2362
2359
|
children: [
|
|
2363
|
-
|
|
2360
|
+
D && f && /* @__PURE__ */ t.jsx(
|
|
2364
2361
|
"div",
|
|
2365
2362
|
{
|
|
2366
2363
|
className: `gantt-baseline-bar ${i.type === "milestone" ? "milestone" : ""}`,
|
|
@@ -2368,24 +2365,24 @@ const xn = ({
|
|
|
2368
2365
|
left: `${f.left}px`,
|
|
2369
2366
|
width: `${f.width}px`
|
|
2370
2367
|
},
|
|
2371
|
-
title: `Baseline: ${
|
|
2368
|
+
title: `Baseline: ${D.start.toLocaleDateString()} - ${D.end.toLocaleDateString()}`
|
|
2372
2369
|
}
|
|
2373
2370
|
),
|
|
2374
2371
|
!i.hideBar && /* @__PURE__ */ t.jsx(
|
|
2375
2372
|
xn,
|
|
2376
2373
|
{
|
|
2377
2374
|
task: i,
|
|
2378
|
-
baseline:
|
|
2375
|
+
baseline: D,
|
|
2379
2376
|
dependencyRuleDescriptions: R.get(i.id) || [],
|
|
2380
2377
|
tooltipConfig: m,
|
|
2381
|
-
position:
|
|
2378
|
+
position: g,
|
|
2382
2379
|
selected: c === i.id,
|
|
2383
2380
|
dragging: I.taskId === i.id,
|
|
2384
2381
|
dragDeltaX: I.dragDeltaX,
|
|
2385
2382
|
dragType: I.type,
|
|
2386
2383
|
onClick: () => b(i.id),
|
|
2387
|
-
onDragStart: (
|
|
2388
|
-
ne(i.id,
|
|
2384
|
+
onDragStart: (U, G, ee) => {
|
|
2385
|
+
ne(i.id, U, G, ee), u(i.id, U, G);
|
|
2389
2386
|
},
|
|
2390
2387
|
readonly: r.readonly
|
|
2391
2388
|
}
|
|
@@ -2405,15 +2402,15 @@ const xn = ({
|
|
|
2405
2402
|
Lr.displayName = "Timeline";
|
|
2406
2403
|
const Fr = wr((e, a) => /* @__PURE__ */ t.jsx("div", { className: "gantt-chart-wrapper", style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ t.jsx(Lr, { ...e, ref: a }) }));
|
|
2407
2404
|
Fr.displayName = "Chart";
|
|
2408
|
-
const { Search:
|
|
2409
|
-
const [s, r] =
|
|
2405
|
+
const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig: n = {} }) => {
|
|
2406
|
+
const [s, r] = J({
|
|
2410
2407
|
searchText: "",
|
|
2411
2408
|
status: "all",
|
|
2412
2409
|
priority: "all",
|
|
2413
2410
|
owner: ""
|
|
2414
2411
|
}), c = (d) => {
|
|
2415
|
-
const
|
|
2416
|
-
r(
|
|
2412
|
+
const h = { ...s, ...d };
|
|
2413
|
+
r(h), e(h);
|
|
2417
2414
|
}, b = () => {
|
|
2418
2415
|
const d = {
|
|
2419
2416
|
searchText: "",
|
|
@@ -2425,7 +2422,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2425
2422
|
}, u = s.searchText !== "" || s.status !== "all" || s.priority !== "all" || s.owner !== "";
|
|
2426
2423
|
return /* @__PURE__ */ t.jsx("div", { className: "gantt-filter-container", children: /* @__PURE__ */ t.jsxs("div", { className: "gantt-filter-bar", children: [
|
|
2427
2424
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-filter-left", children: /* @__PURE__ */ t.jsx(
|
|
2428
|
-
|
|
2425
|
+
vn,
|
|
2429
2426
|
{
|
|
2430
2427
|
placeholder: n.searchPlaceholder || "Search stages...",
|
|
2431
2428
|
value: s.searchText,
|
|
@@ -2437,7 +2434,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2437
2434
|
) }),
|
|
2438
2435
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-filter-right", children: [
|
|
2439
2436
|
/* @__PURE__ */ t.jsx(
|
|
2440
|
-
|
|
2437
|
+
Oe,
|
|
2441
2438
|
{
|
|
2442
2439
|
value: s.status,
|
|
2443
2440
|
onChange: (d) => c({ status: d }),
|
|
@@ -2452,7 +2449,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2452
2449
|
}
|
|
2453
2450
|
),
|
|
2454
2451
|
/* @__PURE__ */ t.jsx(
|
|
2455
|
-
|
|
2452
|
+
Oe,
|
|
2456
2453
|
{
|
|
2457
2454
|
value: s.priority,
|
|
2458
2455
|
onChange: (d) => c({ priority: d }),
|
|
@@ -2467,7 +2464,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2467
2464
|
}
|
|
2468
2465
|
),
|
|
2469
2466
|
/* @__PURE__ */ t.jsx(
|
|
2470
|
-
|
|
2467
|
+
Oe,
|
|
2471
2468
|
{
|
|
2472
2469
|
value: s.owner || void 0,
|
|
2473
2470
|
onChange: (d) => c({ owner: d || "" }),
|
|
@@ -2482,7 +2479,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2482
2479
|
}
|
|
2483
2480
|
),
|
|
2484
2481
|
u && /* @__PURE__ */ t.jsx(
|
|
2485
|
-
|
|
2482
|
+
Pe,
|
|
2486
2483
|
{
|
|
2487
2484
|
type: "default",
|
|
2488
2485
|
danger: !0,
|
|
@@ -2494,7 +2491,7 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2494
2491
|
)
|
|
2495
2492
|
] })
|
|
2496
2493
|
] }) });
|
|
2497
|
-
},
|
|
2494
|
+
}, ct = (e, a) => e ? typeof e == "string" ? /* @__PURE__ */ t.jsx(Ee, { icon: a }) : e : /* @__PURE__ */ t.jsx(Ee, { icon: a }), Tn = ({
|
|
2498
2495
|
zoomLevel: e,
|
|
2499
2496
|
setZoomLevel: a,
|
|
2500
2497
|
timelineView: n,
|
|
@@ -2504,21 +2501,21 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2504
2501
|
onFilterChange: b,
|
|
2505
2502
|
owners: u,
|
|
2506
2503
|
onAddTask: d,
|
|
2507
|
-
uiConfig:
|
|
2508
|
-
iconConfig:
|
|
2509
|
-
styleConfig:
|
|
2504
|
+
uiConfig: h,
|
|
2505
|
+
iconConfig: p = {},
|
|
2506
|
+
styleConfig: S
|
|
2510
2507
|
}) => {
|
|
2511
|
-
const
|
|
2508
|
+
const y = jt(S), m = h.showZoomButtons !== !1, E = h.showExportButtons !== !1, F = s.length > 1 && r, N = m && E;
|
|
2512
2509
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
|
|
2513
2510
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar", children: [
|
|
2514
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(er, { size: 8, children:
|
|
2515
|
-
|
|
2511
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(er, { size: 8, children: h.showAddTaskButton !== !1 && /* @__PURE__ */ t.jsx(
|
|
2512
|
+
Pe,
|
|
2516
2513
|
{
|
|
2517
2514
|
type: "primary",
|
|
2518
|
-
icon:
|
|
2515
|
+
icon: ct(p.addTask, ar),
|
|
2519
2516
|
onClick: () => d?.(),
|
|
2520
|
-
style:
|
|
2521
|
-
children:
|
|
2517
|
+
style: y.buttonPrimary,
|
|
2518
|
+
children: h.addTaskButtonText || "New Stage"
|
|
2522
2519
|
}
|
|
2523
2520
|
) }) }),
|
|
2524
2521
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ t.jsxs(er, { size: 4, children: [
|
|
@@ -2535,91 +2532,91 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2535
2532
|
(m || E) && /* @__PURE__ */ t.jsx(tr, { type: "vertical", style: { height: 24, margin: "0 4px" } })
|
|
2536
2533
|
] }),
|
|
2537
2534
|
m && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2538
|
-
/* @__PURE__ */ t.jsx(
|
|
2539
|
-
|
|
2535
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.zoomOutTooltip || "Zoom Out", children: /* @__PURE__ */ t.jsx(
|
|
2536
|
+
Pe,
|
|
2540
2537
|
{
|
|
2541
|
-
icon:
|
|
2538
|
+
icon: ct(p.zoomOut, Gr),
|
|
2542
2539
|
onClick: () => a(Math.max(0.5, e - 0.25)),
|
|
2543
|
-
style:
|
|
2540
|
+
style: y.buttonSecondary
|
|
2544
2541
|
}
|
|
2545
2542
|
) }),
|
|
2546
|
-
/* @__PURE__ */ t.jsx(
|
|
2547
|
-
|
|
2543
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ t.jsx(
|
|
2544
|
+
Pe,
|
|
2548
2545
|
{
|
|
2549
|
-
icon:
|
|
2546
|
+
icon: ct(p.zoomIn, Jr),
|
|
2550
2547
|
onClick: () => a(Math.min(2, e + 0.25)),
|
|
2551
|
-
style:
|
|
2548
|
+
style: y.buttonSecondary
|
|
2552
2549
|
}
|
|
2553
2550
|
) }),
|
|
2554
|
-
/* @__PURE__ */ t.jsx(
|
|
2555
|
-
|
|
2551
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ t.jsx(
|
|
2552
|
+
Pe,
|
|
2556
2553
|
{
|
|
2557
|
-
icon:
|
|
2554
|
+
icon: ct(p.resetZoom, jr),
|
|
2558
2555
|
onClick: () => a(1),
|
|
2559
|
-
style:
|
|
2556
|
+
style: y.buttonSecondary
|
|
2560
2557
|
}
|
|
2561
2558
|
) })
|
|
2562
2559
|
] }),
|
|
2563
2560
|
N && /* @__PURE__ */ t.jsx(tr, { type: "vertical", style: { height: 24, margin: "0 4px" } }),
|
|
2564
2561
|
E && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2565
|
-
/* @__PURE__ */ t.jsx(
|
|
2566
|
-
|
|
2562
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.exportCSVTooltip || "Export to CSV", children: /* @__PURE__ */ t.jsx(
|
|
2563
|
+
Pe,
|
|
2567
2564
|
{
|
|
2568
|
-
icon:
|
|
2565
|
+
icon: ct(p.exportCSV, Kr),
|
|
2569
2566
|
onClick: () => c("csv"),
|
|
2570
|
-
style:
|
|
2567
|
+
style: y.buttonSecondary
|
|
2571
2568
|
}
|
|
2572
2569
|
) }),
|
|
2573
|
-
/* @__PURE__ */ t.jsx(
|
|
2574
|
-
|
|
2570
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ t.jsx(
|
|
2571
|
+
Pe,
|
|
2575
2572
|
{
|
|
2576
|
-
icon:
|
|
2573
|
+
icon: ct(p.exportExcel, Zr),
|
|
2577
2574
|
onClick: () => c("excel"),
|
|
2578
|
-
style:
|
|
2575
|
+
style: y.buttonSecondary
|
|
2579
2576
|
}
|
|
2580
2577
|
) }),
|
|
2581
|
-
/* @__PURE__ */ t.jsx(
|
|
2582
|
-
|
|
2578
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ t.jsx(
|
|
2579
|
+
Pe,
|
|
2583
2580
|
{
|
|
2584
|
-
icon:
|
|
2581
|
+
icon: ct(p.exportJSON, Qr),
|
|
2585
2582
|
onClick: () => c("json"),
|
|
2586
|
-
style:
|
|
2583
|
+
style: y.buttonSecondary
|
|
2587
2584
|
}
|
|
2588
2585
|
) }),
|
|
2589
|
-
/* @__PURE__ */ t.jsx(
|
|
2590
|
-
|
|
2586
|
+
/* @__PURE__ */ t.jsx(nt, { title: h.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ t.jsx(
|
|
2587
|
+
Pe,
|
|
2591
2588
|
{
|
|
2592
|
-
icon:
|
|
2589
|
+
icon: ct(p.exportPDF, en),
|
|
2593
2590
|
onClick: () => c("pdf"),
|
|
2594
|
-
style:
|
|
2591
|
+
style: y.buttonSecondary
|
|
2595
2592
|
}
|
|
2596
2593
|
) })
|
|
2597
2594
|
] })
|
|
2598
2595
|
] }) })
|
|
2599
2596
|
] }),
|
|
2600
|
-
|
|
2601
|
-
|
|
2597
|
+
h.showFilterSearch !== !1 && /* @__PURE__ */ t.jsx(
|
|
2598
|
+
jn,
|
|
2602
2599
|
{
|
|
2603
2600
|
onFilterChange: b,
|
|
2604
2601
|
owners: u,
|
|
2605
|
-
uiConfig:
|
|
2602
|
+
uiConfig: h
|
|
2606
2603
|
}
|
|
2607
2604
|
)
|
|
2608
2605
|
] });
|
|
2609
|
-
}, { Option: St } =
|
|
2610
|
-
const [b] = je.useForm(), u = jt(c), d = (
|
|
2611
|
-
const
|
|
2612
|
-
|
|
2613
|
-
text:
|
|
2614
|
-
start:
|
|
2615
|
-
end:
|
|
2616
|
-
duration:
|
|
2617
|
-
progress:
|
|
2618
|
-
type:
|
|
2619
|
-
color: typeof
|
|
2620
|
-
owner:
|
|
2621
|
-
priority:
|
|
2622
|
-
details:
|
|
2606
|
+
}, { Option: St } = Oe, { TextArea: Dn } = pt, Mn = ({ onCreateTask: e, onClose: a, uiConfig: n = {}, parentId: s, parentTaskName: r, styleConfig: c }) => {
|
|
2607
|
+
const [b] = je.useForm(), u = jt(c), d = (h) => {
|
|
2608
|
+
const p = h.start.toDate(), S = new Date(p);
|
|
2609
|
+
S.setDate(S.getDate() + (h.duration || 1)), e({
|
|
2610
|
+
text: h.text,
|
|
2611
|
+
start: p,
|
|
2612
|
+
end: S,
|
|
2613
|
+
duration: h.duration || 1,
|
|
2614
|
+
progress: h.progress || 0,
|
|
2615
|
+
type: h.type,
|
|
2616
|
+
color: typeof h.color == "string" ? h.color : h.color?.toHexString?.() || "#4A90E2",
|
|
2617
|
+
owner: h.owner || "",
|
|
2618
|
+
priority: h.priority || "medium",
|
|
2619
|
+
details: h.details || "",
|
|
2623
2620
|
parent: s
|
|
2624
2621
|
// Set parent for subtasks
|
|
2625
2622
|
}, s), a();
|
|
@@ -2662,16 +2659,16 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2662
2659
|
name: "text",
|
|
2663
2660
|
label: n.taskNameLabel || "Stage Name",
|
|
2664
2661
|
rules: [{ required: !0, message: n.taskNameRequired || "Please enter stage name" }],
|
|
2665
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2662
|
+
children: /* @__PURE__ */ t.jsx(pt, { placeholder: n.taskNamePlaceholder || "Enter stage name", autoFocus: !0, style: u.input })
|
|
2666
2663
|
}
|
|
2667
2664
|
),
|
|
2668
2665
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2669
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: n.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
2666
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: n.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
|
|
2670
2667
|
/* @__PURE__ */ t.jsx(St, { value: "task", children: n.taskTypeOptions?.task || "Stage" }),
|
|
2671
2668
|
/* @__PURE__ */ t.jsx(St, { value: "milestone", children: n.taskTypeOptions?.milestone || "Milestone" }),
|
|
2672
2669
|
/* @__PURE__ */ t.jsx(St, { value: "project", children: n.taskTypeOptions?.project || "Project" })
|
|
2673
2670
|
] }) }),
|
|
2674
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: n.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
2671
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: n.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
|
|
2675
2672
|
/* @__PURE__ */ t.jsx(St, { value: "low", children: n.priorityOptions?.low || "Low" }),
|
|
2676
2673
|
/* @__PURE__ */ t.jsx(St, { value: "medium", children: n.priorityOptions?.medium || "Medium" }),
|
|
2677
2674
|
/* @__PURE__ */ t.jsx(St, { value: "high", children: n.priorityOptions?.high || "High" })
|
|
@@ -2679,37 +2676,37 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2679
2676
|
] }),
|
|
2680
2677
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2681
2678
|
/* @__PURE__ */ t.jsx(je.Item, { name: "start", label: n.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(Sr, { style: { width: "100%", ...u.input } }) }),
|
|
2682
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: n.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
2679
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: n.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, style: { width: "100%", ...u.input } }) })
|
|
2683
2680
|
] }),
|
|
2684
2681
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2685
2682
|
/* @__PURE__ */ t.jsx(je.Item, { name: "color", label: n.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(vr, { showText: !0 }) }),
|
|
2686
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: n.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
2683
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: n.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, max: 100, style: { width: "100%", ...u.input } }) })
|
|
2687
2684
|
] }),
|
|
2688
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: n.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(
|
|
2689
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: n.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(
|
|
2685
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: n.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(pt, { placeholder: n.ownerPlaceholder || "Assign to...", style: u.input }) }),
|
|
2686
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: n.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(Dn, { placeholder: n.detailsPlaceholder || "Add stage description...", rows: 3, style: u.input }) })
|
|
2690
2687
|
]
|
|
2691
2688
|
}
|
|
2692
2689
|
)
|
|
2693
2690
|
}
|
|
2694
2691
|
);
|
|
2695
|
-
}, { Option: vt } =
|
|
2696
|
-
const [b] = je.useForm(), u = jt(c), d = (
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2692
|
+
}, { Option: vt } = Oe, { TextArea: En } = pt, { confirm: Ln } = At, Fn = ({ task: e, onUpdate: a, onDelete: n, onClose: s, uiConfig: r = {}, styleConfig: c }) => {
|
|
2693
|
+
const [b] = je.useForm(), u = jt(c), d = (p) => {
|
|
2694
|
+
const S = p.start.toDate(), y = new Date(S);
|
|
2695
|
+
y.setDate(y.getDate() + (p.duration || 1)), a({
|
|
2699
2696
|
...e,
|
|
2700
|
-
text:
|
|
2701
|
-
start:
|
|
2702
|
-
end:
|
|
2703
|
-
duration:
|
|
2704
|
-
progress:
|
|
2705
|
-
type:
|
|
2706
|
-
color: typeof
|
|
2707
|
-
owner:
|
|
2708
|
-
priority:
|
|
2709
|
-
details:
|
|
2697
|
+
text: p.text,
|
|
2698
|
+
start: S,
|
|
2699
|
+
end: y,
|
|
2700
|
+
duration: p.duration || 1,
|
|
2701
|
+
progress: p.progress || 0,
|
|
2702
|
+
type: p.type,
|
|
2703
|
+
color: typeof p.color == "string" ? p.color : p.color?.toHexString?.() || "#4A90E2",
|
|
2704
|
+
owner: p.owner || "",
|
|
2705
|
+
priority: p.priority || "medium",
|
|
2706
|
+
details: p.details || ""
|
|
2710
2707
|
}), s();
|
|
2711
|
-
},
|
|
2712
|
-
|
|
2708
|
+
}, h = () => {
|
|
2709
|
+
Ln({
|
|
2713
2710
|
title: r.deleteConfirmTitle ? `${r.deleteConfirmTitle}: "${e.text}"?` : `Are you sure you want to delete "${e.text}"?`,
|
|
2714
2711
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: tn, style: { color: "#faad14", marginRight: 8 } }),
|
|
2715
2712
|
content: r.deleteConfirmContent || "This action cannot be undone.",
|
|
@@ -2728,9 +2725,9 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2728
2725
|
open: !0,
|
|
2729
2726
|
onCancel: s,
|
|
2730
2727
|
footer: [
|
|
2731
|
-
/* @__PURE__ */ t.jsx(
|
|
2732
|
-
/* @__PURE__ */ t.jsx(
|
|
2733
|
-
/* @__PURE__ */ t.jsx(
|
|
2728
|
+
/* @__PURE__ */ t.jsx(Pe, { danger: !0, onClick: h, style: { float: "left", ...u.buttonDanger }, children: r.taskEditorDeleteText || "Delete" }, "delete"),
|
|
2729
|
+
/* @__PURE__ */ t.jsx(Pe, { onClick: s, style: u.buttonSecondary, children: r.taskEditorCancelText || "Cancel" }, "cancel"),
|
|
2730
|
+
/* @__PURE__ */ t.jsx(Pe, { type: "primary", onClick: () => b.submit(), style: u.buttonPrimary, children: r.taskEditorSaveText || "Save Changes" }, "submit")
|
|
2734
2731
|
],
|
|
2735
2732
|
width: 600,
|
|
2736
2733
|
className: "gantt-modal-antd",
|
|
@@ -2762,16 +2759,16 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2762
2759
|
name: "text",
|
|
2763
2760
|
label: r.taskNameLabel || "Stage Name",
|
|
2764
2761
|
rules: [{ required: !0, message: r.taskNameRequired || "Please enter stage name" }],
|
|
2765
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2762
|
+
children: /* @__PURE__ */ t.jsx(pt, { placeholder: r.taskNamePlaceholder || "Enter stage name", style: u.input })
|
|
2766
2763
|
}
|
|
2767
2764
|
),
|
|
2768
2765
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2769
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
2766
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
|
|
2770
2767
|
/* @__PURE__ */ t.jsx(vt, { value: "task", children: r.taskTypeOptions?.task || "Stage" }),
|
|
2771
2768
|
/* @__PURE__ */ t.jsx(vt, { value: "milestone", children: r.taskTypeOptions?.milestone || "Milestone" }),
|
|
2772
2769
|
/* @__PURE__ */ t.jsx(vt, { value: "project", children: r.taskTypeOptions?.project || "Project" })
|
|
2773
2770
|
] }) }),
|
|
2774
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
2771
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
|
|
2775
2772
|
/* @__PURE__ */ t.jsx(vt, { value: "low", children: r.priorityOptions?.low || "Low" }),
|
|
2776
2773
|
/* @__PURE__ */ t.jsx(vt, { value: "medium", children: r.priorityOptions?.medium || "Medium" }),
|
|
2777
2774
|
/* @__PURE__ */ t.jsx(vt, { value: "high", children: r.priorityOptions?.high || "High" })
|
|
@@ -2779,20 +2776,20 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2779
2776
|
] }),
|
|
2780
2777
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2781
2778
|
/* @__PURE__ */ t.jsx(je.Item, { name: "start", label: r.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(Sr, { style: { width: "100%", ...u.input } }) }),
|
|
2782
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: r.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
2779
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: r.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, style: { width: "100%", ...u.input } }) })
|
|
2783
2780
|
] }),
|
|
2784
2781
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2785
2782
|
/* @__PURE__ */ t.jsx(je.Item, { name: "color", label: r.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(vr, { showText: !0 }) }),
|
|
2786
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: r.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(
|
|
2783
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: r.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, max: 100, style: { width: "100%", ...u.input } }) })
|
|
2787
2784
|
] }),
|
|
2788
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: r.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(
|
|
2789
|
-
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: r.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(
|
|
2785
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: r.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(pt, { placeholder: r.ownerPlaceholder || "Assign to...", style: u.input }) }),
|
|
2786
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: r.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(En, { placeholder: r.detailsPlaceholder || "Add stage description...", rows: 3, style: u.input }) })
|
|
2790
2787
|
]
|
|
2791
2788
|
}
|
|
2792
2789
|
)
|
|
2793
2790
|
}
|
|
2794
2791
|
);
|
|
2795
|
-
}, { Title: Pt, Text: gt, Paragraph:
|
|
2792
|
+
}, { Title: Pt, Text: gt, Paragraph: Rn } = br, { Option: rt } = Oe, Pn = ({
|
|
2796
2793
|
task: e,
|
|
2797
2794
|
allTasks: a,
|
|
2798
2795
|
links: n,
|
|
@@ -2802,18 +2799,18 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2802
2799
|
onClose: b,
|
|
2803
2800
|
styleConfig: u
|
|
2804
2801
|
}) => {
|
|
2805
|
-
const d = jt(u), [
|
|
2806
|
-
if (
|
|
2802
|
+
const d = jt(u), [h, p] = J(""), [S, y] = J("e2s"), [m, E] = J(0), [F, N] = J("day"), [M, v] = J(e.duration), [w, C] = J(""), Z = n.filter((R) => R.target === e.id), W = a.filter((R) => R.id !== e.id && R.id !== e.parent), re = () => {
|
|
2803
|
+
if (h) {
|
|
2807
2804
|
const R = rr(m, F);
|
|
2808
2805
|
if (M !== e.duration && c) {
|
|
2809
|
-
const
|
|
2806
|
+
const k = Te(new Date(e.start), M, "day");
|
|
2810
2807
|
c({
|
|
2811
2808
|
...e,
|
|
2812
2809
|
duration: M,
|
|
2813
|
-
end:
|
|
2810
|
+
end: k
|
|
2814
2811
|
});
|
|
2815
2812
|
}
|
|
2816
|
-
s(
|
|
2813
|
+
s(h, e.id, S, R), p(""), E(0), N("day");
|
|
2817
2814
|
}
|
|
2818
2815
|
}, le = () => {
|
|
2819
2816
|
if (!w.trim()) return;
|
|
@@ -2823,13 +2820,13 @@ const { Search: jn } = ut, Tn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2823
2820
|
Example: 3FS+10d`);
|
|
2824
2821
|
return;
|
|
2825
2822
|
}
|
|
2826
|
-
const
|
|
2823
|
+
const k = R.taskNumber - 1, B = a[k];
|
|
2827
2824
|
if (!B) {
|
|
2828
2825
|
alert(`Task ${R.taskNumber} not found`);
|
|
2829
2826
|
return;
|
|
2830
2827
|
}
|
|
2831
|
-
const Y = fn(R.type),
|
|
2832
|
-
s(B.id, e.id, Y,
|
|
2828
|
+
const Y = fn(R.type), O = rr(R.lag, R.lagUnit);
|
|
2829
|
+
s(B.id, e.id, Y, O), C("");
|
|
2833
2830
|
}, j = (R) => {
|
|
2834
2831
|
switch (R) {
|
|
2835
2832
|
case "e2s":
|
|
@@ -2841,7 +2838,7 @@ Example: 3FS+10d`);
|
|
|
2841
2838
|
case "s2e":
|
|
2842
2839
|
return "Start-to-Finish (SF)";
|
|
2843
2840
|
}
|
|
2844
|
-
},
|
|
2841
|
+
}, X = (R) => {
|
|
2845
2842
|
switch (R) {
|
|
2846
2843
|
case "e2s":
|
|
2847
2844
|
return "blue";
|
|
@@ -2887,15 +2884,15 @@ Example: 3FS+10d`);
|
|
|
2887
2884
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2888
2885
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Predecessor" }),
|
|
2889
2886
|
/* @__PURE__ */ t.jsx(
|
|
2890
|
-
|
|
2887
|
+
Oe,
|
|
2891
2888
|
{
|
|
2892
2889
|
showSearch: !0,
|
|
2893
2890
|
placeholder: "Select a task",
|
|
2894
2891
|
optionFilterProp: "children",
|
|
2895
2892
|
style: { width: "100%", ...d.input },
|
|
2896
|
-
value:
|
|
2897
|
-
onChange:
|
|
2898
|
-
children: W.map((R) => /* @__PURE__ */ t.jsxs(
|
|
2893
|
+
value: h,
|
|
2894
|
+
onChange: p,
|
|
2895
|
+
children: W.map((R) => /* @__PURE__ */ t.jsxs(rt, { value: R.id, children: [
|
|
2899
2896
|
"[",
|
|
2900
2897
|
a.indexOf(R) + 1,
|
|
2901
2898
|
"] ",
|
|
@@ -2907,16 +2904,16 @@ Example: 3FS+10d`);
|
|
|
2907
2904
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2908
2905
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Type" }),
|
|
2909
2906
|
/* @__PURE__ */ t.jsxs(
|
|
2910
|
-
|
|
2907
|
+
Oe,
|
|
2911
2908
|
{
|
|
2912
2909
|
style: { width: "100%", ...d.input },
|
|
2913
|
-
value:
|
|
2914
|
-
onChange:
|
|
2910
|
+
value: S,
|
|
2911
|
+
onChange: y,
|
|
2915
2912
|
children: [
|
|
2916
|
-
/* @__PURE__ */ t.jsx(
|
|
2917
|
-
/* @__PURE__ */ t.jsx(
|
|
2918
|
-
/* @__PURE__ */ t.jsx(
|
|
2919
|
-
/* @__PURE__ */ t.jsx(
|
|
2913
|
+
/* @__PURE__ */ t.jsx(rt, { value: "e2s", children: "Finish-to-Start (FS)" }),
|
|
2914
|
+
/* @__PURE__ */ t.jsx(rt, { value: "s2s", children: "Start-to-Start (SS)" }),
|
|
2915
|
+
/* @__PURE__ */ t.jsx(rt, { value: "e2e", children: "Finish-to-Finish (FF)" }),
|
|
2916
|
+
/* @__PURE__ */ t.jsx(rt, { value: "s2e", children: "Start-to-Finish (SF)" })
|
|
2920
2917
|
]
|
|
2921
2918
|
}
|
|
2922
2919
|
)
|
|
@@ -2925,7 +2922,7 @@ Example: 3FS+10d`);
|
|
|
2925
2922
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
2926
2923
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Lag/Lead" }),
|
|
2927
2924
|
/* @__PURE__ */ t.jsx(
|
|
2928
|
-
|
|
2925
|
+
at,
|
|
2929
2926
|
{
|
|
2930
2927
|
style: { width: "100%", ...d.input },
|
|
2931
2928
|
value: m,
|
|
@@ -2936,16 +2933,16 @@ Example: 3FS+10d`);
|
|
|
2936
2933
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
2937
2934
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Units" }),
|
|
2938
2935
|
/* @__PURE__ */ t.jsxs(
|
|
2939
|
-
|
|
2936
|
+
Oe,
|
|
2940
2937
|
{
|
|
2941
2938
|
style: { width: "100%", ...d.input },
|
|
2942
2939
|
value: F,
|
|
2943
2940
|
onChange: N,
|
|
2944
2941
|
children: [
|
|
2945
|
-
/* @__PURE__ */ t.jsx(
|
|
2946
|
-
/* @__PURE__ */ t.jsx(
|
|
2947
|
-
/* @__PURE__ */ t.jsx(
|
|
2948
|
-
/* @__PURE__ */ t.jsx(
|
|
2942
|
+
/* @__PURE__ */ t.jsx(rt, { value: "day", children: "Days" }),
|
|
2943
|
+
/* @__PURE__ */ t.jsx(rt, { value: "hour", children: "Hours" }),
|
|
2944
|
+
/* @__PURE__ */ t.jsx(rt, { value: "week", children: "Weeks" }),
|
|
2945
|
+
/* @__PURE__ */ t.jsx(rt, { value: "month", children: "Months" })
|
|
2949
2946
|
]
|
|
2950
2947
|
}
|
|
2951
2948
|
)
|
|
@@ -2954,23 +2951,23 @@ Example: 3FS+10d`);
|
|
|
2954
2951
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2955
2952
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Duration (days)" }),
|
|
2956
2953
|
/* @__PURE__ */ t.jsx(
|
|
2957
|
-
|
|
2954
|
+
at,
|
|
2958
2955
|
{
|
|
2959
2956
|
style: { width: "100%", ...d.input },
|
|
2960
2957
|
min: 1,
|
|
2961
2958
|
value: M,
|
|
2962
|
-
onChange: (R) =>
|
|
2959
|
+
onChange: (R) => v(R || 1)
|
|
2963
2960
|
}
|
|
2964
2961
|
)
|
|
2965
2962
|
] }),
|
|
2966
2963
|
/* @__PURE__ */ t.jsx(
|
|
2967
|
-
|
|
2964
|
+
Pe,
|
|
2968
2965
|
{
|
|
2969
2966
|
type: "primary",
|
|
2970
2967
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: ar, style: { marginRight: 8 } }),
|
|
2971
2968
|
block: !0,
|
|
2972
2969
|
onClick: re,
|
|
2973
|
-
disabled: !
|
|
2970
|
+
disabled: !h,
|
|
2974
2971
|
style: {
|
|
2975
2972
|
height: 40,
|
|
2976
2973
|
marginTop: 8,
|
|
@@ -2990,13 +2987,13 @@ Example: 3FS+10d`);
|
|
|
2990
2987
|
style: { width: 250, ...d.modal },
|
|
2991
2988
|
headStyle: { borderBottom: `1px solid ${d.modal?.borderColor || "#f0f0f0"}` },
|
|
2992
2989
|
children: [
|
|
2993
|
-
/* @__PURE__ */ t.jsxs(
|
|
2990
|
+
/* @__PURE__ */ t.jsxs(Rn, { type: "secondary", style: { fontSize: 12, marginBottom: 16, color: d.font?.color, opacity: 0.7 }, children: [
|
|
2994
2991
|
"Format: [TaskNumber][Type][+/-][Lag][Unit]",
|
|
2995
2992
|
/* @__PURE__ */ t.jsx("br", {}),
|
|
2996
2993
|
"Example: 3FS+10d"
|
|
2997
2994
|
] }),
|
|
2998
2995
|
/* @__PURE__ */ t.jsx(
|
|
2999
|
-
|
|
2996
|
+
pt,
|
|
3000
2997
|
{
|
|
3001
2998
|
placeholder: "e.g. 5FS+2d",
|
|
3002
2999
|
value: w,
|
|
@@ -3010,7 +3007,7 @@ Example: 3FS+10d`);
|
|
|
3010
3007
|
}
|
|
3011
3008
|
),
|
|
3012
3009
|
/* @__PURE__ */ t.jsx(
|
|
3013
|
-
|
|
3010
|
+
Pe,
|
|
3014
3011
|
{
|
|
3015
3012
|
block: !0,
|
|
3016
3013
|
onClick: le,
|
|
@@ -3034,7 +3031,7 @@ Example: 3FS+10d`);
|
|
|
3034
3031
|
dataSource: Z,
|
|
3035
3032
|
locale: { emptyText: /* @__PURE__ */ t.jsx(gt, { type: "secondary", style: { color: d.font?.color, opacity: 0.5 }, children: "No dependencies added yet." }) },
|
|
3036
3033
|
renderItem: (R) => {
|
|
3037
|
-
const
|
|
3034
|
+
const k = a.find((B) => B.id === R.source);
|
|
3038
3035
|
return /* @__PURE__ */ t.jsx(
|
|
3039
3036
|
Jt.Item,
|
|
3040
3037
|
{
|
|
@@ -3047,7 +3044,7 @@ Example: 3FS+10d`);
|
|
|
3047
3044
|
},
|
|
3048
3045
|
actions: [
|
|
3049
3046
|
/* @__PURE__ */ t.jsx(
|
|
3050
|
-
|
|
3047
|
+
Pe,
|
|
3051
3048
|
{
|
|
3052
3049
|
type: "text",
|
|
3053
3050
|
danger: !0,
|
|
@@ -3071,10 +3068,10 @@ Example: 3FS+10d`);
|
|
|
3071
3068
|
color: "#fff",
|
|
3072
3069
|
fontSize: 12,
|
|
3073
3070
|
fontWeight: "bold"
|
|
3074
|
-
}, children:
|
|
3071
|
+
}, children: k ? a.indexOf(k) + 1 : "?" }),
|
|
3075
3072
|
title: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
3076
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children:
|
|
3077
|
-
/* @__PURE__ */ t.jsx(Wr, { color:
|
|
3073
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children: k?.text || "Unknown Task" }),
|
|
3074
|
+
/* @__PURE__ */ t.jsx(Wr, { color: X(R.type), style: { margin: 0 }, children: j(R.type) })
|
|
3078
3075
|
] }),
|
|
3079
3076
|
description: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color: d.font?.color, opacity: 0.7 }, children: [
|
|
3080
3077
|
/* @__PURE__ */ t.jsx(Ee, { icon: Tr, style: { marginRight: 6 } }),
|
|
@@ -3100,7 +3097,7 @@ Example: 3FS+10d`);
|
|
|
3100
3097
|
] })
|
|
3101
3098
|
}
|
|
3102
3099
|
);
|
|
3103
|
-
},
|
|
3100
|
+
}, Nn = ({
|
|
3104
3101
|
x: e,
|
|
3105
3102
|
y: a,
|
|
3106
3103
|
task: n,
|
|
@@ -3110,12 +3107,12 @@ Example: 3FS+10d`);
|
|
|
3110
3107
|
onDependencies: b,
|
|
3111
3108
|
onConvertToMilestone: u,
|
|
3112
3109
|
onConvertToTask: d,
|
|
3113
|
-
onConvertToProject:
|
|
3114
|
-
onAutoSchedule:
|
|
3115
|
-
onClose:
|
|
3116
|
-
styleConfig:
|
|
3110
|
+
onConvertToProject: h,
|
|
3111
|
+
onAutoSchedule: p,
|
|
3112
|
+
onClose: S,
|
|
3113
|
+
styleConfig: y
|
|
3117
3114
|
}) => {
|
|
3118
|
-
const m = jt(
|
|
3115
|
+
const m = jt(y);
|
|
3119
3116
|
if (!n) return null;
|
|
3120
3117
|
const E = [
|
|
3121
3118
|
{
|
|
@@ -3123,7 +3120,7 @@ Example: 3FS+10d`);
|
|
|
3123
3120
|
label: "Edit",
|
|
3124
3121
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: nn }),
|
|
3125
3122
|
onClick: () => {
|
|
3126
|
-
s(),
|
|
3123
|
+
s(), S();
|
|
3127
3124
|
}
|
|
3128
3125
|
},
|
|
3129
3126
|
{
|
|
@@ -3131,7 +3128,7 @@ Example: 3FS+10d`);
|
|
|
3131
3128
|
label: "Copy",
|
|
3132
3129
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: an }),
|
|
3133
3130
|
onClick: () => {
|
|
3134
|
-
c(),
|
|
3131
|
+
c(), S();
|
|
3135
3132
|
}
|
|
3136
3133
|
},
|
|
3137
3134
|
{
|
|
@@ -3139,7 +3136,7 @@ Example: 3FS+10d`);
|
|
|
3139
3136
|
label: "Dependencies",
|
|
3140
3137
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: Tr }),
|
|
3141
3138
|
onClick: () => {
|
|
3142
|
-
b(),
|
|
3139
|
+
b(), S();
|
|
3143
3140
|
}
|
|
3144
3141
|
},
|
|
3145
3142
|
{
|
|
@@ -3156,7 +3153,7 @@ Example: 3FS+10d`);
|
|
|
3156
3153
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: on }),
|
|
3157
3154
|
disabled: n.type === "milestone",
|
|
3158
3155
|
onClick: () => {
|
|
3159
|
-
u(),
|
|
3156
|
+
u(), S();
|
|
3160
3157
|
}
|
|
3161
3158
|
},
|
|
3162
3159
|
{
|
|
@@ -3165,7 +3162,7 @@ Example: 3FS+10d`);
|
|
|
3165
3162
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: sn }),
|
|
3166
3163
|
disabled: n.type === "task",
|
|
3167
3164
|
onClick: () => {
|
|
3168
|
-
d(),
|
|
3165
|
+
d(), S();
|
|
3169
3166
|
}
|
|
3170
3167
|
},
|
|
3171
3168
|
{
|
|
@@ -3174,7 +3171,7 @@ Example: 3FS+10d`);
|
|
|
3174
3171
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: ln }),
|
|
3175
3172
|
disabled: n.type === "project",
|
|
3176
3173
|
onClick: () => {
|
|
3177
|
-
|
|
3174
|
+
h(), S();
|
|
3178
3175
|
}
|
|
3179
3176
|
}
|
|
3180
3177
|
]
|
|
@@ -3184,7 +3181,7 @@ Example: 3FS+10d`);
|
|
|
3184
3181
|
label: "Auto Schedule",
|
|
3185
3182
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: jr }),
|
|
3186
3183
|
onClick: () => {
|
|
3187
|
-
|
|
3184
|
+
p?.(), S();
|
|
3188
3185
|
}
|
|
3189
3186
|
},
|
|
3190
3187
|
{
|
|
@@ -3196,7 +3193,7 @@ Example: 3FS+10d`);
|
|
|
3196
3193
|
icon: /* @__PURE__ */ t.jsx(Ee, { icon: Dr }),
|
|
3197
3194
|
danger: !0,
|
|
3198
3195
|
onClick: () => {
|
|
3199
|
-
r(),
|
|
3196
|
+
r(), S();
|
|
3200
3197
|
}
|
|
3201
3198
|
}
|
|
3202
3199
|
];
|
|
@@ -3228,51 +3225,51 @@ Example: 3FS+10d`);
|
|
|
3228
3225
|
}
|
|
3229
3226
|
);
|
|
3230
3227
|
}, kn = (e, a = []) => {
|
|
3231
|
-
const [n, s] =
|
|
3232
|
-
|
|
3228
|
+
const [n, s] = J([]), [r, c] = J(-1), [b, u] = J(e), [d, h] = J(a);
|
|
3229
|
+
ut(() => {
|
|
3233
3230
|
u(e);
|
|
3234
|
-
}, [e]),
|
|
3235
|
-
|
|
3231
|
+
}, [e]), ut(() => {
|
|
3232
|
+
h(a);
|
|
3236
3233
|
}, [a]);
|
|
3237
|
-
const
|
|
3234
|
+
const p = Je((v, w, C) => {
|
|
3238
3235
|
const Z = {
|
|
3239
|
-
type:
|
|
3236
|
+
type: v,
|
|
3240
3237
|
before: w,
|
|
3241
3238
|
after: C,
|
|
3242
3239
|
timestamp: Date.now()
|
|
3243
3240
|
}, W = n.slice(0, r + 1);
|
|
3244
3241
|
W.push(Z), W.length > 50 ? W.shift() : c(r + 1), s(W);
|
|
3245
|
-
}, [n, r]),
|
|
3242
|
+
}, [n, r]), S = Je(() => {
|
|
3246
3243
|
if (r < 0) return;
|
|
3247
|
-
const
|
|
3248
|
-
u(
|
|
3249
|
-
}, [n, r]),
|
|
3244
|
+
const v = n[r];
|
|
3245
|
+
u(v.before.tasks), h(v.before.links), c(r - 1);
|
|
3246
|
+
}, [n, r]), y = Je(() => {
|
|
3250
3247
|
if (r >= n.length - 1) return;
|
|
3251
|
-
const
|
|
3252
|
-
u(
|
|
3253
|
-
}, [n, r]), m = r >= 0, E = r < n.length - 1, F =
|
|
3254
|
-
const w = { tasks: b, links: d }, C = b.map((W) => W.id ===
|
|
3255
|
-
|
|
3256
|
-
}, [b, d,
|
|
3257
|
-
const w = { tasks: b, links: d }, C = [...b,
|
|
3258
|
-
|
|
3259
|
-
}, [b, d,
|
|
3260
|
-
const w = { tasks: b, links: d }, C = b.filter((re) => re.id !==
|
|
3261
|
-
|
|
3262
|
-
}, [b, d,
|
|
3248
|
+
const v = n[r + 1];
|
|
3249
|
+
u(v.after.tasks), h(v.after.links), c(r + 1);
|
|
3250
|
+
}, [n, r]), m = r >= 0, E = r < n.length - 1, F = Je((v) => {
|
|
3251
|
+
const w = { tasks: b, links: d }, C = b.map((W) => W.id === v.id ? v : W);
|
|
3252
|
+
p("task_update", w, { tasks: C, links: d }), u(C);
|
|
3253
|
+
}, [b, d, p]), N = Je((v) => {
|
|
3254
|
+
const w = { tasks: b, links: d }, C = [...b, v];
|
|
3255
|
+
p("task_create", w, { tasks: C, links: d }), u(C);
|
|
3256
|
+
}, [b, d, p]), M = Je((v) => {
|
|
3257
|
+
const w = { tasks: b, links: d }, C = b.filter((re) => re.id !== v), Z = d.filter((re) => re.source !== v && re.target !== v);
|
|
3258
|
+
p("task_delete", w, { tasks: C, links: Z }), u(C), h(Z);
|
|
3259
|
+
}, [b, d, p]);
|
|
3263
3260
|
return {
|
|
3264
3261
|
tasks: b,
|
|
3265
3262
|
links: d,
|
|
3266
3263
|
setTasks: u,
|
|
3267
|
-
setLinks:
|
|
3268
|
-
undo:
|
|
3269
|
-
redo:
|
|
3264
|
+
setLinks: h,
|
|
3265
|
+
undo: S,
|
|
3266
|
+
redo: y,
|
|
3270
3267
|
canUndo: m,
|
|
3271
3268
|
canRedo: E,
|
|
3272
3269
|
updateTask: F,
|
|
3273
3270
|
createTask: N,
|
|
3274
3271
|
deleteTask: M,
|
|
3275
|
-
saveState:
|
|
3272
|
+
saveState: p,
|
|
3276
3273
|
history: n
|
|
3277
3274
|
};
|
|
3278
3275
|
}, Rr = (e, a, n = { mode: "forward" }) => {
|
|
@@ -3281,50 +3278,50 @@ Example: 3FS+10d`);
|
|
|
3281
3278
|
s.set(c.id, []), r.set(c.id, []);
|
|
3282
3279
|
}), a.forEach((c) => {
|
|
3283
3280
|
c.type === "e2s" && (s.get(c.target)?.push(c.source), r.get(c.source)?.push(c.target));
|
|
3284
|
-
}), n.mode === "forward" ?
|
|
3285
|
-
},
|
|
3281
|
+
}), n.mode === "forward" ? On(e, s, n) : $n(e, r, n);
|
|
3282
|
+
}, On = (e, a, n) => {
|
|
3286
3283
|
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), c = n.projectStart || /* @__PURE__ */ new Date(), b = (u) => {
|
|
3287
3284
|
if (r.has(u)) return;
|
|
3288
3285
|
const d = e.find((E) => E.id === u);
|
|
3289
3286
|
if (!d) return;
|
|
3290
|
-
const
|
|
3291
|
-
|
|
3292
|
-
let
|
|
3293
|
-
|
|
3287
|
+
const h = a.get(u) || [];
|
|
3288
|
+
h.forEach((E) => b(E));
|
|
3289
|
+
let p = c;
|
|
3290
|
+
h.forEach((E) => {
|
|
3294
3291
|
const F = s.get(E);
|
|
3295
|
-
F && F.end >
|
|
3292
|
+
F && F.end > p && (p = new Date(F.end));
|
|
3296
3293
|
});
|
|
3297
|
-
const
|
|
3294
|
+
const S = new Date(p), y = Te(S, d.duration, "day"), m = {
|
|
3298
3295
|
...d,
|
|
3299
|
-
start:
|
|
3300
|
-
end:
|
|
3296
|
+
start: S,
|
|
3297
|
+
end: y
|
|
3301
3298
|
};
|
|
3302
3299
|
s.set(u, m), r.add(u);
|
|
3303
3300
|
};
|
|
3304
3301
|
return e.forEach((u) => b(u.id)), e.map((u) => s.get(u.id) || u);
|
|
3305
|
-
},
|
|
3302
|
+
}, $n = (e, a, n) => {
|
|
3306
3303
|
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), c = n.projectEnd || new Date(
|
|
3307
3304
|
Math.max(...e.map((u) => u.end.getTime()))
|
|
3308
3305
|
), b = (u) => {
|
|
3309
3306
|
if (r.has(u)) return;
|
|
3310
3307
|
const d = e.find((E) => E.id === u);
|
|
3311
3308
|
if (!d) return;
|
|
3312
|
-
const
|
|
3313
|
-
|
|
3314
|
-
let
|
|
3315
|
-
|
|
3309
|
+
const h = a.get(u) || [];
|
|
3310
|
+
h.forEach((E) => b(E));
|
|
3311
|
+
let p = c;
|
|
3312
|
+
h.forEach((E) => {
|
|
3316
3313
|
const F = s.get(E);
|
|
3317
|
-
F && F.start <
|
|
3314
|
+
F && F.start < p && (p = new Date(F.start));
|
|
3318
3315
|
});
|
|
3319
|
-
const
|
|
3316
|
+
const S = new Date(p), y = Te(S, -d.duration, "day"), m = {
|
|
3320
3317
|
...d,
|
|
3321
|
-
start:
|
|
3322
|
-
end:
|
|
3318
|
+
start: y,
|
|
3319
|
+
end: S
|
|
3323
3320
|
};
|
|
3324
3321
|
s.set(u, m), r.add(u);
|
|
3325
3322
|
};
|
|
3326
3323
|
return e.forEach((u) => b(u.id)), e.map((u) => s.get(u.id) || u);
|
|
3327
|
-
},
|
|
3324
|
+
}, Cn = (e) => {
|
|
3328
3325
|
const a = /* @__PURE__ */ new Map();
|
|
3329
3326
|
e.forEach((s) => {
|
|
3330
3327
|
s.owner && (a.has(s.owner) || a.set(s.owner, []), a.get(s.owner).push(s));
|
|
@@ -3335,23 +3332,23 @@ Example: 3FS+10d`);
|
|
|
3335
3332
|
for (let c = 1; c < r.length; c++) {
|
|
3336
3333
|
const b = r[c], u = r[c - 1];
|
|
3337
3334
|
if (b.start < u.end) {
|
|
3338
|
-
const d = n.findIndex((
|
|
3335
|
+
const d = n.findIndex((h) => h.id === b.id);
|
|
3339
3336
|
if (d >= 0) {
|
|
3340
|
-
const
|
|
3337
|
+
const h = new Date(u.end), p = Te(h, b.duration, "day");
|
|
3341
3338
|
n[d] = {
|
|
3342
3339
|
...b,
|
|
3343
|
-
start:
|
|
3344
|
-
end:
|
|
3340
|
+
start: h,
|
|
3341
|
+
end: p
|
|
3345
3342
|
};
|
|
3346
3343
|
}
|
|
3347
3344
|
}
|
|
3348
3345
|
}
|
|
3349
3346
|
}), n;
|
|
3350
|
-
},
|
|
3347
|
+
}, ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3351
3348
|
__proto__: null,
|
|
3352
3349
|
autoSchedule: Rr,
|
|
3353
|
-
levelResources:
|
|
3354
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3350
|
+
levelResources: Cn
|
|
3351
|
+
}, Symbol.toStringTag, { value: "Module" })), Yn = (e) => {
|
|
3355
3352
|
const a = /* @__PURE__ */ new Map();
|
|
3356
3353
|
return e.forEach((n) => {
|
|
3357
3354
|
a.set(n.id, {
|
|
@@ -3396,7 +3393,7 @@ Example: 3FS+10d`);
|
|
|
3396
3393
|
].join(`
|
|
3397
3394
|
`);
|
|
3398
3395
|
It(s, "gantt-tasks.xls", "application/vnd.ms-excel");
|
|
3399
|
-
},
|
|
3396
|
+
}, kr = (e, a) => {
|
|
3400
3397
|
const n = {
|
|
3401
3398
|
tasks: e,
|
|
3402
3399
|
links: a,
|
|
@@ -3404,7 +3401,7 @@ Example: 3FS+10d`);
|
|
|
3404
3401
|
version: "1.0"
|
|
3405
3402
|
}, s = JSON.stringify(n, null, 2);
|
|
3406
3403
|
It(s, "gantt-project.json", "application/json");
|
|
3407
|
-
},
|
|
3404
|
+
}, Or = (e) => {
|
|
3408
3405
|
const a = `
|
|
3409
3406
|
GANTT CHART PROJECT
|
|
3410
3407
|
Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
@@ -3421,7 +3418,7 @@ ${s + 1}. ${n.text}
|
|
|
3421
3418
|
`)}
|
|
3422
3419
|
`.trim();
|
|
3423
3420
|
It(a, "gantt-report.txt", "text/plain"), alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.");
|
|
3424
|
-
},
|
|
3421
|
+
}, _n = (e, a, n = "png") => {
|
|
3425
3422
|
if (!document.getElementById(e)) {
|
|
3426
3423
|
alert("Could not find Gantt chart element to export");
|
|
3427
3424
|
return;
|
|
@@ -3433,11 +3430,11 @@ ${s + 1}. ${n.text}
|
|
|
3433
3430
|
alert("Image export requires html2canvas library. Install with: npm install html2canvas");
|
|
3434
3431
|
}, It = (e, a, n) => {
|
|
3435
3432
|
const s = new Blob([e], { type: n }), r = URL.createObjectURL(s);
|
|
3436
|
-
|
|
3437
|
-
},
|
|
3433
|
+
An(r, a), URL.revokeObjectURL(r);
|
|
3434
|
+
}, An = (e, a) => {
|
|
3438
3435
|
const n = document.createElement("a");
|
|
3439
3436
|
n.href = e, n.download = a, document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
3440
|
-
},
|
|
3437
|
+
}, In = (e) => new Promise((a, n) => {
|
|
3441
3438
|
const s = new FileReader();
|
|
3442
3439
|
s.onload = (r) => {
|
|
3443
3440
|
try {
|
|
@@ -3451,15 +3448,15 @@ ${s + 1}. ${n.text}
|
|
|
3451
3448
|
n(new Error("Invalid JSON file"));
|
|
3452
3449
|
}
|
|
3453
3450
|
}, s.onerror = () => n(new Error("Failed to read file")), s.readAsText(e);
|
|
3454
|
-
}),
|
|
3451
|
+
}), ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3455
3452
|
__proto__: null,
|
|
3456
3453
|
exportToCSV: Pr,
|
|
3457
3454
|
exportToExcel: Nr,
|
|
3458
|
-
exportToImage:
|
|
3459
|
-
exportToJSON:
|
|
3460
|
-
exportToPDF:
|
|
3461
|
-
importFromJSON:
|
|
3462
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3455
|
+
exportToImage: _n,
|
|
3456
|
+
exportToJSON: kr,
|
|
3457
|
+
exportToPDF: Or,
|
|
3458
|
+
importFromJSON: In
|
|
3459
|
+
}, Symbol.toStringTag, { value: "Module" })), zn = (e, a) => e.filter((n) => {
|
|
3463
3460
|
if (a.searchText) {
|
|
3464
3461
|
const s = a.searchText.toLowerCase(), r = n.text.toLowerCase().includes(s), c = n.owner?.toLowerCase().includes(s), b = n.details?.toLowerCase().includes(s);
|
|
3465
3462
|
if (!r && !c && !b)
|
|
@@ -3473,7 +3470,7 @@ ${s + 1}. ${n.text}
|
|
|
3473
3470
|
return !1;
|
|
3474
3471
|
}
|
|
3475
3472
|
return !0;
|
|
3476
|
-
}), $r = 1440 * 60 * 1e3,
|
|
3473
|
+
}), $r = 1440 * 60 * 1e3, Ve = (e, a) => {
|
|
3477
3474
|
if (e instanceof Date) {
|
|
3478
3475
|
const n = new Date(e.getTime());
|
|
3479
3476
|
return Number.isNaN(n.getTime()) ? new Date(a.getTime()) : n;
|
|
@@ -3495,7 +3492,7 @@ ${s + 1}. ${n.text}
|
|
|
3495
3492
|
return n;
|
|
3496
3493
|
}
|
|
3497
3494
|
return [];
|
|
3498
|
-
},
|
|
3495
|
+
}, Bn = (e) => {
|
|
3499
3496
|
if (Array.isArray(e)) {
|
|
3500
3497
|
const a = e.map((n) => String(n).trim()).filter(Boolean);
|
|
3501
3498
|
return a.length > 0 ? a : void 0;
|
|
@@ -3504,7 +3501,7 @@ ${s + 1}. ${n.text}
|
|
|
3504
3501
|
const a = e.split(/[|,]/).map((n) => n.trim()).filter(Boolean);
|
|
3505
3502
|
return a.length > 0 ? a : void 0;
|
|
3506
3503
|
}
|
|
3507
|
-
},
|
|
3504
|
+
}, Hn = (e) => {
|
|
3508
3505
|
if (Array.isArray(e)) {
|
|
3509
3506
|
const a = e.map((n) => String(n).trim()).filter(Boolean);
|
|
3510
3507
|
return a.length > 0 ? a : void 0;
|
|
@@ -3513,37 +3510,37 @@ ${s + 1}. ${n.text}
|
|
|
3513
3510
|
const a = e.split(/\r?\n|\|/).map((n) => n.trim()).filter(Boolean);
|
|
3514
3511
|
return a.length > 0 ? a : void 0;
|
|
3515
3512
|
}
|
|
3516
|
-
},
|
|
3513
|
+
}, Wn = (e, a, n) => {
|
|
3517
3514
|
const s = Cr(e);
|
|
3518
3515
|
if (s.length === 0) return;
|
|
3519
3516
|
const r = a.getTime(), c = n.getTime();
|
|
3520
3517
|
return s.map((b) => {
|
|
3521
|
-
const u =
|
|
3518
|
+
const u = Ve(b?.start, a), d = Ve(b?.end, n), h = Math.max(u.getTime(), r), p = Math.min(d.getTime(), c);
|
|
3522
3519
|
return {
|
|
3523
|
-
start: new Date(
|
|
3524
|
-
end: new Date(
|
|
3520
|
+
start: new Date(h),
|
|
3521
|
+
end: new Date(p)
|
|
3525
3522
|
};
|
|
3526
3523
|
}).filter((b) => b.end.getTime() > b.start.getTime());
|
|
3527
|
-
},
|
|
3524
|
+
}, Vn = (e, a, n) => {
|
|
3528
3525
|
if (Array.isArray(e))
|
|
3529
3526
|
return e.map((s) => {
|
|
3530
|
-
const r =
|
|
3527
|
+
const r = Ve(s?.start, a), c = Ve(s?.end, n), b = c.getTime() < r.getTime() ? r : c, u = Math.max(Math.ceil((b.getTime() - r.getTime()) / $r), 0);
|
|
3531
3528
|
return {
|
|
3532
3529
|
start: r,
|
|
3533
3530
|
end: b,
|
|
3534
3531
|
duration: nr(s?.duration, u)
|
|
3535
3532
|
};
|
|
3536
3533
|
}).filter((s) => s.end.getTime() >= s.start.getTime());
|
|
3537
|
-
},
|
|
3538
|
-
const a = /* @__PURE__ */ new Date(), n =
|
|
3534
|
+
}, Xn = (e) => {
|
|
3535
|
+
const a = /* @__PURE__ */ new Date(), n = Ve(
|
|
3539
3536
|
e.start ?? e.startDate ?? e.start_date ?? e.plannedStartDate,
|
|
3540
3537
|
a
|
|
3541
|
-
), s =
|
|
3538
|
+
), s = Ve(
|
|
3542
3539
|
e.end ?? e.endDate ?? e.end_date ?? e.plannedEndDate,
|
|
3543
3540
|
n
|
|
3544
|
-
), r = s.getTime() < n.getTime() ? n : s, c =
|
|
3541
|
+
), r = s.getTime() < n.getTime() ? n : s, c = Ve(e.plannedStart ?? e.planned_start ?? e.planned_start_date, n), b = Ve(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), u = b.getTime() < c.getTime() ? c : b, d = Ve(e.actualStart ?? e.actual_start ?? e.actual_start_date, n), h = Ve(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), p = h.getTime() < d.getTime() ? d : h, S = Math.max(Math.ceil((r.getTime() - n.getTime()) / $r), 0), y = Bn(e.dependencies ?? e.dependsOn ?? e.depends_on), m = Hn(
|
|
3545
3542
|
e.dependencyRule ?? e.dependency_rule ?? e.dependencyRuleDescription ?? e.dependency_rule_description
|
|
3546
|
-
), E =
|
|
3543
|
+
), E = Wn(
|
|
3547
3544
|
Yr(
|
|
3548
3545
|
e.onHoldPeriods,
|
|
3549
3546
|
e.on_hold_periods,
|
|
@@ -3565,8 +3562,8 @@ ${s + 1}. ${n.text}
|
|
|
3565
3562
|
plannedStart: c,
|
|
3566
3563
|
plannedEnd: u,
|
|
3567
3564
|
actualStart: d,
|
|
3568
|
-
actualEnd:
|
|
3569
|
-
duration: nr(e.duration,
|
|
3565
|
+
actualEnd: p,
|
|
3566
|
+
duration: nr(e.duration, S),
|
|
3570
3567
|
progress: Math.max(0, Math.min(100, nr(e.progress ?? e.progressPercentage ?? e.progress_percentage, 0))),
|
|
3571
3568
|
type: e.type,
|
|
3572
3569
|
parent: e.parent !== void 0 && e.parent !== null && String(e.parent).length > 0 ? String(e.parent) : void 0,
|
|
@@ -3577,14 +3574,14 @@ ${s + 1}. ${n.text}
|
|
|
3577
3574
|
priority: e.priority,
|
|
3578
3575
|
status: e.status ?? e.currentStatus ?? e.current_status,
|
|
3579
3576
|
onHoldPeriods: E,
|
|
3580
|
-
dependencies:
|
|
3577
|
+
dependencies: y,
|
|
3581
3578
|
dependencyRule: m,
|
|
3582
|
-
segments:
|
|
3579
|
+
segments: Vn(e.segments, n, r),
|
|
3583
3580
|
sequence_id: e.sequence_id,
|
|
3584
3581
|
stage_id: e.stage_id,
|
|
3585
3582
|
tooltipConfig: e.tooltipConfig
|
|
3586
3583
|
};
|
|
3587
|
-
},
|
|
3584
|
+
}, Un = (e) => Array.isArray(e) ? e.map(Xn) : [], gr = (e) => {
|
|
3588
3585
|
if (e.length === 0) return [];
|
|
3589
3586
|
const a = [...e].filter((s) => s.end.getTime() > s.start.getTime()).sort((s, r) => s.start.getTime() - r.start.getTime());
|
|
3590
3587
|
if (a.length === 0) return [];
|
|
@@ -3594,14 +3591,14 @@ ${s + 1}. ${n.text}
|
|
|
3594
3591
|
r.start.getTime() <= c.end.getTime() ? c.end = new Date(Math.max(c.end.getTime(), r.end.getTime())) : n.push({ ...r });
|
|
3595
3592
|
}
|
|
3596
3593
|
return n;
|
|
3597
|
-
},
|
|
3594
|
+
}, qn = (e, a, n) => n.filter((s) => a > s.start.getTime() && e < s.end.getTime()).map((s) => ({
|
|
3598
3595
|
start: new Date(s.start.getTime()),
|
|
3599
3596
|
end: new Date(s.end.getTime())
|
|
3600
|
-
})),
|
|
3597
|
+
})), Gn = (e, a) => {
|
|
3601
3598
|
if (a.length === 0) return e;
|
|
3602
3599
|
const n = gr(a);
|
|
3603
3600
|
return e.map((s) => {
|
|
3604
|
-
const r = s.start.getTime(), c = s.end.getTime(), b =
|
|
3601
|
+
const r = s.start.getTime(), c = s.end.getTime(), b = qn(r, c, n);
|
|
3605
3602
|
if (b.length === 0)
|
|
3606
3603
|
return s;
|
|
3607
3604
|
const u = s.onHoldPeriods || [], d = gr([...u, ...b]);
|
|
@@ -3610,13 +3607,13 @@ ${s + 1}. ${n.text}
|
|
|
3610
3607
|
onHoldPeriods: d
|
|
3611
3608
|
};
|
|
3612
3609
|
});
|
|
3613
|
-
},
|
|
3610
|
+
}, Jn = (e) => [
|
|
3614
3611
|
{ name: "index", label: "", width: 40, align: "center" },
|
|
3615
3612
|
{ name: "text", label: e?.columnLabels?.name || "Name", width: 250, align: "left", resize: !0 },
|
|
3616
3613
|
{ name: "predecessors", label: e?.columnLabels?.dependsOn || "Depends on", width: 120, align: "left" },
|
|
3617
3614
|
{ name: "duration", label: e?.columnLabels?.duration || "Duration", width: 110, align: "left" },
|
|
3618
3615
|
{ name: "start", label: e?.columnLabels?.start || "Start", width: 130, align: "left" }
|
|
3619
|
-
],
|
|
3616
|
+
], Kn = [
|
|
3620
3617
|
{ unit: "month", step: 1, format: "MMM" },
|
|
3621
3618
|
{ unit: "day", step: 1, format: "D" }
|
|
3622
3619
|
], yr = {
|
|
@@ -3650,7 +3647,7 @@ ${s + 1}. ${n.text}
|
|
|
3650
3647
|
default:
|
|
3651
3648
|
return s;
|
|
3652
3649
|
}
|
|
3653
|
-
},
|
|
3650
|
+
}, Zn = {
|
|
3654
3651
|
showTaskName: !0,
|
|
3655
3652
|
showPlannedDates: !0,
|
|
3656
3653
|
showActualDates: !0,
|
|
@@ -3669,7 +3666,7 @@ ${s + 1}. ${n.text}
|
|
|
3669
3666
|
emptyStatusText: "Not set",
|
|
3670
3667
|
emptyOwnerText: "Not assigned",
|
|
3671
3668
|
emptyDependencyRuleText: "No dependency rule"
|
|
3672
|
-
},
|
|
3669
|
+
}, Qn = {
|
|
3673
3670
|
headerTitle: "Iris Gantt",
|
|
3674
3671
|
showHeader: !0,
|
|
3675
3672
|
showAddTaskButton: !0,
|
|
@@ -3753,7 +3750,7 @@ ${s + 1}. ${n.text}
|
|
|
3753
3750
|
start: "Start"
|
|
3754
3751
|
},
|
|
3755
3752
|
taskNameRequired: "Please enter task name"
|
|
3756
|
-
},
|
|
3753
|
+
}, pa = ({
|
|
3757
3754
|
tasks: e = [],
|
|
3758
3755
|
links: a = [],
|
|
3759
3756
|
config: n = {},
|
|
@@ -3763,89 +3760,89 @@ ${s + 1}. ${n.text}
|
|
|
3763
3760
|
taskTooltipConfig: b = {},
|
|
3764
3761
|
onHoldPeriods: u,
|
|
3765
3762
|
on_hold_periods: d,
|
|
3766
|
-
onHold:
|
|
3767
|
-
on_hold:
|
|
3768
|
-
onhold:
|
|
3769
|
-
onTaskUpdate:
|
|
3763
|
+
onHold: h,
|
|
3764
|
+
on_hold: p,
|
|
3765
|
+
onhold: S,
|
|
3766
|
+
onTaskUpdate: y,
|
|
3770
3767
|
onTaskDragUpdate: m,
|
|
3771
3768
|
onTaskCreate: E,
|
|
3772
3769
|
onTaskDelete: F,
|
|
3773
3770
|
onLinkCreate: N,
|
|
3774
3771
|
onLinkDelete: M,
|
|
3775
|
-
onTimelineViewChange:
|
|
3772
|
+
onTimelineViewChange: v,
|
|
3776
3773
|
baselines: w,
|
|
3777
3774
|
showMonthHeading: C,
|
|
3778
3775
|
showRangeHeading: Z,
|
|
3779
3776
|
relativeDayNumbering: W
|
|
3780
3777
|
}) => {
|
|
3781
|
-
const re = { ...
|
|
3778
|
+
const re = { ...Qn, ...s }, le = { ...Zn, ...b }, j = !!(n.timelineView || Array.isArray(n.timelineViews) && n.timelineViews.length > 0 || n.timelineViewScales), X = A.useMemo(() => {
|
|
3782
3779
|
if (!j) return [];
|
|
3783
3780
|
const l = Array.isArray(n.timelineViews) && n.timelineViews.length > 0 ? n.timelineViews : xr;
|
|
3784
|
-
return Array.from(new Set(l.filter((
|
|
3781
|
+
return Array.from(new Set(l.filter((T) => xr.includes(T))));
|
|
3785
3782
|
}, [n.timelineViews, j]), R = A.useMemo(
|
|
3786
3783
|
() => ({
|
|
3787
3784
|
...yr,
|
|
3788
3785
|
...n.timelineViewScales
|
|
3789
3786
|
}),
|
|
3790
3787
|
[n.timelineViewScales]
|
|
3791
|
-
),
|
|
3788
|
+
), k = A.useMemo(() => j && n.timelineView && X.includes(n.timelineView) ? n.timelineView : j && X.length > 0 ? X[0] : "day", [n.timelineView, j, X]), [B, Y] = J(k), O = j && X.includes(B) ? B : k, De = j ? R[O] || yr[O] : n.scales || Kn, Se = j && re.showTimelineViewSwitcher !== !1 && X.length > 1, V = Se ? X.map((l) => ({
|
|
3792
3789
|
value: l,
|
|
3793
3790
|
label: re.timelineViewLabels?.[l] || `${l.charAt(0).toUpperCase()}${l.slice(1)}s`
|
|
3794
3791
|
})) : [], I = A.useMemo(() => {
|
|
3795
3792
|
if (n.showTimelineHeader === !1) return 0;
|
|
3796
3793
|
let l = j ? Math.max(De.length - 1, 0) : 2;
|
|
3797
3794
|
if ((C === !1 || n.showMonthHeading === !1) && (l = Math.max(0, l - 1)), Z === !1 || n.showRangeHeading === !1) {
|
|
3798
|
-
const
|
|
3799
|
-
l = Math.max(0, l -
|
|
3795
|
+
const T = j ? Math.max(0, De.length - 2) : 1;
|
|
3796
|
+
l = Math.max(0, l - T);
|
|
3800
3797
|
}
|
|
3801
3798
|
return l + 1;
|
|
3802
3799
|
}, [n.showTimelineHeader, n.showMonthHeading, C, n.showRangeHeading, Z, j, De.length]), ne = A.useMemo(() => {
|
|
3803
3800
|
const l = {};
|
|
3804
|
-
return r.primary && (l["--wx-gantt-primary"] = r.primary), r.primarySelected && (l["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (l["--wx-gantt-success"] = r.success), r.warning && (l["--wx-gantt-warning"] = r.warning), r.danger && (l["--wx-gantt-danger"] = r.danger), r.background && (l["--wx-gantt-background"] = r.background), r.backgroundAlt && (l["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (l["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (l["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (l["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (l["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (l["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (l["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (l["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (l["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (l["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (l["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (l["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (l["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (l["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (l["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (l["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (l["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (l["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (l["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (l["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([
|
|
3805
|
-
l[
|
|
3801
|
+
return r.primary && (l["--wx-gantt-primary"] = r.primary), r.primarySelected && (l["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (l["--wx-gantt-success"] = r.success), r.warning && (l["--wx-gantt-warning"] = r.warning), r.danger && (l["--wx-gantt-danger"] = r.danger), r.background && (l["--wx-gantt-background"] = r.background), r.backgroundAlt && (l["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (l["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (l["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (l["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (l["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (l["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (l["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (l["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (l["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (l["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (l["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (l["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (l["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (l["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (l["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (l["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (l["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (l["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (l["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (l["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([T, P]) => {
|
|
3802
|
+
l[T.startsWith("--") ? T : `--${T}`] = P;
|
|
3806
3803
|
}), l["--gantt-header-rows"] = String(I), l;
|
|
3807
3804
|
}, [r, I]), de = A.useMemo(() => {
|
|
3808
3805
|
const l = Yr(
|
|
3809
3806
|
u,
|
|
3810
3807
|
d,
|
|
3811
|
-
p,
|
|
3812
3808
|
h,
|
|
3813
|
-
|
|
3809
|
+
p,
|
|
3810
|
+
S
|
|
3814
3811
|
);
|
|
3815
3812
|
if (l.length === 0) return [];
|
|
3816
|
-
const
|
|
3813
|
+
const T = /* @__PURE__ */ new Date();
|
|
3817
3814
|
return l.map((P) => ({
|
|
3818
|
-
start:
|
|
3819
|
-
end:
|
|
3815
|
+
start: Ve(P.start, T),
|
|
3816
|
+
end: Ve(P.end, T)
|
|
3820
3817
|
})).filter((P) => P.end.getTime() > P.start.getTime());
|
|
3821
|
-
}, [u, d,
|
|
3822
|
-
const l =
|
|
3823
|
-
return
|
|
3818
|
+
}, [u, d, h, p, S]), se = A.useMemo(() => {
|
|
3819
|
+
const l = Un(e);
|
|
3820
|
+
return Gn(l, de);
|
|
3824
3821
|
}, [e, de]), ue = Array.isArray(a) ? a : [], {
|
|
3825
3822
|
tasks: z,
|
|
3826
|
-
links:
|
|
3823
|
+
links: ye,
|
|
3827
3824
|
setTasks: Le,
|
|
3828
3825
|
setLinks: Ie,
|
|
3829
3826
|
undo: Ye,
|
|
3830
3827
|
redo: $,
|
|
3831
|
-
updateTask:
|
|
3832
|
-
createTask:
|
|
3833
|
-
deleteTask:
|
|
3828
|
+
updateTask: q,
|
|
3829
|
+
createTask: xe,
|
|
3830
|
+
deleteTask: Qe,
|
|
3834
3831
|
saveState: ce
|
|
3835
|
-
} = kn(se, ue), [me, Fe] =
|
|
3836
|
-
|
|
3837
|
-
w && w.size > 0 &&
|
|
3838
|
-
}, [w]),
|
|
3839
|
-
j && Y(
|
|
3840
|
-
}, [j,
|
|
3841
|
-
const [wt] =
|
|
3832
|
+
} = kn(se, ue), [me, Fe] = J(z), [pe, et] = J(null), [_e, Xe] = J(null), [Ue, ot] = J(!1), [i, g] = J(void 0), [D, f] = J(void 0), [U, G] = J(!1), [ee, ie] = J(null), [$e, ze] = J(null), [ge, tt] = J(null), [Ke, st] = J(null), [Ce, ht] = J(null), [xt, kt] = J(1), [qe, it] = J(() => w && w.size > 0 ? w : se.length > 0 ? Yn(se) : /* @__PURE__ */ new Map());
|
|
3833
|
+
ut(() => {
|
|
3834
|
+
w && w.size > 0 && it(w);
|
|
3835
|
+
}, [w]), ut(() => {
|
|
3836
|
+
j && Y(k);
|
|
3837
|
+
}, [j, k]);
|
|
3838
|
+
const [wt] = J(n.theme || "light"), [Tt, zt] = J({
|
|
3842
3839
|
searchText: "",
|
|
3843
3840
|
status: "all",
|
|
3844
3841
|
priority: "all",
|
|
3845
3842
|
owner: ""
|
|
3846
|
-
}), Dt = ft(null), Mt = ft(null),
|
|
3843
|
+
}), Dt = ft(null), Mt = ft(null), Ot = ft(null), Et = ft(null), lt = ft(null), $t = ft(null), Ae = {
|
|
3847
3844
|
...{
|
|
3848
|
-
columns: n.columns ||
|
|
3845
|
+
columns: n.columns || Jn(s),
|
|
3849
3846
|
readonly: !1,
|
|
3850
3847
|
editable: !0,
|
|
3851
3848
|
taskHeight: 28,
|
|
@@ -3905,8 +3902,8 @@ ${s + 1}. ${n.text}
|
|
|
3905
3902
|
},
|
|
3906
3903
|
...n,
|
|
3907
3904
|
scales: De,
|
|
3908
|
-
timelineView: j ?
|
|
3909
|
-
timelineViews: j ?
|
|
3905
|
+
timelineView: j ? O : n.timelineView,
|
|
3906
|
+
timelineViews: j ? X : n.timelineViews,
|
|
3910
3907
|
timelineViewScales: j ? R : n.timelineViewScales,
|
|
3911
3908
|
// IMPORTANT: Re-apply baselines after spread so undefined from config doesn't override the default.
|
|
3912
3909
|
// baselines should always be true unless the user explicitly passes false.
|
|
@@ -3915,8 +3912,8 @@ ${s + 1}. ${n.text}
|
|
|
3915
3912
|
showRangeHeading: Z !== void 0 ? Z : n.showRangeHeading,
|
|
3916
3913
|
relativeDayNumbering: W !== void 0 ? W : n.relativeDayNumbering
|
|
3917
3914
|
};
|
|
3918
|
-
|
|
3919
|
-
const l =
|
|
3915
|
+
ut(() => {
|
|
3916
|
+
const l = zn(z, Tt);
|
|
3920
3917
|
Fe(((P) => {
|
|
3921
3918
|
const H = [], ae = (fe) => {
|
|
3922
3919
|
if (!fe) return !1;
|
|
@@ -3936,74 +3933,74 @@ ${s + 1}. ${n.text}
|
|
|
3936
3933
|
return console.warn("Error extracting owners:", l), [];
|
|
3937
3934
|
}
|
|
3938
3935
|
}, [z]), Wt = (() => {
|
|
3939
|
-
const l = De[De.length - 1] || De[0],
|
|
3940
|
-
if (
|
|
3936
|
+
const l = De[De.length - 1] || De[0], T = me.length > 0 ? me : z;
|
|
3937
|
+
if (T.length === 0) {
|
|
3941
3938
|
const ve = /* @__PURE__ */ new Date();
|
|
3942
3939
|
return {
|
|
3943
3940
|
start: _t(Te(ve, -30, "day"), l, "start"),
|
|
3944
3941
|
end: _t(Te(ve, 60, "day"), l, "end")
|
|
3945
3942
|
};
|
|
3946
3943
|
}
|
|
3947
|
-
const P =
|
|
3944
|
+
const P = T.map((ve) => ve.start.getTime()), H = T.map((ve) => ve.end.getTime()), ae = new Date(Math.min(...P)), fe = new Date(Math.max(...H));
|
|
3948
3945
|
return {
|
|
3949
3946
|
start: _t(Te(ae, -7, "day"), l, "start"),
|
|
3950
3947
|
end: _t(fe, l, "end")
|
|
3951
3948
|
};
|
|
3952
3949
|
})(), Vt = (l) => {
|
|
3953
|
-
!
|
|
3950
|
+
!X.includes(l) || l === O || (Y(l), v?.(l));
|
|
3954
3951
|
}, o = (l) => {
|
|
3955
|
-
|
|
3956
|
-
}, x = (l,
|
|
3952
|
+
et(l);
|
|
3953
|
+
}, x = (l, T) => {
|
|
3957
3954
|
if (Ae.readonly) return;
|
|
3958
3955
|
l.preventDefault();
|
|
3959
|
-
const P = z.find((H) => H.id ===
|
|
3956
|
+
const P = z.find((H) => H.id === T);
|
|
3960
3957
|
P && ht({ x: l.clientX, y: l.clientY, task: P });
|
|
3961
3958
|
}, L = () => {
|
|
3962
|
-
if (!
|
|
3963
|
-
const l =
|
|
3959
|
+
if (!Ce?.task) return;
|
|
3960
|
+
const l = Ce.task, T = {
|
|
3964
3961
|
...l,
|
|
3965
3962
|
id: `task-${Date.now()}`,
|
|
3966
3963
|
text: `${l.text} (Copy)`,
|
|
3967
3964
|
start: Te(l.start, 7, "day"),
|
|
3968
3965
|
end: Te(l.end, 7, "day")
|
|
3969
3966
|
};
|
|
3970
|
-
|
|
3967
|
+
xe(T), E && E(T);
|
|
3971
3968
|
}, _ = (l) => {
|
|
3972
|
-
if (!
|
|
3973
|
-
const
|
|
3974
|
-
|
|
3975
|
-
}, te = A.useCallback((l,
|
|
3969
|
+
if (!Ce?.task) return;
|
|
3970
|
+
const T = { ...Ce.task, type: l };
|
|
3971
|
+
q(T), y && y(T);
|
|
3972
|
+
}, te = A.useCallback((l, T) => {
|
|
3976
3973
|
let P = [];
|
|
3977
|
-
return
|
|
3978
|
-
P.push(ae.id), P = [...P, ...te(ae.id,
|
|
3974
|
+
return T.filter((ae) => ae.parent === l).forEach((ae) => {
|
|
3975
|
+
P.push(ae.id), P = [...P, ...te(ae.id, T)];
|
|
3979
3976
|
}), P;
|
|
3980
|
-
}, []), oe = (l,
|
|
3977
|
+
}, []), oe = (l, T) => (l ?? null) === (T ?? null), Q = (l, T, P, H) => {
|
|
3981
3978
|
if (!Ae.readonly)
|
|
3982
3979
|
if (H === "reorder") {
|
|
3983
3980
|
const ae = me.findIndex((ve) => ve.id === l), fe = te(l, z);
|
|
3984
|
-
|
|
3981
|
+
tt({ id: l, initialIndex: ae, currentX: T, currentY: P, descendantIds: fe }), document.body.classList.add("gantt-dragging");
|
|
3985
3982
|
} else
|
|
3986
|
-
|
|
3983
|
+
ze(l);
|
|
3987
3984
|
}, K = () => {
|
|
3988
|
-
if (
|
|
3989
|
-
const l = z.find((P) => P.id ===
|
|
3990
|
-
if (l &&
|
|
3991
|
-
const P = [l.id, ...
|
|
3992
|
-
if (!P.includes(
|
|
3993
|
-
const H = [...z], ae = (
|
|
3985
|
+
if (ge && Ke) {
|
|
3986
|
+
const l = z.find((P) => P.id === ge.id), T = z.find((P) => P.id === Ke.taskId);
|
|
3987
|
+
if (l && T && l.id !== T.id) {
|
|
3988
|
+
const P = [l.id, ...ge.descendantIds];
|
|
3989
|
+
if (!P.includes(T.id)) {
|
|
3990
|
+
const H = [...z], ae = (Ke.position === "inside" ? T.id : T.parent) ?? void 0, fe = H.findIndex((he) => he.id === l.id);
|
|
3994
3991
|
fe !== -1 && (H[fe] = { ...H[fe], parent: ae });
|
|
3995
3992
|
const ve = H.filter((he) => P.includes(he.id)), Me = H.filter((he) => !P.includes(he.id));
|
|
3996
|
-
let He = Me.findIndex((he) => he.id ===
|
|
3997
|
-
if (
|
|
3998
|
-
const he = [
|
|
3993
|
+
let He = Me.findIndex((he) => he.id === T.id);
|
|
3994
|
+
if (Ke.position === "inside") {
|
|
3995
|
+
const he = [T.id, ...te(T.id, Me)], Gt = he[he.length - 1];
|
|
3999
3996
|
He = Me.findIndex((Ar) => Ar.id === Gt) + 1;
|
|
4000
|
-
} else if (
|
|
4001
|
-
const he = te(
|
|
3997
|
+
} else if (Ke.position === "below") {
|
|
3998
|
+
const he = te(T.id, Me);
|
|
4002
3999
|
he.length > 0 ? He = Me.findIndex((Gt) => Gt.id === he[he.length - 1]) + 1 : He++;
|
|
4003
4000
|
}
|
|
4004
4001
|
He < 0 && (He = Me.length);
|
|
4005
|
-
const Lt = { tasks: [...z], links: [...
|
|
4006
|
-
Me.splice(He, 0, ...ve), Le(Me), ce("task_update", Lt, { tasks: Me, links:
|
|
4002
|
+
const Lt = { tasks: [...z], links: [...ye] };
|
|
4003
|
+
Me.splice(He, 0, ...ve), Le(Me), ce("task_update", Lt, { tasks: Me, links: ye });
|
|
4007
4004
|
const mt = z.filter((he) => oe(he.parent, l.parent)).findIndex((he) => he.id === l.id) + 1, sr = Me.filter((he) => oe(he.parent, ae)).findIndex((he) => he.id === l.id) + 1, ir = {
|
|
4008
4005
|
currentSequenceId: mt,
|
|
4009
4006
|
targetSequenceId: sr,
|
|
@@ -4015,7 +4012,7 @@ ${s + 1}. ${n.text}
|
|
|
4015
4012
|
sequence_id: sr,
|
|
4016
4013
|
stage_id: ae ?? null
|
|
4017
4014
|
};
|
|
4018
|
-
|
|
4015
|
+
y && y(he, ir), m && m({
|
|
4019
4016
|
task: he,
|
|
4020
4017
|
previousTask: l,
|
|
4021
4018
|
dragType: "reorder",
|
|
@@ -4025,14 +4022,14 @@ ${s + 1}. ${n.text}
|
|
|
4025
4022
|
}
|
|
4026
4023
|
}
|
|
4027
4024
|
}
|
|
4028
|
-
|
|
4029
|
-
}, Re = ft(null),
|
|
4030
|
-
if (
|
|
4031
|
-
const { clientX:
|
|
4025
|
+
ze(null), tt(null), st(null), document.body.classList.remove("gantt-dragging");
|
|
4026
|
+
}, Re = ft(null), we = A.useCallback((l) => {
|
|
4027
|
+
if (ge) {
|
|
4028
|
+
const { clientX: T, clientY: P } = l;
|
|
4032
4029
|
Re.current && cancelAnimationFrame(Re.current), Re.current = requestAnimationFrame(() => {
|
|
4033
4030
|
const H = Ae.rowHeight || 48, ae = Mt.current?.querySelector(".gantt-grid-body");
|
|
4034
4031
|
if (!ae || me.length === 0) {
|
|
4035
|
-
|
|
4032
|
+
st(null);
|
|
4036
4033
|
return;
|
|
4037
4034
|
}
|
|
4038
4035
|
const fe = ae.getBoundingClientRect(), ve = P - fe.top + ae.scrollTop;
|
|
@@ -4040,27 +4037,27 @@ ${s + 1}. ${n.text}
|
|
|
4040
4037
|
Me = Math.max(0, Math.min(Me, me.length - 1));
|
|
4041
4038
|
const He = me[Me];
|
|
4042
4039
|
if (He) {
|
|
4043
|
-
if (He.id ===
|
|
4044
|
-
|
|
4040
|
+
if (He.id === ge.id || ge.descendantIds.includes(He.id)) {
|
|
4041
|
+
st(null), tt((qt) => qt ? { ...qt, currentX: T, currentY: P } : null);
|
|
4045
4042
|
return;
|
|
4046
4043
|
}
|
|
4047
4044
|
const Ct = ve - Me * H;
|
|
4048
4045
|
let mt = "above";
|
|
4049
|
-
He.type !== "milestone" ? Ct < H * 0.3 ? mt = "above" : Ct > H * 0.7 ? mt = "below" : mt = "inside" : mt = Ct < H / 2 ? "above" : "below",
|
|
4046
|
+
He.type !== "milestone" ? Ct < H * 0.3 ? mt = "above" : Ct > H * 0.7 ? mt = "below" : mt = "inside" : mt = Ct < H / 2 ? "above" : "below", st({ taskId: He.id, position: mt });
|
|
4050
4047
|
}
|
|
4051
|
-
|
|
4048
|
+
tt((Lt) => Lt ? { ...Lt, currentX: T, currentY: P } : null);
|
|
4052
4049
|
});
|
|
4053
4050
|
}
|
|
4054
|
-
}, [
|
|
4055
|
-
|
|
4056
|
-
}, Be = (l,
|
|
4051
|
+
}, [ge, me, Ae.rowHeight]), be = () => {
|
|
4052
|
+
ge && K();
|
|
4053
|
+
}, Be = (l, T) => {
|
|
4057
4054
|
const P = {
|
|
4058
4055
|
...l,
|
|
4059
4056
|
id: `task-${Date.now()}`,
|
|
4060
|
-
parent:
|
|
4057
|
+
parent: T
|
|
4061
4058
|
// Set parent if provided (for subtasks)
|
|
4062
4059
|
};
|
|
4063
|
-
|
|
4060
|
+
xe(P);
|
|
4064
4061
|
const H = {
|
|
4065
4062
|
taskId: P.id,
|
|
4066
4063
|
start: new Date(P.start),
|
|
@@ -4068,61 +4065,61 @@ ${s + 1}. ${n.text}
|
|
|
4068
4065
|
end: new Date(P.end)
|
|
4069
4066
|
// Capture original end date
|
|
4070
4067
|
};
|
|
4071
|
-
|
|
4068
|
+
it((ae) => {
|
|
4072
4069
|
const fe = new Map(ae);
|
|
4073
4070
|
return fe.set(P.id, H), fe;
|
|
4074
4071
|
}), E && E(P);
|
|
4075
|
-
},
|
|
4076
|
-
|
|
4077
|
-
},
|
|
4078
|
-
|
|
4079
|
-
const P = new Map(
|
|
4072
|
+
}, Ge = (l) => {
|
|
4073
|
+
q(l), y && y(l);
|
|
4074
|
+
}, Ze = (l) => {
|
|
4075
|
+
Qe(l), it((T) => {
|
|
4076
|
+
const P = new Map(T);
|
|
4080
4077
|
return P.delete(l), P;
|
|
4081
4078
|
}), F && F(l);
|
|
4082
|
-
},
|
|
4083
|
-
const ae = { id: `link-${Date.now()}`, source: l, target:
|
|
4084
|
-
Ie([...
|
|
4079
|
+
}, Ne = (l, T, P, H) => {
|
|
4080
|
+
const ae = { id: `link-${Date.now()}`, source: l, target: T, type: P, lag: H };
|
|
4081
|
+
Ie([...ye, ae]), N && N(ae);
|
|
4085
4082
|
}, bt = (l) => {
|
|
4086
|
-
const
|
|
4087
|
-
Ie(
|
|
4083
|
+
const T = ye.filter((P) => P.id !== l);
|
|
4084
|
+
Ie(T), M && M(l);
|
|
4088
4085
|
};
|
|
4089
|
-
|
|
4086
|
+
ut(() => {
|
|
4090
4087
|
if (w && w.size > 0)
|
|
4091
4088
|
return;
|
|
4092
|
-
const l = new Map(
|
|
4093
|
-
let
|
|
4089
|
+
const l = new Map(qe);
|
|
4090
|
+
let T = !1;
|
|
4094
4091
|
z.forEach((H) => {
|
|
4095
|
-
|
|
4092
|
+
qe.has(H.id) || (l.set(H.id, {
|
|
4096
4093
|
taskId: H.id,
|
|
4097
4094
|
start: new Date(H.plannedStart ?? H.start),
|
|
4098
4095
|
// Use planned dates if available
|
|
4099
4096
|
end: new Date(H.plannedEnd ?? H.end)
|
|
4100
4097
|
// Use planned dates if available
|
|
4101
|
-
}),
|
|
4098
|
+
}), T = !0);
|
|
4102
4099
|
});
|
|
4103
4100
|
const P = new Set(z.map((H) => H.id));
|
|
4104
|
-
|
|
4105
|
-
P.has(ae) || (l.delete(ae),
|
|
4106
|
-
}),
|
|
4107
|
-
}, [z, w]),
|
|
4108
|
-
const l = (
|
|
4109
|
-
(
|
|
4101
|
+
qe.forEach((H, ae) => {
|
|
4102
|
+
P.has(ae) || (l.delete(ae), T = !0);
|
|
4103
|
+
}), T && it(l);
|
|
4104
|
+
}, [z, w]), ut(() => {
|
|
4105
|
+
const l = (T) => {
|
|
4106
|
+
(T.ctrlKey || T.metaKey) && (T.key === "z" && !T.shiftKey ? (T.preventDefault(), Ye()) : (T.key === "y" || T.key === "z" && T.shiftKey) && (T.preventDefault(), $()));
|
|
4110
4107
|
};
|
|
4111
4108
|
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
4112
|
-
}, [Ye, $]),
|
|
4113
|
-
const l = Mt.current?.querySelector(".gantt-grid-body"),
|
|
4114
|
-
if (!l || !
|
|
4109
|
+
}, [Ye, $]), ut(() => {
|
|
4110
|
+
const l = Mt.current?.querySelector(".gantt-grid-body"), T = Dt.current?.querySelector(".gantt-timeline-body");
|
|
4111
|
+
if (!l || !T) return;
|
|
4115
4112
|
const P = () => {
|
|
4116
|
-
|
|
4117
|
-
|
|
4113
|
+
lt.current !== "timeline" && (lt.current = "grid", T.scrollTop = l.scrollTop, requestAnimationFrame(() => {
|
|
4114
|
+
lt.current = null;
|
|
4118
4115
|
}));
|
|
4119
4116
|
}, H = () => {
|
|
4120
|
-
|
|
4121
|
-
|
|
4117
|
+
lt.current !== "grid" && (lt.current = "timeline", l.scrollTop = T.scrollTop, requestAnimationFrame(() => {
|
|
4118
|
+
lt.current = null;
|
|
4122
4119
|
}));
|
|
4123
4120
|
};
|
|
4124
|
-
return l.addEventListener("scroll", P, { passive: !0 }),
|
|
4125
|
-
l.removeEventListener("scroll", P),
|
|
4121
|
+
return l.addEventListener("scroll", P, { passive: !0 }), T.addEventListener("scroll", H, { passive: !0 }), () => {
|
|
4122
|
+
l.removeEventListener("scroll", P), T.removeEventListener("scroll", H), $t.current && clearTimeout($t.current);
|
|
4126
4123
|
};
|
|
4127
4124
|
}, [me]);
|
|
4128
4125
|
const Xt = {
|
|
@@ -4147,61 +4144,61 @@ ${s + 1}. ${n.text}
|
|
|
4147
4144
|
style: { ..._r, ...Ut },
|
|
4148
4145
|
children: [
|
|
4149
4146
|
/* @__PURE__ */ t.jsx(
|
|
4150
|
-
|
|
4147
|
+
Tn,
|
|
4151
4148
|
{
|
|
4152
4149
|
zoomLevel: xt,
|
|
4153
|
-
setZoomLevel:
|
|
4154
|
-
timelineView:
|
|
4150
|
+
setZoomLevel: kt,
|
|
4151
|
+
timelineView: Se ? O : void 0,
|
|
4155
4152
|
timelineViewOptions: V,
|
|
4156
|
-
onTimelineViewChange:
|
|
4153
|
+
onTimelineViewChange: Se ? Vt : void 0,
|
|
4157
4154
|
onExport: (l) => {
|
|
4158
|
-
l === "csv" && Pr(z), l === "excel" && Nr(z), l === "json" &&
|
|
4155
|
+
l === "csv" && Pr(z), l === "excel" && Nr(z), l === "json" && kr(z, ye), l === "pdf" && Or(z);
|
|
4159
4156
|
},
|
|
4160
4157
|
onFilterChange: (l) => zt(l),
|
|
4161
4158
|
owners: Ht || [],
|
|
4162
4159
|
onAddTask: (l) => {
|
|
4163
4160
|
if (l) {
|
|
4164
|
-
const
|
|
4165
|
-
|
|
4161
|
+
const T = z.find((P) => P.id === l);
|
|
4162
|
+
g(l), f(T?.text);
|
|
4166
4163
|
} else
|
|
4167
|
-
|
|
4168
|
-
|
|
4164
|
+
g(void 0), f(void 0);
|
|
4165
|
+
ot(!0);
|
|
4169
4166
|
},
|
|
4170
4167
|
uiConfig: re,
|
|
4171
4168
|
iconConfig: c,
|
|
4172
4169
|
styleConfig: r
|
|
4173
4170
|
}
|
|
4174
4171
|
),
|
|
4175
|
-
/* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref:
|
|
4172
|
+
/* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref: Ot, onMouseMove: we, onMouseUp: be, onMouseLeave: be, children: [
|
|
4176
4173
|
/* @__PURE__ */ t.jsx(
|
|
4177
4174
|
Er,
|
|
4178
4175
|
{
|
|
4179
4176
|
ref: Mt,
|
|
4180
4177
|
tasks: me,
|
|
4181
4178
|
columns: Ae.columns || [],
|
|
4182
|
-
selectedTask:
|
|
4179
|
+
selectedTask: pe,
|
|
4183
4180
|
onTaskClick: o,
|
|
4184
4181
|
onTaskContextMenu: x,
|
|
4185
|
-
onTaskUpdate:
|
|
4186
|
-
onTaskDragStart:
|
|
4182
|
+
onTaskUpdate: Ge,
|
|
4183
|
+
onTaskDragStart: Q,
|
|
4187
4184
|
onAddTask: (l) => {
|
|
4188
4185
|
if (l) {
|
|
4189
|
-
const
|
|
4190
|
-
|
|
4186
|
+
const T = z.find((P) => P.id === l);
|
|
4187
|
+
g(l), f(T?.text);
|
|
4191
4188
|
} else
|
|
4192
|
-
|
|
4193
|
-
|
|
4189
|
+
g(void 0), f(void 0);
|
|
4190
|
+
ot(!0);
|
|
4194
4191
|
},
|
|
4195
|
-
onAddDependency:
|
|
4192
|
+
onAddDependency: Ne,
|
|
4196
4193
|
onRemoveDependency: bt,
|
|
4197
4194
|
onDependencyClick: (l) => {
|
|
4198
|
-
const
|
|
4199
|
-
|
|
4195
|
+
const T = z.find((P) => P.id === l);
|
|
4196
|
+
T && (ie(T), G(!0));
|
|
4200
4197
|
},
|
|
4201
|
-
links:
|
|
4198
|
+
links: ye,
|
|
4202
4199
|
allTasks: z,
|
|
4203
|
-
dropIndicator:
|
|
4204
|
-
reorderTask:
|
|
4200
|
+
dropIndicator: Ke,
|
|
4201
|
+
reorderTask: ge,
|
|
4205
4202
|
iconConfig: c,
|
|
4206
4203
|
styleConfig: r,
|
|
4207
4204
|
headerHeight: (Ae.scaleHeight || 28) * I
|
|
@@ -4212,90 +4209,90 @@ ${s + 1}. ${n.text}
|
|
|
4212
4209
|
{
|
|
4213
4210
|
ref: Dt,
|
|
4214
4211
|
tasks: me,
|
|
4215
|
-
links:
|
|
4212
|
+
links: ye,
|
|
4216
4213
|
range: Wt,
|
|
4217
4214
|
scales: Ae.scales,
|
|
4218
4215
|
config: Ae,
|
|
4219
|
-
selectedTask:
|
|
4220
|
-
draggedTask:
|
|
4216
|
+
selectedTask: pe,
|
|
4217
|
+
draggedTask: $e,
|
|
4221
4218
|
onTaskClick: () => {
|
|
4222
4219
|
},
|
|
4223
4220
|
onTaskDragStart: () => {
|
|
4224
4221
|
},
|
|
4225
4222
|
onTaskDragEnd: () => {
|
|
4226
4223
|
},
|
|
4227
|
-
onTaskUpdate: (l,
|
|
4224
|
+
onTaskUpdate: (l, T, P) => {
|
|
4228
4225
|
const H = z.find((ve) => ve.id === l);
|
|
4229
4226
|
if (!H) return;
|
|
4230
|
-
const ae = { ...H }, fe = { ...H, ...
|
|
4231
|
-
|
|
4227
|
+
const ae = { ...H }, fe = { ...H, ...T };
|
|
4228
|
+
Ge(fe), P && m && m({
|
|
4232
4229
|
task: fe,
|
|
4233
4230
|
previousTask: ae,
|
|
4234
4231
|
dragType: P.dragType
|
|
4235
4232
|
});
|
|
4236
4233
|
},
|
|
4237
4234
|
zoomLevel: xt,
|
|
4238
|
-
baselines:
|
|
4235
|
+
baselines: qe,
|
|
4239
4236
|
taskTooltipConfig: le,
|
|
4240
4237
|
headerHeight: (Ae.scaleHeight || 28) * I
|
|
4241
4238
|
}
|
|
4242
4239
|
)
|
|
4243
4240
|
] }),
|
|
4244
|
-
|
|
4245
|
-
|
|
4241
|
+
Ue && /* @__PURE__ */ t.jsx(
|
|
4242
|
+
Mn,
|
|
4246
4243
|
{
|
|
4247
4244
|
onCreateTask: Be,
|
|
4248
4245
|
onClose: () => {
|
|
4249
|
-
|
|
4246
|
+
ot(!1), g(void 0), f(void 0);
|
|
4250
4247
|
},
|
|
4251
4248
|
uiConfig: re,
|
|
4252
|
-
parentId:
|
|
4253
|
-
parentTaskName:
|
|
4249
|
+
parentId: i,
|
|
4250
|
+
parentTaskName: D,
|
|
4254
4251
|
styleConfig: r
|
|
4255
4252
|
}
|
|
4256
4253
|
),
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4254
|
+
_e && /* @__PURE__ */ t.jsx(Fn, { task: _e, onUpdate: Ge, onDelete: Ze, onClose: () => Xe(null), uiConfig: re, styleConfig: r }),
|
|
4255
|
+
U && ee && /* @__PURE__ */ t.jsx(
|
|
4256
|
+
Pn,
|
|
4260
4257
|
{
|
|
4261
|
-
task:
|
|
4258
|
+
task: ee,
|
|
4262
4259
|
allTasks: z,
|
|
4263
|
-
links:
|
|
4264
|
-
onAddDependency:
|
|
4260
|
+
links: ye,
|
|
4261
|
+
onAddDependency: Ne,
|
|
4265
4262
|
onRemoveDependency: bt,
|
|
4266
|
-
onTaskUpdate:
|
|
4263
|
+
onTaskUpdate: Ge,
|
|
4267
4264
|
onClose: () => {
|
|
4268
|
-
|
|
4265
|
+
G(!1), ie(null);
|
|
4269
4266
|
},
|
|
4270
4267
|
styleConfig: r
|
|
4271
4268
|
}
|
|
4272
4269
|
),
|
|
4273
|
-
|
|
4270
|
+
Ce && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
4274
4271
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-context-menu-overlay", onClick: () => ht(null), onContextMenu: (l) => {
|
|
4275
4272
|
l.preventDefault(), ht(null);
|
|
4276
4273
|
} }),
|
|
4277
4274
|
/* @__PURE__ */ t.jsx(
|
|
4278
|
-
|
|
4275
|
+
Nn,
|
|
4279
4276
|
{
|
|
4280
|
-
x:
|
|
4281
|
-
y:
|
|
4282
|
-
task:
|
|
4277
|
+
x: Ce.x,
|
|
4278
|
+
y: Ce.y,
|
|
4279
|
+
task: Ce.task,
|
|
4283
4280
|
onEdit: () => {
|
|
4284
|
-
|
|
4281
|
+
Ce.task && Xe(Ce.task);
|
|
4285
4282
|
},
|
|
4286
4283
|
onDelete: () => {
|
|
4287
|
-
|
|
4284
|
+
Ce.task && Ze(Ce.task.id);
|
|
4288
4285
|
},
|
|
4289
4286
|
onCopy: L,
|
|
4290
4287
|
onDependencies: () => {
|
|
4291
|
-
|
|
4288
|
+
Ce.task && (ie(Ce.task), G(!0));
|
|
4292
4289
|
},
|
|
4293
4290
|
onConvertToMilestone: () => _("milestone"),
|
|
4294
4291
|
onConvertToTask: () => _("task"),
|
|
4295
4292
|
onConvertToProject: () => _("project"),
|
|
4296
4293
|
onClose: () => ht(null),
|
|
4297
4294
|
onAutoSchedule: () => {
|
|
4298
|
-
const l = Rr(z,
|
|
4295
|
+
const l = Rr(z, ye, { mode: "forward" });
|
|
4299
4296
|
Le(l), ht(null);
|
|
4300
4297
|
},
|
|
4301
4298
|
iconConfig: c,
|
|
@@ -4303,10 +4300,10 @@ ${s + 1}. ${n.text}
|
|
|
4303
4300
|
}
|
|
4304
4301
|
)
|
|
4305
4302
|
] }),
|
|
4306
|
-
|
|
4307
|
-
const l = z.find((He) => He.id ===
|
|
4303
|
+
ge && (() => {
|
|
4304
|
+
const l = z.find((He) => He.id === ge.id);
|
|
4308
4305
|
if (!l) return null;
|
|
4309
|
-
const
|
|
4306
|
+
const T = Number.isFinite(ge.currentX) ? ge.currentX : 0, P = Number.isFinite(ge.currentY) ? ge.currentY : 0, H = Ae.rowHeight || 48, fe = Et.current?.getBoundingClientRect(), ve = fe ? T - fe.left + 12 : T + 12, Me = fe ? P - fe.top + 12 : P + 12;
|
|
4310
4307
|
return /* @__PURE__ */ t.jsxs(
|
|
4311
4308
|
"div",
|
|
4312
4309
|
{
|
|
@@ -4322,9 +4319,9 @@ ${s + 1}. ${n.text}
|
|
|
4322
4319
|
},
|
|
4323
4320
|
children: [
|
|
4324
4321
|
/* @__PURE__ */ t.jsx("span", { className: "gantt-drag-preview-name", title: l.text, children: l.text }),
|
|
4325
|
-
|
|
4322
|
+
ge.descendantIds.length > 0 && /* @__PURE__ */ t.jsxs("span", { className: "gantt-drag-preview-count", children: [
|
|
4326
4323
|
"+",
|
|
4327
|
-
|
|
4324
|
+
ge.descendantIds.length
|
|
4328
4325
|
] })
|
|
4329
4326
|
]
|
|
4330
4327
|
}
|
|
@@ -4336,7 +4333,7 @@ ${s + 1}. ${n.text}
|
|
|
4336
4333
|
]
|
|
4337
4334
|
}
|
|
4338
4335
|
);
|
|
4339
|
-
},
|
|
4336
|
+
}, ea = (e, a) => {
|
|
4340
4337
|
const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
4341
4338
|
e.forEach((m) => {
|
|
4342
4339
|
r.set(m.id, []), c.set(m.id, []);
|
|
@@ -4353,66 +4350,66 @@ ${s + 1}. ${n.text}
|
|
|
4353
4350
|
b.set(m, 0), u.set(m, F.duration);
|
|
4354
4351
|
else {
|
|
4355
4352
|
let M = 0;
|
|
4356
|
-
N.forEach((
|
|
4357
|
-
d(
|
|
4358
|
-
const w = u.get(
|
|
4353
|
+
N.forEach((v) => {
|
|
4354
|
+
d(v, E);
|
|
4355
|
+
const w = u.get(v) || 0;
|
|
4359
4356
|
M = Math.max(M, w);
|
|
4360
4357
|
}), b.set(m, M), u.set(m, M + F.duration);
|
|
4361
4358
|
}
|
|
4362
4359
|
};
|
|
4363
4360
|
e.forEach((m) => d(m.id));
|
|
4364
|
-
const
|
|
4361
|
+
const h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), S = Math.max(...Array.from(u.values())), y = (m, E = /* @__PURE__ */ new Set()) => {
|
|
4365
4362
|
if (E.has(m)) return;
|
|
4366
4363
|
E.add(m);
|
|
4367
4364
|
const F = e.find((M) => M.id === m);
|
|
4368
4365
|
if (!F) return;
|
|
4369
4366
|
const N = r.get(m) || [];
|
|
4370
4367
|
if (N.length === 0)
|
|
4371
|
-
|
|
4368
|
+
p.set(m, S), h.set(m, S - F.duration);
|
|
4372
4369
|
else {
|
|
4373
4370
|
let M = 1 / 0;
|
|
4374
|
-
N.forEach((
|
|
4375
|
-
|
|
4376
|
-
const w =
|
|
4371
|
+
N.forEach((v) => {
|
|
4372
|
+
y(v, E);
|
|
4373
|
+
const w = h.get(v) || 0;
|
|
4377
4374
|
M = Math.min(M, w);
|
|
4378
|
-
}),
|
|
4375
|
+
}), p.set(m, M), h.set(m, M - F.duration);
|
|
4379
4376
|
}
|
|
4380
4377
|
};
|
|
4381
|
-
return e.forEach((m) =>
|
|
4382
|
-
const E = b.get(m.id) || 0, N = (
|
|
4378
|
+
return e.forEach((m) => y(m.id)), e.forEach((m) => {
|
|
4379
|
+
const E = b.get(m.id) || 0, N = (h.get(m.id) || 0) - E;
|
|
4383
4380
|
s.set(m.id, N), Math.abs(N) < 0.01 && n.add(m.id);
|
|
4384
4381
|
}), {
|
|
4385
4382
|
criticalTasks: n,
|
|
4386
4383
|
taskFloats: s,
|
|
4387
|
-
projectDuration:
|
|
4384
|
+
projectDuration: S
|
|
4388
4385
|
};
|
|
4389
|
-
},
|
|
4386
|
+
}, ta = (e, a) => a.criticalTasks.has(e), ra = (e, a) => a.taskFloats.get(e) || 0, ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4390
4387
|
__proto__: null,
|
|
4391
|
-
calculateCriticalPath:
|
|
4392
|
-
getTaskFloat:
|
|
4393
|
-
isCriticalTask:
|
|
4388
|
+
calculateCriticalPath: ea,
|
|
4389
|
+
getTaskFloat: ra,
|
|
4390
|
+
isCriticalTask: ta
|
|
4394
4391
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4395
4392
|
export {
|
|
4396
|
-
|
|
4393
|
+
ca as AutoScheduler,
|
|
4397
4394
|
Fr as Chart,
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4395
|
+
ha as CriticalPath,
|
|
4396
|
+
Pn as DependencyEditor,
|
|
4397
|
+
ua as ExportUtils,
|
|
4398
|
+
jn as FilterSearch,
|
|
4399
|
+
pa as Gantt,
|
|
4403
4400
|
Er as Grid,
|
|
4404
4401
|
xn as TaskBar,
|
|
4405
|
-
|
|
4406
|
-
|
|
4402
|
+
Mn as TaskCreator,
|
|
4403
|
+
Fn as TaskEditor,
|
|
4407
4404
|
Lr as Timeline,
|
|
4408
|
-
|
|
4405
|
+
Tn as Toolbar,
|
|
4409
4406
|
Te as addToDate,
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4407
|
+
zn as applyFilters,
|
|
4408
|
+
da as calculateDuration,
|
|
4409
|
+
Yn as createBaseline,
|
|
4413
4410
|
ke as formatDate,
|
|
4414
4411
|
Nt as getDaysBetween,
|
|
4415
|
-
|
|
4412
|
+
la as getEndOfDay,
|
|
4416
4413
|
pn as getHoursBetween,
|
|
4417
4414
|
yt as getStartOfDay,
|
|
4418
4415
|
Zt as isHoliday,
|