iris-gantt 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/Gantt/Gantt.d.ts.map +1 -1
- package/dist/gantt.css +1 -1
- package/dist/iris-gantt.js +775 -769
- package/dist/iris-gantt.umd.cjs +11 -11
- package/package.json +1 -1
package/dist/iris-gantt.js
CHANGED
|
@@ -8,29 +8,29 @@ var Wt;
|
|
|
8
8
|
function Nr() {
|
|
9
9
|
if (Wt) return it;
|
|
10
10
|
Wt = 1;
|
|
11
|
-
var e = G, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.fragment"),
|
|
12
|
-
function
|
|
13
|
-
var p, w = {},
|
|
14
|
-
|
|
15
|
-
for (p in
|
|
16
|
-
if (l && l.defaultProps) for (p in
|
|
17
|
-
return { $$typeof: o, type: l, key:
|
|
11
|
+
var e = G, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
12
|
+
function f(l, i, g) {
|
|
13
|
+
var p, w = {}, E = null, x = null;
|
|
14
|
+
g !== void 0 && (E = "" + g), i.key !== void 0 && (E = "" + i.key), i.ref !== void 0 && (x = i.ref);
|
|
15
|
+
for (p in i) s.call(i, p) && !h.hasOwnProperty(p) && (w[p] = i[p]);
|
|
16
|
+
if (l && l.defaultProps) for (p in i = l.defaultProps, i) w[p] === void 0 && (w[p] = i[p]);
|
|
17
|
+
return { $$typeof: o, type: l, key: E, ref: x, props: w, _owner: r.current };
|
|
18
18
|
}
|
|
19
|
-
return it.Fragment = a, it.jsx =
|
|
19
|
+
return it.Fragment = a, it.jsx = f, it.jsxs = f, it;
|
|
20
20
|
}
|
|
21
21
|
var lt = {};
|
|
22
22
|
var Ht;
|
|
23
23
|
function $r() {
|
|
24
24
|
return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
25
|
-
var e = G, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.portal"),
|
|
26
|
-
function
|
|
25
|
+
var e = G, o = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), h = /* @__PURE__ */ Symbol.for("react.profiler"), f = /* @__PURE__ */ Symbol.for("react.provider"), l = /* @__PURE__ */ Symbol.for("react.context"), i = /* @__PURE__ */ Symbol.for("react.forward_ref"), g = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), w = /* @__PURE__ */ Symbol.for("react.memo"), E = /* @__PURE__ */ Symbol.for("react.lazy"), x = /* @__PURE__ */ Symbol.for("react.offscreen"), j = Symbol.iterator, v = "@@iterator";
|
|
26
|
+
function N(n) {
|
|
27
27
|
if (n === null || typeof n != "object")
|
|
28
28
|
return null;
|
|
29
|
-
var d =
|
|
29
|
+
var d = j && n[j] || n[v];
|
|
30
30
|
return typeof d == "function" ? d : null;
|
|
31
31
|
}
|
|
32
32
|
var S = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
33
|
-
function
|
|
33
|
+
function m(n) {
|
|
34
34
|
{
|
|
35
35
|
for (var d = arguments.length, y = new Array(d > 1 ? d - 1 : 0), M = 1; M < d; M++)
|
|
36
36
|
y[M - 1] = arguments[M];
|
|
@@ -47,10 +47,10 @@ function $r() {
|
|
|
47
47
|
C.unshift("Warning: " + d), Function.prototype.apply.call(console[n], console, C);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
var J = !1, R = !1, V = !1, Q = !1,
|
|
50
|
+
var J = !1, R = !1, V = !1, Q = !1, L = !1, q;
|
|
51
51
|
q = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
52
52
|
function H(n) {
|
|
53
|
-
return !!(typeof n == "string" || typeof n == "function" || n ===
|
|
53
|
+
return !!(typeof n == "string" || typeof n == "function" || n === s || n === h || L || n === r || n === g || n === p || Q || n === x || J || R || V || typeof n == "object" && n !== null && (n.$$typeof === E || n.$$typeof === w || n.$$typeof === f || n.$$typeof === l || n.$$typeof === i || // 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.
|
|
@@ -69,12 +69,12 @@ function $r() {
|
|
|
69
69
|
function Z(n) {
|
|
70
70
|
if (n == null)
|
|
71
71
|
return null;
|
|
72
|
-
if (typeof n.tag == "number" &&
|
|
72
|
+
if (typeof n.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
73
73
|
return n.displayName || n.name || null;
|
|
74
74
|
if (typeof n == "string")
|
|
75
75
|
return n;
|
|
76
76
|
switch (n) {
|
|
77
|
-
case
|
|
77
|
+
case s:
|
|
78
78
|
return "Fragment";
|
|
79
79
|
case a:
|
|
80
80
|
return "Portal";
|
|
@@ -82,7 +82,7 @@ function $r() {
|
|
|
82
82
|
return "Profiler";
|
|
83
83
|
case r:
|
|
84
84
|
return "StrictMode";
|
|
85
|
-
case
|
|
85
|
+
case g:
|
|
86
86
|
return "Suspense";
|
|
87
87
|
case p:
|
|
88
88
|
return "SuspenseList";
|
|
@@ -92,15 +92,15 @@ function $r() {
|
|
|
92
92
|
case l:
|
|
93
93
|
var d = n;
|
|
94
94
|
return I(d) + ".Consumer";
|
|
95
|
-
case
|
|
95
|
+
case f:
|
|
96
96
|
var y = n;
|
|
97
97
|
return I(y._context) + ".Provider";
|
|
98
|
-
case
|
|
98
|
+
case i:
|
|
99
99
|
return D(n, n.render, "ForwardRef");
|
|
100
100
|
case w:
|
|
101
101
|
var M = n.displayName || null;
|
|
102
102
|
return M !== null ? M : Z(n.type) || "Memo";
|
|
103
|
-
case
|
|
103
|
+
case E: {
|
|
104
104
|
var A = n, C = A._payload, k = A._init;
|
|
105
105
|
try {
|
|
106
106
|
return Z(k(C));
|
|
@@ -170,7 +170,7 @@ function $r() {
|
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
B < 0 &&
|
|
173
|
+
B < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
var ne = S.ReactCurrentDispatcher, je;
|
|
@@ -189,8 +189,8 @@ function $r() {
|
|
|
189
189
|
}
|
|
190
190
|
var c = !1, b;
|
|
191
191
|
{
|
|
192
|
-
var
|
|
193
|
-
b = new
|
|
192
|
+
var $ = typeof WeakMap == "function" ? WeakMap : Map;
|
|
193
|
+
b = new $();
|
|
194
194
|
}
|
|
195
195
|
function F(n, d) {
|
|
196
196
|
if (!n || c)
|
|
@@ -278,18 +278,18 @@ function $r() {
|
|
|
278
278
|
if (typeof n == "string")
|
|
279
279
|
return P(n);
|
|
280
280
|
switch (n) {
|
|
281
|
-
case
|
|
281
|
+
case g:
|
|
282
282
|
return P("Suspense");
|
|
283
283
|
case p:
|
|
284
284
|
return P("SuspenseList");
|
|
285
285
|
}
|
|
286
286
|
if (typeof n == "object")
|
|
287
287
|
switch (n.$$typeof) {
|
|
288
|
-
case
|
|
288
|
+
case i:
|
|
289
289
|
return W(n.render);
|
|
290
290
|
case w:
|
|
291
291
|
return U(n.type, d, y);
|
|
292
|
-
case
|
|
292
|
+
case E: {
|
|
293
293
|
var M = n, A = M._payload, C = M._init;
|
|
294
294
|
try {
|
|
295
295
|
return U(C(A), d, y);
|
|
@@ -322,7 +322,7 @@ function $r() {
|
|
|
322
322
|
} catch (ee) {
|
|
323
323
|
z = ee;
|
|
324
324
|
}
|
|
325
|
-
z && !(z instanceof Error) && (De(A),
|
|
325
|
+
z && !(z instanceof Error) && (De(A), m("%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).", M || "React class", y, k, typeof z), De(null)), z instanceof Error && !(z.message in oe) && (oe[z.message] = !0, De(A), m("Failed %s type: %s", y, z.message), De(null));
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -348,7 +348,7 @@ function $r() {
|
|
|
348
348
|
}
|
|
349
349
|
function tt(n) {
|
|
350
350
|
if (ht(n))
|
|
351
|
-
return
|
|
351
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pt(n)), mt(n);
|
|
352
352
|
}
|
|
353
353
|
var qe = S.ReactCurrentOwner, Mt = {
|
|
354
354
|
key: !0,
|
|
@@ -378,7 +378,7 @@ function $r() {
|
|
|
378
378
|
function Yt(n, d) {
|
|
379
379
|
{
|
|
380
380
|
var y = function() {
|
|
381
|
-
rt || (rt = !0,
|
|
381
|
+
rt || (rt = !0, m("%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)", d));
|
|
382
382
|
};
|
|
383
383
|
y.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
384
384
|
get: y,
|
|
@@ -389,7 +389,7 @@ function $r() {
|
|
|
389
389
|
function Lt(n, d) {
|
|
390
390
|
{
|
|
391
391
|
var y = function() {
|
|
392
|
-
$e || ($e = !0,
|
|
392
|
+
$e || ($e = !0, m("%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)", d));
|
|
393
393
|
};
|
|
394
394
|
y.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
395
395
|
get: y,
|
|
@@ -495,7 +495,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
495
495
|
return;
|
|
496
496
|
xt[y] = !0;
|
|
497
497
|
var M = "";
|
|
498
|
-
n && n._owner && n._owner !== nt.current && (M = " It was passed a child from " + Z(n._owner.type) + "."), Fe(n),
|
|
498
|
+
n && n._owner && n._owner !== nt.current && (M = " It was passed a child from " + Z(n._owner.type) + "."), Fe(n), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', y, M), Fe(null);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
function Be(n, d) {
|
|
@@ -510,7 +510,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
510
510
|
else if (at(n))
|
|
511
511
|
n._store && (n._store.validated = !0);
|
|
512
512
|
else if (n) {
|
|
513
|
-
var A =
|
|
513
|
+
var A = N(n);
|
|
514
514
|
if (typeof A == "function" && A !== n.entries)
|
|
515
515
|
for (var C = A.call(n), k; !(k = C.next()).done; )
|
|
516
516
|
at(k.value) && wt(k.value, d);
|
|
@@ -525,7 +525,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
525
525
|
var y;
|
|
526
526
|
if (typeof d == "function")
|
|
527
527
|
y = d.propTypes;
|
|
528
|
-
else if (typeof d == "object" && (d.$$typeof ===
|
|
528
|
+
else if (typeof d == "object" && (d.$$typeof === i || // Note: Memo only checks outer props here.
|
|
529
529
|
// Inner props are checked in the reconciler.
|
|
530
530
|
d.$$typeof === w))
|
|
531
531
|
y = d.propTypes;
|
|
@@ -537,9 +537,9 @@ Check the top-level render call using <` + y + ">.");
|
|
|
537
537
|
} else if (d.PropTypes !== void 0 && !Je) {
|
|
538
538
|
Je = !0;
|
|
539
539
|
var A = Z(d);
|
|
540
|
-
|
|
540
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
|
|
541
541
|
}
|
|
542
|
-
typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved &&
|
|
542
|
+
typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
function St(n) {
|
|
@@ -547,11 +547,11 @@ Check the top-level render call using <` + y + ">.");
|
|
|
547
547
|
for (var d = Object.keys(n.props), y = 0; y < d.length; y++) {
|
|
548
548
|
var M = d[y];
|
|
549
549
|
if (M !== "children" && M !== "key") {
|
|
550
|
-
Fe(n),
|
|
550
|
+
Fe(n), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", M), Fe(null);
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
n.ref !== null && (Fe(n),
|
|
554
|
+
n.ref !== null && (Fe(n), m("Invalid attribute `ref` supplied to `React.Fragment`."), Fe(null));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
var st = {};
|
|
@@ -564,7 +564,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
564
564
|
var me = ot();
|
|
565
565
|
me ? z += me : z += gt();
|
|
566
566
|
var ee;
|
|
567
|
-
n === null ? ee = "null" : Pe(n) ? ee = "array" : n !== void 0 && n.$$typeof === o ? (ee = "<" + (Z(n.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof n,
|
|
567
|
+
n === null ? ee = "null" : Pe(n) ? ee = "array" : n !== void 0 && n.$$typeof === o ? (ee = "<" + (Z(n.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof n, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ee, z);
|
|
568
568
|
}
|
|
569
569
|
var le = Rt(n, d, y, A, C);
|
|
570
570
|
if (le == null)
|
|
@@ -578,7 +578,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
578
578
|
Be(ve[Oe], n);
|
|
579
579
|
Object.freeze && Object.freeze(ve);
|
|
580
580
|
} else
|
|
581
|
-
|
|
581
|
+
m("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
|
Be(ve, n);
|
|
584
584
|
}
|
|
@@ -588,7 +588,7 @@ Check the top-level render call using <` + y + ">.");
|
|
|
588
588
|
}), We = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
589
589
|
if (!st[Ne + We]) {
|
|
590
590
|
var $t = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
591
|
-
|
|
591
|
+
m(`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:
|
|
@@ -596,7 +596,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
596
596
|
<%s key={someKey} {...props} />`, We, Ne, $t, Ne), st[Ne + We] = !0;
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
return n ===
|
|
599
|
+
return n === s ? St(le) : bt(le), le;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
function Pt(n, d, y) {
|
|
@@ -605,8 +605,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
605
605
|
function Nt(n, d, y) {
|
|
606
606
|
return vt(n, d, y, !1);
|
|
607
607
|
}
|
|
608
|
-
var u = Nt,
|
|
609
|
-
lt.Fragment =
|
|
608
|
+
var u = Nt, T = Pt;
|
|
609
|
+
lt.Fragment = s, lt.jsx = u, lt.jsxs = T;
|
|
610
610
|
})()), lt;
|
|
611
611
|
}
|
|
612
612
|
var Vt;
|
|
@@ -615,28 +615,28 @@ function Or() {
|
|
|
615
615
|
}
|
|
616
616
|
var t = Or();
|
|
617
617
|
const ye = (e, o, a) => {
|
|
618
|
-
const
|
|
618
|
+
const s = new Date(e);
|
|
619
619
|
switch (a) {
|
|
620
620
|
case "hour":
|
|
621
|
-
|
|
621
|
+
s.setHours(s.getHours() + o);
|
|
622
622
|
break;
|
|
623
623
|
case "day":
|
|
624
|
-
|
|
624
|
+
s.setDate(s.getDate() + o);
|
|
625
625
|
break;
|
|
626
626
|
case "week":
|
|
627
|
-
|
|
627
|
+
s.setDate(s.getDate() + o * 7);
|
|
628
628
|
break;
|
|
629
629
|
case "month":
|
|
630
|
-
|
|
630
|
+
s.setMonth(s.getMonth() + o);
|
|
631
631
|
break;
|
|
632
632
|
case "quarter":
|
|
633
|
-
|
|
633
|
+
s.setMonth(s.getMonth() + o * 3);
|
|
634
634
|
break;
|
|
635
635
|
case "year":
|
|
636
|
-
|
|
636
|
+
s.setFullYear(s.getFullYear() + o);
|
|
637
637
|
break;
|
|
638
638
|
}
|
|
639
|
-
return
|
|
639
|
+
return s;
|
|
640
640
|
}, ct = (e, o) => {
|
|
641
641
|
const a = o.getTime() - e.getTime();
|
|
642
642
|
return Math.ceil(a / (1e3 * 60 * 60 * 24));
|
|
@@ -644,10 +644,10 @@ const ye = (e, o, a) => {
|
|
|
644
644
|
const a = o.getTime() - e.getTime();
|
|
645
645
|
return Math.ceil(a / (1e3 * 60 * 60));
|
|
646
646
|
}, we = (e, o) => {
|
|
647
|
-
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
647
|
+
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], s = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], h = {
|
|
648
648
|
YYYY: e.getFullYear().toString(),
|
|
649
649
|
YY: e.getFullYear().toString().slice(-2),
|
|
650
|
-
MMMM:
|
|
650
|
+
MMMM: s[e.getMonth()],
|
|
651
651
|
MMM: a[e.getMonth()],
|
|
652
652
|
MM: String(e.getMonth() + 1).padStart(2, "0"),
|
|
653
653
|
M: String(e.getMonth() + 1),
|
|
@@ -659,7 +659,7 @@ const ye = (e, o, a) => {
|
|
|
659
659
|
mm: String(e.getMinutes()).padStart(2, "0"),
|
|
660
660
|
m: String(e.getMinutes())
|
|
661
661
|
};
|
|
662
|
-
return o.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (
|
|
662
|
+
return o.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (f) => h[f]);
|
|
663
663
|
}, Xt = (e) => {
|
|
664
664
|
const o = e.getDay();
|
|
665
665
|
return o === 0 || o === 6;
|
|
@@ -687,13 +687,13 @@ const ye = (e, o, a) => {
|
|
|
687
687
|
};
|
|
688
688
|
function Cr(e) {
|
|
689
689
|
if (!e || typeof e != "string") return null;
|
|
690
|
-
const o = e.trim(), a = /^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,
|
|
691
|
-
if (!
|
|
692
|
-
const r = parseInt(
|
|
693
|
-
let
|
|
694
|
-
if (
|
|
695
|
-
const
|
|
696
|
-
switch (
|
|
690
|
+
const o = e.trim(), a = /^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i, s = o.match(a);
|
|
691
|
+
if (!s) return null;
|
|
692
|
+
const r = parseInt(s[1], 10), h = s[2].toUpperCase();
|
|
693
|
+
let f = 0, l = "day";
|
|
694
|
+
if (s[3]) {
|
|
695
|
+
const i = s[4] === "-" ? -1 : 1;
|
|
696
|
+
switch (f = parseInt(s[5], 10) * i, s[6].toLowerCase()) {
|
|
697
697
|
case "d":
|
|
698
698
|
l = "day";
|
|
699
699
|
break;
|
|
@@ -708,7 +708,7 @@ function Cr(e) {
|
|
|
708
708
|
break;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
return { taskNumber: r, type: h, lag:
|
|
711
|
+
return { taskNumber: r, type: h, lag: f, lagUnit: l };
|
|
712
712
|
}
|
|
713
713
|
function Ct(e, o) {
|
|
714
714
|
switch (o) {
|
|
@@ -726,29 +726,29 @@ function Ct(e, o) {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
function _r(e, o) {
|
|
729
|
-
const
|
|
729
|
+
const s = {
|
|
730
730
|
e2s: "FS",
|
|
731
731
|
s2s: "SS",
|
|
732
732
|
e2e: "FF",
|
|
733
733
|
s2e: "SF"
|
|
734
734
|
}[e.type];
|
|
735
|
-
let r = `${o}${
|
|
735
|
+
let r = `${o}${s}`;
|
|
736
736
|
if (e.lag && e.lag !== 0) {
|
|
737
737
|
const h = e.lag > 0 ? "+" : "", l = (e.lagUnit || "day").charAt(0);
|
|
738
|
-
let
|
|
738
|
+
let i = e.lag;
|
|
739
739
|
if (e.lagUnit && e.lagUnit !== "day")
|
|
740
740
|
switch (e.lagUnit) {
|
|
741
741
|
case "hour":
|
|
742
|
-
|
|
742
|
+
i = e.lag * 24;
|
|
743
743
|
break;
|
|
744
744
|
case "week":
|
|
745
|
-
|
|
745
|
+
i = e.lag / 7;
|
|
746
746
|
break;
|
|
747
747
|
case "month":
|
|
748
|
-
|
|
748
|
+
i = e.lag / 30;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
|
-
r += `${h}${Math.round(
|
|
751
|
+
r += `${h}${Math.round(i)}${l}`;
|
|
752
752
|
}
|
|
753
753
|
return r;
|
|
754
754
|
}
|
|
@@ -841,15 +841,15 @@ const et = (e) => e ? {
|
|
|
841
841
|
task: e,
|
|
842
842
|
allTasks: o,
|
|
843
843
|
links: a,
|
|
844
|
-
onAddDependency:
|
|
844
|
+
onAddDependency: s,
|
|
845
845
|
onRemoveDependency: r,
|
|
846
846
|
onTaskUpdate: h,
|
|
847
|
-
children:
|
|
847
|
+
children: f,
|
|
848
848
|
styleConfig: l
|
|
849
849
|
}) => {
|
|
850
|
-
const
|
|
850
|
+
const i = et(l), [g, p] = X(!1), [w, E] = X(null), [x, j] = X("e2s"), [v, N] = X("lag"), [S, m] = X(0), [O, J] = X(e.duration), [R, V] = X(!0), Q = "day", L = a.find((_) => _.target === e.id), q = !!L, H = G.useMemo(() => o.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...o.map((_) => _.start.getTime()))), [o]), D = () => {
|
|
851
851
|
if (w) {
|
|
852
|
-
const _ =
|
|
852
|
+
const _ = v === "lag" ? S : -S, de = Ct(_, Q);
|
|
853
853
|
if (O !== e.duration && h) {
|
|
854
854
|
const pe = ye(new Date(e.start), O, "day");
|
|
855
855
|
h({
|
|
@@ -858,25 +858,25 @@ const et = (e) => e ? {
|
|
|
858
858
|
end: pe
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
|
|
861
|
+
s(w, e.id, x, de), p(!1), I();
|
|
862
862
|
}
|
|
863
863
|
}, I = () => {
|
|
864
|
-
|
|
864
|
+
E(null), j("e2s"), N("lag"), m(0), J(e.duration);
|
|
865
865
|
}, Z = () => {
|
|
866
|
-
|
|
866
|
+
L && r && (r(L.id), p(!1), I());
|
|
867
867
|
}, re = (_) => {
|
|
868
868
|
if (p(_), _) {
|
|
869
|
-
if (V(!0),
|
|
870
|
-
L
|
|
871
|
-
const de =
|
|
872
|
-
de >= 0 ? (
|
|
869
|
+
if (V(!0), L) {
|
|
870
|
+
E(L.source), j(L.type);
|
|
871
|
+
const de = L.lag || 0;
|
|
872
|
+
de >= 0 ? (N("lag"), m(de)) : (N("lead"), m(Math.abs(de)));
|
|
873
873
|
} else
|
|
874
874
|
I();
|
|
875
875
|
J(e.duration);
|
|
876
876
|
}
|
|
877
877
|
}, B = () => {
|
|
878
878
|
if (!R) return null;
|
|
879
|
-
const _ =
|
|
879
|
+
const _ = x === "e2s", de = x === "s2s", pe = x === "e2e", ge = x === "s2e";
|
|
880
880
|
let te = 0, ce = 0, K = "", Se = 0, ne = -1;
|
|
881
881
|
_ ? (te = 50, ce = 350, Se = 250, ne = 350, K = "M 250 60 L 300 60 L 300 140 L 348 140") : pe ? (te = 100, ce = 100, Se = 300, ne = -1, K = "M 300 60 L 350 60 L 350 140 L 302 140") : de ? (te = 250, ce = 250, Se = 250, ne = -1, K = "M 250 60 L 200 60 L 200 140 L 248 140") : ge && (te = 350, ce = 50, Se = 350, ne = 250, K = "M 350 60 L 300 60 L 300 140 L 252 140");
|
|
882
882
|
const je = w === "gantt-start-date", P = o.find((c) => c.id === w);
|
|
@@ -908,7 +908,7 @@ const et = (e) => e ? {
|
|
|
908
908
|
if (!w) return "Select a checklist from the list to see how it will relate to the current stage.";
|
|
909
909
|
const pe = o.indexOf(e) + 1, ge = _ ? "Start Date" : `Stage ${o.indexOf(de) + 1}`;
|
|
910
910
|
let te = "";
|
|
911
|
-
switch (
|
|
911
|
+
switch (x) {
|
|
912
912
|
case "e2s":
|
|
913
913
|
te = `Stage ${pe} starts after ${ge} finishes`;
|
|
914
914
|
break;
|
|
@@ -924,18 +924,18 @@ const et = (e) => e ? {
|
|
|
924
924
|
}
|
|
925
925
|
if (S > 0) {
|
|
926
926
|
const ce = `${S} ${Q}${S > 1 ? "s" : ""}`;
|
|
927
|
-
|
|
927
|
+
v === "lag" ? te += ` + ${ce} delay` : te += ` - ${ce} overlap`;
|
|
928
928
|
}
|
|
929
929
|
return te + ".";
|
|
930
930
|
}, se = /* @__PURE__ */ t.jsxs("div", { style: {
|
|
931
931
|
width: 550,
|
|
932
|
-
backgroundColor:
|
|
933
|
-
borderRadius:
|
|
932
|
+
backgroundColor: i.popover?.backgroundColor || "#fff",
|
|
933
|
+
borderRadius: i.popover?.borderRadius || "8px",
|
|
934
934
|
padding: "16px 20px",
|
|
935
|
-
boxShadow:
|
|
936
|
-
fontFamily:
|
|
935
|
+
boxShadow: i.popover?.boxShadow,
|
|
936
|
+
fontFamily: i.popover?.fontFamily
|
|
937
937
|
}, children: [
|
|
938
|
-
/* @__PURE__ */ t.jsx(Me, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color:
|
|
938
|
+
/* @__PURE__ */ t.jsx(Me, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color: i.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
|
be,
|
|
@@ -943,7 +943,7 @@ const et = (e) => e ? {
|
|
|
943
943
|
showSearch: !0,
|
|
944
944
|
placeholder: "Select checklist",
|
|
945
945
|
value: w,
|
|
946
|
-
onChange:
|
|
946
|
+
onChange: E,
|
|
947
947
|
style: { width: "100%" },
|
|
948
948
|
filterOption: (_, de) => {
|
|
949
949
|
if (de?.value === "gantt-start-date")
|
|
@@ -976,8 +976,8 @@ const et = (e) => e ? {
|
|
|
976
976
|
/* @__PURE__ */ t.jsx("div", { style: { width: 100 }, children: /* @__PURE__ */ t.jsxs(
|
|
977
977
|
be,
|
|
978
978
|
{
|
|
979
|
-
value:
|
|
980
|
-
onChange:
|
|
979
|
+
value: x,
|
|
980
|
+
onChange: j,
|
|
981
981
|
style: { width: "100%" },
|
|
982
982
|
children: [
|
|
983
983
|
/* @__PURE__ */ t.jsx(ze, { value: "e2s", children: "FS" }),
|
|
@@ -990,12 +990,12 @@ const et = (e) => e ? {
|
|
|
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(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color:
|
|
993
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: i.font?.color }, children: "Delay type" }),
|
|
994
994
|
/* @__PURE__ */ t.jsxs(
|
|
995
995
|
be,
|
|
996
996
|
{
|
|
997
|
-
value:
|
|
998
|
-
onChange:
|
|
997
|
+
value: v,
|
|
998
|
+
onChange: N,
|
|
999
999
|
style: { width: "100%" },
|
|
1000
1000
|
children: [
|
|
1001
1001
|
/* @__PURE__ */ t.jsx(ze, { value: "lag", children: "Lag by" }),
|
|
@@ -1005,13 +1005,13 @@ const et = (e) => e ? {
|
|
|
1005
1005
|
)
|
|
1006
1006
|
] }),
|
|
1007
1007
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
1008
|
-
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color:
|
|
1008
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: i.font?.color }, children: "Days" }),
|
|
1009
1009
|
/* @__PURE__ */ t.jsx(
|
|
1010
1010
|
_e,
|
|
1011
1011
|
{
|
|
1012
1012
|
min: 0,
|
|
1013
1013
|
value: S,
|
|
1014
|
-
onChange: (_) =>
|
|
1014
|
+
onChange: (_) => m(_ || 0),
|
|
1015
1015
|
style: { width: "100%" },
|
|
1016
1016
|
placeholder: "0"
|
|
1017
1017
|
}
|
|
@@ -1019,7 +1019,7 @@ const et = (e) => e ? {
|
|
|
1019
1019
|
] })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ t.jsxs("div", { style: { marginBottom: 14 }, children: [
|
|
1022
|
-
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color:
|
|
1022
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: i.font?.color }, children: "Duration (days)" }),
|
|
1023
1023
|
/* @__PURE__ */ t.jsx(
|
|
1024
1024
|
_e,
|
|
1025
1025
|
{
|
|
@@ -1037,13 +1037,13 @@ const et = (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(Me, { style: { fontSize: "11px", color:
|
|
1041
|
-
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color:
|
|
1042
|
-
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color:
|
|
1043
|
-
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color:
|
|
1040
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color: i.font?.color }, children: "FS: Finish to Start" }),
|
|
1041
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color: i.font?.color }, children: "SS: Start to Start" }),
|
|
1042
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color: i.font?.color }, children: "FF: Finish to Finish" }),
|
|
1043
|
+
/* @__PURE__ */ t.jsx(Me, { style: { fontSize: "11px", color: i.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(Me, { strong: !0, style: { fontSize: "13px", color:
|
|
1046
|
+
/* @__PURE__ */ t.jsx(Me, { strong: !0, style: { fontSize: "13px", color: i.font?.color }, children: "Dependency preview" }),
|
|
1047
1047
|
/* @__PURE__ */ t.jsx(
|
|
1048
1048
|
"a",
|
|
1049
1049
|
{
|
|
@@ -1062,7 +1062,7 @@ const et = (e) => e ? {
|
|
|
1062
1062
|
B(),
|
|
1063
1063
|
/* @__PURE__ */ t.jsx(zr, { style: {
|
|
1064
1064
|
fontSize: "12px",
|
|
1065
|
-
color:
|
|
1065
|
+
color: i.font?.color || "#262626",
|
|
1066
1066
|
marginBottom: 14,
|
|
1067
1067
|
lineHeight: "1.5"
|
|
1068
1068
|
}, children: ue() })
|
|
@@ -1074,7 +1074,7 @@ const et = (e) => e ? {
|
|
|
1074
1074
|
danger: !0,
|
|
1075
1075
|
onClick: Z,
|
|
1076
1076
|
style: {
|
|
1077
|
-
...
|
|
1077
|
+
...i.buttonDanger
|
|
1078
1078
|
},
|
|
1079
1079
|
children: "Remove Dependency"
|
|
1080
1080
|
}
|
|
@@ -1086,7 +1086,7 @@ const et = (e) => e ? {
|
|
|
1086
1086
|
onClick: D,
|
|
1087
1087
|
disabled: !w,
|
|
1088
1088
|
style: {
|
|
1089
|
-
...
|
|
1089
|
+
...i.buttonPrimary,
|
|
1090
1090
|
minWidth: 100
|
|
1091
1091
|
},
|
|
1092
1092
|
children: q ? "Update" : "Add"
|
|
@@ -1099,59 +1099,59 @@ const et = (e) => e ? {
|
|
|
1099
1099
|
{
|
|
1100
1100
|
content: se,
|
|
1101
1101
|
trigger: "click",
|
|
1102
|
-
open:
|
|
1102
|
+
open: g,
|
|
1103
1103
|
onOpenChange: re,
|
|
1104
1104
|
placement: "bottomLeft",
|
|
1105
1105
|
overlayClassName: "dependency-popover",
|
|
1106
1106
|
overlayInnerStyle: { padding: 0 },
|
|
1107
|
-
children:
|
|
1107
|
+
children: f
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
1110
|
}, rr = ur(At(
|
|
1111
|
-
({ tasks: e, allTasks: o = [], columns: a, selectedTask:
|
|
1112
|
-
const
|
|
1113
|
-
G.useImperativeHandle(
|
|
1114
|
-
const [S,
|
|
1115
|
-
if (!
|
|
1116
|
-
const H = e.find((D) => D.id ===
|
|
1111
|
+
({ tasks: e, allTasks: o = [], columns: a, selectedTask: s, onTaskClick: r, onTaskContextMenu: h, onTaskUpdate: f, onTaskDragStart: l, onAddTask: i, onAddDependency: g, onRemoveDependency: p, links: w = [], dropIndicator: E, reorderTask: x, styleConfig: j }, v) => {
|
|
1112
|
+
const N = G.useRef(null);
|
|
1113
|
+
G.useImperativeHandle(v, () => N.current);
|
|
1114
|
+
const [S, m] = G.useState(null), [O, J] = G.useState(0), R = (L, q = 0) => {
|
|
1115
|
+
if (!L.parent) return q;
|
|
1116
|
+
const H = e.find((D) => D.id === L.parent);
|
|
1117
1117
|
return H ? R(H, q + 1) : q;
|
|
1118
|
-
}, V = (
|
|
1119
|
-
if (q ===
|
|
1120
|
-
const H = ye(new Date(
|
|
1121
|
-
|
|
1122
|
-
...
|
|
1118
|
+
}, V = (L, q) => {
|
|
1119
|
+
if (q === L.duration) return;
|
|
1120
|
+
const H = ye(new Date(L.start), q, "day");
|
|
1121
|
+
f?.({
|
|
1122
|
+
...L,
|
|
1123
1123
|
duration: q,
|
|
1124
1124
|
end: H
|
|
1125
1125
|
});
|
|
1126
|
-
}, Q = (
|
|
1126
|
+
}, Q = (L, q) => {
|
|
1127
1127
|
if (q.template)
|
|
1128
|
-
return q.template(
|
|
1128
|
+
return q.template(L);
|
|
1129
1129
|
switch (q.name) {
|
|
1130
1130
|
case "text": {
|
|
1131
|
-
const H = R(
|
|
1131
|
+
const H = R(L);
|
|
1132
1132
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft: H * 14 }, children: [
|
|
1133
1133
|
/* @__PURE__ */ t.jsx(
|
|
1134
1134
|
"div",
|
|
1135
1135
|
{
|
|
1136
1136
|
className: "gantt-row-drag-handle",
|
|
1137
1137
|
onMouseDown: (D) => {
|
|
1138
|
-
D.preventDefault(), l?.(
|
|
1138
|
+
D.preventDefault(), l?.(L.id, D.clientX, D.clientY, "reorder");
|
|
1139
1139
|
},
|
|
1140
1140
|
children: /* @__PURE__ */ t.jsx(fe, { icon: gr })
|
|
1141
1141
|
}
|
|
1142
1142
|
),
|
|
1143
|
-
|
|
1144
|
-
D.stopPropagation(),
|
|
1145
|
-
}, children: /* @__PURE__ */ t.jsx(fe, { icon:
|
|
1146
|
-
/* @__PURE__ */ t.jsx("span", { className: "gantt-task-name-text", children:
|
|
1143
|
+
L.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (D) => {
|
|
1144
|
+
D.stopPropagation(), f?.({ ...L, open: !L.open });
|
|
1145
|
+
}, children: /* @__PURE__ */ t.jsx(fe, { icon: L.open ? Bt : xr }) }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, display: "inline-block" } }),
|
|
1146
|
+
/* @__PURE__ */ t.jsx("span", { className: "gantt-task-name-text", children: L.text })
|
|
1147
1147
|
] });
|
|
1148
1148
|
}
|
|
1149
1149
|
case "start":
|
|
1150
|
-
return we(
|
|
1150
|
+
return we(L.start, "DD-MM-YYYY");
|
|
1151
1151
|
case "end":
|
|
1152
|
-
return we(
|
|
1152
|
+
return we(L.end, "DD-MM-YYYY");
|
|
1153
1153
|
case "duration":
|
|
1154
|
-
return S ===
|
|
1154
|
+
return S === L.id ? /* @__PURE__ */ t.jsx(
|
|
1155
1155
|
_e,
|
|
1156
1156
|
{
|
|
1157
1157
|
size: "small",
|
|
@@ -1159,10 +1159,10 @@ const et = (e) => e ? {
|
|
|
1159
1159
|
value: O,
|
|
1160
1160
|
onChange: (D) => J(D || 1),
|
|
1161
1161
|
onBlur: () => {
|
|
1162
|
-
V(
|
|
1162
|
+
V(L, O), m(null);
|
|
1163
1163
|
},
|
|
1164
1164
|
onPressEnter: () => {
|
|
1165
|
-
V(
|
|
1165
|
+
V(L, O), m(null);
|
|
1166
1166
|
},
|
|
1167
1167
|
autoFocus: !0,
|
|
1168
1168
|
style: { width: "100%", fontSize: "12px" }
|
|
@@ -1171,7 +1171,7 @@ const et = (e) => e ? {
|
|
|
1171
1171
|
"div",
|
|
1172
1172
|
{
|
|
1173
1173
|
onClick: (D) => {
|
|
1174
|
-
D.stopPropagation(),
|
|
1174
|
+
D.stopPropagation(), m(L.id), J(L.duration);
|
|
1175
1175
|
},
|
|
1176
1176
|
style: {
|
|
1177
1177
|
backgroundColor: "#fff7e6",
|
|
@@ -1185,24 +1185,24 @@ const et = (e) => e ? {
|
|
|
1185
1185
|
cursor: "text"
|
|
1186
1186
|
},
|
|
1187
1187
|
children: [
|
|
1188
|
-
|
|
1188
|
+
L.duration,
|
|
1189
1189
|
" day",
|
|
1190
|
-
|
|
1190
|
+
L.duration !== 1 ? "s" : ""
|
|
1191
1191
|
]
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
case "predecessors": {
|
|
1195
|
-
const D = w.filter((I) => I.target ===
|
|
1195
|
+
const D = w.filter((I) => I.target === L.id)[0];
|
|
1196
1196
|
return /* @__PURE__ */ t.jsx(
|
|
1197
1197
|
Yr,
|
|
1198
1198
|
{
|
|
1199
|
-
task:
|
|
1199
|
+
task: L,
|
|
1200
1200
|
allTasks: o,
|
|
1201
1201
|
links: w,
|
|
1202
|
-
onAddDependency: (I, Z, re, B) =>
|
|
1202
|
+
onAddDependency: (I, Z, re, B) => g?.(I, Z, re, B),
|
|
1203
1203
|
onRemoveDependency: (I) => p?.(I),
|
|
1204
|
-
onTaskUpdate:
|
|
1205
|
-
styleConfig:
|
|
1204
|
+
onTaskUpdate: f,
|
|
1205
|
+
styleConfig: j,
|
|
1206
1206
|
children: /* @__PURE__ */ t.jsx(
|
|
1207
1207
|
"div",
|
|
1208
1208
|
{
|
|
@@ -1258,7 +1258,7 @@ const et = (e) => e ? {
|
|
|
1258
1258
|
size: "small",
|
|
1259
1259
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: zt, style: { fontSize: 12 } }),
|
|
1260
1260
|
onClick: (H) => {
|
|
1261
|
-
H.stopPropagation(),
|
|
1261
|
+
H.stopPropagation(), i?.(L.id);
|
|
1262
1262
|
},
|
|
1263
1263
|
title: "Add Subtask",
|
|
1264
1264
|
style: {
|
|
@@ -1279,46 +1279,46 @@ const et = (e) => e ? {
|
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
1281
|
className: "gantt-progress-bar-fill",
|
|
1282
|
-
style: { width: `${
|
|
1282
|
+
style: { width: `${L.progress}%` }
|
|
1283
1283
|
}
|
|
1284
1284
|
) }),
|
|
1285
1285
|
/* @__PURE__ */ t.jsxs("span", { className: "gantt-progress-text", children: [
|
|
1286
|
-
|
|
1286
|
+
L.progress,
|
|
1287
1287
|
"%"
|
|
1288
1288
|
] })
|
|
1289
1289
|
] });
|
|
1290
1290
|
case "index":
|
|
1291
|
-
return /* @__PURE__ */ t.jsx("span", { style: { color: "#8c8c8c" }, children: o.indexOf(
|
|
1291
|
+
return /* @__PURE__ */ t.jsx("span", { style: { color: "#8c8c8c" }, children: o.indexOf(L) + 1 });
|
|
1292
1292
|
default:
|
|
1293
|
-
return
|
|
1293
|
+
return L[q.name] || "";
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid", ref:
|
|
1297
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%" }, children: a.map((
|
|
1296
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid", ref: N, children: [
|
|
1297
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%" }, children: a.map((L) => /* @__PURE__ */ t.jsx(
|
|
1298
1298
|
"div",
|
|
1299
1299
|
{
|
|
1300
1300
|
className: "gantt-grid-header-cell",
|
|
1301
1301
|
style: {
|
|
1302
|
-
width:
|
|
1303
|
-
minWidth:
|
|
1302
|
+
width: L.width,
|
|
1303
|
+
minWidth: L.width,
|
|
1304
1304
|
/* Ensure column maintains width */
|
|
1305
|
-
justifyContent:
|
|
1305
|
+
justifyContent: L.align === "center" ? "center" : "flex-start"
|
|
1306
1306
|
},
|
|
1307
|
-
children:
|
|
1308
|
-
|
|
1309
|
-
|
|
1307
|
+
children: L.name === "add" ? /* @__PURE__ */ t.jsx("span", { style: { fontSize: 11, color: "#64748b", fontWeight: 600, whiteSpace: "nowrap" }, children: "Add" }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1308
|
+
L.label,
|
|
1309
|
+
L.name === "start" && /* @__PURE__ */ t.jsx(fe, { icon: Bt, style: { marginLeft: 8, fontSize: 10, color: "#64748b" } })
|
|
1310
1310
|
] })
|
|
1311
1311
|
},
|
|
1312
|
-
|
|
1312
|
+
L.name
|
|
1313
1313
|
)) }),
|
|
1314
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-body", children: e.map((
|
|
1315
|
-
const q =
|
|
1314
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-body", children: e.map((L) => {
|
|
1315
|
+
const q = x?.id === L.id, H = x?.descendantIds.includes(L.id);
|
|
1316
1316
|
return /* @__PURE__ */ t.jsxs(
|
|
1317
1317
|
"div",
|
|
1318
1318
|
{
|
|
1319
|
-
className: `gantt-grid-row ${
|
|
1320
|
-
onClick: () => r(
|
|
1321
|
-
onContextMenu: (D) => h?.(D,
|
|
1319
|
+
className: `gantt-grid-row ${s === L.id ? "selected" : ""} ${q ? "dragging-row" : ""} ${H ? "descendant-dragging-row" : ""} ${E?.taskId === L.id ? `drop-target-${E.position}` : ""}`,
|
|
1320
|
+
onClick: () => r(L.id),
|
|
1321
|
+
onContextMenu: (D) => h?.(D, L.id),
|
|
1322
1322
|
style: {
|
|
1323
1323
|
display: "flex",
|
|
1324
1324
|
minWidth: "100%"
|
|
@@ -1344,15 +1344,15 @@ const et = (e) => e ? {
|
|
|
1344
1344
|
opacity: 1
|
|
1345
1345
|
/* Ensure column is not transparent */
|
|
1346
1346
|
},
|
|
1347
|
-
children: Q(
|
|
1347
|
+
children: Q(L, D)
|
|
1348
1348
|
},
|
|
1349
|
-
`${
|
|
1349
|
+
`${L.id}-${D.name}`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
|
|
1352
|
+
E?.taskId === L.id && /* @__PURE__ */ t.jsx("div", { className: `gantt-drop-indicator ${E.position}` })
|
|
1353
1353
|
]
|
|
1354
1354
|
},
|
|
1355
|
-
|
|
1355
|
+
L.id
|
|
1356
1356
|
);
|
|
1357
1357
|
}) })
|
|
1358
1358
|
] });
|
|
@@ -1363,39 +1363,39 @@ const Ir = ({
|
|
|
1363
1363
|
task: e,
|
|
1364
1364
|
position: o,
|
|
1365
1365
|
selected: a,
|
|
1366
|
-
dragging:
|
|
1366
|
+
dragging: s,
|
|
1367
1367
|
onClick: r,
|
|
1368
1368
|
onDragStart: h,
|
|
1369
|
-
dragDeltaX:
|
|
1369
|
+
dragDeltaX: f = 0,
|
|
1370
1370
|
dragType: l = null,
|
|
1371
|
-
readonly:
|
|
1372
|
-
baseline:
|
|
1371
|
+
readonly: i = !1,
|
|
1372
|
+
baseline: g,
|
|
1373
1373
|
dependencyRuleDescriptions: p = [],
|
|
1374
1374
|
tooltipConfig: w
|
|
1375
1375
|
}) => {
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
},
|
|
1376
|
+
const E = (P, c) => {
|
|
1377
|
+
i || (P.preventDefault(), P.stopPropagation(), h(P.clientX, P.clientY, c));
|
|
1378
|
+
}, x = () => {
|
|
1379
1379
|
const P = ["gantt-task-bar"];
|
|
1380
|
-
if (e.type === "milestone" && P.push("milestone"), e.type === "project" && P.push("project"), a && P.push("selected"),
|
|
1380
|
+
if (e.type === "milestone" && P.push("milestone"), e.type === "project" && P.push("project"), a && P.push("selected"), s && P.push("dragging"), e.status) {
|
|
1381
1381
|
const c = String(e.status).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
1382
1382
|
c && P.push(`status-${c}`);
|
|
1383
1383
|
}
|
|
1384
1384
|
return P.join(" ");
|
|
1385
|
-
},
|
|
1385
|
+
}, j = () => {
|
|
1386
1386
|
let P = o.left, c = o.width;
|
|
1387
|
-
return
|
|
1387
|
+
return s && l && (l === "move" ? P += f : l === "resize-left" ? (P += f, c -= f) : l === "resize-right" && (c += f)), {
|
|
1388
1388
|
left: `${P}px`,
|
|
1389
1389
|
width: `${Math.max(c, 0)}px`,
|
|
1390
1390
|
// Color handled by CSS classes (.project, .milestone) or task.color override
|
|
1391
1391
|
backgroundColor: e.color || void 0
|
|
1392
1392
|
};
|
|
1393
|
-
},
|
|
1394
|
-
!
|
|
1393
|
+
}, v = (P = !1) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1394
|
+
!i && !P && /* @__PURE__ */ t.jsx(
|
|
1395
1395
|
"div",
|
|
1396
1396
|
{
|
|
1397
1397
|
className: "gantt-task-resize-handle gantt-task-resize-left",
|
|
1398
|
-
onMouseDown: (c) =>
|
|
1398
|
+
onMouseDown: (c) => E(c, "resize-left")
|
|
1399
1399
|
}
|
|
1400
1400
|
),
|
|
1401
1401
|
!P && e.type !== "milestone" && /* @__PURE__ */ t.jsx(
|
|
@@ -1410,14 +1410,14 @@ const Ir = ({
|
|
|
1410
1410
|
}
|
|
1411
1411
|
),
|
|
1412
1412
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-task-content", children: !P && /* @__PURE__ */ t.jsx("span", { className: "gantt-task-text", children: e.text }) }),
|
|
1413
|
-
!
|
|
1413
|
+
!i && !P && /* @__PURE__ */ t.jsx(
|
|
1414
1414
|
"div",
|
|
1415
1415
|
{
|
|
1416
1416
|
className: "gantt-task-resize-handle gantt-task-resize-right",
|
|
1417
|
-
onMouseDown: (c) =>
|
|
1417
|
+
onMouseDown: (c) => E(c, "resize-right")
|
|
1418
1418
|
}
|
|
1419
1419
|
)
|
|
1420
|
-
] }),
|
|
1420
|
+
] }), N = (P, c) => {
|
|
1421
1421
|
if (P instanceof Date)
|
|
1422
1422
|
return Number.isNaN(P.getTime()) ? c : P;
|
|
1423
1423
|
if (typeof P == "string" || typeof P == "number") {
|
|
@@ -1434,49 +1434,49 @@ const Ir = ({
|
|
|
1434
1434
|
const c = P.split(/\r?\n|\|/).map((b) => b.trim()).filter(Boolean);
|
|
1435
1435
|
return c.length > 0 ? c : void 0;
|
|
1436
1436
|
}
|
|
1437
|
-
},
|
|
1438
|
-
|
|
1437
|
+
}, m = e.tooltipConfig ? { ...w, ...e.tooltipConfig } : w, O = m?.dateFormat || "MMM D, YYYY", J = m?.taskNameAccessor?.(e) ?? e.text, R = String(J ?? "").trim() || `Task ${e.id}`, V = m?.taskNameFormatter ? m.taskNameFormatter(R, e) : R, Q = N(
|
|
1438
|
+
m?.plannedStartAccessor?.(e) ?? e.plannedStart ?? g?.start ?? e.start,
|
|
1439
1439
|
e.start
|
|
1440
|
-
),
|
|
1441
|
-
|
|
1440
|
+
), L = N(
|
|
1441
|
+
m?.plannedEndAccessor?.(e) ?? e.plannedEnd ?? g?.end ?? e.end,
|
|
1442
1442
|
e.end
|
|
1443
|
-
), q =
|
|
1444
|
-
|
|
1443
|
+
), q = m?.plannedDatesFormatter ? m.plannedDatesFormatter(Q, L, e) : `${we(Q, O)} - ${we(L, O)}`, H = N(
|
|
1444
|
+
m?.actualStartAccessor?.(e) ?? e.actualStart ?? e.start,
|
|
1445
1445
|
e.start
|
|
1446
|
-
), D =
|
|
1447
|
-
|
|
1446
|
+
), D = N(
|
|
1447
|
+
m?.actualEndAccessor?.(e) ?? e.actualEnd ?? e.end,
|
|
1448
1448
|
e.end
|
|
1449
|
-
), I =
|
|
1450
|
-
|
|
1451
|
-
) || de, te = ge.length > 0 ? ge.map((P) =>
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1449
|
+
), I = m?.actualDatesFormatter ? m.actualDatesFormatter(H, D, e) : `${we(H, O)} - ${we(D, O)}`, Z = m?.statusAccessor?.(e) ?? e.status, re = Z != null ? String(Z) : "", B = m?.statusFormatter ? m.statusFormatter(re, e) : re ? re.replace(/-/g, " ") : m?.emptyStatusText || "Not set", ue = m?.ownerAccessor?.(e) ?? e.owner, se = ue != null ? String(ue).trim() : "", _ = se ? m?.ownerFormatter ? m.ownerFormatter(se, e) : se : m?.emptyOwnerText || "", de = p.length > 0 ? p : e.dependencyRule || [], ge = S(
|
|
1450
|
+
m?.dependencyRuleAccessor?.(e, de)
|
|
1451
|
+
) || de, te = ge.length > 0 ? ge.map((P) => m?.dependencyRuleFormatter ? m.dependencyRuleFormatter(P, e) : P).join(m?.dependencySeparator || " | ") : m?.emptyDependencyRuleText || "No dependency rule", ce = m?.progressAccessor?.(e) ?? e.progress, K = typeof ce == "number" ? ce : Number(ce), Se = Number.isFinite(K) ? K : e.progress, ne = m?.progressFormatter ? m.progressFormatter(Se, e) : `${Se}%`, je = /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip", children: [
|
|
1452
|
+
m?.showTaskName !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-tooltip-title", children: V }),
|
|
1453
|
+
m?.showPlannedDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1454
|
+
m?.plannedLabel || "Planned",
|
|
1455
1455
|
": ",
|
|
1456
1456
|
q
|
|
1457
1457
|
] }),
|
|
1458
|
-
|
|
1459
|
-
|
|
1458
|
+
m?.showActualDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1459
|
+
m?.actualLabel || "Actual",
|
|
1460
1460
|
": ",
|
|
1461
1461
|
I
|
|
1462
1462
|
] }),
|
|
1463
|
-
|
|
1464
|
-
|
|
1463
|
+
m?.showStatus !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-progress", children: [
|
|
1464
|
+
m?.statusLabel || "Status",
|
|
1465
1465
|
": ",
|
|
1466
1466
|
B
|
|
1467
1467
|
] }),
|
|
1468
|
-
|
|
1469
|
-
|
|
1468
|
+
m?.showOwner !== !1 && _ && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-owner", children: [
|
|
1469
|
+
m?.ownerLabel || "Owner",
|
|
1470
1470
|
": ",
|
|
1471
1471
|
_
|
|
1472
1472
|
] }),
|
|
1473
|
-
|
|
1474
|
-
|
|
1473
|
+
m?.showDependencyRule !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-owner", children: [
|
|
1474
|
+
m?.dependencyRuleLabel || "Dependency Rule",
|
|
1475
1475
|
": ",
|
|
1476
1476
|
te
|
|
1477
1477
|
] }),
|
|
1478
|
-
|
|
1479
|
-
|
|
1478
|
+
m?.showProgress !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-progress", children: [
|
|
1479
|
+
m?.progressLabel || "Progress",
|
|
1480
1480
|
": ",
|
|
1481
1481
|
ne
|
|
1482
1482
|
] })
|
|
@@ -1484,7 +1484,7 @@ const Ir = ({
|
|
|
1484
1484
|
if (e.segments && e.segments.length > 0 || e.onHoldPeriods && e.onHoldPeriods.length > 0) {
|
|
1485
1485
|
const P = e.end.getTime() - e.start.getTime(), c = e.segments && e.segments.length > 0 ? e.segments : [{ start: e.start, end: e.end, duration: e.duration || 0 }];
|
|
1486
1486
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-task-group", children: [
|
|
1487
|
-
P > 0 && e.onHoldPeriods?.map((b,
|
|
1487
|
+
P > 0 && e.onHoldPeriods?.map((b, $) => {
|
|
1488
1488
|
const F = Math.max(b.start.getTime(), e.start.getTime()), ae = Math.min(b.end.getTime(), e.end.getTime()) - F;
|
|
1489
1489
|
if (ae <= 0) return null;
|
|
1490
1490
|
const U = o.left + (F - e.start.getTime()) / P * o.width, ie = ae / P * o.width;
|
|
@@ -1497,56 +1497,56 @@ const Ir = ({
|
|
|
1497
1497
|
width: `${ie}px`
|
|
1498
1498
|
}
|
|
1499
1499
|
},
|
|
1500
|
-
`hold-${
|
|
1500
|
+
`hold-${$}`
|
|
1501
1501
|
);
|
|
1502
1502
|
}),
|
|
1503
|
-
c.map((b,
|
|
1503
|
+
c.map((b, $) => /* @__PURE__ */ t.jsx(Ce, { title: je, mouseEnterDelay: 0.5, children: /* @__PURE__ */ t.jsx(
|
|
1504
1504
|
"div",
|
|
1505
1505
|
{
|
|
1506
|
-
className:
|
|
1506
|
+
className: x() + " segment",
|
|
1507
1507
|
style: {
|
|
1508
1508
|
left: `${P > 0 ? o.left + (b.start.getTime() - e.start.getTime()) / P * o.width : o.left}px`,
|
|
1509
1509
|
width: `${P > 0 ? (b.end.getTime() - b.start.getTime()) / P * o.width : o.width}px`,
|
|
1510
1510
|
backgroundColor: e.color || void 0
|
|
1511
1511
|
},
|
|
1512
1512
|
onClick: r,
|
|
1513
|
-
onMouseDown: (F) =>
|
|
1514
|
-
children:
|
|
1513
|
+
onMouseDown: (F) => E(F, "move"),
|
|
1514
|
+
children: v($ > 0)
|
|
1515
1515
|
}
|
|
1516
|
-
) }, `seg-${
|
|
1516
|
+
) }, `seg-${$}`))
|
|
1517
1517
|
] });
|
|
1518
1518
|
}
|
|
1519
1519
|
return /* @__PURE__ */ t.jsx(Ce, { title: je, mouseEnterDelay: 0.5, children: /* @__PURE__ */ t.jsx(
|
|
1520
1520
|
"div",
|
|
1521
1521
|
{
|
|
1522
|
-
className:
|
|
1523
|
-
style:
|
|
1522
|
+
className: x(),
|
|
1523
|
+
style: j(),
|
|
1524
1524
|
onClick: r,
|
|
1525
|
-
onMouseDown: (P) =>
|
|
1526
|
-
children:
|
|
1525
|
+
onMouseDown: (P) => E(P, "move"),
|
|
1526
|
+
children: v()
|
|
1527
1527
|
}
|
|
1528
1528
|
) });
|
|
1529
1529
|
}, Br = ({ links: e, tasks: o, getTaskPosition: a }) => {
|
|
1530
|
-
const
|
|
1530
|
+
const s = G.useMemo(() => {
|
|
1531
1531
|
const l = /* @__PURE__ */ new Map();
|
|
1532
|
-
return o.forEach((
|
|
1533
|
-
}, [o]), r = (l) =>
|
|
1534
|
-
let l = 0,
|
|
1535
|
-
return o.forEach((
|
|
1532
|
+
return o.forEach((i) => l.set(i.id, i)), l;
|
|
1533
|
+
}, [o]), r = (l) => s.get(l), h = G.useMemo(() => {
|
|
1534
|
+
let l = 0, i = 0;
|
|
1535
|
+
return o.forEach((g) => {
|
|
1536
1536
|
try {
|
|
1537
|
-
const p = a(
|
|
1538
|
-
p && typeof p.left == "number" && typeof p.width == "number" && (l = Math.max(l, p.left + p.width)), p && typeof p.top == "number" && typeof p.height == "number" && (
|
|
1537
|
+
const p = a(g);
|
|
1538
|
+
p && typeof p.left == "number" && typeof p.width == "number" && (l = Math.max(l, p.left + p.width)), p && typeof p.top == "number" && typeof p.height == "number" && (i = Math.max(i, p.top + p.height));
|
|
1539
1539
|
} catch (p) {
|
|
1540
|
-
console.warn("Failed to position task for link rendering:",
|
|
1540
|
+
console.warn("Failed to position task for link rendering:", g.id, p);
|
|
1541
1541
|
}
|
|
1542
1542
|
}), {
|
|
1543
1543
|
width: Math.max(l, 1e3),
|
|
1544
|
-
height: Math.max(
|
|
1544
|
+
height: Math.max(i, 100)
|
|
1545
1545
|
};
|
|
1546
|
-
}, [o, a]),
|
|
1547
|
-
const
|
|
1548
|
-
if (!
|
|
1549
|
-
const p = a(
|
|
1546
|
+
}, [o, a]), f = (l) => {
|
|
1547
|
+
const i = r(l.source), g = r(l.target);
|
|
1548
|
+
if (!i || !g) return { path: "", arrow: "" };
|
|
1549
|
+
const p = a(i), w = a(g), E = p.top + p.height / 2, x = w.top + w.height / 2, j = {
|
|
1550
1550
|
sourceStub: 14,
|
|
1551
1551
|
targetStub: 8,
|
|
1552
1552
|
detourPadding: 24,
|
|
@@ -1557,50 +1557,50 @@ const Ir = ({
|
|
|
1557
1557
|
arrowStemOverlap: 1,
|
|
1558
1558
|
chevronNotchDepth: 5
|
|
1559
1559
|
};
|
|
1560
|
-
let
|
|
1560
|
+
let v = 0, N = 0, S = 1, m = 1;
|
|
1561
1561
|
switch (l.type) {
|
|
1562
1562
|
case "e2s":
|
|
1563
|
-
|
|
1563
|
+
v = p.left + p.width, N = w.left, S = 1, m = 1;
|
|
1564
1564
|
break;
|
|
1565
1565
|
case "s2s":
|
|
1566
|
-
|
|
1566
|
+
v = p.left, N = w.left, S = -1, m = 1;
|
|
1567
1567
|
break;
|
|
1568
1568
|
case "e2e":
|
|
1569
|
-
|
|
1569
|
+
v = p.left + p.width, N = w.left + w.width, S = 1, m = -1;
|
|
1570
1570
|
break;
|
|
1571
1571
|
case "s2e":
|
|
1572
|
-
|
|
1572
|
+
v = p.left, N = w.left + w.width, S = -1, m = -1;
|
|
1573
1573
|
break;
|
|
1574
1574
|
}
|
|
1575
|
-
const O =
|
|
1575
|
+
const O = v + S * j.sourceStub, J = N - m * j.arrowGap, R = J - m * j.arrowLength, V = R + m * j.chevronNotchDepth, Q = V - m * j.targetStub, L = V + m * j.arrowStemOverlap, q = Math.abs(x - E) > 1;
|
|
1576
1576
|
let H;
|
|
1577
1577
|
if (q) {
|
|
1578
|
-
const ue =
|
|
1578
|
+
const ue = x > E;
|
|
1579
1579
|
let se = ue ? Math.min(p.top + p.height + 6, w.top - 6) : Math.max(p.top - 6, w.top + w.height + 6);
|
|
1580
|
-
Math.abs(se -
|
|
1581
|
-
{ x:
|
|
1582
|
-
{ x: O, y:
|
|
1580
|
+
Math.abs(se - E) < 2 && (se = E + (ue ? 2 : -2)), Math.abs(se - x) < 2 && (se = x + (ue ? -2 : 2)), H = [
|
|
1581
|
+
{ x: v, y: E },
|
|
1582
|
+
{ x: O, y: E },
|
|
1583
1583
|
{ x: O, y: se },
|
|
1584
1584
|
{ x: Q, y: se },
|
|
1585
|
-
{ x: Q, y:
|
|
1586
|
-
{ x:
|
|
1585
|
+
{ x: Q, y: x },
|
|
1586
|
+
{ x: L, y: x }
|
|
1587
1587
|
];
|
|
1588
1588
|
} else {
|
|
1589
1589
|
let B;
|
|
1590
|
-
S ===
|
|
1591
|
-
{ x:
|
|
1592
|
-
{ x: O, y:
|
|
1593
|
-
{ x: B, y:
|
|
1594
|
-
{ x: B, y:
|
|
1595
|
-
{ x: Q, y:
|
|
1596
|
-
{ x:
|
|
1590
|
+
S === m && (S === 1 ? Q - O >= j.minHorizontalSpan : O - Q >= j.minHorizontalSpan) ? B = (O + Q) / 2 : B = S === 1 ? Math.max(v, N) + j.detourPadding : Math.min(v, N) - j.detourPadding, H = [
|
|
1591
|
+
{ x: v, y: E },
|
|
1592
|
+
{ x: O, y: E },
|
|
1593
|
+
{ x: B, y: E },
|
|
1594
|
+
{ x: B, y: x },
|
|
1595
|
+
{ x: Q, y: x },
|
|
1596
|
+
{ x: L, y: x }
|
|
1597
1597
|
];
|
|
1598
1598
|
}
|
|
1599
1599
|
const D = H.filter((B, ue) => {
|
|
1600
1600
|
if (ue === 0) return !0;
|
|
1601
1601
|
const se = H[ue - 1];
|
|
1602
1602
|
return Math.abs(B.x - se.x) > 0.5 || Math.abs(B.y - se.y) > 0.5;
|
|
1603
|
-
}), I = D.length > 0 ? D.map((B, ue) => `${ue === 0 ? "M" : "L"} ${B.x},${B.y}`).join(" ") : "", Z =
|
|
1603
|
+
}), I = D.length > 0 ? D.map((B, ue) => `${ue === 0 ? "M" : "L"} ${B.x},${B.y}`).join(" ") : "", Z = j.arrowWidth / 2, re = `M ${R},${x - Z} L ${J},${x} L ${R},${x + Z} L ${V},${x} Z`;
|
|
1604
1604
|
return { path: I, arrow: re };
|
|
1605
1605
|
};
|
|
1606
1606
|
return e.length === 0 ? null : /* @__PURE__ */ t.jsx(
|
|
@@ -1617,10 +1617,10 @@ const Ir = ({
|
|
|
1617
1617
|
pointerEvents: "none"
|
|
1618
1618
|
},
|
|
1619
1619
|
children: e.map((l) => {
|
|
1620
|
-
const
|
|
1621
|
-
if (!
|
|
1622
|
-
const p =
|
|
1623
|
-
return !w || !
|
|
1620
|
+
const i = r(l.source), g = r(l.target);
|
|
1621
|
+
if (!i || !g) return null;
|
|
1622
|
+
const p = f(l), w = p.path, E = p.arrow;
|
|
1623
|
+
return !w || !E ? null : /* @__PURE__ */ t.jsxs("g", { className: "gantt-link", children: [
|
|
1624
1624
|
/* @__PURE__ */ t.jsx(
|
|
1625
1625
|
"path",
|
|
1626
1626
|
{
|
|
@@ -1633,7 +1633,7 @@ const Ir = ({
|
|
|
1633
1633
|
/* @__PURE__ */ t.jsx(
|
|
1634
1634
|
"path",
|
|
1635
1635
|
{
|
|
1636
|
-
d:
|
|
1636
|
+
d: E,
|
|
1637
1637
|
className: "gantt-link-arrow"
|
|
1638
1638
|
}
|
|
1639
1639
|
)
|
|
@@ -1641,8 +1641,8 @@ const Ir = ({
|
|
|
1641
1641
|
})
|
|
1642
1642
|
}
|
|
1643
1643
|
);
|
|
1644
|
-
}, Wr = (e, o, a = 60,
|
|
1645
|
-
const [h,
|
|
1644
|
+
}, Wr = (e, o, a = 60, s = "day", r = 1) => {
|
|
1645
|
+
const [h, f] = X({
|
|
1646
1646
|
taskId: null,
|
|
1647
1647
|
initialX: 0,
|
|
1648
1648
|
initialY: 0,
|
|
@@ -1651,63 +1651,63 @@ const Ir = ({
|
|
|
1651
1651
|
type: null,
|
|
1652
1652
|
dragDeltaX: 0,
|
|
1653
1653
|
dragDeltaY: 0
|
|
1654
|
-
}), l = Re((p, w,
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1654
|
+
}), l = Re((p, w, E, x) => {
|
|
1655
|
+
const j = e.find((v) => v.id === p);
|
|
1656
|
+
j && f({
|
|
1657
1657
|
taskId: p,
|
|
1658
1658
|
initialX: w,
|
|
1659
|
-
initialY:
|
|
1660
|
-
initialStart: new Date(
|
|
1661
|
-
initialEnd: new Date(
|
|
1662
|
-
type:
|
|
1659
|
+
initialY: E,
|
|
1660
|
+
initialStart: new Date(j.start),
|
|
1661
|
+
initialEnd: new Date(j.end),
|
|
1662
|
+
type: x,
|
|
1663
1663
|
dragDeltaX: 0,
|
|
1664
1664
|
dragDeltaY: 0
|
|
1665
1665
|
});
|
|
1666
|
-
}, [e]),
|
|
1666
|
+
}, [e]), i = Re((p, w) => {
|
|
1667
1667
|
if (!h.taskId || !h.type) return null;
|
|
1668
|
-
const
|
|
1669
|
-
if (
|
|
1668
|
+
const E = p - h.initialX, x = w - h.initialY;
|
|
1669
|
+
if (f((O) => ({
|
|
1670
1670
|
...O,
|
|
1671
|
-
dragDeltaX:
|
|
1672
|
-
dragDeltaY:
|
|
1671
|
+
dragDeltaX: E,
|
|
1672
|
+
dragDeltaY: x
|
|
1673
1673
|
})), h.type === "reorder") return null;
|
|
1674
|
-
const
|
|
1675
|
-
if (!
|
|
1676
|
-
const
|
|
1677
|
-
let
|
|
1674
|
+
const j = e.find((O) => O.id === h.taskId);
|
|
1675
|
+
if (!j) return null;
|
|
1676
|
+
const v = Math.round(E / a);
|
|
1677
|
+
let N = new Date(h.initialStart), S = new Date(h.initialEnd);
|
|
1678
1678
|
switch (h.type) {
|
|
1679
1679
|
case "move":
|
|
1680
|
-
|
|
1680
|
+
N = ye(h.initialStart, v * r, s), S = ye(h.initialEnd, v * r, s);
|
|
1681
1681
|
break;
|
|
1682
1682
|
case "resize-left":
|
|
1683
|
-
|
|
1683
|
+
N = ye(h.initialStart, v * r, s), N >= S && (N = ye(S, -r, s));
|
|
1684
1684
|
break;
|
|
1685
1685
|
case "resize-right":
|
|
1686
|
-
S = ye(h.initialEnd,
|
|
1686
|
+
S = ye(h.initialEnd, v * r, s), S <= N && (S = ye(N, r, s));
|
|
1687
1687
|
break;
|
|
1688
1688
|
}
|
|
1689
|
-
const
|
|
1689
|
+
const m = ct(N, S);
|
|
1690
1690
|
return {
|
|
1691
|
-
...
|
|
1692
|
-
start:
|
|
1691
|
+
...j,
|
|
1692
|
+
start: N,
|
|
1693
1693
|
end: S,
|
|
1694
|
-
duration:
|
|
1694
|
+
duration: m
|
|
1695
1695
|
};
|
|
1696
|
-
}, [h, e, a, r,
|
|
1696
|
+
}, [h, e, a, r, s]), g = Re((p) => {
|
|
1697
1697
|
if (p && o) {
|
|
1698
|
-
const { id: w, ...
|
|
1699
|
-
if (
|
|
1700
|
-
const
|
|
1701
|
-
dragType:
|
|
1698
|
+
const { id: w, ...E } = p, x = h.type;
|
|
1699
|
+
if (x && x !== "reorder") {
|
|
1700
|
+
const j = {
|
|
1701
|
+
dragType: x,
|
|
1702
1702
|
previousStart: new Date(h.initialStart),
|
|
1703
1703
|
previousEnd: new Date(h.initialEnd),
|
|
1704
1704
|
previousDuration: ct(h.initialStart, h.initialEnd)
|
|
1705
1705
|
};
|
|
1706
|
-
o(w,
|
|
1706
|
+
o(w, E, j);
|
|
1707
1707
|
} else
|
|
1708
|
-
o(w,
|
|
1708
|
+
o(w, E);
|
|
1709
1709
|
}
|
|
1710
|
-
|
|
1710
|
+
f({
|
|
1711
1711
|
taskId: null,
|
|
1712
1712
|
initialX: 0,
|
|
1713
1713
|
initialY: 0,
|
|
@@ -1721,69 +1721,69 @@ const Ir = ({
|
|
|
1721
1721
|
return {
|
|
1722
1722
|
dragState: h,
|
|
1723
1723
|
handleDragStart: l,
|
|
1724
|
-
handleDrag:
|
|
1725
|
-
handleDragEnd:
|
|
1724
|
+
handleDrag: i,
|
|
1725
|
+
handleDragEnd: g
|
|
1726
1726
|
};
|
|
1727
1727
|
}, nr = At(
|
|
1728
1728
|
({
|
|
1729
1729
|
tasks: e,
|
|
1730
1730
|
links: o,
|
|
1731
1731
|
range: a,
|
|
1732
|
-
scales:
|
|
1732
|
+
scales: s,
|
|
1733
1733
|
config: r,
|
|
1734
1734
|
selectedTask: h,
|
|
1735
|
-
onTaskClick:
|
|
1735
|
+
onTaskClick: f,
|
|
1736
1736
|
onTaskDragStart: l,
|
|
1737
|
-
onTaskDragEnd:
|
|
1738
|
-
onTaskUpdate:
|
|
1737
|
+
onTaskDragEnd: i,
|
|
1738
|
+
onTaskUpdate: g,
|
|
1739
1739
|
zoomLevel: p,
|
|
1740
1740
|
baselines: w,
|
|
1741
|
-
allowBaselineOnlyMode:
|
|
1742
|
-
taskTooltipConfig:
|
|
1743
|
-
},
|
|
1744
|
-
const [
|
|
1741
|
+
allowBaselineOnlyMode: E = !1,
|
|
1742
|
+
taskTooltipConfig: x
|
|
1743
|
+
}, j) => {
|
|
1744
|
+
const [v, N] = X(e), S = (r.columnWidth || 60) * p, m = r.baselines && w && w.size > 0, O = G.useMemo(() => {
|
|
1745
1745
|
const c = /* @__PURE__ */ new Map();
|
|
1746
|
-
return
|
|
1747
|
-
}, [
|
|
1746
|
+
return v.forEach((b) => c.set(b.id, b)), c;
|
|
1747
|
+
}, [v]), J = G.useMemo(() => {
|
|
1748
1748
|
const c = /* @__PURE__ */ new Map(), b = {
|
|
1749
1749
|
e2s: "Finish-to-Start",
|
|
1750
1750
|
s2s: "Start-to-Start",
|
|
1751
1751
|
e2e: "Finish-to-Finish",
|
|
1752
1752
|
s2e: "Start-to-Finish"
|
|
1753
|
-
},
|
|
1753
|
+
}, $ = (F, W) => {
|
|
1754
1754
|
const U = [...c.get(F) || [], ...W.map((ie) => ie.trim()).filter(Boolean)];
|
|
1755
1755
|
U.length > 0 && c.set(F, Array.from(new Set(U)));
|
|
1756
1756
|
};
|
|
1757
|
-
return
|
|
1758
|
-
F.dependencyRule && F.dependencyRule.length > 0 &&
|
|
1757
|
+
return v.forEach((F) => {
|
|
1758
|
+
F.dependencyRule && F.dependencyRule.length > 0 && $(F.id, F.dependencyRule);
|
|
1759
1759
|
}), o.forEach((F) => {
|
|
1760
1760
|
const W = O.get(F.source), ae = O.get(F.target), U = W?.text || `Task ${F.source}`, ie = ae?.text || `Task ${F.target}`, oe = b[F.type], Te = typeof F.lag == "number" && F.lag !== 0 ? ` (${F.lag > 0 ? "+" : ""}${F.lag} ${F.lagUnit || "day"})` : "", De = `${ie} depends on ${U} [${oe}]${Te}`;
|
|
1761
|
-
|
|
1761
|
+
$(F.target, [De]);
|
|
1762
1762
|
}), c;
|
|
1763
|
-
}, [o,
|
|
1764
|
-
|
|
1765
|
-
|
|
1763
|
+
}, [o, v, O]), { dragState: R, handleDragStart: V, handleDrag: Q, handleDragEnd: L } = Wr(
|
|
1764
|
+
v,
|
|
1765
|
+
g,
|
|
1766
1766
|
S,
|
|
1767
|
-
|
|
1768
|
-
|
|
1767
|
+
s[1].unit,
|
|
1768
|
+
s[1].step
|
|
1769
1769
|
);
|
|
1770
1770
|
G.useEffect(() => {
|
|
1771
|
-
(e.length !==
|
|
1772
|
-
const F =
|
|
1771
|
+
(e.length !== v.length || e.some((b, $) => {
|
|
1772
|
+
const F = v[$];
|
|
1773
1773
|
return !F || b.id !== F.id || b.start.getTime() !== F.start.getTime() || b.end.getTime() !== F.end.getTime();
|
|
1774
|
-
})) &&
|
|
1774
|
+
})) && N(e);
|
|
1775
1775
|
}, [e]);
|
|
1776
1776
|
const q = G.useCallback((c) => {
|
|
1777
1777
|
const b = [];
|
|
1778
|
-
let
|
|
1779
|
-
for (;
|
|
1778
|
+
let $ = new Date(a.start);
|
|
1779
|
+
for (; $ <= a.end; )
|
|
1780
1780
|
b.push({
|
|
1781
|
-
date: new Date(
|
|
1782
|
-
label: we(
|
|
1783
|
-
}),
|
|
1781
|
+
date: new Date($),
|
|
1782
|
+
label: we($, c.format || "D")
|
|
1783
|
+
}), $ = ye($, c.step, c.unit);
|
|
1784
1784
|
return b;
|
|
1785
1785
|
}, [a.start, a.end]), H = G.useCallback((c) => {
|
|
1786
|
-
const b =
|
|
1786
|
+
const b = s[1], $ = a.start.getTime(), W = c.getTime() - $, U = {
|
|
1787
1787
|
hour: 36e5,
|
|
1788
1788
|
day: 864e5,
|
|
1789
1789
|
week: 6048e5,
|
|
@@ -1792,23 +1792,23 @@ const Ir = ({
|
|
|
1792
1792
|
year: 31536e6
|
|
1793
1793
|
}[b.unit] || 864e5;
|
|
1794
1794
|
return W / (U * b.step) * S;
|
|
1795
|
-
}, [
|
|
1796
|
-
const b = H(c.start),
|
|
1795
|
+
}, [s, a.start, S]), D = (c) => {
|
|
1796
|
+
const b = H(c.start), $ = H(c.end);
|
|
1797
1797
|
return {
|
|
1798
1798
|
left: b,
|
|
1799
|
-
width: Math.max(
|
|
1799
|
+
width: Math.max($ - b, 0)
|
|
1800
1800
|
};
|
|
1801
1801
|
}, I = (c) => {
|
|
1802
|
-
const b = H(c.start),
|
|
1802
|
+
const b = H(c.start), $ = H(c.end);
|
|
1803
1803
|
return {
|
|
1804
1804
|
left: b,
|
|
1805
|
-
width: Math.max(
|
|
1805
|
+
width: Math.max($ - b, 0)
|
|
1806
1806
|
};
|
|
1807
1807
|
}, Z = G.useCallback((c) => {
|
|
1808
|
-
const b = D(c),
|
|
1808
|
+
const b = D(c), $ = v.findIndex((U) => U.id === c.id);
|
|
1809
1809
|
let F = r.rowHeight || 48;
|
|
1810
|
-
if (
|
|
1811
|
-
const U = getComputedStyle(
|
|
1810
|
+
if (j && typeof j == "object" && j.current) {
|
|
1811
|
+
const U = getComputedStyle(j.current).getPropertyValue("--gantt-row-height");
|
|
1812
1812
|
if (U) {
|
|
1813
1813
|
const ie = parseFloat(U);
|
|
1814
1814
|
!isNaN(ie) && ie > 0 && (F = ie);
|
|
@@ -1818,35 +1818,35 @@ const Ir = ({
|
|
|
1818
1818
|
return {
|
|
1819
1819
|
left: b.left,
|
|
1820
1820
|
width: b.width,
|
|
1821
|
-
top:
|
|
1821
|
+
top: $ * F + ae,
|
|
1822
1822
|
height: W
|
|
1823
1823
|
};
|
|
1824
|
-
}, [D,
|
|
1824
|
+
}, [D, v, r.rowHeight, r.taskHeight, j]), re = G.useRef(null), B = Re((c) => {
|
|
1825
1825
|
R.taskId && R.type && (re.current && cancelAnimationFrame(re.current), re.current = requestAnimationFrame(() => {
|
|
1826
1826
|
const b = Q(c.clientX, c.clientY);
|
|
1827
|
-
b &&
|
|
1828
|
-
(
|
|
1827
|
+
b && N(
|
|
1828
|
+
($) => $.map((F) => F.id === b.id ? b : F)
|
|
1829
1829
|
);
|
|
1830
1830
|
}));
|
|
1831
1831
|
}, [R, Q]), ue = Re(() => {
|
|
1832
1832
|
if (R.taskId) {
|
|
1833
|
-
const c =
|
|
1834
|
-
|
|
1833
|
+
const c = v.find((b) => b.id === R.taskId);
|
|
1834
|
+
L(c || null), i();
|
|
1835
1835
|
}
|
|
1836
|
-
}, [R,
|
|
1836
|
+
}, [R, v, L, i]), se = s[1], _ = G.useMemo(() => q(se), [q, se]), de = E && v.length === 0 && m, pe = G.useCallback(() => {
|
|
1837
1837
|
const c = [];
|
|
1838
|
-
let b = -1,
|
|
1838
|
+
let b = -1, $ = -1, F = 0, W = "";
|
|
1839
1839
|
return _.forEach((ae) => {
|
|
1840
1840
|
const U = ae.date.getMonth(), ie = ae.date.getFullYear(), oe = we(ae.date, "MMM YYYY");
|
|
1841
|
-
U !== b || ie !==
|
|
1841
|
+
U !== b || ie !== $ ? (b !== -1 && c.push({ label: W, width: F }), b = U, $ = ie, F = S, W = oe) : F += S;
|
|
1842
1842
|
}), b !== -1 && c.push({ label: W, width: F }), c;
|
|
1843
1843
|
}, [_, S]), ge = G.useCallback(() => {
|
|
1844
1844
|
const c = [];
|
|
1845
|
-
let b = -1,
|
|
1845
|
+
let b = -1, $ = 0, F = -1, W = -1, ae = "";
|
|
1846
1846
|
return _.forEach((U) => {
|
|
1847
1847
|
const oe = U.date.getDate() <= 15 ? 0 : 1, Te = U.date.getMonth(), De = U.date.getFullYear(), Ue = we(U.date, "MMM"), Ae = new Date(De, Te + 1, 0).getDate(), Pe = oe === 0 ? `${Ue} 1 - 15` : `${Ue} 16 - ${Ae}`;
|
|
1848
|
-
oe !== b || Te !== F || De !== W ? (b !== -1 && c.push({ label: ae, width:
|
|
1849
|
-
}), b !== -1 && c.push({ label: ae, width:
|
|
1848
|
+
oe !== b || Te !== F || De !== W ? (b !== -1 && c.push({ label: ae, width: $ }), b = oe, F = Te, W = De, $ = S, ae = Pe) : $ += S;
|
|
1849
|
+
}), b !== -1 && c.push({ label: ae, width: $ }), c;
|
|
1850
1850
|
}, [_, S]), te = G.useMemo(() => pe(), [pe]), ce = G.useMemo(() => ge(), [ge]), K = G.useMemo(() => _.length * S, [_.length, S]), Se = G.useMemo(() => {
|
|
1851
1851
|
const c = /* @__PURE__ */ new Date();
|
|
1852
1852
|
return c.setHours(0, 0, 0, 0), c;
|
|
@@ -1871,7 +1871,7 @@ const Ir = ({
|
|
|
1871
1871
|
"div",
|
|
1872
1872
|
{
|
|
1873
1873
|
className: "gantt-timeline-container",
|
|
1874
|
-
ref:
|
|
1874
|
+
ref: j,
|
|
1875
1875
|
onMouseMove: B,
|
|
1876
1876
|
onMouseUp: ue,
|
|
1877
1877
|
style: { width: K, position: "relative" },
|
|
@@ -1960,11 +1960,11 @@ const Ir = ({
|
|
|
1960
1960
|
`mid-${b}`
|
|
1961
1961
|
)) }),
|
|
1962
1962
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: K }, children: _.map((c, b) => {
|
|
1963
|
-
const
|
|
1963
|
+
const $ = r.weekends && Xt(c.date), F = r.holidays && Ut(c.date, r.holidays);
|
|
1964
1964
|
return /* @__PURE__ */ t.jsx(
|
|
1965
1965
|
"div",
|
|
1966
1966
|
{
|
|
1967
|
-
className: `gantt-timeline-cell ${
|
|
1967
|
+
className: `gantt-timeline-cell ${$ ? "weekend" : ""} ${F ? "holiday" : ""}`,
|
|
1968
1968
|
style: {
|
|
1969
1969
|
width: S,
|
|
1970
1970
|
minWidth: S,
|
|
@@ -1980,8 +1980,8 @@ const Ir = ({
|
|
|
1980
1980
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-body", style: { width: K, position: "relative" }, children: [
|
|
1981
1981
|
ne !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1982
1982
|
r.showTodayLineMarker !== !1 && (() => {
|
|
1983
|
-
const c = r.todayLineMarkerSize || 8, b = r.todayLineColor || "#ff4d4f",
|
|
1984
|
-
return
|
|
1983
|
+
const c = r.todayLineMarkerSize || 8, b = r.todayLineColor || "#ff4d4f", $ = r.todayLineMarkerStyle || "triangle", F = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
|
|
1984
|
+
return $ === "triangle" ? /* @__PURE__ */ t.jsx(
|
|
1985
1985
|
"div",
|
|
1986
1986
|
{
|
|
1987
1987
|
className: "gantt-today-line-marker",
|
|
@@ -2000,7 +2000,7 @@ const Ir = ({
|
|
|
2000
2000
|
opacity: F
|
|
2001
2001
|
}
|
|
2002
2002
|
}
|
|
2003
|
-
) :
|
|
2003
|
+
) : $ === "arrow" ? /* @__PURE__ */ t.jsx(
|
|
2004
2004
|
"div",
|
|
2005
2005
|
{
|
|
2006
2006
|
className: "gantt-today-line-marker",
|
|
@@ -2019,7 +2019,7 @@ const Ir = ({
|
|
|
2019
2019
|
opacity: F
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
2022
|
-
) :
|
|
2022
|
+
) : $ === "dot" ? /* @__PURE__ */ t.jsx(
|
|
2023
2023
|
"div",
|
|
2024
2024
|
{
|
|
2025
2025
|
className: "gantt-today-line-marker",
|
|
@@ -2062,8 +2062,8 @@ const Ir = ({
|
|
|
2062
2062
|
] }),
|
|
2063
2063
|
P !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2064
2064
|
r.showProjectStartLineMarker !== !1 && (() => {
|
|
2065
|
-
const c = r.projectStartLineMarkerSize || 8, b = r.projectStartLineColor || "#40a9ff",
|
|
2066
|
-
return
|
|
2065
|
+
const c = r.projectStartLineMarkerSize || 8, b = r.projectStartLineColor || "#40a9ff", $ = r.projectStartLineMarkerStyle || "triangle", F = r.projectStartLineOpacity !== void 0 ? r.projectStartLineOpacity : 1;
|
|
2066
|
+
return $ === "triangle" ? /* @__PURE__ */ t.jsx(
|
|
2067
2067
|
"div",
|
|
2068
2068
|
{
|
|
2069
2069
|
className: "gantt-project-start-line-marker",
|
|
@@ -2082,7 +2082,7 @@ const Ir = ({
|
|
|
2082
2082
|
opacity: F
|
|
2083
2083
|
}
|
|
2084
2084
|
}
|
|
2085
|
-
) :
|
|
2085
|
+
) : $ === "arrow" ? /* @__PURE__ */ t.jsx(
|
|
2086
2086
|
"div",
|
|
2087
2087
|
{
|
|
2088
2088
|
className: "gantt-project-start-line-marker",
|
|
@@ -2101,7 +2101,7 @@ const Ir = ({
|
|
|
2101
2101
|
opacity: F
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
|
-
) :
|
|
2104
|
+
) : $ === "dot" ? /* @__PURE__ */ t.jsx(
|
|
2105
2105
|
"div",
|
|
2106
2106
|
{
|
|
2107
2107
|
className: "gantt-project-start-line-marker",
|
|
@@ -2143,11 +2143,11 @@ const Ir = ({
|
|
|
2143
2143
|
)
|
|
2144
2144
|
] }),
|
|
2145
2145
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-grid", children: _.map((c, b) => {
|
|
2146
|
-
const
|
|
2146
|
+
const $ = r.weekends && Xt(c.date), F = r.holidays && Ut(c.date, r.holidays);
|
|
2147
2147
|
return /* @__PURE__ */ t.jsx(
|
|
2148
2148
|
"div",
|
|
2149
2149
|
{
|
|
2150
|
-
className: `gantt-timeline-grid-column ${
|
|
2150
|
+
className: `gantt-timeline-grid-column ${$ ? "weekend" : ""} ${F ? "holiday" : ""}`,
|
|
2151
2151
|
style: { width: S, minWidth: S }
|
|
2152
2152
|
},
|
|
2153
2153
|
b
|
|
@@ -2157,7 +2157,7 @@ const Ir = ({
|
|
|
2157
2157
|
Br,
|
|
2158
2158
|
{
|
|
2159
2159
|
links: o,
|
|
2160
|
-
tasks:
|
|
2160
|
+
tasks: v,
|
|
2161
2161
|
getTaskPosition: Z
|
|
2162
2162
|
}
|
|
2163
2163
|
),
|
|
@@ -2181,14 +2181,14 @@ const Ir = ({
|
|
|
2181
2181
|
},
|
|
2182
2182
|
`baseline-only-${c.taskId}`
|
|
2183
2183
|
);
|
|
2184
|
-
}) :
|
|
2185
|
-
const b = D(c),
|
|
2184
|
+
}) : v.map((c) => {
|
|
2185
|
+
const b = D(c), $ = m ? w?.get(c.id) : void 0, F = $ ? I($) : void 0;
|
|
2186
2186
|
return /* @__PURE__ */ t.jsxs(
|
|
2187
2187
|
"div",
|
|
2188
2188
|
{
|
|
2189
2189
|
className: "gantt-timeline-row",
|
|
2190
2190
|
children: [
|
|
2191
|
-
|
|
2191
|
+
$ && F && /* @__PURE__ */ t.jsx(
|
|
2192
2192
|
"div",
|
|
2193
2193
|
{
|
|
2194
2194
|
className: `gantt-baseline-bar ${c.type === "milestone" ? "milestone" : ""}`,
|
|
@@ -2196,22 +2196,22 @@ const Ir = ({
|
|
|
2196
2196
|
left: `${F.left}px`,
|
|
2197
2197
|
width: `${F.width}px`
|
|
2198
2198
|
},
|
|
2199
|
-
title: `Baseline: ${
|
|
2199
|
+
title: `Baseline: ${$.start.toLocaleDateString()} - ${$.end.toLocaleDateString()}`
|
|
2200
2200
|
}
|
|
2201
2201
|
),
|
|
2202
2202
|
/* @__PURE__ */ t.jsx(
|
|
2203
2203
|
Ir,
|
|
2204
2204
|
{
|
|
2205
2205
|
task: c,
|
|
2206
|
-
baseline:
|
|
2206
|
+
baseline: $,
|
|
2207
2207
|
dependencyRuleDescriptions: J.get(c.id) || [],
|
|
2208
|
-
tooltipConfig:
|
|
2208
|
+
tooltipConfig: x,
|
|
2209
2209
|
position: b,
|
|
2210
2210
|
selected: h === c.id,
|
|
2211
2211
|
dragging: R.taskId === c.id,
|
|
2212
2212
|
dragDeltaX: R.dragDeltaX,
|
|
2213
2213
|
dragType: R.type,
|
|
2214
|
-
onClick: () =>
|
|
2214
|
+
onClick: () => f(c.id),
|
|
2215
2215
|
onDragStart: (W, ae, U) => {
|
|
2216
2216
|
V(c.id, W, ae, U), l(c.id, W, ae);
|
|
2217
2217
|
},
|
|
@@ -2233,30 +2233,30 @@ nr.displayName = "Timeline";
|
|
|
2233
2233
|
const ar = At((e, o) => /* @__PURE__ */ t.jsx("div", { className: "gantt-chart-wrapper", style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ t.jsx(nr, { ...e, ref: o }) }));
|
|
2234
2234
|
ar.displayName = "Chart";
|
|
2235
2235
|
const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig: a = {} }) => {
|
|
2236
|
-
const [
|
|
2236
|
+
const [s, r] = X({
|
|
2237
2237
|
searchText: "",
|
|
2238
2238
|
status: "all",
|
|
2239
2239
|
priority: "all",
|
|
2240
2240
|
owner: ""
|
|
2241
|
-
}), h = (
|
|
2242
|
-
const
|
|
2243
|
-
r(
|
|
2244
|
-
},
|
|
2245
|
-
const
|
|
2241
|
+
}), h = (i) => {
|
|
2242
|
+
const g = { ...s, ...i };
|
|
2243
|
+
r(g), e(g);
|
|
2244
|
+
}, f = () => {
|
|
2245
|
+
const i = {
|
|
2246
2246
|
searchText: "",
|
|
2247
2247
|
status: "all",
|
|
2248
2248
|
priority: "all",
|
|
2249
2249
|
owner: ""
|
|
2250
2250
|
};
|
|
2251
|
-
r(
|
|
2252
|
-
}, l =
|
|
2251
|
+
r(i), e(i);
|
|
2252
|
+
}, l = s.searchText !== "" || s.status !== "all" || s.priority !== "all" || s.owner !== "";
|
|
2253
2253
|
return /* @__PURE__ */ t.jsx("div", { className: "gantt-filter-container", children: /* @__PURE__ */ t.jsxs("div", { className: "gantt-filter-bar", children: [
|
|
2254
2254
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-filter-left", children: /* @__PURE__ */ t.jsx(
|
|
2255
2255
|
Hr,
|
|
2256
2256
|
{
|
|
2257
2257
|
placeholder: a.searchPlaceholder || "Search stages...",
|
|
2258
|
-
value:
|
|
2259
|
-
onChange: (
|
|
2258
|
+
value: s.searchText,
|
|
2259
|
+
onChange: (i) => h({ searchText: i.target.value }),
|
|
2260
2260
|
allowClear: !0,
|
|
2261
2261
|
className: "gantt-search-antd",
|
|
2262
2262
|
style: { width: 250 }
|
|
@@ -2266,8 +2266,8 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2266
2266
|
/* @__PURE__ */ t.jsx(
|
|
2267
2267
|
be,
|
|
2268
2268
|
{
|
|
2269
|
-
value:
|
|
2270
|
-
onChange: (
|
|
2269
|
+
value: s.status,
|
|
2270
|
+
onChange: (i) => h({ status: i }),
|
|
2271
2271
|
className: "gantt-filter-select-antd",
|
|
2272
2272
|
style: { width: 140 },
|
|
2273
2273
|
options: [
|
|
@@ -2281,8 +2281,8 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2281
2281
|
/* @__PURE__ */ t.jsx(
|
|
2282
2282
|
be,
|
|
2283
2283
|
{
|
|
2284
|
-
value:
|
|
2285
|
-
onChange: (
|
|
2284
|
+
value: s.priority,
|
|
2285
|
+
onChange: (i) => h({ priority: i }),
|
|
2286
2286
|
className: "gantt-filter-select-antd",
|
|
2287
2287
|
style: { width: 130 },
|
|
2288
2288
|
options: [
|
|
@@ -2296,15 +2296,15 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2296
2296
|
/* @__PURE__ */ t.jsx(
|
|
2297
2297
|
be,
|
|
2298
2298
|
{
|
|
2299
|
-
value:
|
|
2300
|
-
onChange: (
|
|
2299
|
+
value: s.owner || void 0,
|
|
2300
|
+
onChange: (i) => h({ owner: i || "" }),
|
|
2301
2301
|
className: "gantt-filter-select-antd",
|
|
2302
2302
|
style: { width: 130 },
|
|
2303
2303
|
placeholder: a.allOwnersText || "All Owners",
|
|
2304
2304
|
allowClear: !0,
|
|
2305
2305
|
options: [
|
|
2306
2306
|
{ value: "", label: a.allOwnersText || "All Owners" },
|
|
2307
|
-
...(o || []).map((
|
|
2307
|
+
...(o || []).map((i) => ({ value: i, label: i }))
|
|
2308
2308
|
]
|
|
2309
2309
|
}
|
|
2310
2310
|
),
|
|
@@ -2314,7 +2314,7 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2314
2314
|
type: "default",
|
|
2315
2315
|
danger: !0,
|
|
2316
2316
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: yr }),
|
|
2317
|
-
onClick:
|
|
2317
|
+
onClick: f,
|
|
2318
2318
|
className: "gantt-filter-clear-antd",
|
|
2319
2319
|
children: a.clearFiltersText || "Clear"
|
|
2320
2320
|
}
|
|
@@ -2325,124 +2325,124 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2325
2325
|
zoomLevel: e,
|
|
2326
2326
|
setZoomLevel: o,
|
|
2327
2327
|
onExport: a,
|
|
2328
|
-
onFilterChange:
|
|
2328
|
+
onFilterChange: s,
|
|
2329
2329
|
owners: r,
|
|
2330
2330
|
onAddTask: h,
|
|
2331
|
-
uiConfig:
|
|
2331
|
+
uiConfig: f,
|
|
2332
2332
|
iconConfig: l = {},
|
|
2333
|
-
styleConfig:
|
|
2333
|
+
styleConfig: i
|
|
2334
2334
|
}) => {
|
|
2335
|
-
const
|
|
2335
|
+
const g = et(i), p = f.showZoomButtons !== !1, w = f.showExportButtons !== !1, E = p && w;
|
|
2336
2336
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
|
|
2337
2337
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar", children: [
|
|
2338
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(kt, { size: 8, children:
|
|
2338
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(kt, { size: 8, children: f.showAddTaskButton !== !1 && /* @__PURE__ */ t.jsx(
|
|
2339
2339
|
xe,
|
|
2340
2340
|
{
|
|
2341
2341
|
type: "primary",
|
|
2342
2342
|
icon: Ye(l.addTask, zt),
|
|
2343
2343
|
onClick: () => h?.(),
|
|
2344
|
-
style:
|
|
2345
|
-
children:
|
|
2344
|
+
style: g.buttonPrimary,
|
|
2345
|
+
children: f.addTaskButtonText || "New Stage"
|
|
2346
2346
|
}
|
|
2347
2347
|
) }) }),
|
|
2348
2348
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ t.jsxs(kt, { size: 4, children: [
|
|
2349
2349
|
p && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2350
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2350
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.zoomOutTooltip || "Zoom Out", children: /* @__PURE__ */ t.jsx(
|
|
2351
2351
|
xe,
|
|
2352
2352
|
{
|
|
2353
2353
|
icon: Ye(l.zoomOut, wr),
|
|
2354
2354
|
onClick: () => o(Math.max(0.5, e - 0.25)),
|
|
2355
|
-
style:
|
|
2355
|
+
style: g.buttonSecondary
|
|
2356
2356
|
}
|
|
2357
2357
|
) }),
|
|
2358
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2358
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ t.jsx(
|
|
2359
2359
|
xe,
|
|
2360
2360
|
{
|
|
2361
2361
|
icon: Ye(l.zoomIn, br),
|
|
2362
2362
|
onClick: () => o(Math.min(2, e + 0.25)),
|
|
2363
|
-
style:
|
|
2363
|
+
style: g.buttonSecondary
|
|
2364
2364
|
}
|
|
2365
2365
|
) }),
|
|
2366
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2366
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ t.jsx(
|
|
2367
2367
|
xe,
|
|
2368
2368
|
{
|
|
2369
2369
|
icon: Ye(l.resetZoom, Zt),
|
|
2370
2370
|
onClick: () => o(1),
|
|
2371
|
-
style:
|
|
2371
|
+
style: g.buttonSecondary
|
|
2372
2372
|
}
|
|
2373
2373
|
) })
|
|
2374
2374
|
] }),
|
|
2375
|
-
|
|
2375
|
+
E && /* @__PURE__ */ t.jsx(Gt, { type: "vertical", style: { height: 24, margin: "0 4px" } }),
|
|
2376
2376
|
w && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2377
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2377
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.exportCSVTooltip || "Export to CSV", children: /* @__PURE__ */ t.jsx(
|
|
2378
2378
|
xe,
|
|
2379
2379
|
{
|
|
2380
2380
|
icon: Ye(l.exportCSV, Sr),
|
|
2381
2381
|
onClick: () => a("csv"),
|
|
2382
|
-
style:
|
|
2382
|
+
style: g.buttonSecondary
|
|
2383
2383
|
}
|
|
2384
2384
|
) }),
|
|
2385
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2385
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ t.jsx(
|
|
2386
2386
|
xe,
|
|
2387
2387
|
{
|
|
2388
2388
|
icon: Ye(l.exportExcel, vr),
|
|
2389
2389
|
onClick: () => a("excel"),
|
|
2390
|
-
style:
|
|
2390
|
+
style: g.buttonSecondary
|
|
2391
2391
|
}
|
|
2392
2392
|
) }),
|
|
2393
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2393
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ t.jsx(
|
|
2394
2394
|
xe,
|
|
2395
2395
|
{
|
|
2396
2396
|
icon: Ye(l.exportJSON, jr),
|
|
2397
2397
|
onClick: () => a("json"),
|
|
2398
|
-
style:
|
|
2398
|
+
style: g.buttonSecondary
|
|
2399
2399
|
}
|
|
2400
2400
|
) }),
|
|
2401
|
-
/* @__PURE__ */ t.jsx(Ce, { title:
|
|
2401
|
+
/* @__PURE__ */ t.jsx(Ce, { title: f.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ t.jsx(
|
|
2402
2402
|
xe,
|
|
2403
2403
|
{
|
|
2404
2404
|
icon: Ye(l.exportPDF, Tr),
|
|
2405
2405
|
onClick: () => a("pdf"),
|
|
2406
|
-
style:
|
|
2406
|
+
style: g.buttonSecondary
|
|
2407
2407
|
}
|
|
2408
2408
|
) })
|
|
2409
2409
|
] })
|
|
2410
2410
|
] }) })
|
|
2411
2411
|
] }),
|
|
2412
|
-
|
|
2412
|
+
f.showFilterSearch !== !1 && /* @__PURE__ */ t.jsx(
|
|
2413
2413
|
Vr,
|
|
2414
2414
|
{
|
|
2415
|
-
onFilterChange:
|
|
2415
|
+
onFilterChange: s,
|
|
2416
2416
|
owners: r,
|
|
2417
|
-
uiConfig:
|
|
2417
|
+
uiConfig: f
|
|
2418
2418
|
}
|
|
2419
2419
|
)
|
|
2420
2420
|
] });
|
|
2421
|
-
}, { Option: Ke } = be, { TextArea: Ur } = Ie, qr = ({ onCreateTask: e, onClose: o, uiConfig: a = {}, parentId:
|
|
2422
|
-
const [
|
|
2423
|
-
const p =
|
|
2424
|
-
w.setDate(w.getDate() + (
|
|
2425
|
-
text:
|
|
2421
|
+
}, { Option: Ke } = be, { TextArea: Ur } = Ie, qr = ({ onCreateTask: e, onClose: o, uiConfig: a = {}, parentId: s, parentTaskName: r, styleConfig: h }) => {
|
|
2422
|
+
const [f] = he.useForm(), l = et(h), i = (g) => {
|
|
2423
|
+
const p = g.start.toDate(), w = new Date(p);
|
|
2424
|
+
w.setDate(w.getDate() + (g.duration || 1)), e({
|
|
2425
|
+
text: g.text,
|
|
2426
2426
|
start: p,
|
|
2427
2427
|
end: w,
|
|
2428
|
-
duration:
|
|
2429
|
-
progress:
|
|
2430
|
-
type:
|
|
2431
|
-
color: typeof
|
|
2432
|
-
owner:
|
|
2433
|
-
priority:
|
|
2434
|
-
details:
|
|
2435
|
-
parent:
|
|
2428
|
+
duration: g.duration || 1,
|
|
2429
|
+
progress: g.progress || 0,
|
|
2430
|
+
type: g.type,
|
|
2431
|
+
color: typeof g.color == "string" ? g.color : g.color?.toHexString?.() || "#4A90E2",
|
|
2432
|
+
owner: g.owner || "",
|
|
2433
|
+
priority: g.priority || "medium",
|
|
2434
|
+
details: g.details || "",
|
|
2435
|
+
parent: s
|
|
2436
2436
|
// Set parent for subtasks
|
|
2437
|
-
},
|
|
2437
|
+
}, s), o();
|
|
2438
2438
|
};
|
|
2439
2439
|
return /* @__PURE__ */ t.jsx(
|
|
2440
2440
|
Tt,
|
|
2441
2441
|
{
|
|
2442
|
-
title:
|
|
2442
|
+
title: s ? (a.taskCreatorTitle || "Create Checklist") + (r ? ` for "${r}"` : "") : a.taskCreatorTitle || "Create New Stage",
|
|
2443
2443
|
open: !0,
|
|
2444
2444
|
onCancel: o,
|
|
2445
|
-
onOk: () =>
|
|
2445
|
+
onOk: () => f.submit(),
|
|
2446
2446
|
okText: a.taskCreatorOkText || "Create Stage",
|
|
2447
2447
|
cancelText: a.taskCreatorCancelText || "Cancel",
|
|
2448
2448
|
width: 600,
|
|
@@ -2456,9 +2456,9 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2456
2456
|
children: /* @__PURE__ */ t.jsxs(
|
|
2457
2457
|
he,
|
|
2458
2458
|
{
|
|
2459
|
-
form:
|
|
2459
|
+
form: f,
|
|
2460
2460
|
layout: "vertical",
|
|
2461
|
-
onFinish:
|
|
2461
|
+
onFinish: i,
|
|
2462
2462
|
initialValues: {
|
|
2463
2463
|
type: "task",
|
|
2464
2464
|
priority: "medium",
|
|
@@ -2504,14 +2504,14 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2504
2504
|
)
|
|
2505
2505
|
}
|
|
2506
2506
|
);
|
|
2507
|
-
}, { Option: Ze } = be, { TextArea: Gr } = Ie, { confirm: Jr } = Tt, Kr = ({ task: e, onUpdate: o, onDelete: a, onClose:
|
|
2508
|
-
const [
|
|
2509
|
-
const w = p.start.toDate(),
|
|
2510
|
-
|
|
2507
|
+
}, { Option: Ze } = be, { TextArea: Gr } = Ie, { confirm: Jr } = Tt, Kr = ({ task: e, onUpdate: o, onDelete: a, onClose: s, uiConfig: r = {}, styleConfig: h }) => {
|
|
2508
|
+
const [f] = he.useForm(), l = et(h), i = (p) => {
|
|
2509
|
+
const w = p.start.toDate(), E = new Date(w);
|
|
2510
|
+
E.setDate(E.getDate() + (p.duration || 1)), o({
|
|
2511
2511
|
...e,
|
|
2512
2512
|
text: p.text,
|
|
2513
2513
|
start: w,
|
|
2514
|
-
end:
|
|
2514
|
+
end: E,
|
|
2515
2515
|
duration: p.duration || 1,
|
|
2516
2516
|
progress: p.progress || 0,
|
|
2517
2517
|
type: p.type,
|
|
@@ -2519,8 +2519,8 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2519
2519
|
owner: p.owner || "",
|
|
2520
2520
|
priority: p.priority || "medium",
|
|
2521
2521
|
details: p.details || ""
|
|
2522
|
-
}),
|
|
2523
|
-
},
|
|
2522
|
+
}), s();
|
|
2523
|
+
}, g = () => {
|
|
2524
2524
|
Jr({
|
|
2525
2525
|
title: r.deleteConfirmTitle ? `${r.deleteConfirmTitle}: "${e.text}"?` : `Are you sure you want to delete "${e.text}"?`,
|
|
2526
2526
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: Dr, style: { color: "#faad14", marginRight: 8 } }),
|
|
@@ -2529,7 +2529,7 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2529
2529
|
okType: "danger",
|
|
2530
2530
|
cancelText: r.deleteConfirmCancelText || "No",
|
|
2531
2531
|
onOk() {
|
|
2532
|
-
a(e.id),
|
|
2532
|
+
a(e.id), s();
|
|
2533
2533
|
}
|
|
2534
2534
|
});
|
|
2535
2535
|
};
|
|
@@ -2538,11 +2538,11 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2538
2538
|
{
|
|
2539
2539
|
title: r.taskEditorTitle || "Edit Stage",
|
|
2540
2540
|
open: !0,
|
|
2541
|
-
onCancel:
|
|
2541
|
+
onCancel: s,
|
|
2542
2542
|
footer: [
|
|
2543
|
-
/* @__PURE__ */ t.jsx(xe, { danger: !0, onClick:
|
|
2544
|
-
/* @__PURE__ */ t.jsx(xe, { onClick:
|
|
2545
|
-
/* @__PURE__ */ t.jsx(xe, { type: "primary", onClick: () =>
|
|
2543
|
+
/* @__PURE__ */ t.jsx(xe, { danger: !0, onClick: g, style: { float: "left", ...l.buttonDanger }, children: r.taskEditorDeleteText || "Delete" }, "delete"),
|
|
2544
|
+
/* @__PURE__ */ t.jsx(xe, { onClick: s, style: l.buttonSecondary, children: r.taskEditorCancelText || "Cancel" }, "cancel"),
|
|
2545
|
+
/* @__PURE__ */ t.jsx(xe, { type: "primary", onClick: () => f.submit(), style: l.buttonPrimary, children: r.taskEditorSaveText || "Save Changes" }, "submit")
|
|
2546
2546
|
],
|
|
2547
2547
|
width: 600,
|
|
2548
2548
|
className: "gantt-modal-antd",
|
|
@@ -2553,9 +2553,9 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2553
2553
|
children: /* @__PURE__ */ t.jsxs(
|
|
2554
2554
|
he,
|
|
2555
2555
|
{
|
|
2556
|
-
form:
|
|
2556
|
+
form: f,
|
|
2557
2557
|
layout: "vertical",
|
|
2558
|
-
onFinish:
|
|
2558
|
+
onFinish: i,
|
|
2559
2559
|
initialValues: {
|
|
2560
2560
|
text: e.text,
|
|
2561
2561
|
type: e.type || "task",
|
|
@@ -2608,15 +2608,15 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2608
2608
|
task: e,
|
|
2609
2609
|
allTasks: o,
|
|
2610
2610
|
links: a,
|
|
2611
|
-
onAddDependency:
|
|
2611
|
+
onAddDependency: s,
|
|
2612
2612
|
onRemoveDependency: r,
|
|
2613
2613
|
onTaskUpdate: h,
|
|
2614
|
-
onClose:
|
|
2614
|
+
onClose: f,
|
|
2615
2615
|
styleConfig: l
|
|
2616
2616
|
}) => {
|
|
2617
|
-
const
|
|
2618
|
-
if (
|
|
2619
|
-
const D = Ct(
|
|
2617
|
+
const i = et(l), [g, p] = X(""), [w, E] = X("e2s"), [x, j] = X(0), [v, N] = X("day"), [S, m] = X(e.duration), [O, J] = X(""), R = a.filter((D) => D.target === e.id), V = o.filter((D) => D.id !== e.id && D.id !== e.parent), Q = () => {
|
|
2618
|
+
if (g) {
|
|
2619
|
+
const D = Ct(x, v);
|
|
2620
2620
|
if (S !== e.duration && h) {
|
|
2621
2621
|
const I = ye(new Date(e.start), S, "day");
|
|
2622
2622
|
h({
|
|
@@ -2625,9 +2625,9 @@ const { Search: Hr } = Ie, Vr = ({ onFilterChange: e, owners: o = [], uiConfig:
|
|
|
2625
2625
|
end: I
|
|
2626
2626
|
});
|
|
2627
2627
|
}
|
|
2628
|
-
|
|
2628
|
+
s(g, e.id, w, D), p(""), j(0), N("day");
|
|
2629
2629
|
}
|
|
2630
|
-
},
|
|
2630
|
+
}, L = () => {
|
|
2631
2631
|
if (!O.trim()) return;
|
|
2632
2632
|
const D = Cr(O.trim());
|
|
2633
2633
|
if (!D) {
|
|
@@ -2641,7 +2641,7 @@ Example: 3FS+10d`);
|
|
|
2641
2641
|
return;
|
|
2642
2642
|
}
|
|
2643
2643
|
const re = Ar(D.type), B = Ct(D.lag, D.lagUnit);
|
|
2644
|
-
|
|
2644
|
+
s(Z.id, e.id, re, B), J("");
|
|
2645
2645
|
}, q = (D) => {
|
|
2646
2646
|
switch (D) {
|
|
2647
2647
|
case "e2s":
|
|
@@ -2668,14 +2668,14 @@ Example: 3FS+10d`);
|
|
|
2668
2668
|
return /* @__PURE__ */ t.jsx(
|
|
2669
2669
|
Tt,
|
|
2670
2670
|
{
|
|
2671
|
-
title: /* @__PURE__ */ t.jsx(dt, { level: 4, style: { margin: 0, color:
|
|
2671
|
+
title: /* @__PURE__ */ t.jsx(dt, { level: 4, style: { margin: 0, color: i.font?.color }, children: "Dependency Editor" }),
|
|
2672
2672
|
open: !0,
|
|
2673
|
-
onCancel:
|
|
2673
|
+
onCancel: f,
|
|
2674
2674
|
footer: null,
|
|
2675
2675
|
width: 700,
|
|
2676
2676
|
styles: {
|
|
2677
|
-
content:
|
|
2678
|
-
header: { borderBottom: `1px solid ${
|
|
2677
|
+
content: i.modal,
|
|
2678
|
+
header: { borderBottom: `1px solid ${i.modal?.borderColor || "#f0f0f0"}` }
|
|
2679
2679
|
},
|
|
2680
2680
|
children: /* @__PURE__ */ t.jsxs("div", { style: { padding: "8px 0" }, children: [
|
|
2681
2681
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2684,28 +2684,28 @@ Example: 3FS+10d`);
|
|
|
2684
2684
|
message: "Managing dependencies helps in auto-scheduling and critical path calculation.",
|
|
2685
2685
|
type: "info",
|
|
2686
2686
|
showIcon: !0,
|
|
2687
|
-
style: { marginBottom: 20, ...
|
|
2687
|
+
style: { marginBottom: 20, ...i.font }
|
|
2688
2688
|
}
|
|
2689
2689
|
),
|
|
2690
2690
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 20, marginBottom: 24 }, children: [
|
|
2691
2691
|
/* @__PURE__ */ t.jsx(
|
|
2692
2692
|
It,
|
|
2693
2693
|
{
|
|
2694
|
-
title: /* @__PURE__ */ t.jsx(dt, { level: 5, style: { margin: 0, fontSize: 14, color:
|
|
2694
|
+
title: /* @__PURE__ */ t.jsx(dt, { level: 5, style: { margin: 0, fontSize: 14, color: i.font?.color }, children: "Settings" }),
|
|
2695
2695
|
size: "small",
|
|
2696
|
-
style: { flex: 1, ...
|
|
2697
|
-
headStyle: { borderBottom: `1px solid ${
|
|
2696
|
+
style: { flex: 1, ...i.modal },
|
|
2697
|
+
headStyle: { borderBottom: `1px solid ${i.modal?.borderColor || "#f0f0f0"}` },
|
|
2698
2698
|
children: /* @__PURE__ */ t.jsxs(kt, { direction: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
2699
2699
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2700
|
-
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color:
|
|
2700
|
+
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color: i.font?.color }, children: "Predecessor" }),
|
|
2701
2701
|
/* @__PURE__ */ t.jsx(
|
|
2702
2702
|
be,
|
|
2703
2703
|
{
|
|
2704
2704
|
showSearch: !0,
|
|
2705
2705
|
placeholder: "Select a task",
|
|
2706
2706
|
optionFilterProp: "children",
|
|
2707
|
-
style: { width: "100%", ...
|
|
2708
|
-
value:
|
|
2707
|
+
style: { width: "100%", ...i.input },
|
|
2708
|
+
value: g,
|
|
2709
2709
|
onChange: p,
|
|
2710
2710
|
children: V.map((D) => /* @__PURE__ */ t.jsxs(ke, { value: D.id, children: [
|
|
2711
2711
|
"[",
|
|
@@ -2717,13 +2717,13 @@ Example: 3FS+10d`);
|
|
|
2717
2717
|
)
|
|
2718
2718
|
] }),
|
|
2719
2719
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2720
|
-
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color:
|
|
2720
|
+
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color: i.font?.color }, children: "Type" }),
|
|
2721
2721
|
/* @__PURE__ */ t.jsxs(
|
|
2722
2722
|
be,
|
|
2723
2723
|
{
|
|
2724
|
-
style: { width: "100%", ...
|
|
2724
|
+
style: { width: "100%", ...i.input },
|
|
2725
2725
|
value: w,
|
|
2726
|
-
onChange:
|
|
2726
|
+
onChange: E,
|
|
2727
2727
|
children: [
|
|
2728
2728
|
/* @__PURE__ */ t.jsx(ke, { value: "e2s", children: "Finish-to-Start (FS)" }),
|
|
2729
2729
|
/* @__PURE__ */ t.jsx(ke, { value: "s2s", children: "Start-to-Start (SS)" }),
|
|
@@ -2735,24 +2735,24 @@ Example: 3FS+10d`);
|
|
|
2735
2735
|
] }),
|
|
2736
2736
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12 }, children: [
|
|
2737
2737
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
2738
|
-
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color:
|
|
2738
|
+
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color: i.font?.color }, children: "Lag/Lead" }),
|
|
2739
2739
|
/* @__PURE__ */ t.jsx(
|
|
2740
2740
|
_e,
|
|
2741
2741
|
{
|
|
2742
|
-
style: { width: "100%", ...
|
|
2743
|
-
value:
|
|
2744
|
-
onChange: (D) =>
|
|
2742
|
+
style: { width: "100%", ...i.input },
|
|
2743
|
+
value: x,
|
|
2744
|
+
onChange: (D) => j(D || 0)
|
|
2745
2745
|
}
|
|
2746
2746
|
)
|
|
2747
2747
|
] }),
|
|
2748
2748
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
2749
|
-
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color:
|
|
2749
|
+
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color: i.font?.color }, children: "Units" }),
|
|
2750
2750
|
/* @__PURE__ */ t.jsxs(
|
|
2751
2751
|
be,
|
|
2752
2752
|
{
|
|
2753
|
-
style: { width: "100%", ...
|
|
2754
|
-
value:
|
|
2755
|
-
onChange:
|
|
2753
|
+
style: { width: "100%", ...i.input },
|
|
2754
|
+
value: v,
|
|
2755
|
+
onChange: N,
|
|
2756
2756
|
children: [
|
|
2757
2757
|
/* @__PURE__ */ t.jsx(ke, { value: "day", children: "Days" }),
|
|
2758
2758
|
/* @__PURE__ */ t.jsx(ke, { value: "hour", children: "Hours" }),
|
|
@@ -2764,14 +2764,14 @@ Example: 3FS+10d`);
|
|
|
2764
2764
|
] })
|
|
2765
2765
|
] }),
|
|
2766
2766
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2767
|
-
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color:
|
|
2767
|
+
/* @__PURE__ */ t.jsx(Ve, { style: { display: "block", marginBottom: 8, fontSize: 13, color: i.font?.color }, children: "Duration (days)" }),
|
|
2768
2768
|
/* @__PURE__ */ t.jsx(
|
|
2769
2769
|
_e,
|
|
2770
2770
|
{
|
|
2771
|
-
style: { width: "100%", ...
|
|
2771
|
+
style: { width: "100%", ...i.input },
|
|
2772
2772
|
min: 1,
|
|
2773
2773
|
value: S,
|
|
2774
|
-
onChange: (D) =>
|
|
2774
|
+
onChange: (D) => m(D || 1)
|
|
2775
2775
|
}
|
|
2776
2776
|
)
|
|
2777
2777
|
] }),
|
|
@@ -2782,11 +2782,11 @@ Example: 3FS+10d`);
|
|
|
2782
2782
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: zt, style: { marginRight: 8 } }),
|
|
2783
2783
|
block: !0,
|
|
2784
2784
|
onClick: Q,
|
|
2785
|
-
disabled: !
|
|
2785
|
+
disabled: !g,
|
|
2786
2786
|
style: {
|
|
2787
2787
|
height: 40,
|
|
2788
2788
|
marginTop: 8,
|
|
2789
|
-
...
|
|
2789
|
+
...i.buttonPrimary
|
|
2790
2790
|
},
|
|
2791
2791
|
children: "Add Dependency"
|
|
2792
2792
|
}
|
|
@@ -2797,12 +2797,12 @@ Example: 3FS+10d`);
|
|
|
2797
2797
|
/* @__PURE__ */ t.jsxs(
|
|
2798
2798
|
It,
|
|
2799
2799
|
{
|
|
2800
|
-
title: /* @__PURE__ */ t.jsx(dt, { level: 5, style: { margin: 0, fontSize: 14, color:
|
|
2800
|
+
title: /* @__PURE__ */ t.jsx(dt, { level: 5, style: { margin: 0, fontSize: 14, color: i.font?.color }, children: "Quick Add" }),
|
|
2801
2801
|
size: "small",
|
|
2802
|
-
style: { width: 250, ...
|
|
2803
|
-
headStyle: { borderBottom: `1px solid ${
|
|
2802
|
+
style: { width: 250, ...i.modal },
|
|
2803
|
+
headStyle: { borderBottom: `1px solid ${i.modal?.borderColor || "#f0f0f0"}` },
|
|
2804
2804
|
children: [
|
|
2805
|
-
/* @__PURE__ */ t.jsxs(Zr, { type: "secondary", style: { fontSize: 12, marginBottom: 16, color:
|
|
2805
|
+
/* @__PURE__ */ t.jsxs(Zr, { type: "secondary", style: { fontSize: 12, marginBottom: 16, color: i.font?.color, opacity: 0.7 }, children: [
|
|
2806
2806
|
"Format: [TaskNumber][Type][+/-][Lag][Unit]",
|
|
2807
2807
|
/* @__PURE__ */ t.jsx("br", {}),
|
|
2808
2808
|
"Example: 3FS+10d"
|
|
@@ -2813,11 +2813,11 @@ Example: 3FS+10d`);
|
|
|
2813
2813
|
placeholder: "e.g. 5FS+2d",
|
|
2814
2814
|
value: O,
|
|
2815
2815
|
onChange: (D) => J(D.target.value),
|
|
2816
|
-
onPressEnter:
|
|
2816
|
+
onPressEnter: L,
|
|
2817
2817
|
style: {
|
|
2818
2818
|
marginBottom: 16,
|
|
2819
2819
|
height: 40,
|
|
2820
|
-
...
|
|
2820
|
+
...i.input
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
2823
|
),
|
|
@@ -2825,10 +2825,10 @@ Example: 3FS+10d`);
|
|
|
2825
2825
|
xe,
|
|
2826
2826
|
{
|
|
2827
2827
|
block: !0,
|
|
2828
|
-
onClick:
|
|
2828
|
+
onClick: L,
|
|
2829
2829
|
style: {
|
|
2830
2830
|
height: 40,
|
|
2831
|
-
...
|
|
2831
|
+
...i.buttonSecondary
|
|
2832
2832
|
},
|
|
2833
2833
|
children: "Apply"
|
|
2834
2834
|
}
|
|
@@ -2837,14 +2837,14 @@ Example: 3FS+10d`);
|
|
|
2837
2837
|
}
|
|
2838
2838
|
)
|
|
2839
2839
|
] }),
|
|
2840
|
-
/* @__PURE__ */ t.jsx(Gt, { style: { margin: "0 0 24px 0", borderColor:
|
|
2840
|
+
/* @__PURE__ */ t.jsx(Gt, { style: { margin: "0 0 24px 0", borderColor: i.modal?.borderColor } }),
|
|
2841
2841
|
/* @__PURE__ */ t.jsxs("div", { style: { maxHeight: 300, overflowY: "auto" }, children: [
|
|
2842
|
-
/* @__PURE__ */ t.jsx(dt, { level: 5, style: { fontSize: 14, marginBottom: 16, color:
|
|
2842
|
+
/* @__PURE__ */ t.jsx(dt, { level: 5, style: { fontSize: 14, marginBottom: 16, color: i.font?.color }, children: "Current Dependencies" }),
|
|
2843
2843
|
/* @__PURE__ */ t.jsx(
|
|
2844
2844
|
Ot,
|
|
2845
2845
|
{
|
|
2846
2846
|
dataSource: R,
|
|
2847
|
-
locale: { emptyText: /* @__PURE__ */ t.jsx(Ve, { type: "secondary", style: { color:
|
|
2847
|
+
locale: { emptyText: /* @__PURE__ */ t.jsx(Ve, { type: "secondary", style: { color: i.font?.color, opacity: 0.5 }, children: "No dependencies added yet." }) },
|
|
2848
2848
|
renderItem: (D) => {
|
|
2849
2849
|
const I = o.find((Z) => Z.id === D.source);
|
|
2850
2850
|
return /* @__PURE__ */ t.jsx(
|
|
@@ -2855,7 +2855,7 @@ Example: 3FS+10d`);
|
|
|
2855
2855
|
background: "#fafafa",
|
|
2856
2856
|
borderRadius: 8,
|
|
2857
2857
|
marginBottom: 12,
|
|
2858
|
-
border: `1px solid ${
|
|
2858
|
+
border: `1px solid ${i.listItem?.borderColor || "#f0f0f0"}`
|
|
2859
2859
|
},
|
|
2860
2860
|
actions: [
|
|
2861
2861
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2885,10 +2885,10 @@ Example: 3FS+10d`);
|
|
|
2885
2885
|
fontWeight: "bold"
|
|
2886
2886
|
}, children: I ? o.indexOf(I) + 1 : "?" }),
|
|
2887
2887
|
title: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
2888
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color:
|
|
2888
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: i.font?.color }, children: I?.text || "Unknown Task" }),
|
|
2889
2889
|
/* @__PURE__ */ t.jsx(mr, { color: H(D.type), style: { margin: 0 }, children: q(D.type) })
|
|
2890
2890
|
] }),
|
|
2891
|
-
description: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color:
|
|
2891
|
+
description: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color: i.font?.color, opacity: 0.7 }, children: [
|
|
2892
2892
|
/* @__PURE__ */ t.jsx(fe, { icon: Qt, style: { marginRight: 6 } }),
|
|
2893
2893
|
"Lag: ",
|
|
2894
2894
|
D.lag || 0,
|
|
@@ -2916,26 +2916,26 @@ Example: 3FS+10d`);
|
|
|
2916
2916
|
x: e,
|
|
2917
2917
|
y: o,
|
|
2918
2918
|
task: a,
|
|
2919
|
-
onEdit:
|
|
2919
|
+
onEdit: s,
|
|
2920
2920
|
onDelete: r,
|
|
2921
2921
|
onCopy: h,
|
|
2922
|
-
onDependencies:
|
|
2922
|
+
onDependencies: f,
|
|
2923
2923
|
onConvertToMilestone: l,
|
|
2924
|
-
onConvertToTask:
|
|
2925
|
-
onConvertToProject:
|
|
2924
|
+
onConvertToTask: i,
|
|
2925
|
+
onConvertToProject: g,
|
|
2926
2926
|
onAutoSchedule: p,
|
|
2927
2927
|
onClose: w,
|
|
2928
|
-
styleConfig:
|
|
2928
|
+
styleConfig: E
|
|
2929
2929
|
}) => {
|
|
2930
|
-
const
|
|
2930
|
+
const x = et(E);
|
|
2931
2931
|
if (!a) return null;
|
|
2932
|
-
const
|
|
2932
|
+
const j = [
|
|
2933
2933
|
{
|
|
2934
2934
|
key: "edit",
|
|
2935
2935
|
label: "Edit",
|
|
2936
2936
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: Er }),
|
|
2937
2937
|
onClick: () => {
|
|
2938
|
-
|
|
2938
|
+
s(), w();
|
|
2939
2939
|
}
|
|
2940
2940
|
},
|
|
2941
2941
|
{
|
|
@@ -2951,7 +2951,7 @@ Example: 3FS+10d`);
|
|
|
2951
2951
|
label: "Dependencies",
|
|
2952
2952
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: Qt }),
|
|
2953
2953
|
onClick: () => {
|
|
2954
|
-
|
|
2954
|
+
f(), w();
|
|
2955
2955
|
}
|
|
2956
2956
|
},
|
|
2957
2957
|
{
|
|
@@ -2977,7 +2977,7 @@ Example: 3FS+10d`);
|
|
|
2977
2977
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: Rr }),
|
|
2978
2978
|
disabled: a.type === "task",
|
|
2979
2979
|
onClick: () => {
|
|
2980
|
-
|
|
2980
|
+
i(), w();
|
|
2981
2981
|
}
|
|
2982
2982
|
},
|
|
2983
2983
|
{
|
|
@@ -2986,7 +2986,7 @@ Example: 3FS+10d`);
|
|
|
2986
2986
|
icon: /* @__PURE__ */ t.jsx(fe, { icon: Pr }),
|
|
2987
2987
|
disabled: a.type === "project",
|
|
2988
2988
|
onClick: () => {
|
|
2989
|
-
|
|
2989
|
+
g(), w();
|
|
2990
2990
|
}
|
|
2991
2991
|
}
|
|
2992
2992
|
]
|
|
@@ -3022,137 +3022,137 @@ Example: 3FS+10d`);
|
|
|
3022
3022
|
top: `${o}px`,
|
|
3023
3023
|
zIndex: 1e4
|
|
3024
3024
|
},
|
|
3025
|
-
onClick: (
|
|
3025
|
+
onClick: (v) => v.stopPropagation(),
|
|
3026
3026
|
children: /* @__PURE__ */ t.jsx(
|
|
3027
3027
|
fr,
|
|
3028
3028
|
{
|
|
3029
|
-
items:
|
|
3029
|
+
items: j,
|
|
3030
3030
|
style: {
|
|
3031
|
-
boxShadow:
|
|
3032
|
-
borderRadius:
|
|
3033
|
-
border: `1px solid ${
|
|
3034
|
-
backgroundColor:
|
|
3035
|
-
color:
|
|
3036
|
-
fontFamily:
|
|
3031
|
+
boxShadow: x.popover?.boxShadow || "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
3032
|
+
borderRadius: x.popover?.borderRadius || "6px",
|
|
3033
|
+
border: `1px solid ${x.popover?.borderColor || "#e0e0e0"}`,
|
|
3034
|
+
backgroundColor: x.popover?.backgroundColor,
|
|
3035
|
+
color: x.font?.color,
|
|
3036
|
+
fontFamily: x.font?.fontFamily
|
|
3037
3037
|
}
|
|
3038
3038
|
}
|
|
3039
3039
|
)
|
|
3040
3040
|
}
|
|
3041
3041
|
);
|
|
3042
3042
|
}, tn = (e, o = []) => {
|
|
3043
|
-
const [a,
|
|
3043
|
+
const [a, s] = X([]), [r, h] = X(-1), [f, l] = X(e), [i, g] = X(o);
|
|
3044
3044
|
Xe(() => {
|
|
3045
3045
|
l(e);
|
|
3046
3046
|
}, [e]), Xe(() => {
|
|
3047
|
-
|
|
3047
|
+
g(o);
|
|
3048
3048
|
}, [o]);
|
|
3049
|
-
const p = Re((
|
|
3049
|
+
const p = Re((m, O, J) => {
|
|
3050
3050
|
const R = {
|
|
3051
|
-
type:
|
|
3051
|
+
type: m,
|
|
3052
3052
|
before: O,
|
|
3053
3053
|
after: J,
|
|
3054
3054
|
timestamp: Date.now()
|
|
3055
3055
|
}, V = a.slice(0, r + 1);
|
|
3056
|
-
V.push(R), V.length > 50 ? V.shift() : h(r + 1),
|
|
3056
|
+
V.push(R), V.length > 50 ? V.shift() : h(r + 1), s(V);
|
|
3057
3057
|
}, [a, r]), w = Re(() => {
|
|
3058
3058
|
if (r < 0) return;
|
|
3059
|
-
const
|
|
3060
|
-
l(
|
|
3061
|
-
}, [a, r]),
|
|
3059
|
+
const m = a[r];
|
|
3060
|
+
l(m.before.tasks), g(m.before.links), h(r - 1);
|
|
3061
|
+
}, [a, r]), E = Re(() => {
|
|
3062
3062
|
if (r >= a.length - 1) return;
|
|
3063
|
-
const
|
|
3064
|
-
l(
|
|
3065
|
-
}, [a, r]),
|
|
3066
|
-
const O = { tasks:
|
|
3067
|
-
p("task_update", O, { tasks: J, links:
|
|
3068
|
-
}, [
|
|
3069
|
-
const O = { tasks:
|
|
3070
|
-
p("task_create", O, { tasks: J, links:
|
|
3071
|
-
}, [
|
|
3072
|
-
const O = { tasks:
|
|
3073
|
-
p("task_delete", O, { tasks: J, links: R }), l(J),
|
|
3074
|
-
}, [
|
|
3063
|
+
const m = a[r + 1];
|
|
3064
|
+
l(m.after.tasks), g(m.after.links), h(r + 1);
|
|
3065
|
+
}, [a, r]), x = r >= 0, j = r < a.length - 1, v = Re((m) => {
|
|
3066
|
+
const O = { tasks: f, links: i }, J = f.map((V) => V.id === m.id ? m : V);
|
|
3067
|
+
p("task_update", O, { tasks: J, links: i }), l(J);
|
|
3068
|
+
}, [f, i, p]), N = Re((m) => {
|
|
3069
|
+
const O = { tasks: f, links: i }, J = [...f, m];
|
|
3070
|
+
p("task_create", O, { tasks: J, links: i }), l(J);
|
|
3071
|
+
}, [f, i, p]), S = Re((m) => {
|
|
3072
|
+
const O = { tasks: f, links: i }, J = f.filter((Q) => Q.id !== m), R = i.filter((Q) => Q.source !== m && Q.target !== m);
|
|
3073
|
+
p("task_delete", O, { tasks: J, links: R }), l(J), g(R);
|
|
3074
|
+
}, [f, i, p]);
|
|
3075
3075
|
return {
|
|
3076
|
-
tasks:
|
|
3077
|
-
links:
|
|
3076
|
+
tasks: f,
|
|
3077
|
+
links: i,
|
|
3078
3078
|
setTasks: l,
|
|
3079
|
-
setLinks:
|
|
3079
|
+
setLinks: g,
|
|
3080
3080
|
undo: w,
|
|
3081
|
-
redo:
|
|
3082
|
-
canUndo:
|
|
3083
|
-
canRedo:
|
|
3084
|
-
updateTask:
|
|
3085
|
-
createTask:
|
|
3081
|
+
redo: E,
|
|
3082
|
+
canUndo: x,
|
|
3083
|
+
canRedo: j,
|
|
3084
|
+
updateTask: v,
|
|
3085
|
+
createTask: N,
|
|
3086
3086
|
deleteTask: S,
|
|
3087
3087
|
saveState: p,
|
|
3088
3088
|
history: a
|
|
3089
3089
|
};
|
|
3090
3090
|
}, or = (e, o, a = { mode: "forward" }) => {
|
|
3091
|
-
const
|
|
3091
|
+
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3092
3092
|
return e.forEach((h) => {
|
|
3093
|
-
|
|
3093
|
+
s.set(h.id, []), r.set(h.id, []);
|
|
3094
3094
|
}), o.forEach((h) => {
|
|
3095
|
-
h.type === "e2s" && (
|
|
3096
|
-
}), a.mode === "forward" ? rn(e,
|
|
3095
|
+
h.type === "e2s" && (s.get(h.target)?.push(h.source), r.get(h.source)?.push(h.target));
|
|
3096
|
+
}), a.mode === "forward" ? rn(e, s, a) : nn(e, r, a);
|
|
3097
3097
|
}, rn = (e, o, a) => {
|
|
3098
|
-
const
|
|
3098
|
+
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), h = a.projectStart || /* @__PURE__ */ new Date(), f = (l) => {
|
|
3099
3099
|
if (r.has(l)) return;
|
|
3100
|
-
const
|
|
3101
|
-
if (!
|
|
3102
|
-
const
|
|
3103
|
-
|
|
3100
|
+
const i = e.find((j) => j.id === l);
|
|
3101
|
+
if (!i) return;
|
|
3102
|
+
const g = o.get(l) || [];
|
|
3103
|
+
g.forEach((j) => f(j));
|
|
3104
3104
|
let p = h;
|
|
3105
|
-
|
|
3106
|
-
const
|
|
3107
|
-
|
|
3105
|
+
g.forEach((j) => {
|
|
3106
|
+
const v = s.get(j);
|
|
3107
|
+
v && v.end > p && (p = new Date(v.end));
|
|
3108
3108
|
});
|
|
3109
|
-
const w = new Date(p),
|
|
3110
|
-
...
|
|
3109
|
+
const w = new Date(p), E = ye(w, i.duration, "day"), x = {
|
|
3110
|
+
...i,
|
|
3111
3111
|
start: w,
|
|
3112
|
-
end:
|
|
3112
|
+
end: E
|
|
3113
3113
|
};
|
|
3114
|
-
|
|
3114
|
+
s.set(l, x), r.add(l);
|
|
3115
3115
|
};
|
|
3116
|
-
return e.forEach((l) =>
|
|
3116
|
+
return e.forEach((l) => f(l.id)), e.map((l) => s.get(l.id) || l);
|
|
3117
3117
|
}, nn = (e, o, a) => {
|
|
3118
|
-
const
|
|
3118
|
+
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), h = a.projectEnd || new Date(
|
|
3119
3119
|
Math.max(...e.map((l) => l.end.getTime()))
|
|
3120
|
-
),
|
|
3120
|
+
), f = (l) => {
|
|
3121
3121
|
if (r.has(l)) return;
|
|
3122
|
-
const
|
|
3123
|
-
if (!
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3122
|
+
const i = e.find((j) => j.id === l);
|
|
3123
|
+
if (!i) return;
|
|
3124
|
+
const g = o.get(l) || [];
|
|
3125
|
+
g.forEach((j) => f(j));
|
|
3126
3126
|
let p = h;
|
|
3127
|
-
|
|
3128
|
-
const
|
|
3129
|
-
|
|
3127
|
+
g.forEach((j) => {
|
|
3128
|
+
const v = s.get(j);
|
|
3129
|
+
v && v.start < p && (p = new Date(v.start));
|
|
3130
3130
|
});
|
|
3131
|
-
const w = new Date(p),
|
|
3132
|
-
...
|
|
3133
|
-
start:
|
|
3131
|
+
const w = new Date(p), E = ye(w, -i.duration, "day"), x = {
|
|
3132
|
+
...i,
|
|
3133
|
+
start: E,
|
|
3134
3134
|
end: w
|
|
3135
3135
|
};
|
|
3136
|
-
|
|
3136
|
+
s.set(l, x), r.add(l);
|
|
3137
3137
|
};
|
|
3138
|
-
return e.forEach((l) =>
|
|
3138
|
+
return e.forEach((l) => f(l.id)), e.map((l) => s.get(l.id) || l);
|
|
3139
3139
|
}, an = (e) => {
|
|
3140
3140
|
const o = /* @__PURE__ */ new Map();
|
|
3141
|
-
e.forEach((
|
|
3142
|
-
|
|
3141
|
+
e.forEach((s) => {
|
|
3142
|
+
s.owner && (o.has(s.owner) || o.set(s.owner, []), o.get(s.owner).push(s));
|
|
3143
3143
|
});
|
|
3144
3144
|
const a = [...e];
|
|
3145
|
-
return o.forEach((
|
|
3146
|
-
const r =
|
|
3145
|
+
return o.forEach((s) => {
|
|
3146
|
+
const r = s.sort((h, f) => h.start.getTime() - f.start.getTime());
|
|
3147
3147
|
for (let h = 1; h < r.length; h++) {
|
|
3148
|
-
const
|
|
3149
|
-
if (
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
const
|
|
3153
|
-
a[
|
|
3154
|
-
...
|
|
3155
|
-
start:
|
|
3148
|
+
const f = r[h], l = r[h - 1];
|
|
3149
|
+
if (f.start < l.end) {
|
|
3150
|
+
const i = a.findIndex((g) => g.id === f.id);
|
|
3151
|
+
if (i >= 0) {
|
|
3152
|
+
const g = new Date(l.end), p = ye(g, f.duration, "day");
|
|
3153
|
+
a[i] = {
|
|
3154
|
+
...f,
|
|
3155
|
+
start: g,
|
|
3156
3156
|
end: p
|
|
3157
3157
|
};
|
|
3158
3158
|
}
|
|
@@ -3183,12 +3183,12 @@ Example: 3FS+10d`);
|
|
|
3183
3183
|
r.type || "task",
|
|
3184
3184
|
r.owner || "",
|
|
3185
3185
|
r.priority || "medium"
|
|
3186
|
-
]),
|
|
3186
|
+
]), s = [
|
|
3187
3187
|
o.join(","),
|
|
3188
3188
|
...a.map((r) => r.map((h) => `"${h}"`).join(","))
|
|
3189
3189
|
].join(`
|
|
3190
3190
|
`);
|
|
3191
|
-
Dt(
|
|
3191
|
+
Dt(s, "gantt-tasks.csv", "text/csv");
|
|
3192
3192
|
}, ir = (e) => {
|
|
3193
3193
|
const o = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority", "Details"], a = e.map((r) => [
|
|
3194
3194
|
r.id,
|
|
@@ -3201,29 +3201,29 @@ Example: 3FS+10d`);
|
|
|
3201
3201
|
r.owner || "",
|
|
3202
3202
|
r.priority || "medium",
|
|
3203
3203
|
r.details || ""
|
|
3204
|
-
]),
|
|
3204
|
+
]), s = "\uFEFF" + [
|
|
3205
3205
|
// BOM for UTF-8
|
|
3206
3206
|
o.join(" "),
|
|
3207
3207
|
...a.map((r) => r.map((h) => h.replace(/\t/g, " ")).join(" "))
|
|
3208
3208
|
].join(`
|
|
3209
3209
|
`);
|
|
3210
|
-
Dt(
|
|
3210
|
+
Dt(s, "gantt-tasks.xls", "application/vnd.ms-excel");
|
|
3211
3211
|
}, lr = (e, o) => {
|
|
3212
3212
|
const a = {
|
|
3213
3213
|
tasks: e,
|
|
3214
3214
|
links: o,
|
|
3215
3215
|
exported: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3216
3216
|
version: "1.0"
|
|
3217
|
-
},
|
|
3218
|
-
Dt(
|
|
3217
|
+
}, s = JSON.stringify(a, null, 2);
|
|
3218
|
+
Dt(s, "gantt-project.json", "application/json");
|
|
3219
3219
|
}, dr = (e) => {
|
|
3220
3220
|
const o = `
|
|
3221
3221
|
GANTT CHART PROJECT
|
|
3222
3222
|
Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
3223
3223
|
|
|
3224
3224
|
Tasks:
|
|
3225
|
-
${e.map((a,
|
|
3226
|
-
${
|
|
3225
|
+
${e.map((a, s) => `
|
|
3226
|
+
${s + 1}. ${a.text}
|
|
3227
3227
|
Start: ${we(a.start, "MM/DD/YYYY")}
|
|
3228
3228
|
End: ${we(a.end, "MM/DD/YYYY")}
|
|
3229
3229
|
Duration: ${a.duration} days
|
|
@@ -3244,25 +3244,25 @@ ${i + 1}. ${a.text}
|
|
|
3244
3244
|
}
|
|
3245
3245
|
alert("Image export requires html2canvas library. Install with: npm install html2canvas");
|
|
3246
3246
|
}, Dt = (e, o, a) => {
|
|
3247
|
-
const
|
|
3247
|
+
const s = new Blob([e], { type: a }), r = URL.createObjectURL(s);
|
|
3248
3248
|
ln(r, o), URL.revokeObjectURL(r);
|
|
3249
3249
|
}, ln = (e, o) => {
|
|
3250
3250
|
const a = document.createElement("a");
|
|
3251
3251
|
a.href = e, a.download = o, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
3252
3252
|
}, dn = (e) => new Promise((o, a) => {
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3253
|
+
const s = new FileReader();
|
|
3254
|
+
s.onload = (r) => {
|
|
3255
3255
|
try {
|
|
3256
|
-
const h = r.target?.result,
|
|
3257
|
-
...
|
|
3258
|
-
start: new Date(
|
|
3259
|
-
end: new Date(
|
|
3256
|
+
const h = r.target?.result, f = JSON.parse(h), l = f.tasks.map((i) => ({
|
|
3257
|
+
...i,
|
|
3258
|
+
start: new Date(i.start),
|
|
3259
|
+
end: new Date(i.end)
|
|
3260
3260
|
}));
|
|
3261
|
-
o({ tasks: l, links:
|
|
3261
|
+
o({ tasks: l, links: f.links || [] });
|
|
3262
3262
|
} catch {
|
|
3263
3263
|
a(new Error("Invalid JSON file"));
|
|
3264
3264
|
}
|
|
3265
|
-
},
|
|
3265
|
+
}, s.onerror = () => a(new Error("Failed to read file")), s.readAsText(e);
|
|
3266
3266
|
}), $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3267
3267
|
__proto__: null,
|
|
3268
3268
|
exportToCSV: sr,
|
|
@@ -3273,15 +3273,15 @@ ${i + 1}. ${a.text}
|
|
|
3273
3273
|
importFromJSON: dn
|
|
3274
3274
|
}, Symbol.toStringTag, { value: "Module" })), cn = (e, o) => e.filter((a) => {
|
|
3275
3275
|
if (o.searchText) {
|
|
3276
|
-
const
|
|
3277
|
-
if (!r && !h && !
|
|
3276
|
+
const s = o.searchText.toLowerCase(), r = a.text.toLowerCase().includes(s), h = a.owner?.toLowerCase().includes(s), f = a.details?.toLowerCase().includes(s);
|
|
3277
|
+
if (!r && !h && !f)
|
|
3278
3278
|
return !1;
|
|
3279
3279
|
}
|
|
3280
3280
|
if (o.status !== "all" && (a.progress === 0 ? "not-started" : a.progress === 100 ? "completed" : "in-progress") !== o.status || o.priority !== "all" && a.priority !== o.priority || o.owner && a.owner !== o.owner)
|
|
3281
3281
|
return !1;
|
|
3282
3282
|
if (o.dateRange) {
|
|
3283
|
-
const
|
|
3284
|
-
if (
|
|
3283
|
+
const s = a.start.getTime(), r = o.dateRange.start.getTime(), h = o.dateRange.end.getTime();
|
|
3284
|
+
if (s < r || s > h)
|
|
3285
3285
|
return !1;
|
|
3286
3286
|
}
|
|
3287
3287
|
return !0;
|
|
@@ -3320,28 +3320,28 @@ ${i + 1}. ${a.text}
|
|
|
3320
3320
|
}
|
|
3321
3321
|
}, hn = (e, o, a) => {
|
|
3322
3322
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
3323
|
-
const
|
|
3323
|
+
const s = o.getTime(), r = a.getTime();
|
|
3324
3324
|
return e.map((h) => {
|
|
3325
|
-
const
|
|
3325
|
+
const f = Le(h?.start, o), l = Le(h?.end, a), i = Math.max(f.getTime(), s), g = Math.min(l.getTime(), r);
|
|
3326
3326
|
return {
|
|
3327
|
-
start: new Date(
|
|
3328
|
-
end: new Date(
|
|
3327
|
+
start: new Date(i),
|
|
3328
|
+
end: new Date(g)
|
|
3329
3329
|
};
|
|
3330
3330
|
}).filter((h) => h.end.getTime() > h.start.getTime());
|
|
3331
3331
|
}, mn = (e, o, a) => {
|
|
3332
3332
|
if (Array.isArray(e))
|
|
3333
|
-
return e.map((
|
|
3334
|
-
const r = Le(
|
|
3333
|
+
return e.map((s) => {
|
|
3334
|
+
const r = Le(s?.start, o), h = Le(s?.end, a), f = h.getTime() < r.getTime() ? r : h, l = Math.max(Math.ceil((f.getTime() - r.getTime()) / ut), 0);
|
|
3335
3335
|
return {
|
|
3336
3336
|
start: r,
|
|
3337
|
-
end:
|
|
3338
|
-
duration: _t(
|
|
3337
|
+
end: f,
|
|
3338
|
+
duration: _t(s?.duration, l)
|
|
3339
3339
|
};
|
|
3340
|
-
}).filter((
|
|
3340
|
+
}).filter((s) => s.end.getTime() >= s.start.getTime());
|
|
3341
3341
|
}, fn = (e) => {
|
|
3342
|
-
const o = /* @__PURE__ */ new Date(), a = Le(e.start ?? e.startDate ?? e.start_date, o),
|
|
3342
|
+
const o = /* @__PURE__ */ new Date(), a = Le(e.start ?? e.startDate ?? e.start_date, o), s = Le(e.end ?? e.endDate ?? e.end_date, a), r = s.getTime() < a.getTime() ? a : s, h = Le(e.plannedStart ?? e.planned_start ?? e.planned_start_date, a), f = Le(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), l = f.getTime() < h.getTime() ? h : f, i = Le(e.actualStart ?? e.actual_start ?? e.actual_start_date, a), g = Le(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), p = g.getTime() < i.getTime() ? i : g, w = Math.max(Math.ceil((r.getTime() - a.getTime()) / ut), 0), E = un(e.dependencies ?? e.dependsOn ?? e.depends_on), x = pn(
|
|
3343
3343
|
e.dependencyRule ?? e.dependency_rule ?? e.dependencyRuleDescription ?? e.dependency_rule_description
|
|
3344
|
-
),
|
|
3344
|
+
), j = hn(e.onHoldPeriods ?? e.on_hold_periods, a, r);
|
|
3345
3345
|
return {
|
|
3346
3346
|
id: String(e.id),
|
|
3347
3347
|
rawId: e.id,
|
|
@@ -3350,7 +3350,7 @@ ${i + 1}. ${a.text}
|
|
|
3350
3350
|
end: r,
|
|
3351
3351
|
plannedStart: h,
|
|
3352
3352
|
plannedEnd: l,
|
|
3353
|
-
actualStart:
|
|
3353
|
+
actualStart: i,
|
|
3354
3354
|
actualEnd: p,
|
|
3355
3355
|
duration: _t(e.duration, w),
|
|
3356
3356
|
progress: Math.max(0, Math.min(100, _t(e.progress ?? e.progressPercentage ?? e.progress_percentage, 0))),
|
|
@@ -3362,9 +3362,9 @@ ${i + 1}. ${a.text}
|
|
|
3362
3362
|
owner: e.owner || e.ownerName || e.owner_name,
|
|
3363
3363
|
priority: e.priority,
|
|
3364
3364
|
status: e.status ?? e.currentStatus ?? e.current_status,
|
|
3365
|
-
onHoldPeriods:
|
|
3366
|
-
dependencies:
|
|
3367
|
-
dependencyRule:
|
|
3365
|
+
onHoldPeriods: j,
|
|
3366
|
+
dependencies: E,
|
|
3367
|
+
dependencyRule: x,
|
|
3368
3368
|
segments: mn(e.segments, a, r),
|
|
3369
3369
|
sequence_id: e.sequence_id,
|
|
3370
3370
|
stage_id: e.stage_id,
|
|
@@ -3373,65 +3373,71 @@ ${i + 1}. ${a.text}
|
|
|
3373
3373
|
}, gn = (e) => Array.isArray(e) ? e.map(fn) : [], xn = (e, o) => {
|
|
3374
3374
|
if (o.length === 0) return e;
|
|
3375
3375
|
const a = [...o].sort(
|
|
3376
|
-
(
|
|
3376
|
+
(s, r) => s.start.getTime() - r.start.getTime()
|
|
3377
3377
|
);
|
|
3378
|
-
return e.map((
|
|
3379
|
-
if (
|
|
3380
|
-
return
|
|
3381
|
-
const r =
|
|
3382
|
-
if (
|
|
3383
|
-
for (const
|
|
3384
|
-
if (r >=
|
|
3378
|
+
return e.map((s) => {
|
|
3379
|
+
if (s.onHoldPeriods && s.onHoldPeriods.length > 0 || s.segments && s.segments.length > 0)
|
|
3380
|
+
return s;
|
|
3381
|
+
const r = s.start.getTime(), h = s.end.getTime(), f = h - r;
|
|
3382
|
+
if (f <= 0) {
|
|
3383
|
+
for (const v of a)
|
|
3384
|
+
if (r >= v.start.getTime() && r < v.end.getTime())
|
|
3385
3385
|
return {
|
|
3386
|
-
...
|
|
3387
|
-
start: new Date(
|
|
3388
|
-
end: new Date(
|
|
3386
|
+
...s,
|
|
3387
|
+
start: new Date(v.end.getTime()),
|
|
3388
|
+
end: new Date(v.end.getTime())
|
|
3389
3389
|
};
|
|
3390
|
-
return
|
|
3390
|
+
return s;
|
|
3391
3391
|
}
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3392
|
+
const l = a[a.length - 1].end.getTime();
|
|
3393
|
+
if (r >= l)
|
|
3394
|
+
return s;
|
|
3395
|
+
const i = a[0].start.getTime();
|
|
3396
|
+
if (h <= i)
|
|
3397
|
+
return s;
|
|
3398
|
+
let g = r, p = 0, w = 0;
|
|
3399
|
+
const E = [], x = [];
|
|
3400
|
+
for (; p < f; ) {
|
|
3401
|
+
for (; w < a.length && a[w].end.getTime() <= g; )
|
|
3402
|
+
w++;
|
|
3403
|
+
if (w < a.length) {
|
|
3404
|
+
const v = a[w], N = v.start.getTime(), S = v.end.getTime();
|
|
3405
|
+
if (g < N) {
|
|
3406
|
+
const m = N - g, O = Math.min(m, f - p);
|
|
3407
|
+
if (E.push({
|
|
3408
|
+
start: new Date(g),
|
|
3409
|
+
end: new Date(g + O),
|
|
3410
|
+
duration: Math.ceil(O / ut)
|
|
3411
|
+
}), p += O, g += O, p >= f) break;
|
|
3412
|
+
x.push({
|
|
3413
|
+
start: new Date(N),
|
|
3414
|
+
end: new Date(S)
|
|
3415
|
+
}), g = S, w++;
|
|
3410
3416
|
} else
|
|
3411
|
-
|
|
3412
|
-
start: new Date(
|
|
3413
|
-
end: new Date(
|
|
3414
|
-
}),
|
|
3417
|
+
x.push({
|
|
3418
|
+
start: new Date(g),
|
|
3419
|
+
end: new Date(S)
|
|
3420
|
+
}), g = S, w++;
|
|
3415
3421
|
} else {
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3418
|
-
start: new Date(
|
|
3419
|
-
end: new Date(
|
|
3420
|
-
duration: Math.ceil(
|
|
3421
|
-
}),
|
|
3422
|
+
const v = f - p;
|
|
3423
|
+
E.push({
|
|
3424
|
+
start: new Date(g),
|
|
3425
|
+
end: new Date(g + v),
|
|
3426
|
+
duration: Math.ceil(v / ut)
|
|
3427
|
+
}), p = f;
|
|
3422
3428
|
}
|
|
3423
3429
|
}
|
|
3424
|
-
if (
|
|
3425
|
-
const
|
|
3430
|
+
if (x.length === 0) return s;
|
|
3431
|
+
const j = E.length > 0 ? E[E.length - 1].end : s.end;
|
|
3426
3432
|
return {
|
|
3427
|
-
...
|
|
3428
|
-
end:
|
|
3433
|
+
...s,
|
|
3434
|
+
end: j,
|
|
3429
3435
|
duration: Math.max(
|
|
3430
|
-
Math.ceil((
|
|
3436
|
+
Math.ceil((j.getTime() - r) / ut),
|
|
3431
3437
|
0
|
|
3432
3438
|
),
|
|
3433
|
-
segments:
|
|
3434
|
-
onHoldPeriods:
|
|
3439
|
+
segments: E,
|
|
3440
|
+
onHoldPeriods: x
|
|
3435
3441
|
};
|
|
3436
3442
|
});
|
|
3437
3443
|
}, yn = (e) => [
|
|
@@ -3544,56 +3550,56 @@ ${i + 1}. ${a.text}
|
|
|
3544
3550
|
tasks: e = [],
|
|
3545
3551
|
links: o = [],
|
|
3546
3552
|
config: a = {},
|
|
3547
|
-
uiConfig:
|
|
3553
|
+
uiConfig: s = {},
|
|
3548
3554
|
styleConfig: r = {},
|
|
3549
3555
|
iconConfig: h = {},
|
|
3550
|
-
taskTooltipConfig:
|
|
3556
|
+
taskTooltipConfig: f = {},
|
|
3551
3557
|
onHoldPeriods: l,
|
|
3552
|
-
onTaskUpdate:
|
|
3553
|
-
onTaskDragUpdate:
|
|
3558
|
+
onTaskUpdate: i,
|
|
3559
|
+
onTaskDragUpdate: g,
|
|
3554
3560
|
onTaskCreate: p,
|
|
3555
3561
|
onTaskDelete: w,
|
|
3556
|
-
onLinkCreate:
|
|
3557
|
-
onLinkDelete:
|
|
3558
|
-
baselines:
|
|
3562
|
+
onLinkCreate: E,
|
|
3563
|
+
onLinkDelete: x,
|
|
3564
|
+
baselines: j
|
|
3559
3565
|
}) => {
|
|
3560
|
-
const
|
|
3566
|
+
const v = { ...Sn, ...s }, N = { ...bn, ...f }, S = G.useMemo(() => {
|
|
3561
3567
|
const u = {};
|
|
3562
|
-
return r.primary && (u["--wx-gantt-primary"] = r.primary), r.primarySelected && (u["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (u["--wx-gantt-success"] = r.success), r.warning && (u["--wx-gantt-warning"] = r.warning), r.danger && (u["--wx-gantt-danger"] = r.danger), r.background && (u["--wx-gantt-background"] = r.background), r.backgroundAlt && (u["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (u["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (u["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (u["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (u["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (u["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (u["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (u["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (u["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (u["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (u["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (u["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (u["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (u["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (u["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (u["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (u["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (u["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (u["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (u["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([
|
|
3563
|
-
u[
|
|
3568
|
+
return r.primary && (u["--wx-gantt-primary"] = r.primary), r.primarySelected && (u["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (u["--wx-gantt-success"] = r.success), r.warning && (u["--wx-gantt-warning"] = r.warning), r.danger && (u["--wx-gantt-danger"] = r.danger), r.background && (u["--wx-gantt-background"] = r.background), r.backgroundAlt && (u["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (u["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (u["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (u["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (u["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (u["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (u["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (u["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (u["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (u["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (u["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (u["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (u["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (u["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (u["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (u["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (u["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (u["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (u["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (u["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([T, n]) => {
|
|
3569
|
+
u[T.startsWith("--") ? T : `--${T}`] = n;
|
|
3564
3570
|
}), u;
|
|
3565
|
-
}, [r]),
|
|
3571
|
+
}, [r]), m = G.useMemo(() => {
|
|
3566
3572
|
if (!l || l.length === 0) return [];
|
|
3567
3573
|
const u = /* @__PURE__ */ new Date();
|
|
3568
|
-
return l.map((
|
|
3569
|
-
start: Le(
|
|
3570
|
-
end: Le(
|
|
3571
|
-
})).filter((
|
|
3574
|
+
return l.map((T) => ({
|
|
3575
|
+
start: Le(T.start, u),
|
|
3576
|
+
end: Le(T.end, u)
|
|
3577
|
+
})).filter((T) => T.end.getTime() > T.start.getTime());
|
|
3572
3578
|
}, [l]), O = G.useMemo(() => {
|
|
3573
3579
|
const u = gn(e);
|
|
3574
|
-
return xn(u,
|
|
3575
|
-
}, [e,
|
|
3580
|
+
return xn(u, m);
|
|
3581
|
+
}, [e, m]), J = Array.isArray(o) ? o : [], {
|
|
3576
3582
|
tasks: R,
|
|
3577
3583
|
links: V,
|
|
3578
3584
|
setTasks: Q,
|
|
3579
|
-
setLinks:
|
|
3585
|
+
setLinks: L,
|
|
3580
3586
|
undo: q,
|
|
3581
3587
|
redo: H,
|
|
3582
3588
|
updateTask: D,
|
|
3583
3589
|
createTask: I,
|
|
3584
3590
|
deleteTask: Z,
|
|
3585
3591
|
saveState: re
|
|
3586
|
-
} = tn(O, J), [B, ue] = X(R), [se, _] = X(null), [de, pe] = X(null), [ge, te] = X(!1), [ce, K] = X(void 0), [Se, ne] = X(void 0), [je, P] = X(!1), [c, b] = X(null), [
|
|
3592
|
+
} = tn(O, J), [B, ue] = X(R), [se, _] = X(null), [de, pe] = X(null), [ge, te] = X(!1), [ce, K] = X(void 0), [Se, ne] = X(void 0), [je, P] = X(!1), [c, b] = X(null), [$, F] = X(null), [W, ae] = X(null), [U, ie] = X(null), [oe, Te] = X(null), [De, Ue] = X(1), [Ae, Pe] = X(() => j && j.size > 0 ? j : O.length > 0 ? on(O) : /* @__PURE__ */ new Map());
|
|
3587
3593
|
Xe(() => {
|
|
3588
|
-
|
|
3589
|
-
}, [
|
|
3594
|
+
j && j.size > 0 && Pe(j);
|
|
3595
|
+
}, [j]);
|
|
3590
3596
|
const [pt] = X(a.theme || "light"), [ht, mt] = X({
|
|
3591
3597
|
searchText: "",
|
|
3592
3598
|
status: "all",
|
|
3593
3599
|
priority: "all",
|
|
3594
3600
|
owner: ""
|
|
3595
3601
|
}), tt = He(null), qe = He(null), Mt = He(null), rt = He(null), $e = He(null), ft = He(null), Ee = {
|
|
3596
|
-
columns: a.columns || yn(
|
|
3602
|
+
columns: a.columns || yn(s),
|
|
3597
3603
|
scales: wn,
|
|
3598
3604
|
readonly: !1,
|
|
3599
3605
|
editable: !0,
|
|
@@ -3684,59 +3690,59 @@ ${i + 1}. ${a.text}
|
|
|
3684
3690
|
end: Qe(ye(M, 60, "day"))
|
|
3685
3691
|
};
|
|
3686
3692
|
}
|
|
3687
|
-
const
|
|
3693
|
+
const T = u.map((M) => M.start.getTime()), n = u.map((M) => M.end.getTime()), d = new Date(Math.min(...T)), y = new Date(Math.max(...n));
|
|
3688
3694
|
return {
|
|
3689
3695
|
start: Qe(ye(d, -7, "day")),
|
|
3690
3696
|
end: Qe(y)
|
|
3691
3697
|
};
|
|
3692
3698
|
})(), Ft = (u) => {
|
|
3693
3699
|
_(u);
|
|
3694
|
-
}, Rt = (u,
|
|
3700
|
+
}, Rt = (u, T) => {
|
|
3695
3701
|
if (Ee.readonly) return;
|
|
3696
3702
|
u.preventDefault();
|
|
3697
|
-
const n = R.find((d) => d.id ===
|
|
3703
|
+
const n = R.find((d) => d.id === T);
|
|
3698
3704
|
n && Te({ x: u.clientX, y: u.clientY, task: n });
|
|
3699
3705
|
}, nt = () => {
|
|
3700
3706
|
if (!oe?.task) return;
|
|
3701
|
-
const u = oe.task,
|
|
3707
|
+
const u = oe.task, T = {
|
|
3702
3708
|
...u,
|
|
3703
3709
|
id: `task-${Date.now()}`,
|
|
3704
3710
|
text: `${u.text} (Copy)`,
|
|
3705
3711
|
start: ye(u.start, 7, "day"),
|
|
3706
3712
|
end: ye(u.end, 7, "day")
|
|
3707
3713
|
};
|
|
3708
|
-
I(
|
|
3714
|
+
I(T), p && p(T);
|
|
3709
3715
|
}, Ge = (u) => {
|
|
3710
3716
|
if (!oe?.task) return;
|
|
3711
|
-
const
|
|
3712
|
-
D(
|
|
3713
|
-
}, Fe = G.useCallback((u,
|
|
3717
|
+
const T = { ...oe.task, type: u };
|
|
3718
|
+
D(T), i && i(T);
|
|
3719
|
+
}, Fe = G.useCallback((u, T) => {
|
|
3714
3720
|
let n = [];
|
|
3715
|
-
return
|
|
3716
|
-
n.push(y.id), n = [...n, ...Fe(y.id,
|
|
3721
|
+
return T.filter((y) => y.parent === u).forEach((y) => {
|
|
3722
|
+
n.push(y.id), n = [...n, ...Fe(y.id, T)];
|
|
3717
3723
|
}), n;
|
|
3718
|
-
}, []), Je = (u,
|
|
3724
|
+
}, []), Je = (u, T) => (u ?? null) === (T ?? null), at = (u, T, n, d) => {
|
|
3719
3725
|
if (!Ee.readonly)
|
|
3720
3726
|
if (d === "reorder") {
|
|
3721
3727
|
const y = B.findIndex((A) => A.id === u), M = Fe(u, R);
|
|
3722
|
-
ae({ id: u, initialIndex: y, currentX:
|
|
3728
|
+
ae({ id: u, initialIndex: y, currentX: T, currentY: n, descendantIds: M }), document.body.classList.add("gantt-dragging");
|
|
3723
3729
|
} else
|
|
3724
3730
|
F(u);
|
|
3725
3731
|
}, gt = () => {
|
|
3726
3732
|
if (W && U) {
|
|
3727
|
-
const u = R.find((n) => n.id === W.id),
|
|
3728
|
-
if (u &&
|
|
3733
|
+
const u = R.find((n) => n.id === W.id), T = R.find((n) => n.id === U.taskId);
|
|
3734
|
+
if (u && T && u.id !== T.id) {
|
|
3729
3735
|
const n = [u.id, ...W.descendantIds];
|
|
3730
|
-
if (!n.includes(
|
|
3731
|
-
const d = [...R], y = (U.position === "inside" ?
|
|
3736
|
+
if (!n.includes(T.id)) {
|
|
3737
|
+
const d = [...R], y = (U.position === "inside" ? T.id : T.parent) ?? void 0, M = d.findIndex((Y) => Y.id === u.id);
|
|
3732
3738
|
M !== -1 && (d[M] = { ...d[M], parent: y });
|
|
3733
3739
|
const A = d.filter((Y) => n.includes(Y.id)), C = d.filter((Y) => !n.includes(Y.id));
|
|
3734
|
-
let k = C.findIndex((Y) => Y.id ===
|
|
3740
|
+
let k = C.findIndex((Y) => Y.id === T.id);
|
|
3735
3741
|
if (U.position === "inside") {
|
|
3736
|
-
const Y = [
|
|
3742
|
+
const Y = [T.id, ...Fe(T.id, C)], We = Y[Y.length - 1];
|
|
3737
3743
|
k = C.findIndex(($t) => $t.id === We) + 1;
|
|
3738
3744
|
} else if (U.position === "below") {
|
|
3739
|
-
const Y = Fe(
|
|
3745
|
+
const Y = Fe(T.id, C);
|
|
3740
3746
|
Y.length > 0 ? k = C.findIndex((We) => We.id === Y[Y.length - 1]) + 1 : k++;
|
|
3741
3747
|
}
|
|
3742
3748
|
k < 0 && (k = C.length);
|
|
@@ -3753,7 +3759,7 @@ ${i + 1}. ${a.text}
|
|
|
3753
3759
|
sequence_id: ve,
|
|
3754
3760
|
stage_id: y ?? null
|
|
3755
3761
|
};
|
|
3756
|
-
|
|
3762
|
+
i && i(Y, Oe), g && g({
|
|
3757
3763
|
task: Y,
|
|
3758
3764
|
previousTask: u,
|
|
3759
3765
|
dragType: "reorder",
|
|
@@ -3766,7 +3772,7 @@ ${i + 1}. ${a.text}
|
|
|
3766
3772
|
F(null), ae(null), ie(null), document.body.classList.remove("gantt-dragging");
|
|
3767
3773
|
}, ot = He(null), xt = G.useCallback((u) => {
|
|
3768
3774
|
if (W) {
|
|
3769
|
-
const { clientX:
|
|
3775
|
+
const { clientX: T, clientY: n } = u;
|
|
3770
3776
|
ot.current && cancelAnimationFrame(ot.current), ot.current = requestAnimationFrame(() => {
|
|
3771
3777
|
const d = Ee.rowHeight || 48, y = qe.current?.querySelector(".gantt-grid-body");
|
|
3772
3778
|
if (!y || B.length === 0) {
|
|
@@ -3779,23 +3785,23 @@ ${i + 1}. ${a.text}
|
|
|
3779
3785
|
const k = B[C];
|
|
3780
3786
|
if (k) {
|
|
3781
3787
|
if (k.id === W.id || W.descendantIds.includes(k.id)) {
|
|
3782
|
-
ie(null), ae((le) => le ? { ...le, currentX:
|
|
3788
|
+
ie(null), ae((le) => le ? { ...le, currentX: T, currentY: n } : null);
|
|
3783
3789
|
return;
|
|
3784
3790
|
}
|
|
3785
3791
|
const me = A - C * d;
|
|
3786
3792
|
let ee = "above";
|
|
3787
3793
|
k.type !== "milestone" ? me < d * 0.3 ? ee = "above" : me > d * 0.7 ? ee = "below" : ee = "inside" : ee = me < d / 2 ? "above" : "below", ie({ taskId: k.id, position: ee });
|
|
3788
3794
|
}
|
|
3789
|
-
ae((z) => z ? { ...z, currentX:
|
|
3795
|
+
ae((z) => z ? { ...z, currentX: T, currentY: n } : null);
|
|
3790
3796
|
});
|
|
3791
3797
|
}
|
|
3792
3798
|
}, [W, B, Ee.rowHeight]), yt = () => {
|
|
3793
3799
|
W && gt();
|
|
3794
|
-
}, wt = (u,
|
|
3800
|
+
}, wt = (u, T) => {
|
|
3795
3801
|
const n = {
|
|
3796
3802
|
...u,
|
|
3797
3803
|
id: `task-${Date.now()}`,
|
|
3798
|
-
parent:
|
|
3804
|
+
parent: T
|
|
3799
3805
|
// Set parent if provided (for subtasks)
|
|
3800
3806
|
};
|
|
3801
3807
|
I(n);
|
|
@@ -3811,22 +3817,22 @@ ${i + 1}. ${a.text}
|
|
|
3811
3817
|
return M.set(n.id, d), M;
|
|
3812
3818
|
}), p && p(n);
|
|
3813
3819
|
}, Be = (u) => {
|
|
3814
|
-
D(u),
|
|
3820
|
+
D(u), i && i(u);
|
|
3815
3821
|
}, bt = (u) => {
|
|
3816
|
-
Z(u), Pe((
|
|
3817
|
-
const n = new Map(
|
|
3822
|
+
Z(u), Pe((T) => {
|
|
3823
|
+
const n = new Map(T);
|
|
3818
3824
|
return n.delete(u), n;
|
|
3819
3825
|
}), w && w(u);
|
|
3820
|
-
}, St = (u,
|
|
3821
|
-
const y = { id: `link-${Date.now()}`, source: u, target:
|
|
3822
|
-
|
|
3826
|
+
}, St = (u, T, n, d) => {
|
|
3827
|
+
const y = { id: `link-${Date.now()}`, source: u, target: T, type: n, lag: d };
|
|
3828
|
+
L([...V, y]), E && E(y);
|
|
3823
3829
|
}, st = (u) => {
|
|
3824
|
-
const
|
|
3825
|
-
|
|
3830
|
+
const T = V.filter((n) => n.id !== u);
|
|
3831
|
+
L(T), x && x(u);
|
|
3826
3832
|
};
|
|
3827
3833
|
Xe(() => {
|
|
3828
3834
|
const u = new Map(Ae);
|
|
3829
|
-
let
|
|
3835
|
+
let T = !1;
|
|
3830
3836
|
R.forEach((d) => {
|
|
3831
3837
|
Ae.has(d.id) || (u.set(d.id, {
|
|
3832
3838
|
taskId: d.id,
|
|
@@ -3834,31 +3840,31 @@ ${i + 1}. ${a.text}
|
|
|
3834
3840
|
// Capture original start date
|
|
3835
3841
|
end: new Date(d.end)
|
|
3836
3842
|
// Capture original end date
|
|
3837
|
-
}),
|
|
3843
|
+
}), T = !0);
|
|
3838
3844
|
});
|
|
3839
3845
|
const n = new Set(R.map((d) => d.id));
|
|
3840
3846
|
Ae.forEach((d, y) => {
|
|
3841
|
-
n.has(y) || (u.delete(y),
|
|
3842
|
-
}),
|
|
3847
|
+
n.has(y) || (u.delete(y), T = !0);
|
|
3848
|
+
}), T && Pe(u);
|
|
3843
3849
|
}, [R]), Xe(() => {
|
|
3844
|
-
const u = (
|
|
3845
|
-
(
|
|
3850
|
+
const u = (T) => {
|
|
3851
|
+
(T.ctrlKey || T.metaKey) && (T.key === "z" && !T.shiftKey ? (T.preventDefault(), q()) : (T.key === "y" || T.key === "z" && T.shiftKey) && (T.preventDefault(), H()));
|
|
3846
3852
|
};
|
|
3847
3853
|
return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
|
|
3848
3854
|
}, [q, H]), Xe(() => {
|
|
3849
|
-
const u = qe.current?.querySelector(".gantt-grid-body"),
|
|
3850
|
-
if (!u || !
|
|
3855
|
+
const u = qe.current?.querySelector(".gantt-grid-body"), T = tt.current?.querySelector(".gantt-timeline-body");
|
|
3856
|
+
if (!u || !T) return;
|
|
3851
3857
|
const n = () => {
|
|
3852
|
-
$e.current !== "timeline" && ($e.current = "grid",
|
|
3858
|
+
$e.current !== "timeline" && ($e.current = "grid", T.scrollTop = u.scrollTop, requestAnimationFrame(() => {
|
|
3853
3859
|
$e.current = null;
|
|
3854
3860
|
}));
|
|
3855
3861
|
}, d = () => {
|
|
3856
|
-
$e.current !== "grid" && ($e.current = "timeline", u.scrollTop =
|
|
3862
|
+
$e.current !== "grid" && ($e.current = "timeline", u.scrollTop = T.scrollTop, requestAnimationFrame(() => {
|
|
3857
3863
|
$e.current = null;
|
|
3858
3864
|
}));
|
|
3859
3865
|
};
|
|
3860
|
-
return u.addEventListener("scroll", n, { passive: !0 }),
|
|
3861
|
-
u.removeEventListener("scroll", n),
|
|
3866
|
+
return u.addEventListener("scroll", n, { passive: !0 }), T.addEventListener("scroll", d, { passive: !0 }), () => {
|
|
3867
|
+
u.removeEventListener("scroll", n), T.removeEventListener("scroll", d), ft.current && clearTimeout(ft.current);
|
|
3862
3868
|
};
|
|
3863
3869
|
}, [B]);
|
|
3864
3870
|
const vt = {
|
|
@@ -3873,7 +3879,7 @@ ${i + 1}. ${a.text}
|
|
|
3873
3879
|
className: `gantt-page-wrapper theme-${pt}`,
|
|
3874
3880
|
style: { ...vt, ...S },
|
|
3875
3881
|
children: [
|
|
3876
|
-
|
|
3882
|
+
v.showHeader && /* @__PURE__ */ t.jsx("div", { className: "gantt-page-header", children: /* @__PURE__ */ t.jsx("div", { className: "gantt-page-header-left", children: /* @__PURE__ */ t.jsx("h1", { className: "gantt-page-title", children: v.headerTitle }) }) }),
|
|
3877
3883
|
/* @__PURE__ */ t.jsxs(
|
|
3878
3884
|
"div",
|
|
3879
3885
|
{
|
|
@@ -3893,13 +3899,13 @@ ${i + 1}. ${a.text}
|
|
|
3893
3899
|
owners: Et || [],
|
|
3894
3900
|
onAddTask: (u) => {
|
|
3895
3901
|
if (u) {
|
|
3896
|
-
const
|
|
3897
|
-
K(u), ne(
|
|
3902
|
+
const T = R.find((n) => n.id === u);
|
|
3903
|
+
K(u), ne(T?.text);
|
|
3898
3904
|
} else
|
|
3899
3905
|
K(void 0), ne(void 0);
|
|
3900
3906
|
te(!0);
|
|
3901
3907
|
},
|
|
3902
|
-
uiConfig:
|
|
3908
|
+
uiConfig: v,
|
|
3903
3909
|
iconConfig: h,
|
|
3904
3910
|
styleConfig: r
|
|
3905
3911
|
}
|
|
@@ -3918,8 +3924,8 @@ ${i + 1}. ${a.text}
|
|
|
3918
3924
|
onTaskDragStart: at,
|
|
3919
3925
|
onAddTask: (u) => {
|
|
3920
3926
|
if (u) {
|
|
3921
|
-
const
|
|
3922
|
-
K(u), ne(
|
|
3927
|
+
const T = R.find((n) => n.id === u);
|
|
3928
|
+
K(u), ne(T?.text);
|
|
3923
3929
|
} else
|
|
3924
3930
|
K(void 0), ne(void 0);
|
|
3925
3931
|
te(!0);
|
|
@@ -3927,8 +3933,8 @@ ${i + 1}. ${a.text}
|
|
|
3927
3933
|
onAddDependency: St,
|
|
3928
3934
|
onRemoveDependency: st,
|
|
3929
3935
|
onDependencyClick: (u) => {
|
|
3930
|
-
const
|
|
3931
|
-
|
|
3936
|
+
const T = R.find((n) => n.id === u);
|
|
3937
|
+
T && (b(T), P(!0));
|
|
3932
3938
|
},
|
|
3933
3939
|
links: V,
|
|
3934
3940
|
allTasks: R,
|
|
@@ -3948,18 +3954,18 @@ ${i + 1}. ${a.text}
|
|
|
3948
3954
|
scales: Ee.scales,
|
|
3949
3955
|
config: Ee,
|
|
3950
3956
|
selectedTask: se,
|
|
3951
|
-
draggedTask:
|
|
3957
|
+
draggedTask: $,
|
|
3952
3958
|
onTaskClick: () => {
|
|
3953
3959
|
},
|
|
3954
3960
|
onTaskDragStart: () => {
|
|
3955
3961
|
},
|
|
3956
3962
|
onTaskDragEnd: () => {
|
|
3957
3963
|
},
|
|
3958
|
-
onTaskUpdate: (u,
|
|
3964
|
+
onTaskUpdate: (u, T, n) => {
|
|
3959
3965
|
const d = R.find((A) => A.id === u);
|
|
3960
3966
|
if (!d) return;
|
|
3961
|
-
const y = { ...d }, M = { ...d, ...
|
|
3962
|
-
Be(M), n &&
|
|
3967
|
+
const y = { ...d }, M = { ...d, ...T };
|
|
3968
|
+
Be(M), n && g && g({
|
|
3963
3969
|
task: M,
|
|
3964
3970
|
previousTask: y,
|
|
3965
3971
|
dragType: n.dragType
|
|
@@ -3967,7 +3973,7 @@ ${i + 1}. ${a.text}
|
|
|
3967
3973
|
},
|
|
3968
3974
|
zoomLevel: De,
|
|
3969
3975
|
baselines: Ae,
|
|
3970
|
-
taskTooltipConfig:
|
|
3976
|
+
taskTooltipConfig: N
|
|
3971
3977
|
}
|
|
3972
3978
|
)
|
|
3973
3979
|
] }),
|
|
@@ -3978,13 +3984,13 @@ ${i + 1}. ${a.text}
|
|
|
3978
3984
|
onClose: () => {
|
|
3979
3985
|
te(!1), K(void 0), ne(void 0);
|
|
3980
3986
|
},
|
|
3981
|
-
uiConfig:
|
|
3987
|
+
uiConfig: v,
|
|
3982
3988
|
parentId: ce,
|
|
3983
3989
|
parentTaskName: Se,
|
|
3984
3990
|
styleConfig: r
|
|
3985
3991
|
}
|
|
3986
3992
|
),
|
|
3987
|
-
de && /* @__PURE__ */ t.jsx(Kr, { task: de, onUpdate: Be, onDelete: bt, onClose: () => pe(null), uiConfig:
|
|
3993
|
+
de && /* @__PURE__ */ t.jsx(Kr, { task: de, onUpdate: Be, onDelete: bt, onClose: () => pe(null), uiConfig: v, styleConfig: r }),
|
|
3988
3994
|
je && c && /* @__PURE__ */ t.jsx(
|
|
3989
3995
|
Qr,
|
|
3990
3996
|
{
|
|
@@ -4036,7 +4042,7 @@ ${i + 1}. ${a.text}
|
|
|
4036
4042
|
W && (() => {
|
|
4037
4043
|
const u = R.find((k) => k.id === W.id);
|
|
4038
4044
|
if (!u) return null;
|
|
4039
|
-
const
|
|
4045
|
+
const T = Number.isFinite(W.currentX) ? W.currentX : 0, n = Number.isFinite(W.currentY) ? W.currentY : 0, d = Ee.rowHeight || 48, M = rt.current?.getBoundingClientRect(), A = M ? T - M.left + 12 : T + 12, C = M ? n - M.top + 12 : n + 12;
|
|
4040
4046
|
return /* @__PURE__ */ t.jsxs(
|
|
4041
4047
|
"div",
|
|
4042
4048
|
{
|
|
@@ -4067,53 +4073,53 @@ ${i + 1}. ${a.text}
|
|
|
4067
4073
|
}
|
|
4068
4074
|
);
|
|
4069
4075
|
}, vn = (e, o) => {
|
|
4070
|
-
const a = /* @__PURE__ */ new Set(),
|
|
4071
|
-
e.forEach((
|
|
4072
|
-
r.set(
|
|
4073
|
-
}), o.forEach((
|
|
4074
|
-
|
|
4076
|
+
const a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
4077
|
+
e.forEach((x) => {
|
|
4078
|
+
r.set(x.id, []), h.set(x.id, []);
|
|
4079
|
+
}), o.forEach((x) => {
|
|
4080
|
+
x.type === "e2s" && (r.get(x.source)?.push(x.target), h.get(x.target)?.push(x.source));
|
|
4075
4081
|
});
|
|
4076
|
-
const
|
|
4077
|
-
if (
|
|
4078
|
-
|
|
4079
|
-
const
|
|
4080
|
-
if (!
|
|
4081
|
-
const
|
|
4082
|
-
if (
|
|
4083
|
-
|
|
4082
|
+
const f = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = (x, j = /* @__PURE__ */ new Set()) => {
|
|
4083
|
+
if (j.has(x)) return;
|
|
4084
|
+
j.add(x);
|
|
4085
|
+
const v = e.find((S) => S.id === x);
|
|
4086
|
+
if (!v) return;
|
|
4087
|
+
const N = h.get(x) || [];
|
|
4088
|
+
if (N.length === 0)
|
|
4089
|
+
f.set(x, 0), l.set(x, v.duration);
|
|
4084
4090
|
else {
|
|
4085
4091
|
let S = 0;
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
const O = l.get(
|
|
4092
|
+
N.forEach((m) => {
|
|
4093
|
+
i(m, j);
|
|
4094
|
+
const O = l.get(m) || 0;
|
|
4089
4095
|
S = Math.max(S, O);
|
|
4090
|
-
}),
|
|
4096
|
+
}), f.set(x, S), l.set(x, S + v.duration);
|
|
4091
4097
|
}
|
|
4092
4098
|
};
|
|
4093
|
-
e.forEach((
|
|
4094
|
-
const
|
|
4095
|
-
if (
|
|
4096
|
-
|
|
4097
|
-
const
|
|
4098
|
-
if (!
|
|
4099
|
-
const
|
|
4100
|
-
if (
|
|
4101
|
-
p.set(
|
|
4099
|
+
e.forEach((x) => i(x.id));
|
|
4100
|
+
const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), w = Math.max(...Array.from(l.values())), E = (x, j = /* @__PURE__ */ new Set()) => {
|
|
4101
|
+
if (j.has(x)) return;
|
|
4102
|
+
j.add(x);
|
|
4103
|
+
const v = e.find((S) => S.id === x);
|
|
4104
|
+
if (!v) return;
|
|
4105
|
+
const N = r.get(x) || [];
|
|
4106
|
+
if (N.length === 0)
|
|
4107
|
+
p.set(x, w), g.set(x, w - v.duration);
|
|
4102
4108
|
else {
|
|
4103
4109
|
let S = 1 / 0;
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
const O =
|
|
4110
|
+
N.forEach((m) => {
|
|
4111
|
+
E(m, j);
|
|
4112
|
+
const O = g.get(m) || 0;
|
|
4107
4113
|
S = Math.min(S, O);
|
|
4108
|
-
}), p.set(
|
|
4114
|
+
}), p.set(x, S), g.set(x, S - v.duration);
|
|
4109
4115
|
}
|
|
4110
4116
|
};
|
|
4111
|
-
return e.forEach((
|
|
4112
|
-
const
|
|
4113
|
-
|
|
4117
|
+
return e.forEach((x) => E(x.id)), e.forEach((x) => {
|
|
4118
|
+
const j = f.get(x.id) || 0, N = (g.get(x.id) || 0) - j;
|
|
4119
|
+
s.set(x.id, N), Math.abs(N) < 0.01 && a.add(x.id);
|
|
4114
4120
|
}), {
|
|
4115
4121
|
criticalTasks: a,
|
|
4116
|
-
taskFloats:
|
|
4122
|
+
taskFloats: s,
|
|
4117
4123
|
projectDuration: w
|
|
4118
4124
|
};
|
|
4119
4125
|
}, jn = (e, o) => o.criticalTasks.has(e), Tn = (e, o) => o.taskFloats.get(e) || 0, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|