@art-tools/react-gantt 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -8
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -4
- package/dist/index.d.ts +157 -4
- package/dist/index.mjs +1286 -1098
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
2
|
-
import { flushSync as
|
|
3
|
-
import { Fragment as
|
|
1
|
+
import { Fragment as e, cloneElement as t, createContext as n, isValidElement as r, memo as i, startTransition as a, useCallback as o, useContext as s, useDeferredValue as c, useEffect as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
2
|
+
import { createPortal as h, flushSync as g } from "react-dom";
|
|
3
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
4
4
|
//#region src/core/lruCache.ts
|
|
5
|
-
var
|
|
5
|
+
var b = class {
|
|
6
6
|
cache = /* @__PURE__ */ new Map();
|
|
7
7
|
capacity;
|
|
8
8
|
constructor(e) {
|
|
@@ -25,8 +25,8 @@ var g = class {
|
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/core/utils.ts
|
|
28
|
-
function
|
|
29
|
-
let n = new
|
|
28
|
+
function x(e, t) {
|
|
29
|
+
let n = new b(t);
|
|
30
30
|
return (t) => {
|
|
31
31
|
let r = n.get(t);
|
|
32
32
|
if (r != null) return r;
|
|
@@ -34,40 +34,40 @@ function _(e, t) {
|
|
|
34
34
|
return n.put(t, i), i;
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function S(e, t) {
|
|
38
|
+
return x(e, t);
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/core/dateUtils.ts
|
|
42
|
-
var
|
|
43
|
-
minute:
|
|
44
|
-
hour:
|
|
45
|
-
day:
|
|
46
|
-
week:
|
|
42
|
+
var C = 6e4, w = 36e5, T = 864e5, E = {
|
|
43
|
+
minute: C,
|
|
44
|
+
hour: w,
|
|
45
|
+
day: T,
|
|
46
|
+
week: T * 7
|
|
47
47
|
};
|
|
48
|
-
function
|
|
48
|
+
function D(e, t, n) {
|
|
49
49
|
let r = e.getFullYear(), i = e.getMonth(), a = e.getDate();
|
|
50
50
|
switch (t) {
|
|
51
51
|
case "minute": {
|
|
52
52
|
let t = new Date(e);
|
|
53
53
|
t.setSeconds(0, 0);
|
|
54
|
-
let r = Math.round(t.getTime() /
|
|
54
|
+
let r = Math.round(t.getTime() / C);
|
|
55
55
|
return `mi-${Math.floor(r / n)}`;
|
|
56
56
|
}
|
|
57
57
|
case "hour": {
|
|
58
58
|
let t = new Date(e);
|
|
59
59
|
t.setMinutes(0, 0, 0);
|
|
60
|
-
let r = Math.round(t.getTime() /
|
|
60
|
+
let r = Math.round(t.getTime() / w);
|
|
61
61
|
return `h-${Math.floor(r / n)}`;
|
|
62
62
|
}
|
|
63
63
|
case "day": {
|
|
64
|
-
let e = Math.floor(Date.UTC(r, i, a) /
|
|
64
|
+
let e = Math.floor(Date.UTC(r, i, a) / T);
|
|
65
65
|
return `d-${Math.floor(e / n)}`;
|
|
66
66
|
}
|
|
67
67
|
case "week": {
|
|
68
68
|
let e = new Date(r, i, a), t = e.getDay(), o = t === 0 ? -6 : 1 - t;
|
|
69
69
|
e.setDate(e.getDate() + o);
|
|
70
|
-
let s = Math.floor(e.getTime() / (
|
|
70
|
+
let s = Math.floor(e.getTime() / (T * 7));
|
|
71
71
|
return `w-${Math.floor(s / n)}`;
|
|
72
72
|
}
|
|
73
73
|
case "month": {
|
|
@@ -82,22 +82,22 @@ function C(e, t, n) {
|
|
|
82
82
|
default: throw Error(`Unsupported unit: ${t}`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function O(e) {
|
|
86
86
|
let t = e.getDay();
|
|
87
87
|
return t === 0 || t === 6;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) /
|
|
89
|
+
function k(e) {
|
|
90
|
+
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) / T;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let t = new Date(e *
|
|
92
|
+
function A(e) {
|
|
93
|
+
let t = new Date(e * T);
|
|
94
94
|
return new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function j(e, t) {
|
|
97
97
|
let n = new Date(e);
|
|
98
|
-
return n.setHours(0, 0, 0, 0), new Date(n.getTime() + t *
|
|
98
|
+
return n.setHours(0, 0, 0, 0), new Date(n.getTime() + t * T);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function M(e, t) {
|
|
101
101
|
let n = new Date(e);
|
|
102
102
|
switch (t) {
|
|
103
103
|
case "minute": return n.setSeconds(0, 0), n;
|
|
@@ -114,9 +114,9 @@ function O(e, t) {
|
|
|
114
114
|
default: throw Error(`Unsupported unit: ${t}`);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
let r =
|
|
119
|
-
if (r !== void 0) return t === "day" || t === "week" ?
|
|
117
|
+
function N(e, t, n) {
|
|
118
|
+
let r = E[t];
|
|
119
|
+
if (r !== void 0) return t === "day" || t === "week" ? j(e, r / T * n) : new Date(e.getTime() + n * r);
|
|
120
120
|
let i = new Date(e);
|
|
121
121
|
switch (t) {
|
|
122
122
|
case "month": return i.setMonth(i.getMonth() + n), i;
|
|
@@ -125,25 +125,25 @@ function k(e, t, n) {
|
|
|
125
125
|
default: throw Error(`Unsupported unit: ${t}`);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
let r =
|
|
128
|
+
function P(e, t, n) {
|
|
129
|
+
let r = E[n];
|
|
130
130
|
if (r !== void 0) return (t.getTime() - e.getTime()) / r;
|
|
131
131
|
let i = n === "month" ? 1 : n === "quarter" ? 3 : 12, a = e.getFullYear() * 12 + e.getMonth(), o = t.getFullYear() * 12 + t.getMonth(), s = Math.floor((o - a) / i);
|
|
132
|
-
for (;
|
|
133
|
-
for (;
|
|
134
|
-
let c =
|
|
132
|
+
for (; N(e, n, s).getTime() > t.getTime();) --s;
|
|
133
|
+
for (; N(e, n, s + 1).getTime() <= t.getTime();) s += 1;
|
|
134
|
+
let c = N(e, n, s).getTime(), l = N(e, n, s + 1).getTime();
|
|
135
135
|
return s + (t.getTime() - c) / (l - c);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
let r =
|
|
137
|
+
function F(e, t, n) {
|
|
138
|
+
let r = E[t];
|
|
139
139
|
if (r !== void 0) return new Date(e.getTime() + n * r);
|
|
140
|
-
let i = Math.floor(n), a = n - i, o =
|
|
140
|
+
let i = Math.floor(n), a = n - i, o = N(e, t, i).getTime(), s = N(e, t, i + 1).getTime();
|
|
141
141
|
return new Date(o + a * (s - o));
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return Array.from({ length: t }, (t, i) =>
|
|
143
|
+
function ee(e, t, n = "day", r = 1) {
|
|
144
|
+
return Array.from({ length: t }, (t, i) => N(e, n, i * r));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function I(e) {
|
|
147
147
|
let t = e[0];
|
|
148
148
|
if (!t) return null;
|
|
149
149
|
let n = t.startDate, r = t.endDate ?? t.startDate;
|
|
@@ -157,19 +157,19 @@ function ee(e) {
|
|
|
157
157
|
max: r
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
function
|
|
162
|
-
let t =
|
|
160
|
+
var L = S(I, 3), R = 1440, z = 6e4, B = [0, R], V = /^\s*(\d{1,2}):(\d{2})\s*-\s*(\d{1,2}):(\d{2})\s*$/;
|
|
161
|
+
function te(e) {
|
|
162
|
+
let t = V.exec(e);
|
|
163
163
|
if (!t) throw Error(`Invalid working-hours range ${JSON.stringify(e)}: expected "H:MM-H:MM", e.g. "8:30-12:00".`);
|
|
164
164
|
let n = Number(t[1]) * 60 + Number(t[2]), r = Number(t[3]) * 60 + Number(t[4]);
|
|
165
165
|
if (n < 0 || n >= 1440) throw Error(`Invalid working-hours range ${JSON.stringify(e)}: start must be within the day.`);
|
|
166
166
|
if (r <= n || r > 1440) throw Error(`Invalid working-hours range ${JSON.stringify(e)}: end must be after start and no later than 24:00.`);
|
|
167
167
|
return [n, r];
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
if (e === void 0) return
|
|
169
|
+
function H(e) {
|
|
170
|
+
if (e === void 0) return B;
|
|
171
171
|
if (e === !1) return [];
|
|
172
|
-
let t = e.map(
|
|
172
|
+
let t = e.map(te).toSorted((e, t) => e[0] - t[0]), n = [];
|
|
173
173
|
for (let [e, r] of t) {
|
|
174
174
|
let t = n.length > 0 ? n[n.length - 1] : void 0;
|
|
175
175
|
if (t !== void 0 && e <= t) {
|
|
@@ -180,7 +180,7 @@ function L(e) {
|
|
|
180
180
|
}
|
|
181
181
|
return n;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function ne(e, t) {
|
|
184
184
|
let n = [], r = 0;
|
|
185
185
|
for (let t = 0; t < e.length; t += 2) n.push(r), r += e[t + 1] - e[t];
|
|
186
186
|
return {
|
|
@@ -190,43 +190,43 @@ function R(e, t) {
|
|
|
190
190
|
id: t
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function re() {
|
|
194
194
|
let e = /* @__PURE__ */ new Map();
|
|
195
195
|
return (t) => {
|
|
196
196
|
let n = t.join(","), r = e.get(n);
|
|
197
197
|
if (r) return r;
|
|
198
|
-
let i =
|
|
198
|
+
let i = ne(t, e.size);
|
|
199
199
|
return e.set(n, i), i;
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function ie(e) {
|
|
203
203
|
return e === void 0 ? "*" : e === !1 ? "-" : e.join(",");
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ae(e) {
|
|
206
206
|
if (!e) return "";
|
|
207
|
-
let t = [
|
|
207
|
+
let t = [ie(e.hours)];
|
|
208
208
|
for (let n = 0; n < 7; n++) {
|
|
209
209
|
let r = e.days?.[n];
|
|
210
|
-
r !== void 0 && t.push(`${n}=${
|
|
210
|
+
r !== void 0 && t.push(`${n}=${ie(r)}`);
|
|
211
211
|
}
|
|
212
212
|
let n = e.dates;
|
|
213
|
-
if (n) for (let e of Object.keys(n).toSorted()) t.push(`${e}=${
|
|
213
|
+
if (n) for (let e of Object.keys(n).toSorted()) t.push(`${e}=${ie(n[e])}`);
|
|
214
214
|
return t.join("|");
|
|
215
215
|
}
|
|
216
|
-
var
|
|
217
|
-
function
|
|
218
|
-
let t =
|
|
216
|
+
var oe = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
217
|
+
function se(e) {
|
|
218
|
+
let t = oe.exec(e);
|
|
219
219
|
if (!t) throw Error(`Invalid calendar date key ${JSON.stringify(e)}: expected a local civil date, "YYYY-MM-DD".`);
|
|
220
|
-
return
|
|
220
|
+
return k(new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3])));
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
let n =
|
|
222
|
+
function ce(e, t) {
|
|
223
|
+
let n = re(), r = H(e.hours), i = [];
|
|
224
224
|
for (let t = 0; t < 7; t++) {
|
|
225
225
|
let a = e.days?.[t];
|
|
226
|
-
i.push(n(a === void 0 ? r :
|
|
226
|
+
i.push(n(a === void 0 ? r : H(a)));
|
|
227
227
|
}
|
|
228
228
|
let a = /* @__PURE__ */ new Map();
|
|
229
|
-
if (e.dates) for (let [t, r] of Object.entries(e.dates)) a.set(
|
|
229
|
+
if (e.dates) for (let [t, r] of Object.entries(e.dates)) a.set(se(t), n(H(r)));
|
|
230
230
|
let o = [...a.keys()].toSorted((e, t) => e - t), s = 0, c = !0, l = a.size === 0;
|
|
231
231
|
for (let e of i) s += e.totalMinutes, e.totalMinutes !== 0 && e.totalMinutes !== 1440 && (c = !1), e.totalMinutes !== 1440 && (l = !1);
|
|
232
232
|
for (let e of a.values()) e.totalMinutes !== 0 && e.totalMinutes !== 1440 && (c = !1);
|
|
@@ -240,13 +240,13 @@ function ae(e, t) {
|
|
|
240
240
|
isAlwaysWorking: l,
|
|
241
241
|
isDayGranular: c,
|
|
242
242
|
weekMinutes: s,
|
|
243
|
-
msPerWorkingDay: u *
|
|
243
|
+
msPerWorkingDay: u * z
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function U(e, t) {
|
|
247
247
|
return e.byDate.get(t) || e.byWeekday[((t + 4) % 7 + 7) % 7];
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function le(e, t) {
|
|
250
250
|
let n = e.overrideDays, r = 0, i = n.length;
|
|
251
251
|
for (; r < i;) {
|
|
252
252
|
let e = r + i >> 1;
|
|
@@ -254,7 +254,7 @@ function oe(e, t) {
|
|
|
254
254
|
}
|
|
255
255
|
return r < n.length ? n[r] : Infinity;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function ue(e, t) {
|
|
258
258
|
let n = e.overrideDays, r = 0, i = n.length;
|
|
259
259
|
for (; r < i;) {
|
|
260
260
|
let e = r + i >> 1;
|
|
@@ -264,24 +264,24 @@ function se(e, t) {
|
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region src/hooks/useResolvedCalendar.ts
|
|
267
|
-
function
|
|
268
|
-
let t =
|
|
267
|
+
function de(e) {
|
|
268
|
+
let t = p(null), n = ae(e);
|
|
269
269
|
return (!t.current || t.current.key !== n) && (t.current = {
|
|
270
270
|
key: n,
|
|
271
|
-
value: e ?
|
|
271
|
+
value: e ? ce(e, n) : null
|
|
272
272
|
}), t.current.value;
|
|
273
273
|
}
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region src/core/workingTime.ts
|
|
276
|
-
var
|
|
277
|
-
function
|
|
278
|
-
return (e.getHours() *
|
|
276
|
+
var fe = 36e5, pe = 864e5, me = 2e4;
|
|
277
|
+
function he(e) {
|
|
278
|
+
return (e.getHours() * fe + e.getMinutes() * z + e.getSeconds() * 1e3 + e.getMilliseconds()) / z;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
let n =
|
|
282
|
-
return new Date(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0, Math.round(t *
|
|
280
|
+
function ge(e, t) {
|
|
281
|
+
let n = A(e);
|
|
282
|
+
return new Date(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0, Math.round(t * z));
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function _e(e, t) {
|
|
285
285
|
let { intervals: n, prefix: r } = e;
|
|
286
286
|
for (let e = 0, i = 0; e < n.length; e += 2, i++) {
|
|
287
287
|
let a = n[e], o = n[e + 1];
|
|
@@ -290,12 +290,12 @@ function W(e, t) {
|
|
|
290
290
|
}
|
|
291
291
|
return e.totalMinutes;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function W(e, t) {
|
|
294
294
|
let { intervals: n, prefix: r } = e, i = n.length > 0 ? n[0] : 0;
|
|
295
295
|
for (let e = 0, a = 0; e < n.length && !(r[a] >= t); e += 2, a++) i = n[e] + (t - r[a]);
|
|
296
296
|
return i;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function ve(e, t) {
|
|
299
299
|
let { intervals: n, prefix: r } = e;
|
|
300
300
|
for (let e = 0, i = 0; e < n.length; e += 2, i++) {
|
|
301
301
|
let a = n[e + 1] - n[e];
|
|
@@ -303,106 +303,106 @@ function me(e, t) {
|
|
|
303
303
|
}
|
|
304
304
|
return n.length > 0 ? n[n.length - 1] : 0;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ye(e, t) {
|
|
307
307
|
let { intervals: n } = e;
|
|
308
308
|
for (let e = 0; e < n.length; e += 2) if (t < n[e + 1]) return Math.max(t, n[e]);
|
|
309
309
|
return null;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function be(e, t) {
|
|
312
312
|
let { intervals: n } = e, r = null;
|
|
313
313
|
for (let e = 0; e < n.length; e += 2) t > n[e] && (r = Math.min(t, n[e + 1]));
|
|
314
314
|
return r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function xe(e, t) {
|
|
317
317
|
if (!e || e.isAlwaysWorking) return !0;
|
|
318
|
-
let n =
|
|
318
|
+
let n = U(e, k(t)), r = he(t), { intervals: i } = n;
|
|
319
319
|
for (let e = 0; e < i.length; e += 2) if (r >= i[e] && r < i[e + 1]) return !0;
|
|
320
320
|
return !1;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function G(e, t, n) {
|
|
323
323
|
if (!e || e.isAlwaysWorking || e.weekMinutes === 0 && e.byDate.size === 0) return t;
|
|
324
|
-
let r =
|
|
325
|
-
for (let a = 0; a <
|
|
326
|
-
let a =
|
|
324
|
+
let r = k(t), i = he(t);
|
|
325
|
+
for (let a = 0; a < me; a++) {
|
|
326
|
+
let a = U(e, r);
|
|
327
327
|
if (n === 1) {
|
|
328
|
-
let e =
|
|
329
|
-
if (e !== null) return e === i && r ===
|
|
328
|
+
let e = ye(a, i);
|
|
329
|
+
if (e !== null) return e === i && r === k(t) ? t : ge(r, e);
|
|
330
330
|
r += 1, i = 0;
|
|
331
331
|
continue;
|
|
332
332
|
}
|
|
333
|
-
let o =
|
|
334
|
-
if (o !== null) return o === i && r ===
|
|
335
|
-
--r, i =
|
|
333
|
+
let o = be(a, i);
|
|
334
|
+
if (o !== null) return o === i && r === k(t) ? t : ge(r, o);
|
|
335
|
+
--r, i = R;
|
|
336
336
|
}
|
|
337
337
|
return t;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
if (!e || e.isAlwaysWorking ||
|
|
341
|
-
let n =
|
|
339
|
+
function Se(e, t) {
|
|
340
|
+
if (!e || e.isAlwaysWorking || xe(e, t)) return t;
|
|
341
|
+
let n = G(e, t, 1), r = G(e, t, -1);
|
|
342
342
|
return n.getTime() - t.getTime() <= t.getTime() - r.getTime() ? n : r;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
let r =
|
|
346
|
-
for (let t = 0; t <
|
|
347
|
-
let t =
|
|
348
|
-
if (a <= o) return
|
|
344
|
+
function Ce(e, t, n) {
|
|
345
|
+
let r = k(t), i = he(t), a = n;
|
|
346
|
+
for (let t = 0; t < me; t++) {
|
|
347
|
+
let t = U(e, r), n = _e(t, i), o = t.totalMinutes - n;
|
|
348
|
+
if (a <= o) return ge(r, W(t, n + a));
|
|
349
349
|
if (a -= o, r += 1, i = 0, e.weekMinutes > 0 && a > e.weekMinutes) {
|
|
350
|
-
let t =
|
|
350
|
+
let t = le(e, r), n = t === Infinity ? Infinity : Math.floor((t - r) / 7), i = Math.ceil(a / e.weekMinutes) - 1, o = Math.min(n, i);
|
|
351
351
|
o > 0 && Number.isFinite(o) && (r += o * 7, a -= o * e.weekMinutes);
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
return
|
|
355
|
-
}
|
|
356
|
-
function
|
|
357
|
-
let r =
|
|
358
|
-
for (let t = 0; t <
|
|
359
|
-
let t =
|
|
360
|
-
if (a <= n) return
|
|
361
|
-
if (a -= n, --r, i =
|
|
362
|
-
let t =
|
|
354
|
+
return ge(r, i);
|
|
355
|
+
}
|
|
356
|
+
function we(e, t, n) {
|
|
357
|
+
let r = k(t), i = he(t), a = n;
|
|
358
|
+
for (let t = 0; t < me; t++) {
|
|
359
|
+
let t = U(e, r), n = _e(t, i);
|
|
360
|
+
if (a <= n) return ge(r, ve(t, n - a));
|
|
361
|
+
if (a -= n, --r, i = R, e.weekMinutes > 0 && a > e.weekMinutes) {
|
|
362
|
+
let t = ue(e, r), n = t === -Infinity ? Infinity : Math.floor((r - t) / 7), i = Math.ceil(a / e.weekMinutes) - 1, o = Math.min(n, i);
|
|
363
363
|
o > 0 && Number.isFinite(o) && (r -= o * 7, a -= o * e.weekMinutes);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
return
|
|
366
|
+
return ge(r, i);
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function K(e, t, n, r) {
|
|
369
369
|
if (!e) return new Date(t.getTime() + n);
|
|
370
|
-
let i =
|
|
371
|
-
return n === 0 || e.weekMinutes === 0 && e.byDate.size === 0 ? i : n > 0 ?
|
|
370
|
+
let i = G(e, t, r ?? (n < 0 ? -1 : 1));
|
|
371
|
+
return n === 0 || e.weekMinutes === 0 && e.byDate.size === 0 ? i : n > 0 ? Ce(e, i, n / z) : we(e, i, -n / z);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Te(e, t, n) {
|
|
374
374
|
if (!e) return n.getTime() - t.getTime();
|
|
375
|
-
if (n.getTime() < t.getTime()) return -
|
|
376
|
-
let r =
|
|
375
|
+
if (n.getTime() < t.getTime()) return -Te(e, n, t);
|
|
376
|
+
let r = k(n), i = k(t), a = he(t), o = 0;
|
|
377
377
|
for (; i < r;) {
|
|
378
378
|
if (a === 0 && e.weekMinutes > 0) {
|
|
379
|
-
let t =
|
|
379
|
+
let t = le(e, i), n = Math.floor((Math.min(r, t) - i) / 7);
|
|
380
380
|
if (n > 0) {
|
|
381
381
|
o += n * e.weekMinutes, i += n * 7;
|
|
382
382
|
continue;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
let t =
|
|
386
|
-
o += t.totalMinutes -
|
|
385
|
+
let t = U(e, i);
|
|
386
|
+
o += t.totalMinutes - _e(t, a), i += 1, a = 0;
|
|
387
387
|
}
|
|
388
|
-
let s =
|
|
389
|
-
return o +=
|
|
388
|
+
let s = U(e, i);
|
|
389
|
+
return o += _e(s, he(n)) - _e(s, a), o * z;
|
|
390
390
|
}
|
|
391
|
-
var
|
|
392
|
-
function
|
|
391
|
+
var Ee = { isNonWorking: !1 };
|
|
392
|
+
function De(e, t, n) {
|
|
393
393
|
if (!e) {
|
|
394
394
|
let e = t.getDay();
|
|
395
395
|
return e === 0 || e === 6 ? {
|
|
396
396
|
isNonWorking: !0,
|
|
397
397
|
reason: "weekend"
|
|
398
|
-
} :
|
|
398
|
+
} : Ee;
|
|
399
399
|
}
|
|
400
|
-
if (
|
|
401
|
-
let r =
|
|
400
|
+
if (Te(e, t, n) > 0) return Ee;
|
|
401
|
+
let r = k(t);
|
|
402
402
|
return e.byDate.has(r) ? {
|
|
403
403
|
isNonWorking: !0,
|
|
404
404
|
reason: "holiday"
|
|
405
|
-
} :
|
|
405
|
+
} : U(e, r).totalMinutes === 0 ? {
|
|
406
406
|
isNonWorking: !0,
|
|
407
407
|
reason: "weekend"
|
|
408
408
|
} : {
|
|
@@ -410,38 +410,38 @@ function Se(e, t, n) {
|
|
|
410
410
|
reason: "offHours"
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
return t === "minute" ?
|
|
413
|
+
function Oe(e, t) {
|
|
414
|
+
return t === "minute" ? z : t === "hour" ? fe : !e || e.msPerWorkingDay === 0 ? pe : e.msPerWorkingDay;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
return
|
|
416
|
+
function ke(e, t, n, r, i) {
|
|
417
|
+
return K(e, t, n * Oe(e, r), i);
|
|
418
418
|
}
|
|
419
419
|
//#endregion
|
|
420
420
|
//#region src/core/taskDates.ts
|
|
421
|
-
var
|
|
421
|
+
var Ae = {
|
|
422
422
|
calendar: null,
|
|
423
423
|
durationUnit: "day",
|
|
424
424
|
snapToWorking: !0
|
|
425
425
|
};
|
|
426
|
-
function
|
|
427
|
-
return e.type === "milestone" || e.duration === 0 ? e.startDate : e.endDate ? e.endDate : e.duration === void 0 ? e.startDate :
|
|
426
|
+
function je(e, t) {
|
|
427
|
+
return e.type === "milestone" || e.duration === 0 ? e.startDate : e.endDate ? e.endDate : e.duration === void 0 ? e.startDate : ke(t.calendar, e.startDate, e.duration, t.durationUnit, 1);
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
return t.getTime() <= e.getTime() ?
|
|
429
|
+
function Me(e, t) {
|
|
430
|
+
return t.getTime() <= e.getTime() ? M(e, "day") : M(/* @__PURE__ */ new Date(t.getTime() - 1), "day");
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function Ne(e) {
|
|
433
433
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
436
|
-
let n =
|
|
437
|
-
if (!(n.getTime() <= e.startDate.getTime())) return
|
|
435
|
+
function Pe(e, t) {
|
|
436
|
+
let n = je(e, t);
|
|
437
|
+
if (!(n.getTime() <= e.startDate.getTime())) return Me(e.startDate, n);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
439
|
+
function Fe(e, t) {
|
|
440
|
+
return Te(t.calendar, e.startDate, je(e, t)) / Oe(t.calendar, t.durationUnit);
|
|
441
441
|
}
|
|
442
442
|
//#endregion
|
|
443
443
|
//#region src/core/labels.ts
|
|
444
|
-
var
|
|
444
|
+
var Ie = {
|
|
445
445
|
gantt: "Gantt chart",
|
|
446
446
|
taskList: "Task list",
|
|
447
447
|
timeline: "Timeline",
|
|
@@ -452,27 +452,27 @@ var je = {
|
|
|
452
452
|
editTask: (e) => `Edit ${e.name}`,
|
|
453
453
|
addTaskAfter: (e) => `Add task after ${e.name}`,
|
|
454
454
|
deleteTask: (e) => `Delete ${e.name}`,
|
|
455
|
-
bar: (e, { progress: t }) =>
|
|
455
|
+
bar: (e, { progress: t }) => Be(e, t)
|
|
456
456
|
};
|
|
457
|
-
function
|
|
457
|
+
function Le(e) {
|
|
458
458
|
return e ? {
|
|
459
|
-
...
|
|
459
|
+
...Ie,
|
|
460
460
|
...e
|
|
461
|
-
} :
|
|
461
|
+
} : Ie;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Re(e) {
|
|
464
464
|
return e.toLocaleDateString(void 0, { dateStyle: "medium" });
|
|
465
465
|
}
|
|
466
|
-
var
|
|
466
|
+
var ze = {
|
|
467
467
|
task: "task",
|
|
468
468
|
milestone: "milestone",
|
|
469
469
|
summary: "summary"
|
|
470
470
|
};
|
|
471
|
-
function
|
|
472
|
-
let n =
|
|
473
|
-
return e.endDate && e.endDate.getTime() !== e.startDate.getTime() ? r.push(`${
|
|
471
|
+
function Be(e, t) {
|
|
472
|
+
let n = ze[e.type ?? "task"], r = [e.name, n];
|
|
473
|
+
return e.endDate && e.endDate.getTime() !== e.startDate.getTime() ? r.push(`${Re(e.startDate)} to ${Re(e.endDate)}`) : r.push(Re(e.startDate)), e.type !== "milestone" && r.push(`${Math.round(t)}% complete`), r.join(", ");
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Ve(e, t, n) {
|
|
476
476
|
switch (t) {
|
|
477
477
|
case "minute":
|
|
478
478
|
case "hour": return e.toLocaleString(void 0, {
|
|
@@ -491,20 +491,20 @@ function Ie(e, t, n) {
|
|
|
491
491
|
}
|
|
492
492
|
//#endregion
|
|
493
493
|
//#region src/core/prepareData.ts
|
|
494
|
-
function
|
|
495
|
-
let n =
|
|
496
|
-
for (let e of r)
|
|
494
|
+
function He(e, t = Ae) {
|
|
495
|
+
let n = $e(e.values()), r = n.get(null) ?? [], i = [];
|
|
496
|
+
for (let e of r) Xe(e, n, i, t);
|
|
497
497
|
return i;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Ue(e) {
|
|
500
500
|
let t = /* @__PURE__ */ new Map();
|
|
501
501
|
for (let n of e) t.set(n.id, n);
|
|
502
502
|
return t;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
504
|
+
function We(e, t) {
|
|
505
|
+
return Ge(new Map(e), t);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Ge(e, t) {
|
|
508
508
|
for (let n of t) switch (n.type) {
|
|
509
509
|
case "update":
|
|
510
510
|
e.has(n.task.id) && e.set(n.task.id, n.task);
|
|
@@ -513,27 +513,27 @@ function Be(e, t) {
|
|
|
513
513
|
e.delete(n.id);
|
|
514
514
|
break;
|
|
515
515
|
case "create":
|
|
516
|
-
e =
|
|
516
|
+
e = Ke(e, n.task, n.afterId);
|
|
517
517
|
break;
|
|
518
518
|
}
|
|
519
519
|
return e;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function Ke(e, t, n) {
|
|
522
522
|
if (n == null) return e.set(t.id, t), e;
|
|
523
523
|
let r = /* @__PURE__ */ new Map();
|
|
524
524
|
e.has(n) || r.set(t.id, t);
|
|
525
525
|
for (let [i, a] of e) r.set(i, a), i === n && r.set(t.id, t);
|
|
526
526
|
return r;
|
|
527
527
|
}
|
|
528
|
-
var
|
|
529
|
-
function
|
|
528
|
+
var qe = 32;
|
|
529
|
+
function Je() {
|
|
530
530
|
return {
|
|
531
531
|
seedTasks: null,
|
|
532
|
-
snapshots: new
|
|
532
|
+
snapshots: new b(qe)
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
e.seedTasks !== t && (e.seedTasks = t, e.snapshots = new
|
|
535
|
+
function Ye(e, t, n) {
|
|
536
|
+
e.seedTasks !== t && (e.seedTasks = t, e.snapshots = new b(qe));
|
|
537
537
|
let r = 0, i = null;
|
|
538
538
|
for (let t = n.cursor; t >= 1; t--) {
|
|
539
539
|
let a = e.snapshots.get(t);
|
|
@@ -544,46 +544,46 @@ function We(e, t, n) {
|
|
|
544
544
|
}
|
|
545
545
|
if (!i) {
|
|
546
546
|
let n = e.snapshots.get(0);
|
|
547
|
-
i = n ? n.map :
|
|
547
|
+
i = n ? n.map : Ue(t), n || e.snapshots.put(0, {
|
|
548
548
|
producedBy: null,
|
|
549
549
|
map: i
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
552
|
for (let t = r; t < n.cursor; t++) {
|
|
553
553
|
let r = n.transactions[t];
|
|
554
|
-
i =
|
|
554
|
+
i = We(i, r), e.snapshots.put(t + 1, {
|
|
555
555
|
producedBy: r,
|
|
556
556
|
map: i
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
559
|
return i;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Xe(e, t, n, r) {
|
|
562
562
|
let i = t.get(e.id);
|
|
563
563
|
if (!i || i.length === 0) {
|
|
564
|
-
let t =
|
|
564
|
+
let t = Ze(e, r);
|
|
565
565
|
return n.push(t), t;
|
|
566
566
|
}
|
|
567
567
|
let a = n.length;
|
|
568
568
|
n.push(e);
|
|
569
569
|
let o = [];
|
|
570
|
-
for (let e of i) o.push(
|
|
571
|
-
let s =
|
|
570
|
+
for (let e of i) o.push(Xe(e, t, n, r));
|
|
571
|
+
let s = Qe(e, o, r);
|
|
572
572
|
return n[a] = s, s;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
let n =
|
|
574
|
+
function Ze(e, t) {
|
|
575
|
+
let n = je(e, t);
|
|
576
576
|
return e.endDate && e.endDate.getTime() === n.getTime() || !e.endDate && n === e.startDate ? e : {
|
|
577
577
|
...e,
|
|
578
578
|
endDate: n
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
if (e.type !== "summary" || t.length === 0) return
|
|
583
|
-
let r = t[0].startDate, i =
|
|
581
|
+
function Qe(e, t, n = Ae) {
|
|
582
|
+
if (e.type !== "summary" || t.length === 0) return Ze(e, n);
|
|
583
|
+
let r = t[0].startDate, i = je(t[0], n), a = 0, o = 0;
|
|
584
584
|
for (let e of t) {
|
|
585
585
|
e.startDate < r && (r = e.startDate);
|
|
586
|
-
let t =
|
|
586
|
+
let t = je(e, n);
|
|
587
587
|
t > i && (i = t), e.type !== "milestone" && (o++, a += e.progress ?? 0);
|
|
588
588
|
}
|
|
589
589
|
let s = o === 0 ? 0 : Math.round(a / o);
|
|
@@ -594,7 +594,7 @@ function qe(e, t, n = Te) {
|
|
|
594
594
|
progress: s
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function $e(e) {
|
|
598
598
|
let t = /* @__PURE__ */ new Map();
|
|
599
599
|
for (let n of e) {
|
|
600
600
|
let e = n.parentId ?? null, r = t.get(e) ?? [];
|
|
@@ -604,7 +604,7 @@ function Je(e) {
|
|
|
604
604
|
}
|
|
605
605
|
//#endregion
|
|
606
606
|
//#region src/core/queue.ts
|
|
607
|
-
var
|
|
607
|
+
var et = class {
|
|
608
608
|
items = [];
|
|
609
609
|
head = 0;
|
|
610
610
|
constructor(e) {
|
|
@@ -627,26 +627,26 @@ var Ye = class {
|
|
|
627
627
|
};
|
|
628
628
|
//#endregion
|
|
629
629
|
//#region src/core/scheduling.ts
|
|
630
|
-
function
|
|
630
|
+
function tt(e, t) {
|
|
631
631
|
return {
|
|
632
632
|
start: e.startDate,
|
|
633
|
-
end:
|
|
633
|
+
end: je(e, t)
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
let { start: n, end: r } =
|
|
638
|
-
return
|
|
636
|
+
function nt(e, t) {
|
|
637
|
+
let { start: n, end: r } = tt(e, t);
|
|
638
|
+
return Te(t.calendar, n, r);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function rt(e, t, n, r, i) {
|
|
641
641
|
let a = i.calendar;
|
|
642
642
|
switch (t) {
|
|
643
|
-
case "FS": return
|
|
644
|
-
case "SS": return
|
|
645
|
-
case "FF": return
|
|
646
|
-
case "SF": return
|
|
643
|
+
case "FS": return K(a, e.end, n, 1);
|
|
644
|
+
case "SS": return K(a, e.start, n, 1);
|
|
645
|
+
case "FF": return K(a, K(a, e.end, n, -1), -r, -1);
|
|
646
|
+
case "SF": return K(a, K(a, e.start, n, -1), -r, -1);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function it(e) {
|
|
650
650
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
651
651
|
for (let r of e) {
|
|
652
652
|
let e = t.get(r.from);
|
|
@@ -660,7 +660,7 @@ function $e(e) {
|
|
|
660
660
|
size: e.length
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function at(e) {
|
|
664
664
|
let t = /* @__PURE__ */ new Map();
|
|
665
665
|
return {
|
|
666
666
|
get: (n) => t.get(n) ?? e.get(n),
|
|
@@ -672,17 +672,17 @@ function et(e) {
|
|
|
672
672
|
}
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
let i =
|
|
675
|
+
function ot(e, t, n, r) {
|
|
676
|
+
let i = nt(e, r), a = Oe(r.calendar, r.durationUnit), o = null;
|
|
677
677
|
for (let s of t.get(e.id) ?? []) {
|
|
678
678
|
let e = n.get(s.from);
|
|
679
679
|
if (!e) continue;
|
|
680
|
-
let t =
|
|
680
|
+
let t = rt(tt(e, r), s.type, (s.lag ?? 0) * a, i, r);
|
|
681
681
|
(o === null || t > o) && (o = t);
|
|
682
682
|
}
|
|
683
|
-
return o === null ? null :
|
|
683
|
+
return o === null ? null : G(r.calendar, o, 1);
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function st(e, t, n) {
|
|
686
686
|
return e.type === "milestone" ? {
|
|
687
687
|
...e,
|
|
688
688
|
startDate: t,
|
|
@@ -690,34 +690,34 @@ function nt(e, t, n) {
|
|
|
690
690
|
} : {
|
|
691
691
|
...e,
|
|
692
692
|
startDate: t,
|
|
693
|
-
endDate:
|
|
693
|
+
endDate: K(n.calendar, t, nt(e, n), 1)
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
let r = n.calendar, i = n.snapToWorking, a =
|
|
696
|
+
function ct(e, t, n) {
|
|
697
|
+
let r = n.calendar, i = n.snapToWorking, a = tt(e, n);
|
|
698
698
|
if (e.type === "milestone") {
|
|
699
|
-
let e = t.kind === "resizeEnd" ? t.endDate : t.startDate, n = i ?
|
|
699
|
+
let e = t.kind === "resizeEnd" ? t.endDate : t.startDate, n = i ? Se(r, e) : e;
|
|
700
700
|
return {
|
|
701
701
|
startDate: n,
|
|
702
702
|
endDate: n
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
if (t.kind === "move") {
|
|
706
|
-
let e =
|
|
706
|
+
let e = Te(r, a.start, a.end), n = i ? G(r, t.startDate, 1) : t.startDate;
|
|
707
707
|
return {
|
|
708
708
|
startDate: n,
|
|
709
|
-
endDate:
|
|
709
|
+
endDate: K(r, n, e, 1)
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
let o = t.kind === "resizeStart" ? t.startDate : a.start, s = t.kind === "resizeEnd" ? t.endDate : a.end, c = i ?
|
|
713
|
-
if (
|
|
714
|
-
let e =
|
|
712
|
+
let o = t.kind === "resizeStart" ? t.startDate : a.start, s = t.kind === "resizeEnd" ? t.endDate : a.end, c = i ? G(r, o, 1) : o, l = i ? G(r, s, -1) : s;
|
|
713
|
+
if (Te(r, c, l) <= 0) {
|
|
714
|
+
let e = Oe(r, n.durationUnit);
|
|
715
715
|
return t.kind === "resizeStart" ? {
|
|
716
|
-
startDate:
|
|
716
|
+
startDate: K(r, l, -e, -1),
|
|
717
717
|
endDate: l
|
|
718
718
|
} : {
|
|
719
719
|
startDate: c,
|
|
720
|
-
endDate:
|
|
720
|
+
endDate: K(r, c, e, 1)
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
return {
|
|
@@ -725,24 +725,24 @@ function rt(e, t, n) {
|
|
|
725
725
|
endDate: l
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function lt(e, t, n, r = Ae) {
|
|
729
729
|
let { successorsOf: i, predecessorDeps: a } = t, o = /* @__PURE__ */ new Map(), s = e.get(n);
|
|
730
730
|
if (s) {
|
|
731
|
-
let t =
|
|
731
|
+
let t = ot(s, a, e, r);
|
|
732
732
|
if (t !== null && t.getTime() > s.startDate.getTime()) {
|
|
733
|
-
let i =
|
|
733
|
+
let i = st(s, t, r);
|
|
734
734
|
e.set(n, i), o.set(n, i);
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
let c = new
|
|
737
|
+
let c = new et([n]), l = (t.size + 1) * (e.size + 1), u = 0;
|
|
738
738
|
for (; !c.isEmpty() && !(u++ > l);) {
|
|
739
739
|
let t = c.dequeue();
|
|
740
740
|
for (let n of i.get(t) ?? []) {
|
|
741
741
|
let t = e.get(n);
|
|
742
742
|
if (!t) continue;
|
|
743
|
-
let i =
|
|
743
|
+
let i = ot(t, a, e, r);
|
|
744
744
|
if (i === null || i.getTime() <= t.startDate.getTime()) continue;
|
|
745
|
-
let s =
|
|
745
|
+
let s = st(t, i, r);
|
|
746
746
|
e.set(n, s), o.set(n, s), c.enqueue(n);
|
|
747
747
|
}
|
|
748
748
|
}
|
|
@@ -750,106 +750,106 @@ function it(e, t, n, r = Te) {
|
|
|
750
750
|
}
|
|
751
751
|
//#endregion
|
|
752
752
|
//#region src/hooks/useTaskList.ts
|
|
753
|
-
var
|
|
753
|
+
var ut = {
|
|
754
754
|
transactions: [],
|
|
755
755
|
cursor: 0
|
|
756
|
-
},
|
|
757
|
-
function
|
|
758
|
-
|
|
756
|
+
}, dt = [];
|
|
757
|
+
function ft(e) {
|
|
758
|
+
a(e);
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function pt(e, t) {
|
|
761
761
|
let n = e.transactions.slice(0, e.cursor);
|
|
762
762
|
return {
|
|
763
763
|
transactions: [...n, t],
|
|
764
764
|
cursor: n.length + 1
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function mt(e, t) {
|
|
768
768
|
return e instanceof Date && t instanceof Date ? e.getTime() === t.getTime() : Object.is(e, t);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ht(e, t) {
|
|
771
771
|
let n = new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
772
|
-
for (let r of n) if (!
|
|
772
|
+
for (let r of n) if (!mt(e[r], t[r])) return !1;
|
|
773
773
|
return !0;
|
|
774
774
|
}
|
|
775
|
-
var
|
|
776
|
-
let
|
|
777
|
-
|
|
778
|
-
let
|
|
779
|
-
|
|
780
|
-
let [
|
|
781
|
-
_.current =
|
|
782
|
-
let v =
|
|
775
|
+
var gt = (e, t = dt, n = {}, r = Ae) => {
|
|
776
|
+
let i = p(n);
|
|
777
|
+
i.current = n;
|
|
778
|
+
let a = p(r);
|
|
779
|
+
a.current = r;
|
|
780
|
+
let [s, c] = m(ut), u = f(() => it(t), [t]), d = p(null), h = f(() => (d.current ??= Je(), Ye(d.current, e, s)), [e, s]), _ = p(h);
|
|
781
|
+
_.current = h;
|
|
782
|
+
let v = f(() => He(h, r), [h, r]), y = o((e, t) => {
|
|
783
783
|
let n = _.current.get(e);
|
|
784
784
|
if (!n) return;
|
|
785
|
-
let { startDate: r, endDate: i } =
|
|
785
|
+
let { startDate: r, endDate: i } = ct(n, t, a.current), o = {
|
|
786
786
|
...n,
|
|
787
787
|
startDate: r,
|
|
788
788
|
endDate: i
|
|
789
789
|
};
|
|
790
|
-
if (
|
|
791
|
-
let
|
|
790
|
+
if (ht(o, n)) return;
|
|
791
|
+
let s = [{
|
|
792
792
|
type: "update",
|
|
793
|
-
task:
|
|
793
|
+
task: o
|
|
794
794
|
}];
|
|
795
|
-
if (
|
|
796
|
-
let t =
|
|
797
|
-
t.set(e,
|
|
798
|
-
let n =
|
|
799
|
-
for (let e of n.values())
|
|
795
|
+
if (u.size > 0) {
|
|
796
|
+
let t = at(_.current);
|
|
797
|
+
t.set(e, o);
|
|
798
|
+
let n = lt(t, u, e, a.current);
|
|
799
|
+
for (let e of n.values()) s.push({
|
|
800
800
|
type: "update",
|
|
801
801
|
task: e
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
|
-
|
|
805
|
-
}, [
|
|
804
|
+
ft(() => c((e) => pt(e, s)));
|
|
805
|
+
}, [u]), b = o((e, t) => {
|
|
806
806
|
let n = _.current.get(e);
|
|
807
807
|
if (!n) return;
|
|
808
808
|
let r = { ...n };
|
|
809
|
-
if (t.name !== void 0 && (r.name = t.name), t.startDate && (r.startDate = t.startDate), t.endDate && (r.endDate = t.endDate), t.progress !== void 0 && (r.progress = t.progress),
|
|
809
|
+
if (t.name !== void 0 && (r.name = t.name), t.startDate && (r.startDate = t.startDate), t.endDate && (r.endDate = t.endDate), t.progress !== void 0 && (r.progress = t.progress), ht(r, n)) return;
|
|
810
810
|
let i = [{
|
|
811
811
|
type: "update",
|
|
812
812
|
task: r
|
|
813
813
|
}];
|
|
814
|
-
if ((t.startDate !== void 0 || t.endDate !== void 0) &&
|
|
815
|
-
let t =
|
|
814
|
+
if ((t.startDate !== void 0 || t.endDate !== void 0) && u.size > 0) {
|
|
815
|
+
let t = at(_.current);
|
|
816
816
|
t.set(e, r);
|
|
817
|
-
let n =
|
|
817
|
+
let n = lt(t, u, e, a.current);
|
|
818
818
|
for (let e of n.values()) i.push({
|
|
819
819
|
type: "update",
|
|
820
820
|
task: e
|
|
821
821
|
});
|
|
822
822
|
}
|
|
823
|
-
|
|
824
|
-
}, [
|
|
825
|
-
|
|
826
|
-
|
|
823
|
+
ft(() => c((e) => pt(e, i)));
|
|
824
|
+
}, [u]), x = o((e, t) => {
|
|
825
|
+
g(() => {
|
|
826
|
+
c((n) => pt(n, [{
|
|
827
827
|
type: "create",
|
|
828
828
|
task: e,
|
|
829
829
|
afterId: t
|
|
830
830
|
}]));
|
|
831
|
-
}),
|
|
832
|
-
}, []), S =
|
|
833
|
-
|
|
831
|
+
}), i.current.onTaskCreate?.(e, t);
|
|
832
|
+
}, []), S = o((e) => {
|
|
833
|
+
ft(() => c((t) => pt(t, [{
|
|
834
834
|
type: "delete",
|
|
835
835
|
id: e
|
|
836
|
-
}]))),
|
|
837
|
-
}, []), C =
|
|
838
|
-
|
|
836
|
+
}]))), i.current.onTaskDelete?.(e);
|
|
837
|
+
}, []), C = o(() => {
|
|
838
|
+
ft(() => c((e) => e.cursor > 0 ? {
|
|
839
839
|
...e,
|
|
840
840
|
cursor: e.cursor - 1
|
|
841
841
|
} : e));
|
|
842
|
-
}, []), w =
|
|
843
|
-
|
|
842
|
+
}, []), w = o(() => {
|
|
843
|
+
ft(() => c((e) => e.cursor < e.transactions.length ? {
|
|
844
844
|
...e,
|
|
845
845
|
cursor: e.cursor + 1
|
|
846
846
|
} : e));
|
|
847
|
-
}, []), T =
|
|
847
|
+
}, []), T = s.cursor > 0, E = s.cursor < s.transactions.length, D = p(v);
|
|
848
848
|
D.current = v;
|
|
849
|
-
let O =
|
|
850
|
-
return
|
|
851
|
-
O.current !==
|
|
852
|
-
}, [
|
|
849
|
+
let O = p(s);
|
|
850
|
+
return l(() => {
|
|
851
|
+
O.current !== s && (O.current = s, i.current.onTasksChange?.(D.current));
|
|
852
|
+
}, [s]), {
|
|
853
853
|
tasksList: v,
|
|
854
854
|
updateTask: b,
|
|
855
855
|
commitTask: y,
|
|
@@ -863,38 +863,38 @@ var dt = (e, t = ot, n = {}, r = Te) => {
|
|
|
863
863
|
};
|
|
864
864
|
//#endregion
|
|
865
865
|
//#region src/hooks/useLatestRef.ts
|
|
866
|
-
function
|
|
867
|
-
let t =
|
|
866
|
+
function q(e) {
|
|
867
|
+
let t = p(e);
|
|
868
868
|
return t.current = e, t;
|
|
869
869
|
}
|
|
870
870
|
//#endregion
|
|
871
871
|
//#region src/hooks/useExpand.ts
|
|
872
|
-
function
|
|
873
|
-
let t =
|
|
872
|
+
function _t(e) {
|
|
873
|
+
let t = f(() => {
|
|
874
874
|
let t = /* @__PURE__ */ new Set();
|
|
875
875
|
for (let n of e) n.parentId != null && t.add(n.parentId);
|
|
876
876
|
return t;
|
|
877
|
-
}, [e]), [n, r] =
|
|
877
|
+
}, [e]), [n, r] = m(/* @__PURE__ */ new Set()), i = o((e) => {
|
|
878
878
|
r((t) => {
|
|
879
879
|
let n = new Set(t);
|
|
880
880
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
881
881
|
});
|
|
882
|
-
}, []),
|
|
882
|
+
}, []), a = q(e), s = o((e) => {
|
|
883
883
|
r((t) => {
|
|
884
884
|
if (t.size === 0) return t;
|
|
885
885
|
let n = /* @__PURE__ */ new Map();
|
|
886
|
-
for (let e of
|
|
887
|
-
let r = new Set(t), i = !1,
|
|
888
|
-
for (;
|
|
886
|
+
for (let e of a.current) n.set(e.id, e);
|
|
887
|
+
let r = new Set(t), i = !1, o = n.get(e);
|
|
888
|
+
for (; o && o.parentId != null;) r.delete(o.parentId) && (i = !0), o = n.get(o.parentId);
|
|
889
889
|
return i ? r : t;
|
|
890
890
|
});
|
|
891
|
-
}, [
|
|
891
|
+
}, [a]), c = f(() => {
|
|
892
892
|
let e = /* @__PURE__ */ new Set();
|
|
893
893
|
for (let r of t) n.has(r) || e.add(r);
|
|
894
894
|
return e;
|
|
895
895
|
}, [t, n]);
|
|
896
896
|
return {
|
|
897
|
-
visibleTasks:
|
|
897
|
+
visibleTasks: f(() => {
|
|
898
898
|
if (n.size === 0) return e;
|
|
899
899
|
let t = /* @__PURE__ */ new Set(), r = [];
|
|
900
900
|
for (let i of e) {
|
|
@@ -908,19 +908,19 @@ function ft(e) {
|
|
|
908
908
|
}, [e, n]),
|
|
909
909
|
expandedIds: c,
|
|
910
910
|
parentIds: t,
|
|
911
|
-
toggleExpand:
|
|
911
|
+
toggleExpand: i,
|
|
912
912
|
revealAncestors: s
|
|
913
913
|
};
|
|
914
914
|
}
|
|
915
915
|
//#endregion
|
|
916
916
|
//#region src/hooks/useIsomorphicLayoutEffect.ts
|
|
917
|
-
var
|
|
917
|
+
var vt = typeof window < "u" ? d : l, yt = {
|
|
918
918
|
scrollTop: 0,
|
|
919
919
|
scrollLeft: 0,
|
|
920
920
|
clientWidth: 0,
|
|
921
921
|
clientHeight: 0
|
|
922
922
|
};
|
|
923
|
-
function
|
|
923
|
+
function bt(e) {
|
|
924
924
|
return {
|
|
925
925
|
scrollTop: e.scrollTop,
|
|
926
926
|
scrollLeft: e.scrollLeft,
|
|
@@ -928,83 +928,83 @@ function ht(e) {
|
|
|
928
928
|
clientHeight: e.clientHeight
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function xt(e, t, n) {
|
|
932
932
|
return e.scrollTop !== t.scrollTop || e.clientHeight !== t.clientHeight ? !1 : n ? e.scrollLeft === t.scrollLeft && e.clientWidth === t.clientWidth : !0;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
let n =
|
|
934
|
+
function St(e, { trackHorizontal: t = !0 } = {}) {
|
|
935
|
+
let n = p(null), r = q(t), [i, a] = m(yt), s = o(() => {
|
|
936
936
|
n.current === null && (n.current = requestAnimationFrame(() => {
|
|
937
937
|
n.current = null;
|
|
938
938
|
let t = e.current;
|
|
939
939
|
if (!t) return;
|
|
940
|
-
let i =
|
|
941
|
-
|
|
940
|
+
let i = bt(t);
|
|
941
|
+
a((e) => xt(e, i, r.current) ? e : i);
|
|
942
942
|
}));
|
|
943
943
|
}, [e, r]);
|
|
944
|
-
return
|
|
944
|
+
return vt(() => {
|
|
945
945
|
let t = e.current;
|
|
946
|
-
t &&
|
|
947
|
-
let n =
|
|
948
|
-
return
|
|
946
|
+
t && a((e) => {
|
|
947
|
+
let n = bt(t);
|
|
948
|
+
return xt(e, n, r.current) ? e : n;
|
|
949
949
|
});
|
|
950
|
-
}, [e]),
|
|
950
|
+
}, [e]), l(() => {
|
|
951
951
|
let t = e.current;
|
|
952
952
|
if (!t || typeof ResizeObserver > "u") return;
|
|
953
|
-
let r = new ResizeObserver(
|
|
953
|
+
let r = new ResizeObserver(s);
|
|
954
954
|
return r.observe(t), () => {
|
|
955
955
|
r.disconnect(), n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
956
956
|
};
|
|
957
|
-
}, [
|
|
958
|
-
viewport:
|
|
959
|
-
scheduleMeasure:
|
|
957
|
+
}, [s, e]), {
|
|
958
|
+
viewport: i,
|
|
959
|
+
scheduleMeasure: s
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
962
|
//#endregion
|
|
963
963
|
//#region src/hooks/useScrollSync.ts
|
|
964
|
-
function
|
|
965
|
-
let e =
|
|
964
|
+
function Ct() {
|
|
965
|
+
let e = p(null), t = p(null), n = p(!1), { viewport: r, scheduleMeasure: i } = St(t);
|
|
966
966
|
return {
|
|
967
967
|
taskListRef: e,
|
|
968
968
|
gridRef: t,
|
|
969
|
-
onTaskListScroll:
|
|
970
|
-
n.current || !e.current || !t.current || (n.current = !0, t.current.scrollTop = e.current.scrollTop, n.current = !1,
|
|
971
|
-
}, [
|
|
972
|
-
onGridScroll:
|
|
973
|
-
t.current && e.current && !n.current && (n.current = !0, e.current.scrollTop = t.current.scrollTop, n.current = !1),
|
|
974
|
-
}, [
|
|
969
|
+
onTaskListScroll: o(() => {
|
|
970
|
+
n.current || !e.current || !t.current || (n.current = !0, t.current.scrollTop = e.current.scrollTop, n.current = !1, i());
|
|
971
|
+
}, [i]),
|
|
972
|
+
onGridScroll: o(() => {
|
|
973
|
+
t.current && e.current && !n.current && (n.current = !0, e.current.scrollTop = t.current.scrollTop, n.current = !1), i();
|
|
974
|
+
}, [i]),
|
|
975
975
|
viewport: r
|
|
976
976
|
};
|
|
977
977
|
}
|
|
978
978
|
//#endregion
|
|
979
979
|
//#region src/hooks/useEventCallback.ts
|
|
980
|
-
function
|
|
981
|
-
let t =
|
|
980
|
+
function wt(e) {
|
|
981
|
+
let t = p(e);
|
|
982
982
|
t.current = e;
|
|
983
|
-
let n =
|
|
983
|
+
let n = o((...e) => t.current?.(...e), []);
|
|
984
984
|
if (e) return n;
|
|
985
985
|
}
|
|
986
986
|
//#endregion
|
|
987
987
|
//#region src/core/scroll.ts
|
|
988
|
-
function
|
|
988
|
+
function Tt(e, t, n, r, i = 0) {
|
|
989
989
|
let a = n + r;
|
|
990
990
|
return e - i < n ? Math.max(0, e - i) : e + t + i > a ? e + t + i - r : n;
|
|
991
991
|
}
|
|
992
992
|
//#endregion
|
|
993
993
|
//#region src/core/barUtils.ts
|
|
994
|
-
function
|
|
995
|
-
let a = t.startDate ?? e.startDate, o = t.endDate ?? e.endDate ?? a, s =
|
|
994
|
+
function Et(e, t = {}, n, r, i = "day") {
|
|
995
|
+
let a = t.startDate ?? e.startDate, o = t.endDate ?? e.endDate ?? a, s = P(n, a, i), c = P(n, o, i);
|
|
996
996
|
return {
|
|
997
997
|
left: s * r,
|
|
998
998
|
width: (c - s) * r,
|
|
999
999
|
progress: t.progress ?? e.progress ?? 0
|
|
1000
1000
|
};
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1002
|
+
function Dt(e, t, n, r = "day") {
|
|
1003
|
+
return F(t, r, e / n);
|
|
1004
1004
|
}
|
|
1005
1005
|
//#endregion
|
|
1006
1006
|
//#region src/core/scales.ts
|
|
1007
|
-
var
|
|
1007
|
+
var Ot = [{
|
|
1008
1008
|
unit: "month",
|
|
1009
1009
|
step: 1,
|
|
1010
1010
|
format: (e) => e.toLocaleString(void 0, {
|
|
@@ -1016,91 +1016,91 @@ var Ct = [{
|
|
|
1016
1016
|
step: 1,
|
|
1017
1017
|
format: (e) => String(e.getDate())
|
|
1018
1018
|
}];
|
|
1019
|
-
function
|
|
1020
|
-
return (e ??
|
|
1019
|
+
function kt(e) {
|
|
1020
|
+
return (e ?? Ot).at(-1)?.unit ?? "day";
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return (e ??
|
|
1022
|
+
function At(e) {
|
|
1023
|
+
return (e ?? Ot).at(-1)?.step ?? 1;
|
|
1024
1024
|
}
|
|
1025
1025
|
//#endregion
|
|
1026
1026
|
//#region src/core/timeline.ts
|
|
1027
|
-
function
|
|
1028
|
-
let r =
|
|
1029
|
-
return r ?
|
|
1027
|
+
function jt(e, t, n) {
|
|
1028
|
+
let r = L(e);
|
|
1029
|
+
return r ? Mt(r.min, kt(t), n, At(t)) : null;
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return
|
|
1031
|
+
function Mt(e, t, n, r) {
|
|
1032
|
+
return M(N(M(e, t), t, -n * r), t);
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
let r =
|
|
1034
|
+
function Nt(e, t = 0, n) {
|
|
1035
|
+
let r = L(e);
|
|
1036
1036
|
if (!r) return [];
|
|
1037
|
-
let i =
|
|
1038
|
-
return
|
|
1037
|
+
let i = kt(n), a = At(n), o = Mt(r.min, i, t, a), s = N(M(r.max, i), i, t * a);
|
|
1038
|
+
return ee(o, Math.round(P(o, s, i) / a) + 1, i, a);
|
|
1039
1039
|
}
|
|
1040
1040
|
//#endregion
|
|
1041
1041
|
//#region src/hooks/useRevealTask.ts
|
|
1042
|
-
function
|
|
1043
|
-
let
|
|
1042
|
+
function Pt({ taskListRef: e, gridRef: t, tasksList: n, visibleTasks: r, rowHeight: i, colWidth: a, scales: s, padDays: c, revealAncestors: l }) {
|
|
1043
|
+
let u = q(n), f = q(r), m = p(() => {}), h = p(null), g = (n) => {
|
|
1044
1044
|
let r = e.current ?? t.current;
|
|
1045
1045
|
if (!r) return;
|
|
1046
|
-
let
|
|
1047
|
-
|
|
1046
|
+
let a = Tt(n * i, i, r.scrollTop, r.clientHeight, i);
|
|
1047
|
+
a !== r.scrollTop && (r.scrollTop = a);
|
|
1048
1048
|
}, _ = (e) => {
|
|
1049
|
-
let n = t.current, r =
|
|
1049
|
+
let n = t.current, r = jt(f.current, s, c);
|
|
1050
1050
|
if (!n || !r) return;
|
|
1051
|
-
let { left: i, width:
|
|
1052
|
-
|
|
1051
|
+
let { left: i, width: o } = Et(e, {}, r, a, kt(s)), l = Tt(i, o, n.scrollLeft, n.clientWidth, a);
|
|
1052
|
+
l !== n.scrollLeft && (n.scrollLeft = l);
|
|
1053
1053
|
};
|
|
1054
1054
|
return m.current = (e, t) => {
|
|
1055
|
-
let { vertical: n = !0, horizontal: r = !1 } = t ?? {}, i =
|
|
1055
|
+
let { vertical: n = !0, horizontal: r = !1 } = t ?? {}, i = f.current.findIndex((t) => t.id === e);
|
|
1056
1056
|
if (i < 0) {
|
|
1057
|
-
if (!
|
|
1057
|
+
if (!u.current.some((t) => t.id === e)) return;
|
|
1058
1058
|
h.current = {
|
|
1059
1059
|
id: e,
|
|
1060
1060
|
options: t
|
|
1061
|
-
},
|
|
1061
|
+
}, l(e);
|
|
1062
1062
|
return;
|
|
1063
1063
|
}
|
|
1064
|
-
n && g(i), r && _(
|
|
1065
|
-
},
|
|
1064
|
+
n && g(i), r && _(f.current[i]);
|
|
1065
|
+
}, d(() => {
|
|
1066
1066
|
let e = h.current;
|
|
1067
1067
|
e && (h.current = null, m.current(e.id, e.options));
|
|
1068
|
-
}, [r]),
|
|
1068
|
+
}, [r]), o((e, t) => m.current(e, t), []);
|
|
1069
1069
|
}
|
|
1070
1070
|
//#endregion
|
|
1071
1071
|
//#region src/hooks/useZoom.ts
|
|
1072
|
-
function
|
|
1073
|
-
let
|
|
1074
|
-
let r =
|
|
1072
|
+
function Ft({ gridRef: e, visibleTasks: t, padDays: n, levels: r, initialIndex: i }) {
|
|
1073
|
+
let a = o((e) => Math.max(0, Math.min(r.length - 1, e)), [r.length]), [s, c] = m(() => a(i)), l = q(s), u = q(t), f = q(n), h = q(r), g = p(null), _ = o((t, n) => {
|
|
1074
|
+
let r = l.current, i = a(r + n);
|
|
1075
1075
|
if (i === r) return;
|
|
1076
|
-
let
|
|
1077
|
-
|
|
1078
|
-
date:
|
|
1079
|
-
viewportOffset: t -
|
|
1080
|
-
} : g.current = null,
|
|
1076
|
+
let o = e.current, s = h.current[r], d = jt(u.current, s.scales, f.current);
|
|
1077
|
+
o && d ? g.current = {
|
|
1078
|
+
date: F(d, kt(s.scales), t / s.colWidth),
|
|
1079
|
+
viewportOffset: t - o.scrollLeft
|
|
1080
|
+
} : g.current = null, c(i);
|
|
1081
1081
|
}, [
|
|
1082
|
-
|
|
1082
|
+
a,
|
|
1083
1083
|
e,
|
|
1084
|
+
l,
|
|
1085
|
+
u,
|
|
1084
1086
|
f,
|
|
1085
|
-
p,
|
|
1086
|
-
m,
|
|
1087
1087
|
h
|
|
1088
|
-
]), v =
|
|
1088
|
+
]), v = o(() => {
|
|
1089
1089
|
let t = e.current;
|
|
1090
1090
|
return t ? t.scrollLeft + t.clientWidth / 2 : 0;
|
|
1091
|
-
}, [e]), y =
|
|
1091
|
+
}, [e]), y = o(() => _(v(), 1), [_, v]), b = o(() => _(v(), -1), [_, v]), x = o((e) => _(v(), a(e) - l.current), [
|
|
1092
1092
|
_,
|
|
1093
1093
|
v,
|
|
1094
|
-
|
|
1095
|
-
|
|
1094
|
+
a,
|
|
1095
|
+
l
|
|
1096
1096
|
]);
|
|
1097
|
-
return
|
|
1097
|
+
return d(() => {
|
|
1098
1098
|
let t = g.current;
|
|
1099
1099
|
if (t === null) return;
|
|
1100
1100
|
g.current = null;
|
|
1101
|
-
let n = e.current, r = h.current[s], i =
|
|
1101
|
+
let n = e.current, r = h.current[s], i = jt(u.current, r.scales, f.current);
|
|
1102
1102
|
if (!n || !i) return;
|
|
1103
|
-
let a =
|
|
1103
|
+
let a = kt(r.scales), o = P(i, t.date, a) * r.colWidth;
|
|
1104
1104
|
n.scrollLeft = Math.max(0, o - t.viewportOffset);
|
|
1105
1105
|
}, [s]), {
|
|
1106
1106
|
index: s,
|
|
@@ -1116,23 +1116,23 @@ function At({ gridRef: e, visibleTasks: t, padDays: n, levels: r, initialIndex:
|
|
|
1116
1116
|
}
|
|
1117
1117
|
//#endregion
|
|
1118
1118
|
//#region src/core/zoom.ts
|
|
1119
|
-
var
|
|
1119
|
+
var It = (e) => String(e).padStart(2, "0"), Lt = (e) => String(e.getFullYear()), Rt = (e) => `Q${Math.floor(e.getMonth() / 3) + 1}`, zt = (e) => e.toLocaleString(void 0, {
|
|
1120
1120
|
month: "long",
|
|
1121
1121
|
year: "numeric"
|
|
1122
|
-
}),
|
|
1122
|
+
}), Bt = (e) => e.toLocaleString(void 0, { month: "short" }), Vt = (e) => String(e.getDate()), Ht = (e) => e.toLocaleString(void 0, {
|
|
1123
1123
|
weekday: "short",
|
|
1124
1124
|
day: "numeric"
|
|
1125
|
-
}),
|
|
1125
|
+
}), Ut = [
|
|
1126
1126
|
{
|
|
1127
1127
|
colWidth: 56,
|
|
1128
1128
|
scales: [{
|
|
1129
1129
|
unit: "year",
|
|
1130
1130
|
step: 1,
|
|
1131
|
-
format:
|
|
1131
|
+
format: Lt
|
|
1132
1132
|
}, {
|
|
1133
1133
|
unit: "quarter",
|
|
1134
1134
|
step: 1,
|
|
1135
|
-
format:
|
|
1135
|
+
format: Rt
|
|
1136
1136
|
}]
|
|
1137
1137
|
},
|
|
1138
1138
|
{
|
|
@@ -1140,11 +1140,11 @@ var jt = (e) => String(e).padStart(2, "0"), Mt = (e) => String(e.getFullYear()),
|
|
|
1140
1140
|
scales: [{
|
|
1141
1141
|
unit: "year",
|
|
1142
1142
|
step: 1,
|
|
1143
|
-
format:
|
|
1143
|
+
format: Lt
|
|
1144
1144
|
}, {
|
|
1145
1145
|
unit: "month",
|
|
1146
1146
|
step: 1,
|
|
1147
|
-
format:
|
|
1147
|
+
format: Bt
|
|
1148
1148
|
}]
|
|
1149
1149
|
},
|
|
1150
1150
|
{
|
|
@@ -1152,11 +1152,11 @@ var jt = (e) => String(e).padStart(2, "0"), Mt = (e) => String(e.getFullYear()),
|
|
|
1152
1152
|
scales: [{
|
|
1153
1153
|
unit: "month",
|
|
1154
1154
|
step: 1,
|
|
1155
|
-
format:
|
|
1155
|
+
format: zt
|
|
1156
1156
|
}, {
|
|
1157
1157
|
unit: "week",
|
|
1158
1158
|
step: 1,
|
|
1159
|
-
format:
|
|
1159
|
+
format: Ht
|
|
1160
1160
|
}]
|
|
1161
1161
|
},
|
|
1162
1162
|
{
|
|
@@ -1164,11 +1164,11 @@ var jt = (e) => String(e).padStart(2, "0"), Mt = (e) => String(e.getFullYear()),
|
|
|
1164
1164
|
scales: [{
|
|
1165
1165
|
unit: "month",
|
|
1166
1166
|
step: 1,
|
|
1167
|
-
format:
|
|
1167
|
+
format: zt
|
|
1168
1168
|
}, {
|
|
1169
1169
|
unit: "day",
|
|
1170
1170
|
step: 1,
|
|
1171
|
-
format:
|
|
1171
|
+
format: Vt
|
|
1172
1172
|
}]
|
|
1173
1173
|
},
|
|
1174
1174
|
{
|
|
@@ -1176,23 +1176,23 @@ var jt = (e) => String(e).padStart(2, "0"), Mt = (e) => String(e.getFullYear()),
|
|
|
1176
1176
|
scales: [{
|
|
1177
1177
|
unit: "day",
|
|
1178
1178
|
step: 1,
|
|
1179
|
-
format:
|
|
1179
|
+
format: Ht
|
|
1180
1180
|
}, {
|
|
1181
1181
|
unit: "hour",
|
|
1182
1182
|
step: 1,
|
|
1183
|
-
format: (e) => `${
|
|
1183
|
+
format: (e) => `${It(e.getHours())}:00`
|
|
1184
1184
|
}]
|
|
1185
1185
|
}
|
|
1186
|
-
],
|
|
1187
|
-
function
|
|
1188
|
-
return e && e.length > 0 ? e : !t && n === void 0 ?
|
|
1186
|
+
], Wt = 3;
|
|
1187
|
+
function Gt(e, t, n) {
|
|
1188
|
+
return e && e.length > 0 ? e : !t && n === void 0 ? Ut : Ut.map((e, r) => r === 3 ? {
|
|
1189
1189
|
scales: t ?? e.scales,
|
|
1190
1190
|
colWidth: n ?? e.colWidth
|
|
1191
1191
|
} : e);
|
|
1192
1192
|
}
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region src/hooks/useDependencyDrag.ts
|
|
1195
|
-
var
|
|
1195
|
+
var Kt = {
|
|
1196
1196
|
end: {
|
|
1197
1197
|
start: "FS",
|
|
1198
1198
|
end: "FF"
|
|
@@ -1202,60 +1202,60 @@ var Vt = {
|
|
|
1202
1202
|
end: "SF"
|
|
1203
1203
|
}
|
|
1204
1204
|
};
|
|
1205
|
-
function
|
|
1206
|
-
let n =
|
|
1207
|
-
|
|
1205
|
+
function qt({ gridBodyRef: e, onDependencyCreate: t }) {
|
|
1206
|
+
let n = q(t), [r, i] = m(null), a = q(r), s = p(null), c = p(null), u = p(null), d = o(() => {
|
|
1207
|
+
s.current &&= (window.removeEventListener("mousemove", s.current.move), window.removeEventListener("mouseup", s.current.up), null), c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1208
1208
|
}, []);
|
|
1209
|
-
return
|
|
1209
|
+
return l(() => d, [d]), {
|
|
1210
1210
|
drag: r,
|
|
1211
|
-
startDrag:
|
|
1212
|
-
|
|
1211
|
+
startDrag: o((t) => {
|
|
1212
|
+
i(t);
|
|
1213
1213
|
let n = (t) => {
|
|
1214
|
-
|
|
1214
|
+
u.current = {
|
|
1215
1215
|
x: t.clientX,
|
|
1216
1216
|
y: t.clientY
|
|
1217
|
-
},
|
|
1218
|
-
|
|
1219
|
-
let t = e.current, n =
|
|
1217
|
+
}, c.current === null && (c.current = requestAnimationFrame(() => {
|
|
1218
|
+
c.current = null;
|
|
1219
|
+
let t = e.current, n = u.current;
|
|
1220
1220
|
if (!t || !n) return;
|
|
1221
1221
|
let r = t.getBoundingClientRect();
|
|
1222
|
-
|
|
1222
|
+
i((e) => e ? {
|
|
1223
1223
|
...e,
|
|
1224
1224
|
currentX: n.x - r.left,
|
|
1225
1225
|
currentY: n.y - r.top
|
|
1226
1226
|
} : null);
|
|
1227
1227
|
}));
|
|
1228
1228
|
}, r = () => {
|
|
1229
|
-
|
|
1229
|
+
i(null), d();
|
|
1230
1230
|
};
|
|
1231
|
-
|
|
1231
|
+
s.current = {
|
|
1232
1232
|
move: n,
|
|
1233
1233
|
up: r
|
|
1234
1234
|
}, window.addEventListener("mousemove", n), window.addEventListener("mouseup", r);
|
|
1235
|
-
}, [
|
|
1236
|
-
endDrag:
|
|
1237
|
-
let r =
|
|
1235
|
+
}, [d, e]),
|
|
1236
|
+
endDrag: o((e, t) => {
|
|
1237
|
+
let r = a.current;
|
|
1238
1238
|
if (r && e !== null && t && e !== r.fromTaskId) {
|
|
1239
|
-
let i =
|
|
1239
|
+
let i = Kt[r.handle][t];
|
|
1240
1240
|
n.current?.({
|
|
1241
1241
|
from: r.fromTaskId,
|
|
1242
1242
|
to: e,
|
|
1243
1243
|
type: i
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
|
-
|
|
1246
|
+
i(null), d();
|
|
1247
1247
|
}, [
|
|
1248
|
-
|
|
1249
|
-
|
|
1248
|
+
d,
|
|
1249
|
+
a,
|
|
1250
1250
|
n
|
|
1251
1251
|
])
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
//#endregion
|
|
1255
1255
|
//#region src/context/useGanttHandle.ts
|
|
1256
|
-
function
|
|
1257
|
-
let { createTask: t, updateTask: n, deleteTask: r, undo: i, redo: a, revealTask: o, zoomIn: s, zoomOut: c, setZoom:
|
|
1258
|
-
return
|
|
1256
|
+
function Jt(e) {
|
|
1257
|
+
let { createTask: t, updateTask: n, deleteTask: r, undo: i, redo: a, revealTask: o, zoomIn: s, zoomOut: c, setZoom: l } = e;
|
|
1258
|
+
return f(() => ({
|
|
1259
1259
|
createTask: t,
|
|
1260
1260
|
updateTask: n,
|
|
1261
1261
|
deleteTask: r,
|
|
@@ -1264,7 +1264,7 @@ function Ut(e) {
|
|
|
1264
1264
|
revealTask: o,
|
|
1265
1265
|
zoomIn: s,
|
|
1266
1266
|
zoomOut: c,
|
|
1267
|
-
setZoom:
|
|
1267
|
+
setZoom: l
|
|
1268
1268
|
}), [
|
|
1269
1269
|
t,
|
|
1270
1270
|
n,
|
|
@@ -1274,20 +1274,20 @@ function Ut(e) {
|
|
|
1274
1274
|
o,
|
|
1275
1275
|
s,
|
|
1276
1276
|
c,
|
|
1277
|
-
|
|
1277
|
+
l
|
|
1278
1278
|
]);
|
|
1279
1279
|
}
|
|
1280
1280
|
//#endregion
|
|
1281
1281
|
//#region src/context/useColumnApi.ts
|
|
1282
|
-
function
|
|
1283
|
-
return
|
|
1282
|
+
function Yt({ handle: e, readOnly: t, labels: n, schedulingContext: r, onTaskEditRef: i }) {
|
|
1283
|
+
return f(() => ({
|
|
1284
1284
|
...e,
|
|
1285
1285
|
editTask: (e) => i.current?.(e),
|
|
1286
1286
|
readOnly: t,
|
|
1287
1287
|
labels: n,
|
|
1288
1288
|
format: {
|
|
1289
|
-
endDate: (e) =>
|
|
1290
|
-
duration: (e) =>
|
|
1289
|
+
endDate: (e) => Pe(e, r),
|
|
1290
|
+
duration: (e) => Fe(e, r)
|
|
1291
1291
|
}
|
|
1292
1292
|
}), [
|
|
1293
1293
|
e,
|
|
@@ -1299,249 +1299,249 @@ function Wt({ handle: e, readOnly: t, labels: n, schedulingContext: r, onTaskEdi
|
|
|
1299
1299
|
}
|
|
1300
1300
|
//#endregion
|
|
1301
1301
|
//#region src/context/contexts.ts
|
|
1302
|
-
var
|
|
1303
|
-
function
|
|
1304
|
-
let e =
|
|
1302
|
+
var Xt = n(null);
|
|
1303
|
+
function Zt() {
|
|
1304
|
+
let e = s(Xt);
|
|
1305
1305
|
if (!e) throw Error("useGanttConfig must be used within a <GanttProvider>");
|
|
1306
1306
|
return e;
|
|
1307
1307
|
}
|
|
1308
|
-
var
|
|
1309
|
-
function
|
|
1310
|
-
return
|
|
1308
|
+
var Qt = n(Ie);
|
|
1309
|
+
function $t() {
|
|
1310
|
+
return s(Qt);
|
|
1311
1311
|
}
|
|
1312
|
-
var
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1312
|
+
var en = n(Ae);
|
|
1313
|
+
function tn() {
|
|
1314
|
+
return s(en);
|
|
1315
1315
|
}
|
|
1316
|
-
var
|
|
1317
|
-
function
|
|
1318
|
-
return
|
|
1316
|
+
var nn = n(!1);
|
|
1317
|
+
function rn() {
|
|
1318
|
+
return s(nn);
|
|
1319
1319
|
}
|
|
1320
|
-
var
|
|
1321
|
-
function
|
|
1322
|
-
let e =
|
|
1320
|
+
var an = n(null);
|
|
1321
|
+
function on() {
|
|
1322
|
+
let e = s(an);
|
|
1323
1323
|
if (!e) throw Error("useGanttTaskState must be used within a <GanttProvider>");
|
|
1324
1324
|
return e;
|
|
1325
1325
|
}
|
|
1326
|
-
var
|
|
1327
|
-
function
|
|
1328
|
-
let e =
|
|
1326
|
+
var sn = n(null);
|
|
1327
|
+
function cn() {
|
|
1328
|
+
let e = s(sn);
|
|
1329
1329
|
if (!e) throw Error("useGanttTaskActions must be used within a <GanttProvider>");
|
|
1330
1330
|
return e;
|
|
1331
1331
|
}
|
|
1332
|
-
var
|
|
1333
|
-
function
|
|
1334
|
-
return
|
|
1332
|
+
var ln = n(null);
|
|
1333
|
+
function un() {
|
|
1334
|
+
return s(ln);
|
|
1335
1335
|
}
|
|
1336
|
-
var
|
|
1337
|
-
function
|
|
1338
|
-
let e =
|
|
1336
|
+
var dn = n(null);
|
|
1337
|
+
function fn() {
|
|
1338
|
+
let e = s(dn);
|
|
1339
1339
|
if (!e) throw Error("useGanttScroll must be used within a <GanttProvider>");
|
|
1340
1340
|
return e;
|
|
1341
1341
|
}
|
|
1342
|
-
var
|
|
1343
|
-
function
|
|
1344
|
-
let e =
|
|
1342
|
+
var pn = n(null);
|
|
1343
|
+
function mn() {
|
|
1344
|
+
let e = s(pn);
|
|
1345
1345
|
if (!e) throw Error("useGanttViewport must be used within a <GanttProvider>");
|
|
1346
1346
|
return e;
|
|
1347
1347
|
}
|
|
1348
|
-
var
|
|
1349
|
-
function
|
|
1350
|
-
let e =
|
|
1348
|
+
var hn = n(null);
|
|
1349
|
+
function gn() {
|
|
1350
|
+
let e = s(hn);
|
|
1351
1351
|
if (!e) throw Error("useGanttDependency must be used within a <GanttProvider>");
|
|
1352
1352
|
return e;
|
|
1353
1353
|
}
|
|
1354
|
-
var
|
|
1355
|
-
function
|
|
1356
|
-
return
|
|
1354
|
+
var _n = n(!1);
|
|
1355
|
+
function vn() {
|
|
1356
|
+
return s(_n);
|
|
1357
1357
|
}
|
|
1358
|
-
var
|
|
1359
|
-
function
|
|
1360
|
-
return
|
|
1358
|
+
var yn = n(null);
|
|
1359
|
+
function bn() {
|
|
1360
|
+
return s(yn);
|
|
1361
1361
|
}
|
|
1362
|
-
var
|
|
1363
|
-
function
|
|
1364
|
-
let e =
|
|
1362
|
+
var xn = n(null);
|
|
1363
|
+
function Sn() {
|
|
1364
|
+
let e = s(xn);
|
|
1365
1365
|
if (!e) throw Error("useGanttZoom must be used within a <GanttProvider>");
|
|
1366
1366
|
return e;
|
|
1367
1367
|
}
|
|
1368
1368
|
//#endregion
|
|
1369
1369
|
//#region src/context/GanttProvider.tsx
|
|
1370
|
-
function
|
|
1371
|
-
let [
|
|
1372
|
-
calendar:
|
|
1370
|
+
function Cn({ tasks: e, rowHeight: t = 36, colWidth: n, height: r, scales: i, padDays: a = 1, zoomLevels: s, defaultZoomIndex: c, onZoomChange: d, zoomWheel: h = !1, zoomKeyboard: g = !1, dependencies: _ = dt, onTaskClick: y, onDependencyCreate: b, onDependencyDelete: x, onTaskCreate: S, onTaskDelete: C, onTaskEdit: w, onTasksChange: T, apiRef: E, labels: D, calendar: O, snapToWorking: k = !0, durationUnit: A = "day", readOnly: j = !1, children: M }) {
|
|
1371
|
+
let [N, P] = m(null), F = f(() => Le(D), [D]), ee = de(O), I = f(() => ({
|
|
1372
|
+
calendar: ee,
|
|
1373
1373
|
durationUnit: A,
|
|
1374
1374
|
snapToWorking: k
|
|
1375
1375
|
}), [
|
|
1376
|
-
|
|
1376
|
+
ee,
|
|
1377
1377
|
A,
|
|
1378
1378
|
k
|
|
1379
|
-
]),
|
|
1379
|
+
]), L = q(w), R = wt(y), z = wt(x), { tasksList: B, updateTask: V, commitTask: te, createTask: H, deleteTask: ne, undo: re, redo: ie, canUndo: ae, canRedo: oe } = gt(e, _, {
|
|
1380
1380
|
onTaskCreate: S,
|
|
1381
1381
|
onTaskDelete: C,
|
|
1382
1382
|
onTasksChange: T
|
|
1383
|
-
}, I), { visibleTasks: se, expandedIds:
|
|
1384
|
-
gridRef:
|
|
1383
|
+
}, I), { visibleTasks: se, expandedIds: ce, parentIds: U, toggleExpand: le, revealAncestors: ue } = _t(B), { taskListRef: fe, gridRef: pe, onTaskListScroll: me, onGridScroll: he, viewport: ge } = Ct(), _e = p(null), W = Ft({
|
|
1384
|
+
gridRef: pe,
|
|
1385
1385
|
visibleTasks: se,
|
|
1386
|
-
padDays:
|
|
1387
|
-
levels:
|
|
1388
|
-
|
|
1389
|
-
|
|
1386
|
+
padDays: a,
|
|
1387
|
+
levels: f(() => Gt(s, i, n), [
|
|
1388
|
+
s,
|
|
1389
|
+
i,
|
|
1390
1390
|
n
|
|
1391
1391
|
]),
|
|
1392
|
-
initialIndex:
|
|
1393
|
-
}),
|
|
1394
|
-
taskListRef:
|
|
1395
|
-
gridRef:
|
|
1396
|
-
tasksList:
|
|
1392
|
+
initialIndex: c ?? 3
|
|
1393
|
+
}), ve = Pt({
|
|
1394
|
+
taskListRef: fe,
|
|
1395
|
+
gridRef: pe,
|
|
1396
|
+
tasksList: B,
|
|
1397
1397
|
visibleTasks: se,
|
|
1398
1398
|
rowHeight: t,
|
|
1399
|
-
colWidth:
|
|
1400
|
-
scales:
|
|
1401
|
-
padDays:
|
|
1402
|
-
revealAncestors:
|
|
1403
|
-
}),
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
index:
|
|
1407
|
-
count:
|
|
1399
|
+
colWidth: W.level.colWidth,
|
|
1400
|
+
scales: W.level.scales,
|
|
1401
|
+
padDays: a,
|
|
1402
|
+
revealAncestors: ue
|
|
1403
|
+
}), ye = q(d);
|
|
1404
|
+
l(() => {
|
|
1405
|
+
ye.current?.({
|
|
1406
|
+
index: W.index,
|
|
1407
|
+
count: W.count
|
|
1408
1408
|
});
|
|
1409
1409
|
}, [
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1410
|
+
W.index,
|
|
1411
|
+
W.count,
|
|
1412
|
+
ye
|
|
1413
1413
|
]);
|
|
1414
|
-
let
|
|
1415
|
-
|
|
1416
|
-
}, [
|
|
1417
|
-
createTask:
|
|
1418
|
-
updateTask:
|
|
1419
|
-
deleteTask:
|
|
1420
|
-
undo:
|
|
1421
|
-
redo:
|
|
1422
|
-
revealTask:
|
|
1423
|
-
zoomIn:
|
|
1424
|
-
zoomOut:
|
|
1425
|
-
setZoom:
|
|
1414
|
+
let be = o((e, t) => {
|
|
1415
|
+
H(e, t), P(e.id), ve(e.id);
|
|
1416
|
+
}, [H, ve]), { zoomIn: xe, zoomOut: G, setZoom: Se, zoomAt: Ce } = W, we = Jt({
|
|
1417
|
+
createTask: be,
|
|
1418
|
+
updateTask: V,
|
|
1419
|
+
deleteTask: ne,
|
|
1420
|
+
undo: re,
|
|
1421
|
+
redo: ie,
|
|
1422
|
+
revealTask: ve,
|
|
1423
|
+
zoomIn: xe,
|
|
1424
|
+
zoomOut: G,
|
|
1425
|
+
setZoom: Se
|
|
1426
1426
|
});
|
|
1427
|
-
|
|
1428
|
-
let
|
|
1429
|
-
handle:
|
|
1427
|
+
u(E, () => we, [we]);
|
|
1428
|
+
let K = Yt({
|
|
1429
|
+
handle: we,
|
|
1430
1430
|
readOnly: j,
|
|
1431
|
-
labels:
|
|
1431
|
+
labels: F,
|
|
1432
1432
|
schedulingContext: I,
|
|
1433
|
-
onTaskEditRef:
|
|
1434
|
-
}), { drag:
|
|
1435
|
-
gridBodyRef:
|
|
1433
|
+
onTaskEditRef: L
|
|
1434
|
+
}), { drag: Te, startDrag: Ee, endDrag: De } = qt({
|
|
1435
|
+
gridBodyRef: _e,
|
|
1436
1436
|
onDependencyCreate: b
|
|
1437
|
-
}),
|
|
1437
|
+
}), Oe = f(() => ({
|
|
1438
1438
|
rowHeight: t,
|
|
1439
|
-
colWidth:
|
|
1440
|
-
scales:
|
|
1441
|
-
padDays:
|
|
1439
|
+
colWidth: W.level.colWidth,
|
|
1440
|
+
scales: W.level.scales,
|
|
1441
|
+
padDays: a,
|
|
1442
1442
|
height: r
|
|
1443
1443
|
}), [
|
|
1444
1444
|
t,
|
|
1445
|
-
|
|
1446
|
-
|
|
1445
|
+
W.level,
|
|
1446
|
+
a,
|
|
1447
1447
|
r
|
|
1448
|
-
]),
|
|
1449
|
-
zoomIn:
|
|
1450
|
-
zoomOut:
|
|
1451
|
-
zoomAt:
|
|
1452
|
-
wheelEnabled:
|
|
1453
|
-
keyboardEnabled:
|
|
1448
|
+
]), ke = f(() => ({
|
|
1449
|
+
zoomIn: xe,
|
|
1450
|
+
zoomOut: G,
|
|
1451
|
+
zoomAt: Ce,
|
|
1452
|
+
wheelEnabled: h,
|
|
1453
|
+
keyboardEnabled: g
|
|
1454
1454
|
}), [
|
|
1455
|
-
ye,
|
|
1456
|
-
q,
|
|
1457
1455
|
xe,
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1456
|
+
G,
|
|
1457
|
+
Ce,
|
|
1458
|
+
h,
|
|
1459
|
+
g
|
|
1460
|
+
]), Ae = f(() => ({
|
|
1461
|
+
tasksList: B,
|
|
1462
1462
|
visibleTasks: se,
|
|
1463
|
-
expandedIds:
|
|
1464
|
-
parentIds:
|
|
1465
|
-
canUndo:
|
|
1463
|
+
expandedIds: ce,
|
|
1464
|
+
parentIds: U,
|
|
1465
|
+
canUndo: ae,
|
|
1466
1466
|
canRedo: oe
|
|
1467
1467
|
}), [
|
|
1468
|
-
|
|
1468
|
+
B,
|
|
1469
1469
|
se,
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1470
|
+
ce,
|
|
1471
|
+
U,
|
|
1472
|
+
ae,
|
|
1473
1473
|
oe
|
|
1474
|
-
]),
|
|
1475
|
-
updateTask:
|
|
1476
|
-
commitTask:
|
|
1477
|
-
createTask:
|
|
1478
|
-
deleteTask:
|
|
1479
|
-
undo:
|
|
1480
|
-
redo:
|
|
1481
|
-
columnApi:
|
|
1482
|
-
setSelectedId:
|
|
1483
|
-
toggleExpand:
|
|
1484
|
-
onTaskClick:
|
|
1485
|
-
revealTask:
|
|
1474
|
+
]), je = f(() => ({
|
|
1475
|
+
updateTask: V,
|
|
1476
|
+
commitTask: te,
|
|
1477
|
+
createTask: be,
|
|
1478
|
+
deleteTask: ne,
|
|
1479
|
+
undo: re,
|
|
1480
|
+
redo: ie,
|
|
1481
|
+
columnApi: K,
|
|
1482
|
+
setSelectedId: P,
|
|
1483
|
+
toggleExpand: le,
|
|
1484
|
+
onTaskClick: R,
|
|
1485
|
+
revealTask: ve
|
|
1486
1486
|
}), [
|
|
1487
|
-
z,
|
|
1488
|
-
re,
|
|
1489
|
-
ve,
|
|
1490
1487
|
V,
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
Ce,
|
|
1494
|
-
de,
|
|
1488
|
+
te,
|
|
1489
|
+
be,
|
|
1495
1490
|
ne,
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1491
|
+
re,
|
|
1492
|
+
ie,
|
|
1493
|
+
K,
|
|
1494
|
+
le,
|
|
1495
|
+
R,
|
|
1496
|
+
ve
|
|
1497
|
+
]), Me = f(() => ({
|
|
1498
|
+
taskListRef: fe,
|
|
1499
|
+
gridRef: pe,
|
|
1500
|
+
gridBodyRef: _e,
|
|
1501
|
+
onTaskListScroll: me,
|
|
1502
|
+
onGridScroll: he
|
|
1503
1503
|
}), [
|
|
1504
|
-
|
|
1505
|
-
W,
|
|
1504
|
+
fe,
|
|
1506
1505
|
pe,
|
|
1507
|
-
me
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1506
|
+
me,
|
|
1507
|
+
he
|
|
1508
|
+
]), Ne = f(() => ({
|
|
1509
|
+
dependencies: _,
|
|
1510
|
+
onDependencyDelete: z,
|
|
1511
|
+
startDrag: Ee,
|
|
1512
|
+
endDrag: De
|
|
1513
1513
|
}), [
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1514
|
+
_,
|
|
1515
|
+
z,
|
|
1516
|
+
Ee,
|
|
1517
|
+
De
|
|
1518
1518
|
]);
|
|
1519
|
-
return /* @__PURE__ */
|
|
1520
|
-
value:
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ v(Xt.Provider, {
|
|
1520
|
+
value: Oe,
|
|
1521
|
+
children: /* @__PURE__ */ v(nn.Provider, {
|
|
1522
1522
|
value: j,
|
|
1523
|
-
children: /* @__PURE__ */
|
|
1524
|
-
value:
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1523
|
+
children: /* @__PURE__ */ v(Qt.Provider, {
|
|
1524
|
+
value: F,
|
|
1525
|
+
children: /* @__PURE__ */ v(en.Provider, {
|
|
1526
1526
|
value: I,
|
|
1527
|
-
children: /* @__PURE__ */
|
|
1528
|
-
value:
|
|
1529
|
-
children: /* @__PURE__ */
|
|
1530
|
-
value:
|
|
1531
|
-
children: /* @__PURE__ */
|
|
1532
|
-
value:
|
|
1533
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ v(xn.Provider, {
|
|
1528
|
+
value: ke,
|
|
1529
|
+
children: /* @__PURE__ */ v(dn.Provider, {
|
|
1530
|
+
value: Me,
|
|
1531
|
+
children: /* @__PURE__ */ v(sn.Provider, {
|
|
1532
|
+
value: je,
|
|
1533
|
+
children: /* @__PURE__ */ v(hn.Provider, {
|
|
1534
1534
|
value: Ne,
|
|
1535
|
-
children: /* @__PURE__ */
|
|
1536
|
-
value:
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1538
|
-
value:
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1540
|
-
value:
|
|
1541
|
-
children: /* @__PURE__ */
|
|
1542
|
-
value:
|
|
1543
|
-
children: /* @__PURE__ */
|
|
1544
|
-
value:
|
|
1535
|
+
children: /* @__PURE__ */ v(an.Provider, {
|
|
1536
|
+
value: Ae,
|
|
1537
|
+
children: /* @__PURE__ */ v(ln.Provider, {
|
|
1538
|
+
value: N,
|
|
1539
|
+
children: /* @__PURE__ */ v(_n.Provider, {
|
|
1540
|
+
value: Te !== null,
|
|
1541
|
+
children: /* @__PURE__ */ v(pn.Provider, {
|
|
1542
|
+
value: ge,
|
|
1543
|
+
children: /* @__PURE__ */ v(yn.Provider, {
|
|
1544
|
+
value: Te,
|
|
1545
1545
|
children: M
|
|
1546
1546
|
})
|
|
1547
1547
|
})
|
|
@@ -1559,48 +1559,48 @@ function vn({ tasks: e, rowHeight: t = 36, colWidth: n, height: r, scales: a, pa
|
|
|
1559
1559
|
}
|
|
1560
1560
|
//#endregion
|
|
1561
1561
|
//#region src/context/GanttSlotsContext.tsx
|
|
1562
|
-
var
|
|
1563
|
-
function
|
|
1564
|
-
return /* @__PURE__ */
|
|
1562
|
+
var wn = n({});
|
|
1563
|
+
function Tn({ value: e, children: t }) {
|
|
1564
|
+
return /* @__PURE__ */ v(wn.Provider, {
|
|
1565
1565
|
value: e,
|
|
1566
1566
|
children: t
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1570
|
-
return
|
|
1569
|
+
function J() {
|
|
1570
|
+
return s(wn);
|
|
1571
1571
|
}
|
|
1572
1572
|
//#endregion
|
|
1573
1573
|
//#region ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
1574
|
-
function
|
|
1574
|
+
function En(e) {
|
|
1575
1575
|
var t, n, r = "";
|
|
1576
1576
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1577
1577
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1578
1578
|
var i = e.length;
|
|
1579
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
1579
|
+
for (t = 0; t < i; t++) e[t] && (n = En(e[t])) && (r && (r += " "), r += n);
|
|
1580
1580
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
1581
1581
|
return r;
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1584
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
1583
|
+
function Dn() {
|
|
1584
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = En(e)) && (r && (r += " "), r += t);
|
|
1585
1585
|
return r;
|
|
1586
1586
|
}
|
|
1587
1587
|
//#endregion
|
|
1588
1588
|
//#region src/core/slots.ts
|
|
1589
|
-
function
|
|
1589
|
+
function Y(e, t, n) {
|
|
1590
1590
|
let r = typeof t == "function" ? t(n) : t;
|
|
1591
1591
|
if (!r) return e;
|
|
1592
1592
|
let { className: i, style: a, ...o } = r;
|
|
1593
1593
|
return {
|
|
1594
1594
|
...e,
|
|
1595
1595
|
...o,
|
|
1596
|
-
className:
|
|
1596
|
+
className: Dn(e.className, i),
|
|
1597
1597
|
style: {
|
|
1598
1598
|
...e.style,
|
|
1599
1599
|
...a
|
|
1600
1600
|
}
|
|
1601
1601
|
};
|
|
1602
1602
|
}
|
|
1603
|
-
var
|
|
1603
|
+
var On = {
|
|
1604
1604
|
calendar: "_calendar_1ksbu_1",
|
|
1605
1605
|
row: "_row_1ksbu_19",
|
|
1606
1606
|
cell: "_cell_1ksbu_29",
|
|
@@ -1608,10 +1608,10 @@ var Cn = {
|
|
|
1608
1608
|
};
|
|
1609
1609
|
//#endregion
|
|
1610
1610
|
//#region src/components/calendar/CalendarRow.tsx
|
|
1611
|
-
function
|
|
1611
|
+
function kn(e, t) {
|
|
1612
1612
|
let n = [];
|
|
1613
1613
|
for (let r = 0; r < e.length; r++) {
|
|
1614
|
-
let i = e[r], a =
|
|
1614
|
+
let i = e[r], a = D(i, t.unit, t.step), o = n[n.length - 1];
|
|
1615
1615
|
o && o.key === a ? o.count += 1 : n.push({
|
|
1616
1616
|
key: a,
|
|
1617
1617
|
start: i,
|
|
@@ -1621,7 +1621,7 @@ function wn(e, t) {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
return n;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function An(e, t) {
|
|
1625
1625
|
if (!t) return {
|
|
1626
1626
|
start: 0,
|
|
1627
1627
|
end: e.length
|
|
@@ -1638,25 +1638,25 @@ function Tn(e, t) {
|
|
|
1638
1638
|
end: i
|
|
1639
1639
|
};
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let
|
|
1641
|
+
function jn({ scale: e, dates: t, colWidth: n, rowHeight: r, highlightWeekends: i = !1, colRange: a, rowIndex: o, slots: s, slotProps: c }) {
|
|
1642
|
+
let l = J(), u = s ?? l.timeline?.calendarRow?.slots, { calendar: d } = tn(), p = c ?? l.timeline?.calendarRow?.slotProps, m = f(() => kn(t, e), [t, e]), h = An(m, a), g = u?.row ?? "div", _ = u?.cell ?? "div", y = {
|
|
1643
1643
|
scale: e,
|
|
1644
1644
|
colWidth: n,
|
|
1645
1645
|
rowHeight: r,
|
|
1646
1646
|
highlightWeekends: i
|
|
1647
1647
|
};
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
...
|
|
1650
|
-
className:
|
|
1648
|
+
return /* @__PURE__ */ v(g, {
|
|
1649
|
+
...Y({
|
|
1650
|
+
className: On.row,
|
|
1651
1651
|
style: { height: r },
|
|
1652
1652
|
role: "row",
|
|
1653
1653
|
"aria-rowindex": o
|
|
1654
1654
|
}, p?.row, y),
|
|
1655
|
-
children:
|
|
1656
|
-
let r = i &&
|
|
1655
|
+
children: m.slice(h.start, h.end).map((t) => {
|
|
1656
|
+
let r = i && d ? De(d, t.start, N(t.start, e.unit, e.step)) : {
|
|
1657
1657
|
isNonWorking: !1,
|
|
1658
1658
|
reason: void 0
|
|
1659
|
-
}, a =
|
|
1659
|
+
}, a = d ? r.isNonWorking : i && O(t.start), o = {
|
|
1660
1660
|
scale: e,
|
|
1661
1661
|
date: t.start,
|
|
1662
1662
|
startIndex: t.startIndex,
|
|
@@ -1666,8 +1666,8 @@ function En({ scale: e, dates: t, colWidth: n, rowHeight: r, highlightWeekends:
|
|
|
1666
1666
|
isWeekend: a,
|
|
1667
1667
|
colWidth: n
|
|
1668
1668
|
};
|
|
1669
|
-
return /* @__PURE__ */
|
|
1670
|
-
className:
|
|
1669
|
+
return /* @__PURE__ */ v(_, { ...Y({
|
|
1670
|
+
className: Dn(On.cell, a && On.cellWeekend),
|
|
1671
1671
|
style: {
|
|
1672
1672
|
left: t.startIndex * n,
|
|
1673
1673
|
width: t.count * n
|
|
@@ -1676,20 +1676,20 @@ function En({ scale: e, dates: t, colWidth: n, rowHeight: r, highlightWeekends:
|
|
|
1676
1676
|
role: "columnheader",
|
|
1677
1677
|
"aria-colindex": t.startIndex + 1,
|
|
1678
1678
|
"aria-colspan": t.count,
|
|
1679
|
-
"aria-label": e.ariaFormat ? e.ariaFormat(t.start) :
|
|
1679
|
+
"aria-label": e.ariaFormat ? e.ariaFormat(t.start) : Ve(t.start, e.unit, e.step)
|
|
1680
1680
|
}, p?.cell, o) }, t.key);
|
|
1681
1681
|
})
|
|
1682
1682
|
});
|
|
1683
1683
|
}
|
|
1684
1684
|
//#endregion
|
|
1685
1685
|
//#region src/components/calendar/Calendar.tsx
|
|
1686
|
-
function
|
|
1686
|
+
function Mn({ colWidth: e, rowHeight: t, scales: n = Ot, dates: r, colRange: i }) {
|
|
1687
1687
|
let a = r.length * e;
|
|
1688
|
-
return /* @__PURE__ */
|
|
1689
|
-
className:
|
|
1688
|
+
return /* @__PURE__ */ v("div", {
|
|
1689
|
+
className: On.calendar,
|
|
1690
1690
|
style: { width: a },
|
|
1691
1691
|
role: "rowgroup",
|
|
1692
|
-
children: n.map((n, a) => /* @__PURE__ */
|
|
1692
|
+
children: n.map((n, a) => /* @__PURE__ */ v(jn, {
|
|
1693
1693
|
scale: n,
|
|
1694
1694
|
dates: r,
|
|
1695
1695
|
colWidth: e,
|
|
@@ -1702,8 +1702,8 @@ function Dn({ colWidth: e, rowHeight: t, scales: n = Ct, dates: r, colRange: i }
|
|
|
1702
1702
|
}
|
|
1703
1703
|
//#endregion
|
|
1704
1704
|
//#region src/hooks/useAutoScroll.ts
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
1705
|
+
var Nn = 40, Pn = 14;
|
|
1706
|
+
function Fn(e) {
|
|
1707
1707
|
let t = e;
|
|
1708
1708
|
for (; t;) {
|
|
1709
1709
|
let e = getComputedStyle(t);
|
|
@@ -1712,7 +1712,7 @@ function An(e) {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
return document.scrollingElement;
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function In(e) {
|
|
1716
1716
|
if (e === document.scrollingElement) return {
|
|
1717
1717
|
left: 0,
|
|
1718
1718
|
right: window.innerWidth
|
|
@@ -1723,76 +1723,76 @@ function jn(e) {
|
|
|
1723
1723
|
right: t.right
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1727
|
-
return n < e +
|
|
1726
|
+
function Ln(e, t, n) {
|
|
1727
|
+
return n < e + Nn ? -Pn * Math.min(1, (e + Nn - n) / Nn) : n > t - Nn ? Pn * Math.min(1, (n - (t - Nn)) / Nn) : 0;
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1730
|
-
let n =
|
|
1729
|
+
function Rn({ enabled: e, onScroll: t }) {
|
|
1730
|
+
let n = p({
|
|
1731
1731
|
container: null,
|
|
1732
1732
|
scrollTarget: null,
|
|
1733
1733
|
startScrollLeft: 0,
|
|
1734
1734
|
cursorX: 0,
|
|
1735
1735
|
rafId: null
|
|
1736
|
-
}), r =
|
|
1736
|
+
}), r = p(t);
|
|
1737
1737
|
r.current = t;
|
|
1738
|
-
let
|
|
1738
|
+
let i = o(() => r.current(), []), a = o(() => {
|
|
1739
1739
|
let e = n.current;
|
|
1740
1740
|
if (!e.container) {
|
|
1741
1741
|
e.rafId = null;
|
|
1742
1742
|
return;
|
|
1743
1743
|
}
|
|
1744
|
-
let { left: t, right: r } =
|
|
1745
|
-
i !== 0 && (e.container.scrollLeft += i), e.rafId = requestAnimationFrame(
|
|
1746
|
-
}, []),
|
|
1744
|
+
let { left: t, right: r } = In(e.container), i = Ln(t, r, e.cursorX);
|
|
1745
|
+
i !== 0 && (e.container.scrollLeft += i), e.rafId = requestAnimationFrame(a);
|
|
1746
|
+
}, []), s = o(() => {
|
|
1747
1747
|
let e = n.current;
|
|
1748
|
-
e.rafId !== null && cancelAnimationFrame(e.rafId), e.scrollTarget && e.scrollTarget.removeEventListener("scroll",
|
|
1749
|
-
}, [
|
|
1748
|
+
e.rafId !== null && cancelAnimationFrame(e.rafId), e.scrollTarget && e.scrollTarget.removeEventListener("scroll", i), e.container = null, e.scrollTarget = null, e.rafId = null;
|
|
1749
|
+
}, [i]), c = o((t) => {
|
|
1750
1750
|
if (!e) return;
|
|
1751
|
-
let r = n.current,
|
|
1752
|
-
r.container =
|
|
1751
|
+
let r = n.current, o = Fn(t);
|
|
1752
|
+
r.container = o, r.startScrollLeft = o?.scrollLeft ?? 0, o && (r.scrollTarget = o === document.scrollingElement ? window : o, r.scrollTarget.addEventListener("scroll", i, { passive: !0 }), r.rafId = requestAnimationFrame(a));
|
|
1753
1753
|
}, [
|
|
1754
1754
|
e,
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
]),
|
|
1755
|
+
i,
|
|
1756
|
+
a
|
|
1757
|
+
]), u = o((e) => {
|
|
1758
1758
|
n.current.cursorX = e;
|
|
1759
|
-
}, []),
|
|
1759
|
+
}, []), d = o(() => {
|
|
1760
1760
|
let e = n.current;
|
|
1761
1761
|
return e.container ? e.container.scrollLeft - e.startScrollLeft : 0;
|
|
1762
1762
|
}, []);
|
|
1763
|
-
return
|
|
1764
|
-
start:
|
|
1765
|
-
stop:
|
|
1766
|
-
setCursorX:
|
|
1767
|
-
getScrollDelta:
|
|
1763
|
+
return l(() => s, [s]), {
|
|
1764
|
+
start: c,
|
|
1765
|
+
stop: s,
|
|
1766
|
+
setCursorX: u,
|
|
1767
|
+
getScrollDelta: d
|
|
1768
1768
|
};
|
|
1769
1769
|
}
|
|
1770
1770
|
//#endregion
|
|
1771
1771
|
//#region src/hooks/useDrag.ts
|
|
1772
|
-
function
|
|
1773
|
-
let
|
|
1774
|
-
|
|
1775
|
-
let m =
|
|
1772
|
+
function zn({ onStart: e, onDrag: t, onEnd: n, autoScroll: r = !1 }) {
|
|
1773
|
+
let i = p(!1), a = p(null), s = p(0), c = p(0), u = p(0), d = p(t), f = p(n);
|
|
1774
|
+
d.current = t, f.current = n;
|
|
1775
|
+
let m = p(() => {}), { start: h, stop: g, setCursorX: _, getScrollDelta: v } = Rn({
|
|
1776
1776
|
enabled: r,
|
|
1777
1777
|
onScroll: () => m.current()
|
|
1778
|
-
}), y =
|
|
1779
|
-
if (!
|
|
1780
|
-
let e =
|
|
1781
|
-
|
|
1778
|
+
}), y = o(() => {
|
|
1779
|
+
if (!i.current || a.current === null) return;
|
|
1780
|
+
let e = c.current - s.current + v();
|
|
1781
|
+
u.current = e, d.current(e, a.current);
|
|
1782
1782
|
}, [v]);
|
|
1783
1783
|
m.current = y;
|
|
1784
|
-
let b =
|
|
1785
|
-
|
|
1784
|
+
let b = o((t) => {
|
|
1785
|
+
a.current = e(t), s.current = t.clientX, c.current = t.clientX, u.current = 0, i.current = !0, _(t.clientX), h(t.currentTarget), t.preventDefault(), t.stopPropagation();
|
|
1786
1786
|
}, [
|
|
1787
1787
|
e,
|
|
1788
1788
|
_,
|
|
1789
1789
|
h
|
|
1790
1790
|
]);
|
|
1791
|
-
return
|
|
1791
|
+
return l(() => {
|
|
1792
1792
|
let e = (e) => {
|
|
1793
|
-
!
|
|
1793
|
+
!i.current || a.current === null || (c.current = e.clientX, _(e.clientX), y(), e.preventDefault());
|
|
1794
1794
|
}, t = () => {
|
|
1795
|
-
|
|
1795
|
+
i.current && a.current !== null && f.current?.(u.current, a.current), i.current = !1, a.current = null, g();
|
|
1796
1796
|
};
|
|
1797
1797
|
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
|
|
1798
1798
|
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), g();
|
|
@@ -1803,10 +1803,183 @@ function Pn({ onStart: e, onDrag: t, onEnd: n, autoScroll: r = !1 }) {
|
|
|
1803
1803
|
g
|
|
1804
1804
|
]), b;
|
|
1805
1805
|
}
|
|
1806
|
+
var X = {
|
|
1807
|
+
tooltip: "_tooltip_mcgy9_11",
|
|
1808
|
+
name: "_name_mcgy9_31",
|
|
1809
|
+
row: "_row_mcgy9_6",
|
|
1810
|
+
label: "_label_mcgy9_42"
|
|
1811
|
+
}, Bn = n(null), Vn = () => s(Bn);
|
|
1812
|
+
//#endregion
|
|
1813
|
+
//#region src/components/bars/barTooltip/BarTooltipRoot.tsx
|
|
1814
|
+
function Hn({ anchorRef: e, children: t }) {
|
|
1815
|
+
let [n, r] = m(!1), i = f(() => ({
|
|
1816
|
+
open: n,
|
|
1817
|
+
setOpen: r,
|
|
1818
|
+
anchorRef: e
|
|
1819
|
+
}), [n, e]);
|
|
1820
|
+
return /* @__PURE__ */ v(Bn.Provider, {
|
|
1821
|
+
value: i,
|
|
1822
|
+
children: t
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
//#endregion
|
|
1826
|
+
//#region src/components/bars/barTooltip/useTooltipPosition.ts
|
|
1827
|
+
var Un = 12, Wn = 8, Gn = null;
|
|
1828
|
+
function Kn(e, t) {
|
|
1829
|
+
Gn = {
|
|
1830
|
+
x: e,
|
|
1831
|
+
y: t
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
function qn(e, t, n, r) {
|
|
1835
|
+
let i = e + Un, a = i + t <= r - Wn;
|
|
1836
|
+
return Math.max(a ? i : e - Un - t, n + Wn);
|
|
1837
|
+
}
|
|
1838
|
+
var Jn = (e, t) => {
|
|
1839
|
+
let n = s(dn)?.gridRef, [r, i] = m({
|
|
1840
|
+
left: -9999,
|
|
1841
|
+
top: -9999
|
|
1842
|
+
}), a = c(r);
|
|
1843
|
+
return vt(() => {
|
|
1844
|
+
if (!t) return;
|
|
1845
|
+
let r = (t, r) => {
|
|
1846
|
+
let a = n?.current?.getBoundingClientRect(), o = a && a.width > 0 && a.height > 0 ? {
|
|
1847
|
+
left: a.left,
|
|
1848
|
+
top: a.top,
|
|
1849
|
+
right: a.right,
|
|
1850
|
+
bottom: a.bottom
|
|
1851
|
+
} : {
|
|
1852
|
+
left: 0,
|
|
1853
|
+
top: 0,
|
|
1854
|
+
right: window.innerWidth,
|
|
1855
|
+
bottom: window.innerHeight
|
|
1856
|
+
};
|
|
1857
|
+
if (t < o.left || t > o.right || r < o.top || r > o.bottom) return;
|
|
1858
|
+
let s = e.current?.getBoundingClientRect(), c = s?.width ?? 0, l = s?.height ?? 0, u = qn(t, c, o.left, o.right), d = qn(r, l, o.top, o.bottom);
|
|
1859
|
+
i((e) => e.left === u && e.top === d ? e : {
|
|
1860
|
+
left: u,
|
|
1861
|
+
top: d
|
|
1862
|
+
});
|
|
1863
|
+
};
|
|
1864
|
+
Gn && r(Gn.x, Gn.y);
|
|
1865
|
+
let a = (e) => r(e.clientX, e.clientY);
|
|
1866
|
+
return window.addEventListener("mousemove", a), () => {
|
|
1867
|
+
window.removeEventListener("mousemove", a);
|
|
1868
|
+
};
|
|
1869
|
+
}, [
|
|
1870
|
+
e,
|
|
1871
|
+
n,
|
|
1872
|
+
t
|
|
1873
|
+
]), a;
|
|
1874
|
+
};
|
|
1875
|
+
//#endregion
|
|
1876
|
+
//#region src/components/bars/barTooltip/BarTooltipTrigger.tsx
|
|
1877
|
+
function Yn({ children: e }) {
|
|
1878
|
+
let n = Vn(), i = n?.open ?? !1, a = n?.setOpen, o = n?.anchorRef;
|
|
1879
|
+
if (l(() => {
|
|
1880
|
+
if (!i || !a) return;
|
|
1881
|
+
let e = () => a(!1), t = (e) => {
|
|
1882
|
+
let t = o?.current, n = e.target;
|
|
1883
|
+
!t || !(n instanceof Node) || t.contains(n) || a(!1);
|
|
1884
|
+
};
|
|
1885
|
+
return document.addEventListener("scroll", e, {
|
|
1886
|
+
capture: !0,
|
|
1887
|
+
passive: !0
|
|
1888
|
+
}), document.addEventListener("mousemove", t, { passive: !0 }), () => {
|
|
1889
|
+
document.removeEventListener("scroll", e, { capture: !0 }), document.removeEventListener("mousemove", t);
|
|
1890
|
+
};
|
|
1891
|
+
}, [
|
|
1892
|
+
i,
|
|
1893
|
+
a,
|
|
1894
|
+
o
|
|
1895
|
+
]), !a || !r(e)) return e;
|
|
1896
|
+
let { onMouseEnter: s, onMouseLeave: c } = e.props;
|
|
1897
|
+
return t(e, {
|
|
1898
|
+
onMouseEnter: (e) => {
|
|
1899
|
+
s?.(e), Kn(e.clientX, e.clientY), a(!0);
|
|
1900
|
+
},
|
|
1901
|
+
onMouseLeave: (e) => {
|
|
1902
|
+
c?.(e), a(!1);
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
//#endregion
|
|
1907
|
+
//#region src/components/bars/barTooltip/BarTooltip.tsx
|
|
1908
|
+
function Xn(e) {
|
|
1909
|
+
return e ? e.toLocaleDateString(void 0, {
|
|
1910
|
+
year: "numeric",
|
|
1911
|
+
month: "short",
|
|
1912
|
+
day: "numeric"
|
|
1913
|
+
}) : "—";
|
|
1914
|
+
}
|
|
1915
|
+
function Zn({ task: e, progress: t, displayEnd: n, className: r, style: i, ...a }) {
|
|
1916
|
+
let o = p(null), s = Vn()?.open ?? !1, c = Jn(o, s);
|
|
1917
|
+
return !s || typeof document > "u" ? null : h(/* @__PURE__ */ y("div", {
|
|
1918
|
+
role: "tooltip",
|
|
1919
|
+
ref: o,
|
|
1920
|
+
className: r ? `${X.tooltip} ${r}` : X.tooltip,
|
|
1921
|
+
style: {
|
|
1922
|
+
...i,
|
|
1923
|
+
...c
|
|
1924
|
+
},
|
|
1925
|
+
...a,
|
|
1926
|
+
children: [
|
|
1927
|
+
/* @__PURE__ */ v("div", {
|
|
1928
|
+
className: X.name,
|
|
1929
|
+
children: e.name
|
|
1930
|
+
}),
|
|
1931
|
+
/* @__PURE__ */ y("div", {
|
|
1932
|
+
className: X.row,
|
|
1933
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1934
|
+
className: X.label,
|
|
1935
|
+
children: "Start"
|
|
1936
|
+
}), /* @__PURE__ */ v("span", { children: Xn(e.startDate) })]
|
|
1937
|
+
}),
|
|
1938
|
+
/* @__PURE__ */ y("div", {
|
|
1939
|
+
className: X.row,
|
|
1940
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1941
|
+
className: X.label,
|
|
1942
|
+
children: "End"
|
|
1943
|
+
}), /* @__PURE__ */ v("span", { children: Xn(n) })]
|
|
1944
|
+
}),
|
|
1945
|
+
/* @__PURE__ */ y("div", {
|
|
1946
|
+
className: X.row,
|
|
1947
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1948
|
+
className: X.label,
|
|
1949
|
+
children: "Progress"
|
|
1950
|
+
}), /* @__PURE__ */ y("span", { children: [Math.round(t), "%"] })]
|
|
1951
|
+
})
|
|
1952
|
+
]
|
|
1953
|
+
}), document.body);
|
|
1954
|
+
}
|
|
1955
|
+
function Qn({ task: e, progress: t, displayEnd: n, anchorRef: r, className: i, style: a, children: o, ...s }) {
|
|
1956
|
+
return /* @__PURE__ */ y(Hn, {
|
|
1957
|
+
anchorRef: r,
|
|
1958
|
+
children: [/* @__PURE__ */ v(Yn, { children: o }), /* @__PURE__ */ v(Zn, {
|
|
1959
|
+
task: e,
|
|
1960
|
+
progress: t,
|
|
1961
|
+
displayEnd: n,
|
|
1962
|
+
className: i,
|
|
1963
|
+
style: a,
|
|
1964
|
+
...s
|
|
1965
|
+
})]
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
//#endregion
|
|
1969
|
+
//#region src/components/bars/barTooltip/BarTooltipConsumer.tsx
|
|
1970
|
+
function $n({ children: e, tooltip: t, anchorRef: n }) {
|
|
1971
|
+
let r = J().bars?.tooltip, i = r?.slots?.tooltip;
|
|
1972
|
+
return !i || !t ? e : /* @__PURE__ */ v(i, {
|
|
1973
|
+
...Y({}, r?.slotProps?.tooltip, t),
|
|
1974
|
+
anchorRef: n,
|
|
1975
|
+
...t,
|
|
1976
|
+
children: e
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1806
1979
|
//#endregion
|
|
1807
1980
|
//#region src/components/bars/common/DraggableBar.tsx
|
|
1808
|
-
function
|
|
1809
|
-
let p = !l && !u,
|
|
1981
|
+
function er({ left: e, top: t, width: n, height: r, colWidth: i, dragAnchor: a, className: o, title: s, style: c, onMove: l, onMoveEnd: u, tooltip: d, onMouseEnter: f, onMouseLeave: m, children: h, ...g }) {
|
|
1982
|
+
let _ = p(null), y = !l && !u, b = zn({
|
|
1810
1983
|
onStart: () => ({ start: a }),
|
|
1811
1984
|
onDrag: (e, { start: t }) => l?.(t + e),
|
|
1812
1985
|
onEnd: (e, { start: t }) => {
|
|
@@ -1814,42 +1987,50 @@ function Fn({ left: e, top: t, width: n, height: r, colWidth: i, dragAnchor: a,
|
|
|
1814
1987
|
u?.(n);
|
|
1815
1988
|
},
|
|
1816
1989
|
autoScroll: !0
|
|
1817
|
-
}),
|
|
1818
|
-
return /* @__PURE__ */
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1990
|
+
}), x = !!(l || u);
|
|
1991
|
+
return /* @__PURE__ */ v($n, {
|
|
1992
|
+
tooltip: d,
|
|
1993
|
+
anchorRef: _,
|
|
1994
|
+
children: /* @__PURE__ */ v("div", {
|
|
1995
|
+
...g,
|
|
1996
|
+
ref: _,
|
|
1997
|
+
className: o,
|
|
1998
|
+
style: {
|
|
1999
|
+
left: e,
|
|
2000
|
+
top: t,
|
|
2001
|
+
width: n,
|
|
2002
|
+
height: r,
|
|
2003
|
+
cursor: y ? "default" : "move",
|
|
2004
|
+
...c
|
|
2005
|
+
},
|
|
2006
|
+
title: s,
|
|
2007
|
+
onMouseDown: x ? b : void 0,
|
|
2008
|
+
onMouseEnter: f,
|
|
2009
|
+
onMouseLeave: m,
|
|
2010
|
+
children: h
|
|
2011
|
+
})
|
|
1832
2012
|
});
|
|
1833
2013
|
}
|
|
1834
|
-
var
|
|
2014
|
+
var tr = {
|
|
1835
2015
|
milestone: "_milestone_o4jql_1",
|
|
1836
2016
|
milestoneShape: "_milestoneShape_o4jql_5"
|
|
1837
2017
|
};
|
|
1838
2018
|
//#endregion
|
|
1839
2019
|
//#region src/components/bars/milestoneBar/MilestoneBar.tsx
|
|
1840
|
-
function
|
|
1841
|
-
let
|
|
2020
|
+
function nr({ size: e, centerLeft: t, top: n, colWidth: r, title: i, a11y: a, onMove: o, onMoveEnd: s, tooltip: c, slots: l, slotProps: u }) {
|
|
2021
|
+
let d = J(), f = l ?? d.bars?.milestoneBar?.slots, p = u ?? d.bars?.milestoneBar?.slotProps, m = {
|
|
1842
2022
|
size: e,
|
|
1843
2023
|
title: i
|
|
1844
|
-
}, h =
|
|
1845
|
-
className:
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
},
|
|
1849
|
-
className:
|
|
2024
|
+
}, h = f?.root ?? er, g = f?.shape ?? "div", _ = Y({
|
|
2025
|
+
className: tr.milestone,
|
|
2026
|
+
...a,
|
|
2027
|
+
title: a ? a.title : i
|
|
2028
|
+
}, p?.root, m), y = Y({
|
|
2029
|
+
className: tr.milestoneShape,
|
|
1850
2030
|
"aria-hidden": !0
|
|
1851
|
-
},
|
|
1852
|
-
return /* @__PURE__ */
|
|
2031
|
+
}, p?.shape, m);
|
|
2032
|
+
return /* @__PURE__ */ v(h, {
|
|
2033
|
+
tooltip: c,
|
|
1853
2034
|
left: t - e / 2,
|
|
1854
2035
|
top: n,
|
|
1855
2036
|
width: e,
|
|
@@ -1859,17 +2040,17 @@ function Ln({ size: e, centerLeft: t, top: n, colWidth: r, title: i, a11y: a, on
|
|
|
1859
2040
|
onMove: o,
|
|
1860
2041
|
onMoveEnd: s,
|
|
1861
2042
|
..._,
|
|
1862
|
-
children: /* @__PURE__ */
|
|
2043
|
+
children: /* @__PURE__ */ v(g, { ...y })
|
|
1863
2044
|
});
|
|
1864
2045
|
}
|
|
1865
|
-
var
|
|
2046
|
+
var rr = {
|
|
1866
2047
|
barProgress: "_barProgress_1obm3_1",
|
|
1867
2048
|
barProgressResizeHandle: "_barProgressResizeHandle_1obm3_10"
|
|
1868
2049
|
};
|
|
1869
2050
|
//#endregion
|
|
1870
2051
|
//#region src/components/bars/progress/BarProgressResizeHandle.tsx
|
|
1871
|
-
function
|
|
1872
|
-
let o =
|
|
2052
|
+
function ir({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, slotProps: a }) {
|
|
2053
|
+
let o = J(), s = i ?? o.bars?.barProgressResizeHandle?.slots, c = a ?? o.bars?.barProgressResizeHandle?.slotProps, l = (e, t) => Math.min(Math.max(0, t + e), r), u = zn({
|
|
1873
2054
|
onStart: () => ({ startWidth: e }),
|
|
1874
2055
|
onDrag: (e, { startWidth: n }) => t(l(e, n)),
|
|
1875
2056
|
onEnd: (e, { startWidth: t }) => n?.(l(e, t))
|
|
@@ -1877,8 +2058,8 @@ function zn({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, s
|
|
|
1877
2058
|
width: e,
|
|
1878
2059
|
parentWidth: r
|
|
1879
2060
|
};
|
|
1880
|
-
return /* @__PURE__ */
|
|
1881
|
-
className:
|
|
2061
|
+
return /* @__PURE__ */ v(s?.root ?? "div", { ...Y({
|
|
2062
|
+
className: rr.barProgressResizeHandle,
|
|
1882
2063
|
"aria-hidden": !0,
|
|
1883
2064
|
tabIndex: -1,
|
|
1884
2065
|
onMouseDown: u
|
|
@@ -1886,21 +2067,21 @@ function zn({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, s
|
|
|
1886
2067
|
}
|
|
1887
2068
|
//#endregion
|
|
1888
2069
|
//#region src/components/bars/progress/BarProgress.tsx
|
|
1889
|
-
function
|
|
1890
|
-
let s =
|
|
2070
|
+
function ar({ progress: e, width: t, height: n, onProgressChange: r, onProgressEnd: i, slots: a, slotProps: o }) {
|
|
2071
|
+
let s = J(), c = a ?? s.bars?.barProgress?.slots, l = o ?? s.bars?.barProgress?.slotProps, u = e / 100 * t, d = (e) => e / t * 100, f = {
|
|
1891
2072
|
progress: e,
|
|
1892
2073
|
width: u,
|
|
1893
2074
|
height: n
|
|
1894
2075
|
};
|
|
1895
|
-
return /* @__PURE__ */
|
|
1896
|
-
...
|
|
1897
|
-
className:
|
|
2076
|
+
return /* @__PURE__ */ v(c?.root ?? "div", {
|
|
2077
|
+
...Y({
|
|
2078
|
+
className: rr.barProgress,
|
|
1898
2079
|
style: {
|
|
1899
2080
|
width: u,
|
|
1900
2081
|
height: n
|
|
1901
2082
|
}
|
|
1902
2083
|
}, l?.root, f),
|
|
1903
|
-
children: r && /* @__PURE__ */
|
|
2084
|
+
children: r && /* @__PURE__ */ v(ir, {
|
|
1904
2085
|
width: u,
|
|
1905
2086
|
parentWidth: t,
|
|
1906
2087
|
onResize: (e) => r(d(e)),
|
|
@@ -1908,31 +2089,32 @@ function Bn({ progress: e, width: t, height: n, onProgressChange: r, onProgressE
|
|
|
1908
2089
|
})
|
|
1909
2090
|
});
|
|
1910
2091
|
}
|
|
1911
|
-
var
|
|
2092
|
+
var or = {
|
|
1912
2093
|
project: "_project_927ph_1",
|
|
1913
2094
|
projectInner: "_projectInner_927ph_10",
|
|
1914
2095
|
projectContent: "_projectContent_927ph_16"
|
|
1915
2096
|
};
|
|
1916
2097
|
//#endregion
|
|
1917
2098
|
//#region src/components/bars/projectBar/ProjectBar.tsx
|
|
1918
|
-
function
|
|
1919
|
-
let
|
|
2099
|
+
function sr({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y: o, progress: s, onProgressChange: c, onProgressEnd: l, onMove: u, onMoveEnd: d, tooltip: f, slots: p, slotProps: m }) {
|
|
2100
|
+
let h = J(), g = p ?? h.bars?.projectBar?.slots, _ = m ?? h.bars?.projectBar?.slotProps, b = {
|
|
1920
2101
|
width: e,
|
|
1921
2102
|
height: t,
|
|
1922
2103
|
progress: s,
|
|
1923
2104
|
title: a
|
|
1924
|
-
},
|
|
1925
|
-
className:
|
|
2105
|
+
}, x = g?.root ?? er, S = g?.inner ?? "div", C = g?.label ?? "div", w = Y({
|
|
2106
|
+
className: or.project,
|
|
1926
2107
|
style: { lineHeight: `${t}px` },
|
|
1927
2108
|
...o
|
|
1928
|
-
},
|
|
1929
|
-
className:
|
|
2109
|
+
}, _?.root, b), T = Y({
|
|
2110
|
+
className: or.projectInner,
|
|
1930
2111
|
"aria-hidden": !0
|
|
1931
|
-
},
|
|
1932
|
-
className:
|
|
2112
|
+
}, _?.inner, b), E = Y({
|
|
2113
|
+
className: or.projectContent,
|
|
1933
2114
|
children: a
|
|
1934
|
-
},
|
|
1935
|
-
return /* @__PURE__ */
|
|
2115
|
+
}, _?.label, b);
|
|
2116
|
+
return /* @__PURE__ */ v(x, {
|
|
2117
|
+
tooltip: f,
|
|
1936
2118
|
left: n,
|
|
1937
2119
|
top: r,
|
|
1938
2120
|
width: e,
|
|
@@ -1941,20 +2123,20 @@ function Hn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
1941
2123
|
dragAnchor: n,
|
|
1942
2124
|
onMove: u,
|
|
1943
2125
|
onMoveEnd: d,
|
|
1944
|
-
...
|
|
1945
|
-
children: /* @__PURE__ */
|
|
1946
|
-
...
|
|
1947
|
-
children: [/* @__PURE__ */
|
|
2126
|
+
...w,
|
|
2127
|
+
children: /* @__PURE__ */ y(S, {
|
|
2128
|
+
...T,
|
|
2129
|
+
children: [/* @__PURE__ */ v(ar, {
|
|
1948
2130
|
width: e,
|
|
1949
2131
|
height: t,
|
|
1950
2132
|
progress: s,
|
|
1951
2133
|
onProgressChange: c,
|
|
1952
2134
|
onProgressEnd: l
|
|
1953
|
-
}), /* @__PURE__ */
|
|
2135
|
+
}), /* @__PURE__ */ v(C, { ...E })]
|
|
1954
2136
|
})
|
|
1955
2137
|
});
|
|
1956
2138
|
}
|
|
1957
|
-
var
|
|
2139
|
+
var cr = {
|
|
1958
2140
|
task: "_task_18g5p_1",
|
|
1959
2141
|
taskInner: "_taskInner_18g5p_9",
|
|
1960
2142
|
taskContent: "_taskContent_18g5p_15",
|
|
@@ -1964,8 +2146,8 @@ var Un = {
|
|
|
1964
2146
|
};
|
|
1965
2147
|
//#endregion
|
|
1966
2148
|
//#region src/components/bars/taskBar/TaskResizer.tsx
|
|
1967
|
-
function
|
|
1968
|
-
let s =
|
|
2149
|
+
function lr({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots: a, slotProps: o }) {
|
|
2150
|
+
let s = J(), c = a ?? s.bars?.taskResizer?.slots, l = o ?? s.bars?.taskResizer?.slotProps, u = zn({
|
|
1969
2151
|
onStart: () => ({
|
|
1970
2152
|
startWidth: e,
|
|
1971
2153
|
startLeft: t
|
|
@@ -1978,7 +2160,7 @@ function Wn({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots
|
|
|
1978
2160
|
let a = r + Math.min(e, t);
|
|
1979
2161
|
i("start", Math.round(a / n) * n);
|
|
1980
2162
|
}
|
|
1981
|
-
}), d =
|
|
2163
|
+
}), d = zn({
|
|
1982
2164
|
onStart: () => ({
|
|
1983
2165
|
startWidth: e,
|
|
1984
2166
|
startLeft: t
|
|
@@ -1993,42 +2175,43 @@ function Wn({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots
|
|
|
1993
2175
|
}), f = {
|
|
1994
2176
|
width: e,
|
|
1995
2177
|
left: t
|
|
1996
|
-
},
|
|
2178
|
+
}, p = c?.startHandle ?? "button", m = c?.endHandle ?? "button", h = Y({
|
|
1997
2179
|
type: "button",
|
|
1998
2180
|
"aria-hidden": !0,
|
|
1999
2181
|
tabIndex: -1,
|
|
2000
|
-
className:
|
|
2182
|
+
className: Dn(cr.resizer, cr.startResizer),
|
|
2001
2183
|
onMouseDown: u
|
|
2002
|
-
}, l?.startHandle, f),
|
|
2184
|
+
}, l?.startHandle, f), g = Y({
|
|
2003
2185
|
type: "button",
|
|
2004
2186
|
"aria-hidden": !0,
|
|
2005
2187
|
tabIndex: -1,
|
|
2006
|
-
className:
|
|
2188
|
+
className: Dn(cr.resizer, cr.endResizer),
|
|
2007
2189
|
onMouseDown: d
|
|
2008
2190
|
}, l?.endHandle, f);
|
|
2009
|
-
return /* @__PURE__ */
|
|
2191
|
+
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(p, { ...h }), /* @__PURE__ */ v(m, { ...g })] });
|
|
2010
2192
|
}
|
|
2011
2193
|
//#endregion
|
|
2012
2194
|
//#region src/components/bars/taskBar/TaskBar.tsx
|
|
2013
|
-
function
|
|
2014
|
-
let
|
|
2195
|
+
function ur({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y: o, progress: s = 30, onProgressChange: c, onProgressEnd: l, onResize: u, onResizeEnd: d, onMove: f, onMoveEnd: p, tooltip: m, slots: h, slotProps: g }) {
|
|
2196
|
+
let _ = J(), b = h ?? _.bars?.taskBar?.slots, x = g ?? _.bars?.taskBar?.slotProps, S = {
|
|
2015
2197
|
width: e,
|
|
2016
2198
|
height: t,
|
|
2017
2199
|
progress: s,
|
|
2018
2200
|
title: a
|
|
2019
|
-
},
|
|
2020
|
-
className: `${
|
|
2201
|
+
}, C = b?.root ?? er, w = b?.inner ?? "div", T = b?.label ?? "div", E = Y({
|
|
2202
|
+
className: `${cr.task} am-gantt-bar-task`,
|
|
2021
2203
|
style: { lineHeight: `${t}px` },
|
|
2022
2204
|
...o
|
|
2023
|
-
},
|
|
2024
|
-
className:
|
|
2205
|
+
}, x?.root, S), D = Y({
|
|
2206
|
+
className: cr.taskInner,
|
|
2025
2207
|
"aria-hidden": !0
|
|
2026
|
-
},
|
|
2027
|
-
className:
|
|
2028
|
-
title:
|
|
2208
|
+
}, x?.inner, S), O = Y({
|
|
2209
|
+
className: cr.taskContent,
|
|
2210
|
+
title: o?.title,
|
|
2029
2211
|
children: a
|
|
2030
|
-
},
|
|
2031
|
-
return /* @__PURE__ */
|
|
2212
|
+
}, x?.label, S);
|
|
2213
|
+
return /* @__PURE__ */ v(C, {
|
|
2214
|
+
tooltip: m,
|
|
2032
2215
|
left: n,
|
|
2033
2216
|
top: r,
|
|
2034
2217
|
width: e,
|
|
@@ -2037,19 +2220,19 @@ function Gn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
2037
2220
|
dragAnchor: n,
|
|
2038
2221
|
onMove: f,
|
|
2039
2222
|
onMoveEnd: p,
|
|
2040
|
-
...
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2042
|
-
...
|
|
2223
|
+
...E,
|
|
2224
|
+
children: /* @__PURE__ */ y(w, {
|
|
2225
|
+
...D,
|
|
2043
2226
|
children: [
|
|
2044
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ v(ar, {
|
|
2045
2228
|
width: e,
|
|
2046
2229
|
height: t,
|
|
2047
2230
|
progress: s,
|
|
2048
2231
|
onProgressChange: c,
|
|
2049
2232
|
onProgressEnd: l
|
|
2050
2233
|
}),
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
u && d && /* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ v(T, { ...O }),
|
|
2235
|
+
u && d && /* @__PURE__ */ v(lr, {
|
|
2053
2236
|
width: e,
|
|
2054
2237
|
left: n,
|
|
2055
2238
|
colWidth: i,
|
|
@@ -2060,13 +2243,13 @@ function Gn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
2060
2243
|
})
|
|
2061
2244
|
});
|
|
2062
2245
|
}
|
|
2063
|
-
var
|
|
2246
|
+
var dr = {
|
|
2064
2247
|
handle: "_handle_fw6gu_1",
|
|
2065
2248
|
visible: "_visible_fw6gu_18"
|
|
2066
|
-
},
|
|
2067
|
-
function
|
|
2068
|
-
let s =
|
|
2069
|
-
let n =
|
|
2249
|
+
}, fr = 10 / 2;
|
|
2250
|
+
function pr({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots: a, slotProps: o }) {
|
|
2251
|
+
let s = J(), c = a ?? s.bars?.connectorHandles?.slots, l = o ?? s.bars?.connectorHandles?.slotProps, { startDrag: u, endDrag: d } = gn(), f = vn(), { gridBodyRef: p } = fn(), m = (e, t) => {
|
|
2252
|
+
let n = p.current?.getBoundingClientRect();
|
|
2070
2253
|
if (!n) return {
|
|
2071
2254
|
x: 0,
|
|
2072
2255
|
y: 0
|
|
@@ -2076,9 +2259,9 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2076
2259
|
x: r.left + r.width / 2 - n.left,
|
|
2077
2260
|
y: r.top + r.height / 2 - n.top
|
|
2078
2261
|
};
|
|
2079
|
-
},
|
|
2262
|
+
}, h = (t, n) => {
|
|
2080
2263
|
t.stopPropagation(), t.preventDefault();
|
|
2081
|
-
let { x: r, y: i } =
|
|
2264
|
+
let { x: r, y: i } = m(t, n);
|
|
2082
2265
|
u({
|
|
2083
2266
|
fromTaskId: e,
|
|
2084
2267
|
handle: n,
|
|
@@ -2087,7 +2270,7 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2087
2270
|
currentX: r,
|
|
2088
2271
|
currentY: i
|
|
2089
2272
|
});
|
|
2090
|
-
},
|
|
2273
|
+
}, g = (t, n) => {
|
|
2091
2274
|
f && (t.stopPropagation(), d(e, n));
|
|
2092
2275
|
}, b = {
|
|
2093
2276
|
taskId: e,
|
|
@@ -2096,133 +2279,140 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2096
2279
|
barCenterY: r,
|
|
2097
2280
|
show: i,
|
|
2098
2281
|
isDragging: f
|
|
2099
|
-
}, x = c?.startHandle ?? "div", S = c?.endHandle ?? "div", C = i || f, w =
|
|
2282
|
+
}, x = c?.startHandle ?? "div", S = c?.endHandle ?? "div", C = i || f, w = Y({
|
|
2100
2283
|
"aria-hidden": !0,
|
|
2101
2284
|
tabIndex: -1,
|
|
2102
|
-
className:
|
|
2285
|
+
className: Dn(dr.handle, C && dr.visible),
|
|
2103
2286
|
style: {
|
|
2104
2287
|
left: t - 10,
|
|
2105
|
-
top: r -
|
|
2288
|
+
top: r - fr
|
|
2106
2289
|
},
|
|
2107
|
-
onMouseDown: (e) =>
|
|
2108
|
-
onMouseUp: (e) =>
|
|
2109
|
-
}, l?.startHandle, b), T =
|
|
2290
|
+
onMouseDown: (e) => h(e, "start"),
|
|
2291
|
+
onMouseUp: (e) => g(e, "start")
|
|
2292
|
+
}, l?.startHandle, b), T = Y({
|
|
2110
2293
|
"aria-hidden": !0,
|
|
2111
2294
|
tabIndex: -1,
|
|
2112
|
-
className:
|
|
2295
|
+
className: Dn(dr.handle, C && dr.visible),
|
|
2113
2296
|
style: {
|
|
2114
2297
|
left: t + n,
|
|
2115
|
-
top: r -
|
|
2298
|
+
top: r - fr
|
|
2116
2299
|
},
|
|
2117
|
-
onMouseDown: (e) =>
|
|
2118
|
-
onMouseUp: (e) =>
|
|
2300
|
+
onMouseDown: (e) => h(e, "end"),
|
|
2301
|
+
onMouseUp: (e) => g(e, "end")
|
|
2119
2302
|
}, l?.endHandle, b);
|
|
2120
|
-
return /* @__PURE__ */
|
|
2121
|
-
}
|
|
2122
|
-
var
|
|
2123
|
-
let
|
|
2124
|
-
startDate:
|
|
2125
|
-
endDate:
|
|
2126
|
-
}),
|
|
2127
|
-
startDate:
|
|
2128
|
-
endDate:
|
|
2129
|
-
}),
|
|
2303
|
+
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(x, { ...w }), /* @__PURE__ */ v(S, { ...T })] });
|
|
2304
|
+
}
|
|
2305
|
+
var mr = { row: "_row_1jios_13" }, hr = i(function({ task: e, index: t, origin: n, colWidth: r, rowHeight: i, unit: o, override: s, onOverride: c, onUpdate: l, onCommit: u, onTaskClick: d, rowIndexOffset: f }) {
|
|
2306
|
+
let p = $t(), h = rn(), g = un() === e.id, _ = tn(), b = J().bars?.tooltip?.slots?.tooltip, { left: x, width: S, progress: C } = Et(e, s || {}, n, r, o), w = t * i, T = x, E = i - 12, D = 6 + E / 2, O = e.type === "milestone", k = O ? T - E / 2 : T, A = O ? E - 1 : S, [j, M] = m(!1), N = (e) => ({
|
|
2307
|
+
startDate: Dt(e, n, r, o),
|
|
2308
|
+
endDate: Dt(e + S, n, r, o)
|
|
2309
|
+
}), P = (e, t) => ({
|
|
2310
|
+
startDate: Dt(t, n, r, o),
|
|
2311
|
+
endDate: Dt(t + e, n, r, o)
|
|
2312
|
+
}), F = (t) => {
|
|
2130
2313
|
c(e.id, t);
|
|
2131
|
-
},
|
|
2132
|
-
|
|
2314
|
+
}, ee = (e, t) => {
|
|
2315
|
+
a(() => {
|
|
2133
2316
|
l(e, t), c(e, null);
|
|
2134
2317
|
});
|
|
2135
|
-
},
|
|
2136
|
-
|
|
2318
|
+
}, I = (t) => {
|
|
2319
|
+
a(() => {
|
|
2137
2320
|
u(e.id, t), c(e.id, null);
|
|
2138
2321
|
});
|
|
2139
|
-
},
|
|
2322
|
+
}, L = (e) => ({
|
|
2140
2323
|
kind: "move",
|
|
2141
|
-
startDate:
|
|
2142
|
-
}),
|
|
2143
|
-
onMove: (e) =>
|
|
2144
|
-
onMoveEnd: (e) =>
|
|
2145
|
-
},
|
|
2146
|
-
onProgressChange: (e) =>
|
|
2147
|
-
onProgressEnd: (t) =>
|
|
2148
|
-
},
|
|
2149
|
-
onResize: (e, t) =>
|
|
2150
|
-
onResizeEnd: (e, t) =>
|
|
2324
|
+
startDate: Dt(e, n, r, o)
|
|
2325
|
+
}), R = h ? {} : {
|
|
2326
|
+
onMove: (e) => F(N(e)),
|
|
2327
|
+
onMoveEnd: (e) => I(L(e))
|
|
2328
|
+
}, z = h ? {} : {
|
|
2329
|
+
onProgressChange: (e) => F({ progress: e }),
|
|
2330
|
+
onProgressEnd: (t) => ee(e.id, { progress: t })
|
|
2331
|
+
}, B = h ? {} : {
|
|
2332
|
+
onResize: (e, t) => F(P(e, t)),
|
|
2333
|
+
onResizeEnd: (e, t) => I(e === "start" ? {
|
|
2151
2334
|
kind: "resizeStart",
|
|
2152
|
-
startDate:
|
|
2335
|
+
startDate: Dt(t, n, r, o)
|
|
2153
2336
|
} : {
|
|
2154
2337
|
kind: "resizeEnd",
|
|
2155
|
-
endDate:
|
|
2338
|
+
endDate: Dt(t, n, r, o)
|
|
2156
2339
|
})
|
|
2157
|
-
},
|
|
2340
|
+
}, V = {
|
|
2158
2341
|
role: "gridcell",
|
|
2159
|
-
"aria-colindex": Math.max(1, Math.floor(
|
|
2160
|
-
"aria-colspan": Math.max(1, Math.round(
|
|
2161
|
-
"aria-label":
|
|
2162
|
-
"aria-selected":
|
|
2163
|
-
title: e.name
|
|
2342
|
+
"aria-colindex": Math.max(1, Math.floor(T / r) + 1),
|
|
2343
|
+
"aria-colspan": Math.max(1, Math.round(S / r)),
|
|
2344
|
+
"aria-label": p.bar(e, { progress: C }),
|
|
2345
|
+
"aria-selected": g || void 0,
|
|
2346
|
+
title: b ? void 0 : e.name
|
|
2347
|
+
}, te = {
|
|
2348
|
+
task: e,
|
|
2349
|
+
progress: C,
|
|
2350
|
+
displayEnd: Pe(e, _)
|
|
2164
2351
|
};
|
|
2165
|
-
return /* @__PURE__ */
|
|
2166
|
-
className:
|
|
2352
|
+
return /* @__PURE__ */ y("div", {
|
|
2353
|
+
className: mr.row,
|
|
2167
2354
|
style: {
|
|
2168
|
-
top:
|
|
2169
|
-
height:
|
|
2355
|
+
top: w,
|
|
2356
|
+
height: i
|
|
2170
2357
|
},
|
|
2171
|
-
onClick:
|
|
2172
|
-
onMouseEnter: () =>
|
|
2173
|
-
onMouseLeave: () =>
|
|
2358
|
+
onClick: d ? () => d(e) : void 0,
|
|
2359
|
+
onMouseEnter: () => M(!0),
|
|
2360
|
+
onMouseLeave: () => M(!1),
|
|
2174
2361
|
role: "row",
|
|
2175
|
-
"aria-rowindex":
|
|
2362
|
+
"aria-rowindex": f + t + 1,
|
|
2176
2363
|
children: [
|
|
2177
|
-
!
|
|
2364
|
+
!h && /* @__PURE__ */ v(pr, {
|
|
2178
2365
|
taskId: e.id,
|
|
2179
|
-
barLeft:
|
|
2180
|
-
barWidth:
|
|
2181
|
-
barCenterY:
|
|
2182
|
-
show:
|
|
2366
|
+
barLeft: k,
|
|
2367
|
+
barWidth: A,
|
|
2368
|
+
barCenterY: D,
|
|
2369
|
+
show: j
|
|
2183
2370
|
}),
|
|
2184
|
-
e.type === "milestone" && /* @__PURE__ */
|
|
2185
|
-
|
|
2186
|
-
|
|
2371
|
+
e.type === "milestone" && /* @__PURE__ */ v(nr, {
|
|
2372
|
+
tooltip: te,
|
|
2373
|
+
size: E,
|
|
2374
|
+
centerLeft: T,
|
|
2187
2375
|
top: 6,
|
|
2188
|
-
colWidth:
|
|
2376
|
+
colWidth: r,
|
|
2189
2377
|
title: e.name,
|
|
2190
|
-
a11y:
|
|
2191
|
-
...
|
|
2378
|
+
a11y: V,
|
|
2379
|
+
...R
|
|
2192
2380
|
}),
|
|
2193
|
-
e.type === "summary" && /* @__PURE__ */
|
|
2194
|
-
|
|
2381
|
+
e.type === "summary" && /* @__PURE__ */ v(sr, {
|
|
2382
|
+
tooltip: te,
|
|
2383
|
+
left: T,
|
|
2195
2384
|
top: 6,
|
|
2196
|
-
width:
|
|
2197
|
-
height:
|
|
2198
|
-
colWidth:
|
|
2385
|
+
width: S,
|
|
2386
|
+
height: E,
|
|
2387
|
+
colWidth: r,
|
|
2199
2388
|
title: e.name,
|
|
2200
|
-
a11y:
|
|
2201
|
-
progress:
|
|
2202
|
-
...
|
|
2203
|
-
...
|
|
2389
|
+
a11y: V,
|
|
2390
|
+
progress: C,
|
|
2391
|
+
...z,
|
|
2392
|
+
...R
|
|
2204
2393
|
}),
|
|
2205
|
-
e.type === "task" || !e.type ? /* @__PURE__ */
|
|
2206
|
-
|
|
2394
|
+
e.type === "task" || !e.type ? /* @__PURE__ */ v(ur, {
|
|
2395
|
+
tooltip: te,
|
|
2396
|
+
left: T,
|
|
2207
2397
|
top: 6,
|
|
2208
|
-
width:
|
|
2209
|
-
height:
|
|
2210
|
-
colWidth:
|
|
2398
|
+
width: S,
|
|
2399
|
+
height: E,
|
|
2400
|
+
colWidth: r,
|
|
2211
2401
|
title: e.name,
|
|
2212
|
-
a11y:
|
|
2213
|
-
progress:
|
|
2214
|
-
...
|
|
2215
|
-
...
|
|
2216
|
-
...
|
|
2402
|
+
a11y: V,
|
|
2403
|
+
progress: C,
|
|
2404
|
+
...z,
|
|
2405
|
+
...R,
|
|
2406
|
+
...B
|
|
2217
2407
|
}) : null
|
|
2218
2408
|
]
|
|
2219
2409
|
});
|
|
2220
2410
|
});
|
|
2221
|
-
|
|
2411
|
+
hr.displayName = "Row";
|
|
2222
2412
|
//#endregion
|
|
2223
2413
|
//#region src/components/dependency-links/geometry.ts
|
|
2224
|
-
var
|
|
2225
|
-
function
|
|
2414
|
+
var gr = 12, _r = {};
|
|
2415
|
+
function vr(e) {
|
|
2226
2416
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
2227
2417
|
for (let a of e) a.x < t && (t = a.x), a.x > r && (r = a.x), a.y < n && (n = a.y), a.y > i && (i = a.y);
|
|
2228
2418
|
return {
|
|
@@ -2232,7 +2422,7 @@ function $n(e) {
|
|
|
2232
2422
|
maxY: i
|
|
2233
2423
|
};
|
|
2234
2424
|
}
|
|
2235
|
-
function
|
|
2425
|
+
function yr(e) {
|
|
2236
2426
|
if (e.length < 2) return e[0] ?? {
|
|
2237
2427
|
x: 0,
|
|
2238
2428
|
y: 0
|
|
@@ -2243,8 +2433,8 @@ function er(e) {
|
|
|
2243
2433
|
y: (n.y + r.y) / 2
|
|
2244
2434
|
};
|
|
2245
2435
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let { left: s, width: c } =
|
|
2436
|
+
function br(e, t, n, { origin: r, colWidth: i, rowHeight: a, unit: o }) {
|
|
2437
|
+
let { left: s, width: c } = Et(e, t, r, i, o);
|
|
2248
2438
|
if (e.type === "milestone") {
|
|
2249
2439
|
let t = (a - 12) / 2;
|
|
2250
2440
|
return {
|
|
@@ -2261,13 +2451,13 @@ function tr(e, t, n, { origin: r, colWidth: i, rowHeight: a, unit: o }) {
|
|
|
2261
2451
|
task: e
|
|
2262
2452
|
};
|
|
2263
2453
|
}
|
|
2264
|
-
function
|
|
2454
|
+
function xr(e, t) {
|
|
2265
2455
|
let n = /* @__PURE__ */ new Map(), { rowHeight: r } = t;
|
|
2266
2456
|
return e.forEach((e, i) => {
|
|
2267
|
-
n.set(e.id,
|
|
2457
|
+
n.set(e.id, br(e, _r, i * r + r / 2, t));
|
|
2268
2458
|
}), n;
|
|
2269
2459
|
}
|
|
2270
|
-
function
|
|
2460
|
+
function Sr(e, t) {
|
|
2271
2461
|
let n = (e.x + t.x) / 2;
|
|
2272
2462
|
return [
|
|
2273
2463
|
e,
|
|
@@ -2282,8 +2472,8 @@ function rr(e, t) {
|
|
|
2282
2472
|
t
|
|
2283
2473
|
];
|
|
2284
2474
|
}
|
|
2285
|
-
function
|
|
2286
|
-
let i = e.x + n *
|
|
2475
|
+
function Cr(e, t, n, r) {
|
|
2476
|
+
let i = e.x + n * gr, a = t.x - r * gr, o = (e.y + t.y) / 2;
|
|
2287
2477
|
return [
|
|
2288
2478
|
e,
|
|
2289
2479
|
{
|
|
@@ -2305,7 +2495,7 @@ function ir(e, t, n, r) {
|
|
|
2305
2495
|
t
|
|
2306
2496
|
];
|
|
2307
2497
|
}
|
|
2308
|
-
function
|
|
2498
|
+
function wr(e, t, n) {
|
|
2309
2499
|
return [
|
|
2310
2500
|
e,
|
|
2311
2501
|
{
|
|
@@ -2319,7 +2509,7 @@ function ar(e, t, n) {
|
|
|
2319
2509
|
t
|
|
2320
2510
|
];
|
|
2321
2511
|
}
|
|
2322
|
-
function
|
|
2512
|
+
function Tr(e, t, n) {
|
|
2323
2513
|
let r = t.centerY, i = n.centerY;
|
|
2324
2514
|
switch (e) {
|
|
2325
2515
|
case "FS": {
|
|
@@ -2330,22 +2520,22 @@ function or(e, t, n) {
|
|
|
2330
2520
|
x: n.startX,
|
|
2331
2521
|
y: i
|
|
2332
2522
|
};
|
|
2333
|
-
return n.startX >= t.endX + 2 *
|
|
2523
|
+
return n.startX >= t.endX + 2 * gr ? Sr(e, a) : Cr(e, a, 1, 1);
|
|
2334
2524
|
}
|
|
2335
|
-
case "SS": return
|
|
2525
|
+
case "SS": return wr({
|
|
2336
2526
|
x: t.startX,
|
|
2337
2527
|
y: r
|
|
2338
2528
|
}, {
|
|
2339
2529
|
x: n.startX,
|
|
2340
2530
|
y: i
|
|
2341
|
-
}, Math.min(t.startX, n.startX) -
|
|
2342
|
-
case "FF": return
|
|
2531
|
+
}, Math.min(t.startX, n.startX) - gr);
|
|
2532
|
+
case "FF": return wr({
|
|
2343
2533
|
x: t.endX,
|
|
2344
2534
|
y: r
|
|
2345
2535
|
}, {
|
|
2346
2536
|
x: n.endX,
|
|
2347
2537
|
y: i
|
|
2348
|
-
}, Math.max(t.endX, n.endX) +
|
|
2538
|
+
}, Math.max(t.endX, n.endX) + gr);
|
|
2349
2539
|
case "SF": {
|
|
2350
2540
|
let e = {
|
|
2351
2541
|
x: t.startX,
|
|
@@ -2354,36 +2544,36 @@ function or(e, t, n) {
|
|
|
2354
2544
|
x: n.endX,
|
|
2355
2545
|
y: i
|
|
2356
2546
|
};
|
|
2357
|
-
return n.endX <= t.startX - 2 *
|
|
2547
|
+
return n.endX <= t.startX - 2 * gr ? Sr(e, a) : Cr(e, a, -1, -1);
|
|
2358
2548
|
}
|
|
2359
2549
|
}
|
|
2360
2550
|
}
|
|
2361
|
-
function
|
|
2362
|
-
let r =
|
|
2551
|
+
function Er({ tasks: e, dependencies: t, ...n }) {
|
|
2552
|
+
let r = xr(e, n), i = [];
|
|
2363
2553
|
for (let e of t) {
|
|
2364
2554
|
let t = r.get(e.from), n = r.get(e.to);
|
|
2365
|
-
!t || !n || i.push(
|
|
2555
|
+
!t || !n || i.push(Dr(e, t, n));
|
|
2366
2556
|
}
|
|
2367
2557
|
let a = null;
|
|
2368
2558
|
return {
|
|
2369
2559
|
links: i,
|
|
2370
2560
|
boxes: r,
|
|
2371
2561
|
linksTouching(e) {
|
|
2372
|
-
return a ??=
|
|
2562
|
+
return a ??= Or(i), a.get(e);
|
|
2373
2563
|
}
|
|
2374
2564
|
};
|
|
2375
2565
|
}
|
|
2376
|
-
function
|
|
2377
|
-
let r =
|
|
2566
|
+
function Dr(e, t, n) {
|
|
2567
|
+
let r = Tr(e.type, t, n);
|
|
2378
2568
|
return {
|
|
2379
2569
|
id: `${e.from}->${e.to}`,
|
|
2380
2570
|
type: e.type,
|
|
2381
2571
|
points: r,
|
|
2382
|
-
bounds:
|
|
2572
|
+
bounds: vr(r),
|
|
2383
2573
|
dep: e
|
|
2384
2574
|
};
|
|
2385
2575
|
}
|
|
2386
|
-
function
|
|
2576
|
+
function Or(e) {
|
|
2387
2577
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2388
2578
|
let r = t.get(e);
|
|
2389
2579
|
r ? r.push(n) : t.set(e, [n]);
|
|
@@ -2392,26 +2582,26 @@ function lr(e) {
|
|
|
2392
2582
|
n(String(e.dep.from), t), n(String(e.dep.to), t);
|
|
2393
2583
|
}), t;
|
|
2394
2584
|
}
|
|
2395
|
-
function
|
|
2585
|
+
function kr(e, t, n) {
|
|
2396
2586
|
let r = Object.keys(t);
|
|
2397
2587
|
if (r.length === 0) return e.links;
|
|
2398
2588
|
let i = /* @__PURE__ */ new Map(), a = (r) => {
|
|
2399
2589
|
let a = e.boxes.get(r), o = a && t[String(r)];
|
|
2400
2590
|
if (!a || !o) return a;
|
|
2401
2591
|
let s = i.get(r);
|
|
2402
|
-
return s || (s =
|
|
2592
|
+
return s || (s = br(a.task, o, a.centerY, n), i.set(r, s)), s;
|
|
2403
2593
|
}, o = null;
|
|
2404
2594
|
for (let t of r) for (let n of e.linksTouching(t) ?? []) {
|
|
2405
2595
|
let { dep: t } = e.links[n], r = a(t.from), i = a(t.to);
|
|
2406
|
-
!r || !i || (o ??= e.links.slice(), o[n] =
|
|
2596
|
+
!r || !i || (o ??= e.links.slice(), o[n] = Dr(t, r, i));
|
|
2407
2597
|
}
|
|
2408
2598
|
return o ?? e.links;
|
|
2409
2599
|
}
|
|
2410
2600
|
//#endregion
|
|
2411
2601
|
//#region src/components/dependency-links/DependencyLinksContext.tsx
|
|
2412
|
-
var
|
|
2413
|
-
function
|
|
2414
|
-
let c =
|
|
2602
|
+
var Ar = n(null);
|
|
2603
|
+
function jr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, unit: a, children: o, overrides: s }) {
|
|
2604
|
+
let c = f(() => Er({
|
|
2415
2605
|
tasks: e,
|
|
2416
2606
|
dependencies: t,
|
|
2417
2607
|
origin: n,
|
|
@@ -2425,7 +2615,7 @@ function fr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, u
|
|
|
2425
2615
|
r,
|
|
2426
2616
|
i,
|
|
2427
2617
|
a
|
|
2428
|
-
]),
|
|
2618
|
+
]), l = f(() => kr(c, s, {
|
|
2429
2619
|
origin: n,
|
|
2430
2620
|
colWidth: r,
|
|
2431
2621
|
rowHeight: i,
|
|
@@ -2438,13 +2628,13 @@ function fr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, u
|
|
|
2438
2628
|
i,
|
|
2439
2629
|
a
|
|
2440
2630
|
]);
|
|
2441
|
-
return /* @__PURE__ */
|
|
2442
|
-
value:
|
|
2631
|
+
return /* @__PURE__ */ v(Ar.Provider, {
|
|
2632
|
+
value: l,
|
|
2443
2633
|
children: o
|
|
2444
2634
|
});
|
|
2445
2635
|
}
|
|
2446
|
-
function
|
|
2447
|
-
let e =
|
|
2636
|
+
function Mr() {
|
|
2637
|
+
let e = s(Ar);
|
|
2448
2638
|
if (e === null) throw Error("useDependencyLinks must be used within a <DependencyLinksProvider>");
|
|
2449
2639
|
return e;
|
|
2450
2640
|
}
|
|
@@ -2458,11 +2648,11 @@ var Z = {
|
|
|
2458
2648
|
arrowSelected: "_arrowSelected_1ih9f_43",
|
|
2459
2649
|
lagLabel: "_lagLabel_1ih9f_51",
|
|
2460
2650
|
deleteBtn: "_deleteBtn_1ih9f_65"
|
|
2461
|
-
}, Q = 2,
|
|
2462
|
-
function
|
|
2651
|
+
}, Q = 2, Nr = 8, Pr = 6;
|
|
2652
|
+
function Fr(e, t) {
|
|
2463
2653
|
return t ? e.minX <= t.maxX && e.maxX >= t.minX && e.minY <= t.maxY && e.maxY >= t.minY : !0;
|
|
2464
2654
|
}
|
|
2465
|
-
function
|
|
2655
|
+
function Ir(e, t) {
|
|
2466
2656
|
return e.y === t.y ? {
|
|
2467
2657
|
left: Math.min(e.x, t.x) - Q / 2,
|
|
2468
2658
|
top: e.y - Q / 2,
|
|
@@ -2475,51 +2665,51 @@ function _r(e, t) {
|
|
|
2475
2665
|
height: Math.abs(t.y - e.y) + Q
|
|
2476
2666
|
};
|
|
2477
2667
|
}
|
|
2478
|
-
function
|
|
2668
|
+
function Lr(e, t) {
|
|
2479
2669
|
return e.y === t.y ? {
|
|
2480
2670
|
left: Math.min(e.x, t.x) - Q / 2,
|
|
2481
|
-
top: e.y -
|
|
2671
|
+
top: e.y - Pr,
|
|
2482
2672
|
width: Math.abs(t.x - e.x) + Q,
|
|
2483
|
-
height: Q +
|
|
2673
|
+
height: Q + Pr * 2
|
|
2484
2674
|
} : {
|
|
2485
|
-
left: e.x -
|
|
2675
|
+
left: e.x - Pr,
|
|
2486
2676
|
top: Math.min(e.y, t.y) - Q / 2,
|
|
2487
|
-
width: Q +
|
|
2677
|
+
width: Q + Pr * 2,
|
|
2488
2678
|
height: Math.abs(t.y - e.y) + Q
|
|
2489
2679
|
};
|
|
2490
2680
|
}
|
|
2491
|
-
function
|
|
2681
|
+
function Rr(e) {
|
|
2492
2682
|
let t = [];
|
|
2493
2683
|
for (let n = 0; n + 1 < e.length; n++) t.push([e[n], e[n + 1]]);
|
|
2494
2684
|
return t;
|
|
2495
2685
|
}
|
|
2496
|
-
function
|
|
2686
|
+
function zr(e) {
|
|
2497
2687
|
let t = e[e.length - 1], n = e[e.length - 2], r = t.x >= n.x;
|
|
2498
2688
|
return {
|
|
2499
2689
|
className: r ? Z.arrowRight : Z.arrowLeft,
|
|
2500
2690
|
style: {
|
|
2501
|
-
left: r ? t.x -
|
|
2502
|
-
top: t.y -
|
|
2691
|
+
left: r ? t.x - Nr : t.x,
|
|
2692
|
+
top: t.y - Nr / 2
|
|
2503
2693
|
}
|
|
2504
2694
|
};
|
|
2505
2695
|
}
|
|
2506
|
-
function
|
|
2507
|
-
let
|
|
2508
|
-
if (
|
|
2509
|
-
if (!
|
|
2696
|
+
function Br({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots: a, slotProps: o }) {
|
|
2697
|
+
let s = J(), c = a ?? s.dependencies?.links?.slots, u = o ?? s.dependencies?.links?.slotProps, d = $t(), f = rn(), p = Mr(), [h, g] = m(null), [_, b] = m(null), x = h ? p.find((e) => e.id === h) : null;
|
|
2698
|
+
if (l(() => {
|
|
2699
|
+
if (!h) return;
|
|
2510
2700
|
let e = (e) => {
|
|
2511
|
-
(e.key === "Delete" || e.key === "Backspace") && (x && r?.(x.dep),
|
|
2701
|
+
(e.key === "Delete" || e.key === "Backspace") && (x && r?.(x.dep), g(null), b(null));
|
|
2512
2702
|
};
|
|
2513
2703
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2514
2704
|
}, [
|
|
2515
|
-
|
|
2705
|
+
h,
|
|
2516
2706
|
x,
|
|
2517
2707
|
r
|
|
2518
|
-
]),
|
|
2708
|
+
]), p.length === 0) return null;
|
|
2519
2709
|
let S = (e, t) => {
|
|
2520
|
-
if (t.stopPropagation(),
|
|
2710
|
+
if (t.stopPropagation(), h === e) g(null), b(null);
|
|
2521
2711
|
else {
|
|
2522
|
-
|
|
2712
|
+
g(e);
|
|
2523
2713
|
let n = t.currentTarget.closest(`.${Z.layer}`)?.getBoundingClientRect();
|
|
2524
2714
|
b(n ? {
|
|
2525
2715
|
x: t.clientX - n.left,
|
|
@@ -2527,10 +2717,10 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2527
2717
|
} : null);
|
|
2528
2718
|
}
|
|
2529
2719
|
}, C = (e) => {
|
|
2530
|
-
e.stopPropagation(), x && r?.(x.dep),
|
|
2531
|
-
}, w =
|
|
2532
|
-
return /* @__PURE__ */
|
|
2533
|
-
...
|
|
2720
|
+
e.stopPropagation(), x && r?.(x.dep), g(null), b(null);
|
|
2721
|
+
}, w = c?.layer ?? "div", T = c?.segment ?? "div", E = c?.arrow ?? "div", D = c?.lagLabel ?? "div", O = c?.deleteButton ?? "button";
|
|
2722
|
+
return /* @__PURE__ */ y(w, {
|
|
2723
|
+
...Y({
|
|
2534
2724
|
className: Z.layer,
|
|
2535
2725
|
style: {
|
|
2536
2726
|
width: t,
|
|
@@ -2539,32 +2729,32 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2539
2729
|
role: "presentation",
|
|
2540
2730
|
"aria-hidden": !0,
|
|
2541
2731
|
onClick: () => {
|
|
2542
|
-
|
|
2732
|
+
g(null), b(null);
|
|
2543
2733
|
}
|
|
2544
2734
|
}, u?.layer, {
|
|
2545
2735
|
width: t,
|
|
2546
2736
|
height: n,
|
|
2547
|
-
linkCount:
|
|
2737
|
+
linkCount: p.length
|
|
2548
2738
|
}),
|
|
2549
|
-
children: [
|
|
2550
|
-
let n = t.id ===
|
|
2551
|
-
if (!n && !
|
|
2552
|
-
let r =
|
|
2739
|
+
children: [p.map((t) => {
|
|
2740
|
+
let n = t.id === h;
|
|
2741
|
+
if (!n && !Fr(t.bounds, i)) return null;
|
|
2742
|
+
let r = zr(t.points), a = Rr(t.points), o = t.dep.lag ? yr(t.points) : null, s = {
|
|
2553
2743
|
link: t,
|
|
2554
2744
|
isSelected: n
|
|
2555
|
-
}, c =
|
|
2745
|
+
}, c = Y({
|
|
2556
2746
|
className: `${r.className} ${n ? Z.arrowSelected : ""}`,
|
|
2557
2747
|
style: r.style
|
|
2558
2748
|
}, u?.arrow, s);
|
|
2559
|
-
return /* @__PURE__ */
|
|
2560
|
-
!
|
|
2749
|
+
return /* @__PURE__ */ y(e, { children: [
|
|
2750
|
+
!f && a.map(([e, n]) => /* @__PURE__ */ v("div", {
|
|
2561
2751
|
className: Z.hitArea,
|
|
2562
|
-
style:
|
|
2752
|
+
style: Lr(e, n),
|
|
2563
2753
|
onClick: (e) => S(t.id, e)
|
|
2564
2754
|
}, `hit-${e.x},${e.y}-${n.x},${n.y}`)),
|
|
2565
|
-
a.map(([e, r], i) => /* @__PURE__ */
|
|
2755
|
+
a.map(([e, r], i) => /* @__PURE__ */ v(T, { ...Y({
|
|
2566
2756
|
className: `${Z.segment} ${n ? Z.segmentSelected : ""}`,
|
|
2567
|
-
style:
|
|
2757
|
+
style: Ir(e, r)
|
|
2568
2758
|
}, u?.segment, {
|
|
2569
2759
|
link: t,
|
|
2570
2760
|
isSelected: n,
|
|
@@ -2572,8 +2762,8 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2572
2762
|
to: r,
|
|
2573
2763
|
index: i
|
|
2574
2764
|
}) }, `seg-${e.x},${e.y}-${r.x},${r.y}`)),
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
o && t.dep.lag !== void 0 && t.dep.lag !== 0 && /* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ v(E, { ...c }),
|
|
2766
|
+
o && t.dep.lag !== void 0 && t.dep.lag !== 0 && /* @__PURE__ */ v(D, { ...Y({
|
|
2577
2767
|
className: Z.lagLabel,
|
|
2578
2768
|
style: {
|
|
2579
2769
|
left: o.x,
|
|
@@ -2586,29 +2776,29 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2586
2776
|
lag: t.dep.lag
|
|
2587
2777
|
}) })
|
|
2588
2778
|
] }, t.id);
|
|
2589
|
-
}), !
|
|
2779
|
+
}), !f && x && _ && /* @__PURE__ */ v(O, { ...Y({
|
|
2590
2780
|
className: Z.deleteBtn,
|
|
2591
2781
|
type: "button",
|
|
2592
2782
|
tabIndex: -1,
|
|
2593
2783
|
style: {
|
|
2594
|
-
left:
|
|
2595
|
-
top:
|
|
2784
|
+
left: _.x,
|
|
2785
|
+
top: _.y
|
|
2596
2786
|
},
|
|
2597
2787
|
onClick: C,
|
|
2598
|
-
"aria-label":
|
|
2788
|
+
"aria-label": d.deleteDependency,
|
|
2599
2789
|
children: "×"
|
|
2600
2790
|
}, u?.deleteButton, { dependency: x.dep }) })]
|
|
2601
2791
|
});
|
|
2602
2792
|
}
|
|
2603
|
-
var
|
|
2793
|
+
var Vr = { preview: "_preview_1jjzd_1" };
|
|
2604
2794
|
//#endregion
|
|
2605
2795
|
//#region src/components/dependency-links/DependencyPreview.tsx
|
|
2606
|
-
function
|
|
2607
|
-
let n =
|
|
2796
|
+
function Hr({ slots: e, slotProps: t }) {
|
|
2797
|
+
let n = J(), r = e ?? n.dependencies?.preview?.slots, i = t ?? n.dependencies?.preview?.slotProps, a = bn();
|
|
2608
2798
|
if (!a) return null;
|
|
2609
2799
|
let o = a.currentX - a.startX, s = a.currentY - a.startY, c = Math.hypot(o, s), l = 180 / Math.PI * Math.atan2(s, o);
|
|
2610
|
-
return /* @__PURE__ */
|
|
2611
|
-
className:
|
|
2800
|
+
return /* @__PURE__ */ v(r?.root ?? "div", { ...Y({
|
|
2801
|
+
className: Vr.preview,
|
|
2612
2802
|
style: {
|
|
2613
2803
|
left: a.startX,
|
|
2614
2804
|
top: a.startY,
|
|
@@ -2622,24 +2812,24 @@ function Cr({ slots: e, slotProps: t }) {
|
|
|
2622
2812
|
angle: l
|
|
2623
2813
|
}) });
|
|
2624
2814
|
}
|
|
2625
|
-
var
|
|
2815
|
+
var Ur = {
|
|
2626
2816
|
cols: "_cols_kjab1_1",
|
|
2627
2817
|
col: "_col_kjab1_1",
|
|
2628
2818
|
colWeekend: "_colWeekend_kjab1_14"
|
|
2629
2819
|
};
|
|
2630
2820
|
//#endregion
|
|
2631
2821
|
//#region src/components/grid/GridColumns.tsx
|
|
2632
|
-
function
|
|
2633
|
-
let c =
|
|
2634
|
-
return /* @__PURE__ */
|
|
2635
|
-
className:
|
|
2822
|
+
function Wr({ dates: e, colWidth: t, bodyHeight: n, colRange: r, unit: i = "day", step: a = 1, slots: o, slotProps: s }) {
|
|
2823
|
+
let c = J(), l = o ?? c.timeline?.gridColumn?.slots, u = s ?? c.timeline?.gridColumn?.slotProps, d = l?.column ?? "div", { calendar: f } = tn(), p = i === "day" || i === "hour" || i === "minute";
|
|
2824
|
+
return /* @__PURE__ */ v("div", {
|
|
2825
|
+
className: Ur.cols,
|
|
2636
2826
|
role: "presentation",
|
|
2637
2827
|
"aria-hidden": !0,
|
|
2638
2828
|
children: e.slice(r.start, r.end).map((e, o) => {
|
|
2639
|
-
let s = r.start + o, c = p ?
|
|
2829
|
+
let s = r.start + o, c = p ? De(f, e, N(e, i, a)) : {
|
|
2640
2830
|
isNonWorking: !1,
|
|
2641
2831
|
reason: void 0
|
|
2642
|
-
}, l = f ? c.isNonWorking : i === "day" &&
|
|
2832
|
+
}, l = f ? c.isNonWorking : i === "day" && O(e), m = {
|
|
2643
2833
|
date: e,
|
|
2644
2834
|
index: s,
|
|
2645
2835
|
isNonWorking: l,
|
|
@@ -2648,26 +2838,26 @@ function Tr({ dates: e, colWidth: t, bodyHeight: n, colRange: r, unit: i = "day"
|
|
|
2648
2838
|
colWidth: t,
|
|
2649
2839
|
bodyHeight: n
|
|
2650
2840
|
};
|
|
2651
|
-
return /* @__PURE__ */
|
|
2652
|
-
className:
|
|
2841
|
+
return /* @__PURE__ */ v(d, { ...Y({
|
|
2842
|
+
className: Dn(Ur.col, l && Ur.colWeekend),
|
|
2653
2843
|
style: {
|
|
2654
2844
|
left: s * t,
|
|
2655
2845
|
width: t,
|
|
2656
2846
|
height: n
|
|
2657
2847
|
}
|
|
2658
|
-
}, u?.column,
|
|
2848
|
+
}, u?.column, m) }, e.getTime());
|
|
2659
2849
|
})
|
|
2660
2850
|
});
|
|
2661
2851
|
}
|
|
2662
|
-
|
|
2663
|
-
var
|
|
2852
|
+
Wr.displayName = "GridColumns";
|
|
2853
|
+
var Gr = {
|
|
2664
2854
|
gridWrapper: "_gridWrapper_1tr84_1",
|
|
2665
2855
|
grid: "_grid_1tr84_1",
|
|
2666
2856
|
body: "_body_1tr84_17"
|
|
2667
2857
|
};
|
|
2668
2858
|
//#endregion
|
|
2669
2859
|
//#region src/core/virtualize.ts
|
|
2670
|
-
function
|
|
2860
|
+
function Kr(e, t, n, r, i = 0) {
|
|
2671
2861
|
if (r <= 0) return {
|
|
2672
2862
|
start: 0,
|
|
2673
2863
|
end: 0
|
|
@@ -2684,9 +2874,9 @@ function Dr(e, t, n, r, i = 0) {
|
|
|
2684
2874
|
}
|
|
2685
2875
|
//#endregion
|
|
2686
2876
|
//#region src/components/grid/Grid.tsx
|
|
2687
|
-
function
|
|
2688
|
-
let n =
|
|
2689
|
-
|
|
2877
|
+
function qr({ slots: e, slotProps: t } = {}) {
|
|
2878
|
+
let n = J(), r = e ?? n.timeline?.grid?.slots, i = t ?? n.timeline?.grid?.slotProps, { visibleTasks: a } = on(), { updateTask: s, commitTask: c, onTaskClick: u, setSelectedId: d } = cn(), { colWidth: p, rowHeight: h, scales: g, padDays: _, height: b } = Zt(), x = $t(), { gridRef: S, onGridScroll: C, gridBodyRef: w } = fn(), T = mn(), { dependencies: E, onDependencyDelete: D } = gn(), { zoomAt: O, zoomIn: k, zoomOut: A, wheelEnabled: j, keyboardEnabled: M } = Sn();
|
|
2879
|
+
l(() => {
|
|
2690
2880
|
let e = S.current;
|
|
2691
2881
|
if (!e || !j && !M) return;
|
|
2692
2882
|
let t = (t) => {
|
|
@@ -2707,12 +2897,12 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2707
2897
|
O,
|
|
2708
2898
|
k,
|
|
2709
2899
|
A,
|
|
2710
|
-
|
|
2900
|
+
a.length
|
|
2711
2901
|
]);
|
|
2712
|
-
let [
|
|
2713
|
-
|
|
2714
|
-
}, [
|
|
2715
|
-
|
|
2902
|
+
let [N, P] = m({}), F = o((e) => {
|
|
2903
|
+
d(e.id), u?.(e);
|
|
2904
|
+
}, [d, u]), ee = o((e, t) => {
|
|
2905
|
+
P((n) => {
|
|
2716
2906
|
if (t === null) {
|
|
2717
2907
|
let { [e]: t, ...r } = n;
|
|
2718
2908
|
return r;
|
|
@@ -2725,90 +2915,90 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2725
2915
|
}
|
|
2726
2916
|
};
|
|
2727
2917
|
});
|
|
2728
|
-
}, []), I =
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
]),
|
|
2733
|
-
if (!
|
|
2734
|
-
let
|
|
2735
|
-
minX:
|
|
2736
|
-
maxX:
|
|
2737
|
-
minY:
|
|
2738
|
-
maxY:
|
|
2739
|
-
},
|
|
2740
|
-
totalWidth:
|
|
2741
|
-
bodyHeight:
|
|
2918
|
+
}, []), I = f(() => Nt(a, _, g), [
|
|
2919
|
+
a,
|
|
2920
|
+
_,
|
|
2921
|
+
g
|
|
2922
|
+
]), L = I[0]?.getTime(), R = f(() => L == null ? void 0 : new Date(L), [L]);
|
|
2923
|
+
if (!R) return null;
|
|
2924
|
+
let z = kt(g), B = I.length * p, V = a.length * h, te = (g ?? Ot).length, H = Kr(T.scrollTop, T.clientHeight, h, a.length, 6), ne = Kr(T.scrollLeft, T.clientWidth, p, I.length, 4), re = {
|
|
2925
|
+
minX: ne.start * p,
|
|
2926
|
+
maxX: ne.end * p,
|
|
2927
|
+
minY: H.start * h,
|
|
2928
|
+
maxY: H.end * h
|
|
2929
|
+
}, ie = r?.root ?? "div", ae = r?.body ?? "div", oe = {
|
|
2930
|
+
totalWidth: B,
|
|
2931
|
+
bodyHeight: V,
|
|
2742
2932
|
height: b
|
|
2743
|
-
}, se =
|
|
2744
|
-
className:
|
|
2933
|
+
}, se = Y({
|
|
2934
|
+
className: Gr.gridWrapper,
|
|
2745
2935
|
style: b === void 0 ? {} : { height: b },
|
|
2746
2936
|
onScroll: C,
|
|
2747
2937
|
role: "grid",
|
|
2748
2938
|
"aria-label": x.timeline,
|
|
2749
|
-
"aria-rowcount":
|
|
2939
|
+
"aria-rowcount": te + a.length,
|
|
2750
2940
|
"aria-colcount": I.length
|
|
2751
|
-
},
|
|
2752
|
-
className:
|
|
2941
|
+
}, i?.root, oe), ce = Y({
|
|
2942
|
+
className: Gr.body,
|
|
2753
2943
|
style: {
|
|
2754
|
-
height:
|
|
2755
|
-
width:
|
|
2944
|
+
height: V,
|
|
2945
|
+
width: B
|
|
2756
2946
|
},
|
|
2757
2947
|
role: "rowgroup"
|
|
2758
|
-
},
|
|
2759
|
-
return /* @__PURE__ */
|
|
2948
|
+
}, i?.body, oe);
|
|
2949
|
+
return /* @__PURE__ */ v(ie, {
|
|
2760
2950
|
ref: S,
|
|
2761
2951
|
...se,
|
|
2762
|
-
children: /* @__PURE__ */
|
|
2763
|
-
className:
|
|
2764
|
-
style: { width:
|
|
2952
|
+
children: /* @__PURE__ */ y("div", {
|
|
2953
|
+
className: Gr.grid,
|
|
2954
|
+
style: { width: B },
|
|
2765
2955
|
role: "presentation",
|
|
2766
|
-
children: [/* @__PURE__ */
|
|
2767
|
-
colWidth:
|
|
2768
|
-
rowHeight:
|
|
2956
|
+
children: [/* @__PURE__ */ v(Mn, {
|
|
2957
|
+
colWidth: p,
|
|
2958
|
+
rowHeight: h,
|
|
2769
2959
|
dates: I,
|
|
2770
|
-
scales:
|
|
2771
|
-
colRange:
|
|
2772
|
-
}), /* @__PURE__ */
|
|
2773
|
-
tasks:
|
|
2960
|
+
scales: g,
|
|
2961
|
+
colRange: ne
|
|
2962
|
+
}), /* @__PURE__ */ v(jr, {
|
|
2963
|
+
tasks: a,
|
|
2774
2964
|
dependencies: E,
|
|
2775
|
-
origin:
|
|
2776
|
-
colWidth:
|
|
2777
|
-
rowHeight:
|
|
2778
|
-
unit:
|
|
2779
|
-
overrides:
|
|
2780
|
-
children: /* @__PURE__ */
|
|
2965
|
+
origin: R,
|
|
2966
|
+
colWidth: p,
|
|
2967
|
+
rowHeight: h,
|
|
2968
|
+
unit: z,
|
|
2969
|
+
overrides: N,
|
|
2970
|
+
children: /* @__PURE__ */ y(ae, {
|
|
2781
2971
|
ref: w,
|
|
2782
2972
|
...ce,
|
|
2783
2973
|
children: [
|
|
2784
|
-
/* @__PURE__ */
|
|
2974
|
+
/* @__PURE__ */ v(Wr, {
|
|
2785
2975
|
dates: I,
|
|
2786
|
-
colWidth:
|
|
2787
|
-
bodyHeight:
|
|
2788
|
-
colRange:
|
|
2789
|
-
unit:
|
|
2790
|
-
step:
|
|
2976
|
+
colWidth: p,
|
|
2977
|
+
bodyHeight: V,
|
|
2978
|
+
colRange: ne,
|
|
2979
|
+
unit: z,
|
|
2980
|
+
step: At(g)
|
|
2791
2981
|
}),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
width:
|
|
2794
|
-
height:
|
|
2982
|
+
/* @__PURE__ */ v(Br, {
|
|
2983
|
+
width: B,
|
|
2984
|
+
height: V,
|
|
2795
2985
|
onDependencyDelete: D,
|
|
2796
|
-
visibleRect:
|
|
2986
|
+
visibleRect: re
|
|
2797
2987
|
}),
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
|
|
2988
|
+
/* @__PURE__ */ v(Hr, {}),
|
|
2989
|
+
a.slice(H.start, H.end).map((e, t) => /* @__PURE__ */ v(hr, {
|
|
2800
2990
|
task: e,
|
|
2801
|
-
index:
|
|
2802
|
-
origin:
|
|
2803
|
-
colWidth:
|
|
2804
|
-
rowHeight:
|
|
2805
|
-
unit:
|
|
2806
|
-
onUpdate:
|
|
2807
|
-
onCommit:
|
|
2808
|
-
override:
|
|
2809
|
-
onOverride:
|
|
2810
|
-
onTaskClick:
|
|
2811
|
-
rowIndexOffset:
|
|
2991
|
+
index: H.start + t,
|
|
2992
|
+
origin: R,
|
|
2993
|
+
colWidth: p,
|
|
2994
|
+
rowHeight: h,
|
|
2995
|
+
unit: z,
|
|
2996
|
+
onUpdate: s,
|
|
2997
|
+
onCommit: c,
|
|
2998
|
+
override: N[e.id],
|
|
2999
|
+
onOverride: ee,
|
|
3000
|
+
onTaskClick: F,
|
|
3001
|
+
rowIndexOffset: te
|
|
2812
3002
|
}, e.id))
|
|
2813
3003
|
]
|
|
2814
3004
|
})
|
|
@@ -2816,14 +3006,14 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2816
3006
|
})
|
|
2817
3007
|
});
|
|
2818
3008
|
}
|
|
2819
|
-
|
|
2820
|
-
var
|
|
3009
|
+
qr.displayName = "GanttGrid";
|
|
3010
|
+
var Jr = { handle: "_handle_1o220_1" };
|
|
2821
3011
|
//#endregion
|
|
2822
3012
|
//#region src/components/grid/GridResizeHandle.tsx
|
|
2823
|
-
function
|
|
2824
|
-
let i =
|
|
2825
|
-
return /* @__PURE__ */
|
|
2826
|
-
className:
|
|
3013
|
+
function Yr({ onMouseDown: e, isResizing: t = !1, slots: n, slotProps: r }) {
|
|
3014
|
+
let i = J(), a = n ?? i.timeline?.gridResizeHandle?.slots, o = r ?? i.timeline?.gridResizeHandle?.slotProps, s = $t(), c = { isResizing: t };
|
|
3015
|
+
return /* @__PURE__ */ v(a?.root ?? "div", { ...Y({
|
|
3016
|
+
className: Jr.handle,
|
|
2827
3017
|
onMouseDown: e,
|
|
2828
3018
|
role: "separator",
|
|
2829
3019
|
"aria-orientation": "vertical",
|
|
@@ -2847,10 +3037,10 @@ var $ = {
|
|
|
2847
3037
|
};
|
|
2848
3038
|
//#endregion
|
|
2849
3039
|
//#region src/components/taskList/TaskListHeader.tsx
|
|
2850
|
-
function
|
|
3040
|
+
function Xr({ columns: e, rowHeight: t, scales: n = Ot, onResizeStart: r, slots: i, slotProps: a }) {
|
|
2851
3041
|
let o = n.length * t + 2, s = i?.header ?? "div", c = i?.headerCell ?? "div", l = i?.columnResizeHandle ?? "div";
|
|
2852
|
-
return /* @__PURE__ */
|
|
2853
|
-
...
|
|
3042
|
+
return /* @__PURE__ */ v(s, {
|
|
3043
|
+
...Y({
|
|
2854
3044
|
className: $.header,
|
|
2855
3045
|
style: {
|
|
2856
3046
|
minHeight: o,
|
|
@@ -2866,7 +3056,7 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2866
3056
|
let n = {
|
|
2867
3057
|
column: e,
|
|
2868
3058
|
index: t
|
|
2869
|
-
}, i =
|
|
3059
|
+
}, i = Y({
|
|
2870
3060
|
className: $.headerCell,
|
|
2871
3061
|
style: e.width ? {
|
|
2872
3062
|
width: e.width,
|
|
@@ -2877,7 +3067,7 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2877
3067
|
},
|
|
2878
3068
|
role: "columnheader",
|
|
2879
3069
|
"aria-colindex": t + 1
|
|
2880
|
-
}, a?.headerCell, n), o =
|
|
3070
|
+
}, a?.headerCell, n), o = Y({
|
|
2881
3071
|
className: $.divider,
|
|
2882
3072
|
"aria-hidden": !0,
|
|
2883
3073
|
onMouseDown: (t) => {
|
|
@@ -2885,26 +3075,26 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2885
3075
|
r(e.key, n.offsetWidth, t);
|
|
2886
3076
|
}
|
|
2887
3077
|
}, a?.columnResizeHandle, n);
|
|
2888
|
-
return /* @__PURE__ */
|
|
3078
|
+
return /* @__PURE__ */ y(c, {
|
|
2889
3079
|
...i,
|
|
2890
|
-
children: [e.header, /* @__PURE__ */
|
|
3080
|
+
children: [e.header, /* @__PURE__ */ v(l, { ...o })]
|
|
2891
3081
|
}, e.key);
|
|
2892
3082
|
})
|
|
2893
3083
|
});
|
|
2894
3084
|
}
|
|
2895
3085
|
//#endregion
|
|
2896
3086
|
//#region src/components/taskList/TreeCell.tsx
|
|
2897
|
-
var
|
|
2898
|
-
function
|
|
2899
|
-
let c =
|
|
3087
|
+
var Zr = 16;
|
|
3088
|
+
function Qr({ taskId: e, depth: t, isParent: n, isExpanded: r, onToggleExpand: i, children: a, slots: o, slotProps: s }) {
|
|
3089
|
+
let c = $t(), l = {
|
|
2900
3090
|
taskId: e,
|
|
2901
3091
|
depth: t,
|
|
2902
3092
|
isParent: n,
|
|
2903
3093
|
isExpanded: r
|
|
2904
|
-
}, u = o?.root ?? "span", d = o?.expandButton ?? "button", f = o?.placeholder ?? "span", p =
|
|
3094
|
+
}, u = o?.root ?? "span", d = o?.expandButton ?? "button", f = o?.placeholder ?? "span", p = Y({
|
|
2905
3095
|
className: $.nameContent,
|
|
2906
|
-
style: { paddingLeft: t *
|
|
2907
|
-
}, s?.root, l),
|
|
3096
|
+
style: { paddingLeft: t * Zr }
|
|
3097
|
+
}, s?.root, l), m = Y({
|
|
2908
3098
|
className: $.expandBtn,
|
|
2909
3099
|
type: "button",
|
|
2910
3100
|
onClick: (t) => {
|
|
@@ -2912,20 +3102,20 @@ function Nr({ taskId: e, depth: t, isParent: n, isExpanded: r, onToggleExpand: i
|
|
|
2912
3102
|
},
|
|
2913
3103
|
"aria-label": r ? c.collapse : c.expand,
|
|
2914
3104
|
children: r ? "▾" : "▸"
|
|
2915
|
-
}, s?.expandButton, l),
|
|
3105
|
+
}, s?.expandButton, l), h = Y({
|
|
2916
3106
|
className: $.expandPlaceholder,
|
|
2917
3107
|
"aria-hidden": !0
|
|
2918
3108
|
}, s?.placeholder, l);
|
|
2919
|
-
return /* @__PURE__ */
|
|
3109
|
+
return /* @__PURE__ */ y(u, {
|
|
2920
3110
|
...p,
|
|
2921
|
-
children: [n ? /* @__PURE__ */
|
|
3111
|
+
children: [n ? /* @__PURE__ */ v(d, { ...m }) : /* @__PURE__ */ v(f, { ...h }), a]
|
|
2922
3112
|
});
|
|
2923
3113
|
}
|
|
2924
3114
|
//#endregion
|
|
2925
3115
|
//#region src/components/taskList/TaskListRow.tsx
|
|
2926
|
-
var
|
|
2927
|
-
let { columnApi: p } =
|
|
2928
|
-
return /* @__PURE__ */
|
|
3116
|
+
var $r = 100, ei = i(function({ task: e, rowHeight: t, rowIndex: n, depth: r, posinset: i, setsize: a, isParent: o, isExpanded: s, isSelected: c, onToggleExpand: l, onSelect: u, columns: d, treeCell: f }) {
|
|
3117
|
+
let { columnApi: p } = cn();
|
|
3118
|
+
return /* @__PURE__ */ v("div", {
|
|
2929
3119
|
className: `${$.row} ${c ? $.selected : ""}`,
|
|
2930
3120
|
style: { height: t },
|
|
2931
3121
|
onClick: () => u(e.id),
|
|
@@ -2936,15 +3126,15 @@ var Pr = 100, Fr = n(function({ task: e, rowHeight: t, rowIndex: n, depth: r, po
|
|
|
2936
3126
|
"aria-setsize": a,
|
|
2937
3127
|
"aria-expanded": o ? s : void 0,
|
|
2938
3128
|
"aria-selected": c || void 0,
|
|
2939
|
-
children: d.map((t, n) => /* @__PURE__ */
|
|
3129
|
+
children: d.map((t, n) => /* @__PURE__ */ v("div", {
|
|
2940
3130
|
className: `${$.cell} ${t.isTreeColumn ? $.treeCell : ""}`,
|
|
2941
3131
|
style: {
|
|
2942
|
-
width: t.width ||
|
|
3132
|
+
width: t.width || $r,
|
|
2943
3133
|
flexShrink: 0
|
|
2944
3134
|
},
|
|
2945
3135
|
role: t.isTreeColumn ? "rowheader" : "gridcell",
|
|
2946
3136
|
"aria-colindex": n + 1,
|
|
2947
|
-
children: t.isTreeColumn ? /* @__PURE__ */
|
|
3137
|
+
children: t.isTreeColumn ? /* @__PURE__ */ v(Qr, {
|
|
2948
3138
|
taskId: e.id,
|
|
2949
3139
|
depth: r,
|
|
2950
3140
|
isParent: o,
|
|
@@ -2957,14 +3147,14 @@ var Pr = 100, Fr = n(function({ task: e, rowHeight: t, rowIndex: n, depth: r, po
|
|
|
2957
3147
|
}, t.key))
|
|
2958
3148
|
});
|
|
2959
3149
|
});
|
|
2960
|
-
|
|
3150
|
+
ei.displayName = "TaskListRow";
|
|
2961
3151
|
//#endregion
|
|
2962
3152
|
//#region src/hooks/useColumnWidths.ts
|
|
2963
|
-
function
|
|
2964
|
-
let [e, t] =
|
|
3153
|
+
function ti() {
|
|
3154
|
+
let [e, t] = m({}), n = p(null);
|
|
2965
3155
|
return {
|
|
2966
3156
|
widths: e,
|
|
2967
|
-
onResizeStart:
|
|
3157
|
+
onResizeStart: o((e, r, i) => {
|
|
2968
3158
|
i.preventDefault(), n.current = {
|
|
2969
3159
|
key: e,
|
|
2970
3160
|
mouseX: i.clientX,
|
|
@@ -2986,29 +3176,29 @@ function Ir() {
|
|
|
2986
3176
|
}
|
|
2987
3177
|
//#endregion
|
|
2988
3178
|
//#region src/components/taskList/TaskList.tsx
|
|
2989
|
-
var
|
|
3179
|
+
var ni = {
|
|
2990
3180
|
flex: "1 1 auto",
|
|
2991
3181
|
minHeight: 0
|
|
2992
3182
|
};
|
|
2993
|
-
function
|
|
2994
|
-
let { visibleTasks: n, expandedIds: r, parentIds:
|
|
3183
|
+
function ri({ columns: e = [], taskList: t }) {
|
|
3184
|
+
let { visibleTasks: n, expandedIds: r, parentIds: i } = on(), { toggleExpand: a, setSelectedId: s, onTaskClick: c, revealTask: l } = cn(), u = un(), { rowHeight: d, scales: p, height: m } = Zt(), h = $t(), { taskListRef: g, onTaskListScroll: _ } = fn(), { widths: b, onResizeStart: x } = ti(), S = f(() => e.map((e) => b[e.key] == null ? e : {
|
|
2995
3185
|
...e,
|
|
2996
3186
|
width: b[e.key]
|
|
2997
|
-
}), [e, b]), C =
|
|
3187
|
+
}), [e, b]), C = q((e) => {
|
|
2998
3188
|
s(e);
|
|
2999
3189
|
let t = n.find((t) => t.id === e);
|
|
3000
|
-
t && (c?.(t),
|
|
3190
|
+
t && (c?.(t), l(e, {
|
|
3001
3191
|
horizontal: !0,
|
|
3002
3192
|
vertical: !1
|
|
3003
3193
|
}));
|
|
3004
|
-
}), w =
|
|
3194
|
+
}), w = o((e) => C.current(e), [C]), T = f(() => {
|
|
3005
3195
|
let e = /* @__PURE__ */ new Map();
|
|
3006
3196
|
for (let t of n) {
|
|
3007
3197
|
let n = t.parentId == null ? -1 : e.get(t.parentId) ?? 0;
|
|
3008
3198
|
e.set(t.id, n + 1);
|
|
3009
3199
|
}
|
|
3010
3200
|
return e;
|
|
3011
|
-
}, [n]), E =
|
|
3201
|
+
}, [n]), E = f(() => {
|
|
3012
3202
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
3013
3203
|
for (let r of n) {
|
|
3014
3204
|
let n = r.parentId ?? null, i = (e.get(n) ?? 0) + 1;
|
|
@@ -3022,58 +3212,58 @@ function Rr({ columns: e = [], taskList: t }) {
|
|
|
3022
3212
|
n.setsize = e.get(r.parentId ?? null) ?? 1;
|
|
3023
3213
|
}
|
|
3024
3214
|
return t;
|
|
3025
|
-
}, [n]), { viewport: D, scheduleMeasure: O } =
|
|
3026
|
-
|
|
3027
|
-
}, [
|
|
3028
|
-
return /* @__PURE__ */
|
|
3215
|
+
}, [n]), { viewport: D, scheduleMeasure: O } = St(g, { trackHorizontal: !1 }), k = o(() => {
|
|
3216
|
+
_(), O();
|
|
3217
|
+
}, [_, O]), A = Kr(D.scrollTop, D.clientHeight, d, n.length, 6);
|
|
3218
|
+
return /* @__PURE__ */ y("div", {
|
|
3029
3219
|
className: $.taskList,
|
|
3030
|
-
style: { height:
|
|
3220
|
+
style: { height: m },
|
|
3031
3221
|
role: "treegrid",
|
|
3032
|
-
"aria-label":
|
|
3222
|
+
"aria-label": h.taskList,
|
|
3033
3223
|
"aria-rowcount": n.length + 1,
|
|
3034
3224
|
"aria-colcount": S.length,
|
|
3035
|
-
children: [/* @__PURE__ */
|
|
3225
|
+
children: [/* @__PURE__ */ v(Xr, {
|
|
3036
3226
|
columns: S,
|
|
3037
|
-
rowHeight:
|
|
3227
|
+
rowHeight: d,
|
|
3038
3228
|
scales: p,
|
|
3039
3229
|
onResizeStart: x,
|
|
3040
3230
|
slots: t?.header?.slots,
|
|
3041
3231
|
slotProps: t?.header?.slotProps
|
|
3042
|
-
}), /* @__PURE__ */
|
|
3043
|
-
ref:
|
|
3232
|
+
}), /* @__PURE__ */ v("div", {
|
|
3233
|
+
ref: g,
|
|
3044
3234
|
className: $.body,
|
|
3045
|
-
style:
|
|
3235
|
+
style: ni,
|
|
3046
3236
|
onScroll: k,
|
|
3047
3237
|
role: "presentation",
|
|
3048
|
-
children: /* @__PURE__ */
|
|
3238
|
+
children: /* @__PURE__ */ y("div", {
|
|
3049
3239
|
className: $.rows,
|
|
3050
3240
|
role: "rowgroup",
|
|
3051
3241
|
children: [
|
|
3052
|
-
/* @__PURE__ */
|
|
3053
|
-
style: { height: A.start *
|
|
3242
|
+
/* @__PURE__ */ v("div", {
|
|
3243
|
+
style: { height: A.start * d },
|
|
3054
3244
|
role: "presentation",
|
|
3055
3245
|
"aria-hidden": "true"
|
|
3056
3246
|
}),
|
|
3057
|
-
Array.from({ length: A.end - A.start }, (e,
|
|
3058
|
-
let s = A.start +
|
|
3059
|
-
return /* @__PURE__ */
|
|
3247
|
+
Array.from({ length: A.end - A.start }, (e, o) => {
|
|
3248
|
+
let s = A.start + o, c = n[s], l = E.get(c.id);
|
|
3249
|
+
return /* @__PURE__ */ v(ei, {
|
|
3060
3250
|
task: c,
|
|
3061
|
-
rowHeight:
|
|
3251
|
+
rowHeight: d,
|
|
3062
3252
|
rowIndex: s,
|
|
3063
3253
|
depth: T.get(c.id) ?? 0,
|
|
3064
3254
|
posinset: l?.posinset ?? 1,
|
|
3065
3255
|
setsize: l?.setsize ?? 1,
|
|
3066
|
-
isParent:
|
|
3256
|
+
isParent: i.has(c.id),
|
|
3067
3257
|
isExpanded: r.has(c.id),
|
|
3068
|
-
isSelected:
|
|
3069
|
-
onToggleExpand:
|
|
3258
|
+
isSelected: u === c.id,
|
|
3259
|
+
onToggleExpand: a,
|
|
3070
3260
|
onSelect: w,
|
|
3071
3261
|
columns: S,
|
|
3072
3262
|
treeCell: t?.treeCell
|
|
3073
3263
|
}, c.id);
|
|
3074
3264
|
}),
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
style: { height: (n.length - A.end) *
|
|
3265
|
+
/* @__PURE__ */ v("div", {
|
|
3266
|
+
style: { height: (n.length - A.end) * d },
|
|
3077
3267
|
role: "presentation",
|
|
3078
3268
|
"aria-hidden": "true"
|
|
3079
3269
|
})
|
|
@@ -3084,79 +3274,77 @@ function Rr({ columns: e = [], taskList: t }) {
|
|
|
3084
3274
|
}
|
|
3085
3275
|
//#endregion
|
|
3086
3276
|
//#region src/hooks/useGridResize.ts
|
|
3087
|
-
function
|
|
3088
|
-
let [n, r] =
|
|
3277
|
+
function ii(e, t) {
|
|
3278
|
+
let [n, r] = m(void 0), i = p(null);
|
|
3089
3279
|
return {
|
|
3090
3280
|
gridWidth: n,
|
|
3091
|
-
onHandleMouseDown:
|
|
3281
|
+
onHandleMouseDown: o((n) => {
|
|
3092
3282
|
n.preventDefault();
|
|
3093
|
-
let
|
|
3094
|
-
if (!
|
|
3095
|
-
|
|
3283
|
+
let a = t.current, o = e.current;
|
|
3284
|
+
if (!a || !o) return;
|
|
3285
|
+
i.current = {
|
|
3096
3286
|
mouseX: n.clientX,
|
|
3097
|
-
width:
|
|
3287
|
+
width: a.offsetWidth,
|
|
3098
3288
|
containerW: o.offsetWidth
|
|
3099
3289
|
};
|
|
3100
3290
|
let s = (e) => {
|
|
3101
|
-
if (!
|
|
3102
|
-
let { mouseX: t, width: n, containerW:
|
|
3103
|
-
r(Math.min(
|
|
3291
|
+
if (!i.current) return;
|
|
3292
|
+
let { mouseX: t, width: n, containerW: a } = i.current;
|
|
3293
|
+
r(Math.min(a, Math.max(10, n + (t - e.clientX))));
|
|
3104
3294
|
}, c = () => {
|
|
3105
|
-
|
|
3295
|
+
i.current = null, window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", c);
|
|
3106
3296
|
};
|
|
3107
3297
|
window.addEventListener("mousemove", s), window.addEventListener("mouseup", c);
|
|
3108
3298
|
}, [e, t])
|
|
3109
3299
|
};
|
|
3110
3300
|
}
|
|
3301
|
+
var ai = { actionsCell: "_actionsCell_1gvtx_1" };
|
|
3111
3302
|
//#endregion
|
|
3112
3303
|
//#region src/components/taskList/ActionsCell.tsx
|
|
3113
|
-
function
|
|
3114
|
-
let t =
|
|
3304
|
+
function oi(e) {
|
|
3305
|
+
let t = j(e.startDate, 1);
|
|
3115
3306
|
return {
|
|
3116
3307
|
id: `task-${Date.now()}`,
|
|
3117
3308
|
name: "New task",
|
|
3118
3309
|
startDate: t,
|
|
3119
|
-
endDate:
|
|
3310
|
+
endDate: j(t, 1),
|
|
3120
3311
|
duration: 1,
|
|
3121
3312
|
progress: 0,
|
|
3122
3313
|
type: "task",
|
|
3123
3314
|
parentId: e.parentId ?? null
|
|
3124
3315
|
};
|
|
3125
3316
|
}
|
|
3126
|
-
function
|
|
3127
|
-
return /* @__PURE__ */
|
|
3128
|
-
|
|
3129
|
-
display: "flex",
|
|
3130
|
-
gap: "8px"
|
|
3131
|
-
},
|
|
3317
|
+
function si({ task: e, api: t }) {
|
|
3318
|
+
return /* @__PURE__ */ y("div", {
|
|
3319
|
+
className: ai.actionsCell,
|
|
3132
3320
|
children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ v("button", {
|
|
3134
3322
|
type: "button",
|
|
3135
3323
|
title: "Edit",
|
|
3136
3324
|
"aria-label": t.labels.editTask(e),
|
|
3137
3325
|
onClick: (n) => {
|
|
3138
3326
|
n.stopPropagation(), t.editTask(e);
|
|
3139
3327
|
},
|
|
3140
|
-
children: /* @__PURE__ */
|
|
3328
|
+
children: /* @__PURE__ */ v("span", {
|
|
3141
3329
|
"aria-hidden": "true",
|
|
3142
3330
|
children: "✎"
|
|
3143
3331
|
})
|
|
3144
3332
|
}),
|
|
3145
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ v("button", {
|
|
3146
3334
|
type: "button",
|
|
3147
3335
|
title: "Add after",
|
|
3148
3336
|
"aria-label": t.labels.addTaskAfter(e),
|
|
3149
3337
|
onClick: (n) => {
|
|
3150
3338
|
n.stopPropagation();
|
|
3151
|
-
let r =
|
|
3339
|
+
let r = oi(e);
|
|
3152
3340
|
t.createTask(r, e.id), t.editTask(r);
|
|
3153
3341
|
},
|
|
3154
|
-
children: /* @__PURE__ */
|
|
3342
|
+
children: /* @__PURE__ */ v("span", {
|
|
3155
3343
|
"aria-hidden": "true",
|
|
3156
3344
|
children: "➕"
|
|
3157
3345
|
})
|
|
3158
3346
|
}),
|
|
3159
|
-
/* @__PURE__ */
|
|
3347
|
+
/* @__PURE__ */ v("button", {
|
|
3160
3348
|
type: "button",
|
|
3161
3349
|
title: "Delete",
|
|
3162
3350
|
"aria-label": t.labels.deleteTask(e),
|
|
@@ -3164,7 +3352,7 @@ function Vr({ task: e, api: t }) {
|
|
|
3164
3352
|
onClick: (n) => {
|
|
3165
3353
|
n.stopPropagation(), t.deleteTask(e.id);
|
|
3166
3354
|
},
|
|
3167
|
-
children: /* @__PURE__ */
|
|
3355
|
+
children: /* @__PURE__ */ v("span", {
|
|
3168
3356
|
"aria-hidden": "true",
|
|
3169
3357
|
children: "❌"
|
|
3170
3358
|
})
|
|
@@ -3174,12 +3362,12 @@ function Vr({ task: e, api: t }) {
|
|
|
3174
3362
|
}
|
|
3175
3363
|
//#endregion
|
|
3176
3364
|
//#region src/components/taskList/defaultColumns.tsx
|
|
3177
|
-
var
|
|
3365
|
+
var ci = "__action", li = [
|
|
3178
3366
|
{
|
|
3179
|
-
key:
|
|
3367
|
+
key: ci,
|
|
3180
3368
|
header: " ",
|
|
3181
|
-
width:
|
|
3182
|
-
render: (e, t) => /* @__PURE__ */
|
|
3369
|
+
width: 100,
|
|
3370
|
+
render: (e, t) => /* @__PURE__ */ v(si, {
|
|
3183
3371
|
task: e,
|
|
3184
3372
|
api: t
|
|
3185
3373
|
})
|
|
@@ -3209,12 +3397,12 @@ var Hr = "__action", Ur = [
|
|
|
3209
3397
|
width: 90,
|
|
3210
3398
|
render: (e) => `${e.progress ?? 0}%`
|
|
3211
3399
|
}
|
|
3212
|
-
],
|
|
3400
|
+
], ui = li.filter((e) => e.key !== ci);
|
|
3213
3401
|
//#endregion
|
|
3214
3402
|
//#region src/Gantt.tsx
|
|
3215
|
-
function
|
|
3216
|
-
let
|
|
3217
|
-
return /* @__PURE__ */
|
|
3403
|
+
function di({ tasks: e, dependencies: t, rowHeight: n, colWidth: r, height: i, scales: a, padDays: o, zoomLevels: s, defaultZoomIndex: c, onZoomChange: l, zoomWheel: u, zoomKeyboard: d, onTaskClick: m, columns: h, defaultTaskListWidth: g = 280, onDependencyCreate: _, onDependencyDelete: b, onTaskCreate: x, onTaskDelete: S, onTaskEdit: C, onTasksChange: w, calendar: T, snapToWorking: E, durationUnit: D, readOnly: O = !1, apiRef: k, hideTaskList: A, taskList: j, bars: M, dependencySlots: N, timeline: P, labels: F }) {
|
|
3404
|
+
let ee = p(null), I = p(null), { gridWidth: L, onHandleMouseDown: R } = ii(ee, I), z = h ?? (O ? ui : li), B = !A;
|
|
3405
|
+
return /* @__PURE__ */ v(Cn, {
|
|
3218
3406
|
tasks: e,
|
|
3219
3407
|
dependencies: t,
|
|
3220
3408
|
rowHeight: n,
|
|
@@ -3224,41 +3412,41 @@ function Gr({ tasks: e, dependencies: t, rowHeight: n, colWidth: r, height: i, s
|
|
|
3224
3412
|
padDays: o,
|
|
3225
3413
|
zoomLevels: s,
|
|
3226
3414
|
defaultZoomIndex: c,
|
|
3227
|
-
onZoomChange:
|
|
3228
|
-
zoomWheel:
|
|
3229
|
-
zoomKeyboard:
|
|
3230
|
-
onTaskClick:
|
|
3231
|
-
onDependencyCreate:
|
|
3415
|
+
onZoomChange: l,
|
|
3416
|
+
zoomWheel: u,
|
|
3417
|
+
zoomKeyboard: d,
|
|
3418
|
+
onTaskClick: m,
|
|
3419
|
+
onDependencyCreate: _,
|
|
3232
3420
|
onDependencyDelete: b,
|
|
3233
3421
|
onTaskCreate: x,
|
|
3234
3422
|
onTaskDelete: S,
|
|
3235
3423
|
onTaskEdit: C,
|
|
3236
3424
|
onTasksChange: w,
|
|
3237
3425
|
apiRef: k,
|
|
3238
|
-
labels:
|
|
3426
|
+
labels: F,
|
|
3239
3427
|
calendar: T,
|
|
3240
3428
|
snapToWorking: E,
|
|
3241
3429
|
durationUnit: D,
|
|
3242
3430
|
readOnly: O,
|
|
3243
|
-
children: /* @__PURE__ */
|
|
3244
|
-
value:
|
|
3431
|
+
children: /* @__PURE__ */ v(Tn, {
|
|
3432
|
+
value: f(() => ({
|
|
3245
3433
|
bars: M,
|
|
3246
|
-
dependencies:
|
|
3247
|
-
timeline:
|
|
3434
|
+
dependencies: N,
|
|
3435
|
+
timeline: P
|
|
3248
3436
|
}), [
|
|
3249
3437
|
M,
|
|
3250
|
-
|
|
3251
|
-
|
|
3438
|
+
N,
|
|
3439
|
+
P
|
|
3252
3440
|
]),
|
|
3253
|
-
children:
|
|
3254
|
-
ref:
|
|
3441
|
+
children: B ? /* @__PURE__ */ y("div", {
|
|
3442
|
+
ref: ee,
|
|
3255
3443
|
role: "group",
|
|
3256
|
-
"aria-label":
|
|
3444
|
+
"aria-label": F?.gantt ?? Ie.gantt,
|
|
3257
3445
|
style: { position: "relative" },
|
|
3258
|
-
children: [/* @__PURE__ */
|
|
3259
|
-
columns:
|
|
3446
|
+
children: [/* @__PURE__ */ v(ri, {
|
|
3447
|
+
columns: z,
|
|
3260
3448
|
taskList: j
|
|
3261
|
-
}), /* @__PURE__ */
|
|
3449
|
+
}), /* @__PURE__ */ y("div", {
|
|
3262
3450
|
ref: I,
|
|
3263
3451
|
style: {
|
|
3264
3452
|
position: "absolute",
|
|
@@ -3268,21 +3456,21 @@ function Gr({ tasks: e, dependencies: t, rowHeight: n, colWidth: r, height: i, s
|
|
|
3268
3456
|
display: "flex",
|
|
3269
3457
|
flexDirection: "row",
|
|
3270
3458
|
background: "var(--am-gantt-grid-bg, #ffffff)",
|
|
3271
|
-
...
|
|
3459
|
+
...L === void 0 ? { left: g } : { width: L }
|
|
3272
3460
|
},
|
|
3273
|
-
children: [/* @__PURE__ */
|
|
3461
|
+
children: [/* @__PURE__ */ v(Yr, { onMouseDown: R }), /* @__PURE__ */ v("div", {
|
|
3274
3462
|
style: {
|
|
3275
3463
|
flex: "1 1 auto",
|
|
3276
3464
|
minWidth: 0
|
|
3277
3465
|
},
|
|
3278
|
-
children: /* @__PURE__ */
|
|
3466
|
+
children: /* @__PURE__ */ v(qr, {})
|
|
3279
3467
|
})]
|
|
3280
3468
|
})]
|
|
3281
|
-
}) : /* @__PURE__ */
|
|
3469
|
+
}) : /* @__PURE__ */ v(qr, {})
|
|
3282
3470
|
})
|
|
3283
3471
|
});
|
|
3284
3472
|
}
|
|
3285
3473
|
//#endregion
|
|
3286
|
-
export {
|
|
3474
|
+
export { ci as ACTION_COLUMN_KEY, Hn as BarTooltipRoot, Yn as BarTooltipTrigger, Mn as Calendar, li as DEFAULT_COLUMNS, Wt as DEFAULT_ZOOM_INDEX, Ut as DEFAULT_ZOOM_LEVELS, di as Gantt, Qn as GanttBarTooltip, qr as GanttGrid, Cn as GanttProvider, Tn as GanttSlotsProvider, nr as MilestoneBar, sr as ProjectBar, ui as READ_ONLY_COLUMNS, ur as TaskBar, ri as TaskList, Me as displayEndDate, Ne as endInstantFromDisplayDate, Y as mergeSlotProps, Vn as useBarTooltip, rn as useGanttReadOnly, J as useGanttSlots };
|
|
3287
3475
|
|
|
3288
3476
|
//# sourceMappingURL=index.mjs.map
|