iris-gantt 1.5.8 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CUSTOMIZATION_GUIDE.md +392 -0
- package/DATE_FORMATTING_GUIDE.md +121 -0
- package/PACKAGE_SETUP.md +4 -1
- package/PROPS_REFERENCE.md +586 -0
- package/QUICK_START.md +29 -0
- package/README.md +28 -3
- package/RESPONSIVE_STYLING.md +261 -0
- package/USAGE.md +19 -0
- package/dist/Gantt/DragDrop.d.ts.map +1 -1
- package/dist/Gantt/Gantt.d.ts.map +1 -1
- package/dist/Gantt/TaskBar.d.ts.map +1 -1
- package/dist/Gantt/Timeline.d.ts.map +1 -1
- package/dist/gantt.css +1 -1
- package/dist/iris-gantt.js +820 -817
- package/dist/iris-gantt.umd.cjs +9 -9
- package/package.json +6 -2
package/dist/iris-gantt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Typography as br, Select as
|
|
3
|
-
import { FontAwesomeIcon as
|
|
1
|
+
import A, { useState as G, memo as Ir, forwardRef as wr, useCallback as Je, useEffect as ut, useRef as ft } from "react";
|
|
2
|
+
import { Typography as br, Select as ke, InputNumber as at, Button as Pe, Popover as zr, Tooltip as nt, Input as pt, Space as er, Segmented as Br, Divider as tr, Form as je, Modal as At, DatePicker as Sr, ColorPicker as vr, Alert as Hr, Card as dr, List as Jt, Tag as Wr, Menu as Vr } from "antd";
|
|
3
|
+
import { FontAwesomeIcon as Ee } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { faChevronDown as cr, faPlus as ar, faGripVertical as Xr, faChevronRight as Ur, faTimesCircle as qr, faSearchMinus as Gr, faSearchPlus as Jr, faRotateLeft as jr, faFileCsv as Kr, faFileExcel as Zr, faFileCode as Qr, faFilePdf as en, faExclamationTriangle as tn, faLink as Tr, faTrash as Dr, faInfoCircle as rn, faEdit as nn, faCopy as an, faFlag as on, faTasks as sn, faFolder as ln } from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import Mr from "dayjs";
|
|
6
6
|
var Yt = { exports: {} }, Ft = {};
|
|
@@ -8,13 +8,13 @@ var ur;
|
|
|
8
8
|
function dn() {
|
|
9
9
|
if (ur) return Ft;
|
|
10
10
|
ur = 1;
|
|
11
|
-
var e =
|
|
11
|
+
var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
12
12
|
function b(u, d, p) {
|
|
13
|
-
var h,
|
|
14
|
-
p !== void 0 && (
|
|
15
|
-
for (h in d) s.call(d, h) && !c.hasOwnProperty(h) && (
|
|
16
|
-
if (u && u.defaultProps) for (h in d = u.defaultProps, d)
|
|
17
|
-
return { $$typeof: a, type: u, key:
|
|
13
|
+
var h, v = {}, y = null, m = null;
|
|
14
|
+
p !== void 0 && (y = "" + p), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (m = d.ref);
|
|
15
|
+
for (h in d) s.call(d, h) && !c.hasOwnProperty(h) && (v[h] = d[h]);
|
|
16
|
+
if (u && u.defaultProps) for (h in d = u.defaultProps, d) v[h] === void 0 && (v[h] = d[h]);
|
|
17
|
+
return { $$typeof: a, type: u, key: y, ref: m, props: v, _owner: r.current };
|
|
18
18
|
}
|
|
19
19
|
return Ft.Fragment = n, Ft.jsx = b, Ft.jsxs = b, Ft;
|
|
20
20
|
}
|
|
@@ -22,54 +22,54 @@ var Rt = {};
|
|
|
22
22
|
var pr;
|
|
23
23
|
function cn() {
|
|
24
24
|
return pr || (pr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
25
|
-
var e =
|
|
25
|
+
var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.provider"), u = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), p = /* @__PURE__ */ Symbol.for("react.suspense"), h = /* @__PURE__ */ Symbol.for("react.suspense_list"), v = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), m = /* @__PURE__ */ Symbol.for("react.offscreen"), E = Symbol.iterator, F = "@@iterator";
|
|
26
26
|
function N(o) {
|
|
27
27
|
if (o === null || typeof o != "object")
|
|
28
28
|
return null;
|
|
29
|
-
var
|
|
30
|
-
return typeof
|
|
29
|
+
var x = E && o[E] || o[F];
|
|
30
|
+
return typeof x == "function" ? x : null;
|
|
31
31
|
}
|
|
32
32
|
var M = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
33
|
-
function
|
|
33
|
+
function S(o) {
|
|
34
34
|
{
|
|
35
|
-
for (var
|
|
36
|
-
L[
|
|
37
|
-
|
|
35
|
+
for (var x = arguments.length, L = new Array(x > 1 ? x - 1 : 0), _ = 1; _ < x; _++)
|
|
36
|
+
L[_ - 1] = arguments[_];
|
|
37
|
+
w("error", o, L);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function w(o, x, L) {
|
|
41
41
|
{
|
|
42
|
-
var
|
|
43
|
-
te !== "" && (
|
|
44
|
-
var oe = L.map(function(
|
|
45
|
-
return String(
|
|
42
|
+
var _ = M.ReactDebugCurrentFrame, te = _.getStackAddendum();
|
|
43
|
+
te !== "" && (x += "%s", L = L.concat([te]));
|
|
44
|
+
var oe = L.map(function(Q) {
|
|
45
|
+
return String(Q);
|
|
46
46
|
});
|
|
47
|
-
oe.unshift("Warning: " +
|
|
47
|
+
oe.unshift("Warning: " + x), Function.prototype.apply.call(console[o], console, oe);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
var C = !1,
|
|
50
|
+
var C = !1, Z = !1, W = !1, re = !1, le = !1, j;
|
|
51
51
|
j = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
52
52
|
function X(o) {
|
|
53
|
-
return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o === p || o === h || re || o === m || C ||
|
|
53
|
+
return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o === p || o === h || re || o === m || C || Z || W || typeof o == "object" && o !== null && (o.$$typeof === y || o.$$typeof === v || o.$$typeof === b || o.$$typeof === u || o.$$typeof === d || // This needs to include all possible module reference object
|
|
54
54
|
// types supported by any Flight configuration anywhere since
|
|
55
55
|
// we don't know which Flight build this will end up being used
|
|
56
56
|
// with.
|
|
57
57
|
o.$$typeof === j || o.getModuleId !== void 0));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
var
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
var te =
|
|
59
|
+
function R(o, x, L) {
|
|
60
|
+
var _ = o.displayName;
|
|
61
|
+
if (_)
|
|
62
|
+
return _;
|
|
63
|
+
var te = x.displayName || x.name || "";
|
|
64
64
|
return te !== "" ? L + "(" + te + ")" : L;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function O(o) {
|
|
67
67
|
return o.displayName || "Context";
|
|
68
68
|
}
|
|
69
69
|
function B(o) {
|
|
70
70
|
if (o == null)
|
|
71
71
|
return null;
|
|
72
|
-
if (typeof o.tag == "number" &&
|
|
72
|
+
if (typeof o.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
|
|
73
73
|
return o.displayName || o.name || null;
|
|
74
74
|
if (typeof o == "string")
|
|
75
75
|
return o;
|
|
@@ -90,20 +90,20 @@ function cn() {
|
|
|
90
90
|
if (typeof o == "object")
|
|
91
91
|
switch (o.$$typeof) {
|
|
92
92
|
case u:
|
|
93
|
-
var
|
|
94
|
-
return
|
|
93
|
+
var x = o;
|
|
94
|
+
return O(x) + ".Consumer";
|
|
95
95
|
case b:
|
|
96
96
|
var L = o;
|
|
97
|
-
return
|
|
97
|
+
return O(L._context) + ".Provider";
|
|
98
98
|
case d:
|
|
99
|
-
return
|
|
100
|
-
case
|
|
101
|
-
var
|
|
102
|
-
return
|
|
103
|
-
case
|
|
104
|
-
var te = o, oe = te._payload,
|
|
99
|
+
return R(o, o.render, "ForwardRef");
|
|
100
|
+
case v:
|
|
101
|
+
var _ = o.displayName || null;
|
|
102
|
+
return _ !== null ? _ : B(o.type) || "Memo";
|
|
103
|
+
case y: {
|
|
104
|
+
var te = o, oe = te._payload, Q = te._init;
|
|
105
105
|
try {
|
|
106
|
-
return B(
|
|
106
|
+
return B(Q(oe));
|
|
107
107
|
} catch {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
@@ -111,14 +111,14 @@ function cn() {
|
|
|
111
111
|
}
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
114
|
-
var Y = Object.assign,
|
|
114
|
+
var Y = Object.assign, k = 0, De, Se, V, I, ne, de, se;
|
|
115
115
|
function ue() {
|
|
116
116
|
}
|
|
117
117
|
ue.__reactDisabledLog = !0;
|
|
118
118
|
function z() {
|
|
119
119
|
{
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (k === 0) {
|
|
121
|
+
De = console.log, Se = console.info, V = console.warn, I = console.error, ne = console.group, de = console.groupCollapsed, se = console.groupEnd;
|
|
122
122
|
var o = {
|
|
123
123
|
configurable: !0,
|
|
124
124
|
enumerable: !0,
|
|
@@ -135,12 +135,12 @@ function cn() {
|
|
|
135
135
|
groupEnd: o
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
k++;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ye() {
|
|
142
142
|
{
|
|
143
|
-
if (
|
|
143
|
+
if (k--, k === 0) {
|
|
144
144
|
var o = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
@@ -148,10 +148,10 @@ function cn() {
|
|
|
148
148
|
};
|
|
149
149
|
Object.defineProperties(console, {
|
|
150
150
|
log: Y({}, o, {
|
|
151
|
-
value:
|
|
151
|
+
value: De
|
|
152
152
|
}),
|
|
153
153
|
info: Y({}, o, {
|
|
154
|
-
value:
|
|
154
|
+
value: Se
|
|
155
155
|
}),
|
|
156
156
|
warn: Y({}, o, {
|
|
157
157
|
value: V
|
|
@@ -170,107 +170,107 @@ function cn() {
|
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
k < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function Ye(o,
|
|
176
|
+
var Le = M.ReactCurrentDispatcher, Ie;
|
|
177
|
+
function Ye(o, x, L) {
|
|
178
178
|
{
|
|
179
179
|
if (Ie === void 0)
|
|
180
180
|
try {
|
|
181
181
|
throw Error();
|
|
182
182
|
} catch (te) {
|
|
183
|
-
var
|
|
184
|
-
Ie =
|
|
183
|
+
var _ = te.stack.trim().match(/\n( *(at )?)/);
|
|
184
|
+
Ie = _ && _[1] || "";
|
|
185
185
|
}
|
|
186
186
|
return `
|
|
187
187
|
` + Ie + o;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var $ = !1,
|
|
190
|
+
var $ = !1, J;
|
|
191
191
|
{
|
|
192
|
-
var
|
|
193
|
-
|
|
192
|
+
var xe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
193
|
+
J = new xe();
|
|
194
194
|
}
|
|
195
|
-
function Qe(o,
|
|
195
|
+
function Qe(o, x) {
|
|
196
196
|
if (!o || $)
|
|
197
197
|
return "";
|
|
198
198
|
{
|
|
199
|
-
var L =
|
|
199
|
+
var L = J.get(o);
|
|
200
200
|
if (L !== void 0)
|
|
201
201
|
return L;
|
|
202
202
|
}
|
|
203
|
-
var
|
|
203
|
+
var _;
|
|
204
204
|
$ = !0;
|
|
205
205
|
var te = Error.prepareStackTrace;
|
|
206
206
|
Error.prepareStackTrace = void 0;
|
|
207
207
|
var oe;
|
|
208
|
-
oe =
|
|
208
|
+
oe = Le.current, Le.current = null, z();
|
|
209
209
|
try {
|
|
210
|
-
if (
|
|
211
|
-
var
|
|
210
|
+
if (x) {
|
|
211
|
+
var Q = function() {
|
|
212
212
|
throw Error();
|
|
213
213
|
};
|
|
214
|
-
if (Object.defineProperty(
|
|
214
|
+
if (Object.defineProperty(Q.prototype, "props", {
|
|
215
215
|
set: function() {
|
|
216
216
|
throw Error();
|
|
217
217
|
}
|
|
218
218
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
219
219
|
try {
|
|
220
|
-
Reflect.construct(
|
|
220
|
+
Reflect.construct(Q, []);
|
|
221
221
|
} catch (Ne) {
|
|
222
|
-
|
|
222
|
+
_ = Ne;
|
|
223
223
|
}
|
|
224
|
-
Reflect.construct(o, [],
|
|
224
|
+
Reflect.construct(o, [], Q);
|
|
225
225
|
} else {
|
|
226
226
|
try {
|
|
227
|
-
|
|
227
|
+
Q.call();
|
|
228
228
|
} catch (Ne) {
|
|
229
|
-
|
|
229
|
+
_ = Ne;
|
|
230
230
|
}
|
|
231
|
-
o.call(
|
|
231
|
+
o.call(Q.prototype);
|
|
232
232
|
}
|
|
233
233
|
} else {
|
|
234
234
|
try {
|
|
235
235
|
throw Error();
|
|
236
236
|
} catch (Ne) {
|
|
237
|
-
|
|
237
|
+
_ = Ne;
|
|
238
238
|
}
|
|
239
239
|
o();
|
|
240
240
|
}
|
|
241
241
|
} catch (Ne) {
|
|
242
|
-
if (Ne &&
|
|
243
|
-
for (var
|
|
244
|
-
`), Re =
|
|
245
|
-
`),
|
|
246
|
-
|
|
247
|
-
for (;
|
|
248
|
-
if (
|
|
249
|
-
if (
|
|
242
|
+
if (Ne && _ && typeof Ne.stack == "string") {
|
|
243
|
+
for (var K = Ne.stack.split(`
|
|
244
|
+
`), Re = _.stack.split(`
|
|
245
|
+
`), we = K.length - 1, be = Re.length - 1; we >= 1 && be >= 0 && K[we] !== Re[be]; )
|
|
246
|
+
be--;
|
|
247
|
+
for (; we >= 1 && be >= 0; we--, be--)
|
|
248
|
+
if (K[we] !== Re[be]) {
|
|
249
|
+
if (we !== 1 || be !== 1)
|
|
250
250
|
do
|
|
251
|
-
if (
|
|
251
|
+
if (we--, be--, be < 0 || K[we] !== Re[be]) {
|
|
252
252
|
var Be = `
|
|
253
|
-
` +
|
|
254
|
-
return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" &&
|
|
253
|
+
` + K[we].replace(" at new ", " at ");
|
|
254
|
+
return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" && J.set(o, Be), Be;
|
|
255
255
|
}
|
|
256
|
-
while (
|
|
256
|
+
while (we >= 1 && be >= 0);
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
} finally {
|
|
261
|
-
$ = !1,
|
|
261
|
+
$ = !1, Le.current = oe, ye(), Error.prepareStackTrace = te;
|
|
262
262
|
}
|
|
263
263
|
var Ge = o ? o.displayName || o.name : "", Ze = Ge ? Ye(Ge) : "";
|
|
264
|
-
return typeof o == "function" &&
|
|
264
|
+
return typeof o == "function" && J.set(o, Ze), Ze;
|
|
265
265
|
}
|
|
266
|
-
function ce(o,
|
|
266
|
+
function ce(o, x, L) {
|
|
267
267
|
return Qe(o, !1);
|
|
268
268
|
}
|
|
269
269
|
function me(o) {
|
|
270
|
-
var
|
|
271
|
-
return !!(
|
|
270
|
+
var x = o.prototype;
|
|
271
|
+
return !!(x && x.isReactComponent);
|
|
272
272
|
}
|
|
273
|
-
function Fe(o,
|
|
273
|
+
function Fe(o, x, L) {
|
|
274
274
|
if (o == null)
|
|
275
275
|
return "";
|
|
276
276
|
if (typeof o == "function")
|
|
@@ -287,42 +287,42 @@ function cn() {
|
|
|
287
287
|
switch (o.$$typeof) {
|
|
288
288
|
case d:
|
|
289
289
|
return ce(o.render);
|
|
290
|
-
case
|
|
291
|
-
return Fe(o.type,
|
|
292
|
-
case
|
|
293
|
-
var
|
|
290
|
+
case v:
|
|
291
|
+
return Fe(o.type, x, L);
|
|
292
|
+
case y: {
|
|
293
|
+
var _ = o, te = _._payload, oe = _._init;
|
|
294
294
|
try {
|
|
295
|
-
return Fe(oe(te),
|
|
295
|
+
return Fe(oe(te), x, L);
|
|
296
296
|
} catch {
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
return "";
|
|
301
301
|
}
|
|
302
|
-
var pe = Object.prototype.hasOwnProperty, et = {},
|
|
302
|
+
var pe = Object.prototype.hasOwnProperty, et = {}, _e = M.ReactDebugCurrentFrame;
|
|
303
303
|
function Xe(o) {
|
|
304
304
|
if (o) {
|
|
305
|
-
var
|
|
306
|
-
|
|
305
|
+
var x = o._owner, L = Fe(o.type, o._source, x ? x.type : null);
|
|
306
|
+
_e.setExtraStackFrame(L);
|
|
307
307
|
} else
|
|
308
|
-
|
|
308
|
+
_e.setExtraStackFrame(null);
|
|
309
309
|
}
|
|
310
|
-
function Ue(o,
|
|
310
|
+
function Ue(o, x, L, _, te) {
|
|
311
311
|
{
|
|
312
312
|
var oe = Function.call.bind(pe);
|
|
313
|
-
for (var
|
|
314
|
-
if (oe(o,
|
|
315
|
-
var
|
|
313
|
+
for (var Q in o)
|
|
314
|
+
if (oe(o, Q)) {
|
|
315
|
+
var K = void 0;
|
|
316
316
|
try {
|
|
317
|
-
if (typeof o[
|
|
318
|
-
var Re = Error((
|
|
317
|
+
if (typeof o[Q] != "function") {
|
|
318
|
+
var Re = Error((_ || "React class") + ": " + L + " type `" + Q + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[Q] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
319
319
|
throw Re.name = "Invariant Violation", Re;
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
323
|
-
|
|
321
|
+
K = o[Q](x, Q, _, L, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
322
|
+
} catch (we) {
|
|
323
|
+
K = we;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
K && !(K instanceof Error) && (Xe(te), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", L, Q, typeof K), Xe(null)), K instanceof Error && !(K.message in et) && (et[K.message] = !0, Xe(te), S("Failed %s type: %s", L, K.message), Xe(null));
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -332,7 +332,7 @@ function cn() {
|
|
|
332
332
|
}
|
|
333
333
|
function g(o) {
|
|
334
334
|
{
|
|
335
|
-
var
|
|
335
|
+
var x = typeof Symbol == "function" && Symbol.toStringTag, L = x && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
336
336
|
return L;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -348,7 +348,7 @@ function cn() {
|
|
|
348
348
|
}
|
|
349
349
|
function U(o) {
|
|
350
350
|
if (D(o))
|
|
351
|
-
return
|
|
351
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", g(o)), f(o);
|
|
352
352
|
}
|
|
353
353
|
var q = M.ReactCurrentOwner, ee = {
|
|
354
354
|
key: !0,
|
|
@@ -358,27 +358,27 @@ function cn() {
|
|
|
358
358
|
}, ie, $e;
|
|
359
359
|
function ze(o) {
|
|
360
360
|
if (pe.call(o, "ref")) {
|
|
361
|
-
var
|
|
362
|
-
if (
|
|
361
|
+
var x = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
362
|
+
if (x && x.isReactWarning)
|
|
363
363
|
return !1;
|
|
364
364
|
}
|
|
365
365
|
return o.ref !== void 0;
|
|
366
366
|
}
|
|
367
367
|
function ge(o) {
|
|
368
368
|
if (pe.call(o, "key")) {
|
|
369
|
-
var
|
|
370
|
-
if (
|
|
369
|
+
var x = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
370
|
+
if (x && x.isReactWarning)
|
|
371
371
|
return !1;
|
|
372
372
|
}
|
|
373
373
|
return o.key !== void 0;
|
|
374
374
|
}
|
|
375
|
-
function tt(o,
|
|
375
|
+
function tt(o, x) {
|
|
376
376
|
typeof o.ref == "string" && q.current;
|
|
377
377
|
}
|
|
378
|
-
function Ke(o,
|
|
378
|
+
function Ke(o, x) {
|
|
379
379
|
{
|
|
380
380
|
var L = function() {
|
|
381
|
-
ie || (ie = !0,
|
|
381
|
+
ie || (ie = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
|
|
382
382
|
};
|
|
383
383
|
L.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
384
384
|
get: L,
|
|
@@ -386,10 +386,10 @@ function cn() {
|
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function st(o,
|
|
389
|
+
function st(o, x) {
|
|
390
390
|
{
|
|
391
391
|
var L = function() {
|
|
392
|
-
$e || ($e = !0,
|
|
392
|
+
$e || ($e = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
|
|
393
393
|
};
|
|
394
394
|
L.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
395
395
|
get: L,
|
|
@@ -397,60 +397,60 @@ function cn() {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
var Ce = function(o,
|
|
401
|
-
var
|
|
400
|
+
var Ce = function(o, x, L, _, te, oe, Q) {
|
|
401
|
+
var K = {
|
|
402
402
|
// This tag allows us to uniquely identify this as a React Element
|
|
403
403
|
$$typeof: a,
|
|
404
404
|
// Built-in properties that belong on the element
|
|
405
405
|
type: o,
|
|
406
|
-
key:
|
|
406
|
+
key: x,
|
|
407
407
|
ref: L,
|
|
408
|
-
props:
|
|
408
|
+
props: Q,
|
|
409
409
|
// Record the component responsible for creating this element.
|
|
410
410
|
_owner: oe
|
|
411
411
|
};
|
|
412
|
-
return
|
|
412
|
+
return K._store = {}, Object.defineProperty(K._store, "validated", {
|
|
413
413
|
configurable: !1,
|
|
414
414
|
enumerable: !1,
|
|
415
415
|
writable: !0,
|
|
416
416
|
value: !1
|
|
417
|
-
}), Object.defineProperty(
|
|
417
|
+
}), Object.defineProperty(K, "_self", {
|
|
418
418
|
configurable: !1,
|
|
419
419
|
enumerable: !1,
|
|
420
420
|
writable: !1,
|
|
421
|
-
value:
|
|
422
|
-
}), Object.defineProperty(
|
|
421
|
+
value: _
|
|
422
|
+
}), Object.defineProperty(K, "_source", {
|
|
423
423
|
configurable: !1,
|
|
424
424
|
enumerable: !1,
|
|
425
425
|
writable: !1,
|
|
426
426
|
value: te
|
|
427
|
-
}), Object.freeze && (Object.freeze(
|
|
427
|
+
}), Object.freeze && (Object.freeze(K.props), Object.freeze(K)), K;
|
|
428
428
|
};
|
|
429
|
-
function ht(o,
|
|
429
|
+
function ht(o, x, L, _, te) {
|
|
430
430
|
{
|
|
431
|
-
var oe,
|
|
432
|
-
L !== void 0 && (U(L),
|
|
433
|
-
for (oe in
|
|
434
|
-
pe.call(
|
|
431
|
+
var oe, Q = {}, K = null, Re = null;
|
|
432
|
+
L !== void 0 && (U(L), K = "" + L), ge(x) && (U(x.key), K = "" + x.key), ze(x) && (Re = x.ref, tt(x, te));
|
|
433
|
+
for (oe in x)
|
|
434
|
+
pe.call(x, oe) && !ee.hasOwnProperty(oe) && (Q[oe] = x[oe]);
|
|
435
435
|
if (o && o.defaultProps) {
|
|
436
|
-
var
|
|
437
|
-
for (oe in
|
|
438
|
-
|
|
436
|
+
var we = o.defaultProps;
|
|
437
|
+
for (oe in we)
|
|
438
|
+
Q[oe] === void 0 && (Q[oe] = we[oe]);
|
|
439
439
|
}
|
|
440
|
-
if (
|
|
441
|
-
var
|
|
442
|
-
|
|
440
|
+
if (K || Re) {
|
|
441
|
+
var be = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
442
|
+
K && Ke(Q, be), Re && st(Q, be);
|
|
443
443
|
}
|
|
444
|
-
return Ce(o,
|
|
444
|
+
return Ce(o, K, Re, te, _, q.current, Q);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
var
|
|
447
|
+
var xt = M.ReactCurrentOwner, Ot = M.ReactDebugCurrentFrame;
|
|
448
448
|
function qe(o) {
|
|
449
449
|
if (o) {
|
|
450
|
-
var
|
|
451
|
-
|
|
450
|
+
var x = o._owner, L = Fe(o.type, o._source, x ? x.type : null);
|
|
451
|
+
Ot.setExtraStackFrame(L);
|
|
452
452
|
} else
|
|
453
|
-
|
|
453
|
+
Ot.setExtraStackFrame(null);
|
|
454
454
|
}
|
|
455
455
|
var it;
|
|
456
456
|
it = !1;
|
|
@@ -459,8 +459,8 @@ function cn() {
|
|
|
459
459
|
}
|
|
460
460
|
function Tt() {
|
|
461
461
|
{
|
|
462
|
-
if (
|
|
463
|
-
var o = B(
|
|
462
|
+
if (xt.current) {
|
|
463
|
+
var o = B(xt.current.type);
|
|
464
464
|
if (o)
|
|
465
465
|
return `
|
|
466
466
|
|
|
@@ -475,120 +475,120 @@ Check the render method of \`` + o + "`.";
|
|
|
475
475
|
var Dt = {};
|
|
476
476
|
function Mt(o) {
|
|
477
477
|
{
|
|
478
|
-
var
|
|
479
|
-
if (!
|
|
478
|
+
var x = Tt();
|
|
479
|
+
if (!x) {
|
|
480
480
|
var L = typeof o == "string" ? o : o.displayName || o.name;
|
|
481
|
-
L && (
|
|
481
|
+
L && (x = `
|
|
482
482
|
|
|
483
483
|
Check the top-level render call using <` + L + ">.");
|
|
484
484
|
}
|
|
485
|
-
return
|
|
485
|
+
return x;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function kt(o, x) {
|
|
489
489
|
{
|
|
490
490
|
if (!o._store || o._store.validated || o.key != null)
|
|
491
491
|
return;
|
|
492
492
|
o._store.validated = !0;
|
|
493
|
-
var L = Mt(
|
|
493
|
+
var L = Mt(x);
|
|
494
494
|
if (Dt[L])
|
|
495
495
|
return;
|
|
496
496
|
Dt[L] = !0;
|
|
497
|
-
var
|
|
498
|
-
o && o._owner && o._owner !==
|
|
497
|
+
var _ = "";
|
|
498
|
+
o && o._owner && o._owner !== xt.current && (_ = " It was passed a child from " + B(o._owner.type) + "."), qe(o), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', L, _), qe(null);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
function Et(o,
|
|
501
|
+
function Et(o, x) {
|
|
502
502
|
{
|
|
503
503
|
if (typeof o != "object")
|
|
504
504
|
return;
|
|
505
505
|
if (l(o))
|
|
506
506
|
for (var L = 0; L < o.length; L++) {
|
|
507
|
-
var
|
|
508
|
-
wt(
|
|
507
|
+
var _ = o[L];
|
|
508
|
+
wt(_) && kt(_, x);
|
|
509
509
|
}
|
|
510
510
|
else if (wt(o))
|
|
511
511
|
o._store && (o._store.validated = !0);
|
|
512
512
|
else if (o) {
|
|
513
513
|
var te = N(o);
|
|
514
514
|
if (typeof te == "function" && te !== o.entries)
|
|
515
|
-
for (var oe = te.call(o),
|
|
516
|
-
wt(
|
|
515
|
+
for (var oe = te.call(o), Q; !(Q = oe.next()).done; )
|
|
516
|
+
wt(Q.value) && kt(Q.value, x);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
function lt(o) {
|
|
521
521
|
{
|
|
522
|
-
var
|
|
523
|
-
if (
|
|
522
|
+
var x = o.type;
|
|
523
|
+
if (x == null || typeof x == "string")
|
|
524
524
|
return;
|
|
525
525
|
var L;
|
|
526
|
-
if (typeof
|
|
527
|
-
L =
|
|
528
|
-
else if (typeof
|
|
526
|
+
if (typeof x == "function")
|
|
527
|
+
L = x.propTypes;
|
|
528
|
+
else if (typeof x == "object" && (x.$$typeof === d || // Note: Memo only checks outer props here.
|
|
529
529
|
// Inner props are checked in the reconciler.
|
|
530
|
-
|
|
531
|
-
L =
|
|
530
|
+
x.$$typeof === v))
|
|
531
|
+
L = x.propTypes;
|
|
532
532
|
else
|
|
533
533
|
return;
|
|
534
534
|
if (L) {
|
|
535
|
-
var
|
|
536
|
-
Ue(L, o.props, "prop",
|
|
537
|
-
} else if (
|
|
535
|
+
var _ = B(x);
|
|
536
|
+
Ue(L, o.props, "prop", _, o);
|
|
537
|
+
} else if (x.PropTypes !== void 0 && !it) {
|
|
538
538
|
it = !0;
|
|
539
|
-
var te = B(
|
|
540
|
-
|
|
539
|
+
var te = B(x);
|
|
540
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", te || "Unknown");
|
|
541
541
|
}
|
|
542
|
-
typeof
|
|
542
|
+
typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
function $t(o) {
|
|
546
546
|
{
|
|
547
|
-
for (var
|
|
548
|
-
var
|
|
549
|
-
if (
|
|
550
|
-
qe(o),
|
|
547
|
+
for (var x = Object.keys(o.props), L = 0; L < x.length; L++) {
|
|
548
|
+
var _ = x[L];
|
|
549
|
+
if (_ !== "children" && _ !== "key") {
|
|
550
|
+
qe(o), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), qe(null);
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
o.ref !== null && (qe(o),
|
|
554
|
+
o.ref !== null && (qe(o), S("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
var Bt = {};
|
|
558
|
-
function
|
|
558
|
+
function Ae(o, x, L, _, te, oe) {
|
|
559
559
|
{
|
|
560
|
-
var
|
|
561
|
-
if (!
|
|
562
|
-
var
|
|
563
|
-
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (
|
|
560
|
+
var Q = X(o);
|
|
561
|
+
if (!Q) {
|
|
562
|
+
var K = "";
|
|
563
|
+
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (K += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
564
564
|
var Re = zt();
|
|
565
|
-
Re ?
|
|
566
|
-
var
|
|
567
|
-
o === null ?
|
|
565
|
+
Re ? K += Re : K += Tt();
|
|
566
|
+
var we;
|
|
567
|
+
o === null ? we = "null" : l(o) ? we = "array" : o !== void 0 && o.$$typeof === a ? (we = "<" + (B(o.type) || "Unknown") + " />", K = " Did you accidentally export a JSX literal instead of a component?") : we = typeof o, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", we, K);
|
|
568
568
|
}
|
|
569
|
-
var
|
|
570
|
-
if (
|
|
571
|
-
return
|
|
572
|
-
if (
|
|
573
|
-
var Be =
|
|
569
|
+
var be = ht(o, x, L, te, oe);
|
|
570
|
+
if (be == null)
|
|
571
|
+
return be;
|
|
572
|
+
if (Q) {
|
|
573
|
+
var Be = x.children;
|
|
574
574
|
if (Be !== void 0)
|
|
575
|
-
if (
|
|
575
|
+
if (_)
|
|
576
576
|
if (l(Be)) {
|
|
577
577
|
for (var Ge = 0; Ge < Be.length; Ge++)
|
|
578
578
|
Et(Be[Ge], o);
|
|
579
579
|
Object.freeze && Object.freeze(Be);
|
|
580
580
|
} else
|
|
581
|
-
|
|
581
|
+
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
582
582
|
else
|
|
583
583
|
Et(Be, o);
|
|
584
584
|
}
|
|
585
|
-
if (pe.call(
|
|
586
|
-
var Ze = B(o), Ne = Object.keys(
|
|
585
|
+
if (pe.call(x, "key")) {
|
|
586
|
+
var Ze = B(o), Ne = Object.keys(x).filter(function(Ut) {
|
|
587
587
|
return Ut !== "key";
|
|
588
588
|
}), bt = Ne.length > 0 ? "{key: someKey, " + Ne.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
589
589
|
if (!Bt[Ze + bt]) {
|
|
590
590
|
var Xt = Ne.length > 0 ? "{" + Ne.join(": ..., ") + ": ...}" : "{}";
|
|
591
|
-
|
|
591
|
+
S(`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,14 +596,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
596
596
|
<%s key={someKey} {...props} />`, bt, Ze, Xt, Ze), Bt[Ze + bt] = !0;
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
return o === s ? $t(
|
|
599
|
+
return o === s ? $t(be) : lt(be), be;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
function Ht(o,
|
|
603
|
-
return
|
|
602
|
+
function Ht(o, x, L) {
|
|
603
|
+
return Ae(o, x, L, !0);
|
|
604
604
|
}
|
|
605
|
-
function or(o,
|
|
606
|
-
return
|
|
605
|
+
function or(o, x, L) {
|
|
606
|
+
return Ae(o, x, L, !1);
|
|
607
607
|
}
|
|
608
608
|
var Wt = or, Vt = Ht;
|
|
609
609
|
Rt.Fragment = s, Rt.jsx = Wt, Rt.jsxs = Vt;
|
|
@@ -614,7 +614,7 @@ function un() {
|
|
|
614
614
|
return hr || (hr = 1, process.env.NODE_ENV === "production" ? Yt.exports = dn() : Yt.exports = cn()), Yt.exports;
|
|
615
615
|
}
|
|
616
616
|
var t = un();
|
|
617
|
-
const
|
|
617
|
+
const Te = (e, a, n) => {
|
|
618
618
|
const s = new Date(e);
|
|
619
619
|
switch (n) {
|
|
620
620
|
case "hour":
|
|
@@ -643,7 +643,7 @@ const je = (e, a, n) => {
|
|
|
643
643
|
}, pn = (e, a) => {
|
|
644
644
|
const n = a.getTime() - e.getTime();
|
|
645
645
|
return Math.ceil(n / (1e3 * 60 * 60));
|
|
646
|
-
},
|
|
646
|
+
}, Oe = (e, a) => {
|
|
647
647
|
const n = ["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"], c = {
|
|
648
648
|
YYYY: e.getFullYear().toString(),
|
|
649
649
|
YY: e.getFullYear().toString().slice(-2),
|
|
@@ -665,7 +665,7 @@ const je = (e, a, n) => {
|
|
|
665
665
|
return a === 0 || a === 6;
|
|
666
666
|
}, Zt = (e, a) => a.some(
|
|
667
667
|
(n) => n.getFullYear() === e.getFullYear() && n.getMonth() === e.getMonth() && n.getDate() === e.getDate()
|
|
668
|
-
),
|
|
668
|
+
), yt = (e) => {
|
|
669
669
|
const a = new Date(e);
|
|
670
670
|
return a.setHours(0, 0, 0, 0), a;
|
|
671
671
|
}, la = (e) => {
|
|
@@ -837,7 +837,7 @@ const jt = (e) => e ? {
|
|
|
837
837
|
lineHeight: e.lineHeight || 1.5714285714285714,
|
|
838
838
|
color: e.fontColor || "rgba(0, 0, 0, 0.88)"
|
|
839
839
|
}
|
|
840
|
-
} : {}, { Text: We, Paragraph: gn } = br, { Option: dt } =
|
|
840
|
+
} : {}, { Text: We, Paragraph: gn } = br, { Option: dt } = ke, yn = ({
|
|
841
841
|
task: e,
|
|
842
842
|
allTasks: a,
|
|
843
843
|
links: n,
|
|
@@ -847,39 +847,39 @@ const jt = (e) => e ? {
|
|
|
847
847
|
children: b,
|
|
848
848
|
styleConfig: u
|
|
849
849
|
}) => {
|
|
850
|
-
const d = jt(u), [p, h] = G(!1), [
|
|
851
|
-
if (
|
|
852
|
-
const V =
|
|
853
|
-
if (
|
|
854
|
-
const ne =
|
|
850
|
+
const d = jt(u), [p, h] = G(!1), [v, y] = G(null), [m, E] = G("e2s"), [F, N] = G("lag"), [M, S] = G(0), [w, C] = G(e.duration), [Z, W] = G(!0), re = "day", le = n.find((V) => V.target === e.id), j = !!le, X = A.useMemo(() => a.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...a.map((V) => V.start.getTime()))), [a]), R = () => {
|
|
851
|
+
if (v) {
|
|
852
|
+
const V = F === "lag" ? M : -M, I = rr(V, re);
|
|
853
|
+
if (w !== e.duration && c) {
|
|
854
|
+
const ne = Te(new Date(e.start), w, "day");
|
|
855
855
|
c({
|
|
856
856
|
...e,
|
|
857
|
-
duration:
|
|
857
|
+
duration: w,
|
|
858
858
|
end: ne
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
s(
|
|
861
|
+
s(v, e.id, m, I), h(!1), O();
|
|
862
862
|
}
|
|
863
|
-
},
|
|
864
|
-
|
|
863
|
+
}, O = () => {
|
|
864
|
+
y(null), E("e2s"), N("lag"), S(0), C(e.duration);
|
|
865
865
|
}, B = () => {
|
|
866
|
-
le && r && (r(le.id), h(!1),
|
|
866
|
+
le && r && (r(le.id), h(!1), O());
|
|
867
867
|
}, Y = (V) => {
|
|
868
868
|
if (h(V), V) {
|
|
869
869
|
if (W(!0), le) {
|
|
870
|
-
|
|
870
|
+
y(le.source), E(le.type);
|
|
871
871
|
const I = le.lag || 0;
|
|
872
|
-
I >= 0 ? (N("lag"),
|
|
872
|
+
I >= 0 ? (N("lag"), S(I)) : (N("lead"), S(Math.abs(I)));
|
|
873
873
|
} else
|
|
874
|
-
|
|
874
|
+
O();
|
|
875
875
|
C(e.duration);
|
|
876
876
|
}
|
|
877
|
-
},
|
|
878
|
-
if (!
|
|
877
|
+
}, k = () => {
|
|
878
|
+
if (!Z) return null;
|
|
879
879
|
const V = m === "e2s", I = m === "s2s", ne = m === "e2e", de = m === "s2e";
|
|
880
|
-
let se = 0, ue = 0, z = "",
|
|
881
|
-
V ? (se = 50, ue = 350,
|
|
882
|
-
const Ie =
|
|
880
|
+
let se = 0, ue = 0, z = "", ye = 0, Le = -1;
|
|
881
|
+
V ? (se = 50, ue = 350, ye = 250, Le = 350, z = "M 250 60 L 300 60 L 300 140 L 348 140") : ne ? (se = 100, ue = 100, ye = 300, Le = -1, z = "M 300 60 L 350 60 L 350 140 L 302 140") : I ? (se = 250, ue = 250, ye = 250, Le = -1, z = "M 250 60 L 200 60 L 200 140 L 248 140") : de && (se = 350, ue = 50, ye = 350, Le = 250, z = "M 350 60 L 300 60 L 300 140 L 252 140");
|
|
882
|
+
const Ie = v === "gantt-start-date", Ye = a.find(($) => $.id === v);
|
|
883
883
|
return /* @__PURE__ */ t.jsx("div", { style: {
|
|
884
884
|
width: "100%",
|
|
885
885
|
height: 90,
|
|
@@ -892,8 +892,8 @@ const jt = (e) => e ? {
|
|
|
892
892
|
flexShrink: 0
|
|
893
893
|
}, children: /* @__PURE__ */ t.jsxs("svg", { viewBox: "0 0 600 200", style: { width: "100%", height: "100%" }, preserveAspectRatio: "xMidYMid meet", children: [
|
|
894
894
|
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("marker", { id: "arrowhead", markerWidth: "12", markerHeight: "9", refX: "12", refY: "4.5", orient: "auto", children: /* @__PURE__ */ t.jsx("polygon", { points: "0 0, 12 4.5, 0 9", fill: "#8c8c8c" }) }) }),
|
|
895
|
-
/* @__PURE__ */ t.jsx("line", { x1:
|
|
896
|
-
|
|
895
|
+
/* @__PURE__ */ t.jsx("line", { x1: ye, x2: ye, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
896
|
+
Le !== -1 && /* @__PURE__ */ t.jsx("line", { x1: Le, x2: Le, y1: "0", y2: "200", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
897
897
|
/* @__PURE__ */ t.jsx("rect", { x: se, y: "35", width: "200", height: "50", rx: "4", fill: "#e6f4ff", stroke: "#91caff", strokeWidth: "2" }),
|
|
898
898
|
/* @__PURE__ */ t.jsx("text", { x: se + 100, y: "66", fontSize: "15", textAnchor: "middle", fill: "#003a8c", fontWeight: "600", children: Ie ? "Start Date" : Ye ? `Stage ${a.indexOf(Ye) + 1}` : "Predecessor" }),
|
|
899
899
|
/* @__PURE__ */ t.jsx("rect", { x: ue, y: "115", width: "200", height: "50", rx: "4", fill: "#e6f4ff", stroke: "#91caff", strokeWidth: "2" }),
|
|
@@ -903,9 +903,9 @@ const jt = (e) => e ? {
|
|
|
903
903
|
] }),
|
|
904
904
|
/* @__PURE__ */ t.jsx("path", { d: z, fill: "none", stroke: "#8c8c8c", strokeWidth: "2.5", markerEnd: "url(#arrowhead)" })
|
|
905
905
|
] }) });
|
|
906
|
-
},
|
|
907
|
-
const V =
|
|
908
|
-
if (!
|
|
906
|
+
}, De = () => {
|
|
907
|
+
const V = v === "gantt-start-date", I = a.find((ue) => ue.id === v);
|
|
908
|
+
if (!v) return "Select a checklist from the list to see how it will relate to the current stage.";
|
|
909
909
|
const ne = a.indexOf(e) + 1, de = V ? "Start Date" : `Stage ${a.indexOf(I) + 1}`;
|
|
910
910
|
let se = "";
|
|
911
911
|
switch (m) {
|
|
@@ -924,10 +924,10 @@ const jt = (e) => e ? {
|
|
|
924
924
|
}
|
|
925
925
|
if (M > 0) {
|
|
926
926
|
const ue = `${M} ${re}${M > 1 ? "s" : ""}`;
|
|
927
|
-
|
|
927
|
+
F === "lag" ? se += ` + ${ue} delay` : se += ` - ${ue} overlap`;
|
|
928
928
|
}
|
|
929
929
|
return se + ".";
|
|
930
|
-
},
|
|
930
|
+
}, Se = /* @__PURE__ */ t.jsxs("div", { style: {
|
|
931
931
|
width: 550,
|
|
932
932
|
backgroundColor: d.popover?.backgroundColor || "#fff",
|
|
933
933
|
borderRadius: d.popover?.borderRadius || "8px",
|
|
@@ -938,12 +938,12 @@ const jt = (e) => e ? {
|
|
|
938
938
|
/* @__PURE__ */ t.jsx(We, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color: d.font?.color }, children: "Add Dependency" }),
|
|
939
939
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
|
|
940
940
|
/* @__PURE__ */ t.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
|
|
941
|
-
|
|
941
|
+
ke,
|
|
942
942
|
{
|
|
943
943
|
showSearch: !0,
|
|
944
944
|
placeholder: "Select checklist",
|
|
945
|
-
value:
|
|
946
|
-
onChange:
|
|
945
|
+
value: v,
|
|
946
|
+
onChange: y,
|
|
947
947
|
style: { width: "100%" },
|
|
948
948
|
filterOption: (V, I) => {
|
|
949
949
|
if (I?.value === "gantt-start-date")
|
|
@@ -963,18 +963,18 @@ const jt = (e) => e ? {
|
|
|
963
963
|
] }),
|
|
964
964
|
/* @__PURE__ */ t.jsxs(We, { type: "secondary", style: { fontSize: "11px" }, children: [
|
|
965
965
|
"Start: ",
|
|
966
|
-
|
|
966
|
+
Oe(V.start, "MMM D, YYYY")
|
|
967
967
|
] })
|
|
968
968
|
] }) }, V.id)),
|
|
969
969
|
/* @__PURE__ */ t.jsx(dt, { value: "gantt-start-date", label: "Start Date", children: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0", borderTop: "1px solid #f0f0f0", marginTop: "4px", paddingTop: "8px" }, children: [
|
|
970
970
|
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "13px", fontWeight: 600 }, children: "Start Date" }),
|
|
971
|
-
/* @__PURE__ */ t.jsx(We, { type: "secondary", style: { fontSize: "11px" }, children:
|
|
971
|
+
/* @__PURE__ */ t.jsx(We, { type: "secondary", style: { fontSize: "11px" }, children: Oe(X, "MMM D, YYYY") })
|
|
972
972
|
] }) }, "gantt-start-date")
|
|
973
973
|
]
|
|
974
974
|
}
|
|
975
975
|
) }),
|
|
976
976
|
/* @__PURE__ */ t.jsx("div", { style: { width: 100 }, children: /* @__PURE__ */ t.jsxs(
|
|
977
|
-
|
|
977
|
+
ke,
|
|
978
978
|
{
|
|
979
979
|
value: m,
|
|
980
980
|
onChange: E,
|
|
@@ -992,9 +992,9 @@ const jt = (e) => e ? {
|
|
|
992
992
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
993
993
|
/* @__PURE__ */ t.jsx(We, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: d.font?.color }, children: "Delay type" }),
|
|
994
994
|
/* @__PURE__ */ t.jsxs(
|
|
995
|
-
|
|
995
|
+
ke,
|
|
996
996
|
{
|
|
997
|
-
value:
|
|
997
|
+
value: F,
|
|
998
998
|
onChange: N,
|
|
999
999
|
style: { width: "100%" },
|
|
1000
1000
|
children: [
|
|
@@ -1011,7 +1011,7 @@ const jt = (e) => e ? {
|
|
|
1011
1011
|
{
|
|
1012
1012
|
min: 0,
|
|
1013
1013
|
value: M,
|
|
1014
|
-
onChange: (V) =>
|
|
1014
|
+
onChange: (V) => S(V || 0),
|
|
1015
1015
|
style: { width: "100%" },
|
|
1016
1016
|
placeholder: "0"
|
|
1017
1017
|
}
|
|
@@ -1024,7 +1024,7 @@ const jt = (e) => e ? {
|
|
|
1024
1024
|
at,
|
|
1025
1025
|
{
|
|
1026
1026
|
min: 1,
|
|
1027
|
-
value:
|
|
1027
|
+
value: w,
|
|
1028
1028
|
onChange: (V) => C(V || 1),
|
|
1029
1029
|
style: { width: "100%" },
|
|
1030
1030
|
placeholder: "Duration"
|
|
@@ -1047,25 +1047,25 @@ const jt = (e) => e ? {
|
|
|
1047
1047
|
/* @__PURE__ */ t.jsx(
|
|
1048
1048
|
"a",
|
|
1049
1049
|
{
|
|
1050
|
-
onClick: () => W(!
|
|
1050
|
+
onClick: () => W(!Z),
|
|
1051
1051
|
style: {
|
|
1052
1052
|
fontSize: "12px",
|
|
1053
1053
|
color: "#1890ff",
|
|
1054
1054
|
cursor: "pointer",
|
|
1055
1055
|
textDecoration: "none"
|
|
1056
1056
|
},
|
|
1057
|
-
children:
|
|
1057
|
+
children: Z ? "Hide preview" : "Show preview"
|
|
1058
1058
|
}
|
|
1059
1059
|
)
|
|
1060
1060
|
] }),
|
|
1061
|
-
|
|
1062
|
-
|
|
1061
|
+
Z && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1062
|
+
k(),
|
|
1063
1063
|
/* @__PURE__ */ t.jsx(gn, { style: {
|
|
1064
1064
|
fontSize: "12px",
|
|
1065
1065
|
color: d.font?.color || "#262626",
|
|
1066
1066
|
marginBottom: 14,
|
|
1067
1067
|
lineHeight: "1.5"
|
|
1068
|
-
}, children:
|
|
1068
|
+
}, children: De() })
|
|
1069
1069
|
] }),
|
|
1070
1070
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 10 }, children: [
|
|
1071
1071
|
j && /* @__PURE__ */ t.jsx(
|
|
@@ -1083,8 +1083,8 @@ const jt = (e) => e ? {
|
|
|
1083
1083
|
Pe,
|
|
1084
1084
|
{
|
|
1085
1085
|
type: "primary",
|
|
1086
|
-
onClick:
|
|
1087
|
-
disabled: !
|
|
1086
|
+
onClick: R,
|
|
1087
|
+
disabled: !v,
|
|
1088
1088
|
style: {
|
|
1089
1089
|
...d.buttonPrimary,
|
|
1090
1090
|
minWidth: 100
|
|
@@ -1097,7 +1097,7 @@ const jt = (e) => e ? {
|
|
|
1097
1097
|
return /* @__PURE__ */ t.jsx(
|
|
1098
1098
|
zr,
|
|
1099
1099
|
{
|
|
1100
|
-
content:
|
|
1100
|
+
content: Se,
|
|
1101
1101
|
trigger: "click",
|
|
1102
1102
|
open: p,
|
|
1103
1103
|
onOpenChange: Y,
|
|
@@ -1108,61 +1108,61 @@ const jt = (e) => e ? {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
1110
|
}, Er = Ir(wr(
|
|
1111
|
-
({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency: p, onRemoveDependency: h, links:
|
|
1112
|
-
const M =
|
|
1113
|
-
|
|
1114
|
-
const [
|
|
1111
|
+
({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency: p, onRemoveDependency: h, links: v = [], dropIndicator: y, reorderTask: m, styleConfig: E, headerHeight: F }, N) => {
|
|
1112
|
+
const M = A.useRef(null);
|
|
1113
|
+
A.useImperativeHandle(N, () => M.current);
|
|
1114
|
+
const [S, w] = A.useState(null), [C, Z] = A.useState(0), W = (j, X = 0) => {
|
|
1115
1115
|
if (!j.parent) return X;
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1116
|
+
const R = e.find((O) => O.id === j.parent);
|
|
1117
|
+
return R ? W(R, X + 1) : X;
|
|
1118
1118
|
}, re = (j, X) => {
|
|
1119
1119
|
if (X === j.duration) return;
|
|
1120
|
-
const
|
|
1120
|
+
const R = Te(new Date(j.start), X, "day");
|
|
1121
1121
|
b?.({
|
|
1122
1122
|
...j,
|
|
1123
1123
|
duration: X,
|
|
1124
|
-
end:
|
|
1124
|
+
end: R
|
|
1125
1125
|
});
|
|
1126
1126
|
}, le = (j, X) => {
|
|
1127
1127
|
if (X.template)
|
|
1128
1128
|
return X.template(j);
|
|
1129
1129
|
switch (X.name) {
|
|
1130
1130
|
case "text": {
|
|
1131
|
-
const
|
|
1132
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft:
|
|
1131
|
+
const R = W(j);
|
|
1132
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft: R * 14 }, children: [
|
|
1133
1133
|
/* @__PURE__ */ t.jsx(
|
|
1134
1134
|
"div",
|
|
1135
1135
|
{
|
|
1136
1136
|
className: "gantt-row-drag-handle",
|
|
1137
|
-
onMouseDown: (
|
|
1138
|
-
|
|
1137
|
+
onMouseDown: (O) => {
|
|
1138
|
+
O.preventDefault(), u?.(j.id, O.clientX, O.clientY, "reorder");
|
|
1139
1139
|
},
|
|
1140
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1140
|
+
children: /* @__PURE__ */ t.jsx(Ee, { icon: Xr })
|
|
1141
1141
|
}
|
|
1142
1142
|
),
|
|
1143
|
-
j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (
|
|
1144
|
-
|
|
1145
|
-
}, children: /* @__PURE__ */ t.jsx(
|
|
1143
|
+
j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (O) => {
|
|
1144
|
+
O.stopPropagation(), b?.({ ...j, open: !j.open });
|
|
1145
|
+
}, children: /* @__PURE__ */ t.jsx(Ee, { icon: j.open ? cr : Ur }) }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, display: "inline-block" } }),
|
|
1146
1146
|
/* @__PURE__ */ t.jsx("span", { className: "gantt-task-name-text", children: j.text })
|
|
1147
1147
|
] });
|
|
1148
1148
|
}
|
|
1149
1149
|
case "start":
|
|
1150
|
-
return
|
|
1150
|
+
return Oe(j.start, "DD-MM-YYYY");
|
|
1151
1151
|
case "end":
|
|
1152
|
-
return
|
|
1152
|
+
return Oe(j.end, "DD-MM-YYYY");
|
|
1153
1153
|
case "duration":
|
|
1154
|
-
return
|
|
1154
|
+
return S === j.id ? /* @__PURE__ */ t.jsx(
|
|
1155
1155
|
at,
|
|
1156
1156
|
{
|
|
1157
1157
|
size: "small",
|
|
1158
1158
|
min: 1,
|
|
1159
1159
|
value: C,
|
|
1160
|
-
onChange: (
|
|
1160
|
+
onChange: (O) => Z(O || 1),
|
|
1161
1161
|
onBlur: () => {
|
|
1162
|
-
re(j, C),
|
|
1162
|
+
re(j, C), w(null);
|
|
1163
1163
|
},
|
|
1164
1164
|
onPressEnter: () => {
|
|
1165
|
-
re(j, C),
|
|
1165
|
+
re(j, C), w(null);
|
|
1166
1166
|
},
|
|
1167
1167
|
autoFocus: !0,
|
|
1168
1168
|
style: { width: "100%", fontSize: "12px" }
|
|
@@ -1170,8 +1170,8 @@ const jt = (e) => e ? {
|
|
|
1170
1170
|
) : /* @__PURE__ */ t.jsxs(
|
|
1171
1171
|
"div",
|
|
1172
1172
|
{
|
|
1173
|
-
onClick: (
|
|
1174
|
-
|
|
1173
|
+
onClick: (O) => {
|
|
1174
|
+
O.stopPropagation(), w(j.id), Z(j.duration);
|
|
1175
1175
|
},
|
|
1176
1176
|
style: {
|
|
1177
1177
|
backgroundColor: "#fff7e6",
|
|
@@ -1192,14 +1192,14 @@ const jt = (e) => e ? {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
case "predecessors": {
|
|
1195
|
-
const
|
|
1195
|
+
const O = v.filter((B) => B.target === j.id)[0];
|
|
1196
1196
|
return /* @__PURE__ */ t.jsx(
|
|
1197
|
-
|
|
1197
|
+
yn,
|
|
1198
1198
|
{
|
|
1199
1199
|
task: j,
|
|
1200
1200
|
allTasks: a,
|
|
1201
|
-
links:
|
|
1202
|
-
onAddDependency: (B, Y,
|
|
1201
|
+
links: v,
|
|
1202
|
+
onAddDependency: (B, Y, k, De) => p?.(B, Y, k, De),
|
|
1203
1203
|
onRemoveDependency: (B) => h?.(B),
|
|
1204
1204
|
onTaskUpdate: b,
|
|
1205
1205
|
styleConfig: E,
|
|
@@ -1214,8 +1214,8 @@ const jt = (e) => e ? {
|
|
|
1214
1214
|
alignItems: "center",
|
|
1215
1215
|
gap: "4px"
|
|
1216
1216
|
},
|
|
1217
|
-
children:
|
|
1218
|
-
const B = a.find((
|
|
1217
|
+
children: O ? (() => {
|
|
1218
|
+
const B = a.find((k) => k.id === O.source), Y = B ? a.indexOf(B) + 1 : 0;
|
|
1219
1219
|
return /* @__PURE__ */ t.jsx(
|
|
1220
1220
|
"span",
|
|
1221
1221
|
{
|
|
@@ -1228,7 +1228,7 @@ const jt = (e) => e ? {
|
|
|
1228
1228
|
borderRadius: "4px",
|
|
1229
1229
|
whiteSpace: "nowrap"
|
|
1230
1230
|
},
|
|
1231
|
-
children: mn(
|
|
1231
|
+
children: mn(O, Y)
|
|
1232
1232
|
}
|
|
1233
1233
|
);
|
|
1234
1234
|
})() : /* @__PURE__ */ t.jsx(
|
|
@@ -1256,9 +1256,9 @@ const jt = (e) => e ? {
|
|
|
1256
1256
|
{
|
|
1257
1257
|
type: "primary",
|
|
1258
1258
|
size: "small",
|
|
1259
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
1260
|
-
onClick: (
|
|
1261
|
-
|
|
1259
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: ar, style: { fontSize: 12 } }),
|
|
1260
|
+
onClick: (R) => {
|
|
1261
|
+
R.stopPropagation(), d?.(j.id);
|
|
1262
1262
|
},
|
|
1263
1263
|
title: "Add Subtask",
|
|
1264
1264
|
style: {
|
|
@@ -1294,7 +1294,7 @@ const jt = (e) => e ? {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-grid", ref: M, children: [
|
|
1297
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%", height:
|
|
1297
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-header", style: { display: "flex", minWidth: "100%", height: F }, children: n.map((j) => /* @__PURE__ */ t.jsx(
|
|
1298
1298
|
"div",
|
|
1299
1299
|
{
|
|
1300
1300
|
className: "gantt-grid-header-cell",
|
|
@@ -1306,50 +1306,50 @@ const jt = (e) => e ? {
|
|
|
1306
1306
|
},
|
|
1307
1307
|
children: j.name === "add" ? /* @__PURE__ */ t.jsx("span", { style: { fontSize: 11, color: "#64748b", fontWeight: 600, whiteSpace: "nowrap" }, children: "Add" }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1308
1308
|
j.label,
|
|
1309
|
-
j.name === "start" && /* @__PURE__ */ t.jsx(
|
|
1309
|
+
j.name === "start" && /* @__PURE__ */ t.jsx(Ee, { icon: cr, style: { marginLeft: 8, fontSize: 10, color: "#64748b" } })
|
|
1310
1310
|
] })
|
|
1311
1311
|
},
|
|
1312
1312
|
j.name
|
|
1313
1313
|
)) }),
|
|
1314
1314
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-grid-body", children: e.map((j) => {
|
|
1315
|
-
const X = m?.id === j.id,
|
|
1315
|
+
const X = m?.id === j.id, R = m?.descendantIds.includes(j.id);
|
|
1316
1316
|
return /* @__PURE__ */ t.jsxs(
|
|
1317
1317
|
"div",
|
|
1318
1318
|
{
|
|
1319
|
-
className: `gantt-grid-row ${s === j.id ? "selected" : ""} ${X ? "dragging-row" : ""} ${
|
|
1319
|
+
className: `gantt-grid-row ${s === j.id ? "selected" : ""} ${X ? "dragging-row" : ""} ${R ? "descendant-dragging-row" : ""} ${y?.taskId === j.id ? `drop-target-${y.position}` : ""}`,
|
|
1320
1320
|
onClick: () => r(j.id),
|
|
1321
|
-
onContextMenu: (
|
|
1321
|
+
onContextMenu: (O) => c?.(O, j.id),
|
|
1322
1322
|
style: {
|
|
1323
1323
|
display: "flex",
|
|
1324
1324
|
minWidth: "100%"
|
|
1325
1325
|
/* Ensure row spans all columns */
|
|
1326
1326
|
},
|
|
1327
1327
|
children: [
|
|
1328
|
-
n.map((
|
|
1329
|
-
const B =
|
|
1328
|
+
n.map((O) => {
|
|
1329
|
+
const B = O.name === "add";
|
|
1330
1330
|
return /* @__PURE__ */ t.jsx(
|
|
1331
1331
|
"div",
|
|
1332
1332
|
{
|
|
1333
1333
|
className: "gantt-grid-cell",
|
|
1334
1334
|
style: {
|
|
1335
|
-
width:
|
|
1336
|
-
minWidth:
|
|
1335
|
+
width: O.width,
|
|
1336
|
+
minWidth: O.width,
|
|
1337
1337
|
/* Ensure column maintains width */
|
|
1338
|
-
textAlign:
|
|
1338
|
+
textAlign: O.align || "left",
|
|
1339
1339
|
display: "flex",
|
|
1340
1340
|
alignItems: "center",
|
|
1341
|
-
justifyContent: B ? "center" :
|
|
1341
|
+
justifyContent: B ? "center" : O.name === "text" ? "flex-start" : O.align === "center" ? "center" : O.align === "right" ? "flex-end" : "flex-start",
|
|
1342
1342
|
visibility: "visible",
|
|
1343
1343
|
/* Ensure column is visible */
|
|
1344
1344
|
opacity: 1
|
|
1345
1345
|
/* Ensure column is not transparent */
|
|
1346
1346
|
},
|
|
1347
|
-
children: le(j,
|
|
1347
|
+
children: le(j, O)
|
|
1348
1348
|
},
|
|
1349
|
-
`${j.id}-${
|
|
1349
|
+
`${j.id}-${O.name}`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
|
|
1352
|
+
y?.taskId === j.id && /* @__PURE__ */ t.jsx("div", { className: `gantt-drop-indicator ${y.position}` })
|
|
1353
1353
|
]
|
|
1354
1354
|
},
|
|
1355
1355
|
j.id
|
|
@@ -1359,7 +1359,7 @@ const jt = (e) => e ? {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
));
|
|
1361
1361
|
Er.displayName = "Grid";
|
|
1362
|
-
const
|
|
1362
|
+
const xn = ({
|
|
1363
1363
|
task: e,
|
|
1364
1364
|
position: a,
|
|
1365
1365
|
selected: n,
|
|
@@ -1371,31 +1371,33 @@ const yn = ({
|
|
|
1371
1371
|
readonly: d = !1,
|
|
1372
1372
|
baseline: p,
|
|
1373
1373
|
dependencyRuleDescriptions: h = [],
|
|
1374
|
-
tooltipConfig:
|
|
1374
|
+
tooltipConfig: v
|
|
1375
1375
|
}) => {
|
|
1376
|
-
const
|
|
1377
|
-
d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY,
|
|
1376
|
+
const y = e.ShowHandle !== void 0 ? e.ShowHandle : !0, m = ($, J) => {
|
|
1377
|
+
d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY, J));
|
|
1378
1378
|
}, E = () => {
|
|
1379
1379
|
const $ = ["gantt-task-bar"];
|
|
1380
1380
|
if (e.type === "milestone" && $.push("milestone"), e.type === "project" && $.push("project"), n && $.push("selected"), s && $.push("dragging"), e.status) {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1381
|
+
const J = String(e.status).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
1382
|
+
J && $.push(`status-${J}`);
|
|
1383
1383
|
}
|
|
1384
1384
|
return $.join(" ");
|
|
1385
|
-
},
|
|
1386
|
-
let $ = a.left,
|
|
1387
|
-
|
|
1385
|
+
}, F = () => {
|
|
1386
|
+
let $ = a.left, J = a.width;
|
|
1387
|
+
s && u && (u === "move" ? $ += b : u === "resize-left" ? ($ += b, J -= b) : u === "resize-right" && (J += b));
|
|
1388
|
+
const xe = 20;
|
|
1389
|
+
return e.type === "milestone" && J < xe && ($ -= (xe - J) / 2, J = xe), {
|
|
1388
1390
|
left: `${$}px`,
|
|
1389
|
-
width: `${Math.max(
|
|
1391
|
+
width: `${Math.max(J, 0)}px`,
|
|
1390
1392
|
// Color handled by CSS classes (.project, .milestone) or task.color override
|
|
1391
1393
|
backgroundColor: e.color || void 0
|
|
1392
1394
|
};
|
|
1393
1395
|
}, N = ($ = !1) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1394
|
-
!d &&
|
|
1396
|
+
!d && y && !$ && /* @__PURE__ */ t.jsx(
|
|
1395
1397
|
"div",
|
|
1396
1398
|
{
|
|
1397
1399
|
className: "gantt-task-resize-handle gantt-task-resize-left",
|
|
1398
|
-
onMouseDown: (
|
|
1400
|
+
onMouseDown: (J) => m(J, "resize-left")
|
|
1399
1401
|
}
|
|
1400
1402
|
),
|
|
1401
1403
|
!$ && e.type !== "milestone" && /* @__PURE__ */ t.jsx(
|
|
@@ -1410,86 +1412,86 @@ const yn = ({
|
|
|
1410
1412
|
}
|
|
1411
1413
|
),
|
|
1412
1414
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-task-content", children: !$ && /* @__PURE__ */ t.jsx("span", { className: "gantt-task-text", children: e.text }) }),
|
|
1413
|
-
!d &&
|
|
1415
|
+
!d && y && !$ && /* @__PURE__ */ t.jsx(
|
|
1414
1416
|
"div",
|
|
1415
1417
|
{
|
|
1416
1418
|
className: "gantt-task-resize-handle gantt-task-resize-right",
|
|
1417
|
-
onMouseDown: (
|
|
1419
|
+
onMouseDown: (J) => m(J, "resize-right")
|
|
1418
1420
|
}
|
|
1419
1421
|
)
|
|
1420
|
-
] }), M = ($,
|
|
1422
|
+
] }), M = ($, J) => {
|
|
1421
1423
|
if ($ instanceof Date)
|
|
1422
|
-
return Number.isNaN($.getTime()) ?
|
|
1424
|
+
return Number.isNaN($.getTime()) ? J : $;
|
|
1423
1425
|
if (typeof $ == "string" || typeof $ == "number") {
|
|
1424
|
-
const
|
|
1425
|
-
return Number.isNaN(
|
|
1426
|
+
const xe = new Date($);
|
|
1427
|
+
return Number.isNaN(xe.getTime()) ? J : xe;
|
|
1426
1428
|
}
|
|
1427
|
-
return
|
|
1428
|
-
},
|
|
1429
|
+
return J;
|
|
1430
|
+
}, S = ($) => {
|
|
1429
1431
|
if (Array.isArray($)) {
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1432
|
+
const J = $.map((xe) => String(xe).trim()).filter(Boolean);
|
|
1433
|
+
return J.length > 0 ? J : void 0;
|
|
1432
1434
|
}
|
|
1433
1435
|
if (typeof $ == "string") {
|
|
1434
|
-
const
|
|
1435
|
-
return
|
|
1436
|
+
const J = $.split(/\r?\n|\|/).map((xe) => xe.trim()).filter(Boolean);
|
|
1437
|
+
return J.length > 0 ? J : void 0;
|
|
1436
1438
|
}
|
|
1437
|
-
},
|
|
1438
|
-
|
|
1439
|
+
}, w = e.tooltipConfig ? { ...v, ...e.tooltipConfig } : v, C = w?.dateFormat || "MMM D, YYYY", Z = w?.taskNameAccessor?.(e) ?? e.text, W = String(Z ?? "").trim() || `Task ${e.id}`, re = w?.taskNameFormatter ? w.taskNameFormatter(W, e) : W, le = M(
|
|
1440
|
+
w?.plannedStartAccessor?.(e) ?? e.plannedStart ?? p?.start ?? e.start,
|
|
1439
1441
|
e.start
|
|
1440
1442
|
), j = M(
|
|
1441
|
-
|
|
1443
|
+
w?.plannedEndAccessor?.(e) ?? e.plannedEnd ?? p?.end ?? e.end,
|
|
1442
1444
|
e.end
|
|
1443
|
-
), X =
|
|
1444
|
-
|
|
1445
|
+
), X = w?.plannedDatesFormatter ? w.plannedDatesFormatter(le, j, e) : `${Oe(le, C)} - ${Oe(j, C)}`, R = M(
|
|
1446
|
+
w?.actualStartAccessor?.(e) ?? e.actualStart ?? e.start,
|
|
1445
1447
|
e.start
|
|
1446
|
-
),
|
|
1447
|
-
|
|
1448
|
+
), O = M(
|
|
1449
|
+
w?.actualEndAccessor?.(e) ?? e.actualEnd ?? e.end,
|
|
1448
1450
|
e.end
|
|
1449
|
-
), B =
|
|
1450
|
-
|
|
1451
|
-
) || ne, ue = se.length > 0 ? se.map(($) =>
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1451
|
+
), B = w?.actualDatesFormatter ? w.actualDatesFormatter(R, O, e) : `${Oe(R, C)} - ${Oe(O, C)}`, Y = w?.statusAccessor?.(e) ?? e.status, k = Y != null ? String(Y) : "", De = w?.statusFormatter ? w.statusFormatter(k, e) : k ? k.replace(/-/g, " ") : w?.emptyStatusText || "Not set", Se = w?.ownerAccessor?.(e) ?? e.owner, V = Se != null ? String(Se).trim() : "", I = V ? w?.ownerFormatter ? w.ownerFormatter(V, e) : V : w?.emptyOwnerText || "", ne = h.length > 0 ? h : e.dependencyRule || [], se = S(
|
|
1452
|
+
w?.dependencyRuleAccessor?.(e, ne)
|
|
1453
|
+
) || ne, ue = se.length > 0 ? se.map(($) => w?.dependencyRuleFormatter ? w.dependencyRuleFormatter($, e) : $).join(w?.dependencySeparator || " | ") : w?.emptyDependencyRuleText || "No dependency rule", z = w?.progressAccessor?.(e) ?? e.progress, ye = typeof z == "number" ? z : Number(z), Le = Number.isFinite(ye) ? ye : e.progress, Ie = w?.progressFormatter ? w.progressFormatter(Le, e) : `${Le}%`, Ye = /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip", children: [
|
|
1454
|
+
w?.showTaskName !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-tooltip-title", children: re }),
|
|
1455
|
+
w?.showPlannedDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1456
|
+
w?.plannedLabel || "Planned",
|
|
1455
1457
|
": ",
|
|
1456
1458
|
X
|
|
1457
1459
|
] }),
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
+
w?.showActualDates !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
1461
|
+
w?.actualLabel || "Actual",
|
|
1460
1462
|
": ",
|
|
1461
1463
|
B
|
|
1462
1464
|
] }),
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
+
w?.showStatus !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-progress", children: [
|
|
1466
|
+
w?.statusLabel || "Status",
|
|
1465
1467
|
": ",
|
|
1466
|
-
|
|
1468
|
+
De
|
|
1467
1469
|
] }),
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
+
w?.showOwner !== !1 && I && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-owner", children: [
|
|
1471
|
+
w?.ownerLabel || "Owner",
|
|
1470
1472
|
": ",
|
|
1471
1473
|
I
|
|
1472
1474
|
] }),
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
+
w?.showDependencyRule !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-owner", children: [
|
|
1476
|
+
w?.dependencyRuleLabel || "Dependency Rule",
|
|
1475
1477
|
": ",
|
|
1476
1478
|
ue
|
|
1477
1479
|
] }),
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
+
w?.showProgress !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip-progress", children: [
|
|
1481
|
+
w?.progressLabel || "Progress",
|
|
1480
1482
|
": ",
|
|
1481
1483
|
Ie
|
|
1482
1484
|
] })
|
|
1483
1485
|
] });
|
|
1484
1486
|
if (e.segments && e.segments.length > 0 || e.onHoldPeriods && e.onHoldPeriods.length > 0) {
|
|
1485
1487
|
console.log("[TaskBar] " + e.text + " onHold:", e.onHoldPeriods);
|
|
1486
|
-
const $ = e.end.getTime() - e.start.getTime(),
|
|
1488
|
+
const $ = e.end.getTime() - e.start.getTime(), J = (e.onHoldPeriods || []).map((ce) => ({
|
|
1487
1489
|
startMs: Math.max(ce.start.getTime(), e.start.getTime()),
|
|
1488
1490
|
endMs: Math.min(ce.end.getTime(), e.end.getTime())
|
|
1489
1491
|
})).filter((ce) => ce.endMs > ce.startMs).sort((ce, me) => ce.startMs - me.startMs).reduce((ce, me) => {
|
|
1490
1492
|
const Fe = ce[ce.length - 1];
|
|
1491
1493
|
return !Fe || me.startMs > Fe.endMs ? (ce.push({ ...me }), ce) : (Fe.endMs = Math.max(Fe.endMs, me.endMs), ce);
|
|
1492
|
-
}, []),
|
|
1494
|
+
}, []), xe = !!(e.segments && e.segments.length > 0), Qe = xe ? e.segments : [{ start: e.start, end: e.end, duration: e.duration || 0 }];
|
|
1493
1495
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-task-group", children: [
|
|
1494
1496
|
Qe.map((ce, me) => /* @__PURE__ */ t.jsx(nt, { title: Ye, mouseEnterDelay: 0.5, children: /* @__PURE__ */ t.jsx(
|
|
1495
1497
|
"div",
|
|
@@ -1505,21 +1507,21 @@ const yn = ({
|
|
|
1505
1507
|
children: N(me > 0)
|
|
1506
1508
|
}
|
|
1507
1509
|
) }, `seg-${me}`)),
|
|
1508
|
-
|
|
1510
|
+
J.map((ce, me) => {
|
|
1509
1511
|
const Fe = $ > 0 ? $ : 864e5, pe = ce.endMs - ce.startMs;
|
|
1510
1512
|
if (pe <= 0) return null;
|
|
1511
|
-
const et = a.left + (ce.startMs - e.start.getTime()) / Fe * a.width,
|
|
1513
|
+
const et = a.left + (ce.startMs - e.start.getTime()) / Fe * a.width, _e = pe / Fe * a.width;
|
|
1512
1514
|
return /* @__PURE__ */ t.jsx(
|
|
1513
1515
|
"div",
|
|
1514
1516
|
{
|
|
1515
1517
|
className: "gantt-on-hold-period",
|
|
1516
1518
|
style: {
|
|
1517
1519
|
left: `${et}px`,
|
|
1518
|
-
width: `${
|
|
1520
|
+
width: `${_e}px`,
|
|
1519
1521
|
// z-index 101: above hover state (100)
|
|
1520
1522
|
// Always rendered on top regardless of status-* colour
|
|
1521
1523
|
zIndex: 101,
|
|
1522
|
-
opacity:
|
|
1524
|
+
opacity: xe ? 0.9 : 0.75,
|
|
1523
1525
|
pointerEvents: "none"
|
|
1524
1526
|
}
|
|
1525
1527
|
},
|
|
@@ -1532,53 +1534,53 @@ const yn = ({
|
|
|
1532
1534
|
"div",
|
|
1533
1535
|
{
|
|
1534
1536
|
className: E(),
|
|
1535
|
-
style:
|
|
1537
|
+
style: F(),
|
|
1536
1538
|
onClick: r,
|
|
1537
1539
|
onMouseDown: ($) => m($, "move"),
|
|
1538
1540
|
children: N()
|
|
1539
1541
|
}
|
|
1540
1542
|
) });
|
|
1541
1543
|
}, wn = ({ links: e, tasks: a, getTaskPosition: n }) => {
|
|
1542
|
-
const s =
|
|
1544
|
+
const s = A.useMemo(() => {
|
|
1543
1545
|
const p = /* @__PURE__ */ new Map();
|
|
1544
1546
|
return a.forEach((h) => p.set(h.id, h)), p;
|
|
1545
|
-
}, [a]), r = (p) => s.get(p), c =
|
|
1546
|
-
const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(),
|
|
1547
|
-
e.forEach((
|
|
1548
|
-
p.set(
|
|
1547
|
+
}, [a]), r = (p) => s.get(p), c = A.useMemo(() => {
|
|
1548
|
+
const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
1549
|
+
e.forEach((F) => {
|
|
1550
|
+
p.set(F.source, (p.get(F.source) || 0) + 1), h.set(F.target, (h.get(F.target) || 0) + 1);
|
|
1549
1551
|
});
|
|
1550
1552
|
const m = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
1551
|
-
return e.forEach((
|
|
1552
|
-
const N = m.get(
|
|
1553
|
-
|
|
1554
|
-
const M = E.get(
|
|
1555
|
-
|
|
1553
|
+
return e.forEach((F) => {
|
|
1554
|
+
const N = m.get(F.source) || 0;
|
|
1555
|
+
v.set(F.id, N), m.set(F.source, N + 1);
|
|
1556
|
+
const M = E.get(F.target) || 0;
|
|
1557
|
+
y.set(F.id, M), E.set(F.target, M + 1);
|
|
1556
1558
|
}), {
|
|
1557
1559
|
outgoingCountByTaskId: p,
|
|
1558
1560
|
incomingCountByTaskId: h,
|
|
1559
|
-
outgoingIndexByLinkId:
|
|
1560
|
-
incomingIndexByLinkId:
|
|
1561
|
+
outgoingIndexByLinkId: v,
|
|
1562
|
+
incomingIndexByLinkId: y
|
|
1561
1563
|
};
|
|
1562
|
-
}, [e]), b =
|
|
1564
|
+
}, [e]), b = A.useMemo(() => {
|
|
1563
1565
|
let p = 0, h = 0;
|
|
1564
|
-
return a.forEach((
|
|
1566
|
+
return a.forEach((v) => {
|
|
1565
1567
|
try {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
} catch (
|
|
1569
|
-
console.warn("Failed to position task for link rendering:",
|
|
1568
|
+
const y = n(v);
|
|
1569
|
+
y && typeof y.left == "number" && typeof y.width == "number" && (p = Math.max(p, y.left + y.width)), y && typeof y.top == "number" && typeof y.height == "number" && (h = Math.max(h, y.top + y.height));
|
|
1570
|
+
} catch (y) {
|
|
1571
|
+
console.warn("Failed to position task for link rendering:", v.id, y);
|
|
1570
1572
|
}
|
|
1571
1573
|
}), {
|
|
1572
1574
|
width: Math.max(p, 1e3),
|
|
1573
1575
|
height: Math.max(h, 100)
|
|
1574
1576
|
};
|
|
1575
1577
|
}, [a, n]), u = (p, h) => {
|
|
1576
|
-
const
|
|
1577
|
-
return Math.min((p + 1) *
|
|
1578
|
+
const v = Math.max(3, Math.round(h / 7)), y = Math.max(2, h / 2 - 2);
|
|
1579
|
+
return Math.min((p + 1) * v, y);
|
|
1578
1580
|
}, d = (p) => {
|
|
1579
|
-
const h = r(p.source),
|
|
1580
|
-
if (!h || !
|
|
1581
|
-
const
|
|
1581
|
+
const h = r(p.source), v = r(p.target);
|
|
1582
|
+
if (!h || !v) return { path: "", arrow: "" };
|
|
1583
|
+
const y = n(h), m = n(v), E = (c.outgoingCountByTaskId.get(h.id) || 0) > 0 && (c.incomingCountByTaskId.get(h.id) || 0) > 0, F = (c.outgoingCountByTaskId.get(v.id) || 0) > 0 && (c.incomingCountByTaskId.get(v.id) || 0) > 0, N = y.top + y.height / 2 + (E ? u(c.outgoingIndexByLinkId.get(p.id) || 0, y.height) : 0), M = m.top + m.height / 2 - (F ? u(c.incomingIndexByLinkId.get(p.id) || 0, m.height) : 0), S = {
|
|
1582
1584
|
sourceStub: 14,
|
|
1583
1585
|
targetStub: 8,
|
|
1584
1586
|
detourPadding: 24,
|
|
@@ -1589,51 +1591,51 @@ const yn = ({
|
|
|
1589
1591
|
arrowStemOverlap: 1,
|
|
1590
1592
|
chevronNotchDepth: 5
|
|
1591
1593
|
};
|
|
1592
|
-
let
|
|
1594
|
+
let w = 0, C = 0, Z = 1, W = 1;
|
|
1593
1595
|
switch (p.type) {
|
|
1594
1596
|
case "e2s":
|
|
1595
|
-
|
|
1597
|
+
w = y.left + y.width, C = m.left, Z = 1, W = 1;
|
|
1596
1598
|
break;
|
|
1597
1599
|
case "s2s":
|
|
1598
|
-
|
|
1600
|
+
w = y.left, C = m.left, Z = -1, W = 1;
|
|
1599
1601
|
break;
|
|
1600
1602
|
case "e2e":
|
|
1601
|
-
|
|
1603
|
+
w = y.left + y.width, C = m.left + m.width, Z = 1, W = -1;
|
|
1602
1604
|
break;
|
|
1603
1605
|
case "s2e":
|
|
1604
|
-
|
|
1606
|
+
w = y.left, C = m.left + m.width, Z = -1, W = -1;
|
|
1605
1607
|
break;
|
|
1606
1608
|
}
|
|
1607
|
-
const re =
|
|
1609
|
+
const re = w + Z * S.sourceStub, le = C - W * S.arrowGap, j = le - W * S.arrowLength, X = j + W * S.chevronNotchDepth, R = X - W * S.targetStub, O = X + W * S.arrowStemOverlap, B = Math.abs(M - N) > 1;
|
|
1608
1610
|
let Y;
|
|
1609
1611
|
if (B) {
|
|
1610
1612
|
const ne = M > N;
|
|
1611
|
-
let de = ne ? Math.min(
|
|
1613
|
+
let de = ne ? Math.min(y.top + y.height + 6, m.top - 6) : Math.max(y.top - 6, m.top + m.height + 6);
|
|
1612
1614
|
Math.abs(de - N) < 2 && (de = N + (ne ? 2 : -2)), Math.abs(de - M) < 2 && (de = M + (ne ? -2 : 2)), Y = [
|
|
1613
|
-
{ x:
|
|
1615
|
+
{ x: w, y: N },
|
|
1614
1616
|
{ x: re, y: N },
|
|
1615
1617
|
{ x: re, y: de },
|
|
1616
|
-
{ x:
|
|
1617
|
-
{ x:
|
|
1618
|
-
{ x:
|
|
1618
|
+
{ x: R, y: de },
|
|
1619
|
+
{ x: R, y: M },
|
|
1620
|
+
{ x: O, y: M }
|
|
1619
1621
|
];
|
|
1620
1622
|
} else {
|
|
1621
1623
|
let I;
|
|
1622
|
-
|
|
1623
|
-
{ x:
|
|
1624
|
+
Z === W && (Z === 1 ? R - re >= S.minHorizontalSpan : re - R >= S.minHorizontalSpan) ? I = (re + R) / 2 : I = Z === 1 ? Math.max(w, C) + S.detourPadding : Math.min(w, C) - S.detourPadding, Y = [
|
|
1625
|
+
{ x: w, y: N },
|
|
1624
1626
|
{ x: re, y: N },
|
|
1625
1627
|
{ x: I, y: N },
|
|
1626
1628
|
{ x: I, y: M },
|
|
1627
|
-
{ x:
|
|
1628
|
-
{ x:
|
|
1629
|
+
{ x: R, y: M },
|
|
1630
|
+
{ x: O, y: M }
|
|
1629
1631
|
];
|
|
1630
1632
|
}
|
|
1631
|
-
const
|
|
1633
|
+
const k = Y.filter((I, ne) => {
|
|
1632
1634
|
if (ne === 0) return !0;
|
|
1633
1635
|
const de = Y[ne - 1];
|
|
1634
1636
|
return Math.abs(I.x - de.x) > 0.5 || Math.abs(I.y - de.y) > 0.5;
|
|
1635
|
-
}),
|
|
1636
|
-
return { path:
|
|
1637
|
+
}), De = k.length > 0 ? k.map((I, ne) => `${ne === 0 ? "M" : "L"} ${I.x},${I.y}`).join(" ") : "", Se = S.arrowWidth / 2, V = `M ${j},${M - Se} L ${le},${M} L ${j},${M + Se} L ${X},${M} Z`;
|
|
1638
|
+
return { path: De, arrow: V };
|
|
1637
1639
|
};
|
|
1638
1640
|
return e.length === 0 ? null : /* @__PURE__ */ t.jsx(
|
|
1639
1641
|
"svg",
|
|
@@ -1649,9 +1651,9 @@ const yn = ({
|
|
|
1649
1651
|
pointerEvents: "none"
|
|
1650
1652
|
},
|
|
1651
1653
|
children: e.map((p) => {
|
|
1652
|
-
const h = r(p.source),
|
|
1653
|
-
if (!h || !
|
|
1654
|
-
const
|
|
1654
|
+
const h = r(p.source), v = r(p.target);
|
|
1655
|
+
if (!h || !v) return null;
|
|
1656
|
+
const y = d(p), m = y.path, E = y.arrow;
|
|
1655
1657
|
return !m || !E ? null : /* @__PURE__ */ t.jsxs("g", { className: "gantt-link", children: [
|
|
1656
1658
|
/* @__PURE__ */ t.jsx(
|
|
1657
1659
|
"path",
|
|
@@ -1683,51 +1685,52 @@ const yn = ({
|
|
|
1683
1685
|
type: null,
|
|
1684
1686
|
dragDeltaX: 0,
|
|
1685
1687
|
dragDeltaY: 0
|
|
1686
|
-
}), u = Je((h,
|
|
1687
|
-
const E = e.find((
|
|
1688
|
+
}), u = Je((h, v, y, m) => {
|
|
1689
|
+
const E = e.find((F) => F.id === h);
|
|
1688
1690
|
E && b({
|
|
1689
1691
|
taskId: h,
|
|
1690
|
-
initialX:
|
|
1691
|
-
initialY:
|
|
1692
|
+
initialX: v,
|
|
1693
|
+
initialY: y,
|
|
1692
1694
|
initialStart: new Date(E.start),
|
|
1693
1695
|
initialEnd: new Date(E.end),
|
|
1694
1696
|
type: m,
|
|
1695
1697
|
dragDeltaX: 0,
|
|
1696
1698
|
dragDeltaY: 0
|
|
1697
1699
|
});
|
|
1698
|
-
}, [e]), d = Je((h,
|
|
1700
|
+
}, [e]), d = Je((h, v) => {
|
|
1699
1701
|
if (!c.taskId || !c.type) return null;
|
|
1700
|
-
const
|
|
1701
|
-
if (b((
|
|
1702
|
-
...
|
|
1703
|
-
dragDeltaX:
|
|
1702
|
+
const y = h - c.initialX, m = v - c.initialY;
|
|
1703
|
+
if (b((C) => ({
|
|
1704
|
+
...C,
|
|
1705
|
+
dragDeltaX: y,
|
|
1704
1706
|
dragDeltaY: m
|
|
1705
1707
|
})), c.type === "reorder") return null;
|
|
1706
|
-
const E = e.find((
|
|
1708
|
+
const E = e.find((C) => C.id === c.taskId);
|
|
1707
1709
|
if (!E) return null;
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
+
let F = 0, N = s;
|
|
1711
|
+
s === "week" ? (F = Math.round(y / n * 7), N = "day") : s === "month" ? (F = Math.round(y / n * 30), N = "day") : (F = Math.round(y / n) * r, N = s);
|
|
1712
|
+
let M = new Date(c.initialStart), S = new Date(c.initialEnd);
|
|
1710
1713
|
switch (c.type) {
|
|
1711
1714
|
case "move":
|
|
1712
|
-
|
|
1715
|
+
M = Te(c.initialStart, F, N), S = Te(c.initialEnd, F, N);
|
|
1713
1716
|
break;
|
|
1714
1717
|
case "resize-left":
|
|
1715
|
-
|
|
1718
|
+
M = Te(c.initialStart, F, N), M >= S && (M = Te(S, N === "day" ? -1 : -r, N));
|
|
1716
1719
|
break;
|
|
1717
1720
|
case "resize-right":
|
|
1718
|
-
|
|
1721
|
+
S = Te(c.initialEnd, F, N), S <= M && (S = Te(M, N === "day" ? 1 : r, N));
|
|
1719
1722
|
break;
|
|
1720
1723
|
}
|
|
1721
|
-
const
|
|
1724
|
+
const w = Nt(M, S);
|
|
1722
1725
|
return {
|
|
1723
1726
|
...E,
|
|
1724
|
-
start:
|
|
1725
|
-
end:
|
|
1726
|
-
duration:
|
|
1727
|
+
start: M,
|
|
1728
|
+
end: S,
|
|
1729
|
+
duration: w
|
|
1727
1730
|
};
|
|
1728
1731
|
}, [c, e, n, r, s]), p = Je((h) => {
|
|
1729
1732
|
if (h && a) {
|
|
1730
|
-
const { id:
|
|
1733
|
+
const { id: v, ...y } = h, m = c.type;
|
|
1731
1734
|
if (m && m !== "reorder") {
|
|
1732
1735
|
const E = {
|
|
1733
1736
|
dragType: m,
|
|
@@ -1735,9 +1738,9 @@ const yn = ({
|
|
|
1735
1738
|
previousEnd: new Date(c.initialEnd),
|
|
1736
1739
|
previousDuration: Nt(c.initialStart, c.initialEnd)
|
|
1737
1740
|
};
|
|
1738
|
-
a(
|
|
1741
|
+
a(v, y, E);
|
|
1739
1742
|
} else
|
|
1740
|
-
a(
|
|
1743
|
+
a(v, y);
|
|
1741
1744
|
}
|
|
1742
1745
|
b({
|
|
1743
1746
|
taskId: null,
|
|
@@ -1759,7 +1762,7 @@ const yn = ({
|
|
|
1759
1762
|
}, mr = (e) => {
|
|
1760
1763
|
const a = new Date(e.getFullYear(), e.getMonth(), 1);
|
|
1761
1764
|
return Math.ceil((e.getDate() + a.getDay()) / 7);
|
|
1762
|
-
}, fr = (e) => Math.floor(e.getMonth() / 3) + 1, Qt = (e, a, n) => a.unit === "week" ? a.format?.includes("W") ? a.format.replace(/\bW\b/g, String(mr(e))) : `Week ${mr(e)}` : a.unit === "quarter" ? a.format?.includes("Q") ? a.format.replace(/\bQ\b/g, String(fr(e))) : `Q${fr(e)}` :
|
|
1765
|
+
}, fr = (e) => Math.floor(e.getMonth() / 3) + 1, Qt = (e, a, n) => a.unit === "week" ? a.format?.includes("W") ? a.format.replace(/\bW\b/g, String(mr(e))) : `Week ${mr(e)}` : a.unit === "quarter" ? a.format?.includes("Q") ? a.format.replace(/\bQ\b/g, String(fr(e))) : `Q${fr(e)}` : Oe(e, a.format || n), Sn = (e, a) => {
|
|
1763
1766
|
const n = new Date(e);
|
|
1764
1767
|
switch (n.setMinutes(0, 0, 0), a.unit) {
|
|
1765
1768
|
case "hour": {
|
|
@@ -1767,11 +1770,11 @@ const yn = ({
|
|
|
1767
1770
|
return n.setHours(s), n;
|
|
1768
1771
|
}
|
|
1769
1772
|
case "day": {
|
|
1770
|
-
const s =
|
|
1773
|
+
const s = yt(n), r = s.getDate(), c = r - (r - 1) % a.step;
|
|
1771
1774
|
return new Date(s.getFullYear(), s.getMonth(), c);
|
|
1772
1775
|
}
|
|
1773
1776
|
case "week": {
|
|
1774
|
-
const s =
|
|
1777
|
+
const s = yt(n), r = new Date(s);
|
|
1775
1778
|
return r.setDate(s.getDate() - s.getDay()), r;
|
|
1776
1779
|
}
|
|
1777
1780
|
case "month":
|
|
@@ -1785,20 +1788,20 @@ const yn = ({
|
|
|
1785
1788
|
return new Date(s, 0, 1);
|
|
1786
1789
|
}
|
|
1787
1790
|
default:
|
|
1788
|
-
return
|
|
1791
|
+
return yt(n);
|
|
1789
1792
|
}
|
|
1790
|
-
}, Lr =
|
|
1791
|
-
|
|
1792
|
-
({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate: p, zoomLevel: h, baselines:
|
|
1793
|
-
const N =
|
|
1794
|
-
N.current = l, typeof
|
|
1795
|
-
}, [
|
|
1793
|
+
}, Lr = A.memo(
|
|
1794
|
+
A.forwardRef(
|
|
1795
|
+
({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate: p, zoomLevel: h, baselines: v, allowBaselineOnlyMode: y, taskTooltipConfig: m, headerHeight: E }, F) => {
|
|
1796
|
+
const N = A.useRef(null), M = A.useCallback((l) => {
|
|
1797
|
+
N.current = l, typeof F == "function" ? F(l) : F && (F.current = l);
|
|
1798
|
+
}, [F]), [S, w] = G(e), [C, Z] = G(a), [W, re] = G(0), le = A.useMemo(
|
|
1796
1799
|
() => Math.max((r.columnWidth || 60) * h, r.minColumnWidth || 0),
|
|
1797
1800
|
[r.columnWidth, r.minColumnWidth, h]
|
|
1798
|
-
), j = r.baselines &&
|
|
1801
|
+
), j = r.baselines && v && v.size > 0, X = A.useMemo(() => {
|
|
1799
1802
|
const l = /* @__PURE__ */ new Map();
|
|
1800
|
-
return
|
|
1801
|
-
}, [
|
|
1803
|
+
return S.forEach((g) => l.set(g.id, g)), l;
|
|
1804
|
+
}, [S]), R = A.useMemo(() => {
|
|
1802
1805
|
const l = /* @__PURE__ */ new Map(), g = {
|
|
1803
1806
|
e2s: "Finish-to-Start",
|
|
1804
1807
|
s2s: "Start-to-Start",
|
|
@@ -1808,24 +1811,24 @@ const yn = ({
|
|
|
1808
1811
|
const ee = [...l.get(f) || [], ...U.map((ie) => ie.trim()).filter(Boolean)];
|
|
1809
1812
|
ee.length > 0 && l.set(f, Array.from(new Set(ee)));
|
|
1810
1813
|
};
|
|
1811
|
-
return
|
|
1814
|
+
return S.forEach((f) => {
|
|
1812
1815
|
f.dependencyRule && f.dependencyRule.length > 0 && D(f.id, f.dependencyRule);
|
|
1813
1816
|
}), C.forEach((f) => {
|
|
1814
1817
|
const U = X.get(f.source), q = X.get(f.target), ee = U?.text || `Task ${f.source}`, ie = q?.text || `Task ${f.target}`, $e = g[f.type], ze = typeof f.lag == "number" && f.lag !== 0 ? ` (${f.lag > 0 ? "+" : ""}${f.lag} ${f.lagUnit || "day"})` : "", ge = `${ie} depends on ${ee} [${$e}]${ze}`;
|
|
1815
1818
|
D(f.target, [ge]);
|
|
1816
1819
|
}), l;
|
|
1817
|
-
}, [C,
|
|
1818
|
-
|
|
1819
|
-
(e.length !==
|
|
1820
|
-
const f =
|
|
1820
|
+
}, [C, S, X]);
|
|
1821
|
+
A.useEffect(() => {
|
|
1822
|
+
(e.length !== S.length || e.some((g, D) => {
|
|
1823
|
+
const f = S[D];
|
|
1821
1824
|
return !f || g.id !== f.id || g.start.getTime() !== f.start.getTime() || g.end.getTime() !== f.end.getTime() || g.duration !== f.duration;
|
|
1822
|
-
})) &&
|
|
1823
|
-
}, [e]),
|
|
1825
|
+
})) && w(e);
|
|
1826
|
+
}, [e]), A.useEffect(() => {
|
|
1824
1827
|
(a.length !== C.length || a.some((g, D) => {
|
|
1825
1828
|
const f = C[D];
|
|
1826
1829
|
return !f || g.id !== f.id || g.source !== f.source || g.target !== f.target || g.type !== f.type;
|
|
1827
|
-
})) &&
|
|
1828
|
-
}, [a]),
|
|
1830
|
+
})) && Z(a);
|
|
1831
|
+
}, [a]), A.useEffect(() => {
|
|
1829
1832
|
const l = N.current?.parentElement;
|
|
1830
1833
|
if (!l) return;
|
|
1831
1834
|
const g = () => {
|
|
@@ -1842,7 +1845,7 @@ const yn = ({
|
|
|
1842
1845
|
});
|
|
1843
1846
|
return f.observe(D), () => f.disconnect();
|
|
1844
1847
|
}, []);
|
|
1845
|
-
const
|
|
1848
|
+
const O = A.useCallback((l) => {
|
|
1846
1849
|
const g = [];
|
|
1847
1850
|
let D = new Date(n.start);
|
|
1848
1851
|
for (; D <= n.end; ) {
|
|
@@ -1858,7 +1861,7 @@ const yn = ({
|
|
|
1858
1861
|
g.push({
|
|
1859
1862
|
date: new Date(D),
|
|
1860
1863
|
label: f
|
|
1861
|
-
}), D =
|
|
1864
|
+
}), D = Te(D, l.step, l.unit);
|
|
1862
1865
|
}
|
|
1863
1866
|
if (W > 0) {
|
|
1864
1867
|
const f = Math.floor(W / le);
|
|
@@ -1875,51 +1878,51 @@ const yn = ({
|
|
|
1875
1878
|
g.push({
|
|
1876
1879
|
date: new Date(D),
|
|
1877
1880
|
label: U
|
|
1878
|
-
}), D =
|
|
1881
|
+
}), D = Te(D, l.step, l.unit);
|
|
1879
1882
|
}
|
|
1880
1883
|
}
|
|
1881
1884
|
return g;
|
|
1882
|
-
}, [n.start, n.end, W, le]), B = s[1] || s[0], Y =
|
|
1885
|
+
}, [n.start, n.end, W, le]), B = s[s.length - 1] || s[0], Y = A.useMemo(() => O(B), [O, B]), k = A.useMemo(() => Y.length === 0 || W <= 0 ? le : Math.max(le, W / Y.length), [le, Y.length, W]), De = y && S.length === 0 && j, Se = !!r.timelineView || !!r.timelineViews?.length, V = A.useMemo(() => {
|
|
1883
1886
|
if (r.showTimelineHeader === !1) return 0;
|
|
1884
|
-
let l =
|
|
1887
|
+
let l = Se ? Math.max(s.length - 1, 0) : 2;
|
|
1885
1888
|
if (r.showMonthHeading === !1 && (l = Math.max(0, l - 1)), r.showRangeHeading === !1) {
|
|
1886
|
-
const g =
|
|
1889
|
+
const g = Se ? Math.max(0, s.length - 2) : 1;
|
|
1887
1890
|
l = Math.max(0, l - g);
|
|
1888
1891
|
}
|
|
1889
1892
|
return l;
|
|
1890
|
-
}, [r.showTimelineHeader, r.showMonthHeading, r.showRangeHeading,
|
|
1891
|
-
|
|
1893
|
+
}, [r.showTimelineHeader, r.showMonthHeading, r.showRangeHeading, Se, s.length]), { dragState: I, handleDragStart: ne, handleDrag: de, handleDragEnd: se } = bn(
|
|
1894
|
+
S,
|
|
1892
1895
|
p,
|
|
1893
|
-
|
|
1896
|
+
k,
|
|
1894
1897
|
B.unit,
|
|
1895
1898
|
B.step
|
|
1896
|
-
), ue =
|
|
1899
|
+
), ue = A.useCallback((l) => {
|
|
1897
1900
|
if (Y.length === 0) return 0;
|
|
1898
1901
|
const g = l.getTime(), D = Y.length - 1;
|
|
1899
1902
|
for (let f = 0; f <= D; f++) {
|
|
1900
|
-
const U = Y[f], q = U.date.getTime(), ie = (f < D ? Y[f + 1].date :
|
|
1903
|
+
const U = Y[f], q = U.date.getTime(), ie = (f < D ? Y[f + 1].date : Te(U.date, B.step, B.unit)).getTime(), $e = Math.max(ie - q, 1);
|
|
1901
1904
|
if (g < q)
|
|
1902
|
-
return f *
|
|
1905
|
+
return f * k;
|
|
1903
1906
|
if (g <= ie) {
|
|
1904
1907
|
const ze = Math.max(0, Math.min((g - q) / $e, 1));
|
|
1905
|
-
return (f + ze) *
|
|
1908
|
+
return (f + ze) * k;
|
|
1906
1909
|
}
|
|
1907
1910
|
}
|
|
1908
|
-
return Y.length *
|
|
1909
|
-
}, [Y, B,
|
|
1911
|
+
return Y.length * k;
|
|
1912
|
+
}, [Y, B, k]), z = (l) => {
|
|
1910
1913
|
const g = ue(l.start), D = ue(l.end);
|
|
1911
1914
|
return {
|
|
1912
1915
|
left: g,
|
|
1913
1916
|
width: Math.max(D - g, 0)
|
|
1914
1917
|
};
|
|
1915
|
-
},
|
|
1918
|
+
}, ye = (l) => {
|
|
1916
1919
|
const g = ue(l.start), D = ue(l.end);
|
|
1917
1920
|
return {
|
|
1918
1921
|
left: g,
|
|
1919
1922
|
width: Math.max(D - g, 0)
|
|
1920
1923
|
};
|
|
1921
|
-
},
|
|
1922
|
-
const g = z(l), D =
|
|
1924
|
+
}, Le = A.useCallback((l) => {
|
|
1925
|
+
const g = z(l), D = S.findIndex((ee) => ee.id === l.id);
|
|
1923
1926
|
let f = r.rowHeight || 48;
|
|
1924
1927
|
if (N.current) {
|
|
1925
1928
|
const ee = getComputedStyle(N.current).getPropertyValue("--gantt-row-height");
|
|
@@ -1935,73 +1938,73 @@ const yn = ({
|
|
|
1935
1938
|
top: D * f + q,
|
|
1936
1939
|
height: U
|
|
1937
1940
|
};
|
|
1938
|
-
}, [z,
|
|
1941
|
+
}, [z, S, r.rowHeight, r.taskHeight]), Ie = A.useRef(null), Ye = Je((l) => {
|
|
1939
1942
|
I.taskId && I.type && (Ie.current && cancelAnimationFrame(Ie.current), Ie.current = requestAnimationFrame(() => {
|
|
1940
1943
|
const g = de(l.clientX, l.clientY);
|
|
1941
|
-
g &&
|
|
1944
|
+
g && w(
|
|
1942
1945
|
(D) => D.map((f) => f.id === g.id ? g : f)
|
|
1943
1946
|
);
|
|
1944
1947
|
}));
|
|
1945
1948
|
}, [I, de]), $ = Je(() => {
|
|
1946
1949
|
if (I.taskId) {
|
|
1947
|
-
const l =
|
|
1950
|
+
const l = S.find((g) => g.id === I.taskId);
|
|
1948
1951
|
se(l || null), d();
|
|
1949
1952
|
}
|
|
1950
|
-
}, [I,
|
|
1953
|
+
}, [I, S, se, d]), J = A.useCallback((l) => {
|
|
1951
1954
|
const g = [];
|
|
1952
1955
|
let D = "", f = "", U = 0;
|
|
1953
1956
|
return Y.forEach((q) => {
|
|
1954
1957
|
const ee = Sn(q.date, l), ie = ee.toISOString(), $e = l.unit === "year" ? "YYYY" : l.unit === "month" ? "MMM YYYY" : l.unit === "day" ? "MMM D" : "D", ze = Qt(ee, l, $e);
|
|
1955
|
-
ie !== D ? (D && g.push({ key: D, label: f, width: U }), D = ie, f = ze, U =
|
|
1958
|
+
ie !== D ? (D && g.push({ key: D, label: f, width: U }), D = ie, f = ze, U = k) : U += k;
|
|
1956
1959
|
}), D && g.push({ key: D, label: f, width: U }), g;
|
|
1957
|
-
}, [Y,
|
|
1958
|
-
if (!
|
|
1960
|
+
}, [Y, k]), xe = A.useMemo(() => {
|
|
1961
|
+
if (!Se) return [];
|
|
1959
1962
|
const l = [];
|
|
1960
1963
|
return s.slice(0, -1).forEach((D) => {
|
|
1961
|
-
const f =
|
|
1964
|
+
const f = J(D);
|
|
1962
1965
|
f.length > 0 && l.push(f);
|
|
1963
1966
|
}), l.push(
|
|
1964
1967
|
Y.map((D, f) => ({
|
|
1965
1968
|
key: `secondary-${f}`,
|
|
1966
1969
|
label: D.label,
|
|
1967
|
-
width:
|
|
1970
|
+
width: k,
|
|
1968
1971
|
date: D.date
|
|
1969
1972
|
}))
|
|
1970
1973
|
), l;
|
|
1971
|
-
}, [
|
|
1974
|
+
}, [J, k, Se, s, Y]), Qe = A.useCallback(() => {
|
|
1972
1975
|
const l = [];
|
|
1973
1976
|
let g = -1, D = -1, f = 0, U = "";
|
|
1974
1977
|
return Y.forEach((q) => {
|
|
1975
|
-
const ee = q.date.getMonth(), ie = q.date.getFullYear(), $e =
|
|
1976
|
-
ee !== g || ie !== D ? (g !== -1 && l.push({ label: U, width: f }), g = ee, D = ie, f =
|
|
1978
|
+
const ee = q.date.getMonth(), ie = q.date.getFullYear(), $e = Oe(q.date, "MMM YYYY");
|
|
1979
|
+
ee !== g || ie !== D ? (g !== -1 && l.push({ label: U, width: f }), g = ee, D = ie, f = k, U = $e) : f += k;
|
|
1977
1980
|
}), g !== -1 && l.push({ label: U, width: f }), l;
|
|
1978
|
-
}, [Y,
|
|
1981
|
+
}, [Y, k]), ce = A.useCallback(() => {
|
|
1979
1982
|
const l = [];
|
|
1980
1983
|
let g = -1, D = 0, f = -1, U = -1, q = "";
|
|
1981
1984
|
return Y.forEach((ee) => {
|
|
1982
|
-
const $e = ee.date.getDate() <= 15 ? 0 : 1, ze = ee.date.getMonth(), ge = ee.date.getFullYear(), tt =
|
|
1983
|
-
$e !== g || ze !== f || ge !== U ? (g !== -1 && l.push({ label: q, width: D }), g = $e, f = ze, U = ge, D =
|
|
1985
|
+
const $e = ee.date.getDate() <= 15 ? 0 : 1, ze = ee.date.getMonth(), ge = ee.date.getFullYear(), tt = Oe(ee.date, "MMM"), Ke = new Date(ge, ze + 1, 0).getDate(), st = $e === 0 ? `${tt} 1 - 15` : `${tt} 16 - ${Ke}`;
|
|
1986
|
+
$e !== g || ze !== f || ge !== U ? (g !== -1 && l.push({ label: q, width: D }), g = $e, f = ze, U = ge, D = k, q = st) : D += k;
|
|
1984
1987
|
}), g !== -1 && l.push({ label: q, width: D }), l;
|
|
1985
|
-
}, [Y,
|
|
1988
|
+
}, [Y, k]), me = A.useMemo(() => Qe(), [Qe]), Fe = A.useMemo(() => ce(), [ce]), pe = A.useMemo(() => Y.length * k, [Y.length, k]), et = A.useMemo(() => {
|
|
1986
1989
|
const l = /* @__PURE__ */ new Date();
|
|
1987
1990
|
return l.setHours(0, 0, 0, 0), l;
|
|
1988
|
-
}, []),
|
|
1991
|
+
}, []), _e = A.useMemo(() => {
|
|
1989
1992
|
if (!r.showTodayLine) return null;
|
|
1990
1993
|
const l = ue(et);
|
|
1991
|
-
return l >= -
|
|
1992
|
-
}, [r.showTodayLine, et, pe,
|
|
1994
|
+
return l >= -k && l <= pe + k ? Math.max(0, Math.min(l, pe)) : null;
|
|
1995
|
+
}, [r.showTodayLine, et, pe, k, ue]), Xe = A.useMemo(() => {
|
|
1993
1996
|
if (r.projectStartDate)
|
|
1994
|
-
return
|
|
1995
|
-
if (
|
|
1996
|
-
const l =
|
|
1997
|
-
return
|
|
1997
|
+
return yt(r.projectStartDate);
|
|
1998
|
+
if (S.length > 0) {
|
|
1999
|
+
const l = S.map((g) => g.start.getTime());
|
|
2000
|
+
return yt(new Date(Math.min(...l)));
|
|
1998
2001
|
}
|
|
1999
2002
|
return null;
|
|
2000
|
-
}, [r.projectStartDate,
|
|
2003
|
+
}, [r.projectStartDate, S]), Ue = A.useMemo(() => {
|
|
2001
2004
|
if (!r.showProjectStartLine || !Xe) return null;
|
|
2002
2005
|
const l = ue(Xe);
|
|
2003
|
-
return l >= -
|
|
2004
|
-
}, [r.showProjectStartLine, Xe, pe,
|
|
2006
|
+
return l >= -k && l <= pe + k ? Math.max(0, Math.min(l, pe)) : null;
|
|
2007
|
+
}, [r.showProjectStartLine, Xe, pe, k, ue]), ot = `calc(var(--gantt-scale-height, 24px) * ${V})`;
|
|
2005
2008
|
return /* @__PURE__ */ t.jsxs(
|
|
2006
2009
|
"div",
|
|
2007
2010
|
{
|
|
@@ -2012,14 +2015,14 @@ const yn = ({
|
|
|
2012
2015
|
style: { width: pe, position: "relative" },
|
|
2013
2016
|
children: [
|
|
2014
2017
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-header", style: { width: pe, minWidth: pe, position: "relative", height: E }, children: [
|
|
2015
|
-
|
|
2018
|
+
_e !== null && r.showTodayLine && r.todayLineLabel && r.todayLineLabel !== "" && /* @__PURE__ */ t.jsx(
|
|
2016
2019
|
"div",
|
|
2017
2020
|
{
|
|
2018
2021
|
className: "gantt-today-line-label",
|
|
2019
2022
|
style: {
|
|
2020
2023
|
position: "absolute",
|
|
2021
2024
|
top: ot,
|
|
2022
|
-
left: `${
|
|
2025
|
+
left: `${_e}px`,
|
|
2023
2026
|
transform: "translateX(-50%)",
|
|
2024
2027
|
backgroundColor: r.todayLineColor || "#ff4d4f",
|
|
2025
2028
|
color: "#ffffff",
|
|
@@ -2064,15 +2067,15 @@ const yn = ({
|
|
|
2064
2067
|
children: r.projectStartLineLabel
|
|
2065
2068
|
}
|
|
2066
2069
|
),
|
|
2067
|
-
r.showTimelineHeader !== !1 && (
|
|
2068
|
-
const D = g === 0 ? "gantt-timeline-scale-month" : g ===
|
|
2070
|
+
r.showTimelineHeader !== !1 && (Se ? xe.map((l, g) => {
|
|
2071
|
+
const D = g === 0 ? "gantt-timeline-scale-month" : g === xe.length - 1 ? "gantt-timeline-scale-day" : "gantt-timeline-scale-range";
|
|
2069
2072
|
return /* @__PURE__ */ t.jsx(
|
|
2070
2073
|
"div",
|
|
2071
2074
|
{
|
|
2072
2075
|
className: `gantt-timeline-scale ${D}`,
|
|
2073
|
-
style: { width: pe, display: g === 0 && r.showMonthHeading === !1 || g !== 0 && g !==
|
|
2076
|
+
style: { width: pe, display: g === 0 && r.showMonthHeading === !1 || g !== 0 && g !== xe.length - 1 && r.showRangeHeading === !1 ? "none" : "flex" },
|
|
2074
2077
|
children: l.map((f, U) => {
|
|
2075
|
-
const q = g ===
|
|
2078
|
+
const q = g === xe.length - 1, ee = q && f.date ? r.weekends && Kt(f.date) : !1, ie = q && f.date ? r.holidays && Zt(f.date, r.holidays) : !1;
|
|
2076
2079
|
return /* @__PURE__ */ t.jsx(
|
|
2077
2080
|
"div",
|
|
2078
2081
|
{
|
|
@@ -2127,9 +2130,9 @@ const yn = ({
|
|
|
2127
2130
|
{
|
|
2128
2131
|
className: `gantt-timeline-cell ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
|
|
2129
2132
|
style: {
|
|
2130
|
-
width:
|
|
2131
|
-
minWidth:
|
|
2132
|
-
maxWidth:
|
|
2133
|
+
width: k,
|
|
2134
|
+
minWidth: k,
|
|
2135
|
+
maxWidth: k,
|
|
2133
2136
|
borderRight: g === Y.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
2134
2137
|
},
|
|
2135
2138
|
children: l.label
|
|
@@ -2140,7 +2143,7 @@ const yn = ({
|
|
|
2140
2143
|
] }))
|
|
2141
2144
|
] }),
|
|
2142
2145
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-body", style: { width: pe, position: "relative" }, children: [
|
|
2143
|
-
|
|
2146
|
+
_e !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2144
2147
|
r.showTodayLineMarker !== !1 && (() => {
|
|
2145
2148
|
const l = r.todayLineMarkerSize || 8, g = r.todayLineColor || "#ff4d4f", D = r.todayLineMarkerStyle || "triangle", f = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
|
|
2146
2149
|
return D === "triangle" ? /* @__PURE__ */ t.jsx(
|
|
@@ -2149,7 +2152,7 @@ const yn = ({
|
|
|
2149
2152
|
className: "gantt-today-line-marker",
|
|
2150
2153
|
style: {
|
|
2151
2154
|
position: "absolute",
|
|
2152
|
-
left: `${
|
|
2155
|
+
left: `${_e}px`,
|
|
2153
2156
|
top: "-4px",
|
|
2154
2157
|
transform: "translateX(-50%)",
|
|
2155
2158
|
width: 0,
|
|
@@ -2168,7 +2171,7 @@ const yn = ({
|
|
|
2168
2171
|
className: "gantt-today-line-marker",
|
|
2169
2172
|
style: {
|
|
2170
2173
|
position: "absolute",
|
|
2171
|
-
left: `${
|
|
2174
|
+
left: `${_e}px`,
|
|
2172
2175
|
top: "-6px",
|
|
2173
2176
|
transform: "translateX(-50%)",
|
|
2174
2177
|
width: 0,
|
|
@@ -2187,7 +2190,7 @@ const yn = ({
|
|
|
2187
2190
|
className: "gantt-today-line-marker",
|
|
2188
2191
|
style: {
|
|
2189
2192
|
position: "absolute",
|
|
2190
|
-
left: `${
|
|
2193
|
+
left: `${_e}px`,
|
|
2191
2194
|
top: `-${l / 2}px`,
|
|
2192
2195
|
transform: "translateX(-50%)",
|
|
2193
2196
|
width: `${l}px`,
|
|
@@ -2207,7 +2210,7 @@ const yn = ({
|
|
|
2207
2210
|
className: "gantt-today-line",
|
|
2208
2211
|
style: {
|
|
2209
2212
|
position: "absolute",
|
|
2210
|
-
left: `${
|
|
2213
|
+
left: `${_e}px`,
|
|
2211
2214
|
top: 0,
|
|
2212
2215
|
bottom: 0,
|
|
2213
2216
|
width: `${r.todayLineWidth || 1}px`,
|
|
@@ -2310,7 +2313,7 @@ const yn = ({
|
|
|
2310
2313
|
"div",
|
|
2311
2314
|
{
|
|
2312
2315
|
className: `gantt-timeline-grid-column ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
|
|
2313
|
-
style: { width:
|
|
2316
|
+
style: { width: k, minWidth: k }
|
|
2314
2317
|
},
|
|
2315
2318
|
g
|
|
2316
2319
|
);
|
|
@@ -2319,12 +2322,12 @@ const yn = ({
|
|
|
2319
2322
|
wn,
|
|
2320
2323
|
{
|
|
2321
2324
|
links: C,
|
|
2322
|
-
tasks:
|
|
2323
|
-
getTaskPosition:
|
|
2325
|
+
tasks: S,
|
|
2326
|
+
getTaskPosition: Le
|
|
2324
2327
|
}
|
|
2325
2328
|
),
|
|
2326
|
-
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width: pe }, children:
|
|
2327
|
-
const g =
|
|
2329
|
+
/* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width: pe }, children: De ? Array.from(v?.values() || []).map((l) => {
|
|
2330
|
+
const g = ye(l);
|
|
2328
2331
|
return /* @__PURE__ */ t.jsx(
|
|
2329
2332
|
"div",
|
|
2330
2333
|
{
|
|
@@ -2343,8 +2346,8 @@ const yn = ({
|
|
|
2343
2346
|
},
|
|
2344
2347
|
`baseline-only-${l.taskId}`
|
|
2345
2348
|
);
|
|
2346
|
-
}) :
|
|
2347
|
-
const g = z(l), D = j ?
|
|
2349
|
+
}) : S.map((l) => {
|
|
2350
|
+
const g = z(l), D = j ? v?.get(l.id) : void 0, f = D ? ye(D) : void 0;
|
|
2348
2351
|
return /* @__PURE__ */ t.jsxs(
|
|
2349
2352
|
"div",
|
|
2350
2353
|
{
|
|
@@ -2362,11 +2365,11 @@ const yn = ({
|
|
|
2362
2365
|
}
|
|
2363
2366
|
),
|
|
2364
2367
|
!l.hideBar && /* @__PURE__ */ t.jsx(
|
|
2365
|
-
|
|
2368
|
+
xn,
|
|
2366
2369
|
{
|
|
2367
2370
|
task: l,
|
|
2368
2371
|
baseline: D,
|
|
2369
|
-
dependencyRuleDescriptions:
|
|
2372
|
+
dependencyRuleDescriptions: R.get(l.id) || [],
|
|
2370
2373
|
tooltipConfig: m,
|
|
2371
2374
|
position: g,
|
|
2372
2375
|
selected: c === l.id,
|
|
@@ -2427,7 +2430,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2427
2430
|
) }),
|
|
2428
2431
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-filter-right", children: [
|
|
2429
2432
|
/* @__PURE__ */ t.jsx(
|
|
2430
|
-
|
|
2433
|
+
ke,
|
|
2431
2434
|
{
|
|
2432
2435
|
value: s.status,
|
|
2433
2436
|
onChange: (d) => c({ status: d }),
|
|
@@ -2442,7 +2445,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2442
2445
|
}
|
|
2443
2446
|
),
|
|
2444
2447
|
/* @__PURE__ */ t.jsx(
|
|
2445
|
-
|
|
2448
|
+
ke,
|
|
2446
2449
|
{
|
|
2447
2450
|
value: s.priority,
|
|
2448
2451
|
onChange: (d) => c({ priority: d }),
|
|
@@ -2457,7 +2460,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2457
2460
|
}
|
|
2458
2461
|
),
|
|
2459
2462
|
/* @__PURE__ */ t.jsx(
|
|
2460
|
-
|
|
2463
|
+
ke,
|
|
2461
2464
|
{
|
|
2462
2465
|
value: s.owner || void 0,
|
|
2463
2466
|
onChange: (d) => c({ owner: d || "" }),
|
|
@@ -2476,7 +2479,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2476
2479
|
{
|
|
2477
2480
|
type: "default",
|
|
2478
2481
|
danger: !0,
|
|
2479
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
2482
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: qr }),
|
|
2480
2483
|
onClick: b,
|
|
2481
2484
|
className: "gantt-filter-clear-antd",
|
|
2482
2485
|
children: n.clearFiltersText || "Clear"
|
|
@@ -2484,7 +2487,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2484
2487
|
)
|
|
2485
2488
|
] })
|
|
2486
2489
|
] }) });
|
|
2487
|
-
}, ct = (e, a) => e ? typeof e == "string" ? /* @__PURE__ */ t.jsx(
|
|
2490
|
+
}, ct = (e, a) => e ? typeof e == "string" ? /* @__PURE__ */ t.jsx(Ee, { icon: a }) : e : /* @__PURE__ */ t.jsx(Ee, { icon: a }), Tn = ({
|
|
2488
2491
|
zoomLevel: e,
|
|
2489
2492
|
setZoomLevel: a,
|
|
2490
2493
|
timelineView: n,
|
|
@@ -2496,9 +2499,9 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2496
2499
|
onAddTask: d,
|
|
2497
2500
|
uiConfig: p,
|
|
2498
2501
|
iconConfig: h = {},
|
|
2499
|
-
styleConfig:
|
|
2502
|
+
styleConfig: v
|
|
2500
2503
|
}) => {
|
|
2501
|
-
const
|
|
2504
|
+
const y = jt(v), m = p.showZoomButtons !== !1, E = p.showExportButtons !== !1, F = s.length > 1 && r, N = m && E;
|
|
2502
2505
|
return /* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
|
|
2503
2506
|
/* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar", children: [
|
|
2504
2507
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(er, { size: 8, children: p.showAddTaskButton !== !1 && /* @__PURE__ */ t.jsx(
|
|
@@ -2507,12 +2510,12 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2507
2510
|
type: "primary",
|
|
2508
2511
|
icon: ct(h.addTask, ar),
|
|
2509
2512
|
onClick: () => d?.(),
|
|
2510
|
-
style:
|
|
2513
|
+
style: y.buttonPrimary,
|
|
2511
2514
|
children: p.addTaskButtonText || "New Stage"
|
|
2512
2515
|
}
|
|
2513
2516
|
) }) }),
|
|
2514
2517
|
/* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ t.jsxs(er, { size: 4, children: [
|
|
2515
|
-
|
|
2518
|
+
F && n && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2516
2519
|
/* @__PURE__ */ t.jsx(
|
|
2517
2520
|
Br,
|
|
2518
2521
|
{
|
|
@@ -2530,7 +2533,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2530
2533
|
{
|
|
2531
2534
|
icon: ct(h.zoomOut, Gr),
|
|
2532
2535
|
onClick: () => a(Math.max(0.5, e - 0.25)),
|
|
2533
|
-
style:
|
|
2536
|
+
style: y.buttonSecondary
|
|
2534
2537
|
}
|
|
2535
2538
|
) }),
|
|
2536
2539
|
/* @__PURE__ */ t.jsx(nt, { title: p.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ t.jsx(
|
|
@@ -2538,7 +2541,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2538
2541
|
{
|
|
2539
2542
|
icon: ct(h.zoomIn, Jr),
|
|
2540
2543
|
onClick: () => a(Math.min(2, e + 0.25)),
|
|
2541
|
-
style:
|
|
2544
|
+
style: y.buttonSecondary
|
|
2542
2545
|
}
|
|
2543
2546
|
) }),
|
|
2544
2547
|
/* @__PURE__ */ t.jsx(nt, { title: p.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ t.jsx(
|
|
@@ -2546,7 +2549,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2546
2549
|
{
|
|
2547
2550
|
icon: ct(h.resetZoom, jr),
|
|
2548
2551
|
onClick: () => a(1),
|
|
2549
|
-
style:
|
|
2552
|
+
style: y.buttonSecondary
|
|
2550
2553
|
}
|
|
2551
2554
|
) })
|
|
2552
2555
|
] }),
|
|
@@ -2557,7 +2560,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2557
2560
|
{
|
|
2558
2561
|
icon: ct(h.exportCSV, Kr),
|
|
2559
2562
|
onClick: () => c("csv"),
|
|
2560
|
-
style:
|
|
2563
|
+
style: y.buttonSecondary
|
|
2561
2564
|
}
|
|
2562
2565
|
) }),
|
|
2563
2566
|
/* @__PURE__ */ t.jsx(nt, { title: p.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ t.jsx(
|
|
@@ -2565,7 +2568,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2565
2568
|
{
|
|
2566
2569
|
icon: ct(h.exportExcel, Zr),
|
|
2567
2570
|
onClick: () => c("excel"),
|
|
2568
|
-
style:
|
|
2571
|
+
style: y.buttonSecondary
|
|
2569
2572
|
}
|
|
2570
2573
|
) }),
|
|
2571
2574
|
/* @__PURE__ */ t.jsx(nt, { title: p.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ t.jsx(
|
|
@@ -2573,7 +2576,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2573
2576
|
{
|
|
2574
2577
|
icon: ct(h.exportJSON, Qr),
|
|
2575
2578
|
onClick: () => c("json"),
|
|
2576
|
-
style:
|
|
2579
|
+
style: y.buttonSecondary
|
|
2577
2580
|
}
|
|
2578
2581
|
) }),
|
|
2579
2582
|
/* @__PURE__ */ t.jsx(nt, { title: p.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ t.jsx(
|
|
@@ -2581,7 +2584,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2581
2584
|
{
|
|
2582
2585
|
icon: ct(h.exportPDF, en),
|
|
2583
2586
|
onClick: () => c("pdf"),
|
|
2584
|
-
style:
|
|
2587
|
+
style: y.buttonSecondary
|
|
2585
2588
|
}
|
|
2586
2589
|
) })
|
|
2587
2590
|
] })
|
|
@@ -2596,13 +2599,13 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2596
2599
|
}
|
|
2597
2600
|
)
|
|
2598
2601
|
] });
|
|
2599
|
-
}, { Option: St } =
|
|
2600
|
-
const [b] =
|
|
2601
|
-
const h = p.start.toDate(),
|
|
2602
|
-
|
|
2602
|
+
}, { Option: St } = ke, { TextArea: Dn } = pt, Mn = ({ onCreateTask: e, onClose: a, uiConfig: n = {}, parentId: s, parentTaskName: r, styleConfig: c }) => {
|
|
2603
|
+
const [b] = je.useForm(), u = jt(c), d = (p) => {
|
|
2604
|
+
const h = p.start.toDate(), v = new Date(h);
|
|
2605
|
+
v.setDate(v.getDate() + (p.duration || 1)), e({
|
|
2603
2606
|
text: p.text,
|
|
2604
2607
|
start: h,
|
|
2605
|
-
end:
|
|
2608
|
+
end: v,
|
|
2606
2609
|
duration: p.duration || 1,
|
|
2607
2610
|
progress: p.progress || 0,
|
|
2608
2611
|
type: p.type,
|
|
@@ -2615,7 +2618,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2615
2618
|
}, s), a();
|
|
2616
2619
|
};
|
|
2617
2620
|
return /* @__PURE__ */ t.jsx(
|
|
2618
|
-
|
|
2621
|
+
At,
|
|
2619
2622
|
{
|
|
2620
2623
|
title: s ? (n.taskCreatorTitle || "Create Checklist") + (r ? ` for "${r}"` : "") : n.taskCreatorTitle || "Create New Stage",
|
|
2621
2624
|
open: !0,
|
|
@@ -2632,7 +2635,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2632
2635
|
okButtonProps: { style: u.buttonPrimary },
|
|
2633
2636
|
cancelButtonProps: { style: u.buttonSecondary },
|
|
2634
2637
|
children: /* @__PURE__ */ t.jsxs(
|
|
2635
|
-
|
|
2638
|
+
je,
|
|
2636
2639
|
{
|
|
2637
2640
|
form: b,
|
|
2638
2641
|
layout: "vertical",
|
|
@@ -2647,7 +2650,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2647
2650
|
},
|
|
2648
2651
|
children: [
|
|
2649
2652
|
/* @__PURE__ */ t.jsx(
|
|
2650
|
-
|
|
2653
|
+
je.Item,
|
|
2651
2654
|
{
|
|
2652
2655
|
name: "text",
|
|
2653
2656
|
label: n.taskNameLabel || "Stage Name",
|
|
@@ -2656,40 +2659,40 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2656
2659
|
}
|
|
2657
2660
|
),
|
|
2658
2661
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2659
|
-
/* @__PURE__ */ t.jsx(
|
|
2662
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: n.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
|
|
2660
2663
|
/* @__PURE__ */ t.jsx(St, { value: "task", children: n.taskTypeOptions?.task || "Stage" }),
|
|
2661
2664
|
/* @__PURE__ */ t.jsx(St, { value: "milestone", children: n.taskTypeOptions?.milestone || "Milestone" }),
|
|
2662
2665
|
/* @__PURE__ */ t.jsx(St, { value: "project", children: n.taskTypeOptions?.project || "Project" })
|
|
2663
2666
|
] }) }),
|
|
2664
|
-
/* @__PURE__ */ t.jsx(
|
|
2667
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: n.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
|
|
2665
2668
|
/* @__PURE__ */ t.jsx(St, { value: "low", children: n.priorityOptions?.low || "Low" }),
|
|
2666
2669
|
/* @__PURE__ */ t.jsx(St, { value: "medium", children: n.priorityOptions?.medium || "Medium" }),
|
|
2667
2670
|
/* @__PURE__ */ t.jsx(St, { value: "high", children: n.priorityOptions?.high || "High" })
|
|
2668
2671
|
] }) })
|
|
2669
2672
|
] }),
|
|
2670
2673
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2671
|
-
/* @__PURE__ */ t.jsx(
|
|
2672
|
-
/* @__PURE__ */ t.jsx(
|
|
2674
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "start", label: n.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(Sr, { style: { width: "100%", ...u.input } }) }),
|
|
2675
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: n.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, style: { width: "100%", ...u.input } }) })
|
|
2673
2676
|
] }),
|
|
2674
2677
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2675
|
-
/* @__PURE__ */ t.jsx(
|
|
2676
|
-
/* @__PURE__ */ t.jsx(
|
|
2678
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "color", label: n.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(vr, { showText: !0 }) }),
|
|
2679
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: n.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, max: 100, style: { width: "100%", ...u.input } }) })
|
|
2677
2680
|
] }),
|
|
2678
|
-
/* @__PURE__ */ t.jsx(
|
|
2679
|
-
/* @__PURE__ */ t.jsx(
|
|
2681
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: n.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(pt, { placeholder: n.ownerPlaceholder || "Assign to...", style: u.input }) }),
|
|
2682
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: n.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(Dn, { placeholder: n.detailsPlaceholder || "Add stage description...", rows: 3, style: u.input }) })
|
|
2680
2683
|
]
|
|
2681
2684
|
}
|
|
2682
2685
|
)
|
|
2683
2686
|
}
|
|
2684
2687
|
);
|
|
2685
|
-
}, { Option: vt } =
|
|
2686
|
-
const [b] =
|
|
2687
|
-
const
|
|
2688
|
-
|
|
2688
|
+
}, { Option: vt } = ke, { TextArea: En } = pt, { confirm: Ln } = At, Fn = ({ task: e, onUpdate: a, onDelete: n, onClose: s, uiConfig: r = {}, styleConfig: c }) => {
|
|
2689
|
+
const [b] = je.useForm(), u = jt(c), d = (h) => {
|
|
2690
|
+
const v = h.start.toDate(), y = new Date(v);
|
|
2691
|
+
y.setDate(y.getDate() + (h.duration || 1)), a({
|
|
2689
2692
|
...e,
|
|
2690
2693
|
text: h.text,
|
|
2691
|
-
start:
|
|
2692
|
-
end:
|
|
2694
|
+
start: v,
|
|
2695
|
+
end: y,
|
|
2693
2696
|
duration: h.duration || 1,
|
|
2694
2697
|
progress: h.progress || 0,
|
|
2695
2698
|
type: h.type,
|
|
@@ -2701,7 +2704,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2701
2704
|
}, p = () => {
|
|
2702
2705
|
Ln({
|
|
2703
2706
|
title: r.deleteConfirmTitle ? `${r.deleteConfirmTitle}: "${e.text}"?` : `Are you sure you want to delete "${e.text}"?`,
|
|
2704
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
2707
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: tn, style: { color: "#faad14", marginRight: 8 } }),
|
|
2705
2708
|
content: r.deleteConfirmContent || "This action cannot be undone.",
|
|
2706
2709
|
okText: r.deleteConfirmOkText || "Yes, Delete",
|
|
2707
2710
|
okType: "danger",
|
|
@@ -2712,7 +2715,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2712
2715
|
});
|
|
2713
2716
|
};
|
|
2714
2717
|
return /* @__PURE__ */ t.jsx(
|
|
2715
|
-
|
|
2718
|
+
At,
|
|
2716
2719
|
{
|
|
2717
2720
|
title: r.taskEditorTitle || "Edit Stage",
|
|
2718
2721
|
open: !0,
|
|
@@ -2729,7 +2732,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2729
2732
|
header: { borderBottom: `1px solid ${u.modal?.borderColor || "#f0f0f0"}`, marginBottom: 16 }
|
|
2730
2733
|
},
|
|
2731
2734
|
children: /* @__PURE__ */ t.jsxs(
|
|
2732
|
-
|
|
2735
|
+
je,
|
|
2733
2736
|
{
|
|
2734
2737
|
form: b,
|
|
2735
2738
|
layout: "vertical",
|
|
@@ -2747,7 +2750,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2747
2750
|
},
|
|
2748
2751
|
children: [
|
|
2749
2752
|
/* @__PURE__ */ t.jsx(
|
|
2750
|
-
|
|
2753
|
+
je.Item,
|
|
2751
2754
|
{
|
|
2752
2755
|
name: "text",
|
|
2753
2756
|
label: r.taskNameLabel || "Stage Name",
|
|
@@ -2756,33 +2759,33 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2756
2759
|
}
|
|
2757
2760
|
),
|
|
2758
2761
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2759
|
-
/* @__PURE__ */ t.jsx(
|
|
2762
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
|
|
2760
2763
|
/* @__PURE__ */ t.jsx(vt, { value: "task", children: r.taskTypeOptions?.task || "Stage" }),
|
|
2761
2764
|
/* @__PURE__ */ t.jsx(vt, { value: "milestone", children: r.taskTypeOptions?.milestone || "Milestone" }),
|
|
2762
2765
|
/* @__PURE__ */ t.jsx(vt, { value: "project", children: r.taskTypeOptions?.project || "Project" })
|
|
2763
2766
|
] }) }),
|
|
2764
|
-
/* @__PURE__ */ t.jsx(
|
|
2767
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
|
|
2765
2768
|
/* @__PURE__ */ t.jsx(vt, { value: "low", children: r.priorityOptions?.low || "Low" }),
|
|
2766
2769
|
/* @__PURE__ */ t.jsx(vt, { value: "medium", children: r.priorityOptions?.medium || "Medium" }),
|
|
2767
2770
|
/* @__PURE__ */ t.jsx(vt, { value: "high", children: r.priorityOptions?.high || "High" })
|
|
2768
2771
|
] }) })
|
|
2769
2772
|
] }),
|
|
2770
2773
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2771
|
-
/* @__PURE__ */ t.jsx(
|
|
2772
|
-
/* @__PURE__ */ t.jsx(
|
|
2774
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "start", label: r.startDateLabel || "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(Sr, { style: { width: "100%", ...u.input } }) }),
|
|
2775
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "duration", label: r.durationLabel || "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, style: { width: "100%", ...u.input } }) })
|
|
2773
2776
|
] }),
|
|
2774
2777
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
2775
|
-
/* @__PURE__ */ t.jsx(
|
|
2776
|
-
/* @__PURE__ */ t.jsx(
|
|
2778
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "color", label: r.colorLabel || "Color", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(vr, { showText: !0 }) }),
|
|
2779
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "progress", label: r.progressLabel || "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ t.jsx(at, { min: 0, max: 100, style: { width: "100%", ...u.input } }) })
|
|
2777
2780
|
] }),
|
|
2778
|
-
/* @__PURE__ */ t.jsx(
|
|
2779
|
-
/* @__PURE__ */ t.jsx(
|
|
2781
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "owner", label: r.ownerLabel || "Owner", children: /* @__PURE__ */ t.jsx(pt, { placeholder: r.ownerPlaceholder || "Assign to...", style: u.input }) }),
|
|
2782
|
+
/* @__PURE__ */ t.jsx(je.Item, { name: "details", label: r.detailsLabel || "Details", children: /* @__PURE__ */ t.jsx(En, { placeholder: r.detailsPlaceholder || "Add stage description...", rows: 3, style: u.input }) })
|
|
2780
2783
|
]
|
|
2781
2784
|
}
|
|
2782
2785
|
)
|
|
2783
2786
|
}
|
|
2784
2787
|
);
|
|
2785
|
-
}, { Title: Pt, Text: gt, Paragraph: Rn } = br, { Option: rt } =
|
|
2788
|
+
}, { Title: Pt, Text: gt, Paragraph: Rn } = br, { Option: rt } = ke, Pn = ({
|
|
2786
2789
|
task: e,
|
|
2787
2790
|
allTasks: a,
|
|
2788
2791
|
links: n,
|
|
@@ -2792,36 +2795,36 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
|
|
|
2792
2795
|
onClose: b,
|
|
2793
2796
|
styleConfig: u
|
|
2794
2797
|
}) => {
|
|
2795
|
-
const d = jt(u), [p, h] = G(""), [
|
|
2798
|
+
const d = jt(u), [p, h] = G(""), [v, y] = G("e2s"), [m, E] = G(0), [F, N] = G("day"), [M, S] = G(e.duration), [w, C] = G(""), Z = n.filter((R) => R.target === e.id), W = a.filter((R) => R.id !== e.id && R.id !== e.parent), re = () => {
|
|
2796
2799
|
if (p) {
|
|
2797
|
-
const
|
|
2800
|
+
const R = rr(m, F);
|
|
2798
2801
|
if (M !== e.duration && c) {
|
|
2799
|
-
const
|
|
2802
|
+
const O = Te(new Date(e.start), M, "day");
|
|
2800
2803
|
c({
|
|
2801
2804
|
...e,
|
|
2802
2805
|
duration: M,
|
|
2803
|
-
end:
|
|
2806
|
+
end: O
|
|
2804
2807
|
});
|
|
2805
2808
|
}
|
|
2806
|
-
s(p, e.id,
|
|
2809
|
+
s(p, e.id, v, R), h(""), E(0), N("day");
|
|
2807
2810
|
}
|
|
2808
2811
|
}, le = () => {
|
|
2809
|
-
if (!
|
|
2810
|
-
const
|
|
2811
|
-
if (!
|
|
2812
|
+
if (!w.trim()) return;
|
|
2813
|
+
const R = hn(w.trim());
|
|
2814
|
+
if (!R) {
|
|
2812
2815
|
alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
2813
2816
|
Example: 3FS+10d`);
|
|
2814
2817
|
return;
|
|
2815
2818
|
}
|
|
2816
|
-
const
|
|
2819
|
+
const O = R.taskNumber - 1, B = a[O];
|
|
2817
2820
|
if (!B) {
|
|
2818
|
-
alert(`Task ${
|
|
2821
|
+
alert(`Task ${R.taskNumber} not found`);
|
|
2819
2822
|
return;
|
|
2820
2823
|
}
|
|
2821
|
-
const Y = fn(
|
|
2822
|
-
s(B.id, e.id, Y,
|
|
2823
|
-
}, j = (
|
|
2824
|
-
switch (
|
|
2824
|
+
const Y = fn(R.type), k = rr(R.lag, R.lagUnit);
|
|
2825
|
+
s(B.id, e.id, Y, k), C("");
|
|
2826
|
+
}, j = (R) => {
|
|
2827
|
+
switch (R) {
|
|
2825
2828
|
case "e2s":
|
|
2826
2829
|
return "Finish-to-Start (FS)";
|
|
2827
2830
|
case "s2s":
|
|
@@ -2831,8 +2834,8 @@ Example: 3FS+10d`);
|
|
|
2831
2834
|
case "s2e":
|
|
2832
2835
|
return "Start-to-Finish (SF)";
|
|
2833
2836
|
}
|
|
2834
|
-
}, X = (
|
|
2835
|
-
switch (
|
|
2837
|
+
}, X = (R) => {
|
|
2838
|
+
switch (R) {
|
|
2836
2839
|
case "e2s":
|
|
2837
2840
|
return "blue";
|
|
2838
2841
|
case "s2s":
|
|
@@ -2844,7 +2847,7 @@ Example: 3FS+10d`);
|
|
|
2844
2847
|
}
|
|
2845
2848
|
};
|
|
2846
2849
|
return /* @__PURE__ */ t.jsx(
|
|
2847
|
-
|
|
2850
|
+
At,
|
|
2848
2851
|
{
|
|
2849
2852
|
title: /* @__PURE__ */ t.jsx(Pt, { level: 4, style: { margin: 0, color: d.font?.color }, children: "Dependency Editor" }),
|
|
2850
2853
|
open: !0,
|
|
@@ -2877,7 +2880,7 @@ Example: 3FS+10d`);
|
|
|
2877
2880
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2878
2881
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Predecessor" }),
|
|
2879
2882
|
/* @__PURE__ */ t.jsx(
|
|
2880
|
-
|
|
2883
|
+
ke,
|
|
2881
2884
|
{
|
|
2882
2885
|
showSearch: !0,
|
|
2883
2886
|
placeholder: "Select a task",
|
|
@@ -2885,23 +2888,23 @@ Example: 3FS+10d`);
|
|
|
2885
2888
|
style: { width: "100%", ...d.input },
|
|
2886
2889
|
value: p,
|
|
2887
2890
|
onChange: h,
|
|
2888
|
-
children: W.map((
|
|
2891
|
+
children: W.map((R) => /* @__PURE__ */ t.jsxs(rt, { value: R.id, children: [
|
|
2889
2892
|
"[",
|
|
2890
|
-
a.indexOf(
|
|
2893
|
+
a.indexOf(R) + 1,
|
|
2891
2894
|
"] ",
|
|
2892
|
-
|
|
2893
|
-
] },
|
|
2895
|
+
R.text
|
|
2896
|
+
] }, R.id))
|
|
2894
2897
|
}
|
|
2895
2898
|
)
|
|
2896
2899
|
] }),
|
|
2897
2900
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
2898
2901
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Type" }),
|
|
2899
2902
|
/* @__PURE__ */ t.jsxs(
|
|
2900
|
-
|
|
2903
|
+
ke,
|
|
2901
2904
|
{
|
|
2902
2905
|
style: { width: "100%", ...d.input },
|
|
2903
|
-
value:
|
|
2904
|
-
onChange:
|
|
2906
|
+
value: v,
|
|
2907
|
+
onChange: y,
|
|
2905
2908
|
children: [
|
|
2906
2909
|
/* @__PURE__ */ t.jsx(rt, { value: "e2s", children: "Finish-to-Start (FS)" }),
|
|
2907
2910
|
/* @__PURE__ */ t.jsx(rt, { value: "s2s", children: "Start-to-Start (SS)" }),
|
|
@@ -2919,17 +2922,17 @@ Example: 3FS+10d`);
|
|
|
2919
2922
|
{
|
|
2920
2923
|
style: { width: "100%", ...d.input },
|
|
2921
2924
|
value: m,
|
|
2922
|
-
onChange: (
|
|
2925
|
+
onChange: (R) => E(R || 0)
|
|
2923
2926
|
}
|
|
2924
2927
|
)
|
|
2925
2928
|
] }),
|
|
2926
2929
|
/* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
|
|
2927
2930
|
/* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Units" }),
|
|
2928
2931
|
/* @__PURE__ */ t.jsxs(
|
|
2929
|
-
|
|
2932
|
+
ke,
|
|
2930
2933
|
{
|
|
2931
2934
|
style: { width: "100%", ...d.input },
|
|
2932
|
-
value:
|
|
2935
|
+
value: F,
|
|
2933
2936
|
onChange: N,
|
|
2934
2937
|
children: [
|
|
2935
2938
|
/* @__PURE__ */ t.jsx(rt, { value: "day", children: "Days" }),
|
|
@@ -2949,7 +2952,7 @@ Example: 3FS+10d`);
|
|
|
2949
2952
|
style: { width: "100%", ...d.input },
|
|
2950
2953
|
min: 1,
|
|
2951
2954
|
value: M,
|
|
2952
|
-
onChange: (
|
|
2955
|
+
onChange: (R) => S(R || 1)
|
|
2953
2956
|
}
|
|
2954
2957
|
)
|
|
2955
2958
|
] }),
|
|
@@ -2957,7 +2960,7 @@ Example: 3FS+10d`);
|
|
|
2957
2960
|
Pe,
|
|
2958
2961
|
{
|
|
2959
2962
|
type: "primary",
|
|
2960
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
2963
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: ar, style: { marginRight: 8 } }),
|
|
2961
2964
|
block: !0,
|
|
2962
2965
|
onClick: re,
|
|
2963
2966
|
disabled: !p,
|
|
@@ -2989,8 +2992,8 @@ Example: 3FS+10d`);
|
|
|
2989
2992
|
pt,
|
|
2990
2993
|
{
|
|
2991
2994
|
placeholder: "e.g. 5FS+2d",
|
|
2992
|
-
value:
|
|
2993
|
-
onChange: (
|
|
2995
|
+
value: w,
|
|
2996
|
+
onChange: (R) => C(R.target.value),
|
|
2994
2997
|
onPressEnter: le,
|
|
2995
2998
|
style: {
|
|
2996
2999
|
marginBottom: 16,
|
|
@@ -3021,10 +3024,10 @@ Example: 3FS+10d`);
|
|
|
3021
3024
|
/* @__PURE__ */ t.jsx(
|
|
3022
3025
|
Jt,
|
|
3023
3026
|
{
|
|
3024
|
-
dataSource:
|
|
3027
|
+
dataSource: Z,
|
|
3025
3028
|
locale: { emptyText: /* @__PURE__ */ t.jsx(gt, { type: "secondary", style: { color: d.font?.color, opacity: 0.5 }, children: "No dependencies added yet." }) },
|
|
3026
|
-
renderItem: (
|
|
3027
|
-
const
|
|
3029
|
+
renderItem: (R) => {
|
|
3030
|
+
const O = a.find((B) => B.id === R.source);
|
|
3028
3031
|
return /* @__PURE__ */ t.jsx(
|
|
3029
3032
|
Jt.Item,
|
|
3030
3033
|
{
|
|
@@ -3041,8 +3044,8 @@ Example: 3FS+10d`);
|
|
|
3041
3044
|
{
|
|
3042
3045
|
type: "text",
|
|
3043
3046
|
danger: !0,
|
|
3044
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3045
|
-
onClick: () => r(
|
|
3047
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: Dr }),
|
|
3048
|
+
onClick: () => r(R.id)
|
|
3046
3049
|
},
|
|
3047
3050
|
"delete"
|
|
3048
3051
|
)
|
|
@@ -3061,15 +3064,15 @@ Example: 3FS+10d`);
|
|
|
3061
3064
|
color: "#fff",
|
|
3062
3065
|
fontSize: 12,
|
|
3063
3066
|
fontWeight: "bold"
|
|
3064
|
-
}, children:
|
|
3067
|
+
}, children: O ? a.indexOf(O) + 1 : "?" }),
|
|
3065
3068
|
title: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
3066
|
-
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children:
|
|
3067
|
-
/* @__PURE__ */ t.jsx(Wr, { color: X(
|
|
3069
|
+
/* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children: O?.text || "Unknown Task" }),
|
|
3070
|
+
/* @__PURE__ */ t.jsx(Wr, { color: X(R.type), style: { margin: 0 }, children: j(R.type) })
|
|
3068
3071
|
] }),
|
|
3069
3072
|
description: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color: d.font?.color, opacity: 0.7 }, children: [
|
|
3070
|
-
/* @__PURE__ */ t.jsx(
|
|
3073
|
+
/* @__PURE__ */ t.jsx(Ee, { icon: Tr, style: { marginRight: 6 } }),
|
|
3071
3074
|
"Lag: ",
|
|
3072
|
-
|
|
3075
|
+
R.lag || 0,
|
|
3073
3076
|
" days"
|
|
3074
3077
|
] }) })
|
|
3075
3078
|
}
|
|
@@ -3082,7 +3085,7 @@ Example: 3FS+10d`);
|
|
|
3082
3085
|
] }),
|
|
3083
3086
|
/* @__PURE__ */ t.jsxs("div", { style: { marginTop: 24, padding: "16px", background: "#fff7e6", borderRadius: 8, border: "1px solid #ffe7ba" }, children: [
|
|
3084
3087
|
/* @__PURE__ */ t.jsxs(Pt, { level: 5, style: { fontSize: 13, marginBottom: 8, display: "flex", alignItems: "center" }, children: [
|
|
3085
|
-
/* @__PURE__ */ t.jsx(
|
|
3088
|
+
/* @__PURE__ */ t.jsx(Ee, { icon: rn, style: { marginRight: 8, color: "#fa8c16" } }),
|
|
3086
3089
|
"Coming soon"
|
|
3087
3090
|
] }),
|
|
3088
3091
|
/* @__PURE__ */ t.jsx(gt, { style: { fontSize: 12, color: "rgba(0,0,0,0.65)" }, children: "Dependency visualization on the chart and automatic lag calculations based on working hours." })
|
|
@@ -3102,34 +3105,34 @@ Example: 3FS+10d`);
|
|
|
3102
3105
|
onConvertToTask: d,
|
|
3103
3106
|
onConvertToProject: p,
|
|
3104
3107
|
onAutoSchedule: h,
|
|
3105
|
-
onClose:
|
|
3106
|
-
styleConfig:
|
|
3108
|
+
onClose: v,
|
|
3109
|
+
styleConfig: y
|
|
3107
3110
|
}) => {
|
|
3108
|
-
const m = jt(
|
|
3111
|
+
const m = jt(y);
|
|
3109
3112
|
if (!n) return null;
|
|
3110
3113
|
const E = [
|
|
3111
3114
|
{
|
|
3112
3115
|
key: "edit",
|
|
3113
3116
|
label: "Edit",
|
|
3114
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3117
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: nn }),
|
|
3115
3118
|
onClick: () => {
|
|
3116
|
-
s(),
|
|
3119
|
+
s(), v();
|
|
3117
3120
|
}
|
|
3118
3121
|
},
|
|
3119
3122
|
{
|
|
3120
3123
|
key: "copy",
|
|
3121
3124
|
label: "Copy",
|
|
3122
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3125
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: an }),
|
|
3123
3126
|
onClick: () => {
|
|
3124
|
-
c(),
|
|
3127
|
+
c(), v();
|
|
3125
3128
|
}
|
|
3126
3129
|
},
|
|
3127
3130
|
{
|
|
3128
3131
|
key: "dependencies",
|
|
3129
3132
|
label: "Dependencies",
|
|
3130
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3133
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: Tr }),
|
|
3131
3134
|
onClick: () => {
|
|
3132
|
-
b(),
|
|
3135
|
+
b(), v();
|
|
3133
3136
|
}
|
|
3134
3137
|
},
|
|
3135
3138
|
{
|
|
@@ -3143,28 +3146,28 @@ Example: 3FS+10d`);
|
|
|
3143
3146
|
{
|
|
3144
3147
|
key: "milestone",
|
|
3145
3148
|
label: "Milestone",
|
|
3146
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3149
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: on }),
|
|
3147
3150
|
disabled: n.type === "milestone",
|
|
3148
3151
|
onClick: () => {
|
|
3149
|
-
u(),
|
|
3152
|
+
u(), v();
|
|
3150
3153
|
}
|
|
3151
3154
|
},
|
|
3152
3155
|
{
|
|
3153
3156
|
key: "task",
|
|
3154
3157
|
label: "Task",
|
|
3155
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3158
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: sn }),
|
|
3156
3159
|
disabled: n.type === "task",
|
|
3157
3160
|
onClick: () => {
|
|
3158
|
-
d(),
|
|
3161
|
+
d(), v();
|
|
3159
3162
|
}
|
|
3160
3163
|
},
|
|
3161
3164
|
{
|
|
3162
3165
|
key: "project",
|
|
3163
3166
|
label: "Project",
|
|
3164
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3167
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: ln }),
|
|
3165
3168
|
disabled: n.type === "project",
|
|
3166
3169
|
onClick: () => {
|
|
3167
|
-
p(),
|
|
3170
|
+
p(), v();
|
|
3168
3171
|
}
|
|
3169
3172
|
}
|
|
3170
3173
|
]
|
|
@@ -3172,9 +3175,9 @@ Example: 3FS+10d`);
|
|
|
3172
3175
|
{
|
|
3173
3176
|
key: "auto-schedule",
|
|
3174
3177
|
label: "Auto Schedule",
|
|
3175
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3178
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: jr }),
|
|
3176
3179
|
onClick: () => {
|
|
3177
|
-
h?.(),
|
|
3180
|
+
h?.(), v();
|
|
3178
3181
|
}
|
|
3179
3182
|
},
|
|
3180
3183
|
{
|
|
@@ -3183,10 +3186,10 @@ Example: 3FS+10d`);
|
|
|
3183
3186
|
{
|
|
3184
3187
|
key: "delete",
|
|
3185
3188
|
label: "Delete",
|
|
3186
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
3189
|
+
icon: /* @__PURE__ */ t.jsx(Ee, { icon: Dr }),
|
|
3187
3190
|
danger: !0,
|
|
3188
3191
|
onClick: () => {
|
|
3189
|
-
r(),
|
|
3192
|
+
r(), v();
|
|
3190
3193
|
}
|
|
3191
3194
|
}
|
|
3192
3195
|
];
|
|
@@ -3200,7 +3203,7 @@ Example: 3FS+10d`);
|
|
|
3200
3203
|
top: `${a}px`,
|
|
3201
3204
|
zIndex: 1e4
|
|
3202
3205
|
},
|
|
3203
|
-
onClick: (
|
|
3206
|
+
onClick: (F) => F.stopPropagation(),
|
|
3204
3207
|
children: /* @__PURE__ */ t.jsx(
|
|
3205
3208
|
Vr,
|
|
3206
3209
|
{
|
|
@@ -3217,49 +3220,49 @@ Example: 3FS+10d`);
|
|
|
3217
3220
|
)
|
|
3218
3221
|
}
|
|
3219
3222
|
);
|
|
3220
|
-
},
|
|
3223
|
+
}, On = (e, a = []) => {
|
|
3221
3224
|
const [n, s] = G([]), [r, c] = G(-1), [b, u] = G(e), [d, p] = G(a);
|
|
3222
3225
|
ut(() => {
|
|
3223
3226
|
u(e);
|
|
3224
3227
|
}, [e]), ut(() => {
|
|
3225
3228
|
p(a);
|
|
3226
3229
|
}, [a]);
|
|
3227
|
-
const h = Je((
|
|
3228
|
-
const
|
|
3229
|
-
type:
|
|
3230
|
-
before:
|
|
3230
|
+
const h = Je((S, w, C) => {
|
|
3231
|
+
const Z = {
|
|
3232
|
+
type: S,
|
|
3233
|
+
before: w,
|
|
3231
3234
|
after: C,
|
|
3232
3235
|
timestamp: Date.now()
|
|
3233
3236
|
}, W = n.slice(0, r + 1);
|
|
3234
|
-
W.push(
|
|
3235
|
-
}, [n, r]),
|
|
3237
|
+
W.push(Z), W.length > 50 ? W.shift() : c(r + 1), s(W);
|
|
3238
|
+
}, [n, r]), v = Je(() => {
|
|
3236
3239
|
if (r < 0) return;
|
|
3237
|
-
const
|
|
3238
|
-
u(
|
|
3239
|
-
}, [n, r]),
|
|
3240
|
+
const S = n[r];
|
|
3241
|
+
u(S.before.tasks), p(S.before.links), c(r - 1);
|
|
3242
|
+
}, [n, r]), y = Je(() => {
|
|
3240
3243
|
if (r >= n.length - 1) return;
|
|
3241
|
-
const
|
|
3242
|
-
u(
|
|
3243
|
-
}, [n, r]), m = r >= 0, E = r < n.length - 1,
|
|
3244
|
-
const
|
|
3245
|
-
h("task_update",
|
|
3246
|
-
}, [b, d, h]), N = Je((
|
|
3247
|
-
const
|
|
3248
|
-
h("task_create",
|
|
3249
|
-
}, [b, d, h]), M = Je((
|
|
3250
|
-
const
|
|
3251
|
-
h("task_delete",
|
|
3244
|
+
const S = n[r + 1];
|
|
3245
|
+
u(S.after.tasks), p(S.after.links), c(r + 1);
|
|
3246
|
+
}, [n, r]), m = r >= 0, E = r < n.length - 1, F = Je((S) => {
|
|
3247
|
+
const w = { tasks: b, links: d }, C = b.map((W) => W.id === S.id ? S : W);
|
|
3248
|
+
h("task_update", w, { tasks: C, links: d }), u(C);
|
|
3249
|
+
}, [b, d, h]), N = Je((S) => {
|
|
3250
|
+
const w = { tasks: b, links: d }, C = [...b, S];
|
|
3251
|
+
h("task_create", w, { tasks: C, links: d }), u(C);
|
|
3252
|
+
}, [b, d, h]), M = Je((S) => {
|
|
3253
|
+
const w = { tasks: b, links: d }, C = b.filter((re) => re.id !== S), Z = d.filter((re) => re.source !== S && re.target !== S);
|
|
3254
|
+
h("task_delete", w, { tasks: C, links: Z }), u(C), p(Z);
|
|
3252
3255
|
}, [b, d, h]);
|
|
3253
3256
|
return {
|
|
3254
3257
|
tasks: b,
|
|
3255
3258
|
links: d,
|
|
3256
3259
|
setTasks: u,
|
|
3257
3260
|
setLinks: p,
|
|
3258
|
-
undo:
|
|
3259
|
-
redo:
|
|
3261
|
+
undo: v,
|
|
3262
|
+
redo: y,
|
|
3260
3263
|
canUndo: m,
|
|
3261
3264
|
canRedo: E,
|
|
3262
|
-
updateTask:
|
|
3265
|
+
updateTask: F,
|
|
3263
3266
|
createTask: N,
|
|
3264
3267
|
deleteTask: M,
|
|
3265
3268
|
saveState: h,
|
|
@@ -3271,8 +3274,8 @@ Example: 3FS+10d`);
|
|
|
3271
3274
|
s.set(c.id, []), r.set(c.id, []);
|
|
3272
3275
|
}), a.forEach((c) => {
|
|
3273
3276
|
c.type === "e2s" && (s.get(c.target)?.push(c.source), r.get(c.source)?.push(c.target));
|
|
3274
|
-
}), n.mode === "forward" ?
|
|
3275
|
-
},
|
|
3277
|
+
}), n.mode === "forward" ? kn(e, s, n) : $n(e, r, n);
|
|
3278
|
+
}, kn = (e, a, n) => {
|
|
3276
3279
|
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), c = n.projectStart || /* @__PURE__ */ new Date(), b = (u) => {
|
|
3277
3280
|
if (r.has(u)) return;
|
|
3278
3281
|
const d = e.find((E) => E.id === u);
|
|
@@ -3281,13 +3284,13 @@ Example: 3FS+10d`);
|
|
|
3281
3284
|
p.forEach((E) => b(E));
|
|
3282
3285
|
let h = c;
|
|
3283
3286
|
p.forEach((E) => {
|
|
3284
|
-
const
|
|
3285
|
-
|
|
3287
|
+
const F = s.get(E);
|
|
3288
|
+
F && F.end > h && (h = new Date(F.end));
|
|
3286
3289
|
});
|
|
3287
|
-
const
|
|
3290
|
+
const v = new Date(h), y = Te(v, d.duration, "day"), m = {
|
|
3288
3291
|
...d,
|
|
3289
|
-
start:
|
|
3290
|
-
end:
|
|
3292
|
+
start: v,
|
|
3293
|
+
end: y
|
|
3291
3294
|
};
|
|
3292
3295
|
s.set(u, m), r.add(u);
|
|
3293
3296
|
};
|
|
@@ -3303,13 +3306,13 @@ Example: 3FS+10d`);
|
|
|
3303
3306
|
p.forEach((E) => b(E));
|
|
3304
3307
|
let h = c;
|
|
3305
3308
|
p.forEach((E) => {
|
|
3306
|
-
const
|
|
3307
|
-
|
|
3309
|
+
const F = s.get(E);
|
|
3310
|
+
F && F.start < h && (h = new Date(F.start));
|
|
3308
3311
|
});
|
|
3309
|
-
const
|
|
3312
|
+
const v = new Date(h), y = Te(v, -d.duration, "day"), m = {
|
|
3310
3313
|
...d,
|
|
3311
|
-
start:
|
|
3312
|
-
end:
|
|
3314
|
+
start: y,
|
|
3315
|
+
end: v
|
|
3313
3316
|
};
|
|
3314
3317
|
s.set(u, m), r.add(u);
|
|
3315
3318
|
};
|
|
@@ -3327,7 +3330,7 @@ Example: 3FS+10d`);
|
|
|
3327
3330
|
if (b.start < u.end) {
|
|
3328
3331
|
const d = n.findIndex((p) => p.id === b.id);
|
|
3329
3332
|
if (d >= 0) {
|
|
3330
|
-
const p = new Date(u.end), h =
|
|
3333
|
+
const p = new Date(u.end), h = Te(p, b.duration, "day");
|
|
3331
3334
|
n[d] = {
|
|
3332
3335
|
...b,
|
|
3333
3336
|
start: p,
|
|
@@ -3354,8 +3357,8 @@ Example: 3FS+10d`);
|
|
|
3354
3357
|
const a = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority"], n = e.map((r) => [
|
|
3355
3358
|
r.id,
|
|
3356
3359
|
r.text,
|
|
3357
|
-
|
|
3358
|
-
|
|
3360
|
+
Oe(r.start, "YYYY-MM-DD"),
|
|
3361
|
+
Oe(r.end, "YYYY-MM-DD"),
|
|
3359
3362
|
r.duration.toString(),
|
|
3360
3363
|
`${r.progress}%`,
|
|
3361
3364
|
r.type || "task",
|
|
@@ -3371,8 +3374,8 @@ Example: 3FS+10d`);
|
|
|
3371
3374
|
const a = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority", "Details"], n = e.map((r) => [
|
|
3372
3375
|
r.id,
|
|
3373
3376
|
r.text,
|
|
3374
|
-
|
|
3375
|
-
|
|
3377
|
+
Oe(r.start, "MM/DD/YYYY"),
|
|
3378
|
+
Oe(r.end, "MM/DD/YYYY"),
|
|
3376
3379
|
r.duration.toString(),
|
|
3377
3380
|
r.progress.toString(),
|
|
3378
3381
|
r.type || "task",
|
|
@@ -3386,7 +3389,7 @@ Example: 3FS+10d`);
|
|
|
3386
3389
|
].join(`
|
|
3387
3390
|
`);
|
|
3388
3391
|
It(s, "gantt-tasks.xls", "application/vnd.ms-excel");
|
|
3389
|
-
},
|
|
3392
|
+
}, Or = (e, a) => {
|
|
3390
3393
|
const n = {
|
|
3391
3394
|
tasks: e,
|
|
3392
3395
|
links: a,
|
|
@@ -3394,7 +3397,7 @@ Example: 3FS+10d`);
|
|
|
3394
3397
|
version: "1.0"
|
|
3395
3398
|
}, s = JSON.stringify(n, null, 2);
|
|
3396
3399
|
It(s, "gantt-project.json", "application/json");
|
|
3397
|
-
},
|
|
3400
|
+
}, kr = (e) => {
|
|
3398
3401
|
const a = `
|
|
3399
3402
|
GANTT CHART PROJECT
|
|
3400
3403
|
Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
@@ -3402,8 +3405,8 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
|
3402
3405
|
Tasks:
|
|
3403
3406
|
${e.map((n, s) => `
|
|
3404
3407
|
${s + 1}. ${n.text}
|
|
3405
|
-
Start: ${
|
|
3406
|
-
End: ${
|
|
3408
|
+
Start: ${Oe(n.start, "MM/DD/YYYY")}
|
|
3409
|
+
End: ${Oe(n.end, "MM/DD/YYYY")}
|
|
3407
3410
|
Duration: ${n.duration} days
|
|
3408
3411
|
Progress: ${n.progress}%
|
|
3409
3412
|
${n.owner ? `Owner: ${n.owner}` : ""}
|
|
@@ -3411,7 +3414,7 @@ ${s + 1}. ${n.text}
|
|
|
3411
3414
|
`)}
|
|
3412
3415
|
`.trim();
|
|
3413
3416
|
It(a, "gantt-report.txt", "text/plain"), alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.");
|
|
3414
|
-
},
|
|
3417
|
+
}, _n = (e, a, n = "png") => {
|
|
3415
3418
|
if (!document.getElementById(e)) {
|
|
3416
3419
|
alert("Could not find Gantt chart element to export");
|
|
3417
3420
|
return;
|
|
@@ -3423,8 +3426,8 @@ ${s + 1}. ${n.text}
|
|
|
3423
3426
|
alert("Image export requires html2canvas library. Install with: npm install html2canvas");
|
|
3424
3427
|
}, It = (e, a, n) => {
|
|
3425
3428
|
const s = new Blob([e], { type: n }), r = URL.createObjectURL(s);
|
|
3426
|
-
|
|
3427
|
-
},
|
|
3429
|
+
An(r, a), URL.revokeObjectURL(r);
|
|
3430
|
+
}, An = (e, a) => {
|
|
3428
3431
|
const n = document.createElement("a");
|
|
3429
3432
|
n.href = e, n.download = a, document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
3430
3433
|
}, In = (e) => new Promise((a, n) => {
|
|
@@ -3445,9 +3448,9 @@ ${s + 1}. ${n.text}
|
|
|
3445
3448
|
__proto__: null,
|
|
3446
3449
|
exportToCSV: Pr,
|
|
3447
3450
|
exportToExcel: Nr,
|
|
3448
|
-
exportToImage:
|
|
3449
|
-
exportToJSON:
|
|
3450
|
-
exportToPDF:
|
|
3451
|
+
exportToImage: _n,
|
|
3452
|
+
exportToJSON: Or,
|
|
3453
|
+
exportToPDF: kr,
|
|
3451
3454
|
importFromJSON: In
|
|
3452
3455
|
}, Symbol.toStringTag, { value: "Module" })), zn = (e, a) => e.filter((n) => {
|
|
3453
3456
|
if (a.searchText) {
|
|
@@ -3531,7 +3534,7 @@ ${s + 1}. ${n.text}
|
|
|
3531
3534
|
), s = Ve(
|
|
3532
3535
|
e.end ?? e.endDate ?? e.end_date ?? e.plannedEndDate,
|
|
3533
3536
|
n
|
|
3534
|
-
), r = s.getTime() < n.getTime() ? n : s, c = Ve(e.plannedStart ?? e.planned_start ?? e.planned_start_date, n), b = Ve(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), u = b.getTime() < c.getTime() ? c : b, d = Ve(e.actualStart ?? e.actual_start ?? e.actual_start_date, n), p = Ve(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), h = p.getTime() < d.getTime() ? d : p,
|
|
3537
|
+
), r = s.getTime() < n.getTime() ? n : s, c = Ve(e.plannedStart ?? e.planned_start ?? e.planned_start_date, n), b = Ve(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), u = b.getTime() < c.getTime() ? c : b, d = Ve(e.actualStart ?? e.actual_start ?? e.actual_start_date, n), p = Ve(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), h = p.getTime() < d.getTime() ? d : p, v = Math.max(Math.ceil((r.getTime() - n.getTime()) / $r), 0), y = Bn(e.dependencies ?? e.dependsOn ?? e.depends_on), m = Hn(
|
|
3535
3538
|
e.dependencyRule ?? e.dependency_rule ?? e.dependencyRuleDescription ?? e.dependency_rule_description
|
|
3536
3539
|
), E = Wn(
|
|
3537
3540
|
Yr(
|
|
@@ -3556,7 +3559,7 @@ ${s + 1}. ${n.text}
|
|
|
3556
3559
|
plannedEnd: u,
|
|
3557
3560
|
actualStart: d,
|
|
3558
3561
|
actualEnd: h,
|
|
3559
|
-
duration: nr(e.duration,
|
|
3562
|
+
duration: nr(e.duration, v),
|
|
3560
3563
|
progress: Math.max(0, Math.min(100, nr(e.progress ?? e.progressPercentage ?? e.progress_percentage, 0))),
|
|
3561
3564
|
type: e.type,
|
|
3562
3565
|
parent: e.parent !== void 0 && e.parent !== null && String(e.parent).length > 0 ? String(e.parent) : void 0,
|
|
@@ -3567,7 +3570,7 @@ ${s + 1}. ${n.text}
|
|
|
3567
3570
|
priority: e.priority,
|
|
3568
3571
|
status: e.status ?? e.currentStatus ?? e.current_status,
|
|
3569
3572
|
onHoldPeriods: E,
|
|
3570
|
-
dependencies:
|
|
3573
|
+
dependencies: y,
|
|
3571
3574
|
dependencyRule: m,
|
|
3572
3575
|
segments: Vn(e.segments, n, r),
|
|
3573
3576
|
sequence_id: e.sequence_id,
|
|
@@ -3609,7 +3612,7 @@ ${s + 1}. ${n.text}
|
|
|
3609
3612
|
], Kn = [
|
|
3610
3613
|
{ unit: "month", step: 1, format: "MMM" },
|
|
3611
3614
|
{ unit: "day", step: 1, format: "D" }
|
|
3612
|
-
],
|
|
3615
|
+
], yr = {
|
|
3613
3616
|
day: [
|
|
3614
3617
|
{ unit: "month", step: 1, format: "MMM YYYY" },
|
|
3615
3618
|
{ unit: "day", step: 1, format: "D" }
|
|
@@ -3622,12 +3625,12 @@ ${s + 1}. ${n.text}
|
|
|
3622
3625
|
{ unit: "year", step: 1, format: "YYYY" },
|
|
3623
3626
|
{ unit: "month", step: 1, format: "MMM" }
|
|
3624
3627
|
]
|
|
3625
|
-
},
|
|
3626
|
-
const s =
|
|
3628
|
+
}, xr = ["day", "week", "month"], _t = (e, a, n) => {
|
|
3629
|
+
const s = yt(e);
|
|
3627
3630
|
switch (a.unit) {
|
|
3628
3631
|
case "week": {
|
|
3629
3632
|
const r = s.getDay(), c = n === "start" ? -r : 6 - r;
|
|
3630
|
-
return
|
|
3633
|
+
return yt(Te(s, c, "day"));
|
|
3631
3634
|
}
|
|
3632
3635
|
case "month":
|
|
3633
3636
|
return n === "start" ? new Date(s.getFullYear(), s.getMonth(), 1) : new Date(s.getFullYear(), s.getMonth() + 1, 0);
|
|
@@ -3755,52 +3758,52 @@ ${s + 1}. ${n.text}
|
|
|
3755
3758
|
on_hold_periods: d,
|
|
3756
3759
|
onHold: p,
|
|
3757
3760
|
on_hold: h,
|
|
3758
|
-
onhold:
|
|
3759
|
-
onTaskUpdate:
|
|
3761
|
+
onhold: v,
|
|
3762
|
+
onTaskUpdate: y,
|
|
3760
3763
|
onTaskDragUpdate: m,
|
|
3761
3764
|
onTaskCreate: E,
|
|
3762
|
-
onTaskDelete:
|
|
3765
|
+
onTaskDelete: F,
|
|
3763
3766
|
onLinkCreate: N,
|
|
3764
3767
|
onLinkDelete: M,
|
|
3765
|
-
onTimelineViewChange:
|
|
3766
|
-
baselines:
|
|
3768
|
+
onTimelineViewChange: S,
|
|
3769
|
+
baselines: w,
|
|
3767
3770
|
showMonthHeading: C,
|
|
3768
|
-
showRangeHeading:
|
|
3771
|
+
showRangeHeading: Z,
|
|
3769
3772
|
relativeDayNumbering: W
|
|
3770
3773
|
}) => {
|
|
3771
|
-
const re = { ...Qn, ...s }, le = { ...Zn, ...b }, j = !!(n.timelineView || Array.isArray(n.timelineViews) && n.timelineViews.length > 0 || n.timelineViewScales), X =
|
|
3774
|
+
const re = { ...Qn, ...s }, le = { ...Zn, ...b }, j = !!(n.timelineView || Array.isArray(n.timelineViews) && n.timelineViews.length > 0 || n.timelineViewScales), X = A.useMemo(() => {
|
|
3772
3775
|
if (!j) return [];
|
|
3773
|
-
const i = Array.isArray(n.timelineViews) && n.timelineViews.length > 0 ? n.timelineViews :
|
|
3774
|
-
return Array.from(new Set(i.filter((T) =>
|
|
3775
|
-
}, [n.timelineViews, j]),
|
|
3776
|
+
const i = Array.isArray(n.timelineViews) && n.timelineViews.length > 0 ? n.timelineViews : xr;
|
|
3777
|
+
return Array.from(new Set(i.filter((T) => xr.includes(T))));
|
|
3778
|
+
}, [n.timelineViews, j]), R = A.useMemo(
|
|
3776
3779
|
() => ({
|
|
3777
|
-
...
|
|
3780
|
+
...yr,
|
|
3778
3781
|
...n.timelineViewScales
|
|
3779
3782
|
}),
|
|
3780
3783
|
[n.timelineViewScales]
|
|
3781
|
-
),
|
|
3784
|
+
), O = A.useMemo(() => j && n.timelineView && X.includes(n.timelineView) ? n.timelineView : j && X.length > 0 ? X[0] : "day", [n.timelineView, j, X]), [B, Y] = G(O), k = j && X.includes(B) ? B : O, De = j ? R[k] || yr[k] : n.scales || Kn, Se = j && re.showTimelineViewSwitcher !== !1 && X.length > 1, V = Se ? X.map((i) => ({
|
|
3782
3785
|
value: i,
|
|
3783
3786
|
label: re.timelineViewLabels?.[i] || `${i.charAt(0).toUpperCase()}${i.slice(1)}s`
|
|
3784
|
-
})) : [], I =
|
|
3787
|
+
})) : [], I = A.useMemo(() => {
|
|
3785
3788
|
if (n.showTimelineHeader === !1) return 0;
|
|
3786
|
-
let i = j ? Math.max(
|
|
3787
|
-
if ((C === !1 || n.showMonthHeading === !1) && (i = Math.max(0, i - 1)),
|
|
3788
|
-
const T = j ? Math.max(0,
|
|
3789
|
+
let i = j ? Math.max(De.length - 1, 0) : 2;
|
|
3790
|
+
if ((C === !1 || n.showMonthHeading === !1) && (i = Math.max(0, i - 1)), Z === !1 || n.showRangeHeading === !1) {
|
|
3791
|
+
const T = j ? Math.max(0, De.length - 2) : 1;
|
|
3789
3792
|
i = Math.max(0, i - T);
|
|
3790
3793
|
}
|
|
3791
3794
|
return i + 1;
|
|
3792
|
-
}, [n.showTimelineHeader, n.showMonthHeading, C, n.showRangeHeading,
|
|
3795
|
+
}, [n.showTimelineHeader, n.showMonthHeading, C, n.showRangeHeading, Z, j, De.length]), ne = A.useMemo(() => {
|
|
3793
3796
|
const i = {};
|
|
3794
3797
|
return r.primary && (i["--wx-gantt-primary"] = r.primary), r.primarySelected && (i["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (i["--wx-gantt-success"] = r.success), r.warning && (i["--wx-gantt-warning"] = r.warning), r.danger && (i["--wx-gantt-danger"] = r.danger), r.background && (i["--wx-gantt-background"] = r.background), r.backgroundAlt && (i["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (i["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (i["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (i["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (i["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (i["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (i["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (i["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (i["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (i["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (i["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (i["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (i["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (i["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (i["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (i["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (i["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (i["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (i["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (i["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([T, P]) => {
|
|
3795
3798
|
i[T.startsWith("--") ? T : `--${T}`] = P;
|
|
3796
3799
|
}), i["--gantt-header-rows"] = String(I), i;
|
|
3797
|
-
}, [r, I]), de =
|
|
3800
|
+
}, [r, I]), de = A.useMemo(() => {
|
|
3798
3801
|
const i = Yr(
|
|
3799
3802
|
u,
|
|
3800
3803
|
d,
|
|
3801
3804
|
p,
|
|
3802
3805
|
h,
|
|
3803
|
-
|
|
3806
|
+
v
|
|
3804
3807
|
);
|
|
3805
3808
|
if (i.length === 0) return [];
|
|
3806
3809
|
const T = /* @__PURE__ */ new Date();
|
|
@@ -3808,32 +3811,32 @@ ${s + 1}. ${n.text}
|
|
|
3808
3811
|
start: Ve(P.start, T),
|
|
3809
3812
|
end: Ve(P.end, T)
|
|
3810
3813
|
})).filter((P) => P.end.getTime() > P.start.getTime());
|
|
3811
|
-
}, [u, d, p, h,
|
|
3814
|
+
}, [u, d, p, h, v]), se = A.useMemo(() => {
|
|
3812
3815
|
const i = Un(e);
|
|
3813
3816
|
return Gn(i, de);
|
|
3814
3817
|
}, [e, de]), ue = Array.isArray(a) ? a : [], {
|
|
3815
3818
|
tasks: z,
|
|
3816
|
-
links:
|
|
3817
|
-
setTasks:
|
|
3819
|
+
links: ye,
|
|
3820
|
+
setTasks: Le,
|
|
3818
3821
|
setLinks: Ie,
|
|
3819
3822
|
undo: Ye,
|
|
3820
3823
|
redo: $,
|
|
3821
|
-
updateTask:
|
|
3822
|
-
createTask:
|
|
3824
|
+
updateTask: J,
|
|
3825
|
+
createTask: xe,
|
|
3823
3826
|
deleteTask: Qe,
|
|
3824
3827
|
saveState: ce
|
|
3825
|
-
} =
|
|
3828
|
+
} = On(se, ue), [me, Fe] = G(z), [pe, et] = G(null), [_e, Xe] = G(null), [Ue, ot] = G(!1), [l, g] = G(void 0), [D, f] = G(void 0), [U, q] = G(!1), [ee, ie] = G(null), [$e, ze] = G(null), [ge, tt] = G(null), [Ke, st] = G(null), [Ce, ht] = G(null), [xt, Ot] = G(1), [qe, it] = G(() => w && w.size > 0 ? w : se.length > 0 ? Yn(se) : /* @__PURE__ */ new Map());
|
|
3826
3829
|
ut(() => {
|
|
3827
|
-
|
|
3828
|
-
}, [
|
|
3829
|
-
j && Y(
|
|
3830
|
-
}, [j,
|
|
3830
|
+
w && w.size > 0 && it(w);
|
|
3831
|
+
}, [w]), ut(() => {
|
|
3832
|
+
j && Y(O);
|
|
3833
|
+
}, [j, O]);
|
|
3831
3834
|
const [wt] = G(n.theme || "light"), [Tt, zt] = G({
|
|
3832
3835
|
searchText: "",
|
|
3833
3836
|
status: "all",
|
|
3834
3837
|
priority: "all",
|
|
3835
3838
|
owner: ""
|
|
3836
|
-
}), Dt = ft(null), Mt = ft(null),
|
|
3839
|
+
}), Dt = ft(null), Mt = ft(null), kt = ft(null), Et = ft(null), lt = ft(null), $t = ft(null), Ae = {
|
|
3837
3840
|
...{
|
|
3838
3841
|
columns: n.columns || Jn(s),
|
|
3839
3842
|
readonly: !1,
|
|
@@ -3894,15 +3897,15 @@ ${s + 1}. ${n.text}
|
|
|
3894
3897
|
// Marker style
|
|
3895
3898
|
},
|
|
3896
3899
|
...n,
|
|
3897
|
-
scales:
|
|
3898
|
-
timelineView: j ?
|
|
3900
|
+
scales: De,
|
|
3901
|
+
timelineView: j ? k : n.timelineView,
|
|
3899
3902
|
timelineViews: j ? X : n.timelineViews,
|
|
3900
|
-
timelineViewScales: j ?
|
|
3903
|
+
timelineViewScales: j ? R : n.timelineViewScales,
|
|
3901
3904
|
// IMPORTANT: Re-apply baselines after spread so undefined from config doesn't override the default.
|
|
3902
3905
|
// baselines should always be true unless the user explicitly passes false.
|
|
3903
3906
|
baselines: n.baselines !== !1,
|
|
3904
3907
|
showMonthHeading: C !== void 0 ? C : n.showMonthHeading,
|
|
3905
|
-
showRangeHeading:
|
|
3908
|
+
showRangeHeading: Z !== void 0 ? Z : n.showRangeHeading,
|
|
3906
3909
|
relativeDayNumbering: W !== void 0 ? W : n.relativeDayNumbering
|
|
3907
3910
|
};
|
|
3908
3911
|
ut(() => {
|
|
@@ -3910,15 +3913,15 @@ ${s + 1}. ${n.text}
|
|
|
3910
3913
|
Fe(((P) => {
|
|
3911
3914
|
const H = [], ae = (fe) => {
|
|
3912
3915
|
if (!fe) return !1;
|
|
3913
|
-
const
|
|
3914
|
-
return
|
|
3916
|
+
const ve = P.find((Me) => Me.id === fe);
|
|
3917
|
+
return ve && !ve.open && ve.type === "project" ? !0 : ae(ve?.parent);
|
|
3915
3918
|
};
|
|
3916
3919
|
return P.forEach((fe) => {
|
|
3917
3920
|
ae(fe.parent) || H.push(fe);
|
|
3918
3921
|
}), H;
|
|
3919
3922
|
})(i));
|
|
3920
3923
|
}, [z, Tt]);
|
|
3921
|
-
const Ht =
|
|
3924
|
+
const Ht = A.useMemo(() => {
|
|
3922
3925
|
if (!z || !Array.isArray(z)) return [];
|
|
3923
3926
|
try {
|
|
3924
3927
|
return Array.from(new Set(z.map((i) => i?.owner).filter(Boolean)));
|
|
@@ -3926,25 +3929,25 @@ ${s + 1}. ${n.text}
|
|
|
3926
3929
|
return console.warn("Error extracting owners:", i), [];
|
|
3927
3930
|
}
|
|
3928
3931
|
}, [z]), Wt = (() => {
|
|
3929
|
-
const i =
|
|
3932
|
+
const i = De[De.length - 1] || De[0], T = me.length > 0 ? me : z;
|
|
3930
3933
|
if (T.length === 0) {
|
|
3931
|
-
const
|
|
3934
|
+
const ve = /* @__PURE__ */ new Date();
|
|
3932
3935
|
return {
|
|
3933
|
-
start:
|
|
3934
|
-
end:
|
|
3936
|
+
start: _t(Te(ve, -30, "day"), i, "start"),
|
|
3937
|
+
end: _t(Te(ve, 60, "day"), i, "end")
|
|
3935
3938
|
};
|
|
3936
3939
|
}
|
|
3937
|
-
const P = T.map((
|
|
3940
|
+
const P = T.map((ve) => ve.start.getTime()), H = T.map((ve) => ve.end.getTime()), ae = new Date(Math.min(...P)), fe = new Date(Math.max(...H));
|
|
3938
3941
|
return {
|
|
3939
|
-
start:
|
|
3940
|
-
end:
|
|
3942
|
+
start: _t(Te(ae, -7, "day"), i, "start"),
|
|
3943
|
+
end: _t(fe, i, "end")
|
|
3941
3944
|
};
|
|
3942
3945
|
})(), Vt = (i) => {
|
|
3943
|
-
!X.includes(i) || i ===
|
|
3946
|
+
!X.includes(i) || i === k || (Y(i), S?.(i));
|
|
3944
3947
|
}, o = (i) => {
|
|
3945
3948
|
et(i);
|
|
3946
|
-
},
|
|
3947
|
-
if (
|
|
3949
|
+
}, x = (i, T) => {
|
|
3950
|
+
if (Ae.readonly) return;
|
|
3948
3951
|
i.preventDefault();
|
|
3949
3952
|
const P = z.find((H) => H.id === T);
|
|
3950
3953
|
P && ht({ x: i.clientX, y: i.clientY, task: P });
|
|
@@ -3954,27 +3957,27 @@ ${s + 1}. ${n.text}
|
|
|
3954
3957
|
...i,
|
|
3955
3958
|
id: `task-${Date.now()}`,
|
|
3956
3959
|
text: `${i.text} (Copy)`,
|
|
3957
|
-
start:
|
|
3958
|
-
end:
|
|
3960
|
+
start: Te(i.start, 7, "day"),
|
|
3961
|
+
end: Te(i.end, 7, "day")
|
|
3959
3962
|
};
|
|
3960
|
-
|
|
3961
|
-
},
|
|
3963
|
+
xe(T), E && E(T);
|
|
3964
|
+
}, _ = (i) => {
|
|
3962
3965
|
if (!Ce?.task) return;
|
|
3963
3966
|
const T = { ...Ce.task, type: i };
|
|
3964
|
-
|
|
3965
|
-
}, te =
|
|
3967
|
+
J(T), y && y(T);
|
|
3968
|
+
}, te = A.useCallback((i, T) => {
|
|
3966
3969
|
let P = [];
|
|
3967
3970
|
return T.filter((ae) => ae.parent === i).forEach((ae) => {
|
|
3968
3971
|
P.push(ae.id), P = [...P, ...te(ae.id, T)];
|
|
3969
3972
|
}), P;
|
|
3970
|
-
}, []), oe = (i, T) => (i ?? null) === (T ?? null),
|
|
3971
|
-
if (!
|
|
3973
|
+
}, []), oe = (i, T) => (i ?? null) === (T ?? null), Q = (i, T, P, H) => {
|
|
3974
|
+
if (!Ae.readonly)
|
|
3972
3975
|
if (H === "reorder") {
|
|
3973
|
-
const ae = me.findIndex((
|
|
3976
|
+
const ae = me.findIndex((ve) => ve.id === i), fe = te(i, z);
|
|
3974
3977
|
tt({ id: i, initialIndex: ae, currentX: T, currentY: P, descendantIds: fe }), document.body.classList.add("gantt-dragging");
|
|
3975
3978
|
} else
|
|
3976
3979
|
ze(i);
|
|
3977
|
-
},
|
|
3980
|
+
}, K = () => {
|
|
3978
3981
|
if (ge && Ke) {
|
|
3979
3982
|
const i = z.find((P) => P.id === ge.id), T = z.find((P) => P.id === Ke.taskId);
|
|
3980
3983
|
if (i && T && i.id !== T.id) {
|
|
@@ -3982,30 +3985,30 @@ ${s + 1}. ${n.text}
|
|
|
3982
3985
|
if (!P.includes(T.id)) {
|
|
3983
3986
|
const H = [...z], ae = (Ke.position === "inside" ? T.id : T.parent) ?? void 0, fe = H.findIndex((he) => he.id === i.id);
|
|
3984
3987
|
fe !== -1 && (H[fe] = { ...H[fe], parent: ae });
|
|
3985
|
-
const
|
|
3986
|
-
let He =
|
|
3988
|
+
const ve = H.filter((he) => P.includes(he.id)), Me = H.filter((he) => !P.includes(he.id));
|
|
3989
|
+
let He = Me.findIndex((he) => he.id === T.id);
|
|
3987
3990
|
if (Ke.position === "inside") {
|
|
3988
|
-
const he = [T.id, ...te(T.id,
|
|
3989
|
-
He =
|
|
3991
|
+
const he = [T.id, ...te(T.id, Me)], Gt = he[he.length - 1];
|
|
3992
|
+
He = Me.findIndex((Ar) => Ar.id === Gt) + 1;
|
|
3990
3993
|
} else if (Ke.position === "below") {
|
|
3991
|
-
const he = te(T.id,
|
|
3992
|
-
he.length > 0 ? He =
|
|
3994
|
+
const he = te(T.id, Me);
|
|
3995
|
+
he.length > 0 ? He = Me.findIndex((Gt) => Gt.id === he[he.length - 1]) + 1 : He++;
|
|
3993
3996
|
}
|
|
3994
|
-
He < 0 && (He =
|
|
3995
|
-
const Lt = { tasks: [...z], links: [...
|
|
3996
|
-
|
|
3997
|
-
const mt = z.filter((he) => oe(he.parent, i.parent)).findIndex((he) => he.id === i.id) + 1, sr =
|
|
3997
|
+
He < 0 && (He = Me.length);
|
|
3998
|
+
const Lt = { tasks: [...z], links: [...ye] };
|
|
3999
|
+
Me.splice(He, 0, ...ve), Le(Me), ce("task_update", Lt, { tasks: Me, links: ye });
|
|
4000
|
+
const mt = z.filter((he) => oe(he.parent, i.parent)).findIndex((he) => he.id === i.id) + 1, sr = Me.filter((he) => oe(he.parent, ae)).findIndex((he) => he.id === i.id) + 1, ir = {
|
|
3998
4001
|
currentSequenceId: mt,
|
|
3999
4002
|
targetSequenceId: sr,
|
|
4000
4003
|
targetStageId: ae ?? null
|
|
4001
|
-
}, lr =
|
|
4004
|
+
}, lr = Me.find((he) => he.id === i.id);
|
|
4002
4005
|
if (lr) {
|
|
4003
4006
|
const he = {
|
|
4004
4007
|
...lr,
|
|
4005
4008
|
sequence_id: sr,
|
|
4006
4009
|
stage_id: ae ?? null
|
|
4007
4010
|
};
|
|
4008
|
-
|
|
4011
|
+
y && y(he, ir), m && m({
|
|
4009
4012
|
task: he,
|
|
4010
4013
|
previousTask: i,
|
|
4011
4014
|
dragType: "reorder",
|
|
@@ -4016,33 +4019,33 @@ ${s + 1}. ${n.text}
|
|
|
4016
4019
|
}
|
|
4017
4020
|
}
|
|
4018
4021
|
ze(null), tt(null), st(null), document.body.classList.remove("gantt-dragging");
|
|
4019
|
-
}, Re = ft(null),
|
|
4022
|
+
}, Re = ft(null), we = A.useCallback((i) => {
|
|
4020
4023
|
if (ge) {
|
|
4021
4024
|
const { clientX: T, clientY: P } = i;
|
|
4022
4025
|
Re.current && cancelAnimationFrame(Re.current), Re.current = requestAnimationFrame(() => {
|
|
4023
|
-
const H =
|
|
4026
|
+
const H = Ae.rowHeight || 48, ae = Mt.current?.querySelector(".gantt-grid-body");
|
|
4024
4027
|
if (!ae || me.length === 0) {
|
|
4025
4028
|
st(null);
|
|
4026
4029
|
return;
|
|
4027
4030
|
}
|
|
4028
|
-
const fe = ae.getBoundingClientRect(),
|
|
4029
|
-
let
|
|
4030
|
-
|
|
4031
|
-
const He = me[
|
|
4031
|
+
const fe = ae.getBoundingClientRect(), ve = P - fe.top + ae.scrollTop;
|
|
4032
|
+
let Me = Math.floor(ve / H);
|
|
4033
|
+
Me = Math.max(0, Math.min(Me, me.length - 1));
|
|
4034
|
+
const He = me[Me];
|
|
4032
4035
|
if (He) {
|
|
4033
4036
|
if (He.id === ge.id || ge.descendantIds.includes(He.id)) {
|
|
4034
4037
|
st(null), tt((qt) => qt ? { ...qt, currentX: T, currentY: P } : null);
|
|
4035
4038
|
return;
|
|
4036
4039
|
}
|
|
4037
|
-
const Ct =
|
|
4040
|
+
const Ct = ve - Me * H;
|
|
4038
4041
|
let mt = "above";
|
|
4039
4042
|
He.type !== "milestone" ? Ct < H * 0.3 ? mt = "above" : Ct > H * 0.7 ? mt = "below" : mt = "inside" : mt = Ct < H / 2 ? "above" : "below", st({ taskId: He.id, position: mt });
|
|
4040
4043
|
}
|
|
4041
4044
|
tt((Lt) => Lt ? { ...Lt, currentX: T, currentY: P } : null);
|
|
4042
4045
|
});
|
|
4043
4046
|
}
|
|
4044
|
-
}, [ge, me,
|
|
4045
|
-
ge &&
|
|
4047
|
+
}, [ge, me, Ae.rowHeight]), be = () => {
|
|
4048
|
+
ge && K();
|
|
4046
4049
|
}, Be = (i, T) => {
|
|
4047
4050
|
const P = {
|
|
4048
4051
|
...i,
|
|
@@ -4050,7 +4053,7 @@ ${s + 1}. ${n.text}
|
|
|
4050
4053
|
parent: T
|
|
4051
4054
|
// Set parent if provided (for subtasks)
|
|
4052
4055
|
};
|
|
4053
|
-
|
|
4056
|
+
xe(P);
|
|
4054
4057
|
const H = {
|
|
4055
4058
|
taskId: P.id,
|
|
4056
4059
|
start: new Date(P.start),
|
|
@@ -4063,21 +4066,21 @@ ${s + 1}. ${n.text}
|
|
|
4063
4066
|
return fe.set(P.id, H), fe;
|
|
4064
4067
|
}), E && E(P);
|
|
4065
4068
|
}, Ge = (i) => {
|
|
4066
|
-
|
|
4069
|
+
J(i), y && y(i);
|
|
4067
4070
|
}, Ze = (i) => {
|
|
4068
4071
|
Qe(i), it((T) => {
|
|
4069
4072
|
const P = new Map(T);
|
|
4070
4073
|
return P.delete(i), P;
|
|
4071
|
-
}),
|
|
4074
|
+
}), F && F(i);
|
|
4072
4075
|
}, Ne = (i, T, P, H) => {
|
|
4073
4076
|
const ae = { id: `link-${Date.now()}`, source: i, target: T, type: P, lag: H };
|
|
4074
|
-
Ie([...
|
|
4077
|
+
Ie([...ye, ae]), N && N(ae);
|
|
4075
4078
|
}, bt = (i) => {
|
|
4076
|
-
const T =
|
|
4079
|
+
const T = ye.filter((P) => P.id !== i);
|
|
4077
4080
|
Ie(T), M && M(i);
|
|
4078
4081
|
};
|
|
4079
4082
|
ut(() => {
|
|
4080
|
-
if (
|
|
4083
|
+
if (w && w.size > 0)
|
|
4081
4084
|
return;
|
|
4082
4085
|
const i = new Map(qe);
|
|
4083
4086
|
let T = !1;
|
|
@@ -4094,7 +4097,7 @@ ${s + 1}. ${n.text}
|
|
|
4094
4097
|
qe.forEach((H, ae) => {
|
|
4095
4098
|
P.has(ae) || (i.delete(ae), T = !0);
|
|
4096
4099
|
}), T && it(i);
|
|
4097
|
-
}, [z,
|
|
4100
|
+
}, [z, w]), ut(() => {
|
|
4098
4101
|
const i = (T) => {
|
|
4099
4102
|
(T.ctrlKey || T.metaKey) && (T.key === "z" && !T.shiftKey ? (T.preventDefault(), Ye()) : (T.key === "y" || T.key === "z" && T.shiftKey) && (T.preventDefault(), $()));
|
|
4100
4103
|
};
|
|
@@ -4119,9 +4122,9 @@ ${s + 1}. ${n.text}
|
|
|
4119
4122
|
height: n.containerHeight || "100%",
|
|
4120
4123
|
minHeight: n.containerMinHeight || "400px"
|
|
4121
4124
|
}, Ut = {
|
|
4122
|
-
"--gantt-row-height": `${
|
|
4125
|
+
"--gantt-row-height": `${Ae.rowHeight || 48}px`,
|
|
4123
4126
|
"--gantt-header-rows": String(I)
|
|
4124
|
-
},
|
|
4127
|
+
}, _r = n.gridWidth ? { "--gantt-grid-width": n.gridWidth } : {};
|
|
4125
4128
|
return /* @__PURE__ */ t.jsxs(
|
|
4126
4129
|
"div",
|
|
4127
4130
|
{
|
|
@@ -4132,20 +4135,20 @@ ${s + 1}. ${n.text}
|
|
|
4132
4135
|
/* @__PURE__ */ t.jsxs(
|
|
4133
4136
|
"div",
|
|
4134
4137
|
{
|
|
4135
|
-
className: `gantt-container theme-${
|
|
4138
|
+
className: `gantt-container theme-${Ae.theme}`,
|
|
4136
4139
|
ref: Et,
|
|
4137
|
-
style: { ...
|
|
4140
|
+
style: { ..._r, ...Ut },
|
|
4138
4141
|
children: [
|
|
4139
4142
|
/* @__PURE__ */ t.jsx(
|
|
4140
4143
|
Tn,
|
|
4141
4144
|
{
|
|
4142
|
-
zoomLevel:
|
|
4143
|
-
setZoomLevel:
|
|
4144
|
-
timelineView:
|
|
4145
|
+
zoomLevel: xt,
|
|
4146
|
+
setZoomLevel: Ot,
|
|
4147
|
+
timelineView: Se ? k : void 0,
|
|
4145
4148
|
timelineViewOptions: V,
|
|
4146
|
-
onTimelineViewChange:
|
|
4149
|
+
onTimelineViewChange: Se ? Vt : void 0,
|
|
4147
4150
|
onExport: (i) => {
|
|
4148
|
-
i === "csv" && Pr(z), i === "excel" && Nr(z), i === "json" &&
|
|
4151
|
+
i === "csv" && Pr(z), i === "excel" && Nr(z), i === "json" && Or(z, ye), i === "pdf" && kr(z);
|
|
4149
4152
|
},
|
|
4150
4153
|
onFilterChange: (i) => zt(i),
|
|
4151
4154
|
owners: Ht || [],
|
|
@@ -4162,18 +4165,18 @@ ${s + 1}. ${n.text}
|
|
|
4162
4165
|
styleConfig: r
|
|
4163
4166
|
}
|
|
4164
4167
|
),
|
|
4165
|
-
/* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref:
|
|
4168
|
+
/* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref: kt, onMouseMove: we, onMouseUp: be, onMouseLeave: be, children: [
|
|
4166
4169
|
/* @__PURE__ */ t.jsx(
|
|
4167
4170
|
Er,
|
|
4168
4171
|
{
|
|
4169
4172
|
ref: Mt,
|
|
4170
4173
|
tasks: me,
|
|
4171
|
-
columns:
|
|
4174
|
+
columns: Ae.columns || [],
|
|
4172
4175
|
selectedTask: pe,
|
|
4173
4176
|
onTaskClick: o,
|
|
4174
|
-
onTaskContextMenu:
|
|
4177
|
+
onTaskContextMenu: x,
|
|
4175
4178
|
onTaskUpdate: Ge,
|
|
4176
|
-
onTaskDragStart:
|
|
4179
|
+
onTaskDragStart: Q,
|
|
4177
4180
|
onAddTask: (i) => {
|
|
4178
4181
|
if (i) {
|
|
4179
4182
|
const T = z.find((P) => P.id === i);
|
|
@@ -4188,13 +4191,13 @@ ${s + 1}. ${n.text}
|
|
|
4188
4191
|
const T = z.find((P) => P.id === i);
|
|
4189
4192
|
T && (ie(T), q(!0));
|
|
4190
4193
|
},
|
|
4191
|
-
links:
|
|
4194
|
+
links: ye,
|
|
4192
4195
|
allTasks: z,
|
|
4193
4196
|
dropIndicator: Ke,
|
|
4194
4197
|
reorderTask: ge,
|
|
4195
4198
|
iconConfig: c,
|
|
4196
4199
|
styleConfig: r,
|
|
4197
|
-
headerHeight: (
|
|
4200
|
+
headerHeight: (Ae.scaleHeight || 28) * I
|
|
4198
4201
|
}
|
|
4199
4202
|
),
|
|
4200
4203
|
/* @__PURE__ */ t.jsx(
|
|
@@ -4202,10 +4205,10 @@ ${s + 1}. ${n.text}
|
|
|
4202
4205
|
{
|
|
4203
4206
|
ref: Dt,
|
|
4204
4207
|
tasks: me,
|
|
4205
|
-
links:
|
|
4208
|
+
links: ye,
|
|
4206
4209
|
range: Wt,
|
|
4207
|
-
scales:
|
|
4208
|
-
config:
|
|
4210
|
+
scales: Ae.scales,
|
|
4211
|
+
config: Ae,
|
|
4209
4212
|
selectedTask: pe,
|
|
4210
4213
|
draggedTask: $e,
|
|
4211
4214
|
onTaskClick: () => {
|
|
@@ -4215,7 +4218,7 @@ ${s + 1}. ${n.text}
|
|
|
4215
4218
|
onTaskDragEnd: () => {
|
|
4216
4219
|
},
|
|
4217
4220
|
onTaskUpdate: (i, T, P) => {
|
|
4218
|
-
const H = z.find((
|
|
4221
|
+
const H = z.find((ve) => ve.id === i);
|
|
4219
4222
|
if (!H) return;
|
|
4220
4223
|
const ae = { ...H }, fe = { ...H, ...T };
|
|
4221
4224
|
Ge(fe), P && m && m({
|
|
@@ -4224,10 +4227,10 @@ ${s + 1}. ${n.text}
|
|
|
4224
4227
|
dragType: P.dragType
|
|
4225
4228
|
});
|
|
4226
4229
|
},
|
|
4227
|
-
zoomLevel:
|
|
4230
|
+
zoomLevel: xt,
|
|
4228
4231
|
baselines: qe,
|
|
4229
4232
|
taskTooltipConfig: le,
|
|
4230
|
-
headerHeight: (
|
|
4233
|
+
headerHeight: (Ae.scaleHeight || 28) * I
|
|
4231
4234
|
}
|
|
4232
4235
|
)
|
|
4233
4236
|
] }),
|
|
@@ -4244,13 +4247,13 @@ ${s + 1}. ${n.text}
|
|
|
4244
4247
|
styleConfig: r
|
|
4245
4248
|
}
|
|
4246
4249
|
),
|
|
4247
|
-
|
|
4250
|
+
_e && /* @__PURE__ */ t.jsx(Fn, { task: _e, onUpdate: Ge, onDelete: Ze, onClose: () => Xe(null), uiConfig: re, styleConfig: r }),
|
|
4248
4251
|
U && ee && /* @__PURE__ */ t.jsx(
|
|
4249
4252
|
Pn,
|
|
4250
4253
|
{
|
|
4251
4254
|
task: ee,
|
|
4252
4255
|
allTasks: z,
|
|
4253
|
-
links:
|
|
4256
|
+
links: ye,
|
|
4254
4257
|
onAddDependency: Ne,
|
|
4255
4258
|
onRemoveDependency: bt,
|
|
4256
4259
|
onTaskUpdate: Ge,
|
|
@@ -4280,13 +4283,13 @@ ${s + 1}. ${n.text}
|
|
|
4280
4283
|
onDependencies: () => {
|
|
4281
4284
|
Ce.task && (ie(Ce.task), q(!0));
|
|
4282
4285
|
},
|
|
4283
|
-
onConvertToMilestone: () =>
|
|
4284
|
-
onConvertToTask: () =>
|
|
4285
|
-
onConvertToProject: () =>
|
|
4286
|
+
onConvertToMilestone: () => _("milestone"),
|
|
4287
|
+
onConvertToTask: () => _("task"),
|
|
4288
|
+
onConvertToProject: () => _("project"),
|
|
4286
4289
|
onClose: () => ht(null),
|
|
4287
4290
|
onAutoSchedule: () => {
|
|
4288
|
-
const i = Rr(z,
|
|
4289
|
-
|
|
4291
|
+
const i = Rr(z, ye, { mode: "forward" });
|
|
4292
|
+
Le(i), ht(null);
|
|
4290
4293
|
},
|
|
4291
4294
|
iconConfig: c,
|
|
4292
4295
|
styleConfig: r
|
|
@@ -4296,15 +4299,15 @@ ${s + 1}. ${n.text}
|
|
|
4296
4299
|
ge && (() => {
|
|
4297
4300
|
const i = z.find((He) => He.id === ge.id);
|
|
4298
4301
|
if (!i) return null;
|
|
4299
|
-
const T = Number.isFinite(ge.currentX) ? ge.currentX : 0, P = Number.isFinite(ge.currentY) ? ge.currentY : 0, H =
|
|
4302
|
+
const T = Number.isFinite(ge.currentX) ? ge.currentX : 0, P = Number.isFinite(ge.currentY) ? ge.currentY : 0, H = Ae.rowHeight || 48, fe = Et.current?.getBoundingClientRect(), ve = fe ? T - fe.left + 12 : T + 12, Me = fe ? P - fe.top + 12 : P + 12;
|
|
4300
4303
|
return /* @__PURE__ */ t.jsxs(
|
|
4301
4304
|
"div",
|
|
4302
4305
|
{
|
|
4303
4306
|
className: "gantt-drag-preview",
|
|
4304
4307
|
style: {
|
|
4305
4308
|
height: H,
|
|
4306
|
-
top:
|
|
4307
|
-
left:
|
|
4309
|
+
top: Me,
|
|
4310
|
+
left: ve,
|
|
4308
4311
|
position: "absolute",
|
|
4309
4312
|
pointerEvents: "none",
|
|
4310
4313
|
zIndex: 9999,
|
|
@@ -4336,45 +4339,45 @@ ${s + 1}. ${n.text}
|
|
|
4336
4339
|
const b = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = (m, E = /* @__PURE__ */ new Set()) => {
|
|
4337
4340
|
if (E.has(m)) return;
|
|
4338
4341
|
E.add(m);
|
|
4339
|
-
const
|
|
4340
|
-
if (!
|
|
4342
|
+
const F = e.find((M) => M.id === m);
|
|
4343
|
+
if (!F) return;
|
|
4341
4344
|
const N = c.get(m) || [];
|
|
4342
4345
|
if (N.length === 0)
|
|
4343
|
-
b.set(m, 0), u.set(m,
|
|
4346
|
+
b.set(m, 0), u.set(m, F.duration);
|
|
4344
4347
|
else {
|
|
4345
4348
|
let M = 0;
|
|
4346
|
-
N.forEach((
|
|
4347
|
-
d(
|
|
4348
|
-
const
|
|
4349
|
-
M = Math.max(M,
|
|
4350
|
-
}), b.set(m, M), u.set(m, M +
|
|
4349
|
+
N.forEach((S) => {
|
|
4350
|
+
d(S, E);
|
|
4351
|
+
const w = u.get(S) || 0;
|
|
4352
|
+
M = Math.max(M, w);
|
|
4353
|
+
}), b.set(m, M), u.set(m, M + F.duration);
|
|
4351
4354
|
}
|
|
4352
4355
|
};
|
|
4353
4356
|
e.forEach((m) => d(m.id));
|
|
4354
|
-
const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(),
|
|
4357
|
+
const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), v = Math.max(...Array.from(u.values())), y = (m, E = /* @__PURE__ */ new Set()) => {
|
|
4355
4358
|
if (E.has(m)) return;
|
|
4356
4359
|
E.add(m);
|
|
4357
|
-
const
|
|
4358
|
-
if (!
|
|
4360
|
+
const F = e.find((M) => M.id === m);
|
|
4361
|
+
if (!F) return;
|
|
4359
4362
|
const N = r.get(m) || [];
|
|
4360
4363
|
if (N.length === 0)
|
|
4361
|
-
h.set(m,
|
|
4364
|
+
h.set(m, v), p.set(m, v - F.duration);
|
|
4362
4365
|
else {
|
|
4363
4366
|
let M = 1 / 0;
|
|
4364
|
-
N.forEach((
|
|
4365
|
-
|
|
4366
|
-
const
|
|
4367
|
-
M = Math.min(M,
|
|
4368
|
-
}), h.set(m, M), p.set(m, M -
|
|
4367
|
+
N.forEach((S) => {
|
|
4368
|
+
y(S, E);
|
|
4369
|
+
const w = p.get(S) || 0;
|
|
4370
|
+
M = Math.min(M, w);
|
|
4371
|
+
}), h.set(m, M), p.set(m, M - F.duration);
|
|
4369
4372
|
}
|
|
4370
4373
|
};
|
|
4371
|
-
return e.forEach((m) =>
|
|
4374
|
+
return e.forEach((m) => y(m.id)), e.forEach((m) => {
|
|
4372
4375
|
const E = b.get(m.id) || 0, N = (p.get(m.id) || 0) - E;
|
|
4373
4376
|
s.set(m.id, N), Math.abs(N) < 0.01 && n.add(m.id);
|
|
4374
4377
|
}), {
|
|
4375
4378
|
criticalTasks: n,
|
|
4376
4379
|
taskFloats: s,
|
|
4377
|
-
projectDuration:
|
|
4380
|
+
projectDuration: v
|
|
4378
4381
|
};
|
|
4379
4382
|
}, ta = (e, a) => a.criticalTasks.has(e), ra = (e, a) => a.taskFloats.get(e) || 0, ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4380
4383
|
__proto__: null,
|
|
@@ -4391,21 +4394,21 @@ export {
|
|
|
4391
4394
|
jn as FilterSearch,
|
|
4392
4395
|
pa as Gantt,
|
|
4393
4396
|
Er as Grid,
|
|
4394
|
-
|
|
4397
|
+
xn as TaskBar,
|
|
4395
4398
|
Mn as TaskCreator,
|
|
4396
4399
|
Fn as TaskEditor,
|
|
4397
4400
|
Lr as Timeline,
|
|
4398
4401
|
Tn as Toolbar,
|
|
4399
|
-
|
|
4402
|
+
Te as addToDate,
|
|
4400
4403
|
zn as applyFilters,
|
|
4401
4404
|
da as calculateDuration,
|
|
4402
4405
|
Yn as createBaseline,
|
|
4403
|
-
|
|
4406
|
+
Oe as formatDate,
|
|
4404
4407
|
Nt as getDaysBetween,
|
|
4405
4408
|
la as getEndOfDay,
|
|
4406
4409
|
pn as getHoursBetween,
|
|
4407
|
-
|
|
4410
|
+
yt as getStartOfDay,
|
|
4408
4411
|
Zt as isHoliday,
|
|
4409
4412
|
Kt as isWeekend,
|
|
4410
|
-
|
|
4413
|
+
On as useUndoRedo
|
|
4411
4414
|
};
|