@umriss-ui/schedule 0.53.0 → 0.54.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/CHANGELOG.md +13 -0
- package/dist/schedule.js +880 -881
- package/docs/llms-full.md +19 -19
- package/package.json +5 -5
package/dist/schedule.js
CHANGED
|
@@ -1,179 +1,179 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./schedule.css";
|
|
3
|
-
import { localOffset as
|
|
4
|
-
import { useContext as
|
|
3
|
+
import { localOffset as ht, toWorkingTimeClamped as z, calendarFrom as It, toWallClock as Jt, MINUTE as J, DAY as Q, timeStep as Os, workingTimeTicks as $s, inDoubledHour as Fs, HOUR as Qt, LinearScale as Es, resolveColours as Bs, removedIntervals as xs, subscribeTheme as Ns } from "@umriss-ui/charts";
|
|
4
|
+
import { useContext as te, useEffect as Y, createContext as Je, useRef as U, useId as Qe, useState as ut, useLayoutEffect as Mt, useImperativeHandle as Ps, useSyncExternalStore as ee, useMemo as X, createElement as Rs } from "react";
|
|
5
5
|
import { jsxs as E, Fragment as ot, jsx as m } from "react/jsx-runtime";
|
|
6
|
-
import { zoneFields as ts, zoneInstant as
|
|
7
|
-
function tt(
|
|
8
|
-
return { from:
|
|
6
|
+
import { zoneFields as ts, zoneInstant as Vt, useWording as rt, formatDuration as Gs, useFormats as gt, useTimeZoneLabel as Hs, Skeleton as Ks, AngleGlyph as Ys, VisuallyHidden as De, warnOnce as Vs, createLongPress as zs, zoneDayStart as Ws } from "@umriss-ui/core";
|
|
7
|
+
function tt(s) {
|
|
8
|
+
return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return (
|
|
10
|
+
function se(s, t) {
|
|
11
|
+
return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return (
|
|
13
|
+
function ne(s, t) {
|
|
14
|
+
return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (t.kind === "place" || t.subtask !==
|
|
16
|
+
function _e(s, t) {
|
|
17
|
+
if (t.kind === "place" || t.subtask !== s.id) return s;
|
|
18
18
|
switch (t.kind) {
|
|
19
19
|
case "move":
|
|
20
20
|
case "stretch":
|
|
21
|
-
return { ...
|
|
21
|
+
return { ...s, from: t.from, to: t.to };
|
|
22
22
|
case "leadIn":
|
|
23
|
-
return { ...
|
|
23
|
+
return { ...s, leadIn: t.leadIn };
|
|
24
24
|
case "leadOut":
|
|
25
|
-
return { ...
|
|
25
|
+
return { ...s, leadOut: t.leadOut };
|
|
26
26
|
case "lane":
|
|
27
|
-
return { ...
|
|
27
|
+
return { ...s, lane: t.lane };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function so(s, t) {
|
|
31
31
|
return {
|
|
32
32
|
id: t,
|
|
33
|
-
task:
|
|
34
|
-
lane:
|
|
35
|
-
from:
|
|
36
|
-
to:
|
|
37
|
-
...
|
|
38
|
-
...
|
|
33
|
+
task: s.task,
|
|
34
|
+
lane: s.lane,
|
|
35
|
+
from: s.from,
|
|
36
|
+
to: s.to,
|
|
37
|
+
...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
|
|
38
|
+
...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ie(s) {
|
|
42
42
|
const t = [], e = /* @__PURE__ */ new Map();
|
|
43
|
-
|
|
44
|
-
const { from: o, to: a } = tt(
|
|
43
|
+
s.forEach((n, i) => {
|
|
44
|
+
const { from: o, to: a } = tt(n);
|
|
45
45
|
if (!(o < a)) return;
|
|
46
|
-
const r = e.get(
|
|
47
|
-
r.push({ subtask:
|
|
46
|
+
const r = e.get(n.lane) ?? [];
|
|
47
|
+
r.push({ subtask: n, index: i, from: o, to: a }), e.set(n.lane, r);
|
|
48
48
|
});
|
|
49
|
-
for (const [
|
|
49
|
+
for (const [n, i] of e) {
|
|
50
50
|
i.sort((o, a) => o.from - a.from || o.index - a.index);
|
|
51
51
|
for (let o = 0; o < i.length; o++) {
|
|
52
52
|
const a = i[o];
|
|
53
53
|
for (let r = o + 1; r < i.length; r++) {
|
|
54
54
|
const l = i[r];
|
|
55
55
|
if (l.from >= a.to) break;
|
|
56
|
-
t.push({ lane:
|
|
56
|
+
t.push({ lane: n, first: a.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(a.to, l.to) });
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Us(s) {
|
|
63
63
|
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
64
|
-
for (const
|
|
65
|
-
const i = tt(
|
|
64
|
+
for (const n of s) {
|
|
65
|
+
const i = tt(n), o = e.get(n.lane) ?? [];
|
|
66
66
|
let a = 0;
|
|
67
67
|
if (i.from < i.to) {
|
|
68
68
|
for (const r of o) i.from < r.to && r.from < i.to && a++;
|
|
69
69
|
o.push(i);
|
|
70
70
|
}
|
|
71
|
-
e.set(
|
|
71
|
+
e.set(n.lane, o), t.set(n.id, a);
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const e = new Map(
|
|
75
|
+
function oe(s, t) {
|
|
76
|
+
const e = new Map(s.map((i) => [i.id, i])), n = [];
|
|
77
77
|
for (const i of t) {
|
|
78
78
|
const o = e.get(i.from), a = e.get(i.to);
|
|
79
79
|
if (o === void 0 || a === void 0) continue;
|
|
80
|
-
const r =
|
|
81
|
-
d > 0 &&
|
|
80
|
+
const r = se(i, o), l = ne(i, a), d = r + i.lag - l;
|
|
81
|
+
d > 0 && n.push({ dependency: i.id, departure: r, arrival: l, shortBy: d });
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return n;
|
|
84
84
|
}
|
|
85
|
-
function es(
|
|
85
|
+
function es(s, t) {
|
|
86
86
|
const e = [];
|
|
87
|
-
for (const
|
|
88
|
-
const i = tt(
|
|
87
|
+
for (const n of s) {
|
|
88
|
+
const i = tt(n);
|
|
89
89
|
for (const o of t)
|
|
90
|
-
o.lane !==
|
|
90
|
+
o.lane !== n.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: n.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
|
|
91
91
|
}
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function no(s, t, e = []) {
|
|
95
95
|
return {
|
|
96
|
-
overlaps:
|
|
97
|
-
violatedDependencies:
|
|
98
|
-
inBlockedTime: es(
|
|
96
|
+
overlaps: ie(s),
|
|
97
|
+
violatedDependencies: oe(s, t),
|
|
98
|
+
inBlockedTime: es(s, e)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function io(s, t, e) {
|
|
102
102
|
if (e.kind === "place") return [];
|
|
103
|
-
const
|
|
103
|
+
const n = new Map(s.map((l) => [l.id, _e(l, e)])), i = /* @__PURE__ */ new Map();
|
|
104
104
|
for (const l of t) {
|
|
105
105
|
const d = i.get(l.from) ?? [];
|
|
106
106
|
d.push(l), i.set(l.from, d);
|
|
107
107
|
}
|
|
108
108
|
const o = /* @__PURE__ */ new Map(), a = [e.subtask];
|
|
109
|
-
let r = (
|
|
109
|
+
let r = (s.length + 1) * (t.length + 1);
|
|
110
110
|
for (; a.length > 0 && r-- > 0; ) {
|
|
111
|
-
const l = a.shift(), d =
|
|
111
|
+
const l = a.shift(), d = n.get(l);
|
|
112
112
|
if (d !== void 0)
|
|
113
113
|
for (const c of i.get(l) ?? []) {
|
|
114
114
|
if (c.to === e.subtask) continue;
|
|
115
|
-
const h =
|
|
115
|
+
const h = n.get(c.to);
|
|
116
116
|
if (h === void 0) continue;
|
|
117
|
-
const p =
|
|
117
|
+
const p = se(c, d) + c.lag - ne(c, h);
|
|
118
118
|
if (!(p > 0)) continue;
|
|
119
119
|
const g = { kind: "move", subtask: h.id, from: h.from + p, to: h.to + p };
|
|
120
|
-
|
|
120
|
+
n.set(h.id, _e(h, g)), o.set(h.id, g), a.push(h.id);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return [...o.values()];
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const { step:
|
|
127
|
-
if (!(
|
|
128
|
-
const o =
|
|
129
|
-
return
|
|
125
|
+
function Xs(s, t, e) {
|
|
126
|
+
const { step: n, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
|
|
127
|
+
if (!(n > 0) || !Number.isFinite(s)) return s;
|
|
128
|
+
const o = s - ht(s, e), a = i + Math.round((o - i) / n) * n, r = a + ht(s, e), l = a + ht(r, e);
|
|
129
|
+
return l - ht(l, e) === a ? l : r;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return e === 0 || !Number.isFinite(e) ? [] :
|
|
131
|
+
function oo(s, t, e) {
|
|
132
|
+
return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
let t = !1, e = !1,
|
|
136
|
-
for (const o of
|
|
137
|
-
o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ?
|
|
138
|
-
return { dashed: t, hatched: e, muted:
|
|
134
|
+
function Lt(s) {
|
|
135
|
+
let t = !1, e = !1, n = !1, i = !1;
|
|
136
|
+
for (const o of s ?? [])
|
|
137
|
+
o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? n = !0 : o === "open" && (i = !0);
|
|
138
|
+
return { dashed: t, hatched: e, muted: n, open: i };
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const ae = /* @__PURE__ */ Je(null), ss = /* @__PURE__ */ Je(null);
|
|
141
141
|
function ns() {
|
|
142
|
-
return
|
|
142
|
+
return te(ss);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const t =
|
|
144
|
+
function qs(s) {
|
|
145
|
+
const t = te(ae);
|
|
146
146
|
if (t === null)
|
|
147
|
-
throw new Error(`@umriss-ui/schedule: <${
|
|
147
|
+
throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
|
|
148
148
|
return t;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const o =
|
|
150
|
+
function re(s, t, e, n, i) {
|
|
151
|
+
const o = qs(s), a = U(null);
|
|
152
152
|
Y(() => (a.current = e(o, t), () => {
|
|
153
153
|
a.current !== null && i(o, a.current), a.current = null;
|
|
154
154
|
}), [o]), Y(() => {
|
|
155
|
-
a.current !== null &&
|
|
155
|
+
a.current !== null && n(o, a.current, t);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
158
|
+
function js(s) {
|
|
159
|
+
re("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function Zs(s) {
|
|
162
|
+
re("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const t =
|
|
164
|
+
function Js(s) {
|
|
165
|
+
const t = te(ae);
|
|
166
166
|
return Y(() => {
|
|
167
167
|
if (t !== null)
|
|
168
|
-
return t.registerDataTable(
|
|
169
|
-
}, [t,
|
|
168
|
+
return t.registerDataTable(s), () => t.unregisterDataTable();
|
|
169
|
+
}, [t, s]), t;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
171
|
+
function At(s, t) {
|
|
172
|
+
re(s, t, (e, n) => e.registerLayer(n), (e, n, i) => e.updateLayer(n, i), (e, n) => e.unregisterLayer(n));
|
|
173
173
|
}
|
|
174
|
-
const is = 24,
|
|
175
|
-
function
|
|
176
|
-
const { lanes: t, groups: e, collapsed:
|
|
174
|
+
const is = 24, Qs = 4, tn = 3, Rt = 4;
|
|
175
|
+
function Oe(s) {
|
|
176
|
+
const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = is } = s, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
|
|
177
177
|
const S = [];
|
|
178
178
|
let I = r(b.parent);
|
|
179
179
|
const $ = /* @__PURE__ */ new Set();
|
|
@@ -191,18 +191,18 @@ function _e(n) {
|
|
|
191
191
|
}
|
|
192
192
|
const h = [], p = /* @__PURE__ */ new Map();
|
|
193
193
|
let g = [], f = null, y = 0;
|
|
194
|
-
const A = (b) => (h.push({ ...b, top: y }), y += b.height, h.length - 1), C = (b) => b.find((S) =>
|
|
194
|
+
const A = (b) => (h.push({ ...b, top: y }), y += b.height, h.length - 1), C = (b) => b.find((S) => n.has(S)), M = () => {
|
|
195
195
|
if (f === null) return;
|
|
196
|
-
const { row: b, lanes: S } = f, I = h[b], $ = Math.max(I.height, S.length *
|
|
196
|
+
const { row: b, lanes: S } = f, I = h[b], $ = Math.max(I.height, S.length * Qs + 2 * Rt);
|
|
197
197
|
h[b] = { ...I, height: $ }, y += $ - I.height;
|
|
198
|
-
const O = $ - 2 *
|
|
199
|
-
S.forEach((
|
|
200
|
-
const
|
|
201
|
-
p.set(
|
|
202
|
-
top: I.top +
|
|
198
|
+
const O = $ - 2 * Rt, R = Math.max(tn, Math.floor(O / S.length));
|
|
199
|
+
S.forEach((Z, vt) => {
|
|
200
|
+
const yt = c.get(Z) ?? [];
|
|
201
|
+
p.set(Z, {
|
|
202
|
+
top: I.top + Rt + vt * R,
|
|
203
203
|
height: R,
|
|
204
204
|
miniature: !0,
|
|
205
|
-
group:
|
|
205
|
+
group: yt[yt.length - 1]
|
|
206
206
|
});
|
|
207
207
|
}), f = null;
|
|
208
208
|
};
|
|
@@ -249,100 +249,100 @@ function _e(n) {
|
|
|
249
249
|
}
|
|
250
250
|
return M(), { rows: h, slots: p, height: y };
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
if (t.size === 0) return
|
|
252
|
+
function en(s, t) {
|
|
253
|
+
if (t.size === 0) return s;
|
|
254
254
|
const e = /* @__PURE__ */ new Set();
|
|
255
|
-
for (const
|
|
255
|
+
for (const n of s) t.has(n) || e.add(n);
|
|
256
256
|
return e;
|
|
257
257
|
}
|
|
258
|
-
function at(
|
|
259
|
-
if (t < 0 || t >=
|
|
260
|
-
let e = 0,
|
|
261
|
-
for (; e <=
|
|
262
|
-
const i = e +
|
|
263
|
-
if (t < o.top)
|
|
258
|
+
function at(s, t) {
|
|
259
|
+
if (t < 0 || t >= s.height) return null;
|
|
260
|
+
let e = 0, n = s.rows.length - 1;
|
|
261
|
+
for (; e <= n; ) {
|
|
262
|
+
const i = e + n >> 1, o = s.rows[i];
|
|
263
|
+
if (t < o.top) n = i - 1;
|
|
264
264
|
else if (t >= o.top + o.height) e = i + 1;
|
|
265
265
|
else return o;
|
|
266
266
|
}
|
|
267
267
|
return null;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function le(s, t) {
|
|
270
|
+
return s.slots.get(t) ?? null;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
const e = at(
|
|
272
|
+
function sn(s, t) {
|
|
273
|
+
const e = at(s, t);
|
|
274
274
|
if (e === null) return null;
|
|
275
275
|
if (e.kind === "lane") return e.lane ?? null;
|
|
276
276
|
if (e.kind === "groupHead") return null;
|
|
277
|
-
for (const [
|
|
278
|
-
if (i.miniature && t >= i.top && t < i.top + i.height) return
|
|
277
|
+
for (const [n, i] of s.slots)
|
|
278
|
+
if (i.miniature && t >= i.top && t < i.top + i.height) return n;
|
|
279
279
|
return null;
|
|
280
280
|
}
|
|
281
|
-
const
|
|
282
|
-
function x(
|
|
283
|
-
return Math.round(
|
|
281
|
+
const nn = 6, os = 3, ct = 2, $e = 3, Fe = 3;
|
|
282
|
+
function x(s, t) {
|
|
283
|
+
return Math.round(s.scale.toPx(z(t, s.calendar)));
|
|
284
284
|
}
|
|
285
|
-
function et(
|
|
286
|
-
const e =
|
|
287
|
-
return e === null ? null : { ...e, top: e.top -
|
|
285
|
+
function et(s, t) {
|
|
286
|
+
const e = le(s.rows, t);
|
|
287
|
+
return e === null ? null : { ...e, top: e.top - s.scrollY };
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const e = et(
|
|
291
|
-
return e === null ? null : { x: x(
|
|
289
|
+
function de(s, t) {
|
|
290
|
+
const e = et(s, t.lane);
|
|
291
|
+
return e === null ? null : { x: x(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
return
|
|
293
|
+
function Ee(s, t) {
|
|
294
|
+
return sn(s.rows, t + s.scrollY);
|
|
295
295
|
}
|
|
296
|
-
function as(
|
|
297
|
-
const i = e.miniature ? 0 :
|
|
296
|
+
function as(s, t, e, n) {
|
|
297
|
+
const i = e.miniature ? 0 : nn, o = e.miniature ? 0 : Fe * $e, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - s.scrollY + Math.floor((e.height - a) / 2), l = tt(t);
|
|
298
298
|
return {
|
|
299
299
|
subtask: t,
|
|
300
300
|
miniature: e.miniature,
|
|
301
|
-
depth:
|
|
302
|
-
y: r + (e.miniature ? 0 : Math.min(
|
|
301
|
+
depth: n,
|
|
302
|
+
y: r + (e.miniature ? 0 : Math.min(n, Fe) * $e),
|
|
303
303
|
height: a,
|
|
304
|
-
outerFrom: x(
|
|
305
|
-
mainFrom: x(
|
|
306
|
-
mainTo: x(
|
|
307
|
-
outerTo: x(
|
|
304
|
+
outerFrom: x(s, l.from),
|
|
305
|
+
mainFrom: x(s, t.from),
|
|
306
|
+
mainTo: x(s, t.to),
|
|
307
|
+
outerTo: x(s, l.to)
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function rs(
|
|
311
|
-
if (e <
|
|
312
|
-
const
|
|
313
|
-
return t <
|
|
310
|
+
function rs(s, t, e) {
|
|
311
|
+
if (e < s.y || e > s.y + s.height) return null;
|
|
312
|
+
const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
|
|
313
|
+
return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (e <
|
|
317
|
-
const i = Math.abs(t -
|
|
318
|
-
return Math.min(i, o) >
|
|
315
|
+
function on(s, t, e, n = 5) {
|
|
316
|
+
if (e < s.y || e > s.y + s.height) return null;
|
|
317
|
+
const i = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
|
|
318
|
+
return Math.min(i, o) > n ? null : i <= o ? "from" : "to";
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function zt(s, t, e) {
|
|
321
|
+
return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
let i = Math.min(
|
|
325
|
-
for (let l = 0; l + 1 <
|
|
326
|
-
i = Math.min(i,
|
|
323
|
+
function an(s, t, e) {
|
|
324
|
+
let i = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), a = Math.min(s.y1, s.y2), r = Math.max(s.y1, s.y2);
|
|
325
|
+
for (let l = 0; l + 1 < s.points.length; l += 2)
|
|
326
|
+
i = Math.min(i, s.points[l]), o = Math.max(o, s.points[l]), a = Math.min(a, s.points[l + 1]), r = Math.max(r, s.points[l + 1]);
|
|
327
327
|
return o >= -8 && i <= t + 8 && r >= -8 && a <= e + 8;
|
|
328
328
|
}
|
|
329
|
-
const
|
|
330
|
-
function
|
|
331
|
-
if (
|
|
332
|
-
const e =
|
|
333
|
-
return i <
|
|
329
|
+
const rn = 64;
|
|
330
|
+
function ln(s, t) {
|
|
331
|
+
if (s.miniature) return null;
|
|
332
|
+
const e = Lt(s.subtask.appearance).hatched ? ct + os + 1 : 0, n = Math.max(s.mainFrom + e, 0), i = Math.min(s.mainTo - e, t) - n;
|
|
333
|
+
return i < rn ? null : { x: n, width: i, y: s.y, height: s.height };
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
function
|
|
337
|
-
const
|
|
338
|
-
return
|
|
335
|
+
const dn = 10;
|
|
336
|
+
function Be(s, t, e) {
|
|
337
|
+
const n = Math.round(t.y + t.height / 2);
|
|
338
|
+
return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(
|
|
340
|
+
function Wt(s, t, e, n, i) {
|
|
341
|
+
const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(s, se(t, e.subtask)), d = x(s, ne(t, n.subtask)), c = Be(a, e, n), h = Be(a, n, e);
|
|
342
342
|
if (o === "straight")
|
|
343
343
|
return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: [l, c, d, h] };
|
|
344
344
|
if (o === "orthogonal") {
|
|
345
|
-
const A = l +
|
|
345
|
+
const A = l + dn, C = c === h ? A : Math.round((A + d) / 2);
|
|
346
346
|
return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: c === h ? [l, c, d, h] : [l, c, C, c, C, h, d, h] };
|
|
347
347
|
}
|
|
348
348
|
const p = Math.max(14, Math.abs(d - l) / 2), g = l + p, f = d - p, y = [];
|
|
@@ -355,35 +355,35 @@ function zt(n, t, e, s, i) {
|
|
|
355
355
|
}
|
|
356
356
|
return { dependency: t, kind: "curve", ends: r, x1: l, y1: c, x2: d, y2: h, c1x: g, c2x: f, points: y };
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
let
|
|
360
|
-
const i =
|
|
358
|
+
function hn(s, t, e) {
|
|
359
|
+
let n = 1 / 0;
|
|
360
|
+
const i = s.points;
|
|
361
361
|
for (let o = 0; o + 3 < i.length; o += 2) {
|
|
362
362
|
const a = i[o], r = i[o + 1], l = i[o + 2], d = i[o + 3], c = l - a, h = d - r, p = c * c + h * h, g = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - a) * c + (e - r) * h) / p));
|
|
363
|
-
|
|
363
|
+
n = Math.min(n, Math.hypot(t - (a + g * c), e - (r + g * h)));
|
|
364
364
|
}
|
|
365
|
-
return
|
|
365
|
+
return n;
|
|
366
366
|
}
|
|
367
367
|
const ls = [], ds = 56;
|
|
368
|
-
function
|
|
369
|
-
return
|
|
368
|
+
function cn(s) {
|
|
369
|
+
return s > 16 ? s / 16 : 1;
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
return
|
|
371
|
+
function un(s, t = ds) {
|
|
372
|
+
return s > 0 ? Math.min(Q, Math.max(15 * J, Os(s * t, 1))) : 15 * J;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
function
|
|
376
|
-
const [i, o] = hs(
|
|
377
|
-
return $s(e, i, o, t, 0,
|
|
378
|
-
(a) => a.workingTime >=
|
|
374
|
+
const fn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
375
|
+
function mn(s, t, e = ls, n) {
|
|
376
|
+
const [i, o] = hs(s, e);
|
|
377
|
+
return $s(e, i, o, t, 0, n ?? fn()).filter(
|
|
378
|
+
(a) => a.workingTime >= s[0] && a.workingTime <= s[1]
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
const [
|
|
383
|
-
let d = l, c =
|
|
381
|
+
function pn(s, t = ls, e) {
|
|
382
|
+
const [n, i] = hs(s, t), o = [], { year: a, month: r, day: l } = ts(n, e);
|
|
383
|
+
let d = l, c = Vt({ year: a, month: r, day: d }, e).getTime();
|
|
384
384
|
for (; c < i && o.length < 400; ) {
|
|
385
385
|
const h = c;
|
|
386
|
-
c =
|
|
386
|
+
c = Vt({ year: a, month: r, day: ++d }, e).getTime(), o.push({
|
|
387
387
|
start: h,
|
|
388
388
|
from: z(h, t),
|
|
389
389
|
to: z(c, t)
|
|
@@ -391,42 +391,42 @@ function mn(n, t = ls, e) {
|
|
|
391
391
|
}
|
|
392
392
|
return o;
|
|
393
393
|
}
|
|
394
|
-
const
|
|
395
|
-
function
|
|
396
|
-
return
|
|
394
|
+
const Gt = [1, 2, 7, 14, 28];
|
|
395
|
+
function gn(s, t) {
|
|
396
|
+
return Gt.find((e) => e * s >= t) ?? Gt[Gt.length - 1];
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return ((Math.round((
|
|
398
|
+
function Ht(s, t, e, n = 1) {
|
|
399
|
+
return ((Math.round((s - ht(s, e)) / Q) - 3 - n) % t + t) % t === 0;
|
|
400
400
|
}
|
|
401
|
-
function V(
|
|
402
|
-
const e =
|
|
403
|
-
return Fs(t,
|
|
401
|
+
function V(s, t) {
|
|
402
|
+
const e = s.time(new Date(t), !1);
|
|
403
|
+
return Fs(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
const i =
|
|
407
|
-
if (!(i > 0)) return [
|
|
408
|
-
const o = Math.min(
|
|
405
|
+
function kn(s, t, e, n) {
|
|
406
|
+
const i = s[1] - s[0];
|
|
407
|
+
if (!(i > 0)) return [s[0], s[1]];
|
|
408
|
+
const o = Math.min(n.max, Math.max(n.min, i * e)), a = (t - s[0]) / i, r = t - a * o;
|
|
409
409
|
return [r, r + o];
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
return [
|
|
411
|
+
function vn(s, t) {
|
|
412
|
+
return [s[0] + t, s[1] + t];
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
const e =
|
|
416
|
-
return e.intervals.length === 0 ?
|
|
414
|
+
function mt(s, t) {
|
|
415
|
+
const e = It(t);
|
|
416
|
+
return e.intervals.length === 0 ? s : Jt(Math.max(0, Math.min(e.total, s)), e);
|
|
417
417
|
}
|
|
418
|
-
function hs(
|
|
419
|
-
return [
|
|
418
|
+
function hs(s, t) {
|
|
419
|
+
return [mt(s[0], t), mt(s[1], t)];
|
|
420
420
|
}
|
|
421
|
-
const
|
|
422
|
-
class
|
|
421
|
+
const Ut = 44;
|
|
422
|
+
class yn {
|
|
423
423
|
constructor(t) {
|
|
424
424
|
this.data = t;
|
|
425
425
|
}
|
|
426
426
|
options = {
|
|
427
|
-
laneHeight:
|
|
427
|
+
laneHeight: Ut,
|
|
428
428
|
calendar: [],
|
|
429
|
-
zoomLimits: { min:
|
|
429
|
+
zoomLimits: { min: Qt, max: 28 * Q },
|
|
430
430
|
snap: "ticks",
|
|
431
431
|
intents: [],
|
|
432
432
|
now: null,
|
|
@@ -443,7 +443,7 @@ class vn {
|
|
|
443
443
|
/* What is laid out from top to bottom (`rows.ts`). It is derived here and
|
|
444
444
|
not in the data, because a row's height comes from a view option; every y
|
|
445
445
|
in the package reads it. */
|
|
446
|
-
rows =
|
|
446
|
+
rows = Oe({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Ut });
|
|
447
447
|
/** The folded groups, as the scene holds them. */
|
|
448
448
|
collapsed = /* @__PURE__ */ new Set();
|
|
449
449
|
/** The groups a gesture in flight holds open. Dropped when it ends; the
|
|
@@ -477,11 +477,11 @@ class vn {
|
|
|
477
477
|
}
|
|
478
478
|
/** Takes new options; a new calendar keeps the wall-clock span in view. */
|
|
479
479
|
setOptions(t) {
|
|
480
|
-
const e = t.calendar !== this.options.calendar,
|
|
480
|
+
const e = t.calendar !== this.options.calendar, n = this.options.calendar;
|
|
481
481
|
if (this.options = t, e) {
|
|
482
|
-
const i =
|
|
482
|
+
const i = It(n), o = (a) => {
|
|
483
483
|
const r = i.intervals.length === 0 ? a : Math.max(0, Math.min(i.total, a));
|
|
484
|
-
return z(
|
|
484
|
+
return z(Jt(r, i), t.calendar) + (a - r);
|
|
485
485
|
};
|
|
486
486
|
this.domain = [o(this.domain[0]), o(this.domain[1])];
|
|
487
487
|
}
|
|
@@ -508,42 +508,42 @@ class vn {
|
|
|
508
508
|
/** The fine band's step at the current zoom. */
|
|
509
509
|
step() {
|
|
510
510
|
const t = this.domain[1] - this.domain[0];
|
|
511
|
-
return
|
|
511
|
+
return un(this.width > 0 ? t / this.width : t, ds * this.fontScale);
|
|
512
512
|
}
|
|
513
513
|
/** Lays the rows out, clamps the scroll, and lays the data out anew. */
|
|
514
514
|
layout() {
|
|
515
|
-
this.moved = !1, this.rows =
|
|
515
|
+
this.moved = !1, this.rows = Oe({
|
|
516
516
|
lanes: this.data.lanes,
|
|
517
517
|
groups: this.data.groups,
|
|
518
|
-
collapsed:
|
|
518
|
+
collapsed: en(this.collapsed, this.openForGesture),
|
|
519
519
|
laneHeight: Math.round(this.options.laneHeight * this.fontScale),
|
|
520
520
|
headHeight: Math.round(is * this.fontScale)
|
|
521
521
|
}), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
|
|
522
522
|
const t = this.viewport();
|
|
523
523
|
this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
|
|
524
524
|
for (const e of this.data.subtasks) {
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const i = as(t, e,
|
|
525
|
+
const n = le(this.rows, e.lane);
|
|
526
|
+
if (n === null) continue;
|
|
527
|
+
const i = as(t, e, n, this.data.depth.get(e.id) ?? 0);
|
|
528
528
|
this.laidBoxes.push(i), this.laidBoxById.set(e.id, i);
|
|
529
529
|
}
|
|
530
530
|
this.laidPaths = [];
|
|
531
531
|
for (const e of this.data.dependencies) {
|
|
532
|
-
const
|
|
533
|
-
|
|
532
|
+
const n = this.boxById.get(e.from), i = this.boxById.get(e.to);
|
|
533
|
+
n === void 0 || i === void 0 || this.laidPaths.push(Wt(t, e, n, i, this.options));
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
/** The days of the coarse band and the ticks of the fine band, in pixels. */
|
|
537
537
|
bands() {
|
|
538
538
|
const t = this.step();
|
|
539
539
|
if (this.width <= 0) return { days: [], ticks: [], step: t };
|
|
540
|
-
const e = this.viewport().scale,
|
|
540
|
+
const e = this.viewport().scale, n = this.options.calendar;
|
|
541
541
|
return {
|
|
542
|
-
days:
|
|
542
|
+
days: pn(this.domain, n, this.options.timeZone).map((i) => {
|
|
543
543
|
const o = Math.round(e.toPx(i.from));
|
|
544
544
|
return { start: i.start, x: o, width: Math.round(e.toPx(i.to)) - o };
|
|
545
545
|
}),
|
|
546
|
-
ticks:
|
|
546
|
+
ticks: mn(this.domain, t, n, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
|
|
547
547
|
step: t
|
|
548
548
|
};
|
|
549
549
|
}
|
|
@@ -555,9 +555,9 @@ class vn {
|
|
|
555
555
|
return e >= 0 && e <= this.width ? e : null;
|
|
556
556
|
}
|
|
557
557
|
hitAt(t, e) {
|
|
558
|
-
const
|
|
558
|
+
const n = this.viewport();
|
|
559
559
|
for (let r = this.data.milestones.length - 1; r >= 0; r--) {
|
|
560
|
-
const l = this.data.milestones[r], d =
|
|
560
|
+
const l = this.data.milestones[r], d = de(n, l);
|
|
561
561
|
if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
|
|
562
562
|
}
|
|
563
563
|
for (let r = this.boxes.length - 1; r >= 0; r--) {
|
|
@@ -566,17 +566,17 @@ class vn {
|
|
|
566
566
|
}
|
|
567
567
|
let i = null, o = 4;
|
|
568
568
|
for (const r of this.paths) {
|
|
569
|
-
const l =
|
|
569
|
+
const l = hn(r, t, e);
|
|
570
570
|
l <= o && (o = l, i = r);
|
|
571
571
|
}
|
|
572
572
|
if (i !== null) return { kind: "dependency", dependency: i.dependency };
|
|
573
|
-
const a =
|
|
573
|
+
const a = Ee(this.viewport(), e);
|
|
574
574
|
return a !== null ? { kind: "lane", lane: a } : { kind: "nothing" };
|
|
575
575
|
}
|
|
576
576
|
/** The wall-clock time at a plot x; within the calendar's extent. */
|
|
577
577
|
timeAt(t) {
|
|
578
578
|
const e = this.viewport().scale.fromPx(t);
|
|
579
|
-
return
|
|
579
|
+
return mt(e, this.options.calendar);
|
|
580
580
|
}
|
|
581
581
|
/** The lane at a y, strips included: what the pointer is ON.
|
|
582
582
|
|
|
@@ -585,7 +585,7 @@ class vn {
|
|
|
585
585
|
`foldedGroupAt` - and a caller that reached through `viewport()` for it
|
|
586
586
|
would be depending on the layout rather than asking the view. */
|
|
587
587
|
laneIdAt(t) {
|
|
588
|
-
return
|
|
588
|
+
return Ee(this.viewport(), t);
|
|
589
589
|
}
|
|
590
590
|
/** The lane a DROP at this y would land on.
|
|
591
591
|
|
|
@@ -606,103 +606,100 @@ class vn {
|
|
|
606
606
|
/** Pans by pixels. Says what moved: the span through time, the lanes, or
|
|
607
607
|
neither - a scroll through the lanes is no news about the time. */
|
|
608
608
|
pan(t, e) {
|
|
609
|
-
const
|
|
610
|
-
this.width > 0 && t !== 0 && (this.domain =
|
|
611
|
-
const a = this.domain[0] !==
|
|
609
|
+
const n = this.domain[0], i = this.scrollY, o = this.domain[1] - n;
|
|
610
|
+
this.width > 0 && t !== 0 && (this.domain = vn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
|
|
611
|
+
const a = this.domain[0] !== n;
|
|
612
612
|
return { moved: a || this.scrollY !== i, time: a };
|
|
613
613
|
}
|
|
614
614
|
/** Zooms around a plot x; says whether the span changed. */
|
|
615
615
|
zoomAt(t, e) {
|
|
616
616
|
if (this.width <= 0 || !Number.isFinite(e)) return !1;
|
|
617
|
-
const
|
|
618
|
-
return this.domain =
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
const
|
|
622
|
-
root:
|
|
623
|
-
corner:
|
|
624
|
-
zoneLabel:
|
|
625
|
-
dayBand:
|
|
626
|
-
headers:
|
|
627
|
-
plot:
|
|
628
|
-
cornerBottom:
|
|
629
|
-
tickBand:
|
|
630
|
-
dataKey:
|
|
631
|
-
dataPanel:
|
|
632
|
-
dataTable:
|
|
633
|
-
day:
|
|
634
|
-
dayLabel:
|
|
635
|
-
tick:
|
|
636
|
-
tickLabel:
|
|
637
|
-
header:
|
|
638
|
-
headerLabel:
|
|
639
|
-
headerCount:
|
|
640
|
-
chevron:
|
|
641
|
-
focusRing:
|
|
642
|
-
layer:
|
|
643
|
-
grip:
|
|
644
|
-
ghostLabel:
|
|
645
|
-
finding:
|
|
646
|
-
refusal:
|
|
647
|
-
tooltip:
|
|
648
|
-
tooltipHead:
|
|
649
|
-
tooltipTimes:
|
|
650
|
-
now:
|
|
651
|
-
barLabel:
|
|
652
|
-
barLabelText:
|
|
617
|
+
const n = this.domain, i = this.viewport().scale.fromPx(t);
|
|
618
|
+
return this.domain = kn(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const wn = "_root_1ep59_4 _text_1j10m_22", bn = "_corner_1ep59_19", Mn = "_zoneLabel_1ep59_24", Tn = "_dayBand_1ep59_43", Sn = "_headers_1ep59_48", In = "_plot_1ep59_53", Ln = "_cornerBottom_1ep59_58", An = "_tickBand_1ep59_63", Cn = "_dataKey_1ep59_69", Dn = "_dataPanel_1ep59_100", _n = "_dataTable_1ep59_119", On = "_day_1ep59_43", $n = "_dayLabel_1ep59_179", Fn = "_tick_1ep59_63", En = "_tickLabel_1ep59_200", Bn = "_header_1ep59_48", xn = "_headerLabel_1ep59_229", Nn = "_headerCount_1ep59_265", Pn = "_chevron_1ep59_274", Rn = "_focusRing_1ep59_372", Gn = "_layer_1ep59_390", Hn = "_grip_1ep59_417", Kn = "_ghostLabel_1ep59_427", Yn = "_finding_1ep59_440", Vn = "_refusal_1ep59_448", zn = "_tooltip_1ep59_452", Wn = "_tooltipHead_1ep59_471", Un = "_tooltipTimes_1ep59_476", Xn = "_now_1ep59_485", qn = "_barLabel_1ep59_499", jn = "_barLabelText_1ep59_512", k = {
|
|
622
|
+
root: wn,
|
|
623
|
+
corner: bn,
|
|
624
|
+
zoneLabel: Mn,
|
|
625
|
+
dayBand: Tn,
|
|
626
|
+
headers: Sn,
|
|
627
|
+
plot: In,
|
|
628
|
+
cornerBottom: Ln,
|
|
629
|
+
tickBand: An,
|
|
630
|
+
dataKey: Cn,
|
|
631
|
+
dataPanel: Dn,
|
|
632
|
+
dataTable: _n,
|
|
633
|
+
day: On,
|
|
634
|
+
dayLabel: $n,
|
|
635
|
+
tick: Fn,
|
|
636
|
+
tickLabel: En,
|
|
637
|
+
header: Bn,
|
|
638
|
+
headerLabel: xn,
|
|
639
|
+
headerCount: Nn,
|
|
640
|
+
chevron: Pn,
|
|
641
|
+
focusRing: Rn,
|
|
642
|
+
layer: Gn,
|
|
643
|
+
grip: Hn,
|
|
644
|
+
ghostLabel: Kn,
|
|
645
|
+
finding: Yn,
|
|
646
|
+
refusal: Vn,
|
|
647
|
+
tooltip: zn,
|
|
648
|
+
tooltipHead: Wn,
|
|
649
|
+
tooltipTimes: Un,
|
|
650
|
+
now: Xn,
|
|
651
|
+
barLabel: qn,
|
|
652
|
+
barLabelText: jn
|
|
653
653
|
};
|
|
654
|
-
function
|
|
655
|
-
const
|
|
656
|
-
return (t) =>
|
|
657
|
-
|
|
658
|
-
|
|
654
|
+
function he() {
|
|
655
|
+
const s = rt();
|
|
656
|
+
return (t) => Gs(t, s);
|
|
657
|
+
}
|
|
658
|
+
function Zn() {
|
|
659
|
+
const s = gt(), t = rt();
|
|
660
|
+
return (e, n) => {
|
|
661
|
+
const [i, o] = [new Date(e), new Date(n)], a = s.date(i);
|
|
662
|
+
return a === s.date(o) ? `${a} ${t.scheduleGhostTimes(V(s, e), V(s, n))}` : t.scheduleGhostTimes(`${a} ${V(s, e)}`, `${s.date(o)} ${V(s, n)}`);
|
|
659
663
|
};
|
|
660
664
|
}
|
|
661
|
-
function
|
|
662
|
-
|
|
663
|
-
return (e, s) => {
|
|
664
|
-
const [i, o] = [new Date(e), new Date(s)], a = n.date(i);
|
|
665
|
-
return a === n.date(o) ? `${a} ${t.scheduleGhostTimes(V(n, e), V(n, s))}` : t.scheduleGhostTimes(`${a} ${V(n, e)}`, `${n.date(o)} ${V(n, s)}`);
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
function cs(n, t, e) {
|
|
669
|
-
return Math.round(e / Z) === 0 ? n.scheduleDependency : `${n.scheduleDependency} ${t(e)}`;
|
|
665
|
+
function cs(s, t, e) {
|
|
666
|
+
return Math.round(e / J) === 0 ? s.scheduleDependency : `${s.scheduleDependency} ${t(e)}`;
|
|
670
667
|
}
|
|
671
|
-
function
|
|
672
|
-
const e =
|
|
673
|
-
if (
|
|
674
|
-
const { subtask: h, task: p } =
|
|
668
|
+
function Jn({ target: s, lane: t }) {
|
|
669
|
+
const e = gt(), n = rt(), i = he(), o = (h) => V(e, h);
|
|
670
|
+
if (s.kind === "subtask") {
|
|
671
|
+
const { subtask: h, task: p } = s, g = [
|
|
675
672
|
p?.name ?? h.task,
|
|
676
673
|
h.name ?? h.id,
|
|
677
|
-
`${e.dateShort(new Date(h.from))} ${
|
|
678
|
-
...
|
|
679
|
-
...
|
|
680
|
-
...
|
|
674
|
+
`${e.dateShort(new Date(h.from))} ${n.scheduleGhostTimes(o(h.from), o(h.to))}`,
|
|
675
|
+
...s.overlapping.map((f) => n.scheduleOverlapWith(f.name ?? f.id)),
|
|
676
|
+
...s.violatedDependencies.map((f) => n.scheduleViolatedBy(i(f.shortBy))),
|
|
677
|
+
...s.blocked.map((f) => n.scheduleInBlockedTime(f.label))
|
|
681
678
|
];
|
|
682
679
|
return /* @__PURE__ */ E(ot, { children: [
|
|
683
680
|
t,
|
|
684
681
|
`, ${g.join(", ")}`
|
|
685
682
|
] });
|
|
686
683
|
}
|
|
687
|
-
if (
|
|
688
|
-
const { milestone: h } =
|
|
684
|
+
if (s.kind === "milestone") {
|
|
685
|
+
const { milestone: h } = s;
|
|
689
686
|
return /* @__PURE__ */ E(ot, { children: [
|
|
690
687
|
t,
|
|
691
|
-
`, ${
|
|
688
|
+
`, ${n.scheduleMilestone(h.label ?? h.id)}, ${e.dateShort(new Date(h.at))} ${o(h.at)}`
|
|
692
689
|
] });
|
|
693
690
|
}
|
|
694
|
-
const { dependency: a, task: r, from: l, to: d, violated: c } =
|
|
691
|
+
const { dependency: a, task: r, from: l, to: d, violated: c } = s;
|
|
695
692
|
return [
|
|
696
693
|
r?.name ?? r?.id ?? a.id,
|
|
697
|
-
cs(
|
|
698
|
-
|
|
699
|
-
...c === void 0 ? [] : [
|
|
694
|
+
cs(n, i, a.lag),
|
|
695
|
+
n.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to),
|
|
696
|
+
...c === void 0 ? [] : [n.scheduleViolatedBy(i(c.shortBy))]
|
|
700
697
|
].join(", ");
|
|
701
698
|
}
|
|
702
|
-
function
|
|
703
|
-
const t =
|
|
704
|
-
if (
|
|
705
|
-
const { subtask: h, task: p } =
|
|
699
|
+
function Qn({ target: s }) {
|
|
700
|
+
const t = gt(), e = rt(), n = (h) => V(t, h), i = he(), o = Zn();
|
|
701
|
+
if (s.kind === "subtask") {
|
|
702
|
+
const { subtask: h, task: p } = s;
|
|
706
703
|
return /* @__PURE__ */ E(ot, { children: [
|
|
707
704
|
/* @__PURE__ */ m("span", { className: k.tooltipHead, children: p?.name ?? h.task }),
|
|
708
705
|
/* @__PURE__ */ m("span", { children: h.name ?? h.id }),
|
|
@@ -710,19 +707,19 @@ function Jn({ target: n }) {
|
|
|
710
707
|
/* @__PURE__ */ m("span", { children: i(h.to - h.from) }),
|
|
711
708
|
(h.leadIn ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadIn} ${i(h.leadIn)}` }),
|
|
712
709
|
(h.leadOut ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadOut} ${i(h.leadOut)}` }),
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
710
|
+
s.overlapping.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleOverlapWith(g.name ?? g.id) }, g.id)),
|
|
711
|
+
s.violatedDependencies.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(g.shortBy)) }, g.dependency)),
|
|
712
|
+
s.blocked.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleInBlockedTime(g.label) }, g.id))
|
|
716
713
|
] });
|
|
717
714
|
}
|
|
718
|
-
if (
|
|
719
|
-
const { milestone: h } =
|
|
715
|
+
if (s.kind === "milestone") {
|
|
716
|
+
const { milestone: h } = s;
|
|
720
717
|
return /* @__PURE__ */ E(ot, { children: [
|
|
721
718
|
/* @__PURE__ */ m("span", { className: k.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
|
|
722
|
-
/* @__PURE__ */ m("span", { className: k.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${
|
|
719
|
+
/* @__PURE__ */ m("span", { className: k.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${n(h.at)}` })
|
|
723
720
|
] });
|
|
724
721
|
}
|
|
725
|
-
const { dependency: a, task: r, from: l, to: d, violated: c } =
|
|
722
|
+
const { dependency: a, task: r, from: l, to: d, violated: c } = s;
|
|
726
723
|
return /* @__PURE__ */ E(ot, { children: [
|
|
727
724
|
/* @__PURE__ */ m("span", { className: k.tooltipHead, children: r?.name ?? r?.id ?? a.id }),
|
|
728
725
|
/* @__PURE__ */ m("span", { children: e.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to) }),
|
|
@@ -730,21 +727,21 @@ function Jn({ target: n }) {
|
|
|
730
727
|
c !== void 0 && /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(c.shortBy)) })
|
|
731
728
|
] });
|
|
732
729
|
}
|
|
733
|
-
const
|
|
734
|
-
function
|
|
730
|
+
const ti = [], xe = { min: Qt, max: 28 * Q }, ei = [], Ne = 20, si = 44, ni = 84, ii = 200;
|
|
731
|
+
function oi(s) {
|
|
735
732
|
const {
|
|
736
733
|
ref: t,
|
|
737
734
|
scene: e,
|
|
738
|
-
"aria-label":
|
|
735
|
+
"aria-label": n,
|
|
739
736
|
"aria-labelledby": i,
|
|
740
737
|
"aria-describedby": o,
|
|
741
738
|
height: a,
|
|
742
|
-
laneHeight: r =
|
|
739
|
+
laneHeight: r = Ut,
|
|
743
740
|
headerWidth: l = 160,
|
|
744
|
-
calendar: d =
|
|
741
|
+
calendar: d = ei,
|
|
745
742
|
zoomLimits: c,
|
|
746
743
|
snap: h = "ticks",
|
|
747
|
-
intents: p =
|
|
744
|
+
intents: p = ti,
|
|
748
745
|
onIntent: g,
|
|
749
746
|
canMoveTo: f,
|
|
750
747
|
onInteraction: y,
|
|
@@ -757,71 +754,71 @@ function ii(n) {
|
|
|
757
754
|
label: $,
|
|
758
755
|
tooltip: O,
|
|
759
756
|
now: R,
|
|
760
|
-
loading:
|
|
761
|
-
className:
|
|
762
|
-
style:
|
|
757
|
+
loading: Z = !1,
|
|
758
|
+
className: vt,
|
|
759
|
+
style: yt,
|
|
763
760
|
children: ys,
|
|
764
761
|
...ws
|
|
765
|
-
} =
|
|
762
|
+
} = s, ue = { "aria-label": n, "aria-labelledby": i }, Ct = Qe(), Dt = `${Ct}-summary`, _t = U(null), fe = U(null), me = U(null), pe = U(null), N = gt(), B = rt(), lt = N.timeZone, wt = Hs(), ge = c?.min ?? xe.min, ke = c?.max ?? xe.max, ve = typeof h == "object" ? h.step : null, ye = typeof h == "object" ? h.offset : null, we = typeof h == "object" ? null : h, [bs, Ms] = ut(() => Date.now());
|
|
766
763
|
Y(() => {
|
|
767
764
|
if (R !== !0) return;
|
|
768
|
-
const u = setInterval(() => Ms(Date.now()),
|
|
765
|
+
const u = setInterval(() => Ms(Date.now()), J);
|
|
769
766
|
return () => clearInterval(u);
|
|
770
767
|
}, [R]);
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
const u =
|
|
774
|
-
e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min:
|
|
775
|
-
}, [e, r, d,
|
|
768
|
+
const be = R === !0 ? bs : typeof R == "number" ? R : null;
|
|
769
|
+
Mt(() => {
|
|
770
|
+
const u = we ?? { step: ve ?? 0, offset: ye ?? 0 };
|
|
771
|
+
e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: ge, max: ke }, snap: u, intents: p, now: be, timeZone: lt, route: b, attach: S, ends: I });
|
|
772
|
+
}, [e, r, d, ge, ke, we, ve, ye, p, be, lt, b, S, I]), Y(() => {
|
|
776
773
|
e.setHandlers({ onIntent: g, canMoveTo: f, onInteraction: y, onSelectedTaskChange: C });
|
|
777
|
-
}, [e, g, f, y, C]), Ps(t, () =>
|
|
774
|
+
}, [e, g, f, y, C]), Ps(t, () => _t.current, []), Y(() => {
|
|
778
775
|
e.data.warnOfMalformedData();
|
|
779
776
|
}), Y(() => {
|
|
780
|
-
e.setLoading(
|
|
781
|
-
}, [e,
|
|
777
|
+
e.setLoading(Z);
|
|
778
|
+
}, [e, Z]), Y(() => {
|
|
782
779
|
e.setControlledTask(A);
|
|
783
780
|
}, [e, A]), Y(() => {
|
|
784
781
|
e.setPlacing(M ?? null);
|
|
785
782
|
}, [e, M]), Y(() => {
|
|
786
|
-
const u =
|
|
783
|
+
const u = _t.current, w = fe.current, L = me.current, F = pe.current;
|
|
787
784
|
if (!u || !w || !L || !F) return;
|
|
788
785
|
e.bind(u, w, L, F);
|
|
789
786
|
const D = w.getBoundingClientRect();
|
|
790
787
|
e.resize(D.width, D.height);
|
|
791
788
|
const _ = new ResizeObserver((W) => {
|
|
792
|
-
const
|
|
793
|
-
|
|
789
|
+
const Pt = W[W.length - 1]?.contentRect;
|
|
790
|
+
Pt !== void 0 && e.resize(Pt.width, Pt.height);
|
|
794
791
|
});
|
|
795
792
|
_.observe(w);
|
|
796
793
|
const P = document.createElement("div");
|
|
797
794
|
P.setAttribute("aria-hidden", "true"), P.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(P);
|
|
798
|
-
const H = () => e.setFontScale(
|
|
795
|
+
const H = () => e.setFontScale(cn(parseFloat(getComputedStyle(P).width)));
|
|
799
796
|
H();
|
|
800
797
|
const K = new ResizeObserver(H);
|
|
801
798
|
K.observe(P);
|
|
802
799
|
const nt = (W) => e.wheel(W);
|
|
803
800
|
u.addEventListener("wheel", nt, { passive: !1 });
|
|
804
|
-
const
|
|
805
|
-
u.addEventListener("touchmove",
|
|
806
|
-
const
|
|
801
|
+
const Ae = (W) => e.touchMove(W);
|
|
802
|
+
u.addEventListener("touchmove", Ae, { passive: !1 });
|
|
803
|
+
const Ce = (W) => {
|
|
807
804
|
W.key === "Escape" && e.cancelEdit() && W.preventDefault();
|
|
808
805
|
};
|
|
809
|
-
return window.addEventListener("keydown",
|
|
810
|
-
window.removeEventListener("keydown",
|
|
806
|
+
return window.addEventListener("keydown", Ce), () => {
|
|
807
|
+
window.removeEventListener("keydown", Ce), u.removeEventListener("wheel", nt), u.removeEventListener("touchmove", Ae), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
|
|
811
808
|
};
|
|
812
809
|
}, [e]);
|
|
813
|
-
const v =
|
|
810
|
+
const v = ee(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: dt } = v, Ot = si * dt, Ts = ni * dt, Ss = ii * dt, Is = (u, w) => {
|
|
814
811
|
const L = new Date(u);
|
|
815
|
-
return w >= Ss ? N.dateLong(L) : w >= Ts ? N.date(L) : w >=
|
|
816
|
-
}, Ls = v.days.reduce((u, w) => Math.max(u, w.width), 0), st =
|
|
812
|
+
return w >= Ss ? N.dateLong(L) : w >= Ts ? N.date(L) : w >= Ot ? N.dateShort(L) : "";
|
|
813
|
+
}, Ls = v.days.reduce((u, w) => Math.max(u, w.width), 0), st = gn(Ls, Ot), Me = v.step >= Q ? st : 1, Te = v.dataTable?.open === !0, T = v.ghost, G = v.spoken, $t = v.summary, bt = (u) => `${N.dateShort(new Date(u))} ${V(N, u)}`, Ft = (u) => `${Ct}-row-${encodeURIComponent(u.key)}`, As = X(() => {
|
|
817
814
|
const u = /* @__PURE__ */ new Map();
|
|
818
815
|
for (const w of v.headers)
|
|
819
816
|
for (const L of w.within)
|
|
820
|
-
w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [],
|
|
817
|
+
w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], Ft(w)]);
|
|
821
818
|
return u;
|
|
822
|
-
}, [v.headers,
|
|
823
|
-
|
|
824
|
-
const u =
|
|
819
|
+
}, [v.headers, Ct]), Se = U(null);
|
|
820
|
+
Mt(() => {
|
|
821
|
+
const u = Se.current;
|
|
825
822
|
if (u === null) return;
|
|
826
823
|
let w = !0;
|
|
827
824
|
const L = () => {
|
|
@@ -844,20 +841,20 @@ function ii(n) {
|
|
|
844
841
|
w = !1, F.disconnect(), D.disconnect();
|
|
845
842
|
};
|
|
846
843
|
}, []);
|
|
847
|
-
const Cs = X(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]),
|
|
848
|
-
|
|
849
|
-
const u =
|
|
844
|
+
const Cs = X(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Ie = U(null), [Et, Ds] = ut({ x: 0, y: 0, at: "" }), Bt = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
|
|
845
|
+
Mt(() => {
|
|
846
|
+
const u = Ie.current;
|
|
850
847
|
if (T === null || u === null) return;
|
|
851
848
|
const w = 4, L = T.y - u.offsetHeight - w, F = T.y + T.height + w, D = {
|
|
852
849
|
x: Math.max(2, Math.min(T.x, v.width - u.offsetWidth - 2)),
|
|
853
850
|
y: L >= 2 ? L : Math.min(F, v.height - u.offsetHeight - 2),
|
|
854
|
-
at:
|
|
851
|
+
at: Bt
|
|
855
852
|
};
|
|
856
853
|
Ds((_) => _.x === D.x && _.y === D.y && _.at === D.at ? _ : D);
|
|
857
|
-
}, [T,
|
|
858
|
-
const
|
|
859
|
-
return
|
|
860
|
-
const u =
|
|
854
|
+
}, [T, Bt, v.width, v.height]);
|
|
855
|
+
const Le = U(null), [xt, _s] = ut({ x: 0, y: 0, at: "" }), q = v.tooltip, Nt = q === null ? "" : `${q.x}:${q.y}:${q.target.kind}`;
|
|
856
|
+
return Mt(() => {
|
|
857
|
+
const u = Le.current;
|
|
861
858
|
if (q === null || u === null) return;
|
|
862
859
|
const w = 12, L = (D, _, P) => {
|
|
863
860
|
const H = D + w, K = D - w - _, nt = H + _ <= P - 4 || K < 4 ? H : K;
|
|
@@ -865,31 +862,31 @@ function ii(n) {
|
|
|
865
862
|
}, F = {
|
|
866
863
|
x: L(q.x, u.offsetWidth, v.width),
|
|
867
864
|
y: L(q.y, u.offsetHeight, v.height),
|
|
868
|
-
at:
|
|
865
|
+
at: Nt
|
|
869
866
|
};
|
|
870
867
|
_s((D) => D.x === F.x && D.y === F.y && D.at === F.at ? D : F);
|
|
871
|
-
}, [q,
|
|
868
|
+
}, [q, Nt, v.width, v.height]), /* @__PURE__ */ m(ae, { value: e, children: /* @__PURE__ */ E(
|
|
872
869
|
"div",
|
|
873
870
|
{
|
|
874
871
|
...ws,
|
|
875
|
-
ref:
|
|
872
|
+
ref: _t,
|
|
876
873
|
role: "figure",
|
|
877
874
|
"data-schedule-clip": "schedule",
|
|
878
|
-
...
|
|
879
|
-
className:
|
|
880
|
-
style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, max(120px, 28%)) minmax(0, 1fr)`, ...
|
|
875
|
+
...ue,
|
|
876
|
+
className: vt ? `${k.root} ${vt}` : k.root,
|
|
877
|
+
style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, max(120px, 28%)) minmax(0, 1fr)`, ...yt },
|
|
881
878
|
children: [
|
|
882
|
-
/* @__PURE__ */ m("div", { className: k.corner, children:
|
|
879
|
+
/* @__PURE__ */ m("div", { className: k.corner, children: wt !== null && /* @__PURE__ */ m("span", { className: k.zoneLabel, "data-schedule-overlay": "zone label", children: wt }) }),
|
|
883
880
|
/* @__PURE__ */ m("div", { className: k.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: v.days.map((u, w) => {
|
|
884
|
-
const L = st === 1 || w === 0 ||
|
|
885
|
-
return /* @__PURE__ */ m("span", { className: k.day, style: { left: `${u.x}px`, width: `${L ? F - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: k.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Is(u.start, st === 1 ? _ : Math.min(_,
|
|
881
|
+
const L = st === 1 || w === 0 || Ht(u.start, st, lt, N.weekStart), F = st === 1 ? u.x + u.width : v.days.slice(w + 1).find((P) => Ht(P.start, st, lt, N.weekStart))?.x ?? v.width, D = Math.max(0, -u.x), _ = Math.min(F, v.width) - Math.max(u.x, 0);
|
|
882
|
+
return /* @__PURE__ */ m("span", { className: k.day, style: { left: `${u.x}px`, width: `${L ? F - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: k.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Is(u.start, st === 1 ? _ : Math.min(_, Ot)) : "" }) }, u.start);
|
|
886
883
|
}) }),
|
|
887
|
-
/* @__PURE__ */ m("div", { ref:
|
|
888
|
-
|
|
884
|
+
/* @__PURE__ */ m("div", { ref: Se, className: k.headers, "data-schedule-headers": "", inert: Te || void 0, children: /* @__PURE__ */ E("div", { className: k.headerRun, style: { transform: `translateY(${-v.scrollY}px)` }, children: [
|
|
885
|
+
Z && v.headers.length === 0 && Array.from({ length: Math.floor(v.height / Math.round(r * dt)) }, (u, w) => /* @__PURE__ */ m("div", { className: k.header, style: { height: `${Math.round(r * dt)}px` }, children: /* @__PURE__ */ m(Ks, { width: "60%" }) }, w)),
|
|
889
886
|
v.headers.map((u) => /* @__PURE__ */ E(
|
|
890
887
|
"div",
|
|
891
888
|
{
|
|
892
|
-
id:
|
|
889
|
+
id: Ft(u),
|
|
893
890
|
className: k.header,
|
|
894
891
|
style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
|
|
895
892
|
"data-lane": u.lane,
|
|
@@ -905,10 +902,10 @@ function ii(n) {
|
|
|
905
902
|
className: k.chevron,
|
|
906
903
|
"data-schedule-overlay": "fold control",
|
|
907
904
|
"aria-expanded": u.collapsed === !1,
|
|
908
|
-
"aria-controls": (As.get(u.group) ?? [
|
|
905
|
+
"aria-controls": (As.get(u.group) ?? [Ft(u)]).join(" "),
|
|
909
906
|
"aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
|
|
910
907
|
onClick: () => e.toggleGroup(u.group),
|
|
911
|
-
children: /* @__PURE__ */ m(
|
|
908
|
+
children: /* @__PURE__ */ m(Ys, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
|
|
912
909
|
}
|
|
913
910
|
),
|
|
914
911
|
/* @__PURE__ */ m("span", { className: k.headerLabel, "data-schedule-overlay": "header label", title: typeof u.label == "string" ? u.label : void 0, children: u.label }),
|
|
@@ -921,24 +918,24 @@ function ii(n) {
|
|
|
921
918
|
/* @__PURE__ */ E(
|
|
922
919
|
"div",
|
|
923
920
|
{
|
|
924
|
-
ref:
|
|
921
|
+
ref: fe,
|
|
925
922
|
className: k.plot,
|
|
926
923
|
"data-schedule-plot": "",
|
|
927
924
|
"data-schedule-clip": "plot",
|
|
928
925
|
style: { cursor: v.cursor },
|
|
929
|
-
"aria-busy":
|
|
930
|
-
inert:
|
|
926
|
+
"aria-busy": Z || void 0,
|
|
927
|
+
inert: Te || void 0,
|
|
931
928
|
"data-stale": v.loading && v.headers.length > 0 || void 0,
|
|
932
929
|
tabIndex: 0,
|
|
933
930
|
role: "application",
|
|
934
931
|
"aria-roledescription": B.scheduleRoleDescription,
|
|
935
|
-
...
|
|
936
|
-
"aria-label":
|
|
937
|
-
"aria-describedby": o ? `${
|
|
932
|
+
...ue,
|
|
933
|
+
"aria-label": n === void 0 ? void 0 : B.schedulePlotName(n),
|
|
934
|
+
"aria-describedby": o ? `${Dt} ${o}` : Dt,
|
|
938
935
|
onKeyDown: (u) => {
|
|
939
936
|
e.key(u.nativeEvent) && u.preventDefault();
|
|
940
937
|
},
|
|
941
|
-
onFocus: (u) => e.focus(
|
|
938
|
+
onFocus: (u) => e.focus(ai(u.currentTarget)),
|
|
942
939
|
onBlur: () => e.blur(),
|
|
943
940
|
onPointerDown: (u) => e.pointerDown(u.nativeEvent),
|
|
944
941
|
onPointerMove: (u) => e.pointerMove(u.nativeEvent),
|
|
@@ -953,8 +950,8 @@ function ii(n) {
|
|
|
953
950
|
(!(w instanceof Node) || !u.currentTarget.contains(w)) && e.dragLeave();
|
|
954
951
|
},
|
|
955
952
|
children: [
|
|
956
|
-
/* @__PURE__ */ m("canvas", { ref: fe, className: k.layer, "aria-hidden": "true" }),
|
|
957
953
|
/* @__PURE__ */ m("canvas", { ref: me, className: k.layer, "aria-hidden": "true" }),
|
|
954
|
+
/* @__PURE__ */ m("canvas", { ref: pe, className: k.layer, "aria-hidden": "true" }),
|
|
958
955
|
v.grips.map((u) => /* @__PURE__ */ m(
|
|
959
956
|
"span",
|
|
960
957
|
{
|
|
@@ -982,23 +979,23 @@ function ii(n) {
|
|
|
982
979
|
O !== !1 && v.tooltip !== null && /* @__PURE__ */ m(
|
|
983
980
|
"span",
|
|
984
981
|
{
|
|
985
|
-
ref:
|
|
982
|
+
ref: Le,
|
|
986
983
|
role: "tooltip",
|
|
987
984
|
className: k.tooltip,
|
|
988
985
|
"data-schedule-tooltip": "",
|
|
989
986
|
"data-schedule-overlay": "tooltip",
|
|
990
987
|
style: {
|
|
991
|
-
left: `${
|
|
992
|
-
top: `${
|
|
993
|
-
visibility:
|
|
988
|
+
left: `${xt.x}px`,
|
|
989
|
+
top: `${xt.y}px`,
|
|
990
|
+
visibility: xt.at === Nt ? void 0 : "hidden"
|
|
994
991
|
},
|
|
995
|
-
children: typeof O == "function" ? O(v.tooltip.target) : /* @__PURE__ */ m(
|
|
992
|
+
children: typeof O == "function" ? O(v.tooltip.target) : /* @__PURE__ */ m(Qn, { target: v.tooltip.target })
|
|
996
993
|
}
|
|
997
994
|
),
|
|
998
995
|
T !== null && /* @__PURE__ */ E(
|
|
999
996
|
"span",
|
|
1000
997
|
{
|
|
1001
|
-
ref:
|
|
998
|
+
ref: Ie,
|
|
1002
999
|
className: k.ghostLabel,
|
|
1003
1000
|
"data-ghost": "",
|
|
1004
1001
|
"data-schedule-overlay": "ghost label",
|
|
@@ -1006,9 +1003,9 @@ function ii(n) {
|
|
|
1006
1003
|
"data-refused": T.refused ? "" : void 0,
|
|
1007
1004
|
"data-blocked": T.blocked ? "" : void 0,
|
|
1008
1005
|
style: {
|
|
1009
|
-
left: `${
|
|
1010
|
-
top: `${
|
|
1011
|
-
visibility:
|
|
1006
|
+
left: `${Et.x}px`,
|
|
1007
|
+
top: `${Et.y}px`,
|
|
1008
|
+
visibility: Et.at === Bt ? void 0 : "hidden"
|
|
1012
1009
|
},
|
|
1013
1010
|
children: [
|
|
1014
1011
|
B.scheduleGhostTimes(V(N, T.from), V(N, T.to)),
|
|
@@ -1026,12 +1023,12 @@ function ii(n) {
|
|
|
1026
1023
|
/* @__PURE__ */ m("div", { className: `${k.corner} ${k.cornerBottom}` }),
|
|
1027
1024
|
/* @__PURE__ */ E("div", { className: k.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
|
|
1028
1025
|
v.now !== null && /* @__PURE__ */ m("span", { className: k.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${v.now}px` } }),
|
|
1029
|
-
v.ticks.map((u) => /* @__PURE__ */ m("span", { className: k.tick, style: { left: `${u.x}px` }, children: u.x >=
|
|
1026
|
+
v.ticks.map((u) => /* @__PURE__ */ m("span", { className: k.tick, style: { left: `${u.x}px` }, children: u.x >= Ne && u.x <= v.width - Ne && (Me === 1 || Ht(u.wallClock, Me, lt, N.weekStart)) && /* @__PURE__ */ m("span", { className: k.tickLabel, "data-schedule-overlay": "time label", children: v.step >= Q ? N.dateShort(new Date(u.wallClock)) : V(N, u.wallClock) }) }, u.wallClock))
|
|
1030
1027
|
] }),
|
|
1031
|
-
/* @__PURE__ */ E(
|
|
1032
|
-
G?.span !== void 0 && /* @__PURE__ */ m("span", { children: B.scheduleVisibleRange(
|
|
1028
|
+
/* @__PURE__ */ E(De, { "aria-live": "polite", children: [
|
|
1029
|
+
G?.span !== void 0 && /* @__PURE__ */ m("span", { children: B.scheduleVisibleRange(bt(G.span[0]), bt(G.span[1])) }, G.count),
|
|
1033
1030
|
G !== null && G.target !== null && /* @__PURE__ */ m(
|
|
1034
|
-
|
|
1031
|
+
Jn,
|
|
1035
1032
|
{
|
|
1036
1033
|
target: G.target,
|
|
1037
1034
|
lane: G.lane === null ? null : e.data.lanes.find((u) => u.id === G.lane)?.label ?? G.lane
|
|
@@ -1039,22 +1036,22 @@ function ii(n) {
|
|
|
1039
1036
|
G.count
|
|
1040
1037
|
)
|
|
1041
1038
|
] }),
|
|
1042
|
-
/* @__PURE__ */ m(
|
|
1039
|
+
/* @__PURE__ */ m(De, { id: Dt, children: v === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...$t, from: bt($t.from), to: bt($t.to) })}${wt === null ? "" : ` ${wt}.`} ${B.scheduleKeyHelp}` }),
|
|
1043
1040
|
ys
|
|
1044
1041
|
]
|
|
1045
1042
|
}
|
|
1046
1043
|
) });
|
|
1047
1044
|
}
|
|
1048
|
-
function
|
|
1045
|
+
function ai(s) {
|
|
1049
1046
|
try {
|
|
1050
|
-
return
|
|
1047
|
+
return s.matches(":focus-visible");
|
|
1051
1048
|
} catch {
|
|
1052
1049
|
return !0;
|
|
1053
1050
|
}
|
|
1054
1051
|
}
|
|
1055
|
-
function
|
|
1056
|
-
const
|
|
1057
|
-
t?.subscribe ??
|
|
1052
|
+
function ri() {
|
|
1053
|
+
const s = Qe(), t = Js(s), e = gt(), n = rt(), i = he(), o = ee(
|
|
1054
|
+
t?.subscribe ?? li,
|
|
1058
1055
|
t?.getSnapshot ?? (() => null),
|
|
1059
1056
|
t?.getServerSnapshot ?? (() => null)
|
|
1060
1057
|
);
|
|
@@ -1067,25 +1064,25 @@ function ai() {
|
|
|
1067
1064
|
return p.has(f.lane) && y.to >= l && y.from <= d;
|
|
1068
1065
|
}).sort((f, y) => p.get(f.lane) - p.get(y.lane) || f.from - y.from);
|
|
1069
1066
|
r = /* @__PURE__ */ E("table", { className: k.dataTable, children: [
|
|
1070
|
-
/* @__PURE__ */ m("caption", { children:
|
|
1067
|
+
/* @__PURE__ */ m("caption", { children: n.scheduleTableCaption(h(l), h(d)) }),
|
|
1071
1068
|
/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1069
|
+
n.scheduleColumnLane,
|
|
1070
|
+
n.scheduleColumnTask,
|
|
1071
|
+
n.scheduleColumnSubtask,
|
|
1072
|
+
n.scheduleColumnFrom,
|
|
1073
|
+
n.scheduleColumnTo,
|
|
1074
|
+
n.scheduleColumnDuration,
|
|
1075
|
+
n.scheduleColumnFindings
|
|
1079
1076
|
].map((f) => /* @__PURE__ */ m("th", { scope: "col", children: f }, f)) }) }),
|
|
1080
1077
|
/* @__PURE__ */ m("tbody", { children: g.map((f) => {
|
|
1081
1078
|
const y = c.tooltipTargetFor({ kind: "subtask", subtask: f, part: "main" }), A = y?.kind !== "subtask" ? [] : [
|
|
1082
|
-
...y.overlapping.map((M) =>
|
|
1083
|
-
...y.violatedDependencies.map((M) =>
|
|
1084
|
-
...y.blocked.map((M) =>
|
|
1079
|
+
...y.overlapping.map((M) => n.scheduleOverlapWith(M.name ?? M.id)),
|
|
1080
|
+
...y.violatedDependencies.map((M) => n.scheduleViolatedBy(i(M.shortBy))),
|
|
1081
|
+
...y.blocked.map((M) => n.scheduleInBlockedTime(M.label))
|
|
1085
1082
|
], C = [
|
|
1086
1083
|
i(f.to - f.from),
|
|
1087
|
-
...(f.leadIn ?? 0) > 0 ? [`${
|
|
1088
|
-
...(f.leadOut ?? 0) > 0 ? [`${
|
|
1084
|
+
...(f.leadIn ?? 0) > 0 ? [`${n.scheduleLeadIn} ${i(f.leadIn)}`] : [],
|
|
1085
|
+
...(f.leadOut ?? 0) > 0 ? [`${n.scheduleLeadOut} ${i(f.leadOut)}`] : []
|
|
1089
1086
|
].join(", ");
|
|
1090
1087
|
return /* @__PURE__ */ E("tr", { children: [
|
|
1091
1088
|
/* @__PURE__ */ m("td", { children: c.lanes.find((M) => M.id === f.lane)?.label }),
|
|
@@ -1107,51 +1104,51 @@ function ai() {
|
|
|
1107
1104
|
className: k.dataKey,
|
|
1108
1105
|
"data-schedule-overlay": "data key",
|
|
1109
1106
|
"aria-expanded": a,
|
|
1110
|
-
"aria-controls": a ?
|
|
1107
|
+
"aria-controls": a ? s : void 0,
|
|
1111
1108
|
onClick: () => t.toggleDataTable(),
|
|
1112
|
-
children: a ?
|
|
1109
|
+
children: a ? n.scheduleHideData : n.scheduleShowData
|
|
1113
1110
|
}
|
|
1114
1111
|
),
|
|
1115
1112
|
a && // A tab stop of its own: the panel scrolls, and a keyboard has to be
|
|
1116
1113
|
// able to scroll it.
|
|
1117
|
-
/* @__PURE__ */ m("div", { id:
|
|
1114
|
+
/* @__PURE__ */ m("div", { id: s, className: k.dataPanel, tabIndex: 0, children: r })
|
|
1118
1115
|
] });
|
|
1119
1116
|
}
|
|
1120
|
-
const
|
|
1117
|
+
const li = () => () => {
|
|
1121
1118
|
};
|
|
1122
|
-
function
|
|
1123
|
-
const e = ns(),
|
|
1124
|
-
return
|
|
1119
|
+
function di({ id: s, label: t }) {
|
|
1120
|
+
const e = ns(), n = X(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
|
|
1121
|
+
return js(n), null;
|
|
1125
1122
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const
|
|
1128
|
-
return
|
|
1123
|
+
function hi({ id: s, label: t, children: e }) {
|
|
1124
|
+
const n = ns(), i = X(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
|
|
1125
|
+
return Zs(i), /* @__PURE__ */ m(ss, { value: s, children: e });
|
|
1129
1126
|
}
|
|
1130
|
-
function
|
|
1131
|
-
const e = X(() => ({ kind: "subtasks", data:
|
|
1132
|
-
return
|
|
1127
|
+
function ci({ data: s, tasks: t }) {
|
|
1128
|
+
const e = X(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
|
|
1129
|
+
return At("Subtasks", e), null;
|
|
1133
1130
|
}
|
|
1134
|
-
function
|
|
1135
|
-
const t = X(() => ({ kind: "dependencies", data:
|
|
1136
|
-
return
|
|
1131
|
+
function ui({ data: s }) {
|
|
1132
|
+
const t = X(() => ({ kind: "dependencies", data: s }), [s]);
|
|
1133
|
+
return At("Dependencies", t), null;
|
|
1137
1134
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const t = X(() => ({ kind: "blocked", data:
|
|
1140
|
-
return
|
|
1135
|
+
function fi({ data: s }) {
|
|
1136
|
+
const t = X(() => ({ kind: "blocked", data: s }), [s]);
|
|
1137
|
+
return At("BlockedTimes", t), null;
|
|
1141
1138
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const t = X(() => ({ kind: "milestones", data:
|
|
1144
|
-
return
|
|
1139
|
+
function mi({ data: s }) {
|
|
1140
|
+
const t = X(() => ({ kind: "milestones", data: s }), [s]);
|
|
1141
|
+
return At("Milestones", t), null;
|
|
1145
1142
|
}
|
|
1146
|
-
function
|
|
1143
|
+
function pi() {
|
|
1147
1144
|
try {
|
|
1148
1145
|
return process.env.NODE_ENV !== "production";
|
|
1149
1146
|
} catch {
|
|
1150
1147
|
return !1;
|
|
1151
1148
|
}
|
|
1152
1149
|
}
|
|
1153
|
-
const
|
|
1154
|
-
class
|
|
1150
|
+
const Xt = pi(), gi = "@umriss-ui/schedule", j = (s, t) => Vs(gi, s, t);
|
|
1151
|
+
class ki {
|
|
1155
1152
|
/** `changed` is called after every registration change. */
|
|
1156
1153
|
constructor(t) {
|
|
1157
1154
|
this.changed = t;
|
|
@@ -1217,21 +1214,21 @@ class gi {
|
|
|
1217
1214
|
rebuild() {
|
|
1218
1215
|
if (!this.dirty) return !1;
|
|
1219
1216
|
this.dirty = !1;
|
|
1220
|
-
const t = (
|
|
1217
|
+
const t = (n) => [...n.keys()].sort((i, o) => i - o).map((i) => n.get(i));
|
|
1221
1218
|
this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries);
|
|
1222
|
-
const e = (
|
|
1223
|
-
if (!(!Array.isArray(
|
|
1224
|
-
|
|
1225
|
-
const o = Array.isArray(
|
|
1226
|
-
return
|
|
1219
|
+
const e = (n) => {
|
|
1220
|
+
if (!(!Array.isArray(n.data) || n.kind === "subtasks" && !Array.isArray(n.tasks))) return n;
|
|
1221
|
+
Xt && j(`array:${n.kind}`, `the ${n.kind} layer's data${n.kind === "subtasks" ? " and tasks" : ""} must be arrays, not ${typeof n.data}; what is not an array is not drawn.`);
|
|
1222
|
+
const o = Array.isArray(n.data) ? n.data : [];
|
|
1223
|
+
return n.kind === "subtasks" ? { ...n, data: o, tasks: Array.isArray(n.tasks) ? n.tasks : [] } : { ...n, data: o };
|
|
1227
1224
|
};
|
|
1228
1225
|
this.layers = t(this.layerEntries).map(e), this.subtasks = [], this.dependencies = [], this.blocked = [], this.milestones = [], this.tasks = /* @__PURE__ */ new Map();
|
|
1229
|
-
for (const
|
|
1230
|
-
if (
|
|
1231
|
-
this.subtasks.push(...
|
|
1232
|
-
for (const i of
|
|
1233
|
-
} else
|
|
1234
|
-
return this.subtaskById = new Map(this.subtasks.map((
|
|
1226
|
+
for (const n of this.layers)
|
|
1227
|
+
if (n.kind === "subtasks") {
|
|
1228
|
+
this.subtasks.push(...n.data);
|
|
1229
|
+
for (const i of n.tasks) this.tasks.set(i.id, i);
|
|
1230
|
+
} else n.kind === "dependencies" ? this.dependencies.push(...n.data) : n.kind === "milestones" ? this.milestones.push(...n.data) : this.blocked.push(...n.data);
|
|
1231
|
+
return this.subtaskById = new Map(this.subtasks.map((n) => [n.id, n])), this.overlaps = ie(this.subtasks), this.violatedById = new Map(oe(this.subtasks, this.dependencies).map((n) => [n.dependency, n])), this.depth = Us(this.subtasks), this.inBlocked = es(this.subtasks, this.blocked), this.unchecked = !0, !0;
|
|
1235
1232
|
}
|
|
1236
1233
|
/** Says in development what the data gets wrong and is drawn, dropped or
|
|
1237
1234
|
counted regardless. The Schedule calls it from an effect of its own,
|
|
@@ -1240,7 +1237,7 @@ class gi {
|
|
|
1240
1237
|
missing. With no lane declared the lanes are still on their way, and an
|
|
1241
1238
|
empty `tasks` is a plan drawn muted on purpose. */
|
|
1242
1239
|
warnOfMalformedData() {
|
|
1243
|
-
if (!this.unchecked || (this.unchecked = !1, !
|
|
1240
|
+
if (!this.unchecked || (this.unchecked = !1, !Xt)) return;
|
|
1244
1241
|
const t = (i, o) => {
|
|
1245
1242
|
const a = /* @__PURE__ */ new Set();
|
|
1246
1243
|
for (const r of o)
|
|
@@ -1261,11 +1258,11 @@ class gi {
|
|
|
1261
1258
|
for (const o of [i.from, i.to])
|
|
1262
1259
|
this.subtaskById.has(o) || j(`end:${i.id}:${o}`, `dependency "${i.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
|
|
1263
1260
|
if (this.lanes.length === 0) return;
|
|
1264
|
-
const e = new Set(this.lanes.map((i) => i.id)),
|
|
1261
|
+
const e = new Set(this.lanes.map((i) => i.id)), n = (i, o) => {
|
|
1265
1262
|
for (const { id: a, lane: r } of o)
|
|
1266
1263
|
e.has(r) || j(`lane:${i}:${a}`, `${i} "${a}" is on the lane "${r}", which no Lane declares; it is left out. Declare <Lane id="${r}" />.`);
|
|
1267
1264
|
};
|
|
1268
|
-
|
|
1265
|
+
n("subtask", this.subtasks), n("milestone", this.milestones), n("blocked time", this.blocked);
|
|
1269
1266
|
}
|
|
1270
1267
|
/** The task a dependency belongs to: its departing subtask's. */
|
|
1271
1268
|
taskOfDependency(t) {
|
|
@@ -1280,71 +1277,71 @@ class gi {
|
|
|
1280
1277
|
}
|
|
1281
1278
|
if (t.kind === "milestone") return { kind: "milestone", milestone: t.milestone };
|
|
1282
1279
|
if (t.kind !== "dependency") return null;
|
|
1283
|
-
const e = t.dependency,
|
|
1280
|
+
const e = t.dependency, n = this.taskOfDependency(e);
|
|
1284
1281
|
return {
|
|
1285
1282
|
kind: "dependency",
|
|
1286
1283
|
dependency: e,
|
|
1287
|
-
task:
|
|
1284
|
+
task: n !== null ? this.tasks.get(n) : void 0,
|
|
1288
1285
|
from: this.subtaskById.get(e.from),
|
|
1289
1286
|
to: this.subtaskById.get(e.to),
|
|
1290
1287
|
violated: this.violatedById.get(e.id)
|
|
1291
1288
|
};
|
|
1292
1289
|
}
|
|
1293
1290
|
}
|
|
1294
|
-
const
|
|
1295
|
-
function us(
|
|
1296
|
-
|
|
1297
|
-
for (let a = t - i; a < t +
|
|
1298
|
-
|
|
1299
|
-
|
|
1291
|
+
const vi = 6;
|
|
1292
|
+
function us(s, t, e, n, i, o) {
|
|
1293
|
+
s.save(), s.beginPath(), s.rect(t, e, n, i), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
|
|
1294
|
+
for (let a = t - i; a < t + n + i; a += vi)
|
|
1295
|
+
s.moveTo(a, e + i), s.lineTo(a + i, e);
|
|
1296
|
+
s.stroke(), s.restore();
|
|
1300
1297
|
}
|
|
1301
|
-
function
|
|
1302
|
-
if (
|
|
1298
|
+
function yi(s, t, e, n) {
|
|
1299
|
+
if (n.size === 0) return;
|
|
1303
1300
|
const { width: i, height: o } = t.view;
|
|
1304
|
-
for (const a of
|
|
1301
|
+
for (const a of n) {
|
|
1305
1302
|
const r = et(e, a);
|
|
1306
1303
|
if (r === null) continue;
|
|
1307
1304
|
const { top: l, height: d } = r;
|
|
1308
|
-
l + d < 0 || l > o || (
|
|
1305
|
+
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1, us(s, 0, l, i, d, t.colours.muted));
|
|
1309
1306
|
}
|
|
1310
1307
|
}
|
|
1311
|
-
function
|
|
1312
|
-
const { data:
|
|
1313
|
-
if (
|
|
1314
|
-
for (const i of
|
|
1315
|
-
const o =
|
|
1308
|
+
function wi(s, t, e) {
|
|
1309
|
+
const { data: n } = t;
|
|
1310
|
+
if (n.violatedById.size !== 0)
|
|
1311
|
+
for (const i of n.violatedById.values()) {
|
|
1312
|
+
const o = n.dependencies.find((h) => h.id === i.dependency), a = o === void 0 ? void 0 : n.subtaskById.get(o.to);
|
|
1316
1313
|
if (a === void 0) continue;
|
|
1317
1314
|
const r = et(e, a.lane);
|
|
1318
1315
|
if (r === null || !r.miniature) continue;
|
|
1319
1316
|
const l = at(e.rows, r.top + e.scrollY);
|
|
1320
1317
|
if (l === null) continue;
|
|
1321
1318
|
const d = x(e, i.arrival), c = Math.max(d + 2, x(e, i.arrival + i.shortBy));
|
|
1322
|
-
|
|
1319
|
+
qt(s, t, d, c, l.top - e.scrollY + 1, 3);
|
|
1323
1320
|
}
|
|
1324
1321
|
}
|
|
1325
|
-
function
|
|
1322
|
+
function qt(s, t, e, n, i, o) {
|
|
1326
1323
|
if (!t.colours.forced) {
|
|
1327
|
-
|
|
1324
|
+
s.fillStyle = t.colours.alarm, s.fillRect(e, i, n - e, o);
|
|
1328
1325
|
return;
|
|
1329
1326
|
}
|
|
1330
|
-
|
|
1327
|
+
s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, i + o / 2), s.lineTo(n, i + o / 2), s.stroke(), s.setLineDash([]);
|
|
1331
1328
|
}
|
|
1332
|
-
function
|
|
1333
|
-
const i = et(e,
|
|
1329
|
+
function bi(s, t, e, n) {
|
|
1330
|
+
const i = et(e, n.lane);
|
|
1334
1331
|
if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
|
|
1335
|
-
const o = Math.max(0, x(e,
|
|
1336
|
-
a <= o || (
|
|
1332
|
+
const o = Math.max(0, x(e, n.from)), a = Math.min(t.view.width, x(e, n.to));
|
|
1333
|
+
a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1, us(s, o, i.top, a - o, i.height, t.colours.muted));
|
|
1337
1334
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const i = et(e,
|
|
1335
|
+
function jt(s, t, e, n) {
|
|
1336
|
+
const i = et(e, n.lane);
|
|
1340
1337
|
if (i === null) return;
|
|
1341
|
-
const o = x(e,
|
|
1342
|
-
if (
|
|
1338
|
+
const o = x(e, n.from), a = Math.max(o + 2, x(e, n.to));
|
|
1339
|
+
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), s.globalAlpha = 1, qt(s, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
|
|
1343
1340
|
const r = at(e.rows, i.top + e.scrollY);
|
|
1344
|
-
r !== null &&
|
|
1341
|
+
r !== null && qt(s, t, o, a, r.top - e.scrollY + 1, 3);
|
|
1345
1342
|
}
|
|
1346
1343
|
}
|
|
1347
|
-
const
|
|
1344
|
+
const Mi = {
|
|
1348
1345
|
line: "var(--u-hairline)",
|
|
1349
1346
|
lineStrong: "var(--u-hairline-strong)",
|
|
1350
1347
|
text: "var(--u-color-text)",
|
|
@@ -1368,11 +1365,11 @@ const bi = {
|
|
|
1368
1365
|
active: "Highlight",
|
|
1369
1366
|
now: "GrayText",
|
|
1370
1367
|
onAccent: "Canvas"
|
|
1371
|
-
},
|
|
1372
|
-
function
|
|
1373
|
-
const e =
|
|
1374
|
-
for (const a of t.tasks.values())
|
|
1375
|
-
const i = Bs(
|
|
1368
|
+
}, Ti = (s) => s ? fs : Mi, Si = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
|
|
1369
|
+
function Ii(s, t) {
|
|
1370
|
+
const e = Si(), n = {};
|
|
1371
|
+
for (const a of t.tasks.values()) n[`task:${a.id}`] = e ? fs.text : a.color;
|
|
1372
|
+
const i = Bs(s, { ...Ti(e), ...n }), o = /* @__PURE__ */ new Map();
|
|
1376
1373
|
for (const a of t.tasks.values()) o.set(a.id, i[`task:${a.id}`] ?? a.color);
|
|
1377
1374
|
return {
|
|
1378
1375
|
line: i.line,
|
|
@@ -1388,277 +1385,277 @@ function Si(n, t) {
|
|
|
1388
1385
|
forced: e
|
|
1389
1386
|
};
|
|
1390
1387
|
}
|
|
1391
|
-
function
|
|
1392
|
-
const t =
|
|
1388
|
+
function pt(s) {
|
|
1389
|
+
const t = s.match(/[\d.]+/g);
|
|
1393
1390
|
return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
|
|
1394
1391
|
}
|
|
1395
|
-
function
|
|
1396
|
-
const t =
|
|
1392
|
+
function Pe(s) {
|
|
1393
|
+
const t = pt(s);
|
|
1397
1394
|
return t === null ? 0 : ps(ms(t));
|
|
1398
1395
|
}
|
|
1399
|
-
function ms(
|
|
1400
|
-
return
|
|
1396
|
+
function ms(s) {
|
|
1397
|
+
return s.map((t) => {
|
|
1401
1398
|
const e = t / 255;
|
|
1402
1399
|
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
1403
1400
|
});
|
|
1404
1401
|
}
|
|
1405
|
-
function ps([
|
|
1406
|
-
return 0.2126 *
|
|
1407
|
-
}
|
|
1408
|
-
function
|
|
1409
|
-
const e =
|
|
1410
|
-
return (Math.max(e,
|
|
1411
|
-
}
|
|
1412
|
-
function
|
|
1413
|
-
if (
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
const a =
|
|
1417
|
-
return a === null ? null : (a.setTransform(
|
|
1418
|
-
}
|
|
1419
|
-
function
|
|
1420
|
-
const { data: e, view:
|
|
1421
|
-
|
|
1422
|
-
for (const o of e.blocked)
|
|
1423
|
-
|
|
1402
|
+
function ps([s, t, e]) {
|
|
1403
|
+
return 0.2126 * s + 0.7152 * t + 0.0722 * e;
|
|
1404
|
+
}
|
|
1405
|
+
function Re(s, t) {
|
|
1406
|
+
const e = Pe(s), n = Pe(t);
|
|
1407
|
+
return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
|
|
1408
|
+
}
|
|
1409
|
+
function Ge(s, t, e) {
|
|
1410
|
+
if (s === null) return null;
|
|
1411
|
+
const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
|
|
1412
|
+
s.width !== i && (s.width = i), s.height !== o && (s.height = o);
|
|
1413
|
+
const a = s.getContext("2d");
|
|
1414
|
+
return a === null ? null : (a.setTransform(n, 0, 0, n, 0, 0), a.clearRect(0, 0, t, e), a);
|
|
1415
|
+
}
|
|
1416
|
+
function Li(s, t) {
|
|
1417
|
+
const { data: e, view: n } = t, i = n.viewport();
|
|
1418
|
+
Di(s, t, i);
|
|
1419
|
+
for (const o of e.blocked) bi(s, t, i, o);
|
|
1420
|
+
_i(s, t);
|
|
1424
1421
|
for (const o of e.layers) {
|
|
1425
1422
|
if (o.kind === "blocked" || o.kind === "milestones") continue;
|
|
1426
1423
|
const a = new Set(o.data);
|
|
1427
1424
|
if (o.kind === "dependencies")
|
|
1428
|
-
for (const r of
|
|
1425
|
+
for (const r of n.paths) a.has(r.dependency) && an(r, n.width, n.height) && Zt(s, t, r, !1);
|
|
1429
1426
|
else
|
|
1430
|
-
for (const r of
|
|
1427
|
+
for (const r of n.boxes) a.has(r.subtask) && ks(s, t, r, 1);
|
|
1431
1428
|
}
|
|
1432
|
-
for (const o of e.overlaps)
|
|
1433
|
-
for (const o of e.inBlocked)
|
|
1434
|
-
|
|
1435
|
-
for (const o of e.milestones) vs(
|
|
1436
|
-
|
|
1429
|
+
for (const o of e.overlaps) jt(s, t, i, o);
|
|
1430
|
+
for (const o of e.inBlocked) jt(s, t, i, o);
|
|
1431
|
+
wi(s, t, i);
|
|
1432
|
+
for (const o of e.milestones) vs(s, t, i, o, !1);
|
|
1433
|
+
Pi(s, t);
|
|
1437
1434
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const { view: e, hover:
|
|
1435
|
+
function Ai(s, t) {
|
|
1436
|
+
const { view: e, hover: n } = t, i = e.viewport();
|
|
1440
1437
|
if (t.ghost === null) {
|
|
1441
|
-
if (
|
|
1442
|
-
const h = e.boxById.get(
|
|
1443
|
-
h !== void 0 &&
|
|
1444
|
-
} else if (
|
|
1445
|
-
const h = e.paths.find((p) => p.dependency ===
|
|
1446
|
-
h !== void 0 &&
|
|
1447
|
-
} else
|
|
1438
|
+
if (n.kind === "subtask") {
|
|
1439
|
+
const h = e.boxById.get(n.subtask.id);
|
|
1440
|
+
h !== void 0 && xi(s, t, h);
|
|
1441
|
+
} else if (n.kind === "dependency") {
|
|
1442
|
+
const h = e.paths.find((p) => p.dependency === n.dependency);
|
|
1443
|
+
h !== void 0 && Zt(s, t, h, !0);
|
|
1444
|
+
} else n.kind === "milestone" && vs(s, t, i, n.milestone, !0);
|
|
1448
1445
|
return;
|
|
1449
1446
|
}
|
|
1450
1447
|
const o = t.ghost, { ghost: a, overlaps: r, violated: l } = o;
|
|
1451
|
-
|
|
1448
|
+
yi(s, t, i, o.refusedLanes);
|
|
1452
1449
|
const d = gs(i, a);
|
|
1453
1450
|
if (d === null) return;
|
|
1454
|
-
for (const h of r)
|
|
1451
|
+
for (const h of r) jt(s, t, i, h);
|
|
1455
1452
|
const c = new Set(l.map((h) => h.dependency));
|
|
1456
1453
|
for (const h of t.data.dependencies) {
|
|
1457
1454
|
if (h.from !== a.id && h.to !== a.id) continue;
|
|
1458
1455
|
const p = e.boxById.get(h.from === a.id ? h.to : h.from);
|
|
1459
1456
|
if (p === void 0) continue;
|
|
1460
|
-
const g = h.from === a.id ?
|
|
1461
|
-
|
|
1457
|
+
const g = h.from === a.id ? Wt(i, h, d, p, e.options) : Wt(i, h, p, d, e.options);
|
|
1458
|
+
Zt(s, t, g, !0, c.has(h.id));
|
|
1462
1459
|
}
|
|
1463
|
-
ks(
|
|
1460
|
+
ks(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && Ci(s, t, d, o.tether);
|
|
1464
1461
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const i = Math.max(e.outerFrom, Math.min(e.outerTo,
|
|
1467
|
-
Math.hypot(
|
|
1462
|
+
function Ci(s, t, e, n) {
|
|
1463
|
+
const i = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), o = Math.max(e.y, Math.min(e.y + e.height, n.y));
|
|
1464
|
+
Math.hypot(n.x - i, n.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(i + 0.5, o + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
|
|
1468
1465
|
}
|
|
1469
|
-
function gs(
|
|
1470
|
-
const e =
|
|
1471
|
-
return e === null ? null : as(
|
|
1466
|
+
function gs(s, t) {
|
|
1467
|
+
const e = le(s.rows, t.lane);
|
|
1468
|
+
return e === null ? null : as(s, t, e, 0);
|
|
1472
1469
|
}
|
|
1473
|
-
function
|
|
1474
|
-
const { view:
|
|
1475
|
-
|
|
1470
|
+
function Di(s, t, e) {
|
|
1471
|
+
const { view: n, colours: i, bands: o } = t, { width: a, height: r } = n;
|
|
1472
|
+
s.lineWidth = 1, s.strokeStyle = i.line, s.beginPath();
|
|
1476
1473
|
for (const c of o.ticks)
|
|
1477
|
-
|
|
1474
|
+
s.moveTo(c.x + 0.5, 0), s.lineTo(c.x + 0.5, r);
|
|
1478
1475
|
for (const c of e.rows.rows) {
|
|
1479
1476
|
const h = c.top + c.height - e.scrollY - 0.5;
|
|
1480
|
-
h < 0 || h > r || (
|
|
1477
|
+
h < 0 || h > r || (s.moveTo(0, h), s.lineTo(a, h));
|
|
1481
1478
|
}
|
|
1482
1479
|
const l = [...e.rows.slots.values()].filter((c) => c.miniature).sort((c, h) => c.top - h.top);
|
|
1483
1480
|
l.forEach((c, h) => {
|
|
1484
1481
|
const p = l[h + 1];
|
|
1485
1482
|
if (p === void 0 || p.top !== c.top + c.height || p.group === c.group) return;
|
|
1486
1483
|
const g = c.top + c.height - e.scrollY - 0.5;
|
|
1487
|
-
g < 0 || g > r || (
|
|
1488
|
-
}),
|
|
1484
|
+
g < 0 || g > r || (s.moveTo(0, g), s.lineTo(a, g));
|
|
1485
|
+
}), s.stroke(), s.strokeStyle = i.lineStrong, s.beginPath();
|
|
1489
1486
|
for (const c of o.days)
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
const d = xs(
|
|
1487
|
+
s.moveTo(c.x + 0.5, 0), s.lineTo(c.x + 0.5, r);
|
|
1488
|
+
s.stroke();
|
|
1489
|
+
const d = xs(n.options.calendar);
|
|
1493
1490
|
if (d.length > 0) {
|
|
1494
|
-
|
|
1491
|
+
s.strokeStyle = i.muted, s.setLineDash([2, 3]), s.beginPath();
|
|
1495
1492
|
for (const c of d) {
|
|
1496
1493
|
const h = Math.round(e.scale.toPx(c.workingTime)) + 0.5;
|
|
1497
|
-
h < 0 || h > a || (
|
|
1494
|
+
h < 0 || h > a || (s.moveTo(h, 0), s.lineTo(h, r));
|
|
1498
1495
|
}
|
|
1499
|
-
|
|
1496
|
+
s.stroke(), s.setLineDash([]);
|
|
1500
1497
|
}
|
|
1501
1498
|
}
|
|
1502
|
-
function
|
|
1499
|
+
function _i(s, t) {
|
|
1503
1500
|
const e = t.view.nowX();
|
|
1504
|
-
e !== null && (
|
|
1501
|
+
e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
|
|
1505
1502
|
}
|
|
1506
|
-
function
|
|
1507
|
-
const i =
|
|
1508
|
-
|
|
1503
|
+
function Oi(s, t, e, n) {
|
|
1504
|
+
const i = kt(t.colours, t, e.subtask.task, e.subtask.id);
|
|
1505
|
+
s.fillStyle = i;
|
|
1509
1506
|
for (const [o, a] of [
|
|
1510
1507
|
[e.outerFrom, e.mainFrom],
|
|
1511
1508
|
[e.mainTo, e.outerTo]
|
|
1512
1509
|
])
|
|
1513
|
-
a <= o || (
|
|
1514
|
-
|
|
1515
|
-
}
|
|
1516
|
-
function
|
|
1517
|
-
if (
|
|
1518
|
-
const
|
|
1519
|
-
return { fill:
|
|
1520
|
-
}
|
|
1521
|
-
function
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
const o = (a) => Math.round(
|
|
1510
|
+
a <= o || (s.globalAlpha = 0.28 * n, s.fillRect(o, e.y, a - o, e.height));
|
|
1511
|
+
s.globalAlpha = n, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
|
|
1512
|
+
}
|
|
1513
|
+
function ce(s, t, e) {
|
|
1514
|
+
if (s.dashed) return { fill: null, onDark: !1 };
|
|
1515
|
+
const n = s.muted ? $i(t, e.surface, 0.5) : t;
|
|
1516
|
+
return { fill: n, onDark: Re(n, e.onAccent) > Re(n, e.text) };
|
|
1517
|
+
}
|
|
1518
|
+
function $i(s, t, e) {
|
|
1519
|
+
const n = pt(s), i = pt(t);
|
|
1520
|
+
if (n === null || i === null) return s;
|
|
1521
|
+
const o = (a) => Math.round(n[a] + (i[a] - n[a]) * e);
|
|
1525
1522
|
return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
|
|
1526
1523
|
}
|
|
1527
|
-
function
|
|
1528
|
-
const e =
|
|
1529
|
-
if (e === null || t === 0) return
|
|
1530
|
-
const
|
|
1524
|
+
function He(s, t) {
|
|
1525
|
+
const e = pt(s);
|
|
1526
|
+
if (e === null || t === 0) return s;
|
|
1527
|
+
const n = ms(e), i = ps(n), [o, a, r] = n.map((l) => {
|
|
1531
1528
|
const d = l + (i - l) * t, c = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
|
|
1532
1529
|
return Math.round(Math.min(1, Math.max(0, c)) * 255);
|
|
1533
1530
|
});
|
|
1534
1531
|
return `rgb(${o}, ${a}, ${r})`;
|
|
1535
1532
|
}
|
|
1536
|
-
function
|
|
1537
|
-
const i = (e === null ? void 0 :
|
|
1538
|
-
return t.selectedTask === null ? i : e !== t.selectedTask ?
|
|
1533
|
+
function kt(s, t, e, n) {
|
|
1534
|
+
const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
|
|
1535
|
+
return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted : He(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : He(i, 0.5);
|
|
1539
1536
|
}
|
|
1540
|
-
const
|
|
1541
|
-
function ks(
|
|
1537
|
+
const Fi = 2;
|
|
1538
|
+
function ks(s, t, e, n) {
|
|
1542
1539
|
const { view: i, colours: o } = t;
|
|
1543
|
-
if (!
|
|
1540
|
+
if (!zt(e, i.width, i.height)) return;
|
|
1544
1541
|
if (e.miniature) {
|
|
1545
|
-
|
|
1542
|
+
Oi(s, t, e, n);
|
|
1546
1543
|
return;
|
|
1547
1544
|
}
|
|
1548
|
-
const a =
|
|
1549
|
-
|
|
1545
|
+
const a = Lt(e.subtask.appearance), r = kt(o, t, e.subtask.task, e.subtask.id), l = ce(a, r, o), d = e.y, c = e.height, h = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? o.onAccent : o.text;
|
|
1546
|
+
s.lineWidth = 1, s.fillStyle = r, s.strokeStyle = r;
|
|
1550
1547
|
for (const [f, y] of [
|
|
1551
1548
|
[e.outerFrom, e.mainFrom],
|
|
1552
1549
|
[e.mainTo, e.outerTo]
|
|
1553
1550
|
])
|
|
1554
|
-
y <= f || (
|
|
1555
|
-
l.fill !== null && (
|
|
1551
|
+
y <= f || (s.globalAlpha = 0.28 * n, s.fillRect(f, d, y - f, c), s.globalAlpha = n, s.strokeRect(f + 0.5, d + 0.5, y - f - 1, c - 1));
|
|
1552
|
+
l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, h, c));
|
|
1556
1553
|
const g = e.subtask.progress;
|
|
1557
1554
|
if (g !== void 0) {
|
|
1558
|
-
const f = Math.min(4, Math.max(2, Math.round(c / 6))), y = d + c - f -
|
|
1559
|
-
|
|
1555
|
+
const f = Math.min(4, Math.max(2, Math.round(c / 6))), y = d + c - f - Fi, A = Math.round(h * Math.max(0, Math.min(1, g)));
|
|
1556
|
+
s.fillStyle = l.fill === null ? r : p, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, y, h, f), s.globalAlpha = n, A > 0 && s.fillRect(e.mainFrom, y, A, f);
|
|
1560
1557
|
}
|
|
1561
1558
|
if (a.hatched) {
|
|
1562
|
-
const f = Math.max(1, Math.min(os, Math.floor((h - 2 *
|
|
1563
|
-
|
|
1559
|
+
const f = Math.max(1, Math.min(os, Math.floor((h - 2 * ct) / 3))), y = h >= 4 * f ? ct : 0, A = c >= 4 * ct ? ct : 0;
|
|
1560
|
+
s.globalAlpha = n, s.fillStyle = p, s.fillRect(e.mainFrom + y, d + A, f, c - 2 * A), s.fillRect(e.mainTo - y - f, d + A, f, c - 2 * A);
|
|
1564
1561
|
}
|
|
1565
|
-
a.open &&
|
|
1562
|
+
a.open && Bi(s, e, d, c, o.surface, i.width), a.dashed && (s.globalAlpha = n, s.strokeStyle = r, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, h - 1, c - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && n === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, c + 1));
|
|
1566
1563
|
}
|
|
1567
|
-
const
|
|
1568
|
-
function
|
|
1569
|
-
const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(
|
|
1570
|
-
a &&
|
|
1564
|
+
const Ei = 16;
|
|
1565
|
+
function Bi(s, t, e, n, i, o) {
|
|
1566
|
+
const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(Ei, l);
|
|
1567
|
+
a && Ke(s, 0, d, e, n, i), r && Ke(s, o, -d, e, n, i);
|
|
1571
1568
|
}
|
|
1572
|
-
function
|
|
1573
|
-
const a =
|
|
1574
|
-
a.addColorStop(0,
|
|
1569
|
+
function Ke(s, t, e, n, i, o) {
|
|
1570
|
+
const a = s.createLinearGradient(t, 0, t + e, 0);
|
|
1571
|
+
a.addColorStop(0, Ye(o, 1)), a.addColorStop(1, Ye(o, 0)), s.globalAlpha = 1, s.fillStyle = a, s.fillRect(Math.min(t, t + e), n, Math.abs(e), i);
|
|
1575
1572
|
}
|
|
1576
|
-
function
|
|
1577
|
-
const e =
|
|
1578
|
-
return e === null ?
|
|
1573
|
+
function Ye(s, t) {
|
|
1574
|
+
const e = pt(s);
|
|
1575
|
+
return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
|
|
1579
1576
|
}
|
|
1580
|
-
function
|
|
1581
|
-
const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, c = l ? a.alarm :
|
|
1582
|
-
if (
|
|
1583
|
-
|
|
1577
|
+
function Zt(s, t, e, n, i) {
|
|
1578
|
+
const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, c = l ? a.alarm : kt(a, t, r, null);
|
|
1579
|
+
if (s.strokeStyle = c, s.fillStyle = c, s.lineWidth = n || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
|
|
1580
|
+
s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
|
|
1584
1581
|
else
|
|
1585
|
-
for (let h = 2; h + 1 < e.points.length; h += 2)
|
|
1586
|
-
if (
|
|
1582
|
+
for (let h = 2; h + 1 < e.points.length; h += 2) s.lineTo(e.points[h], e.points[h + 1]);
|
|
1583
|
+
if (s.stroke(), s.setLineDash([]), e.ends === "dot")
|
|
1587
1584
|
for (const [h, p] of [
|
|
1588
1585
|
[e.x1, e.y1],
|
|
1589
1586
|
[e.x2, e.y2]
|
|
1590
1587
|
])
|
|
1591
|
-
|
|
1588
|
+
s.beginPath(), s.arc(h, p, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
|
|
1592
1589
|
}
|
|
1593
|
-
function vs(
|
|
1594
|
-
const o =
|
|
1590
|
+
function vs(s, t, e, n, i) {
|
|
1591
|
+
const o = de(e, n);
|
|
1595
1592
|
if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
|
|
1596
1593
|
const a = (r) => {
|
|
1597
|
-
|
|
1594
|
+
s.beginPath(), s.moveTo(o.x, o.y - r), s.lineTo(o.x + r, o.y), s.lineTo(o.x, o.y + r), s.lineTo(o.x - r, o.y), s.closePath();
|
|
1598
1595
|
};
|
|
1599
|
-
i && (a(o.half + 3),
|
|
1596
|
+
i && (a(o.half + 3), s.fillStyle = t.colours.active, s.fill()), a(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), a(o.half), s.fillStyle = t.colours.text, s.fill();
|
|
1600
1597
|
}
|
|
1601
|
-
function
|
|
1602
|
-
const { colours:
|
|
1603
|
-
if (
|
|
1604
|
-
|
|
1598
|
+
function xi(s, t, e) {
|
|
1599
|
+
const { colours: n } = t, i = Lt(e.subtask.appearance), o = ce(i, kt(n, t, e.subtask.task, e.subtask.id), n);
|
|
1600
|
+
if (n.forced) {
|
|
1601
|
+
s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
|
|
1605
1602
|
return;
|
|
1606
1603
|
}
|
|
1607
|
-
|
|
1604
|
+
s.globalAlpha = Ni, s.fillStyle = o.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
|
|
1608
1605
|
}
|
|
1609
|
-
const
|
|
1610
|
-
function
|
|
1606
|
+
const Ni = 0.2;
|
|
1607
|
+
function Pi(s, t) {
|
|
1611
1608
|
const e = t.selectedTask;
|
|
1612
1609
|
if (e !== null) {
|
|
1613
|
-
|
|
1614
|
-
for (const
|
|
1615
|
-
if (
|
|
1616
|
-
const i =
|
|
1617
|
-
|
|
1610
|
+
s.strokeStyle = t.colours.text;
|
|
1611
|
+
for (const n of t.view.boxes) {
|
|
1612
|
+
if (n.subtask.task !== e) continue;
|
|
1613
|
+
const i = n.subtask.id === t.selectedSubtask;
|
|
1614
|
+
s.lineWidth = i ? 2 : 1;
|
|
1618
1615
|
const o = i ? 1 : 0.5;
|
|
1619
|
-
|
|
1616
|
+
s.strokeRect(n.outerFrom - o, n.y - o, n.outerTo - n.outerFrom + 2 * o, n.height + 2 * o);
|
|
1620
1617
|
}
|
|
1621
1618
|
}
|
|
1622
1619
|
}
|
|
1623
|
-
const
|
|
1624
|
-
function
|
|
1625
|
-
if (!(t > 2 *
|
|
1626
|
-
const e =
|
|
1620
|
+
const Tt = 32, Ri = 18;
|
|
1621
|
+
function Ve(s, t) {
|
|
1622
|
+
if (!(t > 2 * Tt)) return 0;
|
|
1623
|
+
const e = Tt - s, n = s - (t - Tt), i = Math.max(e, n);
|
|
1627
1624
|
if (i <= 0) return 0;
|
|
1628
|
-
const o = Math.min(1, i /
|
|
1625
|
+
const o = Math.min(1, i / Tt), a = Ri * o * o;
|
|
1629
1626
|
return e > 0 ? -a : a;
|
|
1630
1627
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const
|
|
1628
|
+
function ft(s, t, e) {
|
|
1629
|
+
const n = (i, o) => {
|
|
1633
1630
|
const a = tt(i);
|
|
1634
1631
|
return i.lane === o.lane && a.from < o.to && o.from < a.to;
|
|
1635
1632
|
};
|
|
1636
|
-
return e.some((i) => s
|
|
1633
|
+
return e.some((i) => n(s, i) && !(t !== null && n(t, i)));
|
|
1637
1634
|
}
|
|
1638
|
-
function
|
|
1635
|
+
function Gi(s, t, e, n) {
|
|
1639
1636
|
const i = /* @__PURE__ */ new Set();
|
|
1640
|
-
if (
|
|
1641
|
-
for (const o of
|
|
1642
|
-
o !== e && (
|
|
1637
|
+
if (n === void 0) return i;
|
|
1638
|
+
for (const o of s)
|
|
1639
|
+
o !== e && (n(t, o) || i.add(o));
|
|
1643
1640
|
return i;
|
|
1644
1641
|
}
|
|
1645
|
-
const
|
|
1646
|
-
function
|
|
1647
|
-
switch (
|
|
1642
|
+
const ze = "\0placing", We = /* @__PURE__ */ new Set();
|
|
1643
|
+
function Kt(s) {
|
|
1644
|
+
switch (s.kind) {
|
|
1648
1645
|
case "subtask":
|
|
1649
|
-
return `subtask:${
|
|
1646
|
+
return `subtask:${s.subtask.id}:${s.part}`;
|
|
1650
1647
|
case "dependency":
|
|
1651
|
-
return `dependency:${
|
|
1648
|
+
return `dependency:${s.dependency.id}`;
|
|
1652
1649
|
case "milestone":
|
|
1653
|
-
return `milestone:${
|
|
1650
|
+
return `milestone:${s.milestone.id}`;
|
|
1654
1651
|
case "lane":
|
|
1655
|
-
return `lane:${
|
|
1652
|
+
return `lane:${s.lane}`;
|
|
1656
1653
|
default:
|
|
1657
1654
|
return "nothing";
|
|
1658
1655
|
}
|
|
1659
1656
|
}
|
|
1660
|
-
const
|
|
1661
|
-
class
|
|
1657
|
+
const Ue = 3, Hi = 10, Ki = 600;
|
|
1658
|
+
class Yi {
|
|
1662
1659
|
constructor(t) {
|
|
1663
1660
|
this.host = t;
|
|
1664
1661
|
}
|
|
@@ -1685,7 +1682,7 @@ class Ki {
|
|
|
1685
1682
|
/** The finger's long press, armed by a touch on a bar that may be moved.
|
|
1686
1683
|
`armed` is whether the press may still turn into a grab - and, once it
|
|
1687
1684
|
has, whether the `contextmenu` Android fires for it is the grab's. */
|
|
1688
|
-
press =
|
|
1685
|
+
press = zs((t) => this.grab(t));
|
|
1689
1686
|
armed = !1;
|
|
1690
1687
|
hover = { kind: "nothing" };
|
|
1691
1688
|
/** Where the pointer rests on the plot while nothing is being dragged - or,
|
|
@@ -1726,7 +1723,7 @@ class Ki {
|
|
|
1726
1723
|
if (t.kind !== "edit" && t.kind !== "place") return null;
|
|
1727
1724
|
const e = gs(this.host.view.viewport(), t.ghost);
|
|
1728
1725
|
if (e === null) return null;
|
|
1729
|
-
const
|
|
1726
|
+
const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? tt(t.ghost) : t.ghost;
|
|
1730
1727
|
return {
|
|
1731
1728
|
refused: this.refused,
|
|
1732
1729
|
refusedLanes: [...t.refused],
|
|
@@ -1736,34 +1733,34 @@ class Ki {
|
|
|
1736
1733
|
height: e.height,
|
|
1737
1734
|
from: o.from,
|
|
1738
1735
|
to: o.to,
|
|
1739
|
-
overlap:
|
|
1740
|
-
violated:
|
|
1736
|
+
overlap: n.overlaps.length > 0,
|
|
1737
|
+
violated: n.violated.length > 0
|
|
1741
1738
|
};
|
|
1742
1739
|
}
|
|
1743
1740
|
/* ---------------------------------------------------------------- */
|
|
1744
1741
|
/* Pointer */
|
|
1745
1742
|
/* ---------------------------------------------------------------- */
|
|
1746
1743
|
local(t, e) {
|
|
1747
|
-
const
|
|
1748
|
-
return { x: t - (
|
|
1744
|
+
const n = this.host.plotElement()?.getBoundingClientRect();
|
|
1745
|
+
return { x: t - (n?.left ?? 0), y: e - (n?.top ?? 0) };
|
|
1749
1746
|
}
|
|
1750
|
-
report(t, e,
|
|
1747
|
+
report(t, e, n, i, o, a) {
|
|
1751
1748
|
const r = this.host.view;
|
|
1752
|
-
this.host.handlers().onInteraction?.({ type: t, hit: e, clientX:
|
|
1749
|
+
this.host.handlers().onInteraction?.({ type: t, hit: e, clientX: n, clientY: i, time: r.timeAt(o), lane: r.laneIdAt(a) });
|
|
1753
1750
|
}
|
|
1754
1751
|
/** The plan is on its way: no drag, no hover, no placing begins. One under
|
|
1755
1752
|
way finishes and reports as usual. */
|
|
1756
1753
|
loading = !1;
|
|
1757
1754
|
pointerDown(t) {
|
|
1758
1755
|
if (this.loading) return;
|
|
1759
|
-
const { x: e, y:
|
|
1760
|
-
if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y:
|
|
1756
|
+
const { x: e, y: n } = this.local(t.clientX, t.clientY);
|
|
1757
|
+
if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: n }), this.touches.size >= 2)) {
|
|
1761
1758
|
this.press.dispose(), this.armed = !1, this.gesture.kind !== "pinch" && (this.cancelEdit(), this.gesture = { kind: "pinch", distance: this.touchDistance() });
|
|
1762
1759
|
return;
|
|
1763
1760
|
}
|
|
1764
1761
|
if (t.button !== 0) return;
|
|
1765
1762
|
const i = t.target?.closest?.("[data-grip]")?.getAttribute("data-grip"), o = this.host.selectedSubtask(), a = o !== null ? this.host.data.subtaskById.get(o) ?? null : null;
|
|
1766
|
-
t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0:
|
|
1763
|
+
t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: "pan", subtask: null }, this.armed = this.modeAt(e, n).mode === "move", this.press.pointerDown(t)) : (i === "leadIn" || i === "leadOut") && a !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: i, subtask: a } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, ...this.modeAt(e, n) }, this.host.plotElement()?.setPointerCapture?.(t.pointerId);
|
|
1767
1764
|
}
|
|
1768
1765
|
/** A drag over a folded group: resting on one opens it for the GESTURE.
|
|
1769
1766
|
|
|
@@ -1773,12 +1770,12 @@ class Ki {
|
|
|
1773
1770
|
never written to and no change is reported, because the application did
|
|
1774
1771
|
not fold anything (ADR-0025). */
|
|
1775
1772
|
restOver(t) {
|
|
1776
|
-
const e = this.host.view,
|
|
1777
|
-
|
|
1778
|
-
group:
|
|
1773
|
+
const e = this.host.view, n = e.foldedGroupAt(t);
|
|
1774
|
+
n !== this.resting?.group && (this.stopResting(), n !== null && (this.resting = {
|
|
1775
|
+
group: n,
|
|
1779
1776
|
timer: setTimeout(() => {
|
|
1780
|
-
this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture,
|
|
1781
|
-
},
|
|
1777
|
+
this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
|
|
1778
|
+
}, Ki)
|
|
1782
1779
|
}));
|
|
1783
1780
|
}
|
|
1784
1781
|
stopResting() {
|
|
@@ -1806,18 +1803,18 @@ class Ki {
|
|
|
1806
1803
|
gesture that cannot change a lane at all asks nothing: the intents the
|
|
1807
1804
|
caller handles decide whether the question exists. */
|
|
1808
1805
|
askRefused(t, e) {
|
|
1809
|
-
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return
|
|
1810
|
-
const
|
|
1811
|
-
return
|
|
1806
|
+
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return We;
|
|
1807
|
+
const n = this.host.data.lanes.map((i) => i.id);
|
|
1808
|
+
return Gi(n, t, e, this.host.handlers().canMoveTo);
|
|
1812
1809
|
}
|
|
1813
1810
|
/** What a press at a point would start, given the intents the caller handles. */
|
|
1814
1811
|
modeAt(t, e) {
|
|
1815
|
-
const
|
|
1816
|
-
if (
|
|
1817
|
-
for (let o =
|
|
1818
|
-
const a =
|
|
1812
|
+
const n = this.host.view, i = n.options.intents;
|
|
1813
|
+
if (n.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
|
|
1814
|
+
for (let o = n.boxes.length - 1; o >= 0; o--) {
|
|
1815
|
+
const a = n.boxes[o];
|
|
1819
1816
|
if (i.includes("stretch")) {
|
|
1820
|
-
const r =
|
|
1817
|
+
const r = on(a, t, e);
|
|
1821
1818
|
if (r !== null) return { mode: r === "from" ? "stretch-from" : "stretch-to", subtask: a.subtask };
|
|
1822
1819
|
}
|
|
1823
1820
|
if (rs(a, t, e) !== null)
|
|
@@ -1826,44 +1823,44 @@ class Ki {
|
|
|
1826
1823
|
return { mode: "pan", subtask: null };
|
|
1827
1824
|
}
|
|
1828
1825
|
pointerMove(t) {
|
|
1829
|
-
const { x: e, y:
|
|
1830
|
-
if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y:
|
|
1826
|
+
const { x: e, y: n } = this.local(t.clientX, t.clientY);
|
|
1827
|
+
if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: n }), this.press.pointerMove(t), this.gesture.kind === "pinch")) {
|
|
1831
1828
|
const a = this.touchDistance();
|
|
1832
1829
|
a > 0 && this.gesture.distance > 0 && this.host.view.zoomAt(this.touchCentre(), this.gesture.distance / a) && this.host.viewMoved(!0), this.gesture = { kind: "pinch", distance: a };
|
|
1833
1830
|
return;
|
|
1834
1831
|
}
|
|
1835
1832
|
const i = this.gesture;
|
|
1836
1833
|
if (i.kind === "pending" && i.pointerId === t.pointerId) {
|
|
1837
|
-
if (Math.hypot(e - i.x0,
|
|
1834
|
+
if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ? Hi : Ue)) return;
|
|
1838
1835
|
i.mode === "pan" || i.subtask === null ? (this.gesture = { kind: "pan", pointerId: i.pointerId, lastX: i.x0, lastY: i.y0 }, this.setCursor("grabbing")) : this.startEdit(i, i.mode, i.subtask);
|
|
1839
1836
|
}
|
|
1840
1837
|
const o = this.gesture;
|
|
1841
1838
|
if (o.kind === "pan" && o.pointerId === t.pointerId) {
|
|
1842
|
-
const a = this.host.view.pan(o.lastX - e, o.lastY -
|
|
1843
|
-
a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY:
|
|
1839
|
+
const a = this.host.view.pan(o.lastX - e, o.lastY - n);
|
|
1840
|
+
a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY: n };
|
|
1844
1841
|
return;
|
|
1845
1842
|
}
|
|
1846
1843
|
if (o.kind === "edit" && o.pointerId === t.pointerId) {
|
|
1847
|
-
this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y:
|
|
1844
|
+
this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: n }, this.restOver(n), this.gesture = { ...o, ghost: this.heldGhost(o, e, n) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : o.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
|
|
1848
1845
|
return;
|
|
1849
1846
|
}
|
|
1850
|
-
o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e,
|
|
1847
|
+
o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, n));
|
|
1851
1848
|
}
|
|
1852
1849
|
/** The drag of `subtask` in `mode`, taking hold where the pending press
|
|
1853
1850
|
stands. */
|
|
1854
|
-
startEdit(t, e,
|
|
1851
|
+
startEdit(t, e, n) {
|
|
1855
1852
|
this.gesture = {
|
|
1856
1853
|
kind: "edit",
|
|
1857
1854
|
pointerId: t.pointerId,
|
|
1858
1855
|
mode: e,
|
|
1859
|
-
subtask:
|
|
1856
|
+
subtask: n,
|
|
1860
1857
|
/* The working time the drag took hold at - not a pixel, because
|
|
1861
1858
|
auto-pan moves the scale under a drag in flight. */
|
|
1862
1859
|
t0: this.host.view.viewport().scale.fromPx(t.x0),
|
|
1863
|
-
ghost:
|
|
1860
|
+
ghost: n,
|
|
1864
1861
|
/* Asked here, once, and drawn from the first frame of the drag: the
|
|
1865
1862
|
lanes that are closed are marked before the pointer reaches one. */
|
|
1866
|
-
refused: e === "move" ? this.askRefused(
|
|
1863
|
+
refused: e === "move" ? this.askRefused(n, n.lane) : We
|
|
1867
1864
|
}, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
|
|
1868
1865
|
}
|
|
1869
1866
|
/** The finger has been held on a bar: the bar is grabbed, unless the finger
|
|
@@ -1871,8 +1868,8 @@ class Ki {
|
|
|
1871
1868
|
grab(t) {
|
|
1872
1869
|
const e = this.gesture;
|
|
1873
1870
|
if (!this.armed || this.loading || e.kind !== "pending") return;
|
|
1874
|
-
const { x:
|
|
1875
|
-
o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x:
|
|
1871
|
+
const { x: n, y: i } = this.local(t.x, t.y), { mode: o, subtask: a } = this.modeAt(e.x0, e.y0);
|
|
1872
|
+
o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x: n, y: i }, this.startEdit(e, o, a), this.host.interactionChanged());
|
|
1876
1873
|
}
|
|
1877
1874
|
/** The page's own scroll, while a bar is grabbed. Registered as not passive
|
|
1878
1875
|
by the component: a passive listener cannot cancel it. Before the grab and
|
|
@@ -1886,13 +1883,13 @@ class Ki {
|
|
|
1886
1883
|
this.touches.size === 1 && o !== void 0 ? this.gesture = { kind: "pan", pointerId: o[0], lastX: o[1].x, lastY: o[1].y } : this.touches.size === 0 && (this.gesture = { kind: "none" });
|
|
1887
1884
|
return;
|
|
1888
1885
|
}
|
|
1889
|
-
const e = this.gesture, { x:
|
|
1886
|
+
const e = this.gesture, { x: n, y: i } = this.local(t.clientX, t.clientY);
|
|
1890
1887
|
if (e.kind === "pending" && e.pointerId === t.pointerId)
|
|
1891
|
-
this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY,
|
|
1888
|
+
this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, n, i);
|
|
1892
1889
|
else if (e.kind === "pan" && e.pointerId === t.pointerId)
|
|
1893
|
-
this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY,
|
|
1890
|
+
this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, n, i);
|
|
1894
1891
|
else if (e.kind === "edit" && e.pointerId === t.pointerId) {
|
|
1895
|
-
if (t.pointerType === "touch" && (
|
|
1892
|
+
if (t.pointerType === "touch" && (n < 0 || i < 0 || n > this.host.view.width || i > this.host.view.height)) {
|
|
1896
1893
|
this.cancelEdit();
|
|
1897
1894
|
return;
|
|
1898
1895
|
}
|
|
@@ -1913,9 +1910,9 @@ class Ki {
|
|
|
1913
1910
|
this.panFrame = 0;
|
|
1914
1911
|
const e = this.gesture;
|
|
1915
1912
|
if (e.kind !== "edit" && e.kind !== "place") return;
|
|
1916
|
-
const
|
|
1913
|
+
const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = Ve(i, n.width), r = Ve(o, n.height);
|
|
1917
1914
|
if (a === 0 && r === 0) return;
|
|
1918
|
-
const l =
|
|
1915
|
+
const l = n.pan(a, r);
|
|
1919
1916
|
if (l.moved) {
|
|
1920
1917
|
if (this.dragPoint = { x: i, y: o }, e.kind === "edit")
|
|
1921
1918
|
this.gesture = { ...e, ghost: this.heldGhost(e, i, o) };
|
|
@@ -1940,8 +1937,8 @@ class Ki {
|
|
|
1940
1937
|
times would be a lie. Nothing is reported: no interaction happened. */
|
|
1941
1938
|
refreshHover() {
|
|
1942
1939
|
if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
|
|
1943
|
-
const { x: t, y: e } = this.hoverPoint,
|
|
1944
|
-
this.hover =
|
|
1940
|
+
const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
|
|
1941
|
+
this.hover = n, this.hoverKey = Kt(n);
|
|
1945
1942
|
}
|
|
1946
1943
|
pointerLeave() {
|
|
1947
1944
|
this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
|
|
@@ -1953,19 +1950,19 @@ class Ki {
|
|
|
1953
1950
|
}
|
|
1954
1951
|
contextMenu(t) {
|
|
1955
1952
|
if (this.host.handlers().onInteraction === void 0 || (t.preventDefault(), this.armed || this.editing || this.loading)) return;
|
|
1956
|
-
const { x: e, y:
|
|
1957
|
-
this.report("contextmenu", this.host.view.hitAt(e,
|
|
1953
|
+
const { x: e, y: n } = this.local(t.clientX, t.clientY);
|
|
1954
|
+
this.report("contextmenu", this.host.view.hitAt(e, n), t.clientX, t.clientY, e, n);
|
|
1958
1955
|
}
|
|
1959
1956
|
/** The wheel, as every scrolling area has it:
|
|
1960
1957
|
vertical scrolls the lanes, and lets the page scroll on once they are at
|
|
1961
1958
|
their end; Ctrl or ⌘ zooms - a trackpad pinch arrives as a wheel with
|
|
1962
1959
|
Ctrl -; horizontal or Shift pans through time. */
|
|
1963
1960
|
wheel(t) {
|
|
1964
|
-
const e = this.host.view,
|
|
1961
|
+
const e = this.host.view, n = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), i = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, o = t.deltaX * i, a = t.deltaY * i;
|
|
1965
1962
|
if (t.ctrlKey || t.metaKey) {
|
|
1966
1963
|
t.preventDefault();
|
|
1967
1964
|
const d = Math.abs(a) < 50 ? 0.01 : 15e-4;
|
|
1968
|
-
e.zoomAt(
|
|
1965
|
+
e.zoomAt(n, Math.exp(a * d)) && this.host.viewMoved(!0);
|
|
1969
1966
|
return;
|
|
1970
1967
|
}
|
|
1971
1968
|
if (Math.abs(o) > Math.abs(a) || t.shiftKey) {
|
|
@@ -1980,23 +1977,23 @@ class Ki {
|
|
|
1980
1977
|
const l = e.pan(0, a);
|
|
1981
1978
|
l.moved && this.host.viewMoved(l.time);
|
|
1982
1979
|
}
|
|
1983
|
-
click(t, e,
|
|
1984
|
-
const o = this.host.view.hitAt(
|
|
1985
|
-
this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e,
|
|
1980
|
+
click(t, e, n, i) {
|
|
1981
|
+
const o = this.host.view.hitAt(n, i), a = o.kind === "subtask" ? o.subtask.task : o.kind === "dependency" ? this.host.data.taskOfDependency(o.dependency) : null;
|
|
1982
|
+
this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, n, i);
|
|
1986
1983
|
}
|
|
1987
|
-
hoverAt(t, e,
|
|
1988
|
-
const o = this.host.view.hitAt(
|
|
1989
|
-
if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x:
|
|
1984
|
+
hoverAt(t, e, n, i) {
|
|
1985
|
+
const o = this.host.view.hitAt(n, i), a = Kt(o), { mode: r } = this.modeAt(n, i);
|
|
1986
|
+
if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: i }, a === this.hoverKey) {
|
|
1990
1987
|
(o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
|
|
1991
1988
|
return;
|
|
1992
1989
|
}
|
|
1993
|
-
this.setHover(o, a), this.report("hover", o, t, e,
|
|
1990
|
+
this.setHover(o, a), this.report("hover", o, t, e, n, i);
|
|
1994
1991
|
}
|
|
1995
1992
|
/** The keyboard sets the hover: drawn, and its tooltip shown, as the
|
|
1996
1993
|
pointer's would be - and reported to nobody, since `onInteraction`
|
|
1997
1994
|
speaks of pointer positions. `nothing` hands the hover back. */
|
|
1998
1995
|
setKeyboardHover(t, e) {
|
|
1999
|
-
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey =
|
|
1996
|
+
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Kt(t), this.host.interactionChanged();
|
|
2000
1997
|
}
|
|
2001
1998
|
setHover(t, e) {
|
|
2002
1999
|
e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.hoverChanged());
|
|
@@ -2019,10 +2016,10 @@ class Ki {
|
|
|
2019
2016
|
dragging and handles the place intent, the drop is accepted and a ghost
|
|
2020
2017
|
shows where the work would land. */
|
|
2021
2018
|
dragOver(t, e) {
|
|
2022
|
-
const
|
|
2023
|
-
if (this.loading || e === null || !
|
|
2019
|
+
const n = this.host.view;
|
|
2020
|
+
if (this.loading || e === null || !n.options.intents.includes("place")) return;
|
|
2024
2021
|
const { x: i, y: o } = this.local(t.clientX, t.clientY);
|
|
2025
|
-
if (
|
|
2022
|
+
if (n.laneIdAt(o) === null && n.foldedGroupAt(o) === null) {
|
|
2026
2023
|
this.clearPlacing();
|
|
2027
2024
|
return;
|
|
2028
2025
|
}
|
|
@@ -2042,18 +2039,18 @@ class Ki {
|
|
|
2042
2039
|
lanes, none where the caller refuses that lane and none where it would
|
|
2043
2040
|
cover blocked time - which the answer says apart, because they mean
|
|
2044
2041
|
different things to the drag. */
|
|
2045
|
-
placeGhost(t, e,
|
|
2046
|
-
const o = this.onLane(
|
|
2042
|
+
placeGhost(t, e, n, i) {
|
|
2043
|
+
const o = this.onLane(n);
|
|
2047
2044
|
if (o === null) return { ghost: null, refused: !1, blocked: !1 };
|
|
2048
2045
|
if (i.has(o)) return { ghost: null, refused: !0, blocked: !1 };
|
|
2049
|
-
const a = { ...this.askedFor(t, o, e), id:
|
|
2050
|
-
return
|
|
2046
|
+
const a = { ...this.askedFor(t, o, e), id: ze };
|
|
2047
|
+
return ft(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
|
|
2051
2048
|
}
|
|
2052
2049
|
/** The dragged item as a subtask, under the caller's key for it - not the
|
|
2053
2050
|
internal sentinel: the rule is asked about the thing the application says
|
|
2054
2051
|
it is dragging, and the ghost only afterwards takes the sentinel. */
|
|
2055
|
-
askedFor(t, e,
|
|
2056
|
-
const i = this.snapInside(this.host.view.timeAt(
|
|
2052
|
+
askedFor(t, e, n) {
|
|
2053
|
+
const i = this.snapInside(this.host.view.timeAt(n), this.snapStep());
|
|
2057
2054
|
return {
|
|
2058
2055
|
id: t.item,
|
|
2059
2056
|
task: t.task,
|
|
@@ -2070,17 +2067,17 @@ class Ki {
|
|
|
2070
2067
|
const e = this.gesture;
|
|
2071
2068
|
if (e.kind !== "place") return;
|
|
2072
2069
|
t.preventDefault();
|
|
2073
|
-
const { ghost:
|
|
2074
|
-
if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...
|
|
2070
|
+
const { ghost: n, item: i } = e;
|
|
2071
|
+
if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...n, id: i.item }, n.lane)) return;
|
|
2075
2072
|
const o = {
|
|
2076
2073
|
kind: "place",
|
|
2077
2074
|
item: i.item,
|
|
2078
|
-
task:
|
|
2079
|
-
lane:
|
|
2080
|
-
from:
|
|
2081
|
-
to:
|
|
2082
|
-
...
|
|
2083
|
-
...
|
|
2075
|
+
task: n.task,
|
|
2076
|
+
lane: n.lane,
|
|
2077
|
+
from: n.from,
|
|
2078
|
+
to: n.to,
|
|
2079
|
+
...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
|
|
2080
|
+
...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
|
|
2084
2081
|
};
|
|
2085
2082
|
this.host.handlers().onIntent?.(o);
|
|
2086
2083
|
}
|
|
@@ -2102,29 +2099,29 @@ class Ki {
|
|
|
2102
2099
|
put the work into blocked time it did not already cover, the ghost where
|
|
2103
2100
|
it last stood. It is held, not clamped: a pointer carried on past the
|
|
2104
2101
|
blocked time takes the ghost along again. */
|
|
2105
|
-
heldGhost(t, e,
|
|
2106
|
-
const i = this.ghostFor(t, e,
|
|
2107
|
-
return this.blocked =
|
|
2102
|
+
heldGhost(t, e, n) {
|
|
2103
|
+
const i = this.ghostFor(t, e, n);
|
|
2104
|
+
return this.blocked = ft(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
|
|
2108
2105
|
}
|
|
2109
|
-
ghostFor(t, e,
|
|
2106
|
+
ghostFor(t, e, n) {
|
|
2110
2107
|
const i = this.host.view, o = t.subtask, a = this.snapStep(), r = i.options.intents, l = this.snapInside(i.timeAt(e), a);
|
|
2111
2108
|
switch (t.mode) {
|
|
2112
2109
|
case "move": {
|
|
2113
2110
|
let d = o.from;
|
|
2114
2111
|
const c = i.viewport().scale, h = c.fromPx(e) - t.t0;
|
|
2115
|
-
r.includes("move") && Math.abs(h * c.m) >=
|
|
2112
|
+
r.includes("move") && Math.abs(h * c.m) >= Ue && (d = this.shifted(o.from, h, a));
|
|
2116
2113
|
let p = t.ghost.lane;
|
|
2117
2114
|
if (r.includes("lane")) {
|
|
2118
|
-
const g = this.onLane(
|
|
2115
|
+
const g = this.onLane(n) ?? p;
|
|
2119
2116
|
this.refused = t.refused.has(g), this.refused || (p = g);
|
|
2120
2117
|
} else
|
|
2121
2118
|
this.refused = !1;
|
|
2122
2119
|
return { ...o, from: d, to: d + (o.to - o.from), lane: p };
|
|
2123
2120
|
}
|
|
2124
2121
|
case "stretch-from":
|
|
2125
|
-
return { ...o, from: Math.min(l, o.to - Math.max(a.step,
|
|
2122
|
+
return { ...o, from: Math.min(l, o.to - Math.max(a.step, J)) };
|
|
2126
2123
|
case "stretch-to":
|
|
2127
|
-
return { ...o, to: Math.max(l, o.from + Math.max(a.step,
|
|
2124
|
+
return { ...o, to: Math.max(l, o.from + Math.max(a.step, J)) };
|
|
2128
2125
|
case "leadIn":
|
|
2129
2126
|
return { ...o, leadIn: Math.max(0, o.from - l) };
|
|
2130
2127
|
case "leadOut":
|
|
@@ -2134,16 +2131,16 @@ class Ki {
|
|
|
2134
2131
|
/** A time moved by an amount of WORKING time and snapped: a drag moves
|
|
2135
2132
|
a start this way, and a key by one step of the raster - one arithmetic,
|
|
2136
2133
|
so a key proposes exactly what a drag of that length would. */
|
|
2137
|
-
shifted(t, e,
|
|
2138
|
-
const i =
|
|
2139
|
-
return this.snapInside(a,
|
|
2134
|
+
shifted(t, e, n) {
|
|
2135
|
+
const i = It(this.host.view.options.calendar), o = z(t, i) + e, a = mt(o, i);
|
|
2136
|
+
return this.snapInside(a, n);
|
|
2140
2137
|
}
|
|
2141
2138
|
/** Snapped - and, where the raster lands in time the calendar removes, moved
|
|
2142
2139
|
on to the seam, where time counts again. An intent never asks for a time
|
|
2143
2140
|
nobody works. */
|
|
2144
2141
|
snapInside(t, e) {
|
|
2145
|
-
const
|
|
2146
|
-
return i.intervals.length === 0 ?
|
|
2142
|
+
const n = Xs(t, e, this.host.view.options.timeZone), i = It(this.host.view.options.calendar);
|
|
2143
|
+
return i.intervals.length === 0 ? n : Jt(z(n, i), i);
|
|
2147
2144
|
}
|
|
2148
2145
|
/** The id to report: a host may have reminted its ids since the drag began,
|
|
2149
2146
|
so where the old id is gone the subtask is found again by what it is -
|
|
@@ -2152,9 +2149,9 @@ class Ki {
|
|
|
2152
2149
|
const e = this.host.data;
|
|
2153
2150
|
return e.subtaskById.has(t.id) ? t.id : e.subtasks.find((i) => i.task === t.task && i.lane === t.lane && i.from === t.from && i.to === t.to)?.id ?? t.id;
|
|
2154
2151
|
}
|
|
2155
|
-
intentsOf(t, e,
|
|
2152
|
+
intentsOf(t, e, n) {
|
|
2156
2153
|
const i = [], o = this.host.view.options.intents, a = this.currentId(t);
|
|
2157
|
-
return
|
|
2154
|
+
return n === "move" ? (e.from !== t.from && o.includes("move") && i.push({ kind: "move", subtask: a, from: e.from, to: e.to }), e.lane !== t.lane && o.includes("lane") && i.push({ kind: "lane", subtask: a, lane: e.lane })) : n === "stretch-from" || n === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && i.push({ kind: "stretch", subtask: a, from: e.from, to: e.to }) : n === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && i.push({ kind: "leadIn", subtask: a, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && i.push({ kind: "leadOut", subtask: a, leadOut: e.leadOut ?? 0 }), i;
|
|
2158
2155
|
}
|
|
2159
2156
|
/** The lane the ghost came from - the only other lane a drag can touch. */
|
|
2160
2157
|
ghostHome(t) {
|
|
@@ -2170,33 +2167,35 @@ class Ki {
|
|
|
2170
2167
|
keeps a plan of hundreds of tasks fluid while a drag runs, since this is
|
|
2171
2168
|
computed on every pointer movement. */
|
|
2172
2169
|
ghostFindings(t, e) {
|
|
2173
|
-
const
|
|
2174
|
-
return { overlaps:
|
|
2170
|
+
const n = this.host.data, i = (c) => c.lane === t.lane || c.lane === e, a = [...n.subtasks.filter((c) => c.id !== t.id && i(c)), t], r = (c) => c.first === t.id || c.second === t.id, l = n.dependencies.filter((c) => c.from === t.id || c.to === t.id), d = t.id === ze ? n.subtasks : n.subtasks.map((c) => c.id === t.id ? t : c);
|
|
2171
|
+
return { overlaps: ie(a).filter(r), violated: oe(d, l) };
|
|
2175
2172
|
}
|
|
2176
2173
|
}
|
|
2177
|
-
function
|
|
2174
|
+
function Vi(s, t) {
|
|
2178
2175
|
const e = /* @__PURE__ */ new Map();
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
const
|
|
2183
|
-
|
|
2176
|
+
s.rows.forEach((i, o) => e.set(i, o));
|
|
2177
|
+
const n = /* @__PURE__ */ new Map();
|
|
2178
|
+
for (const i of t) {
|
|
2179
|
+
const o = s.slots.get(i.lane), a = o === void 0 ? null : at(s, o.top);
|
|
2180
|
+
if (a === null) continue;
|
|
2181
|
+
const r = e.get(a), l = n.get(r);
|
|
2182
|
+
l === void 0 ? n.set(r, [i]) : l.push(i);
|
|
2184
2183
|
}
|
|
2185
|
-
return [...
|
|
2184
|
+
return [...n.entries()].sort(([i], [o]) => i - o).map(([, i]) => i.sort((o, a) => o.from - a.from || o.to - a.to));
|
|
2186
2185
|
}
|
|
2187
|
-
const
|
|
2188
|
-
function
|
|
2186
|
+
const Xe = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
|
|
2187
|
+
function zi(s, t, e, n) {
|
|
2189
2188
|
let i = -1, o = -1;
|
|
2190
|
-
for (let d = 0; d <
|
|
2191
|
-
o =
|
|
2189
|
+
for (let d = 0; d < s.length && t !== null && i < 0; d++)
|
|
2190
|
+
o = s[d].findIndex((c) => c.id === t), o >= 0 && (i = d);
|
|
2192
2191
|
if (i < 0) {
|
|
2193
|
-
for (const d of
|
|
2194
|
-
const c = d.find((h) => h.to >
|
|
2192
|
+
for (const d of s) {
|
|
2193
|
+
const c = d.find((h) => h.to > n[0] && h.from < n[1]);
|
|
2195
2194
|
if (c !== void 0) return c;
|
|
2196
2195
|
}
|
|
2197
|
-
return
|
|
2196
|
+
return s[0]?.[0] ?? null;
|
|
2198
2197
|
}
|
|
2199
|
-
const a =
|
|
2198
|
+
const a = s[i], r = a[o], l = (n[1] - n[0]) / 10;
|
|
2200
2199
|
switch (e) {
|
|
2201
2200
|
case "next":
|
|
2202
2201
|
return a[o + 1] ?? r;
|
|
@@ -2213,25 +2212,25 @@ function Vi(n, t, e, s) {
|
|
|
2213
2212
|
return a[0];
|
|
2214
2213
|
case "up":
|
|
2215
2214
|
case "down": {
|
|
2216
|
-
const d =
|
|
2215
|
+
const d = s[e === "up" ? i - 1 : i + 1];
|
|
2217
2216
|
if (d === void 0) return r;
|
|
2218
2217
|
const c = (r.from + r.to) / 2;
|
|
2219
|
-
return d.reduce((h, p) =>
|
|
2218
|
+
return d.reduce((h, p) => Xe(p, c) < Xe(h, c) ? p : h);
|
|
2220
2219
|
}
|
|
2221
2220
|
}
|
|
2222
2221
|
}
|
|
2223
|
-
function
|
|
2222
|
+
function Wi(s, t, e, n) {
|
|
2224
2223
|
if (e.kind === "milestone") return e;
|
|
2225
2224
|
if (e.kind === "dependency") {
|
|
2226
|
-
const o =
|
|
2225
|
+
const o = s.find((r) => r.id === e.id), a = o === void 0 ? void 0 : n === "out" ? o.to : o.from;
|
|
2227
2226
|
return a !== void 0 && t.has(a) ? { kind: "subtask", id: a } : e;
|
|
2228
2227
|
}
|
|
2229
|
-
const i =
|
|
2230
|
-
(o) => (
|
|
2228
|
+
const i = s.find(
|
|
2229
|
+
(o) => (n === "out" ? o.from : o.to) === e.id && t.has(n === "out" ? o.to : o.from)
|
|
2231
2230
|
);
|
|
2232
2231
|
return i === void 0 ? e : { kind: "dependency", id: i.id };
|
|
2233
2232
|
}
|
|
2234
|
-
const
|
|
2233
|
+
const St = "\0milestone:", qe = 150, je = 1.25, Ui = {
|
|
2235
2234
|
ArrowRight: "next",
|
|
2236
2235
|
ArrowLeft: "previous",
|
|
2237
2236
|
ArrowUp: "up",
|
|
@@ -2241,7 +2240,7 @@ const Tt = "\0milestone:", Xe = 150, qe = 1.25, Wi = {
|
|
|
2241
2240
|
PageDown: "pageNext",
|
|
2242
2241
|
PageUp: "pagePrevious"
|
|
2243
2242
|
};
|
|
2244
|
-
class
|
|
2243
|
+
class Xi {
|
|
2245
2244
|
constructor(t) {
|
|
2246
2245
|
this.host = t;
|
|
2247
2246
|
}
|
|
@@ -2266,12 +2265,12 @@ class Ui {
|
|
|
2266
2265
|
key(t) {
|
|
2267
2266
|
const e = this.host.gestures;
|
|
2268
2267
|
if (t.metaKey || !e.idle) return !1;
|
|
2269
|
-
const
|
|
2270
|
-
if (t.key === "]" || t.key === "[" ||
|
|
2268
|
+
const n = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
|
|
2269
|
+
if (t.key === "]" || t.key === "[" || n) {
|
|
2271
2270
|
const o = this.active();
|
|
2272
2271
|
if (o === null) return !1;
|
|
2273
|
-
const a = this.host.data, r =
|
|
2274
|
-
return this.show(
|
|
2272
|
+
const a = this.host.data, r = n ? !t.shiftKey : t.key === "]";
|
|
2273
|
+
return this.show(Wi(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
|
|
2275
2274
|
}
|
|
2276
2275
|
if (t.ctrlKey) return !1;
|
|
2277
2276
|
if (!t.altKey && this.zoom(t)) return !0;
|
|
@@ -2279,33 +2278,33 @@ class Ui {
|
|
|
2279
2278
|
if (t.key === "Escape")
|
|
2280
2279
|
return e.byKeyboard ? (this.blur(), !0) : !1;
|
|
2281
2280
|
if (t.key === "Enter" || t.key === " ") return this.select();
|
|
2282
|
-
const i = t.shiftKey ? void 0 :
|
|
2281
|
+
const i = t.shiftKey ? void 0 : Ui[t.key];
|
|
2283
2282
|
return i === void 0 ? !1 : (this.walk(i), !0);
|
|
2284
2283
|
}
|
|
2285
2284
|
/** + and = zoom in, - and _ zoom out, 0 fits the work: by the character, so
|
|
2286
2285
|
that every layout reaches them (Shift is how a US keyboard types +). The
|
|
2287
2286
|
anchor is the middle of the active subtask's main time, else of the plot. */
|
|
2288
2287
|
zoom(t) {
|
|
2289
|
-
const e = t.key === "+" || t.key === "=" ? 1 /
|
|
2288
|
+
const e = t.key === "+" || t.key === "=" ? 1 / je : t.key === "-" || t.key === "_" ? je : 1;
|
|
2290
2289
|
if (e === 1 && t.key !== "0") return !1;
|
|
2291
2290
|
if (e !== 1) {
|
|
2292
|
-
const
|
|
2291
|
+
const n = this.active(), i = n?.kind === "subtask" ? this.host.view.boxById.get(n.id) : void 0, o = this.host.view.width;
|
|
2293
2292
|
this.host.zoomBy(i === void 0 ? o / 2 : Math.max(0, Math.min(o, (i.mainFrom + i.mainTo) / 2)), e);
|
|
2294
2293
|
} else this.host.fitWork();
|
|
2295
2294
|
return this.scheduleSpan(), !0;
|
|
2296
2295
|
}
|
|
2297
2296
|
walk(t) {
|
|
2298
|
-
const { data: e, view:
|
|
2299
|
-
let r =
|
|
2297
|
+
const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? St + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: St + d.id, lane: d.lane, from: d.at, to: d.at }))];
|
|
2298
|
+
let r = Vi(n.rows, a);
|
|
2300
2299
|
if (o === null) {
|
|
2301
2300
|
const d = r.filter((c) => {
|
|
2302
|
-
const h = et(
|
|
2303
|
-
return h !== null && h.top + h.height > 0 && h.top <
|
|
2301
|
+
const h = et(n.viewport(), c[0].lane);
|
|
2302
|
+
return h !== null && h.top + h.height > 0 && h.top < n.height;
|
|
2304
2303
|
});
|
|
2305
2304
|
d.length > 0 && (r = d);
|
|
2306
2305
|
}
|
|
2307
|
-
const l =
|
|
2308
|
-
l !== null && this.show(l.id.startsWith(
|
|
2306
|
+
const l = zi(r, o, t, this.host.visibleDomain());
|
|
2307
|
+
l !== null && this.show(l.id.startsWith(St) ? { kind: "milestone", id: l.id.slice(St.length) } : { kind: "subtask", id: l.id });
|
|
2309
2308
|
}
|
|
2310
2309
|
/** Space and Enter select as a click does: the whole task, and the subtask. */
|
|
2311
2310
|
select() {
|
|
@@ -2320,8 +2319,8 @@ class Ui {
|
|
|
2320
2319
|
reports (ADR-0023), and only where the caller handles them. Nothing is
|
|
2321
2320
|
applied here. */
|
|
2322
2321
|
edit(t) {
|
|
2323
|
-
const e = this.host.gestures.hover,
|
|
2324
|
-
if (
|
|
2322
|
+
const e = this.host.gestures.hover, n = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0, i = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
|
|
2323
|
+
if (n === 0 && i === 0) return !1;
|
|
2325
2324
|
if (this.host.gestures.loading || e.kind !== "subtask") return !0;
|
|
2326
2325
|
const o = e.subtask, a = this.host.gestures, r = this.host.view.options.intents;
|
|
2327
2326
|
if (i !== 0) {
|
|
@@ -2334,31 +2333,31 @@ class Ui {
|
|
|
2334
2333
|
const p = (f) => ({ ...o, from: f, to: f + (o.to - o.from) });
|
|
2335
2334
|
let g = o.from;
|
|
2336
2335
|
for (let f = 0; f < 1e3; f++) {
|
|
2337
|
-
const y = a.shifted(g,
|
|
2338
|
-
if (y === g || (g = y, !
|
|
2336
|
+
const y = a.shifted(g, n * d.step, d);
|
|
2337
|
+
if (y === g || (g = y, !ft(p(g), o, c))) break;
|
|
2339
2338
|
}
|
|
2340
|
-
g !== o.from && !
|
|
2339
|
+
g !== o.from && !ft(p(g), o, c) && (h = { kind: "move", subtask: o.id, from: g, to: p(g).to });
|
|
2341
2340
|
} else if (t.shiftKey && r.includes("stretch")) {
|
|
2342
|
-
const p = Math.max(a.shifted(o.to,
|
|
2343
|
-
p !== o.to && !
|
|
2341
|
+
const p = Math.max(a.shifted(o.to, n * d.step, d), o.from + Math.max(d.step, J));
|
|
2342
|
+
p !== o.to && !ft({ ...o, to: p }, o, c) && (h = { kind: "stretch", subtask: o.id, from: o.from, to: p });
|
|
2344
2343
|
}
|
|
2345
2344
|
return a.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
|
|
2346
2345
|
}
|
|
2347
2346
|
/** The lane drawn one row above (-1) or below (1) a lane - group heads and
|
|
2348
2347
|
folded groups are passed over; null at the first or last lane. */
|
|
2349
2348
|
laneBeside(t, e) {
|
|
2350
|
-
const
|
|
2351
|
-
return i < 0 ? null :
|
|
2349
|
+
const n = this.host.view.rows.rows.flatMap((o) => o.kind === "lane" && o.lane !== void 0 ? [o.lane] : []), i = n.indexOf(t);
|
|
2350
|
+
return i < 0 ? null : n[i + e] ?? null;
|
|
2352
2351
|
}
|
|
2353
2352
|
/** The keys stand on this target: brought into view, drawn as the hover. */
|
|
2354
2353
|
show(t, e = !0) {
|
|
2355
|
-
const
|
|
2356
|
-
if (
|
|
2354
|
+
const n = this.hitOf(t);
|
|
2355
|
+
if (n === null) return;
|
|
2357
2356
|
e && this.reveal(t);
|
|
2358
2357
|
const i = this.bounds(t);
|
|
2359
2358
|
if (i === null) return;
|
|
2360
2359
|
const { view: o } = this.host, a = (r, l) => Math.max(0, Math.min(l, r));
|
|
2361
|
-
this.host.gestures.setKeyboardHover(
|
|
2360
|
+
this.host.gestures.setKeyboardHover(n, {
|
|
2362
2361
|
x: (a(i.x0, o.width) + a(i.x1, o.width)) / 2,
|
|
2363
2362
|
y: (a(i.y0, o.height) + a(i.y1, o.height)) / 2
|
|
2364
2363
|
}), e && this.scheduleReadout();
|
|
@@ -2373,22 +2372,22 @@ class Ui {
|
|
|
2373
2372
|
const i = e.milestones.find((o) => o.id === t.id);
|
|
2374
2373
|
return i === void 0 ? null : { kind: "milestone", milestone: i };
|
|
2375
2374
|
}
|
|
2376
|
-
const
|
|
2377
|
-
return
|
|
2375
|
+
const n = e.dependencies.find((i) => i.id === t.id);
|
|
2376
|
+
return n === void 0 ? null : { kind: "dependency", dependency: n };
|
|
2378
2377
|
}
|
|
2379
2378
|
/** Where a target lies on the plot: a subtask's bar, or the span between
|
|
2380
2379
|
the two bars a dependency joins. */
|
|
2381
2380
|
bounds(t) {
|
|
2382
|
-
const e = this.host.view,
|
|
2381
|
+
const e = this.host.view, n = (r) => e.boxById.get(r);
|
|
2383
2382
|
if (t.kind === "subtask") {
|
|
2384
|
-
const r =
|
|
2383
|
+
const r = n(t.id);
|
|
2385
2384
|
return r === void 0 ? null : { x0: r.outerFrom, x1: r.outerTo, y0: r.y, y1: r.y + r.height };
|
|
2386
2385
|
}
|
|
2387
2386
|
if (t.kind === "milestone") {
|
|
2388
|
-
const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null :
|
|
2387
|
+
const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null : de(e.viewport(), r);
|
|
2389
2388
|
return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
|
|
2390
2389
|
}
|
|
2391
|
-
const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 :
|
|
2390
|
+
const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 : n(i.from), a = i === void 0 ? void 0 : n(i.to);
|
|
2392
2391
|
return o === void 0 || a === void 0 ? null : {
|
|
2393
2392
|
x0: Math.min(o.mainTo, a.mainFrom),
|
|
2394
2393
|
x1: Math.max(o.mainTo, a.mainFrom),
|
|
@@ -2400,11 +2399,11 @@ class Ui {
|
|
|
2400
2399
|
at the side it came in from; a target wider than the view shows its
|
|
2401
2400
|
start. As a drag at the edge pans along, the keys do. */
|
|
2402
2401
|
reveal(t) {
|
|
2403
|
-
const e = this.bounds(t),
|
|
2404
|
-
if (e === null ||
|
|
2405
|
-
const i = Math.min(24,
|
|
2402
|
+
const e = this.bounds(t), n = this.host.view;
|
|
2403
|
+
if (e === null || n.width <= 0) return;
|
|
2404
|
+
const i = Math.min(24, n.width / 10), o = e.x0 < 0 ? e.x0 - i : e.x1 > n.width ? Math.max(0, Math.min(e.x1 - n.width + i, e.x0 - i)) : 0, a = e.y0 < 0 ? e.y0 : e.y1 > n.height ? Math.min(e.y1 - n.height, e.y0) : 0;
|
|
2406
2405
|
if (o === 0 && a === 0) return;
|
|
2407
|
-
const r =
|
|
2406
|
+
const r = n.pan(o, a);
|
|
2408
2407
|
r.moved && this.host.viewMoved(r.time);
|
|
2409
2408
|
}
|
|
2410
2409
|
/** After the data or the view changed: the keys' target is read anew by its
|
|
@@ -2422,49 +2421,49 @@ class Ui {
|
|
|
2422
2421
|
if (!this.host.gestures.byKeyboard) return;
|
|
2423
2422
|
const e = this.host.data.tooltipTargetFor(t);
|
|
2424
2423
|
e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged());
|
|
2425
|
-
},
|
|
2424
|
+
}, qe);
|
|
2426
2425
|
}
|
|
2427
2426
|
/** The span in view, said once the keys rest - also after a key that changed nothing. */
|
|
2428
2427
|
scheduleSpan() {
|
|
2429
2428
|
this.timer !== null && clearTimeout(this.timer), this.timer = setTimeout(() => {
|
|
2430
2429
|
this.timer = null, this.spoken = { target: null, lane: null, span: this.host.visibleDomain(), count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged();
|
|
2431
|
-
},
|
|
2430
|
+
}, qe);
|
|
2432
2431
|
}
|
|
2433
2432
|
/** Unmount: no readout after it. */
|
|
2434
2433
|
stop() {
|
|
2435
2434
|
this.timer !== null && clearTimeout(this.timer), this.timer = null;
|
|
2436
2435
|
}
|
|
2437
2436
|
}
|
|
2438
|
-
const it = (
|
|
2439
|
-
function
|
|
2440
|
-
if (t.size === 0 ||
|
|
2441
|
-
const e =
|
|
2442
|
-
return e.length ===
|
|
2437
|
+
const it = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
|
|
2438
|
+
function qi(s, t) {
|
|
2439
|
+
if (t.size === 0 || s.folded === void 0) return s;
|
|
2440
|
+
const e = s.folded.filter((n) => t.has(n));
|
|
2441
|
+
return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
|
|
2443
2442
|
}
|
|
2444
|
-
function
|
|
2445
|
-
if (
|
|
2446
|
-
const [t, e] = Array.isArray(
|
|
2447
|
-
return Array.isArray(
|
|
2443
|
+
function Yt(s) {
|
|
2444
|
+
if (s == null) return null;
|
|
2445
|
+
const [t, e] = Array.isArray(s) ? s : [];
|
|
2446
|
+
return Array.isArray(s) && s.length === 2 && Number.isFinite(t) && Number.isFinite(e) && typeof t == "number" && typeof e == "number" && t < e ? [t, e] : (Xt && j("domain", `the view's domain must be [from, to], two numbers in milliseconds since 1970 with from before to (as Date.getTime() gives), not ${JSON.stringify(s)}; the schedule shows its subtasks instead.`), null);
|
|
2448
2447
|
}
|
|
2449
|
-
function
|
|
2450
|
-
if (n.length === 0) return null;
|
|
2448
|
+
function ji(s, t, e = (i) => i, n = "middle") {
|
|
2451
2449
|
let i = 1 / 0, o = -1 / 0;
|
|
2452
|
-
for (const l of
|
|
2453
|
-
i = Math.min(i, l.from - (l.leadIn ?? 0)), o = Math.max(o, l.to + (l.leadOut ?? 0));
|
|
2450
|
+
for (const l of s)
|
|
2451
|
+
!Number.isFinite(l.from) || !Number.isFinite(l.to) || (i = Math.min(i, l.from - (l.leadIn ?? 0)), o = Math.max(o, l.to + (l.leadOut ?? 0)));
|
|
2452
|
+
if (i === 1 / 0) return null;
|
|
2454
2453
|
i = e(i), o = e(o);
|
|
2455
2454
|
const a = Math.min(t.max, Math.max(t.min, o - i));
|
|
2456
|
-
if (
|
|
2455
|
+
if (n === "start" && o - i > a) return [i, i + a];
|
|
2457
2456
|
const r = (i + o) / 2;
|
|
2458
2457
|
return [r - a / 2, r + a / 2];
|
|
2459
2458
|
}
|
|
2460
|
-
const
|
|
2459
|
+
const Ze = {
|
|
2461
2460
|
width: 0,
|
|
2462
2461
|
height: 0,
|
|
2463
2462
|
scrollY: 0,
|
|
2464
2463
|
headers: [],
|
|
2465
2464
|
days: [],
|
|
2466
2465
|
ticks: [],
|
|
2467
|
-
step:
|
|
2466
|
+
step: Qt,
|
|
2468
2467
|
fontScale: 1,
|
|
2469
2468
|
ghost: null,
|
|
2470
2469
|
grips: [],
|
|
@@ -2477,9 +2476,9 @@ const je = {
|
|
|
2477
2476
|
spoken: null,
|
|
2478
2477
|
summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
|
|
2479
2478
|
};
|
|
2480
|
-
class
|
|
2481
|
-
data = new
|
|
2482
|
-
view = new
|
|
2479
|
+
class Zi {
|
|
2480
|
+
data = new ki(() => this.viewChanged());
|
|
2481
|
+
view = new yn(this.data);
|
|
2483
2482
|
gestures;
|
|
2484
2483
|
keys;
|
|
2485
2484
|
handlersNow = {};
|
|
@@ -2520,31 +2519,31 @@ class ji {
|
|
|
2520
2519
|
movePending = !1;
|
|
2521
2520
|
domainFrame = 0;
|
|
2522
2521
|
unsubscribeTheme = null;
|
|
2523
|
-
snapshot =
|
|
2522
|
+
snapshot = Ze;
|
|
2524
2523
|
dataTable = null;
|
|
2525
2524
|
listeners = /* @__PURE__ */ new Set();
|
|
2526
2525
|
constructor(t = {}) {
|
|
2527
|
-
this.folded = t.folded ?? [], this.domainInView =
|
|
2526
|
+
this.folded = t.folded ?? [], this.domainInView = Yt(t.domain), this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Yi({
|
|
2528
2527
|
data: this.data,
|
|
2529
2528
|
view: this.view,
|
|
2530
2529
|
plotElement: () => this.plot,
|
|
2531
2530
|
handlers: () => this.handlersNow,
|
|
2532
2531
|
selectedSubtask: () => this.selected,
|
|
2533
|
-
select: (e,
|
|
2532
|
+
select: (e, n) => this.select(e, n),
|
|
2534
2533
|
viewChanged: () => this.viewChanged(),
|
|
2535
2534
|
viewMoved: (e) => this.viewMoved(e),
|
|
2536
2535
|
interactionChanged: () => this.interactionChanged(),
|
|
2537
2536
|
hoverChanged: () => this.hoverChanged()
|
|
2538
|
-
}), this.keys = new
|
|
2537
|
+
}), this.keys = new Xi({
|
|
2539
2538
|
data: this.data,
|
|
2540
2539
|
view: this.view,
|
|
2541
2540
|
gestures: this.gestures,
|
|
2542
2541
|
handlers: () => this.handlersNow,
|
|
2543
2542
|
visibleDomain: () => this.visibleDomain(),
|
|
2544
|
-
select: (e,
|
|
2543
|
+
select: (e, n) => this.select(e, n),
|
|
2545
2544
|
viewMoved: (e) => this.viewMoved(e),
|
|
2546
|
-
zoomBy: (e,
|
|
2547
|
-
this.view.zoomAt(e,
|
|
2545
|
+
zoomBy: (e, n) => {
|
|
2546
|
+
this.view.zoomAt(e, n) && this.viewMoved(!0);
|
|
2548
2547
|
},
|
|
2549
2548
|
fitWork: () => this.setDomain(null),
|
|
2550
2549
|
spokenChanged: () => this.publish()
|
|
@@ -2600,18 +2599,18 @@ class ji {
|
|
|
2600
2599
|
getView = () => this.viewNow;
|
|
2601
2600
|
/** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
|
|
2602
2601
|
applyView(t) {
|
|
2603
|
-
it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain === void 0 ? null :
|
|
2602
|
+
it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain === void 0 ? null : Yt(t.domain)));
|
|
2604
2603
|
}
|
|
2605
2604
|
/** Puts a span of two wall-clock instants in view; null shows the
|
|
2606
2605
|
subtasks' extent. */
|
|
2607
2606
|
setDomain = (t) => {
|
|
2608
|
-
const e =
|
|
2607
|
+
const e = Yt(t);
|
|
2609
2608
|
this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.domainFrame = 0, this.actedOn = !0, this.domainInView = e === null ? null : [e[0], e[1]], e === null ? this.fitted = !1 : this.view.showWall(e), this.viewChanged();
|
|
2610
2609
|
};
|
|
2611
2610
|
/** Folds or unfolds one group. */
|
|
2612
2611
|
toggleGroup = (t) => {
|
|
2613
2612
|
const e = this.viewNow.folded ?? [];
|
|
2614
|
-
this.actedOn = !0, this.folded = e.includes(t) ? e.filter((
|
|
2613
|
+
this.actedOn = !0, this.folded = e.includes(t) ? e.filter((n) => n !== t) : [...e, t], this.viewChanged();
|
|
2615
2614
|
};
|
|
2616
2615
|
foldAll = () => {
|
|
2617
2616
|
this.actedOn = !0, this.folded = this.data.groups.map((t) => t.id), this.viewChanged();
|
|
@@ -2620,7 +2619,7 @@ class ji {
|
|
|
2620
2619
|
this.actedOn = !0, this.folded = [], this.viewChanged();
|
|
2621
2620
|
};
|
|
2622
2621
|
currentView() {
|
|
2623
|
-
return
|
|
2622
|
+
return qi(
|
|
2624
2623
|
{ ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
|
|
2625
2624
|
new Set(this.data.groups.map((t) => t.id))
|
|
2626
2625
|
);
|
|
@@ -2635,13 +2634,13 @@ class ji {
|
|
|
2635
2634
|
/** The subtasks' extent within the zoom limits, while the view names no
|
|
2636
2635
|
span - and the local day of today while there is no work to show. */
|
|
2637
2636
|
fit() {
|
|
2638
|
-
const t = this.view.options.calendar, e =
|
|
2637
|
+
const t = this.view.options.calendar, e = ji(this.data.subtasks, this.view.options.zoomLimits, (l) => z(l, t), "start");
|
|
2639
2638
|
if (e !== null) {
|
|
2640
2639
|
this.view.domain = e, this.fitted = !0;
|
|
2641
2640
|
return;
|
|
2642
2641
|
}
|
|
2643
|
-
const
|
|
2644
|
-
this.view.showWall([i.getTime(),
|
|
2642
|
+
const n = this.view.options.timeZone, i = Ws(Date.now(), n), { year: o, month: a, day: r } = ts(i, n);
|
|
2643
|
+
this.view.showWall([i.getTime(), Vt({ year: o, month: a, day: r + 1 }, n).getTime()]);
|
|
2645
2644
|
}
|
|
2646
2645
|
/** `undefined`: the scene keeps the selection itself. */
|
|
2647
2646
|
setControlledTask(t) {
|
|
@@ -2658,14 +2657,14 @@ class ji {
|
|
|
2658
2657
|
return t !== void 0 && t.task === this.selectedTask ? t.id : null;
|
|
2659
2658
|
}
|
|
2660
2659
|
select(t, e) {
|
|
2661
|
-
const
|
|
2662
|
-
this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t),
|
|
2660
|
+
const n = t !== this.selectedTask || e !== this.selected;
|
|
2661
|
+
this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), n && this.handlersNow.onSelectedTaskChange?.(t, e), this.interactionChanged();
|
|
2663
2662
|
}
|
|
2664
2663
|
/* ---------------------------------------------------------------- */
|
|
2665
2664
|
/* DOM binding */
|
|
2666
2665
|
/* ---------------------------------------------------------------- */
|
|
2667
|
-
bind(t, e,
|
|
2668
|
-
this.root = t, this.plot = e, this.dataCanvas =
|
|
2666
|
+
bind(t, e, n, i) {
|
|
2667
|
+
this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme = Ns(() => {
|
|
2669
2668
|
this.colours = null, this.dataStale = !0, this.requestDraw();
|
|
2670
2669
|
}), this.viewChanged();
|
|
2671
2670
|
}
|
|
@@ -2673,14 +2672,14 @@ class ji {
|
|
|
2673
2672
|
this.gestures.cancelEdit(), this.keys.stop(), this.unsubscribeTheme?.(), this.unsubscribeTheme = null, this.frame !== 0 && cancelAnimationFrame(this.frame), this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.frame = this.domainFrame = 0, this.movePending = !1, this.root = this.plot = this.dataCanvas = this.overlayCanvas = null;
|
|
2674
2673
|
}
|
|
2675
2674
|
resize(t, e) {
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2675
|
+
const n = Math.max(0, Math.round(t)), i = Math.max(0, Math.round(e));
|
|
2676
|
+
n === this.view.width && i === this.view.height || (this.view.width = n, this.view.height = i, this.viewChanged());
|
|
2678
2677
|
}
|
|
2679
2678
|
subscribe = (t) => (this.listeners.add(t), () => {
|
|
2680
2679
|
this.listeners.delete(t);
|
|
2681
2680
|
});
|
|
2682
2681
|
getSnapshot = () => this.snapshot;
|
|
2683
|
-
getServerSnapshot = () =>
|
|
2682
|
+
getServerSnapshot = () => Ze;
|
|
2684
2683
|
/* ---------------------------------------------------------------- */
|
|
2685
2684
|
/* Changes */
|
|
2686
2685
|
/* ---------------------------------------------------------------- */
|
|
@@ -2711,8 +2710,8 @@ class ji {
|
|
|
2711
2710
|
this.requestDraw();
|
|
2712
2711
|
}
|
|
2713
2712
|
publish() {
|
|
2714
|
-
const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0,
|
|
2715
|
-
e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") &&
|
|
2713
|
+
const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, n = [];
|
|
2714
|
+
e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && n.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && n.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
|
|
2716
2715
|
width: t.width,
|
|
2717
2716
|
height: t.height,
|
|
2718
2717
|
scrollY: t.scrollY,
|
|
@@ -2720,7 +2719,7 @@ class ji {
|
|
|
2720
2719
|
...t.bands(),
|
|
2721
2720
|
fontScale: t.fontScale,
|
|
2722
2721
|
ghost: this.gestures.ghostSummary(),
|
|
2723
|
-
grips:
|
|
2722
|
+
grips: n,
|
|
2724
2723
|
cursor: this.gestures.cursor,
|
|
2725
2724
|
tooltip: this.tooltip(),
|
|
2726
2725
|
loading: this.gestures.loading,
|
|
@@ -2736,7 +2735,7 @@ class ji {
|
|
|
2736
2735
|
not taken off here: the header column is moved as a whole, as it always
|
|
2737
2736
|
was, so that a header and its row cannot drift apart by a rounding. */
|
|
2738
2737
|
headers() {
|
|
2739
|
-
const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])),
|
|
2738
|
+
const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])), n = new Set(this.folded);
|
|
2740
2739
|
return this.view.rows.rows.map((i) => ({
|
|
2741
2740
|
key: i.lane ?? i.group ?? "",
|
|
2742
2741
|
kind: i.kind,
|
|
@@ -2746,7 +2745,7 @@ class ji {
|
|
|
2746
2745
|
depth: i.depth,
|
|
2747
2746
|
within: i.within,
|
|
2748
2747
|
lanes: i.lanes,
|
|
2749
|
-
collapsed: i.group === void 0 ? void 0 :
|
|
2748
|
+
collapsed: i.group === void 0 ? void 0 : n.has(i.group),
|
|
2750
2749
|
top: i.top,
|
|
2751
2750
|
height: i.height
|
|
2752
2751
|
}));
|
|
@@ -2758,27 +2757,27 @@ class ji {
|
|
|
2758
2757
|
const t = this.view;
|
|
2759
2758
|
if (t.width <= 0) return [];
|
|
2760
2759
|
const e = this.colours;
|
|
2761
|
-
return t.boxes.flatMap((
|
|
2762
|
-
if (!
|
|
2763
|
-
const i =
|
|
2760
|
+
return t.boxes.flatMap((n) => {
|
|
2761
|
+
if (!zt(n, t.width, t.height)) return [];
|
|
2762
|
+
const i = ln(n, t.width);
|
|
2764
2763
|
if (i === null) return [];
|
|
2765
|
-
const o = e === null ? !0 :
|
|
2766
|
-
|
|
2767
|
-
|
|
2764
|
+
const o = e === null ? !0 : ce(
|
|
2765
|
+
Lt(n.subtask.appearance),
|
|
2766
|
+
kt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
|
|
2768
2767
|
e
|
|
2769
2768
|
).onDark;
|
|
2770
|
-
return [{ subtask:
|
|
2769
|
+
return [{ subtask: n.subtask, ...i, dark: o }];
|
|
2771
2770
|
});
|
|
2772
2771
|
}
|
|
2773
2772
|
/** The findings count the whole plan - an overlap out of view is still one
|
|
2774
2773
|
to know of -, the subtasks only what is in view. */
|
|
2775
2774
|
summary() {
|
|
2776
|
-
const t = this.view, [e,
|
|
2775
|
+
const t = this.view, [e, n] = this.visibleDomain();
|
|
2777
2776
|
return {
|
|
2778
2777
|
lanes: this.data.lanes.length,
|
|
2779
|
-
subtasks: t.boxes.filter((i) =>
|
|
2778
|
+
subtasks: t.boxes.filter((i) => zt(i, t.width, t.height)).length,
|
|
2780
2779
|
from: e,
|
|
2781
|
-
to:
|
|
2780
|
+
to: n,
|
|
2782
2781
|
overlaps: this.data.overlaps.length,
|
|
2783
2782
|
violated: this.data.violatedById.size,
|
|
2784
2783
|
blocked: this.data.inBlocked.length,
|
|
@@ -2790,12 +2789,12 @@ class ji {
|
|
|
2790
2789
|
if (!this.gestures.idle) return null;
|
|
2791
2790
|
const e = this.data.tooltipTargetFor(t);
|
|
2792
2791
|
if (e === null) return null;
|
|
2793
|
-
const { x:
|
|
2794
|
-
return { target: e, x:
|
|
2792
|
+
const { x: n, y: i } = this.gestures.hoverPoint;
|
|
2793
|
+
return { target: e, x: n, y: i };
|
|
2795
2794
|
}
|
|
2796
2795
|
/** The visible span, as two wall-clock instants. */
|
|
2797
2796
|
visibleDomain() {
|
|
2798
|
-
const t = (e) =>
|
|
2797
|
+
const t = (e) => mt(e, this.view.options.calendar);
|
|
2799
2798
|
return [t(this.view.domain[0]), t(this.view.domain[1])];
|
|
2800
2799
|
}
|
|
2801
2800
|
/** A pan or zoom of the planner's goes into the view once per frame,
|
|
@@ -2809,18 +2808,18 @@ class ji {
|
|
|
2809
2808
|
}
|
|
2810
2809
|
/** The time and the lane at a client point, or null outside the plot. */
|
|
2811
2810
|
positionAt(t, e) {
|
|
2812
|
-
const
|
|
2813
|
-
if (
|
|
2814
|
-
const i = t -
|
|
2815
|
-
return i < 0 || o < 0 || i >
|
|
2811
|
+
const n = this.plot?.getBoundingClientRect();
|
|
2812
|
+
if (n === void 0) return null;
|
|
2813
|
+
const i = t - n.left, o = e - n.top;
|
|
2814
|
+
return i < 0 || o < 0 || i > n.width || o > n.height ? null : { time: this.view.timeAt(i), lane: this.view.laneIdAt(o) };
|
|
2816
2815
|
}
|
|
2817
2816
|
/** The client point of a time, on a lane's middle where one is named, or
|
|
2818
2817
|
null while the schedule is not on screen. */
|
|
2819
2818
|
clientPointOf(t, e) {
|
|
2820
|
-
const
|
|
2821
|
-
if (
|
|
2819
|
+
const n = this.plot?.getBoundingClientRect();
|
|
2820
|
+
if (n === void 0) return null;
|
|
2822
2821
|
const i = this.view.viewport(), o = e === void 0 ? null : et(i, e), a = o === null ? 0 : o.top + o.height / 2;
|
|
2823
|
-
return { x:
|
|
2822
|
+
return { x: n.left + x(i, t), y: n.top + a };
|
|
2824
2823
|
}
|
|
2825
2824
|
/** Whether a lane has a row of its own on a mounted plot: not unknown, not
|
|
2826
2825
|
in a folded group, whose lanes are strips and no rows. */
|
|
@@ -2832,7 +2831,7 @@ class ji {
|
|
|
2832
2831
|
moved, for a lane without a row. */
|
|
2833
2832
|
scrollToLane(t) {
|
|
2834
2833
|
if (!this.hasRow(t)) return !1;
|
|
2835
|
-
const e = this.view.rows.slots.get(t),
|
|
2834
|
+
const e = this.view.rows.slots.get(t), n = e.top - this.view.scrollY, i = n < 0 ? n : n + e.height > this.view.height ? Math.min(n + e.height - this.view.height, n) : 0;
|
|
2836
2835
|
return this.view.pan(0, i).moved && this.viewMoved(!1), !0;
|
|
2837
2836
|
}
|
|
2838
2837
|
/** Brings a subtask's lane and time into view, the span keeping its width;
|
|
@@ -2852,9 +2851,9 @@ class ji {
|
|
|
2852
2851
|
}
|
|
2853
2852
|
draw() {
|
|
2854
2853
|
if (this.root === null) return;
|
|
2855
|
-
this.colours === null && (this.colours =
|
|
2856
|
-
const { width: t, height: e } = this.view,
|
|
2857
|
-
if (i === null || t === 0 || this.dataStale &&
|
|
2854
|
+
this.colours === null && (this.colours = Ii(this.root, this.data), this.publish());
|
|
2855
|
+
const { width: t, height: e } = this.view, n = this.dataStale ? Ge(this.dataCanvas, t, e) : null, i = Ge(this.overlayCanvas, t, e);
|
|
2856
|
+
if (i === null || t === 0 || this.dataStale && n === null) return;
|
|
2858
2857
|
this.dataStale = !1;
|
|
2859
2858
|
const o = {
|
|
2860
2859
|
data: this.data,
|
|
@@ -2866,7 +2865,7 @@ class ji {
|
|
|
2866
2865
|
hover: this.gestures.hover,
|
|
2867
2866
|
ghost: this.gestures.ghostDrawing()
|
|
2868
2867
|
};
|
|
2869
|
-
|
|
2868
|
+
n !== null && Li(n, o), Ai(i, o);
|
|
2870
2869
|
}
|
|
2871
2870
|
/* ---------------------------------------------------------------- */
|
|
2872
2871
|
/* Gestures, as the component hands them in */
|
|
@@ -2887,50 +2886,50 @@ class ji {
|
|
|
2887
2886
|
focus = (t) => this.keys.focus(t);
|
|
2888
2887
|
blur = () => this.keys.blur();
|
|
2889
2888
|
}
|
|
2890
|
-
function
|
|
2891
|
-
const { initialView: t, onViewChange: e } =
|
|
2892
|
-
const l = (d) => Rs(
|
|
2889
|
+
function ao(s = {}) {
|
|
2890
|
+
const { initialView: t, onViewChange: e } = s, [n] = ut(() => new Zi(t)), i = U(""), [o] = ut(() => {
|
|
2891
|
+
const l = (d) => Rs(oi, { ...d, scene: n });
|
|
2893
2892
|
return l.displayName = "Schedule", {
|
|
2894
2893
|
Schedule: l,
|
|
2895
|
-
Lane:
|
|
2896
|
-
LaneGroup:
|
|
2897
|
-
Subtasks:
|
|
2898
|
-
Dependencies:
|
|
2899
|
-
BlockedTimes:
|
|
2900
|
-
Milestones:
|
|
2901
|
-
DataTable:
|
|
2894
|
+
Lane: di,
|
|
2895
|
+
LaneGroup: hi,
|
|
2896
|
+
Subtasks: ci,
|
|
2897
|
+
Dependencies: ui,
|
|
2898
|
+
BlockedTimes: fi,
|
|
2899
|
+
Milestones: mi,
|
|
2900
|
+
DataTable: ri,
|
|
2902
2901
|
setView: (d) => {
|
|
2903
|
-
|
|
2902
|
+
n.applyView(d), i.current = it(n.getView());
|
|
2904
2903
|
},
|
|
2905
|
-
setDomain:
|
|
2906
|
-
positionAt: (d, c) =>
|
|
2907
|
-
clientPointOf: (d, c) =>
|
|
2908
|
-
visibleDomain: () =>
|
|
2909
|
-
scrollToLane: (d) =>
|
|
2910
|
-
scrollToSubtask: (d) =>
|
|
2911
|
-
focusSubtask: (d) =>
|
|
2912
|
-
toggleGroup:
|
|
2913
|
-
foldAll:
|
|
2914
|
-
unfoldAll:
|
|
2904
|
+
setDomain: n.setDomain,
|
|
2905
|
+
positionAt: (d, c) => n.positionAt(d, c),
|
|
2906
|
+
clientPointOf: (d, c) => n.clientPointOf(d, c),
|
|
2907
|
+
visibleDomain: () => n.visibleDomain(),
|
|
2908
|
+
scrollToLane: (d) => n.scrollToLane(d),
|
|
2909
|
+
scrollToSubtask: (d) => n.scrollToSubtask(d),
|
|
2910
|
+
focusSubtask: (d) => n.focusSubtask(d),
|
|
2911
|
+
toggleGroup: n.toggleGroup,
|
|
2912
|
+
foldAll: n.foldAll,
|
|
2913
|
+
unfoldAll: n.unfoldAll
|
|
2915
2914
|
};
|
|
2916
|
-
}), a =
|
|
2915
|
+
}), a = ee(n.subscribeView, n.getView, n.getView), r = it(a);
|
|
2917
2916
|
return Y(() => {
|
|
2918
|
-
i.current !== r && (i.current = r,
|
|
2917
|
+
i.current !== r && (i.current = r, n.acted && e?.(a));
|
|
2919
2918
|
}, [r]), X(() => ({ ...o, view: a }), [o, a]);
|
|
2920
2919
|
}
|
|
2921
2920
|
export {
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2921
|
+
_e as applyIntent,
|
|
2922
|
+
ne as arrival,
|
|
2923
|
+
se as departure,
|
|
2924
|
+
no as findings,
|
|
2926
2925
|
es as inBlockedTime,
|
|
2927
2926
|
tt as occupied,
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2927
|
+
ie as overlaps,
|
|
2928
|
+
Lt as resolveAppearance,
|
|
2929
|
+
io as ripple,
|
|
2930
|
+
oo as shiftTask,
|
|
2931
|
+
Xs as snapTime,
|
|
2932
|
+
so as subtaskFromPlace,
|
|
2933
|
+
ao as useSchedule,
|
|
2934
|
+
oe as violatedDependencies
|
|
2936
2935
|
};
|