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