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