@art-tools/react-gantt 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1278 -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,175 @@ 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/BarTooltipTrigger.tsx
|
|
1827
|
+
function Un({ children: e }) {
|
|
1828
|
+
let n = Vn(), i = n?.open ?? !1, a = n?.setOpen, o = n?.anchorRef;
|
|
1829
|
+
if (l(() => {
|
|
1830
|
+
if (!i || !a) return;
|
|
1831
|
+
let e = () => a(!1), t = (e) => {
|
|
1832
|
+
let t = o?.current?.getBoundingClientRect();
|
|
1833
|
+
!t || t.width === 0 || t.height === 0 || e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom || a(!1);
|
|
1834
|
+
};
|
|
1835
|
+
return document.addEventListener("scroll", e, {
|
|
1836
|
+
capture: !0,
|
|
1837
|
+
passive: !0
|
|
1838
|
+
}), document.addEventListener("mousemove", t, { passive: !0 }), () => {
|
|
1839
|
+
document.removeEventListener("scroll", e, { capture: !0 }), document.removeEventListener("mousemove", t);
|
|
1840
|
+
};
|
|
1841
|
+
}, [
|
|
1842
|
+
i,
|
|
1843
|
+
a,
|
|
1844
|
+
o
|
|
1845
|
+
]), !a || !r(e)) return e;
|
|
1846
|
+
let { onMouseEnter: s, onMouseLeave: c } = e.props;
|
|
1847
|
+
return t(e, {
|
|
1848
|
+
onMouseEnter: (e) => {
|
|
1849
|
+
s?.(e), a(!0);
|
|
1850
|
+
},
|
|
1851
|
+
onMouseLeave: (e) => {
|
|
1852
|
+
c?.(e), a(!1);
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
}
|
|
1856
|
+
//#endregion
|
|
1857
|
+
//#region src/components/bars/barTooltip/useTooltipPosition.ts
|
|
1858
|
+
var Wn = 12, Gn = 8;
|
|
1859
|
+
function Kn(e, t, n, r) {
|
|
1860
|
+
let i = e + Wn, a = i + t <= r - Gn;
|
|
1861
|
+
return Math.max(a ? i : e - Wn - t, n + Gn);
|
|
1862
|
+
}
|
|
1863
|
+
var qn = (e, t) => {
|
|
1864
|
+
let n = s(dn)?.gridRef, [r, i] = m({
|
|
1865
|
+
left: -9999,
|
|
1866
|
+
top: -9999
|
|
1867
|
+
}), a = c(r);
|
|
1868
|
+
return l(() => {
|
|
1869
|
+
if (!t) return;
|
|
1870
|
+
let r = (t) => {
|
|
1871
|
+
let { clientX: r, clientY: a } = t, o = n?.current?.getBoundingClientRect(), s = o && o.width > 0 && o.height > 0 ? {
|
|
1872
|
+
left: o.left,
|
|
1873
|
+
top: o.top,
|
|
1874
|
+
right: o.right,
|
|
1875
|
+
bottom: o.bottom
|
|
1876
|
+
} : {
|
|
1877
|
+
left: 0,
|
|
1878
|
+
top: 0,
|
|
1879
|
+
right: window.innerWidth,
|
|
1880
|
+
bottom: window.innerHeight
|
|
1881
|
+
};
|
|
1882
|
+
if (r < s.left || r > s.right || a < s.top || a > s.bottom) return;
|
|
1883
|
+
let c = e.current?.getBoundingClientRect(), l = c?.width ?? 0, u = c?.height ?? 0, d = Kn(r, l, s.left, s.right), f = Kn(a, u, s.top, s.bottom);
|
|
1884
|
+
i((e) => e.left === d && e.top === f ? e : {
|
|
1885
|
+
left: d,
|
|
1886
|
+
top: f
|
|
1887
|
+
});
|
|
1888
|
+
};
|
|
1889
|
+
return window.addEventListener("mousemove", r), () => {
|
|
1890
|
+
window.removeEventListener("mousemove", r);
|
|
1891
|
+
};
|
|
1892
|
+
}, [
|
|
1893
|
+
e,
|
|
1894
|
+
n,
|
|
1895
|
+
t
|
|
1896
|
+
]), a;
|
|
1897
|
+
};
|
|
1898
|
+
//#endregion
|
|
1899
|
+
//#region src/components/bars/barTooltip/BarTooltip.tsx
|
|
1900
|
+
function Jn(e) {
|
|
1901
|
+
return e ? e.toLocaleDateString(void 0, {
|
|
1902
|
+
year: "numeric",
|
|
1903
|
+
month: "short",
|
|
1904
|
+
day: "numeric"
|
|
1905
|
+
}) : "—";
|
|
1906
|
+
}
|
|
1907
|
+
function Yn({ task: e, progress: t, displayEnd: n, className: r, style: i, ...a }) {
|
|
1908
|
+
let o = p(null), s = Vn()?.open ?? !1, c = qn(o, s);
|
|
1909
|
+
return !s || typeof document > "u" ? null : h(/* @__PURE__ */ y("div", {
|
|
1910
|
+
role: "tooltip",
|
|
1911
|
+
ref: o,
|
|
1912
|
+
className: r ? `${X.tooltip} ${r}` : X.tooltip,
|
|
1913
|
+
style: {
|
|
1914
|
+
...i,
|
|
1915
|
+
...c
|
|
1916
|
+
},
|
|
1917
|
+
...a,
|
|
1918
|
+
children: [
|
|
1919
|
+
/* @__PURE__ */ v("div", {
|
|
1920
|
+
className: X.name,
|
|
1921
|
+
children: e.name
|
|
1922
|
+
}),
|
|
1923
|
+
/* @__PURE__ */ y("div", {
|
|
1924
|
+
className: X.row,
|
|
1925
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1926
|
+
className: X.label,
|
|
1927
|
+
children: "Start"
|
|
1928
|
+
}), /* @__PURE__ */ v("span", { children: Jn(e.startDate) })]
|
|
1929
|
+
}),
|
|
1930
|
+
/* @__PURE__ */ y("div", {
|
|
1931
|
+
className: X.row,
|
|
1932
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1933
|
+
className: X.label,
|
|
1934
|
+
children: "End"
|
|
1935
|
+
}), /* @__PURE__ */ v("span", { children: Jn(n) })]
|
|
1936
|
+
}),
|
|
1937
|
+
/* @__PURE__ */ y("div", {
|
|
1938
|
+
className: X.row,
|
|
1939
|
+
children: [/* @__PURE__ */ v("span", {
|
|
1940
|
+
className: X.label,
|
|
1941
|
+
children: "Progress"
|
|
1942
|
+
}), /* @__PURE__ */ y("span", { children: [Math.round(t), "%"] })]
|
|
1943
|
+
})
|
|
1944
|
+
]
|
|
1945
|
+
}), document.body);
|
|
1946
|
+
}
|
|
1947
|
+
function Xn({ task: e, progress: t, displayEnd: n, anchorRef: r, className: i, style: a, children: o, ...s }) {
|
|
1948
|
+
return /* @__PURE__ */ y(Hn, {
|
|
1949
|
+
anchorRef: r,
|
|
1950
|
+
children: [/* @__PURE__ */ v(Un, { children: o }), /* @__PURE__ */ v(Yn, {
|
|
1951
|
+
task: e,
|
|
1952
|
+
progress: t,
|
|
1953
|
+
displayEnd: n,
|
|
1954
|
+
className: i,
|
|
1955
|
+
style: a,
|
|
1956
|
+
...s
|
|
1957
|
+
})]
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
//#endregion
|
|
1961
|
+
//#region src/components/bars/barTooltip/BarTooltipConsumer.tsx
|
|
1962
|
+
function Zn({ children: e, tooltip: t, anchorRef: n }) {
|
|
1963
|
+
let r = J().bars?.tooltip, i = r?.slots?.tooltip;
|
|
1964
|
+
return !i || !t ? e : /* @__PURE__ */ v(i, {
|
|
1965
|
+
...Y({}, r?.slotProps?.tooltip, t),
|
|
1966
|
+
anchorRef: n,
|
|
1967
|
+
...t,
|
|
1968
|
+
children: e
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1806
1971
|
//#endregion
|
|
1807
1972
|
//#region src/components/bars/common/DraggableBar.tsx
|
|
1808
|
-
function
|
|
1809
|
-
let p = !l && !u,
|
|
1973
|
+
function Qn({ 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 }) {
|
|
1974
|
+
let _ = p(null), y = !l && !u, b = zn({
|
|
1810
1975
|
onStart: () => ({ start: a }),
|
|
1811
1976
|
onDrag: (e, { start: t }) => l?.(t + e),
|
|
1812
1977
|
onEnd: (e, { start: t }) => {
|
|
@@ -1814,42 +1979,50 @@ function Fn({ left: e, top: t, width: n, height: r, colWidth: i, dragAnchor: a,
|
|
|
1814
1979
|
u?.(n);
|
|
1815
1980
|
},
|
|
1816
1981
|
autoScroll: !0
|
|
1817
|
-
}),
|
|
1818
|
-
return /* @__PURE__ */
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1982
|
+
}), x = !!(l || u);
|
|
1983
|
+
return /* @__PURE__ */ v(Zn, {
|
|
1984
|
+
tooltip: d,
|
|
1985
|
+
anchorRef: _,
|
|
1986
|
+
children: /* @__PURE__ */ v("div", {
|
|
1987
|
+
...g,
|
|
1988
|
+
ref: _,
|
|
1989
|
+
className: o,
|
|
1990
|
+
style: {
|
|
1991
|
+
left: e,
|
|
1992
|
+
top: t,
|
|
1993
|
+
width: n,
|
|
1994
|
+
height: r,
|
|
1995
|
+
cursor: y ? "default" : "move",
|
|
1996
|
+
...c
|
|
1997
|
+
},
|
|
1998
|
+
title: s,
|
|
1999
|
+
onMouseDown: x ? b : void 0,
|
|
2000
|
+
onMouseEnter: f,
|
|
2001
|
+
onMouseLeave: m,
|
|
2002
|
+
children: h
|
|
2003
|
+
})
|
|
1832
2004
|
});
|
|
1833
2005
|
}
|
|
1834
|
-
var
|
|
2006
|
+
var $n = {
|
|
1835
2007
|
milestone: "_milestone_o4jql_1",
|
|
1836
2008
|
milestoneShape: "_milestoneShape_o4jql_5"
|
|
1837
2009
|
};
|
|
1838
2010
|
//#endregion
|
|
1839
2011
|
//#region src/components/bars/milestoneBar/MilestoneBar.tsx
|
|
1840
|
-
function
|
|
1841
|
-
let
|
|
2012
|
+
function er({ size: e, centerLeft: t, top: n, colWidth: r, title: i, a11y: a, onMove: o, onMoveEnd: s, tooltip: c, slots: l, slotProps: u }) {
|
|
2013
|
+
let d = J(), f = l ?? d.bars?.milestoneBar?.slots, p = u ?? d.bars?.milestoneBar?.slotProps, m = {
|
|
1842
2014
|
size: e,
|
|
1843
2015
|
title: i
|
|
1844
|
-
}, h =
|
|
1845
|
-
className:
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
},
|
|
1849
|
-
className:
|
|
2016
|
+
}, h = f?.root ?? Qn, g = f?.shape ?? "div", _ = Y({
|
|
2017
|
+
className: $n.milestone,
|
|
2018
|
+
...a,
|
|
2019
|
+
title: a ? a.title : i
|
|
2020
|
+
}, p?.root, m), y = Y({
|
|
2021
|
+
className: $n.milestoneShape,
|
|
1850
2022
|
"aria-hidden": !0
|
|
1851
|
-
},
|
|
1852
|
-
return /* @__PURE__ */
|
|
2023
|
+
}, p?.shape, m);
|
|
2024
|
+
return /* @__PURE__ */ v(h, {
|
|
2025
|
+
tooltip: c,
|
|
1853
2026
|
left: t - e / 2,
|
|
1854
2027
|
top: n,
|
|
1855
2028
|
width: e,
|
|
@@ -1859,17 +2032,17 @@ function Ln({ size: e, centerLeft: t, top: n, colWidth: r, title: i, a11y: a, on
|
|
|
1859
2032
|
onMove: o,
|
|
1860
2033
|
onMoveEnd: s,
|
|
1861
2034
|
..._,
|
|
1862
|
-
children: /* @__PURE__ */
|
|
2035
|
+
children: /* @__PURE__ */ v(g, { ...y })
|
|
1863
2036
|
});
|
|
1864
2037
|
}
|
|
1865
|
-
var
|
|
2038
|
+
var tr = {
|
|
1866
2039
|
barProgress: "_barProgress_1obm3_1",
|
|
1867
2040
|
barProgressResizeHandle: "_barProgressResizeHandle_1obm3_10"
|
|
1868
2041
|
};
|
|
1869
2042
|
//#endregion
|
|
1870
2043
|
//#region src/components/bars/progress/BarProgressResizeHandle.tsx
|
|
1871
|
-
function
|
|
1872
|
-
let o =
|
|
2044
|
+
function nr({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, slotProps: a }) {
|
|
2045
|
+
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
2046
|
onStart: () => ({ startWidth: e }),
|
|
1874
2047
|
onDrag: (e, { startWidth: n }) => t(l(e, n)),
|
|
1875
2048
|
onEnd: (e, { startWidth: t }) => n?.(l(e, t))
|
|
@@ -1877,8 +2050,8 @@ function zn({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, s
|
|
|
1877
2050
|
width: e,
|
|
1878
2051
|
parentWidth: r
|
|
1879
2052
|
};
|
|
1880
|
-
return /* @__PURE__ */
|
|
1881
|
-
className:
|
|
2053
|
+
return /* @__PURE__ */ v(s?.root ?? "div", { ...Y({
|
|
2054
|
+
className: tr.barProgressResizeHandle,
|
|
1882
2055
|
"aria-hidden": !0,
|
|
1883
2056
|
tabIndex: -1,
|
|
1884
2057
|
onMouseDown: u
|
|
@@ -1886,21 +2059,21 @@ function zn({ width: e, onResize: t, onResizeEnd: n, parentWidth: r, slots: i, s
|
|
|
1886
2059
|
}
|
|
1887
2060
|
//#endregion
|
|
1888
2061
|
//#region src/components/bars/progress/BarProgress.tsx
|
|
1889
|
-
function
|
|
1890
|
-
let s =
|
|
2062
|
+
function rr({ progress: e, width: t, height: n, onProgressChange: r, onProgressEnd: i, slots: a, slotProps: o }) {
|
|
2063
|
+
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
2064
|
progress: e,
|
|
1892
2065
|
width: u,
|
|
1893
2066
|
height: n
|
|
1894
2067
|
};
|
|
1895
|
-
return /* @__PURE__ */
|
|
1896
|
-
...
|
|
1897
|
-
className:
|
|
2068
|
+
return /* @__PURE__ */ v(c?.root ?? "div", {
|
|
2069
|
+
...Y({
|
|
2070
|
+
className: tr.barProgress,
|
|
1898
2071
|
style: {
|
|
1899
2072
|
width: u,
|
|
1900
2073
|
height: n
|
|
1901
2074
|
}
|
|
1902
2075
|
}, l?.root, f),
|
|
1903
|
-
children: r && /* @__PURE__ */
|
|
2076
|
+
children: r && /* @__PURE__ */ v(nr, {
|
|
1904
2077
|
width: u,
|
|
1905
2078
|
parentWidth: t,
|
|
1906
2079
|
onResize: (e) => r(d(e)),
|
|
@@ -1908,31 +2081,32 @@ function Bn({ progress: e, width: t, height: n, onProgressChange: r, onProgressE
|
|
|
1908
2081
|
})
|
|
1909
2082
|
});
|
|
1910
2083
|
}
|
|
1911
|
-
var
|
|
2084
|
+
var ir = {
|
|
1912
2085
|
project: "_project_927ph_1",
|
|
1913
2086
|
projectInner: "_projectInner_927ph_10",
|
|
1914
2087
|
projectContent: "_projectContent_927ph_16"
|
|
1915
2088
|
};
|
|
1916
2089
|
//#endregion
|
|
1917
2090
|
//#region src/components/bars/projectBar/ProjectBar.tsx
|
|
1918
|
-
function
|
|
1919
|
-
let
|
|
2091
|
+
function ar({ 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 }) {
|
|
2092
|
+
let h = J(), g = p ?? h.bars?.projectBar?.slots, _ = m ?? h.bars?.projectBar?.slotProps, b = {
|
|
1920
2093
|
width: e,
|
|
1921
2094
|
height: t,
|
|
1922
2095
|
progress: s,
|
|
1923
2096
|
title: a
|
|
1924
|
-
},
|
|
1925
|
-
className:
|
|
2097
|
+
}, x = g?.root ?? Qn, S = g?.inner ?? "div", C = g?.label ?? "div", w = Y({
|
|
2098
|
+
className: ir.project,
|
|
1926
2099
|
style: { lineHeight: `${t}px` },
|
|
1927
2100
|
...o
|
|
1928
|
-
},
|
|
1929
|
-
className:
|
|
2101
|
+
}, _?.root, b), T = Y({
|
|
2102
|
+
className: ir.projectInner,
|
|
1930
2103
|
"aria-hidden": !0
|
|
1931
|
-
},
|
|
1932
|
-
className:
|
|
2104
|
+
}, _?.inner, b), E = Y({
|
|
2105
|
+
className: ir.projectContent,
|
|
1933
2106
|
children: a
|
|
1934
|
-
},
|
|
1935
|
-
return /* @__PURE__ */
|
|
2107
|
+
}, _?.label, b);
|
|
2108
|
+
return /* @__PURE__ */ v(x, {
|
|
2109
|
+
tooltip: f,
|
|
1936
2110
|
left: n,
|
|
1937
2111
|
top: r,
|
|
1938
2112
|
width: e,
|
|
@@ -1941,20 +2115,20 @@ function Hn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
1941
2115
|
dragAnchor: n,
|
|
1942
2116
|
onMove: u,
|
|
1943
2117
|
onMoveEnd: d,
|
|
1944
|
-
...
|
|
1945
|
-
children: /* @__PURE__ */
|
|
1946
|
-
...
|
|
1947
|
-
children: [/* @__PURE__ */
|
|
2118
|
+
...w,
|
|
2119
|
+
children: /* @__PURE__ */ y(S, {
|
|
2120
|
+
...T,
|
|
2121
|
+
children: [/* @__PURE__ */ v(rr, {
|
|
1948
2122
|
width: e,
|
|
1949
2123
|
height: t,
|
|
1950
2124
|
progress: s,
|
|
1951
2125
|
onProgressChange: c,
|
|
1952
2126
|
onProgressEnd: l
|
|
1953
|
-
}), /* @__PURE__ */
|
|
2127
|
+
}), /* @__PURE__ */ v(C, { ...E })]
|
|
1954
2128
|
})
|
|
1955
2129
|
});
|
|
1956
2130
|
}
|
|
1957
|
-
var
|
|
2131
|
+
var or = {
|
|
1958
2132
|
task: "_task_18g5p_1",
|
|
1959
2133
|
taskInner: "_taskInner_18g5p_9",
|
|
1960
2134
|
taskContent: "_taskContent_18g5p_15",
|
|
@@ -1964,8 +2138,8 @@ var Un = {
|
|
|
1964
2138
|
};
|
|
1965
2139
|
//#endregion
|
|
1966
2140
|
//#region src/components/bars/taskBar/TaskResizer.tsx
|
|
1967
|
-
function
|
|
1968
|
-
let s =
|
|
2141
|
+
function sr({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots: a, slotProps: o }) {
|
|
2142
|
+
let s = J(), c = a ?? s.bars?.taskResizer?.slots, l = o ?? s.bars?.taskResizer?.slotProps, u = zn({
|
|
1969
2143
|
onStart: () => ({
|
|
1970
2144
|
startWidth: e,
|
|
1971
2145
|
startLeft: t
|
|
@@ -1978,7 +2152,7 @@ function Wn({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots
|
|
|
1978
2152
|
let a = r + Math.min(e, t);
|
|
1979
2153
|
i("start", Math.round(a / n) * n);
|
|
1980
2154
|
}
|
|
1981
|
-
}), d =
|
|
2155
|
+
}), d = zn({
|
|
1982
2156
|
onStart: () => ({
|
|
1983
2157
|
startWidth: e,
|
|
1984
2158
|
startLeft: t
|
|
@@ -1993,42 +2167,43 @@ function Wn({ width: e, left: t, colWidth: n, onResize: r, onResizeEnd: i, slots
|
|
|
1993
2167
|
}), f = {
|
|
1994
2168
|
width: e,
|
|
1995
2169
|
left: t
|
|
1996
|
-
},
|
|
2170
|
+
}, p = c?.startHandle ?? "button", m = c?.endHandle ?? "button", h = Y({
|
|
1997
2171
|
type: "button",
|
|
1998
2172
|
"aria-hidden": !0,
|
|
1999
2173
|
tabIndex: -1,
|
|
2000
|
-
className:
|
|
2174
|
+
className: Dn(or.resizer, or.startResizer),
|
|
2001
2175
|
onMouseDown: u
|
|
2002
|
-
}, l?.startHandle, f),
|
|
2176
|
+
}, l?.startHandle, f), g = Y({
|
|
2003
2177
|
type: "button",
|
|
2004
2178
|
"aria-hidden": !0,
|
|
2005
2179
|
tabIndex: -1,
|
|
2006
|
-
className:
|
|
2180
|
+
className: Dn(or.resizer, or.endResizer),
|
|
2007
2181
|
onMouseDown: d
|
|
2008
2182
|
}, l?.endHandle, f);
|
|
2009
|
-
return /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(p, { ...h }), /* @__PURE__ */ v(m, { ...g })] });
|
|
2010
2184
|
}
|
|
2011
2185
|
//#endregion
|
|
2012
2186
|
//#region src/components/bars/taskBar/TaskBar.tsx
|
|
2013
|
-
function
|
|
2014
|
-
let
|
|
2187
|
+
function cr({ 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 }) {
|
|
2188
|
+
let _ = J(), b = h ?? _.bars?.taskBar?.slots, x = g ?? _.bars?.taskBar?.slotProps, S = {
|
|
2015
2189
|
width: e,
|
|
2016
2190
|
height: t,
|
|
2017
2191
|
progress: s,
|
|
2018
2192
|
title: a
|
|
2019
|
-
},
|
|
2020
|
-
className: `${
|
|
2193
|
+
}, C = b?.root ?? Qn, w = b?.inner ?? "div", T = b?.label ?? "div", E = Y({
|
|
2194
|
+
className: `${or.task} am-gantt-bar-task`,
|
|
2021
2195
|
style: { lineHeight: `${t}px` },
|
|
2022
2196
|
...o
|
|
2023
|
-
},
|
|
2024
|
-
className:
|
|
2197
|
+
}, x?.root, S), D = Y({
|
|
2198
|
+
className: or.taskInner,
|
|
2025
2199
|
"aria-hidden": !0
|
|
2026
|
-
},
|
|
2027
|
-
className:
|
|
2028
|
-
title:
|
|
2200
|
+
}, x?.inner, S), O = Y({
|
|
2201
|
+
className: or.taskContent,
|
|
2202
|
+
title: o?.title,
|
|
2029
2203
|
children: a
|
|
2030
|
-
},
|
|
2031
|
-
return /* @__PURE__ */
|
|
2204
|
+
}, x?.label, S);
|
|
2205
|
+
return /* @__PURE__ */ v(C, {
|
|
2206
|
+
tooltip: m,
|
|
2032
2207
|
left: n,
|
|
2033
2208
|
top: r,
|
|
2034
2209
|
width: e,
|
|
@@ -2037,19 +2212,19 @@ function Gn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
2037
2212
|
dragAnchor: n,
|
|
2038
2213
|
onMove: f,
|
|
2039
2214
|
onMoveEnd: p,
|
|
2040
|
-
...
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2042
|
-
...
|
|
2215
|
+
...E,
|
|
2216
|
+
children: /* @__PURE__ */ y(w, {
|
|
2217
|
+
...D,
|
|
2043
2218
|
children: [
|
|
2044
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ v(rr, {
|
|
2045
2220
|
width: e,
|
|
2046
2221
|
height: t,
|
|
2047
2222
|
progress: s,
|
|
2048
2223
|
onProgressChange: c,
|
|
2049
2224
|
onProgressEnd: l
|
|
2050
2225
|
}),
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
u && d && /* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ v(T, { ...O }),
|
|
2227
|
+
u && d && /* @__PURE__ */ v(sr, {
|
|
2053
2228
|
width: e,
|
|
2054
2229
|
left: n,
|
|
2055
2230
|
colWidth: i,
|
|
@@ -2060,13 +2235,13 @@ function Gn({ width: e, height: t, left: n, top: r, colWidth: i, title: a, a11y:
|
|
|
2060
2235
|
})
|
|
2061
2236
|
});
|
|
2062
2237
|
}
|
|
2063
|
-
var
|
|
2238
|
+
var lr = {
|
|
2064
2239
|
handle: "_handle_fw6gu_1",
|
|
2065
2240
|
visible: "_visible_fw6gu_18"
|
|
2066
|
-
},
|
|
2067
|
-
function
|
|
2068
|
-
let s =
|
|
2069
|
-
let n =
|
|
2241
|
+
}, ur = 10 / 2;
|
|
2242
|
+
function dr({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots: a, slotProps: o }) {
|
|
2243
|
+
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) => {
|
|
2244
|
+
let n = p.current?.getBoundingClientRect();
|
|
2070
2245
|
if (!n) return {
|
|
2071
2246
|
x: 0,
|
|
2072
2247
|
y: 0
|
|
@@ -2076,9 +2251,9 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2076
2251
|
x: r.left + r.width / 2 - n.left,
|
|
2077
2252
|
y: r.top + r.height / 2 - n.top
|
|
2078
2253
|
};
|
|
2079
|
-
},
|
|
2254
|
+
}, h = (t, n) => {
|
|
2080
2255
|
t.stopPropagation(), t.preventDefault();
|
|
2081
|
-
let { x: r, y: i } =
|
|
2256
|
+
let { x: r, y: i } = m(t, n);
|
|
2082
2257
|
u({
|
|
2083
2258
|
fromTaskId: e,
|
|
2084
2259
|
handle: n,
|
|
@@ -2087,7 +2262,7 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2087
2262
|
currentX: r,
|
|
2088
2263
|
currentY: i
|
|
2089
2264
|
});
|
|
2090
|
-
},
|
|
2265
|
+
}, g = (t, n) => {
|
|
2091
2266
|
f && (t.stopPropagation(), d(e, n));
|
|
2092
2267
|
}, b = {
|
|
2093
2268
|
taskId: e,
|
|
@@ -2096,133 +2271,140 @@ function Jn({ taskId: e, barLeft: t, barWidth: n, barCenterY: r, show: i, slots:
|
|
|
2096
2271
|
barCenterY: r,
|
|
2097
2272
|
show: i,
|
|
2098
2273
|
isDragging: f
|
|
2099
|
-
}, x = c?.startHandle ?? "div", S = c?.endHandle ?? "div", C = i || f, w =
|
|
2274
|
+
}, x = c?.startHandle ?? "div", S = c?.endHandle ?? "div", C = i || f, w = Y({
|
|
2100
2275
|
"aria-hidden": !0,
|
|
2101
2276
|
tabIndex: -1,
|
|
2102
|
-
className:
|
|
2277
|
+
className: Dn(lr.handle, C && lr.visible),
|
|
2103
2278
|
style: {
|
|
2104
2279
|
left: t - 10,
|
|
2105
|
-
top: r -
|
|
2280
|
+
top: r - ur
|
|
2106
2281
|
},
|
|
2107
|
-
onMouseDown: (e) =>
|
|
2108
|
-
onMouseUp: (e) =>
|
|
2109
|
-
}, l?.startHandle, b), T =
|
|
2282
|
+
onMouseDown: (e) => h(e, "start"),
|
|
2283
|
+
onMouseUp: (e) => g(e, "start")
|
|
2284
|
+
}, l?.startHandle, b), T = Y({
|
|
2110
2285
|
"aria-hidden": !0,
|
|
2111
2286
|
tabIndex: -1,
|
|
2112
|
-
className:
|
|
2287
|
+
className: Dn(lr.handle, C && lr.visible),
|
|
2113
2288
|
style: {
|
|
2114
2289
|
left: t + n,
|
|
2115
|
-
top: r -
|
|
2290
|
+
top: r - ur
|
|
2116
2291
|
},
|
|
2117
|
-
onMouseDown: (e) =>
|
|
2118
|
-
onMouseUp: (e) =>
|
|
2292
|
+
onMouseDown: (e) => h(e, "end"),
|
|
2293
|
+
onMouseUp: (e) => g(e, "end")
|
|
2119
2294
|
}, l?.endHandle, b);
|
|
2120
|
-
return /* @__PURE__ */
|
|
2121
|
-
}
|
|
2122
|
-
var
|
|
2123
|
-
let
|
|
2124
|
-
startDate:
|
|
2125
|
-
endDate:
|
|
2126
|
-
}),
|
|
2127
|
-
startDate:
|
|
2128
|
-
endDate:
|
|
2129
|
-
}),
|
|
2295
|
+
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(x, { ...w }), /* @__PURE__ */ v(S, { ...T })] });
|
|
2296
|
+
}
|
|
2297
|
+
var fr = { row: "_row_1jios_13" }, pr = 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 }) {
|
|
2298
|
+
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) => ({
|
|
2299
|
+
startDate: Dt(e, n, r, o),
|
|
2300
|
+
endDate: Dt(e + S, n, r, o)
|
|
2301
|
+
}), P = (e, t) => ({
|
|
2302
|
+
startDate: Dt(t, n, r, o),
|
|
2303
|
+
endDate: Dt(t + e, n, r, o)
|
|
2304
|
+
}), F = (t) => {
|
|
2130
2305
|
c(e.id, t);
|
|
2131
|
-
},
|
|
2132
|
-
|
|
2306
|
+
}, ee = (e, t) => {
|
|
2307
|
+
a(() => {
|
|
2133
2308
|
l(e, t), c(e, null);
|
|
2134
2309
|
});
|
|
2135
|
-
},
|
|
2136
|
-
|
|
2310
|
+
}, I = (t) => {
|
|
2311
|
+
a(() => {
|
|
2137
2312
|
u(e.id, t), c(e.id, null);
|
|
2138
2313
|
});
|
|
2139
|
-
},
|
|
2314
|
+
}, L = (e) => ({
|
|
2140
2315
|
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) =>
|
|
2316
|
+
startDate: Dt(e, n, r, o)
|
|
2317
|
+
}), R = h ? {} : {
|
|
2318
|
+
onMove: (e) => F(N(e)),
|
|
2319
|
+
onMoveEnd: (e) => I(L(e))
|
|
2320
|
+
}, z = h ? {} : {
|
|
2321
|
+
onProgressChange: (e) => F({ progress: e }),
|
|
2322
|
+
onProgressEnd: (t) => ee(e.id, { progress: t })
|
|
2323
|
+
}, B = h ? {} : {
|
|
2324
|
+
onResize: (e, t) => F(P(e, t)),
|
|
2325
|
+
onResizeEnd: (e, t) => I(e === "start" ? {
|
|
2151
2326
|
kind: "resizeStart",
|
|
2152
|
-
startDate:
|
|
2327
|
+
startDate: Dt(t, n, r, o)
|
|
2153
2328
|
} : {
|
|
2154
2329
|
kind: "resizeEnd",
|
|
2155
|
-
endDate:
|
|
2330
|
+
endDate: Dt(t, n, r, o)
|
|
2156
2331
|
})
|
|
2157
|
-
},
|
|
2332
|
+
}, V = {
|
|
2158
2333
|
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
|
|
2334
|
+
"aria-colindex": Math.max(1, Math.floor(T / r) + 1),
|
|
2335
|
+
"aria-colspan": Math.max(1, Math.round(S / r)),
|
|
2336
|
+
"aria-label": p.bar(e, { progress: C }),
|
|
2337
|
+
"aria-selected": g || void 0,
|
|
2338
|
+
title: b ? void 0 : e.name
|
|
2339
|
+
}, te = {
|
|
2340
|
+
task: e,
|
|
2341
|
+
progress: C,
|
|
2342
|
+
displayEnd: Pe(e, _)
|
|
2164
2343
|
};
|
|
2165
|
-
return /* @__PURE__ */
|
|
2166
|
-
className:
|
|
2344
|
+
return /* @__PURE__ */ y("div", {
|
|
2345
|
+
className: fr.row,
|
|
2167
2346
|
style: {
|
|
2168
|
-
top:
|
|
2169
|
-
height:
|
|
2347
|
+
top: w,
|
|
2348
|
+
height: i
|
|
2170
2349
|
},
|
|
2171
|
-
onClick:
|
|
2172
|
-
onMouseEnter: () =>
|
|
2173
|
-
onMouseLeave: () =>
|
|
2350
|
+
onClick: d ? () => d(e) : void 0,
|
|
2351
|
+
onMouseEnter: () => M(!0),
|
|
2352
|
+
onMouseLeave: () => M(!1),
|
|
2174
2353
|
role: "row",
|
|
2175
|
-
"aria-rowindex":
|
|
2354
|
+
"aria-rowindex": f + t + 1,
|
|
2176
2355
|
children: [
|
|
2177
|
-
!
|
|
2356
|
+
!h && /* @__PURE__ */ v(dr, {
|
|
2178
2357
|
taskId: e.id,
|
|
2179
|
-
barLeft:
|
|
2180
|
-
barWidth:
|
|
2181
|
-
barCenterY:
|
|
2182
|
-
show:
|
|
2358
|
+
barLeft: k,
|
|
2359
|
+
barWidth: A,
|
|
2360
|
+
barCenterY: D,
|
|
2361
|
+
show: j
|
|
2183
2362
|
}),
|
|
2184
|
-
e.type === "milestone" && /* @__PURE__ */
|
|
2185
|
-
|
|
2186
|
-
|
|
2363
|
+
e.type === "milestone" && /* @__PURE__ */ v(er, {
|
|
2364
|
+
tooltip: te,
|
|
2365
|
+
size: E,
|
|
2366
|
+
centerLeft: T,
|
|
2187
2367
|
top: 6,
|
|
2188
|
-
colWidth:
|
|
2368
|
+
colWidth: r,
|
|
2189
2369
|
title: e.name,
|
|
2190
|
-
a11y:
|
|
2191
|
-
...
|
|
2370
|
+
a11y: V,
|
|
2371
|
+
...R
|
|
2192
2372
|
}),
|
|
2193
|
-
e.type === "summary" && /* @__PURE__ */
|
|
2194
|
-
|
|
2373
|
+
e.type === "summary" && /* @__PURE__ */ v(ar, {
|
|
2374
|
+
tooltip: te,
|
|
2375
|
+
left: T,
|
|
2195
2376
|
top: 6,
|
|
2196
|
-
width:
|
|
2197
|
-
height:
|
|
2198
|
-
colWidth:
|
|
2377
|
+
width: S,
|
|
2378
|
+
height: E,
|
|
2379
|
+
colWidth: r,
|
|
2199
2380
|
title: e.name,
|
|
2200
|
-
a11y:
|
|
2201
|
-
progress:
|
|
2202
|
-
...
|
|
2203
|
-
...
|
|
2381
|
+
a11y: V,
|
|
2382
|
+
progress: C,
|
|
2383
|
+
...z,
|
|
2384
|
+
...R
|
|
2204
2385
|
}),
|
|
2205
|
-
e.type === "task" || !e.type ? /* @__PURE__ */
|
|
2206
|
-
|
|
2386
|
+
e.type === "task" || !e.type ? /* @__PURE__ */ v(cr, {
|
|
2387
|
+
tooltip: te,
|
|
2388
|
+
left: T,
|
|
2207
2389
|
top: 6,
|
|
2208
|
-
width:
|
|
2209
|
-
height:
|
|
2210
|
-
colWidth:
|
|
2390
|
+
width: S,
|
|
2391
|
+
height: E,
|
|
2392
|
+
colWidth: r,
|
|
2211
2393
|
title: e.name,
|
|
2212
|
-
a11y:
|
|
2213
|
-
progress:
|
|
2214
|
-
...
|
|
2215
|
-
...
|
|
2216
|
-
...
|
|
2394
|
+
a11y: V,
|
|
2395
|
+
progress: C,
|
|
2396
|
+
...z,
|
|
2397
|
+
...R,
|
|
2398
|
+
...B
|
|
2217
2399
|
}) : null
|
|
2218
2400
|
]
|
|
2219
2401
|
});
|
|
2220
2402
|
});
|
|
2221
|
-
|
|
2403
|
+
pr.displayName = "Row";
|
|
2222
2404
|
//#endregion
|
|
2223
2405
|
//#region src/components/dependency-links/geometry.ts
|
|
2224
|
-
var
|
|
2225
|
-
function
|
|
2406
|
+
var mr = 12, hr = {};
|
|
2407
|
+
function gr(e) {
|
|
2226
2408
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
2227
2409
|
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
2410
|
return {
|
|
@@ -2232,7 +2414,7 @@ function $n(e) {
|
|
|
2232
2414
|
maxY: i
|
|
2233
2415
|
};
|
|
2234
2416
|
}
|
|
2235
|
-
function
|
|
2417
|
+
function _r(e) {
|
|
2236
2418
|
if (e.length < 2) return e[0] ?? {
|
|
2237
2419
|
x: 0,
|
|
2238
2420
|
y: 0
|
|
@@ -2243,8 +2425,8 @@ function er(e) {
|
|
|
2243
2425
|
y: (n.y + r.y) / 2
|
|
2244
2426
|
};
|
|
2245
2427
|
}
|
|
2246
|
-
function
|
|
2247
|
-
let { left: s, width: c } =
|
|
2428
|
+
function vr(e, t, n, { origin: r, colWidth: i, rowHeight: a, unit: o }) {
|
|
2429
|
+
let { left: s, width: c } = Et(e, t, r, i, o);
|
|
2248
2430
|
if (e.type === "milestone") {
|
|
2249
2431
|
let t = (a - 12) / 2;
|
|
2250
2432
|
return {
|
|
@@ -2261,13 +2443,13 @@ function tr(e, t, n, { origin: r, colWidth: i, rowHeight: a, unit: o }) {
|
|
|
2261
2443
|
task: e
|
|
2262
2444
|
};
|
|
2263
2445
|
}
|
|
2264
|
-
function
|
|
2446
|
+
function yr(e, t) {
|
|
2265
2447
|
let n = /* @__PURE__ */ new Map(), { rowHeight: r } = t;
|
|
2266
2448
|
return e.forEach((e, i) => {
|
|
2267
|
-
n.set(e.id,
|
|
2449
|
+
n.set(e.id, vr(e, hr, i * r + r / 2, t));
|
|
2268
2450
|
}), n;
|
|
2269
2451
|
}
|
|
2270
|
-
function
|
|
2452
|
+
function br(e, t) {
|
|
2271
2453
|
let n = (e.x + t.x) / 2;
|
|
2272
2454
|
return [
|
|
2273
2455
|
e,
|
|
@@ -2282,8 +2464,8 @@ function rr(e, t) {
|
|
|
2282
2464
|
t
|
|
2283
2465
|
];
|
|
2284
2466
|
}
|
|
2285
|
-
function
|
|
2286
|
-
let i = e.x + n *
|
|
2467
|
+
function xr(e, t, n, r) {
|
|
2468
|
+
let i = e.x + n * mr, a = t.x - r * mr, o = (e.y + t.y) / 2;
|
|
2287
2469
|
return [
|
|
2288
2470
|
e,
|
|
2289
2471
|
{
|
|
@@ -2305,7 +2487,7 @@ function ir(e, t, n, r) {
|
|
|
2305
2487
|
t
|
|
2306
2488
|
];
|
|
2307
2489
|
}
|
|
2308
|
-
function
|
|
2490
|
+
function Sr(e, t, n) {
|
|
2309
2491
|
return [
|
|
2310
2492
|
e,
|
|
2311
2493
|
{
|
|
@@ -2319,7 +2501,7 @@ function ar(e, t, n) {
|
|
|
2319
2501
|
t
|
|
2320
2502
|
];
|
|
2321
2503
|
}
|
|
2322
|
-
function
|
|
2504
|
+
function Cr(e, t, n) {
|
|
2323
2505
|
let r = t.centerY, i = n.centerY;
|
|
2324
2506
|
switch (e) {
|
|
2325
2507
|
case "FS": {
|
|
@@ -2330,22 +2512,22 @@ function or(e, t, n) {
|
|
|
2330
2512
|
x: n.startX,
|
|
2331
2513
|
y: i
|
|
2332
2514
|
};
|
|
2333
|
-
return n.startX >= t.endX + 2 *
|
|
2515
|
+
return n.startX >= t.endX + 2 * mr ? br(e, a) : xr(e, a, 1, 1);
|
|
2334
2516
|
}
|
|
2335
|
-
case "SS": return
|
|
2517
|
+
case "SS": return Sr({
|
|
2336
2518
|
x: t.startX,
|
|
2337
2519
|
y: r
|
|
2338
2520
|
}, {
|
|
2339
2521
|
x: n.startX,
|
|
2340
2522
|
y: i
|
|
2341
|
-
}, Math.min(t.startX, n.startX) -
|
|
2342
|
-
case "FF": return
|
|
2523
|
+
}, Math.min(t.startX, n.startX) - mr);
|
|
2524
|
+
case "FF": return Sr({
|
|
2343
2525
|
x: t.endX,
|
|
2344
2526
|
y: r
|
|
2345
2527
|
}, {
|
|
2346
2528
|
x: n.endX,
|
|
2347
2529
|
y: i
|
|
2348
|
-
}, Math.max(t.endX, n.endX) +
|
|
2530
|
+
}, Math.max(t.endX, n.endX) + mr);
|
|
2349
2531
|
case "SF": {
|
|
2350
2532
|
let e = {
|
|
2351
2533
|
x: t.startX,
|
|
@@ -2354,36 +2536,36 @@ function or(e, t, n) {
|
|
|
2354
2536
|
x: n.endX,
|
|
2355
2537
|
y: i
|
|
2356
2538
|
};
|
|
2357
|
-
return n.endX <= t.startX - 2 *
|
|
2539
|
+
return n.endX <= t.startX - 2 * mr ? br(e, a) : xr(e, a, -1, -1);
|
|
2358
2540
|
}
|
|
2359
2541
|
}
|
|
2360
2542
|
}
|
|
2361
|
-
function
|
|
2362
|
-
let r =
|
|
2543
|
+
function wr({ tasks: e, dependencies: t, ...n }) {
|
|
2544
|
+
let r = yr(e, n), i = [];
|
|
2363
2545
|
for (let e of t) {
|
|
2364
2546
|
let t = r.get(e.from), n = r.get(e.to);
|
|
2365
|
-
!t || !n || i.push(
|
|
2547
|
+
!t || !n || i.push(Tr(e, t, n));
|
|
2366
2548
|
}
|
|
2367
2549
|
let a = null;
|
|
2368
2550
|
return {
|
|
2369
2551
|
links: i,
|
|
2370
2552
|
boxes: r,
|
|
2371
2553
|
linksTouching(e) {
|
|
2372
|
-
return a ??=
|
|
2554
|
+
return a ??= Er(i), a.get(e);
|
|
2373
2555
|
}
|
|
2374
2556
|
};
|
|
2375
2557
|
}
|
|
2376
|
-
function
|
|
2377
|
-
let r =
|
|
2558
|
+
function Tr(e, t, n) {
|
|
2559
|
+
let r = Cr(e.type, t, n);
|
|
2378
2560
|
return {
|
|
2379
2561
|
id: `${e.from}->${e.to}`,
|
|
2380
2562
|
type: e.type,
|
|
2381
2563
|
points: r,
|
|
2382
|
-
bounds:
|
|
2564
|
+
bounds: gr(r),
|
|
2383
2565
|
dep: e
|
|
2384
2566
|
};
|
|
2385
2567
|
}
|
|
2386
|
-
function
|
|
2568
|
+
function Er(e) {
|
|
2387
2569
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2388
2570
|
let r = t.get(e);
|
|
2389
2571
|
r ? r.push(n) : t.set(e, [n]);
|
|
@@ -2392,26 +2574,26 @@ function lr(e) {
|
|
|
2392
2574
|
n(String(e.dep.from), t), n(String(e.dep.to), t);
|
|
2393
2575
|
}), t;
|
|
2394
2576
|
}
|
|
2395
|
-
function
|
|
2577
|
+
function Dr(e, t, n) {
|
|
2396
2578
|
let r = Object.keys(t);
|
|
2397
2579
|
if (r.length === 0) return e.links;
|
|
2398
2580
|
let i = /* @__PURE__ */ new Map(), a = (r) => {
|
|
2399
2581
|
let a = e.boxes.get(r), o = a && t[String(r)];
|
|
2400
2582
|
if (!a || !o) return a;
|
|
2401
2583
|
let s = i.get(r);
|
|
2402
|
-
return s || (s =
|
|
2584
|
+
return s || (s = vr(a.task, o, a.centerY, n), i.set(r, s)), s;
|
|
2403
2585
|
}, o = null;
|
|
2404
2586
|
for (let t of r) for (let n of e.linksTouching(t) ?? []) {
|
|
2405
2587
|
let { dep: t } = e.links[n], r = a(t.from), i = a(t.to);
|
|
2406
|
-
!r || !i || (o ??= e.links.slice(), o[n] =
|
|
2588
|
+
!r || !i || (o ??= e.links.slice(), o[n] = Tr(t, r, i));
|
|
2407
2589
|
}
|
|
2408
2590
|
return o ?? e.links;
|
|
2409
2591
|
}
|
|
2410
2592
|
//#endregion
|
|
2411
2593
|
//#region src/components/dependency-links/DependencyLinksContext.tsx
|
|
2412
|
-
var
|
|
2413
|
-
function
|
|
2414
|
-
let c =
|
|
2594
|
+
var Or = n(null);
|
|
2595
|
+
function kr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, unit: a, children: o, overrides: s }) {
|
|
2596
|
+
let c = f(() => wr({
|
|
2415
2597
|
tasks: e,
|
|
2416
2598
|
dependencies: t,
|
|
2417
2599
|
origin: n,
|
|
@@ -2425,7 +2607,7 @@ function fr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, u
|
|
|
2425
2607
|
r,
|
|
2426
2608
|
i,
|
|
2427
2609
|
a
|
|
2428
|
-
]),
|
|
2610
|
+
]), l = f(() => Dr(c, s, {
|
|
2429
2611
|
origin: n,
|
|
2430
2612
|
colWidth: r,
|
|
2431
2613
|
rowHeight: i,
|
|
@@ -2438,13 +2620,13 @@ function fr({ tasks: e, dependencies: t, origin: n, colWidth: r, rowHeight: i, u
|
|
|
2438
2620
|
i,
|
|
2439
2621
|
a
|
|
2440
2622
|
]);
|
|
2441
|
-
return /* @__PURE__ */
|
|
2442
|
-
value:
|
|
2623
|
+
return /* @__PURE__ */ v(Or.Provider, {
|
|
2624
|
+
value: l,
|
|
2443
2625
|
children: o
|
|
2444
2626
|
});
|
|
2445
2627
|
}
|
|
2446
|
-
function
|
|
2447
|
-
let e =
|
|
2628
|
+
function Ar() {
|
|
2629
|
+
let e = s(Or);
|
|
2448
2630
|
if (e === null) throw Error("useDependencyLinks must be used within a <DependencyLinksProvider>");
|
|
2449
2631
|
return e;
|
|
2450
2632
|
}
|
|
@@ -2458,11 +2640,11 @@ var Z = {
|
|
|
2458
2640
|
arrowSelected: "_arrowSelected_1ih9f_43",
|
|
2459
2641
|
lagLabel: "_lagLabel_1ih9f_51",
|
|
2460
2642
|
deleteBtn: "_deleteBtn_1ih9f_65"
|
|
2461
|
-
}, Q = 2,
|
|
2462
|
-
function
|
|
2643
|
+
}, Q = 2, jr = 8, Mr = 6;
|
|
2644
|
+
function Nr(e, t) {
|
|
2463
2645
|
return t ? e.minX <= t.maxX && e.maxX >= t.minX && e.minY <= t.maxY && e.maxY >= t.minY : !0;
|
|
2464
2646
|
}
|
|
2465
|
-
function
|
|
2647
|
+
function Pr(e, t) {
|
|
2466
2648
|
return e.y === t.y ? {
|
|
2467
2649
|
left: Math.min(e.x, t.x) - Q / 2,
|
|
2468
2650
|
top: e.y - Q / 2,
|
|
@@ -2475,51 +2657,51 @@ function _r(e, t) {
|
|
|
2475
2657
|
height: Math.abs(t.y - e.y) + Q
|
|
2476
2658
|
};
|
|
2477
2659
|
}
|
|
2478
|
-
function
|
|
2660
|
+
function Fr(e, t) {
|
|
2479
2661
|
return e.y === t.y ? {
|
|
2480
2662
|
left: Math.min(e.x, t.x) - Q / 2,
|
|
2481
|
-
top: e.y -
|
|
2663
|
+
top: e.y - Mr,
|
|
2482
2664
|
width: Math.abs(t.x - e.x) + Q,
|
|
2483
|
-
height: Q +
|
|
2665
|
+
height: Q + Mr * 2
|
|
2484
2666
|
} : {
|
|
2485
|
-
left: e.x -
|
|
2667
|
+
left: e.x - Mr,
|
|
2486
2668
|
top: Math.min(e.y, t.y) - Q / 2,
|
|
2487
|
-
width: Q +
|
|
2669
|
+
width: Q + Mr * 2,
|
|
2488
2670
|
height: Math.abs(t.y - e.y) + Q
|
|
2489
2671
|
};
|
|
2490
2672
|
}
|
|
2491
|
-
function
|
|
2673
|
+
function Ir(e) {
|
|
2492
2674
|
let t = [];
|
|
2493
2675
|
for (let n = 0; n + 1 < e.length; n++) t.push([e[n], e[n + 1]]);
|
|
2494
2676
|
return t;
|
|
2495
2677
|
}
|
|
2496
|
-
function
|
|
2678
|
+
function Lr(e) {
|
|
2497
2679
|
let t = e[e.length - 1], n = e[e.length - 2], r = t.x >= n.x;
|
|
2498
2680
|
return {
|
|
2499
2681
|
className: r ? Z.arrowRight : Z.arrowLeft,
|
|
2500
2682
|
style: {
|
|
2501
|
-
left: r ? t.x -
|
|
2502
|
-
top: t.y -
|
|
2683
|
+
left: r ? t.x - jr : t.x,
|
|
2684
|
+
top: t.y - jr / 2
|
|
2503
2685
|
}
|
|
2504
2686
|
};
|
|
2505
2687
|
}
|
|
2506
|
-
function
|
|
2507
|
-
let
|
|
2508
|
-
if (
|
|
2509
|
-
if (!
|
|
2688
|
+
function Rr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots: a, slotProps: o }) {
|
|
2689
|
+
let s = J(), c = a ?? s.dependencies?.links?.slots, u = o ?? s.dependencies?.links?.slotProps, d = $t(), f = rn(), p = Ar(), [h, g] = m(null), [_, b] = m(null), x = h ? p.find((e) => e.id === h) : null;
|
|
2690
|
+
if (l(() => {
|
|
2691
|
+
if (!h) return;
|
|
2510
2692
|
let e = (e) => {
|
|
2511
|
-
(e.key === "Delete" || e.key === "Backspace") && (x && r?.(x.dep),
|
|
2693
|
+
(e.key === "Delete" || e.key === "Backspace") && (x && r?.(x.dep), g(null), b(null));
|
|
2512
2694
|
};
|
|
2513
2695
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2514
2696
|
}, [
|
|
2515
|
-
|
|
2697
|
+
h,
|
|
2516
2698
|
x,
|
|
2517
2699
|
r
|
|
2518
|
-
]),
|
|
2700
|
+
]), p.length === 0) return null;
|
|
2519
2701
|
let S = (e, t) => {
|
|
2520
|
-
if (t.stopPropagation(),
|
|
2702
|
+
if (t.stopPropagation(), h === e) g(null), b(null);
|
|
2521
2703
|
else {
|
|
2522
|
-
|
|
2704
|
+
g(e);
|
|
2523
2705
|
let n = t.currentTarget.closest(`.${Z.layer}`)?.getBoundingClientRect();
|
|
2524
2706
|
b(n ? {
|
|
2525
2707
|
x: t.clientX - n.left,
|
|
@@ -2527,10 +2709,10 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2527
2709
|
} : null);
|
|
2528
2710
|
}
|
|
2529
2711
|
}, C = (e) => {
|
|
2530
|
-
e.stopPropagation(), x && r?.(x.dep),
|
|
2531
|
-
}, w =
|
|
2532
|
-
return /* @__PURE__ */
|
|
2533
|
-
...
|
|
2712
|
+
e.stopPropagation(), x && r?.(x.dep), g(null), b(null);
|
|
2713
|
+
}, w = c?.layer ?? "div", T = c?.segment ?? "div", E = c?.arrow ?? "div", D = c?.lagLabel ?? "div", O = c?.deleteButton ?? "button";
|
|
2714
|
+
return /* @__PURE__ */ y(w, {
|
|
2715
|
+
...Y({
|
|
2534
2716
|
className: Z.layer,
|
|
2535
2717
|
style: {
|
|
2536
2718
|
width: t,
|
|
@@ -2539,32 +2721,32 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2539
2721
|
role: "presentation",
|
|
2540
2722
|
"aria-hidden": !0,
|
|
2541
2723
|
onClick: () => {
|
|
2542
|
-
|
|
2724
|
+
g(null), b(null);
|
|
2543
2725
|
}
|
|
2544
2726
|
}, u?.layer, {
|
|
2545
2727
|
width: t,
|
|
2546
2728
|
height: n,
|
|
2547
|
-
linkCount:
|
|
2729
|
+
linkCount: p.length
|
|
2548
2730
|
}),
|
|
2549
|
-
children: [
|
|
2550
|
-
let n = t.id ===
|
|
2551
|
-
if (!n && !
|
|
2552
|
-
let r =
|
|
2731
|
+
children: [p.map((t) => {
|
|
2732
|
+
let n = t.id === h;
|
|
2733
|
+
if (!n && !Nr(t.bounds, i)) return null;
|
|
2734
|
+
let r = Lr(t.points), a = Ir(t.points), o = t.dep.lag ? _r(t.points) : null, s = {
|
|
2553
2735
|
link: t,
|
|
2554
2736
|
isSelected: n
|
|
2555
|
-
}, c =
|
|
2737
|
+
}, c = Y({
|
|
2556
2738
|
className: `${r.className} ${n ? Z.arrowSelected : ""}`,
|
|
2557
2739
|
style: r.style
|
|
2558
2740
|
}, u?.arrow, s);
|
|
2559
|
-
return /* @__PURE__ */
|
|
2560
|
-
!
|
|
2741
|
+
return /* @__PURE__ */ y(e, { children: [
|
|
2742
|
+
!f && a.map(([e, n]) => /* @__PURE__ */ v("div", {
|
|
2561
2743
|
className: Z.hitArea,
|
|
2562
|
-
style:
|
|
2744
|
+
style: Fr(e, n),
|
|
2563
2745
|
onClick: (e) => S(t.id, e)
|
|
2564
2746
|
}, `hit-${e.x},${e.y}-${n.x},${n.y}`)),
|
|
2565
|
-
a.map(([e, r], i) => /* @__PURE__ */
|
|
2747
|
+
a.map(([e, r], i) => /* @__PURE__ */ v(T, { ...Y({
|
|
2566
2748
|
className: `${Z.segment} ${n ? Z.segmentSelected : ""}`,
|
|
2567
|
-
style:
|
|
2749
|
+
style: Pr(e, r)
|
|
2568
2750
|
}, u?.segment, {
|
|
2569
2751
|
link: t,
|
|
2570
2752
|
isSelected: n,
|
|
@@ -2572,8 +2754,8 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2572
2754
|
to: r,
|
|
2573
2755
|
index: i
|
|
2574
2756
|
}) }, `seg-${e.x},${e.y}-${r.x},${r.y}`)),
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
o && t.dep.lag !== void 0 && t.dep.lag !== 0 && /* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ v(E, { ...c }),
|
|
2758
|
+
o && t.dep.lag !== void 0 && t.dep.lag !== 0 && /* @__PURE__ */ v(D, { ...Y({
|
|
2577
2759
|
className: Z.lagLabel,
|
|
2578
2760
|
style: {
|
|
2579
2761
|
left: o.x,
|
|
@@ -2586,29 +2768,29 @@ function xr({ width: t, height: n, onDependencyDelete: r, visibleRect: i, slots:
|
|
|
2586
2768
|
lag: t.dep.lag
|
|
2587
2769
|
}) })
|
|
2588
2770
|
] }, t.id);
|
|
2589
|
-
}), !
|
|
2771
|
+
}), !f && x && _ && /* @__PURE__ */ v(O, { ...Y({
|
|
2590
2772
|
className: Z.deleteBtn,
|
|
2591
2773
|
type: "button",
|
|
2592
2774
|
tabIndex: -1,
|
|
2593
2775
|
style: {
|
|
2594
|
-
left:
|
|
2595
|
-
top:
|
|
2776
|
+
left: _.x,
|
|
2777
|
+
top: _.y
|
|
2596
2778
|
},
|
|
2597
2779
|
onClick: C,
|
|
2598
|
-
"aria-label":
|
|
2780
|
+
"aria-label": d.deleteDependency,
|
|
2599
2781
|
children: "×"
|
|
2600
2782
|
}, u?.deleteButton, { dependency: x.dep }) })]
|
|
2601
2783
|
});
|
|
2602
2784
|
}
|
|
2603
|
-
var
|
|
2785
|
+
var zr = { preview: "_preview_1jjzd_1" };
|
|
2604
2786
|
//#endregion
|
|
2605
2787
|
//#region src/components/dependency-links/DependencyPreview.tsx
|
|
2606
|
-
function
|
|
2607
|
-
let n =
|
|
2788
|
+
function Br({ slots: e, slotProps: t }) {
|
|
2789
|
+
let n = J(), r = e ?? n.dependencies?.preview?.slots, i = t ?? n.dependencies?.preview?.slotProps, a = bn();
|
|
2608
2790
|
if (!a) return null;
|
|
2609
2791
|
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:
|
|
2792
|
+
return /* @__PURE__ */ v(r?.root ?? "div", { ...Y({
|
|
2793
|
+
className: zr.preview,
|
|
2612
2794
|
style: {
|
|
2613
2795
|
left: a.startX,
|
|
2614
2796
|
top: a.startY,
|
|
@@ -2622,24 +2804,24 @@ function Cr({ slots: e, slotProps: t }) {
|
|
|
2622
2804
|
angle: l
|
|
2623
2805
|
}) });
|
|
2624
2806
|
}
|
|
2625
|
-
var
|
|
2807
|
+
var Vr = {
|
|
2626
2808
|
cols: "_cols_kjab1_1",
|
|
2627
2809
|
col: "_col_kjab1_1",
|
|
2628
2810
|
colWeekend: "_colWeekend_kjab1_14"
|
|
2629
2811
|
};
|
|
2630
2812
|
//#endregion
|
|
2631
2813
|
//#region src/components/grid/GridColumns.tsx
|
|
2632
|
-
function
|
|
2633
|
-
let c =
|
|
2634
|
-
return /* @__PURE__ */
|
|
2635
|
-
className:
|
|
2814
|
+
function Hr({ dates: e, colWidth: t, bodyHeight: n, colRange: r, unit: i = "day", step: a = 1, slots: o, slotProps: s }) {
|
|
2815
|
+
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";
|
|
2816
|
+
return /* @__PURE__ */ v("div", {
|
|
2817
|
+
className: Vr.cols,
|
|
2636
2818
|
role: "presentation",
|
|
2637
2819
|
"aria-hidden": !0,
|
|
2638
2820
|
children: e.slice(r.start, r.end).map((e, o) => {
|
|
2639
|
-
let s = r.start + o, c = p ?
|
|
2821
|
+
let s = r.start + o, c = p ? De(f, e, N(e, i, a)) : {
|
|
2640
2822
|
isNonWorking: !1,
|
|
2641
2823
|
reason: void 0
|
|
2642
|
-
}, l = f ? c.isNonWorking : i === "day" &&
|
|
2824
|
+
}, l = f ? c.isNonWorking : i === "day" && O(e), m = {
|
|
2643
2825
|
date: e,
|
|
2644
2826
|
index: s,
|
|
2645
2827
|
isNonWorking: l,
|
|
@@ -2648,26 +2830,26 @@ function Tr({ dates: e, colWidth: t, bodyHeight: n, colRange: r, unit: i = "day"
|
|
|
2648
2830
|
colWidth: t,
|
|
2649
2831
|
bodyHeight: n
|
|
2650
2832
|
};
|
|
2651
|
-
return /* @__PURE__ */
|
|
2652
|
-
className:
|
|
2833
|
+
return /* @__PURE__ */ v(d, { ...Y({
|
|
2834
|
+
className: Dn(Vr.col, l && Vr.colWeekend),
|
|
2653
2835
|
style: {
|
|
2654
2836
|
left: s * t,
|
|
2655
2837
|
width: t,
|
|
2656
2838
|
height: n
|
|
2657
2839
|
}
|
|
2658
|
-
}, u?.column,
|
|
2840
|
+
}, u?.column, m) }, e.getTime());
|
|
2659
2841
|
})
|
|
2660
2842
|
});
|
|
2661
2843
|
}
|
|
2662
|
-
|
|
2663
|
-
var
|
|
2844
|
+
Hr.displayName = "GridColumns";
|
|
2845
|
+
var Ur = {
|
|
2664
2846
|
gridWrapper: "_gridWrapper_1tr84_1",
|
|
2665
2847
|
grid: "_grid_1tr84_1",
|
|
2666
2848
|
body: "_body_1tr84_17"
|
|
2667
2849
|
};
|
|
2668
2850
|
//#endregion
|
|
2669
2851
|
//#region src/core/virtualize.ts
|
|
2670
|
-
function
|
|
2852
|
+
function Wr(e, t, n, r, i = 0) {
|
|
2671
2853
|
if (r <= 0) return {
|
|
2672
2854
|
start: 0,
|
|
2673
2855
|
end: 0
|
|
@@ -2684,9 +2866,9 @@ function Dr(e, t, n, r, i = 0) {
|
|
|
2684
2866
|
}
|
|
2685
2867
|
//#endregion
|
|
2686
2868
|
//#region src/components/grid/Grid.tsx
|
|
2687
|
-
function
|
|
2688
|
-
let n =
|
|
2689
|
-
|
|
2869
|
+
function Gr({ slots: e, slotProps: t } = {}) {
|
|
2870
|
+
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();
|
|
2871
|
+
l(() => {
|
|
2690
2872
|
let e = S.current;
|
|
2691
2873
|
if (!e || !j && !M) return;
|
|
2692
2874
|
let t = (t) => {
|
|
@@ -2707,12 +2889,12 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2707
2889
|
O,
|
|
2708
2890
|
k,
|
|
2709
2891
|
A,
|
|
2710
|
-
|
|
2892
|
+
a.length
|
|
2711
2893
|
]);
|
|
2712
|
-
let [
|
|
2713
|
-
|
|
2714
|
-
}, [
|
|
2715
|
-
|
|
2894
|
+
let [N, P] = m({}), F = o((e) => {
|
|
2895
|
+
d(e.id), u?.(e);
|
|
2896
|
+
}, [d, u]), ee = o((e, t) => {
|
|
2897
|
+
P((n) => {
|
|
2716
2898
|
if (t === null) {
|
|
2717
2899
|
let { [e]: t, ...r } = n;
|
|
2718
2900
|
return r;
|
|
@@ -2725,90 +2907,90 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2725
2907
|
}
|
|
2726
2908
|
};
|
|
2727
2909
|
});
|
|
2728
|
-
}, []), I =
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
]),
|
|
2733
|
-
if (!
|
|
2734
|
-
let
|
|
2735
|
-
minX:
|
|
2736
|
-
maxX:
|
|
2737
|
-
minY:
|
|
2738
|
-
maxY:
|
|
2739
|
-
},
|
|
2740
|
-
totalWidth:
|
|
2741
|
-
bodyHeight:
|
|
2910
|
+
}, []), I = f(() => Nt(a, _, g), [
|
|
2911
|
+
a,
|
|
2912
|
+
_,
|
|
2913
|
+
g
|
|
2914
|
+
]), L = I[0]?.getTime(), R = f(() => L == null ? void 0 : new Date(L), [L]);
|
|
2915
|
+
if (!R) return null;
|
|
2916
|
+
let z = kt(g), B = I.length * p, V = a.length * h, te = (g ?? Ot).length, H = Wr(T.scrollTop, T.clientHeight, h, a.length, 6), ne = Wr(T.scrollLeft, T.clientWidth, p, I.length, 4), re = {
|
|
2917
|
+
minX: ne.start * p,
|
|
2918
|
+
maxX: ne.end * p,
|
|
2919
|
+
minY: H.start * h,
|
|
2920
|
+
maxY: H.end * h
|
|
2921
|
+
}, ie = r?.root ?? "div", ae = r?.body ?? "div", oe = {
|
|
2922
|
+
totalWidth: B,
|
|
2923
|
+
bodyHeight: V,
|
|
2742
2924
|
height: b
|
|
2743
|
-
}, se =
|
|
2744
|
-
className:
|
|
2925
|
+
}, se = Y({
|
|
2926
|
+
className: Ur.gridWrapper,
|
|
2745
2927
|
style: b === void 0 ? {} : { height: b },
|
|
2746
2928
|
onScroll: C,
|
|
2747
2929
|
role: "grid",
|
|
2748
2930
|
"aria-label": x.timeline,
|
|
2749
|
-
"aria-rowcount":
|
|
2931
|
+
"aria-rowcount": te + a.length,
|
|
2750
2932
|
"aria-colcount": I.length
|
|
2751
|
-
},
|
|
2752
|
-
className:
|
|
2933
|
+
}, i?.root, oe), ce = Y({
|
|
2934
|
+
className: Ur.body,
|
|
2753
2935
|
style: {
|
|
2754
|
-
height:
|
|
2755
|
-
width:
|
|
2936
|
+
height: V,
|
|
2937
|
+
width: B
|
|
2756
2938
|
},
|
|
2757
2939
|
role: "rowgroup"
|
|
2758
|
-
},
|
|
2759
|
-
return /* @__PURE__ */
|
|
2940
|
+
}, i?.body, oe);
|
|
2941
|
+
return /* @__PURE__ */ v(ie, {
|
|
2760
2942
|
ref: S,
|
|
2761
2943
|
...se,
|
|
2762
|
-
children: /* @__PURE__ */
|
|
2763
|
-
className:
|
|
2764
|
-
style: { width:
|
|
2944
|
+
children: /* @__PURE__ */ y("div", {
|
|
2945
|
+
className: Ur.grid,
|
|
2946
|
+
style: { width: B },
|
|
2765
2947
|
role: "presentation",
|
|
2766
|
-
children: [/* @__PURE__ */
|
|
2767
|
-
colWidth:
|
|
2768
|
-
rowHeight:
|
|
2948
|
+
children: [/* @__PURE__ */ v(Mn, {
|
|
2949
|
+
colWidth: p,
|
|
2950
|
+
rowHeight: h,
|
|
2769
2951
|
dates: I,
|
|
2770
|
-
scales:
|
|
2771
|
-
colRange:
|
|
2772
|
-
}), /* @__PURE__ */
|
|
2773
|
-
tasks:
|
|
2952
|
+
scales: g,
|
|
2953
|
+
colRange: ne
|
|
2954
|
+
}), /* @__PURE__ */ v(kr, {
|
|
2955
|
+
tasks: a,
|
|
2774
2956
|
dependencies: E,
|
|
2775
|
-
origin:
|
|
2776
|
-
colWidth:
|
|
2777
|
-
rowHeight:
|
|
2778
|
-
unit:
|
|
2779
|
-
overrides:
|
|
2780
|
-
children: /* @__PURE__ */
|
|
2957
|
+
origin: R,
|
|
2958
|
+
colWidth: p,
|
|
2959
|
+
rowHeight: h,
|
|
2960
|
+
unit: z,
|
|
2961
|
+
overrides: N,
|
|
2962
|
+
children: /* @__PURE__ */ y(ae, {
|
|
2781
2963
|
ref: w,
|
|
2782
2964
|
...ce,
|
|
2783
2965
|
children: [
|
|
2784
|
-
/* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ v(Hr, {
|
|
2785
2967
|
dates: I,
|
|
2786
|
-
colWidth:
|
|
2787
|
-
bodyHeight:
|
|
2788
|
-
colRange:
|
|
2789
|
-
unit:
|
|
2790
|
-
step:
|
|
2968
|
+
colWidth: p,
|
|
2969
|
+
bodyHeight: V,
|
|
2970
|
+
colRange: ne,
|
|
2971
|
+
unit: z,
|
|
2972
|
+
step: At(g)
|
|
2791
2973
|
}),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
width:
|
|
2794
|
-
height:
|
|
2974
|
+
/* @__PURE__ */ v(Rr, {
|
|
2975
|
+
width: B,
|
|
2976
|
+
height: V,
|
|
2795
2977
|
onDependencyDelete: D,
|
|
2796
|
-
visibleRect:
|
|
2978
|
+
visibleRect: re
|
|
2797
2979
|
}),
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
|
|
2980
|
+
/* @__PURE__ */ v(Br, {}),
|
|
2981
|
+
a.slice(H.start, H.end).map((e, t) => /* @__PURE__ */ v(pr, {
|
|
2800
2982
|
task: e,
|
|
2801
|
-
index:
|
|
2802
|
-
origin:
|
|
2803
|
-
colWidth:
|
|
2804
|
-
rowHeight:
|
|
2805
|
-
unit:
|
|
2806
|
-
onUpdate:
|
|
2807
|
-
onCommit:
|
|
2808
|
-
override:
|
|
2809
|
-
onOverride:
|
|
2810
|
-
onTaskClick:
|
|
2811
|
-
rowIndexOffset:
|
|
2983
|
+
index: H.start + t,
|
|
2984
|
+
origin: R,
|
|
2985
|
+
colWidth: p,
|
|
2986
|
+
rowHeight: h,
|
|
2987
|
+
unit: z,
|
|
2988
|
+
onUpdate: s,
|
|
2989
|
+
onCommit: c,
|
|
2990
|
+
override: N[e.id],
|
|
2991
|
+
onOverride: ee,
|
|
2992
|
+
onTaskClick: F,
|
|
2993
|
+
rowIndexOffset: te
|
|
2812
2994
|
}, e.id))
|
|
2813
2995
|
]
|
|
2814
2996
|
})
|
|
@@ -2816,14 +2998,14 @@ function Or({ slots: e, slotProps: t } = {}) {
|
|
|
2816
2998
|
})
|
|
2817
2999
|
});
|
|
2818
3000
|
}
|
|
2819
|
-
|
|
2820
|
-
var
|
|
3001
|
+
Gr.displayName = "GanttGrid";
|
|
3002
|
+
var Kr = { handle: "_handle_1o220_1" };
|
|
2821
3003
|
//#endregion
|
|
2822
3004
|
//#region src/components/grid/GridResizeHandle.tsx
|
|
2823
|
-
function
|
|
2824
|
-
let i =
|
|
2825
|
-
return /* @__PURE__ */
|
|
2826
|
-
className:
|
|
3005
|
+
function qr({ onMouseDown: e, isResizing: t = !1, slots: n, slotProps: r }) {
|
|
3006
|
+
let i = J(), a = n ?? i.timeline?.gridResizeHandle?.slots, o = r ?? i.timeline?.gridResizeHandle?.slotProps, s = $t(), c = { isResizing: t };
|
|
3007
|
+
return /* @__PURE__ */ v(a?.root ?? "div", { ...Y({
|
|
3008
|
+
className: Kr.handle,
|
|
2827
3009
|
onMouseDown: e,
|
|
2828
3010
|
role: "separator",
|
|
2829
3011
|
"aria-orientation": "vertical",
|
|
@@ -2847,10 +3029,10 @@ var $ = {
|
|
|
2847
3029
|
};
|
|
2848
3030
|
//#endregion
|
|
2849
3031
|
//#region src/components/taskList/TaskListHeader.tsx
|
|
2850
|
-
function
|
|
3032
|
+
function Jr({ columns: e, rowHeight: t, scales: n = Ot, onResizeStart: r, slots: i, slotProps: a }) {
|
|
2851
3033
|
let o = n.length * t + 2, s = i?.header ?? "div", c = i?.headerCell ?? "div", l = i?.columnResizeHandle ?? "div";
|
|
2852
|
-
return /* @__PURE__ */
|
|
2853
|
-
...
|
|
3034
|
+
return /* @__PURE__ */ v(s, {
|
|
3035
|
+
...Y({
|
|
2854
3036
|
className: $.header,
|
|
2855
3037
|
style: {
|
|
2856
3038
|
minHeight: o,
|
|
@@ -2866,7 +3048,7 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2866
3048
|
let n = {
|
|
2867
3049
|
column: e,
|
|
2868
3050
|
index: t
|
|
2869
|
-
}, i =
|
|
3051
|
+
}, i = Y({
|
|
2870
3052
|
className: $.headerCell,
|
|
2871
3053
|
style: e.width ? {
|
|
2872
3054
|
width: e.width,
|
|
@@ -2877,7 +3059,7 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2877
3059
|
},
|
|
2878
3060
|
role: "columnheader",
|
|
2879
3061
|
"aria-colindex": t + 1
|
|
2880
|
-
}, a?.headerCell, n), o =
|
|
3062
|
+
}, a?.headerCell, n), o = Y({
|
|
2881
3063
|
className: $.divider,
|
|
2882
3064
|
"aria-hidden": !0,
|
|
2883
3065
|
onMouseDown: (t) => {
|
|
@@ -2885,26 +3067,26 @@ function jr({ columns: e, rowHeight: t, scales: n = Ct, onResizeStart: r, slots:
|
|
|
2885
3067
|
r(e.key, n.offsetWidth, t);
|
|
2886
3068
|
}
|
|
2887
3069
|
}, a?.columnResizeHandle, n);
|
|
2888
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ y(c, {
|
|
2889
3071
|
...i,
|
|
2890
|
-
children: [e.header, /* @__PURE__ */
|
|
3072
|
+
children: [e.header, /* @__PURE__ */ v(l, { ...o })]
|
|
2891
3073
|
}, e.key);
|
|
2892
3074
|
})
|
|
2893
3075
|
});
|
|
2894
3076
|
}
|
|
2895
3077
|
//#endregion
|
|
2896
3078
|
//#region src/components/taskList/TreeCell.tsx
|
|
2897
|
-
var
|
|
2898
|
-
function
|
|
2899
|
-
let c =
|
|
3079
|
+
var Yr = 16;
|
|
3080
|
+
function Xr({ taskId: e, depth: t, isParent: n, isExpanded: r, onToggleExpand: i, children: a, slots: o, slotProps: s }) {
|
|
3081
|
+
let c = $t(), l = {
|
|
2900
3082
|
taskId: e,
|
|
2901
3083
|
depth: t,
|
|
2902
3084
|
isParent: n,
|
|
2903
3085
|
isExpanded: r
|
|
2904
|
-
}, u = o?.root ?? "span", d = o?.expandButton ?? "button", f = o?.placeholder ?? "span", p =
|
|
3086
|
+
}, u = o?.root ?? "span", d = o?.expandButton ?? "button", f = o?.placeholder ?? "span", p = Y({
|
|
2905
3087
|
className: $.nameContent,
|
|
2906
|
-
style: { paddingLeft: t *
|
|
2907
|
-
}, s?.root, l),
|
|
3088
|
+
style: { paddingLeft: t * Yr }
|
|
3089
|
+
}, s?.root, l), m = Y({
|
|
2908
3090
|
className: $.expandBtn,
|
|
2909
3091
|
type: "button",
|
|
2910
3092
|
onClick: (t) => {
|
|
@@ -2912,20 +3094,20 @@ function Nr({ taskId: e, depth: t, isParent: n, isExpanded: r, onToggleExpand: i
|
|
|
2912
3094
|
},
|
|
2913
3095
|
"aria-label": r ? c.collapse : c.expand,
|
|
2914
3096
|
children: r ? "▾" : "▸"
|
|
2915
|
-
}, s?.expandButton, l),
|
|
3097
|
+
}, s?.expandButton, l), h = Y({
|
|
2916
3098
|
className: $.expandPlaceholder,
|
|
2917
3099
|
"aria-hidden": !0
|
|
2918
3100
|
}, s?.placeholder, l);
|
|
2919
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ y(u, {
|
|
2920
3102
|
...p,
|
|
2921
|
-
children: [n ? /* @__PURE__ */
|
|
3103
|
+
children: [n ? /* @__PURE__ */ v(d, { ...m }) : /* @__PURE__ */ v(f, { ...h }), a]
|
|
2922
3104
|
});
|
|
2923
3105
|
}
|
|
2924
3106
|
//#endregion
|
|
2925
3107
|
//#region src/components/taskList/TaskListRow.tsx
|
|
2926
|
-
var
|
|
2927
|
-
let { columnApi: p } =
|
|
2928
|
-
return /* @__PURE__ */
|
|
3108
|
+
var Zr = 100, Qr = 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 }) {
|
|
3109
|
+
let { columnApi: p } = cn();
|
|
3110
|
+
return /* @__PURE__ */ v("div", {
|
|
2929
3111
|
className: `${$.row} ${c ? $.selected : ""}`,
|
|
2930
3112
|
style: { height: t },
|
|
2931
3113
|
onClick: () => u(e.id),
|
|
@@ -2936,15 +3118,15 @@ var Pr = 100, Fr = n(function({ task: e, rowHeight: t, rowIndex: n, depth: r, po
|
|
|
2936
3118
|
"aria-setsize": a,
|
|
2937
3119
|
"aria-expanded": o ? s : void 0,
|
|
2938
3120
|
"aria-selected": c || void 0,
|
|
2939
|
-
children: d.map((t, n) => /* @__PURE__ */
|
|
3121
|
+
children: d.map((t, n) => /* @__PURE__ */ v("div", {
|
|
2940
3122
|
className: `${$.cell} ${t.isTreeColumn ? $.treeCell : ""}`,
|
|
2941
3123
|
style: {
|
|
2942
|
-
width: t.width ||
|
|
3124
|
+
width: t.width || Zr,
|
|
2943
3125
|
flexShrink: 0
|
|
2944
3126
|
},
|
|
2945
3127
|
role: t.isTreeColumn ? "rowheader" : "gridcell",
|
|
2946
3128
|
"aria-colindex": n + 1,
|
|
2947
|
-
children: t.isTreeColumn ? /* @__PURE__ */
|
|
3129
|
+
children: t.isTreeColumn ? /* @__PURE__ */ v(Xr, {
|
|
2948
3130
|
taskId: e.id,
|
|
2949
3131
|
depth: r,
|
|
2950
3132
|
isParent: o,
|
|
@@ -2957,14 +3139,14 @@ var Pr = 100, Fr = n(function({ task: e, rowHeight: t, rowIndex: n, depth: r, po
|
|
|
2957
3139
|
}, t.key))
|
|
2958
3140
|
});
|
|
2959
3141
|
});
|
|
2960
|
-
|
|
3142
|
+
Qr.displayName = "TaskListRow";
|
|
2961
3143
|
//#endregion
|
|
2962
3144
|
//#region src/hooks/useColumnWidths.ts
|
|
2963
|
-
function
|
|
2964
|
-
let [e, t] =
|
|
3145
|
+
function $r() {
|
|
3146
|
+
let [e, t] = m({}), n = p(null);
|
|
2965
3147
|
return {
|
|
2966
3148
|
widths: e,
|
|
2967
|
-
onResizeStart:
|
|
3149
|
+
onResizeStart: o((e, r, i) => {
|
|
2968
3150
|
i.preventDefault(), n.current = {
|
|
2969
3151
|
key: e,
|
|
2970
3152
|
mouseX: i.clientX,
|
|
@@ -2986,29 +3168,29 @@ function Ir() {
|
|
|
2986
3168
|
}
|
|
2987
3169
|
//#endregion
|
|
2988
3170
|
//#region src/components/taskList/TaskList.tsx
|
|
2989
|
-
var
|
|
3171
|
+
var ei = {
|
|
2990
3172
|
flex: "1 1 auto",
|
|
2991
3173
|
minHeight: 0
|
|
2992
3174
|
};
|
|
2993
|
-
function
|
|
2994
|
-
let { visibleTasks: n, expandedIds: r, parentIds:
|
|
3175
|
+
function ti({ columns: e = [], taskList: t }) {
|
|
3176
|
+
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 } = $r(), S = f(() => e.map((e) => b[e.key] == null ? e : {
|
|
2995
3177
|
...e,
|
|
2996
3178
|
width: b[e.key]
|
|
2997
|
-
}), [e, b]), C =
|
|
3179
|
+
}), [e, b]), C = q((e) => {
|
|
2998
3180
|
s(e);
|
|
2999
3181
|
let t = n.find((t) => t.id === e);
|
|
3000
|
-
t && (c?.(t),
|
|
3182
|
+
t && (c?.(t), l(e, {
|
|
3001
3183
|
horizontal: !0,
|
|
3002
3184
|
vertical: !1
|
|
3003
3185
|
}));
|
|
3004
|
-
}), w =
|
|
3186
|
+
}), w = o((e) => C.current(e), [C]), T = f(() => {
|
|
3005
3187
|
let e = /* @__PURE__ */ new Map();
|
|
3006
3188
|
for (let t of n) {
|
|
3007
3189
|
let n = t.parentId == null ? -1 : e.get(t.parentId) ?? 0;
|
|
3008
3190
|
e.set(t.id, n + 1);
|
|
3009
3191
|
}
|
|
3010
3192
|
return e;
|
|
3011
|
-
}, [n]), E =
|
|
3193
|
+
}, [n]), E = f(() => {
|
|
3012
3194
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
3013
3195
|
for (let r of n) {
|
|
3014
3196
|
let n = r.parentId ?? null, i = (e.get(n) ?? 0) + 1;
|
|
@@ -3022,58 +3204,58 @@ function Rr({ columns: e = [], taskList: t }) {
|
|
|
3022
3204
|
n.setsize = e.get(r.parentId ?? null) ?? 1;
|
|
3023
3205
|
}
|
|
3024
3206
|
return t;
|
|
3025
|
-
}, [n]), { viewport: D, scheduleMeasure: O } =
|
|
3026
|
-
|
|
3027
|
-
}, [
|
|
3028
|
-
return /* @__PURE__ */
|
|
3207
|
+
}, [n]), { viewport: D, scheduleMeasure: O } = St(g, { trackHorizontal: !1 }), k = o(() => {
|
|
3208
|
+
_(), O();
|
|
3209
|
+
}, [_, O]), A = Wr(D.scrollTop, D.clientHeight, d, n.length, 6);
|
|
3210
|
+
return /* @__PURE__ */ y("div", {
|
|
3029
3211
|
className: $.taskList,
|
|
3030
|
-
style: { height:
|
|
3212
|
+
style: { height: m },
|
|
3031
3213
|
role: "treegrid",
|
|
3032
|
-
"aria-label":
|
|
3214
|
+
"aria-label": h.taskList,
|
|
3033
3215
|
"aria-rowcount": n.length + 1,
|
|
3034
3216
|
"aria-colcount": S.length,
|
|
3035
|
-
children: [/* @__PURE__ */
|
|
3217
|
+
children: [/* @__PURE__ */ v(Jr, {
|
|
3036
3218
|
columns: S,
|
|
3037
|
-
rowHeight:
|
|
3219
|
+
rowHeight: d,
|
|
3038
3220
|
scales: p,
|
|
3039
3221
|
onResizeStart: x,
|
|
3040
3222
|
slots: t?.header?.slots,
|
|
3041
3223
|
slotProps: t?.header?.slotProps
|
|
3042
|
-
}), /* @__PURE__ */
|
|
3043
|
-
ref:
|
|
3224
|
+
}), /* @__PURE__ */ v("div", {
|
|
3225
|
+
ref: g,
|
|
3044
3226
|
className: $.body,
|
|
3045
|
-
style:
|
|
3227
|
+
style: ei,
|
|
3046
3228
|
onScroll: k,
|
|
3047
3229
|
role: "presentation",
|
|
3048
|
-
children: /* @__PURE__ */
|
|
3230
|
+
children: /* @__PURE__ */ y("div", {
|
|
3049
3231
|
className: $.rows,
|
|
3050
3232
|
role: "rowgroup",
|
|
3051
3233
|
children: [
|
|
3052
|
-
/* @__PURE__ */
|
|
3053
|
-
style: { height: A.start *
|
|
3234
|
+
/* @__PURE__ */ v("div", {
|
|
3235
|
+
style: { height: A.start * d },
|
|
3054
3236
|
role: "presentation",
|
|
3055
3237
|
"aria-hidden": "true"
|
|
3056
3238
|
}),
|
|
3057
|
-
Array.from({ length: A.end - A.start }, (e,
|
|
3058
|
-
let s = A.start +
|
|
3059
|
-
return /* @__PURE__ */
|
|
3239
|
+
Array.from({ length: A.end - A.start }, (e, o) => {
|
|
3240
|
+
let s = A.start + o, c = n[s], l = E.get(c.id);
|
|
3241
|
+
return /* @__PURE__ */ v(Qr, {
|
|
3060
3242
|
task: c,
|
|
3061
|
-
rowHeight:
|
|
3243
|
+
rowHeight: d,
|
|
3062
3244
|
rowIndex: s,
|
|
3063
3245
|
depth: T.get(c.id) ?? 0,
|
|
3064
3246
|
posinset: l?.posinset ?? 1,
|
|
3065
3247
|
setsize: l?.setsize ?? 1,
|
|
3066
|
-
isParent:
|
|
3248
|
+
isParent: i.has(c.id),
|
|
3067
3249
|
isExpanded: r.has(c.id),
|
|
3068
|
-
isSelected:
|
|
3069
|
-
onToggleExpand:
|
|
3250
|
+
isSelected: u === c.id,
|
|
3251
|
+
onToggleExpand: a,
|
|
3070
3252
|
onSelect: w,
|
|
3071
3253
|
columns: S,
|
|
3072
3254
|
treeCell: t?.treeCell
|
|
3073
3255
|
}, c.id);
|
|
3074
3256
|
}),
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
style: { height: (n.length - A.end) *
|
|
3257
|
+
/* @__PURE__ */ v("div", {
|
|
3258
|
+
style: { height: (n.length - A.end) * d },
|
|
3077
3259
|
role: "presentation",
|
|
3078
3260
|
"aria-hidden": "true"
|
|
3079
3261
|
})
|
|
@@ -3084,79 +3266,77 @@ function Rr({ columns: e = [], taskList: t }) {
|
|
|
3084
3266
|
}
|
|
3085
3267
|
//#endregion
|
|
3086
3268
|
//#region src/hooks/useGridResize.ts
|
|
3087
|
-
function
|
|
3088
|
-
let [n, r] =
|
|
3269
|
+
function ni(e, t) {
|
|
3270
|
+
let [n, r] = m(void 0), i = p(null);
|
|
3089
3271
|
return {
|
|
3090
3272
|
gridWidth: n,
|
|
3091
|
-
onHandleMouseDown:
|
|
3273
|
+
onHandleMouseDown: o((n) => {
|
|
3092
3274
|
n.preventDefault();
|
|
3093
|
-
let
|
|
3094
|
-
if (!
|
|
3095
|
-
|
|
3275
|
+
let a = t.current, o = e.current;
|
|
3276
|
+
if (!a || !o) return;
|
|
3277
|
+
i.current = {
|
|
3096
3278
|
mouseX: n.clientX,
|
|
3097
|
-
width:
|
|
3279
|
+
width: a.offsetWidth,
|
|
3098
3280
|
containerW: o.offsetWidth
|
|
3099
3281
|
};
|
|
3100
3282
|
let s = (e) => {
|
|
3101
|
-
if (!
|
|
3102
|
-
let { mouseX: t, width: n, containerW:
|
|
3103
|
-
r(Math.min(
|
|
3283
|
+
if (!i.current) return;
|
|
3284
|
+
let { mouseX: t, width: n, containerW: a } = i.current;
|
|
3285
|
+
r(Math.min(a, Math.max(10, n + (t - e.clientX))));
|
|
3104
3286
|
}, c = () => {
|
|
3105
|
-
|
|
3287
|
+
i.current = null, window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", c);
|
|
3106
3288
|
};
|
|
3107
3289
|
window.addEventListener("mousemove", s), window.addEventListener("mouseup", c);
|
|
3108
3290
|
}, [e, t])
|
|
3109
3291
|
};
|
|
3110
3292
|
}
|
|
3293
|
+
var ri = { actionsCell: "_actionsCell_1gvtx_1" };
|
|
3111
3294
|
//#endregion
|
|
3112
3295
|
//#region src/components/taskList/ActionsCell.tsx
|
|
3113
|
-
function
|
|
3114
|
-
let t =
|
|
3296
|
+
function ii(e) {
|
|
3297
|
+
let t = j(e.startDate, 1);
|
|
3115
3298
|
return {
|
|
3116
3299
|
id: `task-${Date.now()}`,
|
|
3117
3300
|
name: "New task",
|
|
3118
3301
|
startDate: t,
|
|
3119
|
-
endDate:
|
|
3302
|
+
endDate: j(t, 1),
|
|
3120
3303
|
duration: 1,
|
|
3121
3304
|
progress: 0,
|
|
3122
3305
|
type: "task",
|
|
3123
3306
|
parentId: e.parentId ?? null
|
|
3124
3307
|
};
|
|
3125
3308
|
}
|
|
3126
|
-
function
|
|
3127
|
-
return /* @__PURE__ */
|
|
3128
|
-
|
|
3129
|
-
display: "flex",
|
|
3130
|
-
gap: "8px"
|
|
3131
|
-
},
|
|
3309
|
+
function ai({ task: e, api: t }) {
|
|
3310
|
+
return /* @__PURE__ */ y("div", {
|
|
3311
|
+
className: ri.actionsCell,
|
|
3132
3312
|
children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ v("button", {
|
|
3134
3314
|
type: "button",
|
|
3135
3315
|
title: "Edit",
|
|
3136
3316
|
"aria-label": t.labels.editTask(e),
|
|
3137
3317
|
onClick: (n) => {
|
|
3138
3318
|
n.stopPropagation(), t.editTask(e);
|
|
3139
3319
|
},
|
|
3140
|
-
children: /* @__PURE__ */
|
|
3320
|
+
children: /* @__PURE__ */ v("span", {
|
|
3141
3321
|
"aria-hidden": "true",
|
|
3142
3322
|
children: "✎"
|
|
3143
3323
|
})
|
|
3144
3324
|
}),
|
|
3145
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ v("button", {
|
|
3146
3326
|
type: "button",
|
|
3147
3327
|
title: "Add after",
|
|
3148
3328
|
"aria-label": t.labels.addTaskAfter(e),
|
|
3149
3329
|
onClick: (n) => {
|
|
3150
3330
|
n.stopPropagation();
|
|
3151
|
-
let r =
|
|
3331
|
+
let r = ii(e);
|
|
3152
3332
|
t.createTask(r, e.id), t.editTask(r);
|
|
3153
3333
|
},
|
|
3154
|
-
children: /* @__PURE__ */
|
|
3334
|
+
children: /* @__PURE__ */ v("span", {
|
|
3155
3335
|
"aria-hidden": "true",
|
|
3156
3336
|
children: "➕"
|
|
3157
3337
|
})
|
|
3158
3338
|
}),
|
|
3159
|
-
/* @__PURE__ */
|
|
3339
|
+
/* @__PURE__ */ v("button", {
|
|
3160
3340
|
type: "button",
|
|
3161
3341
|
title: "Delete",
|
|
3162
3342
|
"aria-label": t.labels.deleteTask(e),
|
|
@@ -3164,7 +3344,7 @@ function Vr({ task: e, api: t }) {
|
|
|
3164
3344
|
onClick: (n) => {
|
|
3165
3345
|
n.stopPropagation(), t.deleteTask(e.id);
|
|
3166
3346
|
},
|
|
3167
|
-
children: /* @__PURE__ */
|
|
3347
|
+
children: /* @__PURE__ */ v("span", {
|
|
3168
3348
|
"aria-hidden": "true",
|
|
3169
3349
|
children: "❌"
|
|
3170
3350
|
})
|
|
@@ -3174,12 +3354,12 @@ function Vr({ task: e, api: t }) {
|
|
|
3174
3354
|
}
|
|
3175
3355
|
//#endregion
|
|
3176
3356
|
//#region src/components/taskList/defaultColumns.tsx
|
|
3177
|
-
var
|
|
3357
|
+
var oi = "__action", si = [
|
|
3178
3358
|
{
|
|
3179
|
-
key:
|
|
3359
|
+
key: oi,
|
|
3180
3360
|
header: " ",
|
|
3181
|
-
width:
|
|
3182
|
-
render: (e, t) => /* @__PURE__ */
|
|
3361
|
+
width: 100,
|
|
3362
|
+
render: (e, t) => /* @__PURE__ */ v(ai, {
|
|
3183
3363
|
task: e,
|
|
3184
3364
|
api: t
|
|
3185
3365
|
})
|
|
@@ -3209,12 +3389,12 @@ var Hr = "__action", Ur = [
|
|
|
3209
3389
|
width: 90,
|
|
3210
3390
|
render: (e) => `${e.progress ?? 0}%`
|
|
3211
3391
|
}
|
|
3212
|
-
],
|
|
3392
|
+
], ci = si.filter((e) => e.key !== oi);
|
|
3213
3393
|
//#endregion
|
|
3214
3394
|
//#region src/Gantt.tsx
|
|
3215
|
-
function
|
|
3216
|
-
let
|
|
3217
|
-
return /* @__PURE__ */
|
|
3395
|
+
function li({ 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 }) {
|
|
3396
|
+
let ee = p(null), I = p(null), { gridWidth: L, onHandleMouseDown: R } = ni(ee, I), z = h ?? (O ? ci : si), B = !A;
|
|
3397
|
+
return /* @__PURE__ */ v(Cn, {
|
|
3218
3398
|
tasks: e,
|
|
3219
3399
|
dependencies: t,
|
|
3220
3400
|
rowHeight: n,
|
|
@@ -3224,41 +3404,41 @@ function Gr({ tasks: e, dependencies: t, rowHeight: n, colWidth: r, height: i, s
|
|
|
3224
3404
|
padDays: o,
|
|
3225
3405
|
zoomLevels: s,
|
|
3226
3406
|
defaultZoomIndex: c,
|
|
3227
|
-
onZoomChange:
|
|
3228
|
-
zoomWheel:
|
|
3229
|
-
zoomKeyboard:
|
|
3230
|
-
onTaskClick:
|
|
3231
|
-
onDependencyCreate:
|
|
3407
|
+
onZoomChange: l,
|
|
3408
|
+
zoomWheel: u,
|
|
3409
|
+
zoomKeyboard: d,
|
|
3410
|
+
onTaskClick: m,
|
|
3411
|
+
onDependencyCreate: _,
|
|
3232
3412
|
onDependencyDelete: b,
|
|
3233
3413
|
onTaskCreate: x,
|
|
3234
3414
|
onTaskDelete: S,
|
|
3235
3415
|
onTaskEdit: C,
|
|
3236
3416
|
onTasksChange: w,
|
|
3237
3417
|
apiRef: k,
|
|
3238
|
-
labels:
|
|
3418
|
+
labels: F,
|
|
3239
3419
|
calendar: T,
|
|
3240
3420
|
snapToWorking: E,
|
|
3241
3421
|
durationUnit: D,
|
|
3242
3422
|
readOnly: O,
|
|
3243
|
-
children: /* @__PURE__ */
|
|
3244
|
-
value:
|
|
3423
|
+
children: /* @__PURE__ */ v(Tn, {
|
|
3424
|
+
value: f(() => ({
|
|
3245
3425
|
bars: M,
|
|
3246
|
-
dependencies:
|
|
3247
|
-
timeline:
|
|
3426
|
+
dependencies: N,
|
|
3427
|
+
timeline: P
|
|
3248
3428
|
}), [
|
|
3249
3429
|
M,
|
|
3250
|
-
|
|
3251
|
-
|
|
3430
|
+
N,
|
|
3431
|
+
P
|
|
3252
3432
|
]),
|
|
3253
|
-
children:
|
|
3254
|
-
ref:
|
|
3433
|
+
children: B ? /* @__PURE__ */ y("div", {
|
|
3434
|
+
ref: ee,
|
|
3255
3435
|
role: "group",
|
|
3256
|
-
"aria-label":
|
|
3436
|
+
"aria-label": F?.gantt ?? Ie.gantt,
|
|
3257
3437
|
style: { position: "relative" },
|
|
3258
|
-
children: [/* @__PURE__ */
|
|
3259
|
-
columns:
|
|
3438
|
+
children: [/* @__PURE__ */ v(ti, {
|
|
3439
|
+
columns: z,
|
|
3260
3440
|
taskList: j
|
|
3261
|
-
}), /* @__PURE__ */
|
|
3441
|
+
}), /* @__PURE__ */ y("div", {
|
|
3262
3442
|
ref: I,
|
|
3263
3443
|
style: {
|
|
3264
3444
|
position: "absolute",
|
|
@@ -3268,21 +3448,21 @@ function Gr({ tasks: e, dependencies: t, rowHeight: n, colWidth: r, height: i, s
|
|
|
3268
3448
|
display: "flex",
|
|
3269
3449
|
flexDirection: "row",
|
|
3270
3450
|
background: "var(--am-gantt-grid-bg, #ffffff)",
|
|
3271
|
-
...
|
|
3451
|
+
...L === void 0 ? { left: g } : { width: L }
|
|
3272
3452
|
},
|
|
3273
|
-
children: [/* @__PURE__ */
|
|
3453
|
+
children: [/* @__PURE__ */ v(qr, { onMouseDown: R }), /* @__PURE__ */ v("div", {
|
|
3274
3454
|
style: {
|
|
3275
3455
|
flex: "1 1 auto",
|
|
3276
3456
|
minWidth: 0
|
|
3277
3457
|
},
|
|
3278
|
-
children: /* @__PURE__ */
|
|
3458
|
+
children: /* @__PURE__ */ v(Gr, {})
|
|
3279
3459
|
})]
|
|
3280
3460
|
})]
|
|
3281
|
-
}) : /* @__PURE__ */
|
|
3461
|
+
}) : /* @__PURE__ */ v(Gr, {})
|
|
3282
3462
|
})
|
|
3283
3463
|
});
|
|
3284
3464
|
}
|
|
3285
3465
|
//#endregion
|
|
3286
|
-
export {
|
|
3466
|
+
export { oi as ACTION_COLUMN_KEY, Hn as BarTooltipRoot, Un as BarTooltipTrigger, Mn as Calendar, si as DEFAULT_COLUMNS, Wt as DEFAULT_ZOOM_INDEX, Ut as DEFAULT_ZOOM_LEVELS, li as Gantt, Xn as GanttBarTooltip, Gr as GanttGrid, Cn as GanttProvider, Tn as GanttSlotsProvider, er as MilestoneBar, ar as ProjectBar, ci as READ_ONLY_COLUMNS, cr as TaskBar, ti as TaskList, Me as displayEndDate, Ne as endInstantFromDisplayDate, Y as mergeSlotProps, Vn as useBarTooltip, rn as useGanttReadOnly, J as useGanttSlots };
|
|
3287
3467
|
|
|
3288
3468
|
//# sourceMappingURL=index.mjs.map
|