schedulant 2.0.7-fixed.5.1 → 2.0.8
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/dist/icons/milestone-icon.d.ts +5 -0
- package/dist/schedulant.css +1 -1
- package/dist/schedulant.d.ts +1 -1
- package/dist/schedulant.js +1465 -1385
- package/dist/types/index.d.ts +1 -1
- package/dist/types/resource.d.ts +5 -0
- package/dist/types/schedulant.d.ts +7 -1
- package/dist/utils/selection.d.ts +5 -4
- package/package.json +1 -1
package/dist/schedulant.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as
|
|
1
|
+
import { jsx as a, Fragment as bt, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import * as ie from "react";
|
|
3
|
+
import { createContext as wt, useReducer as Et, useEffect as N, useContext as Ct, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Tt } from "react";
|
|
4
4
|
import E from "dayjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Dropdown as
|
|
10
|
-
import { PlusSquareOutlined as Ct, MinusSquareOutlined as Tt } from "@ant-design/icons";
|
|
11
|
-
import { useSortable as Dt, SortableContext as Rt, verticalListSortingStrategy as kt } from "@dnd-kit/sortable";
|
|
5
|
+
import Dt from "dayjs/plugin/weekYear";
|
|
6
|
+
import Rt from "dayjs/plugin/weekOfYear";
|
|
7
|
+
import kt from "dayjs/plugin/quarterOfYear";
|
|
8
|
+
import xt from "dayjs/plugin/isSameOrBefore";
|
|
9
|
+
import { Dropdown as Z, Space as It } from "antd";
|
|
12
10
|
import X from "@ant-design/icons/lib/components/Icon";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
11
|
+
import { PlusSquareOutlined as Ot, MinusSquareOutlined as Pt } from "@ant-design/icons";
|
|
12
|
+
import { useSortable as Lt, SortableContext as Nt, verticalListSortingStrategy as Yt } from "@dnd-kit/sortable";
|
|
13
|
+
import { useSensors as _t, useSensor as We, PointerSensor as Wt, KeyboardSensor as Ht, DndContext as zt, closestCenter as Vt, DragOverlay as Ft } from "@dnd-kit/core";
|
|
14
|
+
import { restrictToVerticalAxis as Bt } from "@dnd-kit/modifiers";
|
|
15
|
+
import { flushSync as qt } from "react-dom";
|
|
16
|
+
const de = {
|
|
17
17
|
EXPAND_RESOURCE: "EXPAND_RESOURCE",
|
|
18
18
|
COLLAPSE_RESOURCE: "COLLAPSE_RESOURCE",
|
|
19
19
|
SET_RESOURCE_AREA_WIDTH: "SET_RESOURCE_AREA_WIDTH"
|
|
20
|
-
},
|
|
20
|
+
}, ut = "schedulant.state", Ut = () => {
|
|
21
21
|
try {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return JSON.parse(
|
|
22
|
+
const t = localStorage.getItem(ut);
|
|
23
|
+
if (t)
|
|
24
|
+
return JSON.parse(t);
|
|
25
25
|
} catch {
|
|
26
26
|
console.warn("Error parsing schedulant local storage");
|
|
27
27
|
}
|
|
@@ -29,93 +29,93 @@ const re = {
|
|
|
29
29
|
collapseIds: [],
|
|
30
30
|
resourceAreaWidth: "20%"
|
|
31
31
|
};
|
|
32
|
-
},
|
|
32
|
+
}, jt = (t, e) => {
|
|
33
33
|
switch (e.type) {
|
|
34
|
-
case
|
|
34
|
+
case de.EXPAND_RESOURCE:
|
|
35
35
|
return {
|
|
36
|
-
...
|
|
37
|
-
collapseIds:
|
|
36
|
+
...t,
|
|
37
|
+
collapseIds: t.collapseIds.filter((n) => n !== e.id)
|
|
38
38
|
};
|
|
39
|
-
case
|
|
39
|
+
case de.COLLAPSE_RESOURCE:
|
|
40
40
|
return {
|
|
41
|
-
...
|
|
42
|
-
collapseIds: [...
|
|
41
|
+
...t,
|
|
42
|
+
collapseIds: [...t.collapseIds, e.id]
|
|
43
43
|
};
|
|
44
|
-
case
|
|
44
|
+
case de.SET_RESOURCE_AREA_WIDTH:
|
|
45
45
|
return {
|
|
46
|
-
...
|
|
46
|
+
...t,
|
|
47
47
|
resourceAreaWidth: e.width
|
|
48
48
|
};
|
|
49
49
|
default:
|
|
50
|
-
return
|
|
50
|
+
return t;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
53
|
-
const [e,
|
|
52
|
+
}, ht = wt(void 0), $t = ({ children: t }) => {
|
|
53
|
+
const [e, n] = Et(jt, void 0, Ut);
|
|
54
54
|
return N(() => {
|
|
55
|
-
localStorage.setItem(
|
|
56
|
-
}, [e]), /* @__PURE__ */ a(
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
55
|
+
localStorage.setItem(ut, JSON.stringify(e));
|
|
56
|
+
}, [e]), /* @__PURE__ */ a(ht.Provider, { value: { state: e, dispatch: n }, children: t });
|
|
57
|
+
}, De = () => {
|
|
58
|
+
const t = Ct(ht);
|
|
59
|
+
if (t === void 0)
|
|
60
60
|
throw new Error("useSchedulantContext must be used within a SchedulantProvider");
|
|
61
|
-
return
|
|
62
|
-
}, w = (
|
|
61
|
+
return t;
|
|
62
|
+
}, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), He = (t) => document.querySelector(`.${t}`), mt = 1.5, Gt = 0.7, W = 10, gt = 16, ze = 13, Xt = 0.1, Ve = 0.5, Qt = 0.25, Kt = 0.75, Zt = 100, Jt = (t) => {
|
|
63
63
|
N(() => {
|
|
64
|
-
const e = document.getElementById("schedulant-view-harness"),
|
|
64
|
+
const e = document.getElementById("schedulant-view-harness"), n = document.getElementById("schedulant-datagrid-body"), s = document.getElementById("schedulant-timeline-head"), i = n ? n.getBoundingClientRect().height : 0, r = s ? s.getBoundingClientRect().height : 0, o = i + r + ze, l = t - o > 0 ? o : t;
|
|
65
65
|
e && (e.style.height = w(l));
|
|
66
66
|
const c = () => {
|
|
67
|
-
const m =
|
|
68
|
-
e && (e.style.height = w(
|
|
69
|
-
},
|
|
67
|
+
const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, u = m + f + ze, h = t - u > 0 ? u : t;
|
|
68
|
+
e && (e.style.height = w(h));
|
|
69
|
+
}, d = new ResizeObserver(() => {
|
|
70
70
|
c();
|
|
71
71
|
});
|
|
72
|
-
return
|
|
73
|
-
|
|
72
|
+
return n && d.observe(n), s && d.observe(s), () => {
|
|
73
|
+
d.disconnect();
|
|
74
74
|
};
|
|
75
|
-
}, [
|
|
76
|
-
},
|
|
75
|
+
}, [t]);
|
|
76
|
+
}, en = (t, e, n, s) => {
|
|
77
77
|
N(() => {
|
|
78
|
-
const i =
|
|
78
|
+
const i = t.current, r = e.current, o = n.current, l = s.current;
|
|
79
79
|
if (!i || !r || !o || !l) return;
|
|
80
|
-
const c = [],
|
|
81
|
-
m.addEventListener(f,
|
|
80
|
+
const c = [], d = (m, f, u, h) => {
|
|
81
|
+
m.addEventListener(f, u, h), c.push(() => m.removeEventListener(f, u));
|
|
82
82
|
};
|
|
83
|
-
return
|
|
83
|
+
return d(r, "scroll", () => {
|
|
84
84
|
i.scrollTop = r.scrollTop, l.scrollLeft = r.scrollLeft;
|
|
85
|
-
}),
|
|
85
|
+
}), d(i, "scroll", () => {
|
|
86
86
|
o.scrollLeft = i.scrollLeft;
|
|
87
|
-
}),
|
|
87
|
+
}), d(i, "wheel", ((m) => {
|
|
88
88
|
let f = !1;
|
|
89
89
|
if (m.deltaY !== 0) {
|
|
90
|
-
const
|
|
91
|
-
r.scrollTop =
|
|
90
|
+
const u = r.scrollHeight - r.clientHeight, h = Math.max(0, Math.min(u, r.scrollTop + m.deltaY));
|
|
91
|
+
r.scrollTop = h, i.scrollTop = h, f = !0;
|
|
92
92
|
}
|
|
93
93
|
if (f && m.deltaX !== 0) {
|
|
94
|
-
const
|
|
95
|
-
i.scrollLeft =
|
|
94
|
+
const u = i.scrollWidth - i.clientWidth, h = Math.max(0, Math.min(u, i.scrollLeft + m.deltaX));
|
|
95
|
+
i.scrollLeft = h, o.scrollLeft = h;
|
|
96
96
|
} else if (m.deltaX !== 0) {
|
|
97
|
-
const
|
|
98
|
-
o.scrollLeft = Math.max(0, Math.min(
|
|
97
|
+
const u = i.scrollWidth - i.clientWidth;
|
|
98
|
+
o.scrollLeft = Math.max(0, Math.min(u, i.scrollLeft + m.deltaX));
|
|
99
99
|
}
|
|
100
100
|
f && m.preventDefault();
|
|
101
|
-
}), { passive: !1 }),
|
|
101
|
+
}), { passive: !1 }), d(r, "wheel", ((m) => {
|
|
102
102
|
let f = !1;
|
|
103
103
|
if (m.deltaY !== 0) {
|
|
104
|
-
const
|
|
105
|
-
r.scrollTop =
|
|
104
|
+
const u = r.scrollHeight - r.clientHeight, h = Math.max(0, Math.min(u, r.scrollTop + m.deltaY));
|
|
105
|
+
r.scrollTop = h, i.scrollTop = h, f = !0;
|
|
106
106
|
}
|
|
107
107
|
if (m.deltaX !== 0) {
|
|
108
|
-
const
|
|
109
|
-
r.scrollLeft =
|
|
108
|
+
const u = r.scrollWidth - r.clientWidth, h = Math.max(0, Math.min(u, r.scrollLeft + m.deltaX));
|
|
109
|
+
r.scrollLeft = h, l.scrollLeft = h, f = !0;
|
|
110
110
|
}
|
|
111
111
|
f && m.preventDefault();
|
|
112
112
|
}), { passive: !1 }), () => c.forEach((m) => m());
|
|
113
|
-
}, [
|
|
114
|
-
},
|
|
113
|
+
}, [t, e, n, s]);
|
|
114
|
+
}, tn = (t, e) => {
|
|
115
115
|
N(() => {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
}, [
|
|
116
|
+
const n = t.current;
|
|
117
|
+
n && e && (n.style.width = e);
|
|
118
|
+
}, [t, e]);
|
|
119
119
|
};
|
|
120
120
|
class x {
|
|
121
121
|
value;
|
|
@@ -143,7 +143,7 @@ class x {
|
|
|
143
143
|
return this.isDefined() ? this.value : e;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
class
|
|
146
|
+
class nn {
|
|
147
147
|
event;
|
|
148
148
|
resourceApi;
|
|
149
149
|
constructor(e) {
|
|
@@ -194,14 +194,14 @@ class Xt {
|
|
|
194
194
|
return x.fromNullable(this.event.extendedProps);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
return
|
|
200
|
-
const i = e(
|
|
201
|
-
|
|
202
|
-
}),
|
|
197
|
+
const j = (t, e) => {
|
|
198
|
+
const n = {};
|
|
199
|
+
return t.forEach((s) => {
|
|
200
|
+
const i = e(s);
|
|
201
|
+
n[i] ? n[i].push(s) : n[i] = [s];
|
|
202
|
+
}), n;
|
|
203
203
|
};
|
|
204
|
-
class
|
|
204
|
+
class sn {
|
|
205
205
|
depth;
|
|
206
206
|
resource;
|
|
207
207
|
parent;
|
|
@@ -285,45 +285,45 @@ class Qt {
|
|
|
285
285
|
return x.fromNullable(this.resource.extendedProps);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
class
|
|
289
|
-
static compare(e,
|
|
290
|
-
const
|
|
291
|
-
return (typeof
|
|
288
|
+
class le {
|
|
289
|
+
static compare(e, n) {
|
|
290
|
+
const s = e.getExtendedProps().getOrElse({ order: 0 }).order, i = n.getExtendedProps().getOrElse({ order: 0 }).order;
|
|
291
|
+
return (typeof s == "number" ? s : 0) - (typeof i == "number" ? i : 0);
|
|
292
292
|
}
|
|
293
|
-
static createTree(e,
|
|
294
|
-
const r = "undefined", o = e.map((
|
|
293
|
+
static createTree(e, n, s, i) {
|
|
294
|
+
const r = "undefined", o = e.map((h) => new sn(h)), l = new Map(Object.entries(j(n, (h) => h.getResourceId()))), c = o.reduce((h, A) => h.set(A.getId(), A), /* @__PURE__ */ new Map()), d = new Map(Object.entries(j(s, (h) => h.getResourceId()))), m = new Map(Object.entries(j(i, (h) => h.getResourceId()))), f = [{ parentId: r, depth: 0 }], u = new Map(Object.entries(j(o, (h) => h.getParentId().getOrElse(r))));
|
|
295
295
|
for (; f.length > 0; ) {
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
const { parentId:
|
|
299
|
-
|
|
300
|
-
const g =
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
296
|
+
const h = f.pop();
|
|
297
|
+
if (h) {
|
|
298
|
+
const { parentId: A, depth: p } = h, S = u.get(A);
|
|
299
|
+
S && S.sort(le.compare).forEach((M) => {
|
|
300
|
+
const g = M.getId();
|
|
301
|
+
M.setDepth(p), M.setParent(c.get(A)), M.setChildren(u.get(g) || []);
|
|
302
|
+
const y = l.get(g) || [];
|
|
303
|
+
y.forEach((T) => T.setResourceApi(M)), M.setEventApis(y);
|
|
304
|
+
const v = d.get(g) || [];
|
|
305
|
+
v.forEach((T) => T.setResourceApi(M)), M.setMilestoneApis(v);
|
|
306
|
+
const b = m.get(g) || [];
|
|
307
|
+
b.forEach((T) => T.setResourceApi(M)), M.setCheckpointApis(b), f.push({ parentId: g, depth: p + 1 });
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
return
|
|
311
|
+
return u.get(r) || [];
|
|
312
312
|
}
|
|
313
313
|
static flatMapTree(e) {
|
|
314
|
-
const
|
|
315
|
-
for (;
|
|
316
|
-
const i =
|
|
314
|
+
const n = [], s = [...e];
|
|
315
|
+
for (; s.length > 0; ) {
|
|
316
|
+
const i = s.pop();
|
|
317
317
|
if (i) {
|
|
318
|
-
|
|
318
|
+
n.push(i);
|
|
319
319
|
for (let r = i.getChildren().length - 1; r >= 0; r--)
|
|
320
|
-
|
|
320
|
+
s.push(i.getChildren()[r]);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
return
|
|
323
|
+
return n;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
class
|
|
326
|
+
class rn {
|
|
327
327
|
milestone;
|
|
328
328
|
resourceApi;
|
|
329
329
|
constructor(e) {
|
|
@@ -362,7 +362,7 @@ class Kt {
|
|
|
362
362
|
return x.fromNullable(this.milestone.extendedProps);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
class
|
|
365
|
+
class on {
|
|
366
366
|
checkpoint;
|
|
367
367
|
resourceApi;
|
|
368
368
|
constructor(e) {
|
|
@@ -398,11 +398,11 @@ class Zt {
|
|
|
398
398
|
return x.fromNullable(this.checkpoint.extendedProps);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
E.extend(
|
|
402
|
-
E.extend(
|
|
403
|
-
E.extend(
|
|
404
|
-
E.extend(
|
|
405
|
-
class
|
|
401
|
+
E.extend(xt);
|
|
402
|
+
E.extend(kt);
|
|
403
|
+
E.extend(Rt);
|
|
404
|
+
E.extend(Dt);
|
|
405
|
+
class K {
|
|
406
406
|
start;
|
|
407
407
|
end;
|
|
408
408
|
timelineData;
|
|
@@ -415,8 +415,8 @@ class $ {
|
|
|
415
415
|
monthPositionCache = /* @__PURE__ */ new Map();
|
|
416
416
|
quarterPositionCache = /* @__PURE__ */ new Map();
|
|
417
417
|
yearPositionCache = /* @__PURE__ */ new Map();
|
|
418
|
-
generateTimelineData(e,
|
|
419
|
-
let
|
|
418
|
+
generateTimelineData(e, n) {
|
|
419
|
+
let s = e.clone();
|
|
420
420
|
const i = {
|
|
421
421
|
years: {},
|
|
422
422
|
months: {},
|
|
@@ -426,16 +426,16 @@ class $ {
|
|
|
426
426
|
};
|
|
427
427
|
this.dayPositionCache.clear(), this.weekPositionCache.clear(), this.monthPositionCache.clear(), this.quarterPositionCache.clear(), this.yearPositionCache.clear();
|
|
428
428
|
let r = 0;
|
|
429
|
-
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(),
|
|
430
|
-
for (;
|
|
431
|
-
const m =
|
|
432
|
-
i.years[m] = i.years[m] || [], i.years[m].push(
|
|
433
|
-
const f =
|
|
434
|
-
i.quarters[f] = i.quarters[f] || [], i.quarters[f].push(
|
|
435
|
-
const
|
|
436
|
-
i.months[
|
|
437
|
-
const
|
|
438
|
-
i.weeks[
|
|
429
|
+
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
430
|
+
for (; s.isSameOrBefore(n, "day"); ) {
|
|
431
|
+
const m = s.startOf("year").format("YYYY-MM-DD");
|
|
432
|
+
i.years[m] = i.years[m] || [], i.years[m].push(s.clone()), d.has(m) || d.set(m, d.size);
|
|
433
|
+
const f = s.startOf("quarter").format("YYYY-MM-DD");
|
|
434
|
+
i.quarters[f] = i.quarters[f] || [], i.quarters[f].push(s.clone()), c.has(f) || c.set(f, c.size);
|
|
435
|
+
const u = s.startOf("month").format("YYYY-MM-DD");
|
|
436
|
+
i.months[u] = i.months[u] || [], i.months[u].push(s.clone()), l.has(u) || l.set(u, l.size);
|
|
437
|
+
const h = s.startOf("week").format("YYYY-MM-DD");
|
|
438
|
+
i.weeks[h] = i.weeks[h] || [], i.weeks[h].push(s.clone()), o.has(h) || o.set(h, o.size), i.days.push(s.clone()), this.dayPositionCache.set(s.format("YYYY-MM-DD"), r), r++, s = s.add(1, "day");
|
|
439
439
|
}
|
|
440
440
|
return o.forEach((m, f) => {
|
|
441
441
|
this.weekPositionCache.set(f, m);
|
|
@@ -443,12 +443,12 @@ class $ {
|
|
|
443
443
|
this.monthPositionCache.set(f, m);
|
|
444
444
|
}), c.forEach((m, f) => {
|
|
445
445
|
this.quarterPositionCache.set(f, m);
|
|
446
|
-
}),
|
|
446
|
+
}), d.forEach((m, f) => {
|
|
447
447
|
this.yearPositionCache.set(f, m);
|
|
448
448
|
}), i;
|
|
449
449
|
}
|
|
450
|
-
constructor(e,
|
|
451
|
-
this.start = e, this.end =
|
|
450
|
+
constructor(e, n) {
|
|
451
|
+
this.start = e, this.end = n, this.timelineData = this.generateTimelineData(e, n);
|
|
452
452
|
}
|
|
453
453
|
setStart(e) {
|
|
454
454
|
this.start = e, this.timelineData = this.generateTimelineData(e, this.getEnd());
|
|
@@ -499,79 +499,79 @@ class $ {
|
|
|
499
499
|
return e.day() === 0 || e.day() === 6;
|
|
500
500
|
}
|
|
501
501
|
isHoliday(e) {
|
|
502
|
-
return (this.getCompanyHolidays().some((
|
|
502
|
+
return (this.getCompanyHolidays().some((n) => n.isSame(e, "day")) || this.getNationalHolidays().some((n) => n.isSame(e, "day")) || this.isWeekend(e)) && !this.getSpecialWorkdays().some((n) => n.isSame(e, "day"));
|
|
503
503
|
}
|
|
504
504
|
isSpecialWorkday(e) {
|
|
505
|
-
return this.getSpecialWorkdays().some((
|
|
505
|
+
return this.getSpecialWorkdays().some((n) => n.isSame(e, "day"));
|
|
506
506
|
}
|
|
507
507
|
isCompanyHoliday(e) {
|
|
508
|
-
return this.getCompanyHolidays().some((
|
|
508
|
+
return this.getCompanyHolidays().some((n) => n.isSame(e, "day"));
|
|
509
509
|
}
|
|
510
510
|
isNationalHoliday(e) {
|
|
511
|
-
return this.getNationalHolidays().some((
|
|
511
|
+
return this.getNationalHolidays().some((n) => n.isSame(e, "day"));
|
|
512
512
|
}
|
|
513
513
|
getDayPosition(e) {
|
|
514
|
-
const
|
|
515
|
-
return
|
|
514
|
+
const n = e.format("YYYY-MM-DD"), s = this.dayPositionCache.get(n);
|
|
515
|
+
return s !== void 0 ? s : this.getDays().findIndex((i) => i.isSame(e, "day"));
|
|
516
516
|
}
|
|
517
517
|
getWeekPosition(e) {
|
|
518
|
-
const
|
|
519
|
-
return
|
|
518
|
+
const n = e.startOf("week").format("YYYY-MM-DD"), s = this.weekPositionCache.get(n);
|
|
519
|
+
return s !== void 0 ? s : this.getWeeks().findIndex((i) => i.isSame(e, "week"));
|
|
520
520
|
}
|
|
521
521
|
getMonthPosition(e) {
|
|
522
|
-
const
|
|
523
|
-
return
|
|
522
|
+
const n = e.startOf("month").format("YYYY-MM-DD"), s = this.monthPositionCache.get(n);
|
|
523
|
+
return s !== void 0 ? s : this.getMonths().findIndex((i) => i.isSame(e, "month"));
|
|
524
524
|
}
|
|
525
525
|
getQuarterPosition(e) {
|
|
526
|
-
const
|
|
527
|
-
return
|
|
526
|
+
const n = e.startOf("quarter").format("YYYY-MM-DD"), s = this.quarterPositionCache.get(n);
|
|
527
|
+
return s !== void 0 ? s : this.getQuarters().findIndex((i) => i.isSame(e, "quarter"));
|
|
528
528
|
}
|
|
529
529
|
getYearPosition(e) {
|
|
530
|
-
const
|
|
531
|
-
return
|
|
530
|
+
const n = e.startOf("year").format("YYYY-MM-DD"), s = this.yearPositionCache.get(n);
|
|
531
|
+
return s !== void 0 ? s : this.getYears().findIndex((i) => i.isSame(e, "year"));
|
|
532
532
|
}
|
|
533
533
|
populateMonthsWithDays() {
|
|
534
|
-
const e = [],
|
|
535
|
-
for (const
|
|
534
|
+
const e = [], n = this.timelineData.months;
|
|
535
|
+
for (const s in n) {
|
|
536
536
|
const i = { month: E(), days: [] };
|
|
537
|
-
i.month = E(
|
|
537
|
+
i.month = E(s), i.days = n[s], e.push(i);
|
|
538
538
|
}
|
|
539
539
|
return e;
|
|
540
540
|
}
|
|
541
541
|
populateYearsWithDays() {
|
|
542
|
-
const e = [],
|
|
543
|
-
for (const
|
|
542
|
+
const e = [], n = this.timelineData.years;
|
|
543
|
+
for (const s in n) {
|
|
544
544
|
const i = { year: E(), days: [] };
|
|
545
|
-
i.year = E(
|
|
545
|
+
i.year = E(s), i.days = n[s], e.push(i);
|
|
546
546
|
}
|
|
547
547
|
return e;
|
|
548
548
|
}
|
|
549
549
|
populateYearsWithWeeks() {
|
|
550
|
-
const e = this.getWeeks(),
|
|
551
|
-
for (const i in
|
|
550
|
+
const e = this.getWeeks(), n = j(e, (i) => i.format("YYYY")), s = [];
|
|
551
|
+
for (const i in n) {
|
|
552
552
|
const r = { year: E(), weeks: [] };
|
|
553
|
-
r.year = E(i), r.weeks =
|
|
553
|
+
r.year = E(i), r.weeks = n[i], s.push(r);
|
|
554
554
|
}
|
|
555
|
-
return
|
|
555
|
+
return s;
|
|
556
556
|
}
|
|
557
557
|
populateYearsWithMonths() {
|
|
558
|
-
const e = this.getDays(),
|
|
559
|
-
for (const r in
|
|
558
|
+
const e = this.getDays(), n = Array.from(new Set(e.map((r) => r.format("YYYY-MM")))).map((r) => E(r)), s = j(n, (r) => r.format("YYYY")), i = [];
|
|
559
|
+
for (const r in s) {
|
|
560
560
|
const o = { year: E(), months: [] };
|
|
561
|
-
o.year = E(r), o.months =
|
|
561
|
+
o.year = E(r), o.months = s[r], i.push(o);
|
|
562
562
|
}
|
|
563
563
|
return i;
|
|
564
564
|
}
|
|
565
565
|
populateYearsWithQuarters() {
|
|
566
|
-
const e = this.getDays(),
|
|
567
|
-
for (const r in
|
|
566
|
+
const e = this.getDays(), n = Array.from(new Set(e.map((r) => r.startOf("quarter").format("YYYY-MM-DD")))).map((r) => E(r)), s = j(n, (r) => r.format("YYYY")), i = [];
|
|
567
|
+
for (const r in s) {
|
|
568
568
|
const o = { year: E(), quarters: [] };
|
|
569
|
-
o.year = E(r), o.quarters =
|
|
569
|
+
o.year = E(r), o.quarters = s[r], i.push(o);
|
|
570
570
|
}
|
|
571
571
|
return i;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
class
|
|
574
|
+
class ln {
|
|
575
575
|
schedulantProps;
|
|
576
576
|
schedulantView;
|
|
577
577
|
timelineApi;
|
|
@@ -581,36 +581,36 @@ class Jt {
|
|
|
581
581
|
milestoneApis;
|
|
582
582
|
checkpointApis;
|
|
583
583
|
generateTimelineApi(e) {
|
|
584
|
-
let
|
|
584
|
+
let n;
|
|
585
585
|
switch (e.schedulantViewType) {
|
|
586
586
|
case "Week": {
|
|
587
|
-
const
|
|
588
|
-
|
|
587
|
+
const s = e.start.startOf("week"), i = e.end.endOf("week");
|
|
588
|
+
n = new K(s, i);
|
|
589
589
|
break;
|
|
590
590
|
}
|
|
591
591
|
case "Month": {
|
|
592
|
-
const
|
|
593
|
-
|
|
592
|
+
const s = e.start.startOf("month"), i = e.end.endOf("month");
|
|
593
|
+
n = new K(s, i);
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
case "Quarter": {
|
|
597
|
-
const
|
|
598
|
-
|
|
597
|
+
const s = e.start.startOf("quarter"), i = e.end.endOf("quarter");
|
|
598
|
+
n = new K(s, i);
|
|
599
599
|
break;
|
|
600
600
|
}
|
|
601
601
|
case "Year": {
|
|
602
|
-
const
|
|
603
|
-
|
|
602
|
+
const s = e.start.startOf("year"), i = e.end.endOf("year");
|
|
603
|
+
n = new K(s, i);
|
|
604
604
|
break;
|
|
605
605
|
}
|
|
606
606
|
default:
|
|
607
|
-
|
|
607
|
+
n = new K(e.start, e.end);
|
|
608
608
|
break;
|
|
609
609
|
}
|
|
610
|
-
return
|
|
610
|
+
return n.setSpecialWorkdays(e.specialWorkdays || []), n.setCompanyHolidays(e.companyHolidays || []), n.setNationalHolidays(e.nationalHolidays || []), n;
|
|
611
611
|
}
|
|
612
|
-
constructor(e,
|
|
613
|
-
this.eventApis =
|
|
612
|
+
constructor(e, n) {
|
|
613
|
+
this.eventApis = n.events.map((s) => new nn(s)), this.milestoneApis = n.milestones?.map((s) => new rn(s)) || [], this.checkpointApis = n.checkpoints?.map((s) => new on(s)) || [], this.schedulantProps = n, this.schedulantView = e, this.timelineApi = this.generateTimelineApi(n), this.resourceApis = le.createTree(n.resources, this.eventApis, this.milestoneApis, this.checkpointApis), this.flatMapResourceApis = le.flatMapTree(this.resourceApis);
|
|
614
614
|
}
|
|
615
615
|
updateProps(e) {
|
|
616
616
|
this.schedulantProps = e;
|
|
@@ -652,13 +652,13 @@ class Jt {
|
|
|
652
652
|
return this.eventApis;
|
|
653
653
|
}
|
|
654
654
|
getEventApiById(e) {
|
|
655
|
-
return x.fromNullable(this.eventApis.find((
|
|
655
|
+
return x.fromNullable(this.eventApis.find((n) => n.getId() === e));
|
|
656
656
|
}
|
|
657
657
|
getResourceApis() {
|
|
658
658
|
return this.resourceApis;
|
|
659
659
|
}
|
|
660
660
|
getResourceApiById(e) {
|
|
661
|
-
return x.fromNullable(this.resourceApis.find((
|
|
661
|
+
return x.fromNullable(this.resourceApis.find((n) => n.getId() === e));
|
|
662
662
|
}
|
|
663
663
|
getFlatMapResourceApis() {
|
|
664
664
|
return this.flatMapResourceApis;
|
|
@@ -674,13 +674,13 @@ class Jt {
|
|
|
674
674
|
return this.milestoneApis;
|
|
675
675
|
}
|
|
676
676
|
getMilestoneApiById(e) {
|
|
677
|
-
return x.fromNullable(this.milestoneApis.find((
|
|
677
|
+
return x.fromNullable(this.milestoneApis.find((n) => n.getId() === e));
|
|
678
678
|
}
|
|
679
679
|
getCheckpointApis() {
|
|
680
680
|
return this.checkpointApis;
|
|
681
681
|
}
|
|
682
682
|
getCheckpointApiById(e) {
|
|
683
|
-
return x.fromNullable(this.checkpointApis.find((
|
|
683
|
+
return x.fromNullable(this.checkpointApis.find((n) => n.getId() === e));
|
|
684
684
|
}
|
|
685
685
|
getSchedulantElRef() {
|
|
686
686
|
return this.schedulantView.getScheduleElRef();
|
|
@@ -727,6 +727,12 @@ class Jt {
|
|
|
727
727
|
onResourceLaneContextMenuClick(e) {
|
|
728
728
|
this.schedulantProps.resourceLaneContextMenuClick?.(e);
|
|
729
729
|
}
|
|
730
|
+
getResourceLaneMultiSelectContextMenuItems() {
|
|
731
|
+
return this.schedulantProps.resourceLaneMultiSelectContextMenuItems;
|
|
732
|
+
}
|
|
733
|
+
onResourceLaneMultiSelectContextMenuClick(e) {
|
|
734
|
+
this.schedulantProps.resourceLaneMultiSelectContextMenuClick?.(e);
|
|
735
|
+
}
|
|
730
736
|
resourceLabelDidMount(e) {
|
|
731
737
|
this.schedulantProps.resourceLabelDidMount?.(e);
|
|
732
738
|
}
|
|
@@ -802,230 +808,297 @@ class Jt {
|
|
|
802
808
|
getSelectionColor() {
|
|
803
809
|
return this.schedulantProps.selectionColor || "rgba(66, 133, 244, 0.08)";
|
|
804
810
|
}
|
|
811
|
+
onResourceSelect() {
|
|
812
|
+
return this.schedulantProps.onResourceSelect;
|
|
813
|
+
}
|
|
805
814
|
}
|
|
806
|
-
const
|
|
815
|
+
const an = (t, e, n) => {
|
|
807
816
|
N(() => {
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
return
|
|
811
|
-
el:
|
|
817
|
+
const s = t.current;
|
|
818
|
+
if (s)
|
|
819
|
+
return n.resourceLabelDidMount({
|
|
820
|
+
el: s,
|
|
812
821
|
label: e
|
|
813
822
|
}), () => {
|
|
814
|
-
|
|
815
|
-
el:
|
|
823
|
+
n.resourceLabelWillUnmount({
|
|
824
|
+
el: s,
|
|
816
825
|
label: e
|
|
817
826
|
});
|
|
818
827
|
};
|
|
819
|
-
}, [
|
|
820
|
-
},
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
const
|
|
826
|
-
|
|
828
|
+
}, [t, e, n]);
|
|
829
|
+
}, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(bt, { children: t ? e : n }), cn = (t, e, n) => {
|
|
830
|
+
const s = k(-1), i = C(() => He("schedulant-datagrid-head"), []), r = C(() => He("schedulant-datagrid-body"), []), o = C((u) => {
|
|
831
|
+
u.preventDefault();
|
|
832
|
+
const h = n.current;
|
|
833
|
+
if (h) {
|
|
834
|
+
const A = h.getBoundingClientRect(), p = u.clientX - A.left;
|
|
835
|
+
h.style.width = w(p), t({ type: "SET_RESOURCE_AREA_WIDTH", width: h.style.width });
|
|
827
836
|
}
|
|
828
|
-
}, [
|
|
829
|
-
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
}, [o, e]), c =
|
|
833
|
-
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
}, [o, e]),
|
|
837
|
-
|
|
838
|
-
const
|
|
839
|
-
if (g &&
|
|
840
|
-
const
|
|
841
|
-
|
|
837
|
+
}, [t, n]), l = C((u) => {
|
|
838
|
+
u.preventDefault();
|
|
839
|
+
const h = e.current;
|
|
840
|
+
h ? h.removeEventListener("mousemove", o) : console.error("scheduleEl", h);
|
|
841
|
+
}, [o, e]), c = C((u) => {
|
|
842
|
+
u.preventDefault();
|
|
843
|
+
const h = e.current;
|
|
844
|
+
h ? h.addEventListener("mousemove", o) : console.error("scheduleEl", h);
|
|
845
|
+
}, [o, e]), d = C((u) => {
|
|
846
|
+
u.preventDefault();
|
|
847
|
+
const h = s.current, A = i(), p = r(), S = A.firstElementChild, M = p.firstElementChild, g = S?.children, y = M?.children;
|
|
848
|
+
if (g && y) {
|
|
849
|
+
const v = g[h], b = y[h], T = u.clientX - v.getBoundingClientRect().left, D = u.clientX - b.getBoundingClientRect().left;
|
|
850
|
+
v.style.width = w(T), b.style.width = w(D);
|
|
842
851
|
}
|
|
843
|
-
}, [r, i,
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
}, [
|
|
848
|
-
|
|
849
|
-
const
|
|
852
|
+
}, [r, i, s]), m = C((u) => {
|
|
853
|
+
u.preventDefault(), s.current = -1;
|
|
854
|
+
const h = i(), A = r();
|
|
855
|
+
h.removeEventListener("mousemove", d), A.removeEventListener("mousemove", d);
|
|
856
|
+
}, [s, i, r, d]), f = C((u) => (h) => {
|
|
857
|
+
h.preventDefault();
|
|
858
|
+
const A = u.current?.parentElement, p = u.current?.parentElement?.parentElement;
|
|
850
859
|
if (p) {
|
|
851
|
-
let
|
|
852
|
-
|
|
853
|
-
for (let
|
|
854
|
-
y
|
|
855
|
-
const
|
|
856
|
-
|
|
860
|
+
let S = p.getElementsByTagName("td");
|
|
861
|
+
S.length === 0 && (S = p.getElementsByTagName("th"));
|
|
862
|
+
for (let y = 0; y < S.length; y++)
|
|
863
|
+
S[y] === A && (s.current = y);
|
|
864
|
+
const M = i(), g = r();
|
|
865
|
+
M.addEventListener("mousemove", d), g.addEventListener("mousemove", d);
|
|
857
866
|
} else
|
|
858
867
|
console.error("trElement", p);
|
|
859
|
-
}, [i, r,
|
|
868
|
+
}, [i, r, d, s]);
|
|
860
869
|
return {
|
|
861
870
|
datagridResizerMouseUp: l,
|
|
862
871
|
datagridResizerMouseDown: c,
|
|
863
872
|
datagridCellResizerMouseUp: m,
|
|
864
873
|
datagridCellResizerMouseDownFunc: f
|
|
865
874
|
};
|
|
866
|
-
},
|
|
875
|
+
}, dn = (t) => {
|
|
867
876
|
const e = k(null);
|
|
868
|
-
return
|
|
869
|
-
|
|
877
|
+
return an(e, t.resourceAreaColumn, t.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
|
|
878
|
+
Z,
|
|
870
879
|
{
|
|
871
|
-
disabled: !
|
|
880
|
+
disabled: !t.schedulantApi.isEnableResourceLabelContextMenu(),
|
|
872
881
|
destroyOnHidden: !0,
|
|
873
882
|
trigger: ["contextMenu"],
|
|
874
883
|
menu: {
|
|
875
|
-
items:
|
|
876
|
-
onClick: (
|
|
877
|
-
const { key:
|
|
878
|
-
|
|
879
|
-
key:
|
|
884
|
+
items: t.schedulantApi.getResourceLabelContextMenuItems(),
|
|
885
|
+
onClick: (n) => {
|
|
886
|
+
const { key: s, keyPath: i, domEvent: r } = n;
|
|
887
|
+
t.schedulantApi.onResourceLabelContextMenuClick({
|
|
888
|
+
key: s,
|
|
880
889
|
keyPath: i,
|
|
881
890
|
domEvent: r,
|
|
882
|
-
label:
|
|
891
|
+
label: t.resourceAreaColumn
|
|
883
892
|
});
|
|
884
893
|
}
|
|
885
894
|
},
|
|
886
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ I("div", { className: "schedulant-datagrid-cell-frame", ref: e, children: [
|
|
887
896
|
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ a(
|
|
888
897
|
"span",
|
|
889
898
|
{
|
|
890
899
|
className: "schedulant-datagrid-cell-main",
|
|
891
|
-
children:
|
|
900
|
+
children: t.resourceAreaColumn.headerContent
|
|
892
901
|
}
|
|
893
902
|
) }),
|
|
894
|
-
/* @__PURE__ */ a(
|
|
903
|
+
/* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a(
|
|
895
904
|
"div",
|
|
896
905
|
{
|
|
897
906
|
className: "schedulant-datagrid-cell-resizer",
|
|
898
|
-
onMouseUp:
|
|
899
|
-
onMouseDown:
|
|
907
|
+
onMouseUp: t.cellResizerMouseUp,
|
|
908
|
+
onMouseDown: t.cellResizerMouseDownFunc(e)
|
|
900
909
|
}
|
|
901
910
|
) })
|
|
902
911
|
] })
|
|
903
912
|
}
|
|
904
913
|
) });
|
|
905
|
-
},
|
|
914
|
+
}, un = (t, e, n, s) => {
|
|
906
915
|
N(() => {
|
|
907
|
-
const i =
|
|
916
|
+
const i = t.current;
|
|
908
917
|
if (i)
|
|
909
|
-
return
|
|
918
|
+
return n.resourceLaneDidMount({
|
|
910
919
|
el: i,
|
|
911
|
-
schedulantApi:
|
|
912
|
-
resourceApi:
|
|
920
|
+
schedulantApi: n,
|
|
921
|
+
resourceApi: s,
|
|
913
922
|
label: e
|
|
914
923
|
}), () => {
|
|
915
|
-
|
|
924
|
+
n.resourceLaneWillUnmount({
|
|
916
925
|
el: i,
|
|
917
|
-
schedulantApi:
|
|
918
|
-
resourceApi:
|
|
926
|
+
schedulantApi: n,
|
|
927
|
+
resourceApi: s,
|
|
919
928
|
label: e
|
|
920
929
|
});
|
|
921
930
|
};
|
|
922
|
-
}, [
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
931
|
+
}, [t, e, n, s]);
|
|
932
|
+
}, hn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
933
|
+
"svg",
|
|
934
|
+
{
|
|
935
|
+
className: "milestone-icon",
|
|
936
|
+
viewBox: "0 0 1024 1024",
|
|
937
|
+
version: "1.1",
|
|
938
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
939
|
+
width: `${w(t.width)}`,
|
|
940
|
+
height: `${w(t.height)}`,
|
|
941
|
+
children: /* @__PURE__ */ a(
|
|
942
|
+
"path",
|
|
943
|
+
{
|
|
944
|
+
d: "M156 64v896l356-280 356 280V64H156z m511.8 556.4L512 538.5l-155.7 81.9L386 447 260 324.2l174.1-25.3L512 141.1l77.9 157.8L764 324.2 638 447l29.8 173.4z",
|
|
945
|
+
fill: t.color
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
}
|
|
949
|
+
), ...t }), L = /* @__PURE__ */ new Set();
|
|
950
|
+
let G = null;
|
|
951
|
+
function Re() {
|
|
952
|
+
document.querySelectorAll(".schedulant-resource-selected").forEach((t) => t.classList.remove("schedulant-resource-selected"));
|
|
953
|
+
for (const t of L)
|
|
954
|
+
document.querySelectorAll(`[data-resource-id="${t}"].schedulant-resource`).forEach((e) => e.classList.add("schedulant-resource-selected"));
|
|
955
|
+
}
|
|
956
|
+
function ke(t) {
|
|
957
|
+
t?.(Array.from(L));
|
|
927
958
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
959
|
+
function ft() {
|
|
960
|
+
return L;
|
|
930
961
|
}
|
|
931
|
-
function
|
|
932
|
-
|
|
962
|
+
function Te(t) {
|
|
963
|
+
L.size !== 0 && (L.clear(), G = null, Re(), ke(t));
|
|
933
964
|
}
|
|
934
|
-
function
|
|
935
|
-
|
|
936
|
-
if (t) {
|
|
937
|
-
const n = t.getAttribute("data-resource-id");
|
|
938
|
-
n && rn(n);
|
|
939
|
-
} else
|
|
940
|
-
at();
|
|
965
|
+
function mn(t, e) {
|
|
966
|
+
L.clear(), L.add(t), G = t, Re(), ke(e);
|
|
941
967
|
}
|
|
942
|
-
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
968
|
+
function gn(t, e, n) {
|
|
969
|
+
const i = t.target.closest("[data-resource-id]");
|
|
970
|
+
if (!i) {
|
|
971
|
+
Te(n);
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
const r = i.getAttribute("data-resource-id");
|
|
975
|
+
if (!r) {
|
|
976
|
+
Te(n);
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
if (t.button === 2 && L.has(r))
|
|
980
|
+
return;
|
|
981
|
+
const o = t.ctrlKey || t.metaKey;
|
|
982
|
+
if (t.shiftKey && G) {
|
|
983
|
+
const c = e.indexOf(G), d = e.indexOf(r);
|
|
984
|
+
if (c !== -1 && d !== -1) {
|
|
985
|
+
const m = Math.min(c, d), f = Math.max(c, d);
|
|
986
|
+
o || L.clear();
|
|
987
|
+
for (let u = m; u <= f; u++)
|
|
988
|
+
L.add(e[u]);
|
|
989
|
+
}
|
|
990
|
+
} else o ? (L.has(r) ? L.delete(r) : L.add(r), G = r) : (L.clear(), L.add(r), G = r);
|
|
991
|
+
Re(), ke(n);
|
|
992
|
+
}
|
|
993
|
+
function fn(t, e, n) {
|
|
994
|
+
const s = ft();
|
|
995
|
+
return s.size > 1 && s.has(e.getId()) ? {
|
|
996
|
+
items: t.getResourceLaneMultiSelectContextMenuItems(),
|
|
997
|
+
onClick: (r) => {
|
|
998
|
+
t.onResourceLaneMultiSelectContextMenuClick({
|
|
999
|
+
key: r.key,
|
|
1000
|
+
keyPath: r.keyPath,
|
|
1001
|
+
domEvent: r.domEvent,
|
|
1002
|
+
selectedResourceIds: Array.from(s),
|
|
1003
|
+
schedulantApi: t,
|
|
1004
|
+
label: n
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
} : {
|
|
1008
|
+
items: t.getResourceLaneContextMenuItems(),
|
|
1009
|
+
onClick: (r) => {
|
|
1010
|
+
t.onResourceLaneContextMenuClick({
|
|
1011
|
+
key: r.key,
|
|
1012
|
+
keyPath: r.keyPath,
|
|
1013
|
+
domEvent: r.domEvent,
|
|
1014
|
+
schedulantApi: t,
|
|
1015
|
+
resourceApi: e,
|
|
1016
|
+
label: n
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
const pn = (t) => {
|
|
1022
|
+
const { dispatch: e } = De(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, v) => {
|
|
1023
|
+
const b = v.getResource();
|
|
1024
|
+
if (Object.keys(b).includes(y)) {
|
|
1025
|
+
const O = b[y];
|
|
1026
|
+
if (typeof O == "string")
|
|
1027
|
+
return O;
|
|
949
1028
|
} else {
|
|
950
|
-
const
|
|
951
|
-
if (typeof
|
|
952
|
-
return
|
|
1029
|
+
const O = b.extendedProps?.[y];
|
|
1030
|
+
if (typeof O == "string" || typeof O == "number")
|
|
1031
|
+
return O;
|
|
953
1032
|
}
|
|
954
1033
|
return "";
|
|
955
1034
|
}, []);
|
|
956
|
-
|
|
957
|
-
const o =
|
|
1035
|
+
un(n, t.resourceAreaColumn, t.schedulantApi, t.resourceApi);
|
|
1036
|
+
const o = t.resourceApi.getId(), l = !t.isDraggable || !t.showPlusSquare, { attributes: c, listeners: d, setNodeRef: m, isDragging: f } = Lt({
|
|
958
1037
|
id: o,
|
|
959
1038
|
disabled: l,
|
|
960
1039
|
transition: null
|
|
961
|
-
}),
|
|
962
|
-
const
|
|
963
|
-
return
|
|
964
|
-
}
|
|
1040
|
+
}), u = t.overId === o && t.activeId !== o, h = () => {
|
|
1041
|
+
const y = ["schedulant-datagrid-cell", "schedulant-resource"];
|
|
1042
|
+
return ft().has(o) && y.push("schedulant-resource-selected"), t.isDraggable && f && y.push("schedulant-resource-dragging"), t.isDraggable && u && t.dropPosition && y.push(`schedulant-resource-drop-${t.dropPosition}`), y.join(" ");
|
|
1043
|
+
}, [A, p] = re(!1), [S, M] = re({}), g = C((y) => {
|
|
1044
|
+
y && M(fn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
|
|
1045
|
+
}, [t.schedulantApi, t.resourceApi, t.resourceAreaColumn]);
|
|
965
1046
|
return /* @__PURE__ */ a(
|
|
966
1047
|
"td",
|
|
967
1048
|
{
|
|
968
1049
|
ref: m,
|
|
969
|
-
"data-resource-id":
|
|
970
|
-
className:
|
|
971
|
-
...l ? {} : { ...c, ...
|
|
1050
|
+
"data-resource-id": t.resourceApi.getId(),
|
|
1051
|
+
className: h(),
|
|
1052
|
+
...l ? {} : { ...c, ...d },
|
|
972
1053
|
children: /* @__PURE__ */ a(
|
|
973
|
-
|
|
1054
|
+
Z,
|
|
974
1055
|
{
|
|
975
|
-
disabled: !
|
|
1056
|
+
disabled: !t.schedulantApi.isEnableResourceLaneContextMenu(),
|
|
976
1057
|
destroyOnHidden: !0,
|
|
977
1058
|
trigger: ["contextMenu"],
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
s.schedulantApi.onResourceLaneContextMenuClick({
|
|
983
|
-
key: p,
|
|
984
|
-
keyPath: y,
|
|
985
|
-
domEvent: b,
|
|
986
|
-
schedulantApi: s.schedulantApi,
|
|
987
|
-
resourceApi: s.resourceApi,
|
|
988
|
-
label: s.resourceAreaColumn
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
},
|
|
992
|
-
children: /* @__PURE__ */ O(
|
|
1059
|
+
open: A,
|
|
1060
|
+
onOpenChange: g,
|
|
1061
|
+
menu: S,
|
|
1062
|
+
children: /* @__PURE__ */ I(
|
|
993
1063
|
"div",
|
|
994
1064
|
{
|
|
995
1065
|
className: "schedulant-datagrid-cell-frame",
|
|
996
1066
|
style: { height: w(i) },
|
|
997
|
-
ref:
|
|
1067
|
+
ref: n,
|
|
998
1068
|
children: [
|
|
999
|
-
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */
|
|
1000
|
-
|
|
1069
|
+
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ I(It, { size: "small", children: [
|
|
1070
|
+
t.showPlusSquare && /* @__PURE__ */ I(
|
|
1001
1071
|
"span",
|
|
1002
1072
|
{
|
|
1003
1073
|
className: "schedulant-datagrid-expander schedulant-datagrid-expander-placeholder",
|
|
1004
1074
|
children: [
|
|
1005
|
-
|
|
1006
|
-
/* @__PURE__ */ a("span", { className: "schedulant-icon", children:
|
|
1007
|
-
|
|
1075
|
+
t.showIndentation && Array.from({ length: t.resourceApi.getDepth() }, (y, v) => /* @__PURE__ */ a("span", { className: "schedulant-icon" }, v + 1)),
|
|
1076
|
+
/* @__PURE__ */ a("span", { className: "schedulant-icon", children: t.collapseIds.some((y) => y === t.resourceApi.getId()) ? /* @__PURE__ */ a(
|
|
1077
|
+
Ot,
|
|
1008
1078
|
{
|
|
1009
1079
|
onClick: () => e({
|
|
1010
1080
|
type: "EXPAND_RESOURCE",
|
|
1011
|
-
id:
|
|
1081
|
+
id: t.resourceApi.getId()
|
|
1012
1082
|
})
|
|
1013
1083
|
}
|
|
1014
|
-
) :
|
|
1015
|
-
|
|
1084
|
+
) : t.resourceApi.getChildren().length > 0 ? /* @__PURE__ */ a(
|
|
1085
|
+
Pt,
|
|
1016
1086
|
{
|
|
1017
1087
|
onClick: () => e({
|
|
1018
1088
|
type: "COLLAPSE_RESOURCE",
|
|
1019
|
-
id:
|
|
1089
|
+
id: t.resourceApi.getId()
|
|
1020
1090
|
})
|
|
1021
1091
|
}
|
|
1022
1092
|
) : null })
|
|
1023
1093
|
]
|
|
1024
1094
|
}
|
|
1025
1095
|
),
|
|
1026
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ I("div", { className: "schedulant-datagrid-cell-main", children: [
|
|
1097
|
+
r(t.resourceAreaColumn.field, t.resourceApi),
|
|
1098
|
+
t.showPlusSquare && t.resourceApi.getMilestoneApis().length > 0 && /* @__PURE__ */ a("span", { className: "schedulant-milestone-indicator", children: /* @__PURE__ */ a(hn, { width: 14, height: 14, color: "#91003c" }) })
|
|
1099
|
+
] })
|
|
1027
1100
|
] }) }),
|
|
1028
|
-
/* @__PURE__ */ a(
|
|
1101
|
+
/* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
|
|
1029
1102
|
]
|
|
1030
1103
|
}
|
|
1031
1104
|
)
|
|
@@ -1033,17 +1106,17 @@ const an = (s) => {
|
|
|
1033
1106
|
)
|
|
1034
1107
|
}
|
|
1035
1108
|
);
|
|
1036
|
-
},
|
|
1037
|
-
const
|
|
1109
|
+
}, yn = (t) => /* @__PURE__ */ a("colgroup", { children: t.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Zt } }, e.field)) }), vn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), Sn = (t, e, n) => {
|
|
1110
|
+
const s = n.getStart(), i = n.getEnd(), r = i.isBefore(E(), "day"), o = s.isAfter(E(), "day"), l = s.isSameOrBefore(E(), "day") && (i.isAfter(E(), "day") || i.isSame(E(), "day"));
|
|
1038
1111
|
return N(() => {
|
|
1039
|
-
const c =
|
|
1112
|
+
const c = t.current;
|
|
1040
1113
|
if (c)
|
|
1041
1114
|
return e.eventDidMount({
|
|
1042
1115
|
el: c,
|
|
1043
1116
|
isPast: r,
|
|
1044
1117
|
isFuture: o,
|
|
1045
1118
|
isProcess: l,
|
|
1046
|
-
eventApi:
|
|
1119
|
+
eventApi: n,
|
|
1047
1120
|
schedulantApi: e
|
|
1048
1121
|
}), () => {
|
|
1049
1122
|
e.eventWillUnmount({
|
|
@@ -1051,434 +1124,434 @@ const an = (s) => {
|
|
|
1051
1124
|
isPast: r,
|
|
1052
1125
|
isFuture: o,
|
|
1053
1126
|
isProcess: l,
|
|
1054
|
-
eventApi:
|
|
1127
|
+
eventApi: n,
|
|
1055
1128
|
schedulantApi: e
|
|
1056
1129
|
});
|
|
1057
1130
|
};
|
|
1058
|
-
}, [
|
|
1131
|
+
}, [t, e, n, r, o, l]), { isPast: r, isFuture: o, isProcess: l };
|
|
1059
1132
|
};
|
|
1060
|
-
var
|
|
1061
|
-
function
|
|
1062
|
-
return
|
|
1133
|
+
var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1134
|
+
function An(t) {
|
|
1135
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1063
1136
|
}
|
|
1064
|
-
var
|
|
1065
|
-
function
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1068
|
-
function
|
|
1069
|
-
var
|
|
1070
|
-
return e != null && (
|
|
1071
|
-
}
|
|
1072
|
-
return
|
|
1137
|
+
var ue, Fe;
|
|
1138
|
+
function xe() {
|
|
1139
|
+
if (Fe) return ue;
|
|
1140
|
+
Fe = 1;
|
|
1141
|
+
function t(e) {
|
|
1142
|
+
var n = typeof e;
|
|
1143
|
+
return e != null && (n == "object" || n == "function");
|
|
1144
|
+
}
|
|
1145
|
+
return ue = t, ue;
|
|
1073
1146
|
}
|
|
1074
|
-
var
|
|
1075
|
-
function
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1078
|
-
var
|
|
1079
|
-
return
|
|
1147
|
+
var he, Be;
|
|
1148
|
+
function Mn() {
|
|
1149
|
+
if (Be) return he;
|
|
1150
|
+
Be = 1;
|
|
1151
|
+
var t = typeof se == "object" && se && se.Object === Object && se;
|
|
1152
|
+
return he = t, he;
|
|
1080
1153
|
}
|
|
1081
|
-
var
|
|
1082
|
-
function
|
|
1083
|
-
if (
|
|
1084
|
-
|
|
1085
|
-
var
|
|
1086
|
-
return
|
|
1154
|
+
var me, qe;
|
|
1155
|
+
function pt() {
|
|
1156
|
+
if (qe) return me;
|
|
1157
|
+
qe = 1;
|
|
1158
|
+
var t = Mn(), e = typeof self == "object" && self && self.Object === Object && self, n = t || e || Function("return this")();
|
|
1159
|
+
return me = n, me;
|
|
1087
1160
|
}
|
|
1088
|
-
var
|
|
1089
|
-
function
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1092
|
-
var
|
|
1093
|
-
return
|
|
1161
|
+
var ge, Ue;
|
|
1162
|
+
function bn() {
|
|
1163
|
+
if (Ue) return ge;
|
|
1164
|
+
Ue = 1;
|
|
1165
|
+
var t = pt(), e = function() {
|
|
1166
|
+
return t.Date.now();
|
|
1094
1167
|
};
|
|
1095
|
-
return
|
|
1168
|
+
return ge = e, ge;
|
|
1096
1169
|
}
|
|
1097
|
-
var
|
|
1098
|
-
function
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
1101
|
-
var
|
|
1102
|
-
function e(
|
|
1103
|
-
for (var
|
|
1170
|
+
var fe, je;
|
|
1171
|
+
function wn() {
|
|
1172
|
+
if (je) return fe;
|
|
1173
|
+
je = 1;
|
|
1174
|
+
var t = /\s/;
|
|
1175
|
+
function e(n) {
|
|
1176
|
+
for (var s = n.length; s-- && t.test(n.charAt(s)); )
|
|
1104
1177
|
;
|
|
1105
|
-
return
|
|
1178
|
+
return s;
|
|
1106
1179
|
}
|
|
1107
|
-
return
|
|
1180
|
+
return fe = e, fe;
|
|
1108
1181
|
}
|
|
1109
|
-
var
|
|
1110
|
-
function
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1115
|
-
return
|
|
1182
|
+
var pe, $e;
|
|
1183
|
+
function En() {
|
|
1184
|
+
if ($e) return pe;
|
|
1185
|
+
$e = 1;
|
|
1186
|
+
var t = wn(), e = /^\s+/;
|
|
1187
|
+
function n(s) {
|
|
1188
|
+
return s && s.slice(0, t(s) + 1).replace(e, "");
|
|
1116
1189
|
}
|
|
1117
|
-
return
|
|
1190
|
+
return pe = n, pe;
|
|
1118
1191
|
}
|
|
1119
|
-
var
|
|
1120
|
-
function
|
|
1121
|
-
if (
|
|
1122
|
-
|
|
1123
|
-
var
|
|
1124
|
-
return
|
|
1192
|
+
var ye, Ge;
|
|
1193
|
+
function yt() {
|
|
1194
|
+
if (Ge) return ye;
|
|
1195
|
+
Ge = 1;
|
|
1196
|
+
var t = pt(), e = t.Symbol;
|
|
1197
|
+
return ye = e, ye;
|
|
1125
1198
|
}
|
|
1126
|
-
var
|
|
1127
|
-
function
|
|
1128
|
-
if (
|
|
1129
|
-
|
|
1130
|
-
var
|
|
1199
|
+
var ve, Xe;
|
|
1200
|
+
function Cn() {
|
|
1201
|
+
if (Xe) return ve;
|
|
1202
|
+
Xe = 1;
|
|
1203
|
+
var t = yt(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
|
|
1131
1204
|
function r(o) {
|
|
1132
|
-
var l =
|
|
1205
|
+
var l = n.call(o, i), c = o[i];
|
|
1133
1206
|
try {
|
|
1134
1207
|
o[i] = void 0;
|
|
1135
|
-
var
|
|
1208
|
+
var d = !0;
|
|
1136
1209
|
} catch {
|
|
1137
1210
|
}
|
|
1138
|
-
var m =
|
|
1139
|
-
return
|
|
1211
|
+
var m = s.call(o);
|
|
1212
|
+
return d && (l ? o[i] = c : delete o[i]), m;
|
|
1140
1213
|
}
|
|
1141
|
-
return
|
|
1214
|
+
return ve = r, ve;
|
|
1142
1215
|
}
|
|
1143
|
-
var
|
|
1144
|
-
function
|
|
1145
|
-
if (
|
|
1146
|
-
|
|
1147
|
-
var
|
|
1148
|
-
function
|
|
1149
|
-
return e.call(
|
|
1216
|
+
var Se, Qe;
|
|
1217
|
+
function Tn() {
|
|
1218
|
+
if (Qe) return Se;
|
|
1219
|
+
Qe = 1;
|
|
1220
|
+
var t = Object.prototype, e = t.toString;
|
|
1221
|
+
function n(s) {
|
|
1222
|
+
return e.call(s);
|
|
1150
1223
|
}
|
|
1151
|
-
return
|
|
1224
|
+
return Se = n, Se;
|
|
1152
1225
|
}
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1155
|
-
if (
|
|
1156
|
-
|
|
1157
|
-
var
|
|
1226
|
+
var Ae, Ke;
|
|
1227
|
+
function Dn() {
|
|
1228
|
+
if (Ke) return Ae;
|
|
1229
|
+
Ke = 1;
|
|
1230
|
+
var t = yt(), e = Cn(), n = Tn(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
|
|
1158
1231
|
function o(l) {
|
|
1159
|
-
return l == null ? l === void 0 ? i :
|
|
1232
|
+
return l == null ? l === void 0 ? i : s : r && r in Object(l) ? e(l) : n(l);
|
|
1160
1233
|
}
|
|
1161
|
-
return
|
|
1234
|
+
return Ae = o, Ae;
|
|
1162
1235
|
}
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1167
|
-
function
|
|
1236
|
+
var Me, Ze;
|
|
1237
|
+
function Rn() {
|
|
1238
|
+
if (Ze) return Me;
|
|
1239
|
+
Ze = 1;
|
|
1240
|
+
function t(e) {
|
|
1168
1241
|
return e != null && typeof e == "object";
|
|
1169
1242
|
}
|
|
1170
|
-
return
|
|
1243
|
+
return Me = t, Me;
|
|
1171
1244
|
}
|
|
1172
|
-
var
|
|
1173
|
-
function
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1176
|
-
var
|
|
1177
|
-
function
|
|
1178
|
-
return typeof i == "symbol" || e(i) &&
|
|
1179
|
-
}
|
|
1180
|
-
return
|
|
1245
|
+
var be, Je;
|
|
1246
|
+
function kn() {
|
|
1247
|
+
if (Je) return be;
|
|
1248
|
+
Je = 1;
|
|
1249
|
+
var t = Dn(), e = Rn(), n = "[object Symbol]";
|
|
1250
|
+
function s(i) {
|
|
1251
|
+
return typeof i == "symbol" || e(i) && t(i) == n;
|
|
1252
|
+
}
|
|
1253
|
+
return be = s, be;
|
|
1181
1254
|
}
|
|
1182
|
-
var
|
|
1183
|
-
function
|
|
1184
|
-
if (
|
|
1185
|
-
|
|
1186
|
-
var
|
|
1187
|
-
function c(
|
|
1188
|
-
if (typeof
|
|
1189
|
-
return
|
|
1190
|
-
if (
|
|
1191
|
-
return
|
|
1192
|
-
if (e(
|
|
1193
|
-
var m = typeof
|
|
1194
|
-
|
|
1255
|
+
var we, et;
|
|
1256
|
+
function xn() {
|
|
1257
|
+
if (et) return we;
|
|
1258
|
+
et = 1;
|
|
1259
|
+
var t = En(), e = xe(), n = kn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
|
|
1260
|
+
function c(d) {
|
|
1261
|
+
if (typeof d == "number")
|
|
1262
|
+
return d;
|
|
1263
|
+
if (n(d))
|
|
1264
|
+
return s;
|
|
1265
|
+
if (e(d)) {
|
|
1266
|
+
var m = typeof d.valueOf == "function" ? d.valueOf() : d;
|
|
1267
|
+
d = e(m) ? m + "" : m;
|
|
1195
1268
|
}
|
|
1196
|
-
if (typeof
|
|
1197
|
-
return
|
|
1198
|
-
|
|
1199
|
-
var f = r.test(
|
|
1200
|
-
return f || o.test(
|
|
1269
|
+
if (typeof d != "string")
|
|
1270
|
+
return d === 0 ? d : +d;
|
|
1271
|
+
d = t(d);
|
|
1272
|
+
var f = r.test(d);
|
|
1273
|
+
return f || o.test(d) ? l(d.slice(2), f ? 2 : 8) : i.test(d) ? s : +d;
|
|
1201
1274
|
}
|
|
1202
|
-
return
|
|
1275
|
+
return we = c, we;
|
|
1203
1276
|
}
|
|
1204
|
-
var
|
|
1205
|
-
function
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1208
|
-
var
|
|
1209
|
-
function o(l, c,
|
|
1210
|
-
var m, f,
|
|
1277
|
+
var Ee, tt;
|
|
1278
|
+
function In() {
|
|
1279
|
+
if (tt) return Ee;
|
|
1280
|
+
tt = 1;
|
|
1281
|
+
var t = xe(), e = bn(), n = xn(), s = "Expected a function", i = Math.max, r = Math.min;
|
|
1282
|
+
function o(l, c, d) {
|
|
1283
|
+
var m, f, u, h, A, p, S = 0, M = !1, g = !1, y = !0;
|
|
1211
1284
|
if (typeof l != "function")
|
|
1212
|
-
throw new TypeError(
|
|
1213
|
-
c =
|
|
1214
|
-
function
|
|
1215
|
-
var
|
|
1216
|
-
return m = f = void 0,
|
|
1285
|
+
throw new TypeError(s);
|
|
1286
|
+
c = n(c) || 0, t(d) && (M = !!d.leading, g = "maxWait" in d, u = g ? i(n(d.maxWait) || 0, c) : u, y = "trailing" in d ? !!d.trailing : y);
|
|
1287
|
+
function v(R) {
|
|
1288
|
+
var V = m, q = f;
|
|
1289
|
+
return m = f = void 0, S = R, h = l.apply(q, V), h;
|
|
1217
1290
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return
|
|
1291
|
+
function b(R) {
|
|
1292
|
+
return S = R, A = setTimeout(O, c), M ? v(R) : h;
|
|
1220
1293
|
}
|
|
1221
|
-
function
|
|
1222
|
-
var
|
|
1223
|
-
return g ? r(
|
|
1294
|
+
function T(R) {
|
|
1295
|
+
var V = R - p, q = R - S, Q = c - V;
|
|
1296
|
+
return g ? r(Q, u - q) : Q;
|
|
1224
1297
|
}
|
|
1225
1298
|
function D(R) {
|
|
1226
|
-
var
|
|
1227
|
-
return p === void 0 ||
|
|
1299
|
+
var V = R - p, q = R - S;
|
|
1300
|
+
return p === void 0 || V >= c || V < 0 || g && q >= u;
|
|
1228
1301
|
}
|
|
1229
|
-
function
|
|
1302
|
+
function O() {
|
|
1230
1303
|
var R = e();
|
|
1231
1304
|
if (D(R))
|
|
1232
|
-
return
|
|
1233
|
-
|
|
1305
|
+
return P(R);
|
|
1306
|
+
A = setTimeout(O, T(R));
|
|
1234
1307
|
}
|
|
1235
|
-
function
|
|
1236
|
-
return
|
|
1308
|
+
function P(R) {
|
|
1309
|
+
return A = void 0, y && m ? v(R) : (m = f = void 0, h);
|
|
1237
1310
|
}
|
|
1238
|
-
function
|
|
1239
|
-
|
|
1311
|
+
function Y() {
|
|
1312
|
+
A !== void 0 && clearTimeout(A), S = 0, m = p = f = A = void 0;
|
|
1240
1313
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1314
|
+
function z() {
|
|
1315
|
+
return A === void 0 ? h : P(e());
|
|
1243
1316
|
}
|
|
1244
|
-
function
|
|
1245
|
-
var R = e(),
|
|
1246
|
-
if (m = arguments, f = this, p = R,
|
|
1247
|
-
if (
|
|
1248
|
-
return
|
|
1317
|
+
function _() {
|
|
1318
|
+
var R = e(), V = D(R);
|
|
1319
|
+
if (m = arguments, f = this, p = R, V) {
|
|
1320
|
+
if (A === void 0)
|
|
1321
|
+
return b(p);
|
|
1249
1322
|
if (g)
|
|
1250
|
-
return clearTimeout(
|
|
1323
|
+
return clearTimeout(A), A = setTimeout(O, c), v(p);
|
|
1251
1324
|
}
|
|
1252
|
-
return
|
|
1325
|
+
return A === void 0 && (A = setTimeout(O, c)), h;
|
|
1253
1326
|
}
|
|
1254
|
-
return
|
|
1327
|
+
return _.cancel = Y, _.flush = z, _;
|
|
1255
1328
|
}
|
|
1256
|
-
return
|
|
1329
|
+
return Ee = o, Ee;
|
|
1257
1330
|
}
|
|
1258
|
-
var
|
|
1259
|
-
function
|
|
1260
|
-
if (
|
|
1261
|
-
|
|
1262
|
-
var
|
|
1263
|
-
function
|
|
1331
|
+
var Ce, nt;
|
|
1332
|
+
function On() {
|
|
1333
|
+
if (nt) return Ce;
|
|
1334
|
+
nt = 1;
|
|
1335
|
+
var t = In(), e = xe(), n = "Expected a function";
|
|
1336
|
+
function s(i, r, o) {
|
|
1264
1337
|
var l = !0, c = !0;
|
|
1265
1338
|
if (typeof i != "function")
|
|
1266
|
-
throw new TypeError(
|
|
1267
|
-
return e(o) && (l = "leading" in o ? !!o.leading : l, c = "trailing" in o ? !!o.trailing : c),
|
|
1339
|
+
throw new TypeError(n);
|
|
1340
|
+
return e(o) && (l = "leading" in o ? !!o.leading : l, c = "trailing" in o ? !!o.trailing : c), t(i, r, {
|
|
1268
1341
|
leading: l,
|
|
1269
1342
|
maxWait: r,
|
|
1270
1343
|
trailing: c
|
|
1271
1344
|
});
|
|
1272
1345
|
}
|
|
1273
|
-
return
|
|
1346
|
+
return Ce = s, Ce;
|
|
1274
1347
|
}
|
|
1275
|
-
var
|
|
1276
|
-
const
|
|
1277
|
-
const e =
|
|
1278
|
-
const
|
|
1279
|
-
return { moveSlots:
|
|
1280
|
-
}, [
|
|
1281
|
-
const
|
|
1348
|
+
var Pn = On();
|
|
1349
|
+
const vt = /* @__PURE__ */ An(Pn), Ln = (t) => {
|
|
1350
|
+
const e = F(() => "schedulant-timeline-event-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = k("none"), l = C((g) => {
|
|
1351
|
+
const b = t.schedulantApi.getScheduleView().getTimelineView(), T = g - n.current, D = t.timelineWidth, O = b.getTotalSlots(), P = Math.round(T / D * O), Y = P / O * D;
|
|
1352
|
+
return { moveSlots: P, distance: Y, deltaX: T };
|
|
1353
|
+
}, [t]), c = C((g) => {
|
|
1354
|
+
const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left, b = g.style.right, T = y.calculateLaneHeight(t.resourceApi), D = document.createElement("div");
|
|
1282
1355
|
D.className = e, Object.assign(D.style, {
|
|
1283
1356
|
position: "absolute",
|
|
1284
1357
|
zIndex: 1,
|
|
1285
|
-
left:
|
|
1286
|
-
right:
|
|
1287
|
-
height: w(
|
|
1288
|
-
backgroundColor:
|
|
1358
|
+
left: v,
|
|
1359
|
+
right: b,
|
|
1360
|
+
height: w(T),
|
|
1361
|
+
backgroundColor: t.schedulantApi.getDragHintColor()
|
|
1289
1362
|
}), g.parentNode?.insertBefore(D, g);
|
|
1290
|
-
}, [
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1293
|
-
}, [e]), m =
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
const
|
|
1297
|
-
switch (
|
|
1363
|
+
}, [t, e]), d = C((g) => {
|
|
1364
|
+
const y = g.previousElementSibling;
|
|
1365
|
+
y?.className === e && g.parentElement?.removeChild(y);
|
|
1366
|
+
}, [e]), m = C((g, y) => {
|
|
1367
|
+
const v = g.previousElementSibling;
|
|
1368
|
+
if (v && v.className === e) {
|
|
1369
|
+
const b = o.current, { distance: T } = l(y);
|
|
1370
|
+
switch (b) {
|
|
1298
1371
|
case "press_event": {
|
|
1299
|
-
|
|
1372
|
+
v.style.left = w(Math.max(s.current + T, 0)), v.style.right = w(i.current - T);
|
|
1300
1373
|
break;
|
|
1301
1374
|
}
|
|
1302
1375
|
case "press_event_left": {
|
|
1303
|
-
const D = Math.max(
|
|
1304
|
-
|
|
1376
|
+
const D = Math.max(s.current + T, 0);
|
|
1377
|
+
v.style.left = w(D);
|
|
1305
1378
|
break;
|
|
1306
1379
|
}
|
|
1307
1380
|
case "press_event_right": {
|
|
1308
|
-
const D = i.current -
|
|
1309
|
-
|
|
1381
|
+
const D = i.current - T;
|
|
1382
|
+
v.style.right = w(D);
|
|
1310
1383
|
break;
|
|
1311
1384
|
}
|
|
1312
1385
|
}
|
|
1313
1386
|
}
|
|
1314
|
-
}, [l, e]), f =
|
|
1315
|
-
const
|
|
1316
|
-
switch (
|
|
1387
|
+
}, [l, e]), f = C((g, y) => {
|
|
1388
|
+
const v = t.eventApi, b = t.schedulantApi, T = o.current, { moveSlots: D, distance: O } = l(y);
|
|
1389
|
+
switch (T) {
|
|
1317
1390
|
case "press_event": {
|
|
1318
|
-
g.style.left = w(Math.max(
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1391
|
+
g.style.left = w(Math.max(s.current + O, 0)), g.style.right = w(i.current - O);
|
|
1392
|
+
const P = v.getStart().add(D, "day"), Y = v.getEnd().add(D, "day");
|
|
1393
|
+
b.eventMove({
|
|
1321
1394
|
el: g,
|
|
1322
|
-
startDate:
|
|
1323
|
-
endDate:
|
|
1324
|
-
eventApi:
|
|
1325
|
-
schedulantApi:
|
|
1395
|
+
startDate: P,
|
|
1396
|
+
endDate: Y,
|
|
1397
|
+
eventApi: v,
|
|
1398
|
+
schedulantApi: b
|
|
1326
1399
|
});
|
|
1327
1400
|
break;
|
|
1328
1401
|
}
|
|
1329
1402
|
case "press_event_left": {
|
|
1330
|
-
const
|
|
1331
|
-
g.style.left = w(
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1403
|
+
const P = Math.max(s.current + O, 0);
|
|
1404
|
+
g.style.left = w(P);
|
|
1405
|
+
const Y = v.getStart().add(D, "day");
|
|
1406
|
+
b.eventResizeStart({
|
|
1334
1407
|
el: g,
|
|
1335
|
-
date:
|
|
1336
|
-
eventApi:
|
|
1337
|
-
schedulantApi:
|
|
1408
|
+
date: Y,
|
|
1409
|
+
eventApi: v,
|
|
1410
|
+
schedulantApi: b
|
|
1338
1411
|
});
|
|
1339
1412
|
break;
|
|
1340
1413
|
}
|
|
1341
1414
|
case "press_event_right": {
|
|
1342
|
-
const
|
|
1343
|
-
g.style.right = w(
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1415
|
+
const P = i.current - O;
|
|
1416
|
+
g.style.right = w(P);
|
|
1417
|
+
const Y = v.getEnd().add(D, "day");
|
|
1418
|
+
b.eventResizeEnd({
|
|
1346
1419
|
el: g,
|
|
1347
|
-
date:
|
|
1348
|
-
eventApi:
|
|
1349
|
-
schedulantApi:
|
|
1420
|
+
date: Y,
|
|
1421
|
+
eventApi: v,
|
|
1422
|
+
schedulantApi: b
|
|
1350
1423
|
});
|
|
1351
1424
|
break;
|
|
1352
1425
|
}
|
|
1353
1426
|
}
|
|
1354
|
-
}, [
|
|
1427
|
+
}, [t, l]), u = C((g) => {
|
|
1355
1428
|
g.preventDefault();
|
|
1356
|
-
const
|
|
1357
|
-
if (
|
|
1358
|
-
const { deltaX:
|
|
1429
|
+
const y = r.current, v = t.timelineEventHarnessRef.current;
|
|
1430
|
+
if (y && v) {
|
|
1431
|
+
const { deltaX: b } = l(g.clientX), T = s.current + b, D = i.current - b;
|
|
1359
1432
|
switch (o.current) {
|
|
1360
1433
|
case "press_event":
|
|
1361
|
-
|
|
1434
|
+
v.style.left = w(T), v.style.right = w(D);
|
|
1362
1435
|
break;
|
|
1363
1436
|
case "press_event_left":
|
|
1364
|
-
|
|
1437
|
+
v.style.left = w(T);
|
|
1365
1438
|
break;
|
|
1366
1439
|
case "press_event_right":
|
|
1367
|
-
|
|
1440
|
+
v.style.right = w(D);
|
|
1368
1441
|
break;
|
|
1369
1442
|
}
|
|
1370
|
-
m(
|
|
1443
|
+
m(v, g.clientX);
|
|
1371
1444
|
}
|
|
1372
|
-
}, [
|
|
1373
|
-
() =>
|
|
1374
|
-
[
|
|
1375
|
-
),
|
|
1445
|
+
}, [t.timelineEventHarnessRef, m, l]), h = F(
|
|
1446
|
+
() => vt(u, gt),
|
|
1447
|
+
[u]
|
|
1448
|
+
), A = C((g, y) => {
|
|
1376
1449
|
g.preventDefault();
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
}, [
|
|
1380
|
-
|
|
1381
|
-
}, [
|
|
1382
|
-
|
|
1383
|
-
}, [
|
|
1384
|
-
|
|
1385
|
-
}, [
|
|
1450
|
+
const v = t.schedulantApi.getSchedulantElRef().current, b = t.timelineEventHarnessRef.current;
|
|
1451
|
+
b && v ? (r.current = !0, o.current = y, n.current = g.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), c(b), v.addEventListener("mousemove", h)) : (console.error("scheduleEl", v), console.error("timelineEventHarness", b));
|
|
1452
|
+
}, [t.schedulantApi, t.timelineEventHarnessRef, c, h]), p = C((g) => {
|
|
1453
|
+
A(g, "press_event");
|
|
1454
|
+
}, [A]), S = C((g) => {
|
|
1455
|
+
A(g, "press_event_left");
|
|
1456
|
+
}, [A]), M = C((g) => {
|
|
1457
|
+
A(g, "press_event_right");
|
|
1458
|
+
}, [A]);
|
|
1386
1459
|
return N(() => {
|
|
1387
|
-
const g =
|
|
1388
|
-
if (
|
|
1389
|
-
const
|
|
1390
|
-
if (
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1460
|
+
const g = t.timelineEventHarnessRef.current, y = t.schedulantApi.getSchedulantElRef().current;
|
|
1461
|
+
if (y && g) {
|
|
1462
|
+
const v = g.parentElement?.parentElement;
|
|
1463
|
+
if (v) {
|
|
1464
|
+
const b = (T) => {
|
|
1465
|
+
T.preventDefault(), r.current && !v.contains(T.relatedTarget) && (d(g), f(g, T.clientX), y.removeEventListener("mousemove", h), r.current = !1, o.current = "none");
|
|
1393
1466
|
};
|
|
1394
|
-
return
|
|
1395
|
-
|
|
1467
|
+
return v.addEventListener("mouseup", b), v.addEventListener("mouseout", b), () => {
|
|
1468
|
+
v.removeEventListener("mouseup", b), v.removeEventListener("mouseout", b), y.removeEventListener("mousemove", h), h.cancel();
|
|
1396
1469
|
};
|
|
1397
1470
|
}
|
|
1398
1471
|
}
|
|
1399
|
-
}, [
|
|
1400
|
-
},
|
|
1472
|
+
}, [h, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown: M };
|
|
1473
|
+
}, st = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1401
1474
|
"svg",
|
|
1402
1475
|
{
|
|
1403
1476
|
className: "triangle-left-icon",
|
|
1404
1477
|
viewBox: "0 0 1024 1024",
|
|
1405
1478
|
version: "1.1",
|
|
1406
1479
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1407
|
-
width: `${w(
|
|
1408
|
-
height: `${w(
|
|
1480
|
+
width: `${w(t.width)}`,
|
|
1481
|
+
height: `${w(t.height)}`,
|
|
1409
1482
|
children: /* @__PURE__ */ a(
|
|
1410
1483
|
"path",
|
|
1411
1484
|
{
|
|
1412
1485
|
d: "M765.533 115.367c0-46.168-61.65-75.692-97.005-40.324L271.127 472.426c-22.791 22.791-22.791 56.687 0 79.477l397.4 397.396c34.469 34.481 97.006 7.598 97.006-39.74V115.367z",
|
|
1413
|
-
fill:
|
|
1486
|
+
fill: t.color
|
|
1414
1487
|
}
|
|
1415
1488
|
)
|
|
1416
1489
|
}
|
|
1417
|
-
), ...
|
|
1490
|
+
), ...t }), it = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1418
1491
|
"svg",
|
|
1419
1492
|
{
|
|
1420
1493
|
className: "drag-icon",
|
|
1421
1494
|
viewBox: "0 0 1024 1024",
|
|
1422
1495
|
version: "1.1",
|
|
1423
1496
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1424
|
-
width: `${w(
|
|
1425
|
-
height: `${w(
|
|
1426
|
-
children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill:
|
|
1497
|
+
width: `${w(t.width)}`,
|
|
1498
|
+
height: `${w(t.height)}`,
|
|
1499
|
+
children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill: t.color })
|
|
1427
1500
|
}
|
|
1428
|
-
), ...
|
|
1501
|
+
), ...t }), rt = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1429
1502
|
"svg",
|
|
1430
1503
|
{
|
|
1431
1504
|
className: "triangle-left-icon",
|
|
1432
1505
|
viewBox: "0 0 1024 1024",
|
|
1433
1506
|
version: "1.1",
|
|
1434
1507
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1435
|
-
width: `${w(
|
|
1436
|
-
height: `${w(
|
|
1508
|
+
width: `${w(t.width)}`,
|
|
1509
|
+
height: `${w(t.height)}`,
|
|
1437
1510
|
children: /* @__PURE__ */ a(
|
|
1438
1511
|
"path",
|
|
1439
1512
|
{
|
|
1440
1513
|
d: "M258.467 115.367c0-46.168 61.65-75.692 97.005-40.324l397.396 397.396c22.791 22.791 22.791 56.687 0 79.477L355.472 989.779c-34.469 34.481-97.006 7.598-97.006-39.74V115.367z",
|
|
1441
|
-
fill:
|
|
1514
|
+
fill: t.color
|
|
1442
1515
|
}
|
|
1443
1516
|
)
|
|
1444
1517
|
}
|
|
1445
|
-
), ...
|
|
1446
|
-
const e = k(null),
|
|
1447
|
-
timelineEventHarnessRef:
|
|
1448
|
-
timelineWidth:
|
|
1449
|
-
eventApi:
|
|
1450
|
-
resourceApi:
|
|
1451
|
-
schedulantApi:
|
|
1518
|
+
), ...t }), Nn = ae((t) => {
|
|
1519
|
+
const e = k(null), n = k(null), s = t.schedulantApi.getTimelineApi(), i = t.schedulantApi.getScheduleView().getTimelineView(), r = t.eventApi.getTextColor().getOrElse("white"), o = t.eventApi.getBorderColor().getOrElse(t.eventApi.getColor()), l = t.eventApi.getBackgroundColor().getOrElse(t.eventApi.getColor()), c = i.calculateLaneHeight(t.resourceApi), d = i.calculateEventHeight(), m = (c - d) / 2 - 1, { isPast: f, isFuture: u, isProcess: h } = Sn(e, t.schedulantApi, t.eventApi), { handleMouseDown: A, leftHandleMouseDown: p, rightHandleMouseDown: S } = Ln({
|
|
1520
|
+
timelineEventHarnessRef: n,
|
|
1521
|
+
timelineWidth: t.timelineWidth,
|
|
1522
|
+
eventApi: t.eventApi,
|
|
1523
|
+
resourceApi: t.resourceApi,
|
|
1524
|
+
schedulantApi: t.schedulantApi
|
|
1452
1525
|
});
|
|
1453
|
-
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-event-harness", ref:
|
|
1526
|
+
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-event-harness", ref: n, style: {
|
|
1454
1527
|
top: w(m),
|
|
1455
|
-
height: w(
|
|
1456
|
-
lineHeight: w(
|
|
1457
|
-
left: w(
|
|
1458
|
-
right: w(
|
|
1528
|
+
height: w(d),
|
|
1529
|
+
lineHeight: w(d),
|
|
1530
|
+
left: w(t.position.left),
|
|
1531
|
+
right: w(t.position.right)
|
|
1459
1532
|
}, children: /* @__PURE__ */ a(
|
|
1460
|
-
|
|
1533
|
+
Z,
|
|
1461
1534
|
{
|
|
1462
|
-
disabled: !
|
|
1535
|
+
disabled: !t.schedulantApi.isEnableEventContextMenu(),
|
|
1463
1536
|
destroyOnHidden: !0,
|
|
1464
1537
|
trigger: ["contextMenu"],
|
|
1465
1538
|
menu: {
|
|
1466
|
-
items:
|
|
1467
|
-
onClick: (
|
|
1468
|
-
const { key: g, keyPath:
|
|
1469
|
-
|
|
1539
|
+
items: t.schedulantApi.getEventContextMenuItems(),
|
|
1540
|
+
onClick: (M) => {
|
|
1541
|
+
const { key: g, keyPath: y, domEvent: v } = M;
|
|
1542
|
+
t.schedulantApi.onEventContextMenuClick({
|
|
1470
1543
|
key: g,
|
|
1471
|
-
keyPath:
|
|
1472
|
-
domEvent:
|
|
1544
|
+
keyPath: y,
|
|
1545
|
+
domEvent: v,
|
|
1473
1546
|
isPast: f,
|
|
1474
|
-
isFuture:
|
|
1475
|
-
isProcess:
|
|
1476
|
-
eventApi:
|
|
1477
|
-
schedulantApi:
|
|
1547
|
+
isFuture: u,
|
|
1548
|
+
isProcess: h,
|
|
1549
|
+
eventApi: t.eventApi,
|
|
1550
|
+
schedulantApi: t.schedulantApi
|
|
1478
1551
|
});
|
|
1479
1552
|
}
|
|
1480
1553
|
},
|
|
1481
|
-
children: /* @__PURE__ */
|
|
1554
|
+
children: /* @__PURE__ */ I(
|
|
1482
1555
|
"div",
|
|
1483
1556
|
{
|
|
1484
1557
|
className: "schedulant-timeline-event",
|
|
@@ -1486,29 +1559,29 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1486
1559
|
ref: e,
|
|
1487
1560
|
children: [
|
|
1488
1561
|
/* @__PURE__ */ a(
|
|
1489
|
-
|
|
1562
|
+
H,
|
|
1490
1563
|
{
|
|
1491
|
-
condition:
|
|
1564
|
+
condition: t.schedulantApi.isEditable(),
|
|
1492
1565
|
fallback: /* @__PURE__ */ a(
|
|
1493
|
-
|
|
1566
|
+
H,
|
|
1494
1567
|
{
|
|
1495
|
-
condition:
|
|
1496
|
-
fallback: /* @__PURE__ */ a("div", { style: { width:
|
|
1497
|
-
children: /* @__PURE__ */ a(
|
|
1568
|
+
condition: t.eventApi.getStart().isBefore(s.getStart()),
|
|
1569
|
+
fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
|
|
1570
|
+
children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
|
|
1498
1571
|
}
|
|
1499
1572
|
),
|
|
1500
1573
|
children: /* @__PURE__ */ a(
|
|
1501
|
-
|
|
1574
|
+
H,
|
|
1502
1575
|
{
|
|
1503
|
-
condition: !
|
|
1504
|
-
fallback: /* @__PURE__ */ a(
|
|
1576
|
+
condition: !t.eventApi.getStart().isBefore(s.getStart()),
|
|
1577
|
+
fallback: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" }),
|
|
1505
1578
|
children: /* @__PURE__ */ a(
|
|
1506
1579
|
"div",
|
|
1507
1580
|
{
|
|
1508
1581
|
className: "schedulant-event-resize-handle",
|
|
1509
1582
|
onMouseDown: p,
|
|
1510
|
-
style: { width:
|
|
1511
|
-
children: /* @__PURE__ */ a(
|
|
1583
|
+
style: { width: W, height: d, cursor: "ew-resize" },
|
|
1584
|
+
children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
|
|
1512
1585
|
}
|
|
1513
1586
|
)
|
|
1514
1587
|
}
|
|
@@ -1516,25 +1589,25 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1516
1589
|
}
|
|
1517
1590
|
),
|
|
1518
1591
|
/* @__PURE__ */ a(
|
|
1519
|
-
|
|
1592
|
+
H,
|
|
1520
1593
|
{
|
|
1521
|
-
condition:
|
|
1594
|
+
condition: t.schedulantApi.isEditable() && !t.eventApi.getStart().isBefore(s.getStart()) && t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
|
|
1522
1595
|
fallback: /* @__PURE__ */ a(
|
|
1523
1596
|
"div",
|
|
1524
1597
|
{
|
|
1525
1598
|
className: "schedulant-event-main",
|
|
1526
|
-
style: { color: r, width: `calc(100% - ${
|
|
1599
|
+
style: { color: r, width: `calc(100% - ${W * 2}px)` },
|
|
1527
1600
|
children: /* @__PURE__ */ a(
|
|
1528
|
-
|
|
1601
|
+
H,
|
|
1529
1602
|
{
|
|
1530
|
-
condition:
|
|
1531
|
-
fallback: /* @__PURE__ */ a("span", { children:
|
|
1532
|
-
children:
|
|
1603
|
+
condition: t.eventApi.getUrl().isDefined(),
|
|
1604
|
+
fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
|
|
1605
|
+
children: t.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
|
|
1533
1606
|
"a",
|
|
1534
1607
|
{
|
|
1535
|
-
href:
|
|
1608
|
+
href: t.eventApi.getUrl().get(),
|
|
1536
1609
|
style: { color: "inherit" },
|
|
1537
|
-
children:
|
|
1610
|
+
children: t.eventApi.getTitle()
|
|
1538
1611
|
}
|
|
1539
1612
|
)
|
|
1540
1613
|
}
|
|
@@ -1545,19 +1618,19 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1545
1618
|
"div",
|
|
1546
1619
|
{
|
|
1547
1620
|
className: "schedulant-event-main",
|
|
1548
|
-
style: { color: r, width: `calc(100% - ${
|
|
1549
|
-
onMouseDown:
|
|
1621
|
+
style: { color: r, width: `calc(100% - ${W * 2}px)`, cursor: "grab" },
|
|
1622
|
+
onMouseDown: A,
|
|
1550
1623
|
children: /* @__PURE__ */ a(
|
|
1551
|
-
|
|
1624
|
+
H,
|
|
1552
1625
|
{
|
|
1553
|
-
condition:
|
|
1554
|
-
fallback: /* @__PURE__ */ a("span", { children:
|
|
1555
|
-
children:
|
|
1626
|
+
condition: t.eventApi.getUrl().isDefined(),
|
|
1627
|
+
fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
|
|
1628
|
+
children: t.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
|
|
1556
1629
|
"a",
|
|
1557
1630
|
{
|
|
1558
|
-
href:
|
|
1631
|
+
href: t.eventApi.getUrl().get(),
|
|
1559
1632
|
style: { color: "inherit" },
|
|
1560
|
-
children:
|
|
1633
|
+
children: t.eventApi.getTitle()
|
|
1561
1634
|
}
|
|
1562
1635
|
)
|
|
1563
1636
|
}
|
|
@@ -1567,29 +1640,29 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1567
1640
|
}
|
|
1568
1641
|
),
|
|
1569
1642
|
/* @__PURE__ */ a(
|
|
1570
|
-
|
|
1643
|
+
H,
|
|
1571
1644
|
{
|
|
1572
|
-
condition:
|
|
1645
|
+
condition: t.schedulantApi.isEditable(),
|
|
1573
1646
|
fallback: /* @__PURE__ */ a(
|
|
1574
|
-
|
|
1647
|
+
H,
|
|
1575
1648
|
{
|
|
1576
|
-
condition:
|
|
1577
|
-
fallback: /* @__PURE__ */ a("div", { style: { width:
|
|
1578
|
-
children: /* @__PURE__ */ a(
|
|
1649
|
+
condition: t.eventApi.getEnd().isAfter(s.getEnd()),
|
|
1650
|
+
fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
|
|
1651
|
+
children: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" })
|
|
1579
1652
|
}
|
|
1580
1653
|
),
|
|
1581
1654
|
children: /* @__PURE__ */ a(
|
|
1582
|
-
|
|
1655
|
+
H,
|
|
1583
1656
|
{
|
|
1584
|
-
condition:
|
|
1585
|
-
fallback: /* @__PURE__ */ a(
|
|
1657
|
+
condition: t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
|
|
1658
|
+
fallback: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" }),
|
|
1586
1659
|
children: /* @__PURE__ */ a(
|
|
1587
1660
|
"div",
|
|
1588
1661
|
{
|
|
1589
1662
|
className: "schedulant-event-resize-handle",
|
|
1590
|
-
onMouseDown:
|
|
1591
|
-
style: { width:
|
|
1592
|
-
children: /* @__PURE__ */ a(
|
|
1663
|
+
onMouseDown: S,
|
|
1664
|
+
style: { width: W, height: d, cursor: "ew-resize" },
|
|
1665
|
+
children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
|
|
1593
1666
|
}
|
|
1594
1667
|
)
|
|
1595
1668
|
}
|
|
@@ -1601,17 +1674,17 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1601
1674
|
)
|
|
1602
1675
|
}
|
|
1603
1676
|
) });
|
|
1604
|
-
}),
|
|
1605
|
-
const
|
|
1677
|
+
}), Yn = (t, e, n) => {
|
|
1678
|
+
const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
|
|
1606
1679
|
return N(() => {
|
|
1607
|
-
const l =
|
|
1680
|
+
const l = t.current;
|
|
1608
1681
|
if (l)
|
|
1609
1682
|
return e.milestoneDidMount({
|
|
1610
1683
|
el: l,
|
|
1611
1684
|
isPast: i,
|
|
1612
1685
|
isFuture: r,
|
|
1613
1686
|
isProcess: o,
|
|
1614
|
-
milestoneApi:
|
|
1687
|
+
milestoneApi: n,
|
|
1615
1688
|
schedulantApi: e
|
|
1616
1689
|
}), () => {
|
|
1617
1690
|
e.milestoneWillUnmount({
|
|
@@ -1619,102 +1692,102 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1619
1692
|
isPast: i,
|
|
1620
1693
|
isFuture: r,
|
|
1621
1694
|
isProcess: o,
|
|
1622
|
-
milestoneApi:
|
|
1695
|
+
milestoneApi: n,
|
|
1623
1696
|
schedulantApi: e
|
|
1624
1697
|
});
|
|
1625
1698
|
};
|
|
1626
|
-
}, [e,
|
|
1627
|
-
},
|
|
1628
|
-
const e =
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1699
|
+
}, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
|
|
1700
|
+
}, St = (t) => {
|
|
1701
|
+
const e = F(() => "schedulant-timeline-marker-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = C((p) => {
|
|
1702
|
+
const S = p.style.left, M = p.style.right, g = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), v = g.calculateLaneHeight(y), b = document.createElement("div");
|
|
1703
|
+
b.className = e, Object.assign(b.style, {
|
|
1631
1704
|
position: "absolute",
|
|
1632
1705
|
zIndex: 1,
|
|
1633
|
-
left:
|
|
1634
|
-
right:
|
|
1635
|
-
height: w(
|
|
1636
|
-
backgroundColor:
|
|
1637
|
-
}), p.parentNode?.insertBefore(
|
|
1638
|
-
}, [
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
}, [e]), c =
|
|
1642
|
-
const g =
|
|
1706
|
+
left: S,
|
|
1707
|
+
right: M,
|
|
1708
|
+
height: w(v),
|
|
1709
|
+
backgroundColor: t.schedulantApi.getDragHintColor()
|
|
1710
|
+
}), p.parentNode?.insertBefore(b, p);
|
|
1711
|
+
}, [t, e]), l = C((p) => {
|
|
1712
|
+
const S = p.previousElementSibling;
|
|
1713
|
+
S?.className === e && p.parentElement?.removeChild(S);
|
|
1714
|
+
}, [e]), c = C((p) => {
|
|
1715
|
+
const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth, b = g.getTotalSlots(), T = Math.round(y / v * b), D = T / b * t.timelineWidth;
|
|
1643
1716
|
return {
|
|
1644
|
-
moveSlots:
|
|
1717
|
+
moveSlots: T,
|
|
1645
1718
|
distance: D,
|
|
1646
|
-
deltaX:
|
|
1647
|
-
totalWidth:
|
|
1648
|
-
totalSlots:
|
|
1719
|
+
deltaX: y,
|
|
1720
|
+
totalWidth: v,
|
|
1721
|
+
totalSlots: b
|
|
1649
1722
|
};
|
|
1650
|
-
}, [
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1653
|
-
const { distance: g } = c(
|
|
1654
|
-
|
|
1723
|
+
}, [t]), d = C((p, S) => {
|
|
1724
|
+
const M = p.previousElementSibling;
|
|
1725
|
+
if (M && M.className === e) {
|
|
1726
|
+
const { distance: g } = c(S);
|
|
1727
|
+
M.style.left = w(Math.max(s.current + g, 0)), M.style.right = w(i.current - g);
|
|
1655
1728
|
}
|
|
1656
|
-
}, [e, c]), m =
|
|
1657
|
-
const { moveSlots:
|
|
1658
|
-
if (p.style.left = w(Math.max(
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1729
|
+
}, [e, c]), m = C((p, S) => {
|
|
1730
|
+
const { moveSlots: M, distance: g } = c(S);
|
|
1731
|
+
if (p.style.left = w(Math.max(s.current + g, 0)), p.style.right = w(i.current - g), t.milestoneApi) {
|
|
1732
|
+
const y = t.milestoneApi.getTime().add(M, "day");
|
|
1733
|
+
t.schedulantApi.milestoneMove({
|
|
1661
1734
|
el: p,
|
|
1662
|
-
date:
|
|
1663
|
-
schedulantApi:
|
|
1664
|
-
milestoneApi:
|
|
1735
|
+
date: y,
|
|
1736
|
+
schedulantApi: t.schedulantApi,
|
|
1737
|
+
milestoneApi: t.milestoneApi
|
|
1665
1738
|
});
|
|
1666
|
-
} else if (
|
|
1667
|
-
const
|
|
1668
|
-
|
|
1739
|
+
} else if (t.checkpointApi) {
|
|
1740
|
+
const y = t.checkpointApi.getTime().add(M, "day");
|
|
1741
|
+
t.schedulantApi.checkpointMove({
|
|
1669
1742
|
el: p,
|
|
1670
|
-
date:
|
|
1671
|
-
schedulantApi:
|
|
1672
|
-
checkpointApi:
|
|
1743
|
+
date: y,
|
|
1744
|
+
schedulantApi: t.schedulantApi,
|
|
1745
|
+
checkpointApi: t.checkpointApi
|
|
1673
1746
|
});
|
|
1674
1747
|
}
|
|
1675
|
-
|
|
1676
|
-
}, [
|
|
1748
|
+
n.current = 0;
|
|
1749
|
+
}, [t, c]), f = C((p) => {
|
|
1677
1750
|
p.preventDefault();
|
|
1678
|
-
const
|
|
1679
|
-
if (
|
|
1680
|
-
const g = p.clientX -
|
|
1681
|
-
|
|
1751
|
+
const S = t.markerRef.current, M = r.current;
|
|
1752
|
+
if (S && M) {
|
|
1753
|
+
const g = p.clientX - n.current, y = s.current + g, v = i.current - g;
|
|
1754
|
+
S.style.left = w(y), S.style.right = w(v), d(S, p.clientX);
|
|
1682
1755
|
}
|
|
1683
|
-
}, [
|
|
1684
|
-
() =>
|
|
1756
|
+
}, [t.markerRef, d]), u = F(
|
|
1757
|
+
() => vt(f, gt),
|
|
1685
1758
|
[f]
|
|
1686
|
-
),
|
|
1759
|
+
), h = C((p) => {
|
|
1687
1760
|
p.preventDefault();
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1690
|
-
}, [
|
|
1761
|
+
const S = t.markerRef.current, M = r.current, g = t.schedulantApi.getSchedulantElRef().current;
|
|
1762
|
+
M && g && S && (l(S), m(S, p.clientX), g.removeEventListener("mousemove", u), r.current = !1);
|
|
1763
|
+
}, [u, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
|
|
1691
1764
|
p.preventDefault();
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1694
|
-
}, [o,
|
|
1765
|
+
const S = t.schedulantApi.getSchedulantElRef().current, M = t.markerRef.current;
|
|
1766
|
+
S && M && (r.current = !0, n.current = p.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), o(M), S.addEventListener("mousemove", u));
|
|
1767
|
+
}, [o, u, t.markerRef, t.schedulantApi]);
|
|
1695
1768
|
return N(() => {
|
|
1696
|
-
const p =
|
|
1697
|
-
if (p &&
|
|
1698
|
-
const
|
|
1699
|
-
if (
|
|
1700
|
-
const g = (
|
|
1701
|
-
|
|
1769
|
+
const p = t.schedulantApi.getSchedulantElRef().current, S = t.markerRef.current;
|
|
1770
|
+
if (p && S) {
|
|
1771
|
+
const M = S.parentElement?.parentElement;
|
|
1772
|
+
if (M) {
|
|
1773
|
+
const g = (y) => {
|
|
1774
|
+
y.preventDefault(), r.current && !M.contains(y.relatedTarget) && (l(S), m(S, y.clientX), p.removeEventListener("mousemove", u), r.current = !1);
|
|
1702
1775
|
};
|
|
1703
|
-
return
|
|
1704
|
-
|
|
1776
|
+
return M.addEventListener("mouseup", g), M.addEventListener("mouseout", g), () => {
|
|
1777
|
+
M.removeEventListener("mouseup", g), M.removeEventListener("mouseout", g), p.removeEventListener("mousemove", u), u.cancel();
|
|
1705
1778
|
};
|
|
1706
1779
|
}
|
|
1707
1780
|
}
|
|
1708
|
-
}, [
|
|
1709
|
-
},
|
|
1781
|
+
}, [u, t, l, m]), { handleMouseUp: h, handleMouseDown: A };
|
|
1782
|
+
}, _n = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
|
|
1710
1783
|
"svg",
|
|
1711
1784
|
{
|
|
1712
1785
|
className: "flag-icon",
|
|
1713
1786
|
viewBox: "0 0 1024 1024",
|
|
1714
1787
|
version: "1.1",
|
|
1715
1788
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1716
|
-
width: `${w(
|
|
1717
|
-
height: `${w(
|
|
1789
|
+
width: `${w(t.width)}`,
|
|
1790
|
+
height: `${w(t.height)}`,
|
|
1718
1791
|
children: [
|
|
1719
1792
|
/* @__PURE__ */ a(
|
|
1720
1793
|
"path",
|
|
@@ -1727,60 +1800,60 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1727
1800
|
"path",
|
|
1728
1801
|
{
|
|
1729
1802
|
d: "M199.36 829.983s4.357 17.054-28.283 22.814c-29.64 5.228-34.954-12.974-34.954-12.974L90.217 544.696l54.62-44.933 54.523 330.22z m599.465-788.87l-68.562 408.275-8.54 5.693c-3.24 2.191-80.363 53.56-171.305 35.773-34.002-6.656-65.438-17.274-95.713-27.683-40.192-13.655-78.085-26.548-113.603-26.548-124.979 0-195.563 62.516-196.265 63.145l-54.62 44.933L18.036 80.973c0-9.84 9.666-21.366 17.546-29.384C68.739 17.853 220.414 0.563 335.383 0.563c71.563 0 120.694 36.603 160.185 65.966 23.357 17.331 45.373 33.69 65.31 37.74 59.91 11.965 155.792-24.346 187.659-39.424l50.288-23.731z",
|
|
1730
|
-
fill:
|
|
1803
|
+
fill: t.color
|
|
1731
1804
|
}
|
|
1732
1805
|
)
|
|
1733
1806
|
]
|
|
1734
1807
|
}
|
|
1735
|
-
), ...
|
|
1736
|
-
const e = k(null),
|
|
1737
|
-
markerRef:
|
|
1738
|
-
timelineWidth:
|
|
1739
|
-
schedulantApi:
|
|
1740
|
-
milestoneApi:
|
|
1808
|
+
), ...t }), Wn = ae((t) => {
|
|
1809
|
+
const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.milestoneApi.getStatus(), r = t.milestoneApi.getColor().getOrElse(i === "Success" ? "green" : i === "Failure" ? "red" : "yellow"), l = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.milestoneApi.getResourceApi()), c = l * Xt * -1, { isPast: d, isFuture: m, isProcess: f } = Yn(e, t.schedulantApi, t.milestoneApi), { handleMouseUp: u, handleMouseDown: h } = St({
|
|
1810
|
+
markerRef: n,
|
|
1811
|
+
timelineWidth: t.timelineWidth,
|
|
1812
|
+
schedulantApi: t.schedulantApi,
|
|
1813
|
+
milestoneApi: t.milestoneApi
|
|
1741
1814
|
});
|
|
1742
1815
|
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone-harness", style: {
|
|
1743
1816
|
top: w(c),
|
|
1744
1817
|
height: w(l),
|
|
1745
1818
|
lineHeight: w(l),
|
|
1746
|
-
left: w(
|
|
1747
|
-
right: w(
|
|
1748
|
-
}, onMouseUp:
|
|
1749
|
-
|
|
1819
|
+
left: w(t.position.left),
|
|
1820
|
+
right: w(t.position.right)
|
|
1821
|
+
}, onMouseUp: s ? u : void 0, onMouseDown: s ? h : void 0, ref: n, children: /* @__PURE__ */ a(
|
|
1822
|
+
Z,
|
|
1750
1823
|
{
|
|
1751
|
-
disabled: !
|
|
1824
|
+
disabled: !t.schedulantApi.isEnableMilestoneContextMenu(),
|
|
1752
1825
|
destroyOnHidden: !0,
|
|
1753
1826
|
trigger: ["contextMenu"],
|
|
1754
1827
|
menu: {
|
|
1755
|
-
items:
|
|
1756
|
-
onClick: (
|
|
1757
|
-
const { key: p, keyPath:
|
|
1758
|
-
|
|
1828
|
+
items: t.schedulantApi.getMilestoneContextMenuItems(),
|
|
1829
|
+
onClick: (A) => {
|
|
1830
|
+
const { key: p, keyPath: S, domEvent: M } = A;
|
|
1831
|
+
t.schedulantApi.onMilestoneContextMenuClick({
|
|
1759
1832
|
key: p,
|
|
1760
|
-
keyPath:
|
|
1761
|
-
domEvent:
|
|
1762
|
-
isPast:
|
|
1833
|
+
keyPath: S,
|
|
1834
|
+
domEvent: M,
|
|
1835
|
+
isPast: d,
|
|
1763
1836
|
isFuture: m,
|
|
1764
1837
|
isProcess: f,
|
|
1765
|
-
milestoneApi:
|
|
1766
|
-
schedulantApi:
|
|
1838
|
+
milestoneApi: t.milestoneApi,
|
|
1839
|
+
schedulantApi: t.schedulantApi
|
|
1767
1840
|
});
|
|
1768
1841
|
}
|
|
1769
1842
|
},
|
|
1770
|
-
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(
|
|
1843
|
+
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(_n, { width: l * Ve, height: l * Ve, color: r }) }) })
|
|
1771
1844
|
}
|
|
1772
1845
|
) });
|
|
1773
|
-
}),
|
|
1774
|
-
const
|
|
1846
|
+
}), Hn = (t, e, n) => {
|
|
1847
|
+
const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
|
|
1775
1848
|
return N(() => {
|
|
1776
|
-
const l =
|
|
1849
|
+
const l = t.current;
|
|
1777
1850
|
if (l)
|
|
1778
1851
|
return e.checkpointDidMount({
|
|
1779
1852
|
el: l,
|
|
1780
1853
|
isPast: i,
|
|
1781
1854
|
isFuture: r,
|
|
1782
1855
|
isProcess: o,
|
|
1783
|
-
checkpointApi:
|
|
1856
|
+
checkpointApi: n,
|
|
1784
1857
|
schedulantApi: e
|
|
1785
1858
|
}), () => {
|
|
1786
1859
|
e.checkpointWillUnmount({
|
|
@@ -1788,20 +1861,20 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1788
1861
|
isPast: i,
|
|
1789
1862
|
isFuture: r,
|
|
1790
1863
|
isProcess: o,
|
|
1791
|
-
checkpointApi:
|
|
1864
|
+
checkpointApi: n,
|
|
1792
1865
|
schedulantApi: e
|
|
1793
1866
|
});
|
|
1794
1867
|
};
|
|
1795
|
-
}, [e,
|
|
1796
|
-
},
|
|
1868
|
+
}, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
|
|
1869
|
+
}, zn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
|
|
1797
1870
|
"svg",
|
|
1798
1871
|
{
|
|
1799
1872
|
className: "droplet-icon",
|
|
1800
1873
|
viewBox: "0 0 1024 1024",
|
|
1801
1874
|
version: "1.1",
|
|
1802
1875
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1803
|
-
width: `${w(
|
|
1804
|
-
height: `${w(
|
|
1876
|
+
width: `${w(t.width)}`,
|
|
1877
|
+
height: `${w(t.height)}`,
|
|
1805
1878
|
children: [
|
|
1806
1879
|
/* @__PURE__ */ a(
|
|
1807
1880
|
"path",
|
|
@@ -1814,22 +1887,22 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1814
1887
|
"path",
|
|
1815
1888
|
{
|
|
1816
1889
|
d: "m519.91456,697.78863l-177.9252,-204.81251a337.99847,337.99847 0 0 1 -97.70097,-204.53112a252.67817,252.67817 0 0 1 71.47021,-204.65619a288.19443,288.19443 0 0 1 408.31192,0a252.7407,252.7407 0 0 1 71.43895,204.68745a338.09227,338.09227 0 0 1 -97.70098,204.68745l-177.89393,204.59366l0,0.03126zm-4.34574,-636.10369a207.62629,207.62629 0 1 0 207.6263,207.6263a207.87641,207.87641 0 0 0 -207.6263,-207.6263z",
|
|
1817
|
-
fill:
|
|
1890
|
+
fill: t.color
|
|
1818
1891
|
}
|
|
1819
1892
|
),
|
|
1820
|
-
/* @__PURE__ */ a("path", { d: "M 517,116 A 154,154 0 1 1 517,424 A 154,154 0 1 1 517,116 Z", fill:
|
|
1893
|
+
/* @__PURE__ */ a("path", { d: "M 517,116 A 154,154 0 1 1 517,424 A 154,154 0 1 1 517,116 Z", fill: t.color })
|
|
1821
1894
|
]
|
|
1822
1895
|
}
|
|
1823
|
-
), ...
|
|
1824
|
-
const e = k(null),
|
|
1825
|
-
isPast:
|
|
1896
|
+
), ...t }), Vn = ae((t) => {
|
|
1897
|
+
const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.checkpointApi.getColor().getOrElse("black"), r = t.schedulantApi.getScheduleView().getTimelineView(), o = r.calculateLaneHeight(t.checkpointApi.getResourceApi()), l = r.calculateEventHeight(), c = (o - l) / 2 + 2, {
|
|
1898
|
+
isPast: d,
|
|
1826
1899
|
isFuture: m,
|
|
1827
1900
|
isProcess: f
|
|
1828
|
-
} =
|
|
1829
|
-
markerRef:
|
|
1830
|
-
timelineWidth:
|
|
1831
|
-
schedulantApi:
|
|
1832
|
-
checkpointApi:
|
|
1901
|
+
} = Hn(e, t.schedulantApi, t.checkpointApi), { handleMouseUp: u, handleMouseDown: h } = St({
|
|
1902
|
+
markerRef: n,
|
|
1903
|
+
timelineWidth: t.timelineWidth,
|
|
1904
|
+
schedulantApi: t.schedulantApi,
|
|
1905
|
+
checkpointApi: t.checkpointApi
|
|
1833
1906
|
});
|
|
1834
1907
|
return /* @__PURE__ */ a(
|
|
1835
1908
|
"div",
|
|
@@ -1839,41 +1912,41 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
|
|
|
1839
1912
|
top: w(c),
|
|
1840
1913
|
height: w(l),
|
|
1841
1914
|
lineHeight: w(l),
|
|
1842
|
-
left: w(
|
|
1843
|
-
right: w(
|
|
1915
|
+
left: w(t.position.left),
|
|
1916
|
+
right: w(t.position.right)
|
|
1844
1917
|
},
|
|
1845
|
-
onMouseUp:
|
|
1846
|
-
onMouseDown:
|
|
1847
|
-
ref:
|
|
1918
|
+
onMouseUp: s ? u : void 0,
|
|
1919
|
+
onMouseDown: s ? h : void 0,
|
|
1920
|
+
ref: n,
|
|
1848
1921
|
children: /* @__PURE__ */ a(
|
|
1849
|
-
|
|
1922
|
+
Z,
|
|
1850
1923
|
{
|
|
1851
|
-
disabled: !
|
|
1924
|
+
disabled: !t.schedulantApi.isEnableCheckpointContextMenu(),
|
|
1852
1925
|
destroyOnHidden: !0,
|
|
1853
1926
|
trigger: ["contextMenu"],
|
|
1854
1927
|
menu: {
|
|
1855
|
-
items:
|
|
1856
|
-
onClick: (
|
|
1857
|
-
const { key: p, keyPath:
|
|
1858
|
-
|
|
1928
|
+
items: t.schedulantApi.getCheckpointContextMenuItems(),
|
|
1929
|
+
onClick: (A) => {
|
|
1930
|
+
const { key: p, keyPath: S, domEvent: M } = A;
|
|
1931
|
+
t.schedulantApi.onCheckpointContextMenuClick({
|
|
1859
1932
|
key: p,
|
|
1860
|
-
keyPath:
|
|
1861
|
-
domEvent:
|
|
1862
|
-
isPast:
|
|
1933
|
+
keyPath: S,
|
|
1934
|
+
domEvent: M,
|
|
1935
|
+
isPast: d,
|
|
1863
1936
|
isFuture: m,
|
|
1864
1937
|
isProcess: f,
|
|
1865
|
-
checkpointApi:
|
|
1866
|
-
schedulantApi:
|
|
1938
|
+
checkpointApi: t.checkpointApi,
|
|
1939
|
+
schedulantApi: t.schedulantApi
|
|
1867
1940
|
});
|
|
1868
1941
|
}
|
|
1869
1942
|
},
|
|
1870
|
-
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(
|
|
1943
|
+
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(zn, { width: l, height: l, color: i }) }) })
|
|
1871
1944
|
}
|
|
1872
1945
|
)
|
|
1873
1946
|
}
|
|
1874
1947
|
);
|
|
1875
1948
|
});
|
|
1876
|
-
class
|
|
1949
|
+
class J {
|
|
1877
1950
|
schedulantApi;
|
|
1878
1951
|
constructor(e) {
|
|
1879
1952
|
this.schedulantApi = e;
|
|
@@ -1885,50 +1958,50 @@ class Q {
|
|
|
1885
1958
|
return this.schedulantApi.getTimelineApi();
|
|
1886
1959
|
}
|
|
1887
1960
|
renderLane() {
|
|
1888
|
-
return /* @__PURE__ */ a(
|
|
1961
|
+
return /* @__PURE__ */ a(vn, {});
|
|
1889
1962
|
}
|
|
1890
|
-
renderEvents(e,
|
|
1891
|
-
const
|
|
1892
|
-
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-events schedulant-scrollgrid-sync-inner", children: i.filter((r) => !r.getStart().isAfter(
|
|
1893
|
-
const o = this.calculatePosition(
|
|
1963
|
+
renderEvents(e, n) {
|
|
1964
|
+
const s = this.schedulantApi.getTimelineApi(), i = e.getEventApis();
|
|
1965
|
+
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-events schedulant-scrollgrid-sync-inner", children: i.filter((r) => !r.getStart().isAfter(s.getEnd()) && !r.getEnd().isBefore(s.getStart())).map((r) => {
|
|
1966
|
+
const o = this.calculatePosition(n, r.getStart(), r.getEnd());
|
|
1894
1967
|
return /* @__PURE__ */ a(
|
|
1895
|
-
|
|
1968
|
+
Nn,
|
|
1896
1969
|
{
|
|
1897
1970
|
eventApi: r,
|
|
1898
1971
|
position: o,
|
|
1899
1972
|
resourceApi: e,
|
|
1900
1973
|
schedulantApi: this.schedulantApi,
|
|
1901
|
-
timelineWidth:
|
|
1974
|
+
timelineWidth: n
|
|
1902
1975
|
},
|
|
1903
1976
|
r.getId()
|
|
1904
1977
|
);
|
|
1905
1978
|
}) });
|
|
1906
1979
|
}
|
|
1907
|
-
renderMilestones(e,
|
|
1908
|
-
const
|
|
1909
|
-
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestones schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(
|
|
1910
|
-
const o = this.calculatePosition(
|
|
1980
|
+
renderMilestones(e, n) {
|
|
1981
|
+
const s = this.schedulantApi.getTimelineApi(), i = e.getMilestoneApis();
|
|
1982
|
+
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestones schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
|
|
1983
|
+
const o = this.calculatePosition(n, r.getTime(), r.getTime());
|
|
1911
1984
|
return /* @__PURE__ */ a(
|
|
1912
|
-
|
|
1985
|
+
Wn,
|
|
1913
1986
|
{
|
|
1914
1987
|
position: o,
|
|
1915
1988
|
milestoneApi: r,
|
|
1916
|
-
timelineWidth:
|
|
1989
|
+
timelineWidth: n,
|
|
1917
1990
|
schedulantApi: this.schedulantApi
|
|
1918
1991
|
},
|
|
1919
1992
|
r.getId()
|
|
1920
1993
|
);
|
|
1921
1994
|
}) });
|
|
1922
1995
|
}
|
|
1923
|
-
renderCheckpoints(e,
|
|
1924
|
-
const
|
|
1925
|
-
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoints schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(
|
|
1926
|
-
const o = this.calculatePosition(
|
|
1996
|
+
renderCheckpoints(e, n) {
|
|
1997
|
+
const s = this.schedulantApi.getTimelineApi(), i = e.getCheckpointApis();
|
|
1998
|
+
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoints schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
|
|
1999
|
+
const o = this.calculatePosition(n, r.getTime(), r.getTime());
|
|
1927
2000
|
return /* @__PURE__ */ a(
|
|
1928
|
-
|
|
2001
|
+
Vn,
|
|
1929
2002
|
{
|
|
1930
2003
|
position: o,
|
|
1931
|
-
timelineWidth:
|
|
2004
|
+
timelineWidth: n,
|
|
1932
2005
|
checkpointApi: r,
|
|
1933
2006
|
schedulantApi: this.schedulantApi
|
|
1934
2007
|
},
|
|
@@ -1937,65 +2010,65 @@ class Q {
|
|
|
1937
2010
|
}) });
|
|
1938
2011
|
}
|
|
1939
2012
|
calculateLaneHeight(e) {
|
|
1940
|
-
const
|
|
1941
|
-
return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(
|
|
2013
|
+
const n = this.schedulantApi.getTimelineApi().getStart(), s = this.schedulantApi.getTimelineApi().getEnd();
|
|
2014
|
+
return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(n) && !r.getTime().isAfter(s)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() * mt;
|
|
1942
2015
|
}
|
|
1943
2016
|
calculateEventHeight() {
|
|
1944
|
-
return this.schedulantApi.getLineHeight() *
|
|
2017
|
+
return this.schedulantApi.getLineHeight() * Gt;
|
|
1945
2018
|
}
|
|
1946
2019
|
}
|
|
1947
|
-
const
|
|
1948
|
-
const { dates: e, minWidth:
|
|
1949
|
-
return /* @__PURE__ */ a("colgroup", { children: e.map((
|
|
1950
|
-
},
|
|
1951
|
-
const
|
|
2020
|
+
const ee = (t) => {
|
|
2021
|
+
const { dates: e, minWidth: n } = t;
|
|
2022
|
+
return /* @__PURE__ */ a("colgroup", { children: e.map((s) => /* @__PURE__ */ a("col", { style: { minWidth: n } }, s.format("YYYY-MM-DD"))) });
|
|
2023
|
+
}, Fn = (t, e, n) => {
|
|
2024
|
+
const s = n.isBefore(E(), "day"), i = n.isAfter(E(), "day"), r = n.isSame(E(), "day");
|
|
1952
2025
|
N(() => {
|
|
1953
|
-
const o =
|
|
2026
|
+
const o = t.current;
|
|
1954
2027
|
if (o)
|
|
1955
2028
|
return e.timelineSlotLaneDidMount({
|
|
1956
2029
|
el: o,
|
|
1957
|
-
isPast:
|
|
2030
|
+
isPast: s,
|
|
1958
2031
|
isFuture: i,
|
|
1959
2032
|
isProcess: r,
|
|
1960
|
-
date:
|
|
2033
|
+
date: n,
|
|
1961
2034
|
slotType: e.getSchedulantViewType(),
|
|
1962
2035
|
schedulantApi: e
|
|
1963
2036
|
}), () => {
|
|
1964
2037
|
e.timelineSlotLaneWillUnmount({
|
|
1965
2038
|
el: o,
|
|
1966
|
-
isPast:
|
|
2039
|
+
isPast: s,
|
|
1967
2040
|
isFuture: i,
|
|
1968
2041
|
isProcess: r,
|
|
1969
|
-
date:
|
|
2042
|
+
date: n,
|
|
1970
2043
|
slotType: e.getSchedulantViewType(),
|
|
1971
2044
|
schedulantApi: e
|
|
1972
2045
|
});
|
|
1973
2046
|
};
|
|
1974
|
-
}, [
|
|
1975
|
-
},
|
|
2047
|
+
}, [n, i, s, r, e, t]);
|
|
2048
|
+
}, te = ae((t) => {
|
|
1976
2049
|
const e = k(null);
|
|
1977
|
-
return
|
|
2050
|
+
return Fn(e, t.schedulantApi, t.date), /* @__PURE__ */ a(
|
|
1978
2051
|
"td",
|
|
1979
2052
|
{
|
|
1980
2053
|
ref: e,
|
|
1981
|
-
"data-date":
|
|
2054
|
+
"data-date": t.dataDate,
|
|
1982
2055
|
className: "schedulant-timeline-slot schedulant-timeline-slot-lane",
|
|
1983
|
-
children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${
|
|
2056
|
+
children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${t.classNames?.join(" ")}` })
|
|
1984
2057
|
},
|
|
1985
|
-
|
|
2058
|
+
t.date.format("YYYY-MM-DD")
|
|
1986
2059
|
);
|
|
1987
|
-
}),
|
|
1988
|
-
const r =
|
|
2060
|
+
}), Bn = (t, e, n, s, i) => {
|
|
2061
|
+
const r = n.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSame(E(), "day");
|
|
1989
2062
|
N(() => {
|
|
1990
|
-
const c =
|
|
2063
|
+
const c = t.current;
|
|
1991
2064
|
if (c)
|
|
1992
2065
|
return e.timelineSlotLabelDidMount({
|
|
1993
2066
|
el: c,
|
|
1994
2067
|
isPast: r,
|
|
1995
2068
|
isFuture: o,
|
|
1996
2069
|
isProcess: l,
|
|
1997
|
-
date:
|
|
1998
|
-
level:
|
|
2070
|
+
date: n,
|
|
2071
|
+
level: s,
|
|
1999
2072
|
timeText: i,
|
|
2000
2073
|
slotType: e.getSchedulantViewType(),
|
|
2001
2074
|
schedulantApi: e
|
|
@@ -2005,58 +2078,58 @@ const K = (s) => {
|
|
|
2005
2078
|
isPast: r,
|
|
2006
2079
|
isFuture: o,
|
|
2007
2080
|
isProcess: l,
|
|
2008
|
-
date:
|
|
2009
|
-
level:
|
|
2081
|
+
date: n,
|
|
2082
|
+
level: s,
|
|
2010
2083
|
timeText: i,
|
|
2011
2084
|
slotType: e.getSchedulantViewType(),
|
|
2012
2085
|
schedulantApi: e
|
|
2013
2086
|
});
|
|
2014
2087
|
};
|
|
2015
|
-
}, [
|
|
2016
|
-
},
|
|
2088
|
+
}, [n, o, r, l, s, e, i, t]);
|
|
2089
|
+
}, B = (t) => {
|
|
2017
2090
|
const e = k(null);
|
|
2018
|
-
return
|
|
2091
|
+
return Bn(e, t.schedulantApi, t.date, t.level, t.timeText), /* @__PURE__ */ a(
|
|
2019
2092
|
"th",
|
|
2020
2093
|
{
|
|
2021
2094
|
ref: e,
|
|
2022
|
-
colSpan:
|
|
2023
|
-
"data-date":
|
|
2095
|
+
colSpan: t.colSpan,
|
|
2096
|
+
"data-date": t.dataDate,
|
|
2024
2097
|
className: "schedulant-timeline-slot schedulant-timeline-slot-label",
|
|
2025
|
-
children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${
|
|
2098
|
+
children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${t.classNames.join(" ")}`, children: /* @__PURE__ */ a(
|
|
2026
2099
|
"span",
|
|
2027
2100
|
{
|
|
2028
|
-
title:
|
|
2101
|
+
title: t.dataDate,
|
|
2029
2102
|
className: "schedulant-timeline-slot-cushion schedulant-scrollgrid-sync-inner",
|
|
2030
|
-
children:
|
|
2103
|
+
children: t.timeText
|
|
2031
2104
|
}
|
|
2032
2105
|
) })
|
|
2033
2106
|
},
|
|
2034
|
-
|
|
2107
|
+
t.date.format("YYYY-MM-DD")
|
|
2035
2108
|
);
|
|
2036
2109
|
};
|
|
2037
|
-
class
|
|
2110
|
+
class qn extends J {
|
|
2038
2111
|
renderColgroup() {
|
|
2039
|
-
const e = this.getSchedulantApi(),
|
|
2040
|
-
return /* @__PURE__ */ a(
|
|
2112
|
+
const e = this.getSchedulantApi(), s = this.getTimelineApi().getDays(), i = e.getSlotMinWidth();
|
|
2113
|
+
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
2041
2114
|
}
|
|
2042
2115
|
renderBodySlots() {
|
|
2043
|
-
const e = this.getTimelineApi(),
|
|
2044
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2045
|
-
|
|
2116
|
+
const e = this.getTimelineApi(), n = e.getDays();
|
|
2117
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2118
|
+
te,
|
|
2046
2119
|
{
|
|
2047
|
-
date:
|
|
2048
|
-
dataDate:
|
|
2049
|
-
classNames: ["schedulant-day",
|
|
2120
|
+
date: s,
|
|
2121
|
+
dataDate: s.format("YYYY-MM-DD"),
|
|
2122
|
+
classNames: ["schedulant-day", s.isSame(E(), "day") ? "schedulant-today-body" : "", e.isHoliday(s) ? "schedulant-holiday" : ""],
|
|
2050
2123
|
schedulantApi: this.getSchedulantApi()
|
|
2051
2124
|
},
|
|
2052
|
-
|
|
2125
|
+
s.format("YYYY-MM-DD")
|
|
2053
2126
|
)) }) });
|
|
2054
2127
|
}
|
|
2055
2128
|
renderHeaderSlots() {
|
|
2056
|
-
const e = this.getTimelineApi(),
|
|
2057
|
-
return /* @__PURE__ */
|
|
2129
|
+
const e = this.getTimelineApi(), n = e.getDays(), s = e.populateMonthsWithDays(), i = e.populateYearsWithDays();
|
|
2130
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2058
2131
|
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: i.map((r) => /* @__PURE__ */ a(
|
|
2059
|
-
|
|
2132
|
+
B,
|
|
2060
2133
|
{
|
|
2061
2134
|
level: 1,
|
|
2062
2135
|
date: r.year,
|
|
@@ -2068,8 +2141,8 @@ class Yn extends Q {
|
|
|
2068
2141
|
},
|
|
2069
2142
|
r.year.year()
|
|
2070
2143
|
)) }),
|
|
2071
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2072
|
-
|
|
2144
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((r) => /* @__PURE__ */ a(
|
|
2145
|
+
B,
|
|
2073
2146
|
{
|
|
2074
2147
|
level: 2,
|
|
2075
2148
|
date: r.month,
|
|
@@ -2081,8 +2154,8 @@ class Yn extends Q {
|
|
|
2081
2154
|
},
|
|
2082
2155
|
`${r.month.format("YYYY-MM")}`
|
|
2083
2156
|
)) }),
|
|
2084
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2085
|
-
|
|
2157
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((r) => /* @__PURE__ */ a(
|
|
2158
|
+
B,
|
|
2086
2159
|
{
|
|
2087
2160
|
level: 3,
|
|
2088
2161
|
date: r,
|
|
@@ -2094,8 +2167,8 @@ class Yn extends Q {
|
|
|
2094
2167
|
},
|
|
2095
2168
|
r.format("YYYY-MM-DD")
|
|
2096
2169
|
)) }),
|
|
2097
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2098
|
-
|
|
2170
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((r) => /* @__PURE__ */ a(
|
|
2171
|
+
B,
|
|
2099
2172
|
{
|
|
2100
2173
|
level: 4,
|
|
2101
2174
|
date: r,
|
|
@@ -2112,37 +2185,37 @@ class Yn extends Q {
|
|
|
2112
2185
|
getTotalSlots() {
|
|
2113
2186
|
return this.getTimelineApi().getDays().length;
|
|
2114
2187
|
}
|
|
2115
|
-
calculatePosition(e,
|
|
2116
|
-
const i = this.getTimelineApi(), r = e / i.getDays().length, o = i.getDayPosition(
|
|
2188
|
+
calculatePosition(e, n, s) {
|
|
2189
|
+
const i = this.getTimelineApi(), r = e / i.getDays().length, o = i.getDayPosition(n.isBefore(i.getStart()) ? i.getStart() : n) * r, l = (i.getDayPosition(s.isAfter(i.getEnd()) ? i.getEnd() : s) + 1) * r * -1;
|
|
2117
2190
|
return { left: o, right: l };
|
|
2118
2191
|
}
|
|
2119
2192
|
}
|
|
2120
|
-
class
|
|
2193
|
+
class Un extends J {
|
|
2121
2194
|
getTotalSlots() {
|
|
2122
2195
|
return this.getTimelineApi().getMonths().length;
|
|
2123
2196
|
}
|
|
2124
2197
|
renderColgroup() {
|
|
2125
|
-
const e = this.getSchedulantApi(),
|
|
2126
|
-
return /* @__PURE__ */ a(
|
|
2198
|
+
const e = this.getSchedulantApi(), s = this.getTimelineApi().getMonths(), i = e.getSlotMinWidth();
|
|
2199
|
+
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
2127
2200
|
}
|
|
2128
2201
|
renderBodySlots() {
|
|
2129
|
-
const
|
|
2130
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2131
|
-
|
|
2202
|
+
const n = this.getTimelineApi().getMonths();
|
|
2203
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2204
|
+
te,
|
|
2132
2205
|
{
|
|
2133
|
-
date:
|
|
2134
|
-
dataDate:
|
|
2135
|
-
classNames: ["schedulant-month",
|
|
2206
|
+
date: s,
|
|
2207
|
+
dataDate: s.format("YYYY-MM"),
|
|
2208
|
+
classNames: ["schedulant-month", s.isSame(E(), "month") ? "schedulant-this-month-body" : ""],
|
|
2136
2209
|
schedulantApi: this.getSchedulantApi()
|
|
2137
2210
|
},
|
|
2138
|
-
|
|
2211
|
+
s.format("YYYY-MM")
|
|
2139
2212
|
)) }) });
|
|
2140
2213
|
}
|
|
2141
2214
|
renderHeaderSlots() {
|
|
2142
|
-
const e = this.getTimelineApi(),
|
|
2143
|
-
return /* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2145
|
-
|
|
2215
|
+
const e = this.getTimelineApi(), n = e.getMonths(), s = e.populateYearsWithMonths();
|
|
2216
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2217
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
|
|
2218
|
+
B,
|
|
2146
2219
|
{
|
|
2147
2220
|
level: 1,
|
|
2148
2221
|
date: i.year,
|
|
@@ -2154,8 +2227,8 @@ class _n extends Q {
|
|
|
2154
2227
|
},
|
|
2155
2228
|
i.year.year()
|
|
2156
2229
|
)) }),
|
|
2157
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2158
|
-
|
|
2230
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
|
|
2231
|
+
B,
|
|
2159
2232
|
{
|
|
2160
2233
|
level: 2,
|
|
2161
2234
|
date: i,
|
|
@@ -2169,37 +2242,37 @@ class _n extends Q {
|
|
|
2169
2242
|
)) })
|
|
2170
2243
|
] });
|
|
2171
2244
|
}
|
|
2172
|
-
calculatePosition(e,
|
|
2173
|
-
const i = this.getTimelineApi(), r = i.getMonths(), o = e / r.length, l =
|
|
2174
|
-
return { left:
|
|
2245
|
+
calculatePosition(e, n, s) {
|
|
2246
|
+
const i = this.getTimelineApi(), r = i.getMonths(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.date() - 1, m = o / l.daysInMonth(), f = i.getMonthPosition(l) * o, u = n.isSameOrBefore(i.getStart(), "day") ? f : f + d * m, h = c.daysInMonth() - c.date(), A = o / c.daysInMonth(), p = (i.getMonthPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? p + h * A : p;
|
|
2247
|
+
return { left: u, right: S };
|
|
2175
2248
|
}
|
|
2176
2249
|
}
|
|
2177
|
-
class
|
|
2250
|
+
class jn extends J {
|
|
2178
2251
|
getTotalSlots() {
|
|
2179
2252
|
return this.getTimelineApi().getQuarters().length;
|
|
2180
2253
|
}
|
|
2181
2254
|
renderColgroup() {
|
|
2182
|
-
const e = this.getSchedulantApi(),
|
|
2183
|
-
return /* @__PURE__ */ a(
|
|
2255
|
+
const e = this.getSchedulantApi(), s = this.getTimelineApi().getQuarters(), i = e.getSlotMinWidth();
|
|
2256
|
+
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
2184
2257
|
}
|
|
2185
2258
|
renderBodySlots() {
|
|
2186
|
-
const
|
|
2187
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2188
|
-
|
|
2259
|
+
const n = this.getTimelineApi().getQuarters();
|
|
2260
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2261
|
+
te,
|
|
2189
2262
|
{
|
|
2190
|
-
date:
|
|
2191
|
-
dataDate: `${
|
|
2192
|
-
classNames: ["schedulant-quarter",
|
|
2263
|
+
date: s,
|
|
2264
|
+
dataDate: `${s.year()}-Q${s.quarter()}`,
|
|
2265
|
+
classNames: ["schedulant-quarter", s.isSame(E(), "quarter") ? "schedulant-this-quarter-body" : ""],
|
|
2193
2266
|
schedulantApi: this.getSchedulantApi()
|
|
2194
2267
|
},
|
|
2195
|
-
`${
|
|
2268
|
+
`${s.year()}-Q${s.quarter()}`
|
|
2196
2269
|
)) }) });
|
|
2197
2270
|
}
|
|
2198
2271
|
renderHeaderSlots() {
|
|
2199
|
-
const e = this.getTimelineApi(),
|
|
2200
|
-
return /* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2202
|
-
|
|
2272
|
+
const e = this.getTimelineApi(), n = e.getQuarters(), s = e.populateYearsWithQuarters();
|
|
2273
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2274
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
|
|
2275
|
+
B,
|
|
2203
2276
|
{
|
|
2204
2277
|
level: 1,
|
|
2205
2278
|
date: i.year,
|
|
@@ -2211,8 +2284,8 @@ class Wn extends Q {
|
|
|
2211
2284
|
},
|
|
2212
2285
|
i.year.year()
|
|
2213
2286
|
)) }),
|
|
2214
|
-
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2215
|
-
|
|
2287
|
+
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
|
|
2288
|
+
B,
|
|
2216
2289
|
{
|
|
2217
2290
|
level: 2,
|
|
2218
2291
|
date: i,
|
|
@@ -2226,115 +2299,115 @@ class Wn extends Q {
|
|
|
2226
2299
|
)) })
|
|
2227
2300
|
] });
|
|
2228
2301
|
}
|
|
2229
|
-
calculatePosition(e,
|
|
2230
|
-
const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l =
|
|
2231
|
-
return { left:
|
|
2302
|
+
calculatePosition(e, n, s) {
|
|
2303
|
+
const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = n.diff(l.startOf("quarter"), "day"), f = o / d, u = m * f, h = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, S = c.endOf("quarter").diff(c, "day"), M = o / p, g = S * M, y = (i.getQuarterPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
|
|
2304
|
+
return { left: A, right: v };
|
|
2232
2305
|
}
|
|
2233
2306
|
}
|
|
2234
|
-
class
|
|
2307
|
+
class $n extends J {
|
|
2235
2308
|
getTotalSlots() {
|
|
2236
2309
|
return this.getTimelineApi().getWeeks().length;
|
|
2237
2310
|
}
|
|
2238
2311
|
renderColgroup() {
|
|
2239
|
-
const e = this.getSchedulantApi(),
|
|
2240
|
-
return /* @__PURE__ */ a(
|
|
2312
|
+
const e = this.getSchedulantApi(), s = this.getTimelineApi().getWeeks(), i = e.getSlotMinWidth();
|
|
2313
|
+
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
2241
2314
|
}
|
|
2242
2315
|
renderBodySlots() {
|
|
2243
|
-
const
|
|
2244
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2245
|
-
|
|
2316
|
+
const n = this.getTimelineApi().getWeeks();
|
|
2317
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2318
|
+
te,
|
|
2246
2319
|
{
|
|
2247
|
-
date:
|
|
2248
|
-
dataDate: `${
|
|
2249
|
-
classNames: ["schedulant-week",
|
|
2320
|
+
date: s,
|
|
2321
|
+
dataDate: `${s.format("YYYY-MM-DD")}`,
|
|
2322
|
+
classNames: ["schedulant-week", s.isSame(E(), "week") ? "schedulant-this-week-body" : ""],
|
|
2250
2323
|
schedulantApi: this.getSchedulantApi()
|
|
2251
2324
|
},
|
|
2252
|
-
`${
|
|
2325
|
+
`${s.format("YYYY-MM-DD")}`
|
|
2253
2326
|
)) }) });
|
|
2254
2327
|
}
|
|
2255
2328
|
renderHeaderSlots() {
|
|
2256
|
-
const
|
|
2257
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2258
|
-
|
|
2329
|
+
const n = this.getTimelineApi().getWeeks();
|
|
2330
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2331
|
+
B,
|
|
2259
2332
|
{
|
|
2260
2333
|
level: 2,
|
|
2261
|
-
date:
|
|
2262
|
-
dataDate: `${
|
|
2334
|
+
date: s,
|
|
2335
|
+
dataDate: `${s.format("YYYY-MM-DD")}`,
|
|
2263
2336
|
colSpan: 1,
|
|
2264
|
-
timeText: `W${
|
|
2265
|
-
classNames: ["schedulant-week",
|
|
2337
|
+
timeText: `W${s.week().toString().padStart(2, "0")}`,
|
|
2338
|
+
classNames: ["schedulant-week", s.isSame(E(), "week") ? "schedulant-this-week-head" : ""],
|
|
2266
2339
|
schedulantApi: this.getSchedulantApi()
|
|
2267
2340
|
},
|
|
2268
|
-
`${
|
|
2341
|
+
`${s.format("YYYY-MM-DD")}`
|
|
2269
2342
|
)) }) });
|
|
2270
2343
|
}
|
|
2271
|
-
calculatePosition(e,
|
|
2272
|
-
const i = this.getTimelineApi(), r = i.getWeeks(), o = e / r.length, l =
|
|
2273
|
-
return { left:
|
|
2344
|
+
calculatePosition(e, n, s) {
|
|
2345
|
+
const i = this.getTimelineApi(), r = i.getWeeks(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = o / 7, m = l.day(), f = i.getWeekPosition(l) * o, u = n.isSameOrBefore(i.getStart(), "day") ? f : f + m * d, h = 6 - c.day(), A = (i.getWeekPosition(c) + 1) * o * -1, p = s.isBefore(i.getEnd(), "day") ? A + h * d : A;
|
|
2346
|
+
return { left: u, right: p };
|
|
2274
2347
|
}
|
|
2275
2348
|
}
|
|
2276
|
-
class
|
|
2349
|
+
class Gn extends J {
|
|
2277
2350
|
getTotalSlots() {
|
|
2278
2351
|
return this.getTimelineApi().getYears().length;
|
|
2279
2352
|
}
|
|
2280
2353
|
renderColgroup() {
|
|
2281
|
-
const e = this.getSchedulantApi(),
|
|
2282
|
-
return /* @__PURE__ */ a(
|
|
2354
|
+
const e = this.getSchedulantApi(), s = this.getTimelineApi().getYears(), i = e.getSlotMinWidth();
|
|
2355
|
+
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
2283
2356
|
}
|
|
2284
2357
|
renderBodySlots() {
|
|
2285
|
-
const
|
|
2286
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2287
|
-
|
|
2358
|
+
const n = this.getTimelineApi().getYears();
|
|
2359
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2360
|
+
te,
|
|
2288
2361
|
{
|
|
2289
|
-
date:
|
|
2290
|
-
dataDate:
|
|
2291
|
-
classNames: ["schedulant-year",
|
|
2362
|
+
date: s,
|
|
2363
|
+
dataDate: s.year().toString(),
|
|
2364
|
+
classNames: ["schedulant-year", s.isSame(E(), "year") ? "schedulant-this-year-body" : ""],
|
|
2292
2365
|
schedulantApi: this.getSchedulantApi()
|
|
2293
2366
|
},
|
|
2294
|
-
|
|
2367
|
+
s.year()
|
|
2295
2368
|
)) }) });
|
|
2296
2369
|
}
|
|
2297
2370
|
renderHeaderSlots() {
|
|
2298
|
-
const
|
|
2299
|
-
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children:
|
|
2300
|
-
|
|
2371
|
+
const n = this.getTimelineApi().getYears();
|
|
2372
|
+
return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((s) => /* @__PURE__ */ a(
|
|
2373
|
+
B,
|
|
2301
2374
|
{
|
|
2302
2375
|
level: 1,
|
|
2303
|
-
date:
|
|
2304
|
-
dataDate:
|
|
2376
|
+
date: s,
|
|
2377
|
+
dataDate: s.year().toString(),
|
|
2305
2378
|
colSpan: 1,
|
|
2306
|
-
timeText:
|
|
2307
|
-
classNames: ["schedulant-year",
|
|
2379
|
+
timeText: s.year().toString(),
|
|
2380
|
+
classNames: ["schedulant-year", s.isSame(E(), "year") ? "schedulant-this-year-head" : ""],
|
|
2308
2381
|
schedulantApi: this.getSchedulantApi()
|
|
2309
2382
|
},
|
|
2310
|
-
|
|
2383
|
+
s.year()
|
|
2311
2384
|
)) }) });
|
|
2312
2385
|
}
|
|
2313
|
-
calculatePosition(e,
|
|
2314
|
-
const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l =
|
|
2315
|
-
return { left:
|
|
2386
|
+
calculatePosition(e, n, s) {
|
|
2387
|
+
const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / d, u = m * f, h = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, S = c.endOf("year").diff(c, "day"), M = o / p, g = S * M, y = (i.getYearPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
|
|
2388
|
+
return { left: A, right: v };
|
|
2316
2389
|
}
|
|
2317
2390
|
}
|
|
2318
|
-
class
|
|
2391
|
+
class Xn {
|
|
2319
2392
|
schedulantApi;
|
|
2320
2393
|
timelineView;
|
|
2321
2394
|
schedulantElRef;
|
|
2322
|
-
constructor(e,
|
|
2323
|
-
switch (this.schedulantElRef =
|
|
2395
|
+
constructor(e, n) {
|
|
2396
|
+
switch (this.schedulantElRef = n, this.schedulantApi = new ln(this, e), this.schedulantApi.getSchedulantViewType()) {
|
|
2324
2397
|
case "Day":
|
|
2325
|
-
this.timelineView = new
|
|
2398
|
+
this.timelineView = new qn(this.schedulantApi);
|
|
2326
2399
|
break;
|
|
2327
2400
|
case "Week":
|
|
2328
|
-
this.timelineView = new
|
|
2401
|
+
this.timelineView = new $n(this.schedulantApi);
|
|
2329
2402
|
break;
|
|
2330
2403
|
case "Month":
|
|
2331
|
-
this.timelineView = new
|
|
2404
|
+
this.timelineView = new Un(this.schedulantApi);
|
|
2332
2405
|
break;
|
|
2333
2406
|
case "Quarter":
|
|
2334
|
-
this.timelineView = new
|
|
2407
|
+
this.timelineView = new jn(this.schedulantApi);
|
|
2335
2408
|
break;
|
|
2336
2409
|
case "Year":
|
|
2337
|
-
this.timelineView = new
|
|
2410
|
+
this.timelineView = new Gn(this.schedulantApi);
|
|
2338
2411
|
break;
|
|
2339
2412
|
}
|
|
2340
2413
|
}
|
|
@@ -2347,15 +2420,15 @@ class Vn {
|
|
|
2347
2420
|
renderTimelineHeaderTableSlots() {
|
|
2348
2421
|
return this.timelineView.renderHeaderSlots();
|
|
2349
2422
|
}
|
|
2350
|
-
renderTimelineDrawingBoardTable(e,
|
|
2423
|
+
renderTimelineDrawingBoardTable(e, n, s, i) {
|
|
2351
2424
|
const r = (c) => {
|
|
2352
|
-
const
|
|
2425
|
+
const d = this.timelineView.calculateLaneHeight(c);
|
|
2353
2426
|
return /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
2354
2427
|
"td",
|
|
2355
2428
|
{
|
|
2356
2429
|
"data-resource-id": c.getId(),
|
|
2357
2430
|
className: "schedulant-timeline-lane schedulant-resource",
|
|
2358
|
-
children: /* @__PURE__ */
|
|
2431
|
+
children: /* @__PURE__ */ I("div", { className: "schedulant-timeline-lane-frame", style: { height: d }, children: [
|
|
2359
2432
|
this.timelineView.renderLane(),
|
|
2360
2433
|
/* @__PURE__ */ a("div", { className: "schedulant-timeline-lane-bg" }),
|
|
2361
2434
|
this.timelineView.renderEvents(c, i),
|
|
@@ -2364,36 +2437,36 @@ class Vn {
|
|
|
2364
2437
|
] })
|
|
2365
2438
|
}
|
|
2366
2439
|
) }, c.getId());
|
|
2367
|
-
}, o =
|
|
2368
|
-
return /* @__PURE__ */
|
|
2440
|
+
}, o = n.length > 0 ? n[0].start : 0, l = n.length > 0 ? s - n[n.length - 1].end : 0;
|
|
2441
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2369
2442
|
o > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { style: { height: o, padding: 0, border: "none" } }) }),
|
|
2370
|
-
|
|
2371
|
-
const
|
|
2372
|
-
return r(
|
|
2443
|
+
n.map((c) => {
|
|
2444
|
+
const d = e[c.index];
|
|
2445
|
+
return r(d);
|
|
2373
2446
|
}),
|
|
2374
2447
|
l > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { style: { height: l, padding: 0, border: "none" } }) })
|
|
2375
2448
|
] });
|
|
2376
2449
|
}
|
|
2377
2450
|
renderResourceTableColgroup() {
|
|
2378
2451
|
const e = this.schedulantApi.getResourceAreaColumns();
|
|
2379
|
-
return /* @__PURE__ */ a(
|
|
2452
|
+
return /* @__PURE__ */ a(yn, { resourceAreaColumns: e });
|
|
2380
2453
|
}
|
|
2381
|
-
renderResourceLabel(e,
|
|
2382
|
-
const
|
|
2383
|
-
return /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2384
|
-
|
|
2454
|
+
renderResourceLabel(e, n) {
|
|
2455
|
+
const s = this.schedulantApi.getResourceAreaColumns();
|
|
2456
|
+
return /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { role: "row", children: s.map((i, r) => /* @__PURE__ */ a(
|
|
2457
|
+
dn,
|
|
2385
2458
|
{
|
|
2386
2459
|
schedulantApi: this.schedulantApi,
|
|
2387
2460
|
cellResizerMouseUp: e,
|
|
2388
2461
|
resourceAreaColumn: i,
|
|
2389
|
-
cellResizerMouseDownFunc:
|
|
2390
|
-
isResizable: r !=
|
|
2462
|
+
cellResizerMouseDownFunc: n,
|
|
2463
|
+
isResizable: r != s.length - 1
|
|
2391
2464
|
},
|
|
2392
2465
|
i.field
|
|
2393
2466
|
)) }) });
|
|
2394
2467
|
}
|
|
2395
|
-
renderResourceLane(e,
|
|
2396
|
-
const c = this.schedulantApi.getResourceAreaColumns(),
|
|
2468
|
+
renderResourceLane(e, n, s, i, r, o, l) {
|
|
2469
|
+
const c = this.schedulantApi.getResourceAreaColumns(), d = (u) => c.map((h, A) => {
|
|
2397
2470
|
const p = l ? {
|
|
2398
2471
|
isDraggable: l.isDraggable,
|
|
2399
2472
|
activeId: l.dragState.activeId,
|
|
@@ -2401,27 +2474,27 @@ class Vn {
|
|
|
2401
2474
|
dropPosition: l.dragState.dropPosition
|
|
2402
2475
|
} : {};
|
|
2403
2476
|
return /* @__PURE__ */ a(
|
|
2404
|
-
|
|
2477
|
+
pn,
|
|
2405
2478
|
{
|
|
2406
2479
|
schedulantApi: this.schedulantApi,
|
|
2407
|
-
resourceApi:
|
|
2480
|
+
resourceApi: u,
|
|
2408
2481
|
collapseIds: i,
|
|
2409
|
-
showPlusSquare:
|
|
2482
|
+
showPlusSquare: A === 0,
|
|
2410
2483
|
showIndentation: !0,
|
|
2411
2484
|
cellResizerMouseUp: r,
|
|
2412
|
-
resourceAreaColumn:
|
|
2485
|
+
resourceAreaColumn: h,
|
|
2413
2486
|
cellResizerMouseDownFunc: o,
|
|
2414
|
-
isResizable:
|
|
2487
|
+
isResizable: A != c.length - 1,
|
|
2415
2488
|
...p
|
|
2416
2489
|
},
|
|
2417
|
-
|
|
2490
|
+
h.field
|
|
2418
2491
|
);
|
|
2419
|
-
}), m =
|
|
2420
|
-
return /* @__PURE__ */
|
|
2492
|
+
}), m = n.length > 0 ? n[0].start : 0, f = n.length > 0 ? s - n[n.length - 1].end : 0;
|
|
2493
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2421
2494
|
m > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: m, padding: 0, border: "none" } }) }),
|
|
2422
|
-
|
|
2423
|
-
const
|
|
2424
|
-
return /* @__PURE__ */ a("tr", { role: "row", children:
|
|
2495
|
+
n.map((u) => {
|
|
2496
|
+
const h = e[u.index];
|
|
2497
|
+
return /* @__PURE__ */ a("tr", { role: "row", children: d(h) }, h.getId());
|
|
2425
2498
|
}),
|
|
2426
2499
|
f > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: f, padding: 0, border: "none" } }) })
|
|
2427
2500
|
] });
|
|
@@ -2436,122 +2509,122 @@ class Vn {
|
|
|
2436
2509
|
return this.schedulantElRef;
|
|
2437
2510
|
}
|
|
2438
2511
|
}
|
|
2439
|
-
const
|
|
2440
|
-
const { schedulantView: e, cellResizerMouseUp:
|
|
2441
|
-
return /* @__PURE__ */
|
|
2512
|
+
const Qn = (t) => {
|
|
2513
|
+
const { schedulantView: e, cellResizerMouseUp: n, cellResizerMouseDownFunc: s } = t;
|
|
2514
|
+
return /* @__PURE__ */ I("table", { role: "presentation", className: "schedulant-datagrid-head schedulant-scrollgrid-sync-table", children: [
|
|
2442
2515
|
e.renderResourceTableColgroup(),
|
|
2443
|
-
e.renderResourceLabel(
|
|
2516
|
+
e.renderResourceLabel(n, s)
|
|
2444
2517
|
] });
|
|
2445
|
-
},
|
|
2446
|
-
|
|
2447
|
-
|
|
2518
|
+
}, Kn = (t) => /* @__PURE__ */ I("table", { "aria-hidden": !0, className: "schedulant-scrollgrid-sync-table", children: [
|
|
2519
|
+
t.schedulantView.renderTimelineTableColgroup(),
|
|
2520
|
+
t.schedulantView.renderTimelineHeaderTableSlots()
|
|
2448
2521
|
] });
|
|
2449
|
-
function
|
|
2450
|
-
const
|
|
2451
|
-
return
|
|
2522
|
+
function Zn(t, e) {
|
|
2523
|
+
const n = t - e.top, s = e.height;
|
|
2524
|
+
return n < s * Qt ? "before" : n > s * Kt ? "after" : "child";
|
|
2452
2525
|
}
|
|
2453
|
-
function
|
|
2454
|
-
let
|
|
2455
|
-
for (;
|
|
2456
|
-
if (
|
|
2457
|
-
const
|
|
2458
|
-
|
|
2526
|
+
function Jn(t, e) {
|
|
2527
|
+
let n = e;
|
|
2528
|
+
for (; n; ) {
|
|
2529
|
+
if (n.getId() === t) return !0;
|
|
2530
|
+
const s = n.getParent();
|
|
2531
|
+
n = s.isDefined() ? s.get() : void 0;
|
|
2459
2532
|
}
|
|
2460
2533
|
return !1;
|
|
2461
2534
|
}
|
|
2462
|
-
const
|
|
2463
|
-
const [
|
|
2535
|
+
const es = (t, e) => {
|
|
2536
|
+
const [n, s] = re({
|
|
2464
2537
|
activeId: null,
|
|
2465
2538
|
overId: null,
|
|
2466
2539
|
dropPosition: null
|
|
2467
2540
|
}), i = k(null), r = k(null), o = k(
|
|
2468
|
-
new Map(
|
|
2541
|
+
new Map(t.map((f) => [f.getId(), f]))
|
|
2469
2542
|
);
|
|
2470
|
-
o.current = new Map(
|
|
2471
|
-
const l =
|
|
2472
|
-
i.current = null, r.current = null,
|
|
2543
|
+
o.current = new Map(t.map((f) => [f.getId(), f]));
|
|
2544
|
+
const l = C((f) => {
|
|
2545
|
+
i.current = null, r.current = null, mn(String(f.active.id)), s({
|
|
2473
2546
|
activeId: f.active.id,
|
|
2474
2547
|
overId: null,
|
|
2475
2548
|
dropPosition: null
|
|
2476
2549
|
});
|
|
2477
|
-
}, []), c =
|
|
2478
|
-
const { active:
|
|
2479
|
-
if (!
|
|
2480
|
-
r.current !== null && (r.current = null, i.current = null,
|
|
2550
|
+
}, []), c = C((f) => {
|
|
2551
|
+
const { active: u, over: h, activatorEvent: A, delta: p } = f;
|
|
2552
|
+
if (!h || u.id === h.id) {
|
|
2553
|
+
r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
|
|
2481
2554
|
return;
|
|
2482
2555
|
}
|
|
2483
|
-
const
|
|
2484
|
-
if (!
|
|
2485
|
-
r.current !== null && (r.current = null, i.current = null,
|
|
2556
|
+
const S = o.current.get(String(h.id));
|
|
2557
|
+
if (!S || Jn(String(u.id), S)) {
|
|
2558
|
+
r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
|
|
2486
2559
|
return;
|
|
2487
2560
|
}
|
|
2488
|
-
const
|
|
2489
|
-
top:
|
|
2490
|
-
height:
|
|
2561
|
+
const M = A.clientY + p.y, g = Zn(M, {
|
|
2562
|
+
top: h.rect.top,
|
|
2563
|
+
height: h.rect.height
|
|
2491
2564
|
});
|
|
2492
|
-
(r.current !==
|
|
2493
|
-
...
|
|
2494
|
-
overId:
|
|
2565
|
+
(r.current !== h.id || i.current !== g) && (r.current = h.id, i.current = g, s((y) => ({
|
|
2566
|
+
...y,
|
|
2567
|
+
overId: h.id,
|
|
2495
2568
|
dropPosition: g
|
|
2496
2569
|
})));
|
|
2497
|
-
}, []),
|
|
2498
|
-
const { active:
|
|
2499
|
-
if (
|
|
2500
|
-
const
|
|
2570
|
+
}, []), d = C((f) => {
|
|
2571
|
+
const { active: u, over: h } = f, A = i.current, p = r.current;
|
|
2572
|
+
if (h && u.id !== h.id && A && p) {
|
|
2573
|
+
const S = document.querySelector(
|
|
2501
2574
|
`[data-resource-id="${String(p)}"]`
|
|
2502
2575
|
);
|
|
2503
2576
|
e(
|
|
2504
|
-
|
|
2505
|
-
String(
|
|
2577
|
+
S || document.body,
|
|
2578
|
+
String(u.id),
|
|
2506
2579
|
String(p),
|
|
2507
|
-
|
|
2580
|
+
A
|
|
2508
2581
|
);
|
|
2509
2582
|
}
|
|
2510
|
-
i.current = null, r.current = null,
|
|
2511
|
-
}, [e]), m =
|
|
2512
|
-
i.current = null, r.current = null,
|
|
2583
|
+
i.current = null, r.current = null, s({ activeId: null, overId: null, dropPosition: null });
|
|
2584
|
+
}, [e]), m = C(() => {
|
|
2585
|
+
i.current = null, r.current = null, s({ activeId: null, overId: null, dropPosition: null });
|
|
2513
2586
|
}, []);
|
|
2514
2587
|
return {
|
|
2515
|
-
dragState:
|
|
2588
|
+
dragState: n,
|
|
2516
2589
|
handleDragStart: l,
|
|
2517
2590
|
handleDragMove: c,
|
|
2518
|
-
handleDragEnd:
|
|
2591
|
+
handleDragEnd: d,
|
|
2519
2592
|
handleDragCancel: m
|
|
2520
2593
|
};
|
|
2521
|
-
},
|
|
2522
|
-
...
|
|
2523
|
-
x:
|
|
2524
|
-
y:
|
|
2525
|
-
} :
|
|
2526
|
-
const { schedulantView: e, virtualizer:
|
|
2527
|
-
const
|
|
2528
|
-
if (
|
|
2529
|
-
const
|
|
2594
|
+
}, ts = ({ transform: t, activatorEvent: e }) => e ? {
|
|
2595
|
+
...t,
|
|
2596
|
+
x: t.x + 20,
|
|
2597
|
+
y: t.y + 20
|
|
2598
|
+
} : t, ns = (t) => {
|
|
2599
|
+
const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (b, T, D, O) => {
|
|
2600
|
+
const P = c.find((z) => z.getId() === T), Y = c.find((z) => z.getId() === D);
|
|
2601
|
+
if (P && Y) {
|
|
2602
|
+
const z = P.getParent();
|
|
2530
2603
|
l.resourceLaneMove({
|
|
2531
|
-
el:
|
|
2604
|
+
el: b,
|
|
2532
2605
|
schedulantApi: l,
|
|
2533
|
-
draggedResourceApi:
|
|
2534
|
-
targetResourceApi:
|
|
2535
|
-
position:
|
|
2536
|
-
oldParentResourceApi:
|
|
2606
|
+
draggedResourceApi: P,
|
|
2607
|
+
targetResourceApi: Y,
|
|
2608
|
+
position: O,
|
|
2609
|
+
oldParentResourceApi: z.isDefined() ? z.get() : void 0
|
|
2537
2610
|
});
|
|
2538
2611
|
}
|
|
2539
|
-
}, [l, c]), { dragState: m, handleDragStart: f, handleDragMove:
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
),
|
|
2543
|
-
return /* @__PURE__ */
|
|
2544
|
-
|
|
2612
|
+
}, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: u, handleDragEnd: h, handleDragCancel: A } = es(c, d), p = _t(
|
|
2613
|
+
We(Wt, { activationConstraint: { delay: 300, tolerance: 5 } }),
|
|
2614
|
+
We(Ht)
|
|
2615
|
+
), S = s.map((b) => b.getId()), M = l.isEditable(), g = n.getVirtualItems(), y = n.getTotalSize(), v = F(() => m.activeId ? c.find((b) => b.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
|
|
2616
|
+
return /* @__PURE__ */ I(
|
|
2617
|
+
zt,
|
|
2545
2618
|
{
|
|
2546
2619
|
sensors: p,
|
|
2547
|
-
collisionDetection:
|
|
2548
|
-
modifiers: [
|
|
2620
|
+
collisionDetection: Vt,
|
|
2621
|
+
modifiers: [Bt],
|
|
2549
2622
|
onDragStart: f,
|
|
2550
|
-
onDragMove:
|
|
2551
|
-
onDragEnd:
|
|
2552
|
-
onDragCancel:
|
|
2623
|
+
onDragMove: u,
|
|
2624
|
+
onDragEnd: h,
|
|
2625
|
+
onDragCancel: A,
|
|
2553
2626
|
children: [
|
|
2554
|
-
/* @__PURE__ */ a(
|
|
2627
|
+
/* @__PURE__ */ a(Nt, { items: S, strategy: Yt, children: /* @__PURE__ */ I(
|
|
2555
2628
|
"table",
|
|
2556
2629
|
{
|
|
2557
2630
|
role: "presentation",
|
|
@@ -2559,29 +2632,29 @@ const jn = (s, e) => {
|
|
|
2559
2632
|
className: "schedulant-datagrid-body schedulant-scrollgrid-sync-table",
|
|
2560
2633
|
children: [
|
|
2561
2634
|
e.renderResourceTableColgroup(),
|
|
2562
|
-
e.renderResourceLane(
|
|
2563
|
-
isDraggable:
|
|
2635
|
+
e.renderResourceLane(s, g, y, i, r, o, {
|
|
2636
|
+
isDraggable: M,
|
|
2564
2637
|
dragState: m
|
|
2565
2638
|
})
|
|
2566
2639
|
]
|
|
2567
2640
|
}
|
|
2568
2641
|
) }),
|
|
2569
|
-
/* @__PURE__ */ a(
|
|
2642
|
+
/* @__PURE__ */ a(Ft, { dropAnimation: null, modifiers: [ts], children: v ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: v.getTitle() }) : null })
|
|
2570
2643
|
]
|
|
2571
2644
|
}
|
|
2572
2645
|
);
|
|
2573
|
-
},
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
] }) }),
|
|
2577
|
-
const
|
|
2646
|
+
}, ss = (t) => /* @__PURE__ */ a("div", { id: "schedulant-timeline-slots", className: "schedulant-timeline-slots", children: /* @__PURE__ */ I("table", { "aria-hidden": !0, children: [
|
|
2647
|
+
t.schedulantView.renderTimelineTableColgroup(),
|
|
2648
|
+
t.schedulantView.renderTimelineBodyTableSlots()
|
|
2649
|
+
] }) }), is = () => {
|
|
2650
|
+
const t = C(() => {
|
|
2578
2651
|
const l = document.getElementsByClassName("schedulant-timeline-head").item(0).getElementsByTagName("table").item(0)?.offsetWidth;
|
|
2579
2652
|
return l || 0;
|
|
2580
|
-
}, []), [e,
|
|
2581
|
-
return
|
|
2653
|
+
}, []), [e, n] = re(0), { state: s } = De();
|
|
2654
|
+
return Tt(() => {
|
|
2582
2655
|
const i = () => {
|
|
2583
|
-
const
|
|
2584
|
-
|
|
2656
|
+
const d = t();
|
|
2657
|
+
n(d);
|
|
2585
2658
|
};
|
|
2586
2659
|
i();
|
|
2587
2660
|
const r = () => i();
|
|
@@ -2598,171 +2671,171 @@ const jn = (s, e) => {
|
|
|
2598
2671
|
})), () => {
|
|
2599
2672
|
window.removeEventListener("resize", r), c?.disconnect();
|
|
2600
2673
|
};
|
|
2601
|
-
}, [
|
|
2602
|
-
},
|
|
2603
|
-
const e =
|
|
2674
|
+
}, [t, s.resourceAreaWidth]), e;
|
|
2675
|
+
}, rs = (t) => {
|
|
2676
|
+
const e = is(), n = t.virtualizer.getVirtualItems(), s = t.virtualizer.getTotalSize();
|
|
2604
2677
|
return /* @__PURE__ */ a(
|
|
2605
2678
|
"table",
|
|
2606
2679
|
{
|
|
2607
2680
|
"aria-hidden": !0,
|
|
2608
2681
|
className: "schedulant-timeline-drawing-board schedulant-scrollgrid-sync-table",
|
|
2609
2682
|
style: { width: w(e) },
|
|
2610
|
-
children:
|
|
2683
|
+
children: t.schedulantView.renderTimelineDrawingBoardTable(t.visibleResources, n, s, e)
|
|
2611
2684
|
}
|
|
2612
2685
|
);
|
|
2613
|
-
},
|
|
2686
|
+
}, os = (t, e) => {
|
|
2614
2687
|
N(() => {
|
|
2615
|
-
const
|
|
2616
|
-
if (
|
|
2617
|
-
return
|
|
2618
|
-
el:
|
|
2619
|
-
schedulantApi:
|
|
2688
|
+
const n = t.current, s = e.getScheduleApi();
|
|
2689
|
+
if (n)
|
|
2690
|
+
return s.schedulantDidMount({
|
|
2691
|
+
el: n,
|
|
2692
|
+
schedulantApi: s
|
|
2620
2693
|
}), () => {
|
|
2621
|
-
|
|
2622
|
-
el:
|
|
2623
|
-
schedulantApi:
|
|
2694
|
+
s.schedulantWillUnmount({
|
|
2695
|
+
el: n,
|
|
2696
|
+
schedulantApi: s
|
|
2624
2697
|
});
|
|
2625
2698
|
};
|
|
2626
|
-
}, [
|
|
2699
|
+
}, [t, e]);
|
|
2627
2700
|
};
|
|
2628
|
-
function
|
|
2629
|
-
let
|
|
2701
|
+
function $(t, e, n) {
|
|
2702
|
+
let s = n.initialDeps ?? [], i, r = !0;
|
|
2630
2703
|
function o() {
|
|
2631
|
-
var l, c,
|
|
2704
|
+
var l, c, d;
|
|
2632
2705
|
let m;
|
|
2633
|
-
|
|
2634
|
-
const f =
|
|
2635
|
-
if (!(f.length !==
|
|
2706
|
+
n.key && ((l = n.debug) != null && l.call(n)) && (m = Date.now());
|
|
2707
|
+
const f = t();
|
|
2708
|
+
if (!(f.length !== s.length || f.some((A, p) => s[p] !== A)))
|
|
2636
2709
|
return i;
|
|
2637
|
-
|
|
2638
|
-
let
|
|
2639
|
-
if (
|
|
2640
|
-
const
|
|
2641
|
-
for (g = String(g); g.length <
|
|
2710
|
+
s = f;
|
|
2711
|
+
let h;
|
|
2712
|
+
if (n.key && ((c = n.debug) != null && c.call(n)) && (h = Date.now()), i = e(...f), n.key && ((d = n.debug) != null && d.call(n))) {
|
|
2713
|
+
const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - h) * 100) / 100, S = p / 16, M = (g, y) => {
|
|
2714
|
+
for (g = String(g); g.length < y; )
|
|
2642
2715
|
g = " " + g;
|
|
2643
2716
|
return g;
|
|
2644
2717
|
};
|
|
2645
2718
|
console.info(
|
|
2646
|
-
`%c⏱ ${
|
|
2719
|
+
`%c⏱ ${M(p, 5)} /${M(A, 5)} ms`,
|
|
2647
2720
|
`
|
|
2648
2721
|
font-size: .6rem;
|
|
2649
2722
|
font-weight: bold;
|
|
2650
2723
|
color: hsl(${Math.max(
|
|
2651
2724
|
0,
|
|
2652
|
-
Math.min(120 - 120 *
|
|
2725
|
+
Math.min(120 - 120 * S, 120)
|
|
2653
2726
|
)}deg 100% 31%);`,
|
|
2654
|
-
|
|
2727
|
+
n?.key
|
|
2655
2728
|
);
|
|
2656
2729
|
}
|
|
2657
|
-
return
|
|
2730
|
+
return n?.onChange && !(r && n.skipInitialOnChange) && n.onChange(i), r = !1, i;
|
|
2658
2731
|
}
|
|
2659
2732
|
return o.updateDeps = (l) => {
|
|
2660
|
-
|
|
2733
|
+
s = l;
|
|
2661
2734
|
}, o;
|
|
2662
2735
|
}
|
|
2663
|
-
function
|
|
2664
|
-
if (
|
|
2736
|
+
function ot(t, e) {
|
|
2737
|
+
if (t === void 0)
|
|
2665
2738
|
throw new Error("Unexpected undefined");
|
|
2666
|
-
return
|
|
2739
|
+
return t;
|
|
2667
2740
|
}
|
|
2668
|
-
const
|
|
2669
|
-
let
|
|
2741
|
+
const ls = (t, e) => Math.abs(t - e) < 1.01, as = (t, e, n) => {
|
|
2742
|
+
let s;
|
|
2670
2743
|
return function(...i) {
|
|
2671
|
-
|
|
2744
|
+
t.clearTimeout(s), s = t.setTimeout(() => e.apply(this, i), n);
|
|
2672
2745
|
};
|
|
2673
|
-
},
|
|
2674
|
-
const { offsetWidth: e, offsetHeight:
|
|
2675
|
-
return { width: e, height:
|
|
2676
|
-
},
|
|
2677
|
-
const e = Math.max(
|
|
2678
|
-
for (let i = e; i <=
|
|
2679
|
-
|
|
2680
|
-
return
|
|
2681
|
-
},
|
|
2682
|
-
const
|
|
2683
|
-
if (!t)
|
|
2684
|
-
return;
|
|
2685
|
-
const n = s.targetWindow;
|
|
2746
|
+
}, lt = (t) => {
|
|
2747
|
+
const { offsetWidth: e, offsetHeight: n } = t;
|
|
2748
|
+
return { width: e, height: n };
|
|
2749
|
+
}, cs = (t) => t, ds = (t) => {
|
|
2750
|
+
const e = Math.max(t.startIndex - t.overscan, 0), n = Math.min(t.endIndex + t.overscan, t.count - 1), s = [];
|
|
2751
|
+
for (let i = e; i <= n; i++)
|
|
2752
|
+
s.push(i);
|
|
2753
|
+
return s;
|
|
2754
|
+
}, us = (t, e) => {
|
|
2755
|
+
const n = t.scrollElement;
|
|
2686
2756
|
if (!n)
|
|
2687
2757
|
return;
|
|
2758
|
+
const s = t.targetWindow;
|
|
2759
|
+
if (!s)
|
|
2760
|
+
return;
|
|
2688
2761
|
const i = (o) => {
|
|
2689
2762
|
const { width: l, height: c } = o;
|
|
2690
2763
|
e({ width: Math.round(l), height: Math.round(c) });
|
|
2691
2764
|
};
|
|
2692
|
-
if (i(
|
|
2765
|
+
if (i(lt(n)), !s.ResizeObserver)
|
|
2693
2766
|
return () => {
|
|
2694
2767
|
};
|
|
2695
|
-
const r = new
|
|
2768
|
+
const r = new s.ResizeObserver((o) => {
|
|
2696
2769
|
const l = () => {
|
|
2697
2770
|
const c = o[0];
|
|
2698
2771
|
if (c?.borderBoxSize) {
|
|
2699
|
-
const
|
|
2700
|
-
if (
|
|
2701
|
-
i({ width:
|
|
2772
|
+
const d = c.borderBoxSize[0];
|
|
2773
|
+
if (d) {
|
|
2774
|
+
i({ width: d.inlineSize, height: d.blockSize });
|
|
2702
2775
|
return;
|
|
2703
2776
|
}
|
|
2704
2777
|
}
|
|
2705
|
-
i(
|
|
2778
|
+
i(lt(n));
|
|
2706
2779
|
};
|
|
2707
|
-
|
|
2780
|
+
t.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
2708
2781
|
});
|
|
2709
|
-
return r.observe(
|
|
2710
|
-
r.unobserve(
|
|
2782
|
+
return r.observe(n, { box: "border-box" }), () => {
|
|
2783
|
+
r.unobserve(n);
|
|
2711
2784
|
};
|
|
2712
|
-
},
|
|
2785
|
+
}, at = {
|
|
2713
2786
|
passive: !0
|
|
2714
|
-
},
|
|
2715
|
-
const
|
|
2716
|
-
if (!t)
|
|
2717
|
-
return;
|
|
2718
|
-
const n = s.targetWindow;
|
|
2787
|
+
}, ct = typeof window > "u" ? !0 : "onscrollend" in window, hs = (t, e) => {
|
|
2788
|
+
const n = t.scrollElement;
|
|
2719
2789
|
if (!n)
|
|
2720
2790
|
return;
|
|
2791
|
+
const s = t.targetWindow;
|
|
2792
|
+
if (!s)
|
|
2793
|
+
return;
|
|
2721
2794
|
let i = 0;
|
|
2722
|
-
const r =
|
|
2723
|
-
} :
|
|
2724
|
-
|
|
2795
|
+
const r = t.options.useScrollendEvent && ct ? () => {
|
|
2796
|
+
} : as(
|
|
2797
|
+
s,
|
|
2725
2798
|
() => {
|
|
2726
2799
|
e(i, !1);
|
|
2727
2800
|
},
|
|
2728
|
-
|
|
2801
|
+
t.options.isScrollingResetDelay
|
|
2729
2802
|
), o = (m) => () => {
|
|
2730
|
-
const { horizontal: f, isRtl:
|
|
2731
|
-
i = f ?
|
|
2803
|
+
const { horizontal: f, isRtl: u } = t.options;
|
|
2804
|
+
i = f ? n.scrollLeft * (u && -1 || 1) : n.scrollTop, r(), e(i, m);
|
|
2732
2805
|
}, l = o(!0), c = o(!1);
|
|
2733
|
-
|
|
2734
|
-
const
|
|
2735
|
-
return
|
|
2736
|
-
|
|
2806
|
+
n.addEventListener("scroll", l, at);
|
|
2807
|
+
const d = t.options.useScrollendEvent && ct;
|
|
2808
|
+
return d && n.addEventListener("scrollend", c, at), () => {
|
|
2809
|
+
n.removeEventListener("scroll", l), d && n.removeEventListener("scrollend", c);
|
|
2737
2810
|
};
|
|
2738
|
-
},
|
|
2811
|
+
}, ms = (t, e, n) => {
|
|
2739
2812
|
if (e?.borderBoxSize) {
|
|
2740
|
-
const
|
|
2741
|
-
if (
|
|
2813
|
+
const s = e.borderBoxSize[0];
|
|
2814
|
+
if (s)
|
|
2742
2815
|
return Math.round(
|
|
2743
|
-
n
|
|
2816
|
+
s[n.options.horizontal ? "inlineSize" : "blockSize"]
|
|
2744
2817
|
);
|
|
2745
2818
|
}
|
|
2746
|
-
return
|
|
2747
|
-
},
|
|
2819
|
+
return t[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
2820
|
+
}, gs = (t, {
|
|
2748
2821
|
adjustments: e = 0,
|
|
2749
|
-
behavior:
|
|
2750
|
-
},
|
|
2822
|
+
behavior: n
|
|
2823
|
+
}, s) => {
|
|
2751
2824
|
var i, r;
|
|
2752
|
-
const o =
|
|
2753
|
-
(r = (i =
|
|
2754
|
-
[
|
|
2755
|
-
behavior:
|
|
2825
|
+
const o = t + e;
|
|
2826
|
+
(r = (i = s.scrollElement) == null ? void 0 : i.scrollTo) == null || r.call(i, {
|
|
2827
|
+
[s.options.horizontal ? "left" : "top"]: o,
|
|
2828
|
+
behavior: n
|
|
2756
2829
|
});
|
|
2757
2830
|
};
|
|
2758
|
-
class
|
|
2831
|
+
class fs {
|
|
2759
2832
|
constructor(e) {
|
|
2760
2833
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
2761
|
-
var
|
|
2762
|
-
return ((i = (
|
|
2834
|
+
var n, s, i;
|
|
2835
|
+
return ((i = (s = (n = this.targetWindow) == null ? void 0 : n.performance) == null ? void 0 : s.now) == null ? void 0 : i.call(s)) ?? Date.now();
|
|
2763
2836
|
}, this.observer = /* @__PURE__ */ (() => {
|
|
2764
|
-
let
|
|
2765
|
-
const
|
|
2837
|
+
let n = null;
|
|
2838
|
+
const s = () => n || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : n = new this.targetWindow.ResizeObserver((i) => {
|
|
2766
2839
|
i.forEach((r) => {
|
|
2767
2840
|
const o = () => {
|
|
2768
2841
|
this._measureElement(r.target, r);
|
|
@@ -2773,20 +2846,20 @@ class ls {
|
|
|
2773
2846
|
return {
|
|
2774
2847
|
disconnect: () => {
|
|
2775
2848
|
var i;
|
|
2776
|
-
(i =
|
|
2849
|
+
(i = s()) == null || i.disconnect(), n = null;
|
|
2777
2850
|
},
|
|
2778
2851
|
observe: (i) => {
|
|
2779
2852
|
var r;
|
|
2780
|
-
return (r =
|
|
2853
|
+
return (r = s()) == null ? void 0 : r.observe(i, { box: "border-box" });
|
|
2781
2854
|
},
|
|
2782
2855
|
unobserve: (i) => {
|
|
2783
2856
|
var r;
|
|
2784
|
-
return (r =
|
|
2857
|
+
return (r = s()) == null ? void 0 : r.unobserve(i);
|
|
2785
2858
|
}
|
|
2786
2859
|
};
|
|
2787
|
-
})(), this.range = null, this.setOptions = (
|
|
2788
|
-
Object.entries(
|
|
2789
|
-
typeof i > "u" && delete
|
|
2860
|
+
})(), this.range = null, this.setOptions = (n) => {
|
|
2861
|
+
Object.entries(n).forEach(([s, i]) => {
|
|
2862
|
+
typeof i > "u" && delete n[s];
|
|
2790
2863
|
}), this.options = {
|
|
2791
2864
|
debug: !1,
|
|
2792
2865
|
initialOffset: 0,
|
|
@@ -2796,11 +2869,11 @@ class ls {
|
|
|
2796
2869
|
scrollPaddingStart: 0,
|
|
2797
2870
|
scrollPaddingEnd: 0,
|
|
2798
2871
|
horizontal: !1,
|
|
2799
|
-
getItemKey:
|
|
2800
|
-
rangeExtractor:
|
|
2872
|
+
getItemKey: cs,
|
|
2873
|
+
rangeExtractor: ds,
|
|
2801
2874
|
onChange: () => {
|
|
2802
2875
|
},
|
|
2803
|
-
measureElement:
|
|
2876
|
+
measureElement: ms,
|
|
2804
2877
|
initialRect: { width: 0, height: 0 },
|
|
2805
2878
|
scrollMargin: 0,
|
|
2806
2879
|
gap: 0,
|
|
@@ -2812,19 +2885,19 @@ class ls {
|
|
|
2812
2885
|
isRtl: !1,
|
|
2813
2886
|
useScrollendEvent: !1,
|
|
2814
2887
|
useAnimationFrameWithResizeObserver: !1,
|
|
2815
|
-
...
|
|
2888
|
+
...n
|
|
2816
2889
|
};
|
|
2817
|
-
}, this.notify = (
|
|
2818
|
-
var
|
|
2819
|
-
(i = (
|
|
2820
|
-
}, this.maybeNotify =
|
|
2890
|
+
}, this.notify = (n) => {
|
|
2891
|
+
var s, i;
|
|
2892
|
+
(i = (s = this.options).onChange) == null || i.call(s, this, n);
|
|
2893
|
+
}, this.maybeNotify = $(
|
|
2821
2894
|
() => (this.calculateRange(), [
|
|
2822
2895
|
this.isScrolling,
|
|
2823
2896
|
this.range ? this.range.startIndex : null,
|
|
2824
2897
|
this.range ? this.range.endIndex : null
|
|
2825
2898
|
]),
|
|
2826
|
-
(
|
|
2827
|
-
this.notify(
|
|
2899
|
+
(n) => {
|
|
2900
|
+
this.notify(n);
|
|
2828
2901
|
},
|
|
2829
2902
|
{
|
|
2830
2903
|
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
@@ -2836,18 +2909,18 @@ class ls {
|
|
|
2836
2909
|
]
|
|
2837
2910
|
}
|
|
2838
2911
|
), this.cleanup = () => {
|
|
2839
|
-
this.unsubs.filter(Boolean).forEach((
|
|
2912
|
+
this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
2840
2913
|
}, this._didMount = () => () => {
|
|
2841
2914
|
this.cleanup();
|
|
2842
2915
|
}, this._willUpdate = () => {
|
|
2843
|
-
var
|
|
2844
|
-
const
|
|
2845
|
-
if (this.scrollElement !==
|
|
2846
|
-
if (this.cleanup(), !
|
|
2916
|
+
var n;
|
|
2917
|
+
const s = this.options.enabled ? this.options.getScrollElement() : null;
|
|
2918
|
+
if (this.scrollElement !== s) {
|
|
2919
|
+
if (this.cleanup(), !s) {
|
|
2847
2920
|
this.maybeNotify();
|
|
2848
2921
|
return;
|
|
2849
2922
|
}
|
|
2850
|
-
this.scrollElement =
|
|
2923
|
+
this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
|
|
2851
2924
|
this.observer.observe(i);
|
|
2852
2925
|
}), this.unsubs.push(
|
|
2853
2926
|
this.options.observeElementRect(this, (i) => {
|
|
@@ -2862,10 +2935,10 @@ class ls {
|
|
|
2862
2935
|
behavior: void 0
|
|
2863
2936
|
});
|
|
2864
2937
|
}
|
|
2865
|
-
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (
|
|
2938
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (n, s) => {
|
|
2866
2939
|
const i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2867
|
-
for (let o =
|
|
2868
|
-
const l =
|
|
2940
|
+
for (let o = s - 1; o >= 0; o--) {
|
|
2941
|
+
const l = n[o];
|
|
2869
2942
|
if (i.has(l.lane))
|
|
2870
2943
|
continue;
|
|
2871
2944
|
const c = r.get(
|
|
@@ -2875,7 +2948,7 @@ class ls {
|
|
|
2875
2948
|
break;
|
|
2876
2949
|
}
|
|
2877
2950
|
return r.size === this.options.lanes ? Array.from(r.values()).sort((o, l) => o.end === l.end ? o.index - l.index : o.end - l.end)[0] : void 0;
|
|
2878
|
-
}, this.getMeasurementOptions =
|
|
2951
|
+
}, this.getMeasurementOptions = $(
|
|
2879
2952
|
() => [
|
|
2880
2953
|
this.options.count,
|
|
2881
2954
|
this.options.paddingStart,
|
|
@@ -2884,9 +2957,9 @@ class ls {
|
|
|
2884
2957
|
this.options.enabled,
|
|
2885
2958
|
this.options.lanes
|
|
2886
2959
|
],
|
|
2887
|
-
(
|
|
2888
|
-
count:
|
|
2889
|
-
paddingStart:
|
|
2960
|
+
(n, s, i, r, o, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
|
|
2961
|
+
count: n,
|
|
2962
|
+
paddingStart: s,
|
|
2890
2963
|
scrollMargin: i,
|
|
2891
2964
|
getItemKey: r,
|
|
2892
2965
|
enabled: o,
|
|
@@ -2895,46 +2968,46 @@ class ls {
|
|
|
2895
2968
|
{
|
|
2896
2969
|
key: !1
|
|
2897
2970
|
}
|
|
2898
|
-
), this.getMeasurements =
|
|
2971
|
+
), this.getMeasurements = $(
|
|
2899
2972
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
2900
|
-
({ count:
|
|
2973
|
+
({ count: n, paddingStart: s, scrollMargin: i, getItemKey: r, enabled: o, lanes: l }, c) => {
|
|
2901
2974
|
if (!o)
|
|
2902
2975
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
2903
|
-
if (this.laneAssignments.size >
|
|
2904
|
-
for (const
|
|
2905
|
-
|
|
2906
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
2907
|
-
this.itemSizeCache.set(
|
|
2976
|
+
if (this.laneAssignments.size > n)
|
|
2977
|
+
for (const u of this.laneAssignments.keys())
|
|
2978
|
+
u >= n && this.laneAssignments.delete(u);
|
|
2979
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
|
|
2980
|
+
this.itemSizeCache.set(u.key, u.size);
|
|
2908
2981
|
}));
|
|
2909
|
-
const
|
|
2910
|
-
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length ===
|
|
2911
|
-
const m = this.measurementsCache.slice(0,
|
|
2982
|
+
const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
2983
|
+
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === n && (this.lanesSettling = !1);
|
|
2984
|
+
const m = this.measurementsCache.slice(0, d), f = new Array(l).fill(
|
|
2912
2985
|
void 0
|
|
2913
2986
|
);
|
|
2914
|
-
for (let
|
|
2915
|
-
const
|
|
2916
|
-
|
|
2987
|
+
for (let u = 0; u < d; u++) {
|
|
2988
|
+
const h = m[u];
|
|
2989
|
+
h && (f[h.lane] = u);
|
|
2917
2990
|
}
|
|
2918
|
-
for (let
|
|
2919
|
-
const
|
|
2920
|
-
let p,
|
|
2921
|
-
if (
|
|
2922
|
-
p =
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2991
|
+
for (let u = d; u < n; u++) {
|
|
2992
|
+
const h = r(u), A = this.laneAssignments.get(u);
|
|
2993
|
+
let p, S;
|
|
2994
|
+
if (A !== void 0 && this.options.lanes > 1) {
|
|
2995
|
+
p = A;
|
|
2996
|
+
const v = f[p], b = v !== void 0 ? m[v] : void 0;
|
|
2997
|
+
S = b ? b.end + this.options.gap : s + i;
|
|
2925
2998
|
} else {
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2999
|
+
const v = this.options.lanes === 1 ? m[u - 1] : this.getFurthestMeasurement(m, u);
|
|
3000
|
+
S = v ? v.end + this.options.gap : s + i, p = v ? v.lane : u % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(u, p);
|
|
2928
3001
|
}
|
|
2929
|
-
const
|
|
2930
|
-
m[
|
|
2931
|
-
index:
|
|
2932
|
-
start:
|
|
3002
|
+
const M = c.get(h), g = typeof M == "number" ? M : this.options.estimateSize(u), y = S + g;
|
|
3003
|
+
m[u] = {
|
|
3004
|
+
index: u,
|
|
3005
|
+
start: S,
|
|
2933
3006
|
size: g,
|
|
2934
|
-
end:
|
|
2935
|
-
key:
|
|
3007
|
+
end: y,
|
|
3008
|
+
key: h,
|
|
2936
3009
|
lane: p
|
|
2937
|
-
}, f[p] =
|
|
3010
|
+
}, f[p] = u;
|
|
2938
3011
|
}
|
|
2939
3012
|
return this.measurementsCache = m, m;
|
|
2940
3013
|
},
|
|
@@ -2942,16 +3015,16 @@ class ls {
|
|
|
2942
3015
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2943
3016
|
debug: () => this.options.debug
|
|
2944
3017
|
}
|
|
2945
|
-
), this.calculateRange =
|
|
3018
|
+
), this.calculateRange = $(
|
|
2946
3019
|
() => [
|
|
2947
3020
|
this.getMeasurements(),
|
|
2948
3021
|
this.getSize(),
|
|
2949
3022
|
this.getScrollOffset(),
|
|
2950
3023
|
this.options.lanes
|
|
2951
3024
|
],
|
|
2952
|
-
(
|
|
2953
|
-
measurements:
|
|
2954
|
-
outerSize:
|
|
3025
|
+
(n, s, i, r) => this.range = n.length > 0 && s > 0 ? ps({
|
|
3026
|
+
measurements: n,
|
|
3027
|
+
outerSize: s,
|
|
2955
3028
|
scrollOffset: i,
|
|
2956
3029
|
lanes: r
|
|
2957
3030
|
}) : null,
|
|
@@ -2959,38 +3032,38 @@ class ls {
|
|
|
2959
3032
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2960
3033
|
debug: () => this.options.debug
|
|
2961
3034
|
}
|
|
2962
|
-
), this.getVirtualIndexes =
|
|
3035
|
+
), this.getVirtualIndexes = $(
|
|
2963
3036
|
() => {
|
|
2964
|
-
let
|
|
3037
|
+
let n = null, s = null;
|
|
2965
3038
|
const i = this.calculateRange();
|
|
2966
|
-
return i && (
|
|
3039
|
+
return i && (n = i.startIndex, s = i.endIndex), this.maybeNotify.updateDeps([this.isScrolling, n, s]), [
|
|
2967
3040
|
this.options.rangeExtractor,
|
|
2968
3041
|
this.options.overscan,
|
|
2969
3042
|
this.options.count,
|
|
2970
|
-
|
|
2971
|
-
|
|
3043
|
+
n,
|
|
3044
|
+
s
|
|
2972
3045
|
];
|
|
2973
3046
|
},
|
|
2974
|
-
(
|
|
3047
|
+
(n, s, i, r, o) => r === null || o === null ? [] : n({
|
|
2975
3048
|
startIndex: r,
|
|
2976
3049
|
endIndex: o,
|
|
2977
|
-
overscan:
|
|
3050
|
+
overscan: s,
|
|
2978
3051
|
count: i
|
|
2979
3052
|
}),
|
|
2980
3053
|
{
|
|
2981
3054
|
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
2982
3055
|
debug: () => this.options.debug
|
|
2983
3056
|
}
|
|
2984
|
-
), this.indexFromElement = (
|
|
2985
|
-
const
|
|
3057
|
+
), this.indexFromElement = (n) => {
|
|
3058
|
+
const s = this.options.indexAttribute, i = n.getAttribute(s);
|
|
2986
3059
|
return i ? parseInt(i, 10) : (console.warn(
|
|
2987
|
-
`Missing attribute name '${
|
|
3060
|
+
`Missing attribute name '${s}={index}' on measured element.`
|
|
2988
3061
|
), -1);
|
|
2989
|
-
}, this.shouldMeasureDuringScroll = (
|
|
2990
|
-
var
|
|
3062
|
+
}, this.shouldMeasureDuringScroll = (n) => {
|
|
3063
|
+
var s;
|
|
2991
3064
|
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
2992
3065
|
return !0;
|
|
2993
|
-
const i = this.scrollState.index ?? ((
|
|
3066
|
+
const i = this.scrollState.index ?? ((s = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : s.index);
|
|
2994
3067
|
if (i !== void 0 && this.range) {
|
|
2995
3068
|
const r = Math.max(
|
|
2996
3069
|
this.options.overscan,
|
|
@@ -2999,43 +3072,43 @@ class ls {
|
|
|
2999
3072
|
this.options.count - 1,
|
|
3000
3073
|
i + r
|
|
3001
3074
|
);
|
|
3002
|
-
return
|
|
3075
|
+
return n >= o && n <= l;
|
|
3003
3076
|
}
|
|
3004
3077
|
return !0;
|
|
3005
|
-
}, this._measureElement = (
|
|
3006
|
-
if (!
|
|
3007
|
-
this.observer.unobserve(
|
|
3078
|
+
}, this._measureElement = (n, s) => {
|
|
3079
|
+
if (!n.isConnected) {
|
|
3080
|
+
this.observer.unobserve(n);
|
|
3008
3081
|
return;
|
|
3009
3082
|
}
|
|
3010
|
-
const i = this.indexFromElement(
|
|
3083
|
+
const i = this.indexFromElement(n), r = this.measurementsCache[i];
|
|
3011
3084
|
if (!r)
|
|
3012
3085
|
return;
|
|
3013
3086
|
const o = r.key, l = this.elementsCache.get(o);
|
|
3014
|
-
l !==
|
|
3015
|
-
}, this.resizeItem = (
|
|
3087
|
+
l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(o, n)), this.shouldMeasureDuringScroll(i) && this.resizeItem(i, this.options.measureElement(n, s, this));
|
|
3088
|
+
}, this.resizeItem = (n, s) => {
|
|
3016
3089
|
var i;
|
|
3017
|
-
const r = this.measurementsCache[
|
|
3090
|
+
const r = this.measurementsCache[n];
|
|
3018
3091
|
if (!r)
|
|
3019
3092
|
return;
|
|
3020
|
-
const o = this.itemSizeCache.get(r.key) ?? r.size, l =
|
|
3093
|
+
const o = this.itemSizeCache.get(r.key) ?? r.size, l = s - o;
|
|
3021
3094
|
l !== 0 && (((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(r, l, this) : r.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
|
|
3022
3095
|
adjustments: this.scrollAdjustments += l,
|
|
3023
3096
|
behavior: void 0
|
|
3024
|
-
})), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key,
|
|
3025
|
-
}, this.measureElement = (
|
|
3026
|
-
if (!
|
|
3027
|
-
this.elementsCache.forEach((
|
|
3028
|
-
|
|
3097
|
+
})), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, s)), this.notify(!1));
|
|
3098
|
+
}, this.measureElement = (n) => {
|
|
3099
|
+
if (!n) {
|
|
3100
|
+
this.elementsCache.forEach((s, i) => {
|
|
3101
|
+
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(i));
|
|
3029
3102
|
});
|
|
3030
3103
|
return;
|
|
3031
3104
|
}
|
|
3032
|
-
this._measureElement(
|
|
3033
|
-
}, this.getVirtualItems =
|
|
3105
|
+
this._measureElement(n, void 0);
|
|
3106
|
+
}, this.getVirtualItems = $(
|
|
3034
3107
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
3035
|
-
(
|
|
3108
|
+
(n, s) => {
|
|
3036
3109
|
const i = [];
|
|
3037
|
-
for (let r = 0, o =
|
|
3038
|
-
const l =
|
|
3110
|
+
for (let r = 0, o = n.length; r < o; r++) {
|
|
3111
|
+
const l = n[r], c = s[l];
|
|
3039
3112
|
i.push(c);
|
|
3040
3113
|
}
|
|
3041
3114
|
return i;
|
|
@@ -3044,15 +3117,15 @@ class ls {
|
|
|
3044
3117
|
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
3045
3118
|
debug: () => this.options.debug
|
|
3046
3119
|
}
|
|
3047
|
-
), this.getVirtualItemForOffset = (
|
|
3048
|
-
const
|
|
3049
|
-
if (
|
|
3050
|
-
return
|
|
3051
|
-
|
|
3120
|
+
), this.getVirtualItemForOffset = (n) => {
|
|
3121
|
+
const s = this.getMeasurements();
|
|
3122
|
+
if (s.length !== 0)
|
|
3123
|
+
return ot(
|
|
3124
|
+
s[At(
|
|
3052
3125
|
0,
|
|
3053
|
-
|
|
3054
|
-
(i) =>
|
|
3055
|
-
|
|
3126
|
+
s.length - 1,
|
|
3127
|
+
(i) => ot(s[i]).start,
|
|
3128
|
+
n
|
|
3056
3129
|
)]
|
|
3057
3130
|
);
|
|
3058
3131
|
}, this.getMaxScrollOffset = () => {
|
|
@@ -3060,83 +3133,83 @@ class ls {
|
|
|
3060
3133
|
if ("scrollHeight" in this.scrollElement)
|
|
3061
3134
|
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
3062
3135
|
{
|
|
3063
|
-
const
|
|
3064
|
-
return this.options.horizontal ?
|
|
3136
|
+
const n = this.scrollElement.document.documentElement;
|
|
3137
|
+
return this.options.horizontal ? n.scrollWidth - this.scrollElement.innerWidth : n.scrollHeight - this.scrollElement.innerHeight;
|
|
3065
3138
|
}
|
|
3066
|
-
}, this.getOffsetForAlignment = (
|
|
3139
|
+
}, this.getOffsetForAlignment = (n, s, i = 0) => {
|
|
3067
3140
|
if (!this.scrollElement) return 0;
|
|
3068
3141
|
const r = this.getSize(), o = this.getScrollOffset();
|
|
3069
|
-
|
|
3142
|
+
s === "auto" && (s = n >= o + r ? "end" : "start"), s === "center" ? n += (i - r) / 2 : s === "end" && (n -= r);
|
|
3070
3143
|
const l = this.getMaxScrollOffset();
|
|
3071
|
-
return Math.max(Math.min(l,
|
|
3072
|
-
}, this.getOffsetForIndex = (
|
|
3073
|
-
|
|
3074
|
-
const i = this.getSize(), r = this.getScrollOffset(), o = this.measurementsCache[
|
|
3144
|
+
return Math.max(Math.min(l, n), 0);
|
|
3145
|
+
}, this.getOffsetForIndex = (n, s = "auto") => {
|
|
3146
|
+
n = Math.max(0, Math.min(n, this.options.count - 1));
|
|
3147
|
+
const i = this.getSize(), r = this.getScrollOffset(), o = this.measurementsCache[n];
|
|
3075
3148
|
if (!o) return;
|
|
3076
|
-
if (
|
|
3149
|
+
if (s === "auto")
|
|
3077
3150
|
if (o.end >= r + i - this.options.scrollPaddingEnd)
|
|
3078
|
-
|
|
3151
|
+
s = "end";
|
|
3079
3152
|
else if (o.start <= r + this.options.scrollPaddingStart)
|
|
3080
|
-
|
|
3153
|
+
s = "start";
|
|
3081
3154
|
else
|
|
3082
|
-
return [r,
|
|
3083
|
-
if (
|
|
3084
|
-
return [this.getMaxScrollOffset(),
|
|
3085
|
-
const l =
|
|
3155
|
+
return [r, s];
|
|
3156
|
+
if (s === "end" && n === this.options.count - 1)
|
|
3157
|
+
return [this.getMaxScrollOffset(), s];
|
|
3158
|
+
const l = s === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
|
|
3086
3159
|
return [
|
|
3087
|
-
this.getOffsetForAlignment(l,
|
|
3088
|
-
|
|
3160
|
+
this.getOffsetForAlignment(l, s, o.size),
|
|
3161
|
+
s
|
|
3089
3162
|
];
|
|
3090
|
-
}, this.scrollToOffset = (
|
|
3091
|
-
const r = this.getOffsetForAlignment(
|
|
3163
|
+
}, this.scrollToOffset = (n, { align: s = "start", behavior: i = "auto" } = {}) => {
|
|
3164
|
+
const r = this.getOffsetForAlignment(n, s), o = this.now();
|
|
3092
3165
|
this.scrollState = {
|
|
3093
3166
|
index: null,
|
|
3094
|
-
align:
|
|
3167
|
+
align: s,
|
|
3095
3168
|
behavior: i,
|
|
3096
3169
|
startedAt: o,
|
|
3097
3170
|
lastTargetOffset: r,
|
|
3098
3171
|
stableFrames: 0
|
|
3099
3172
|
}, this._scrollToOffset(r, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
|
|
3100
|
-
}, this.scrollToIndex = (
|
|
3101
|
-
align:
|
|
3173
|
+
}, this.scrollToIndex = (n, {
|
|
3174
|
+
align: s = "auto",
|
|
3102
3175
|
behavior: i = "auto"
|
|
3103
3176
|
} = {}) => {
|
|
3104
|
-
|
|
3105
|
-
const r = this.getOffsetForIndex(
|
|
3177
|
+
n = Math.max(0, Math.min(n, this.options.count - 1));
|
|
3178
|
+
const r = this.getOffsetForIndex(n, s);
|
|
3106
3179
|
if (!r)
|
|
3107
3180
|
return;
|
|
3108
3181
|
const [o, l] = r, c = this.now();
|
|
3109
3182
|
this.scrollState = {
|
|
3110
|
-
index:
|
|
3183
|
+
index: n,
|
|
3111
3184
|
align: l,
|
|
3112
3185
|
behavior: i,
|
|
3113
3186
|
startedAt: c,
|
|
3114
3187
|
lastTargetOffset: o,
|
|
3115
3188
|
stableFrames: 0
|
|
3116
3189
|
}, this._scrollToOffset(o, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
|
|
3117
|
-
}, this.scrollBy = (
|
|
3118
|
-
const i = this.getScrollOffset() +
|
|
3190
|
+
}, this.scrollBy = (n, { behavior: s = "auto" } = {}) => {
|
|
3191
|
+
const i = this.getScrollOffset() + n, r = this.now();
|
|
3119
3192
|
this.scrollState = {
|
|
3120
3193
|
index: null,
|
|
3121
3194
|
align: "start",
|
|
3122
|
-
behavior:
|
|
3195
|
+
behavior: s,
|
|
3123
3196
|
startedAt: r,
|
|
3124
3197
|
lastTargetOffset: i,
|
|
3125
3198
|
stableFrames: 0
|
|
3126
|
-
}, this._scrollToOffset(i, { adjustments: void 0, behavior:
|
|
3199
|
+
}, this._scrollToOffset(i, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
3127
3200
|
}, this.getTotalSize = () => {
|
|
3128
|
-
var
|
|
3129
|
-
const
|
|
3201
|
+
var n;
|
|
3202
|
+
const s = this.getMeasurements();
|
|
3130
3203
|
let i;
|
|
3131
|
-
if (
|
|
3204
|
+
if (s.length === 0)
|
|
3132
3205
|
i = this.options.paddingStart;
|
|
3133
3206
|
else if (this.options.lanes === 1)
|
|
3134
|
-
i = ((
|
|
3207
|
+
i = ((n = s[s.length - 1]) == null ? void 0 : n.end) ?? 0;
|
|
3135
3208
|
else {
|
|
3136
3209
|
const r = Array(this.options.lanes).fill(null);
|
|
3137
|
-
let o =
|
|
3210
|
+
let o = s.length - 1;
|
|
3138
3211
|
for (; o >= 0 && r.some((l) => l === null); ) {
|
|
3139
|
-
const l =
|
|
3212
|
+
const l = s[o];
|
|
3140
3213
|
r[l.lane] === null && (r[l.lane] = l.end), o--;
|
|
3141
3214
|
}
|
|
3142
3215
|
i = Math.max(...r.filter((l) => l !== null));
|
|
@@ -3145,11 +3218,11 @@ class ls {
|
|
|
3145
3218
|
i - this.options.scrollMargin + this.options.paddingEnd,
|
|
3146
3219
|
0
|
|
3147
3220
|
);
|
|
3148
|
-
}, this._scrollToOffset = (
|
|
3149
|
-
adjustments:
|
|
3221
|
+
}, this._scrollToOffset = (n, {
|
|
3222
|
+
adjustments: s,
|
|
3150
3223
|
behavior: i
|
|
3151
3224
|
}) => {
|
|
3152
|
-
this.options.scrollToFn(
|
|
3225
|
+
this.options.scrollToFn(n, { behavior: i, adjustments: s }, this);
|
|
3153
3226
|
}, this.measure = () => {
|
|
3154
3227
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
3155
3228
|
}, this.setOptions(e);
|
|
@@ -3169,8 +3242,8 @@ class ls {
|
|
|
3169
3242
|
this.scrollState = null;
|
|
3170
3243
|
return;
|
|
3171
3244
|
}
|
|
3172
|
-
const
|
|
3173
|
-
if (!o &&
|
|
3245
|
+
const s = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = s ? s[0] : this.scrollState.lastTargetOffset, r = 1, o = i !== this.scrollState.lastTargetOffset;
|
|
3246
|
+
if (!o && ls(i, this.getScrollOffset())) {
|
|
3174
3247
|
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= r) {
|
|
3175
3248
|
this.scrollState = null;
|
|
3176
3249
|
return;
|
|
@@ -3183,190 +3256,197 @@ class ls {
|
|
|
3183
3256
|
this.scheduleScrollReconcile();
|
|
3184
3257
|
}
|
|
3185
3258
|
}
|
|
3186
|
-
const
|
|
3187
|
-
for (;
|
|
3188
|
-
const i = (
|
|
3189
|
-
if (r <
|
|
3190
|
-
|
|
3191
|
-
else if (r >
|
|
3259
|
+
const At = (t, e, n, s) => {
|
|
3260
|
+
for (; t <= e; ) {
|
|
3261
|
+
const i = (t + e) / 2 | 0, r = n(i);
|
|
3262
|
+
if (r < s)
|
|
3263
|
+
t = i + 1;
|
|
3264
|
+
else if (r > s)
|
|
3192
3265
|
e = i - 1;
|
|
3193
3266
|
else
|
|
3194
3267
|
return i;
|
|
3195
3268
|
}
|
|
3196
|
-
return
|
|
3269
|
+
return t > 0 ? t - 1 : 0;
|
|
3197
3270
|
};
|
|
3198
|
-
function
|
|
3199
|
-
measurements:
|
|
3271
|
+
function ps({
|
|
3272
|
+
measurements: t,
|
|
3200
3273
|
outerSize: e,
|
|
3201
|
-
scrollOffset:
|
|
3202
|
-
lanes:
|
|
3274
|
+
scrollOffset: n,
|
|
3275
|
+
lanes: s
|
|
3203
3276
|
}) {
|
|
3204
|
-
const i =
|
|
3205
|
-
if (
|
|
3277
|
+
const i = t.length - 1, r = (c) => t[c].start;
|
|
3278
|
+
if (t.length <= s)
|
|
3206
3279
|
return {
|
|
3207
3280
|
startIndex: 0,
|
|
3208
3281
|
endIndex: i
|
|
3209
3282
|
};
|
|
3210
|
-
let o =
|
|
3283
|
+
let o = At(
|
|
3211
3284
|
0,
|
|
3212
3285
|
i,
|
|
3213
3286
|
r,
|
|
3214
|
-
|
|
3287
|
+
n
|
|
3215
3288
|
), l = o;
|
|
3216
|
-
if (
|
|
3217
|
-
for (; l < i &&
|
|
3289
|
+
if (s === 1)
|
|
3290
|
+
for (; l < i && t[l].end < n + e; )
|
|
3218
3291
|
l++;
|
|
3219
|
-
else if (
|
|
3220
|
-
const c = Array(
|
|
3221
|
-
for (; l < i && c.some((m) => m <
|
|
3222
|
-
const m =
|
|
3292
|
+
else if (s > 1) {
|
|
3293
|
+
const c = Array(s).fill(0);
|
|
3294
|
+
for (; l < i && c.some((m) => m < n + e); ) {
|
|
3295
|
+
const m = t[l];
|
|
3223
3296
|
c[m.lane] = m.end, l++;
|
|
3224
3297
|
}
|
|
3225
|
-
const
|
|
3226
|
-
for (; o >= 0 &&
|
|
3227
|
-
const m =
|
|
3228
|
-
|
|
3298
|
+
const d = Array(s).fill(n + e);
|
|
3299
|
+
for (; o >= 0 && d.some((m) => m >= n); ) {
|
|
3300
|
+
const m = t[o];
|
|
3301
|
+
d[m.lane] = m.start, o--;
|
|
3229
3302
|
}
|
|
3230
|
-
o = Math.max(0, o - o %
|
|
3303
|
+
o = Math.max(0, o - o % s), l = Math.min(i, l + (s - 1 - l % s));
|
|
3231
3304
|
}
|
|
3232
3305
|
return { startIndex: o, endIndex: l };
|
|
3233
3306
|
}
|
|
3234
|
-
const
|
|
3235
|
-
function
|
|
3236
|
-
useFlushSync:
|
|
3307
|
+
const dt = typeof document < "u" ? ie.useLayoutEffect : ie.useEffect;
|
|
3308
|
+
function ys({
|
|
3309
|
+
useFlushSync: t = !0,
|
|
3237
3310
|
...e
|
|
3238
3311
|
}) {
|
|
3239
|
-
const
|
|
3312
|
+
const n = ie.useReducer(() => ({}), {})[1], s = {
|
|
3240
3313
|
...e,
|
|
3241
3314
|
onChange: (r, o) => {
|
|
3242
3315
|
var l;
|
|
3243
|
-
|
|
3316
|
+
t && o ? qt(n) : n(), (l = e.onChange) == null || l.call(e, r, o);
|
|
3244
3317
|
}
|
|
3245
|
-
}, [i] =
|
|
3246
|
-
() => new
|
|
3318
|
+
}, [i] = ie.useState(
|
|
3319
|
+
() => new fs(s)
|
|
3247
3320
|
);
|
|
3248
|
-
return i.setOptions(
|
|
3321
|
+
return i.setOptions(s), dt(() => i._didMount(), []), dt(() => i._willUpdate()), i;
|
|
3249
3322
|
}
|
|
3250
|
-
function
|
|
3251
|
-
return
|
|
3252
|
-
observeElementRect:
|
|
3253
|
-
observeElementOffset:
|
|
3254
|
-
scrollToFn:
|
|
3255
|
-
...
|
|
3323
|
+
function vs(t) {
|
|
3324
|
+
return ys({
|
|
3325
|
+
observeElementRect: us,
|
|
3326
|
+
observeElementOffset: hs,
|
|
3327
|
+
scrollToFn: gs,
|
|
3328
|
+
...t
|
|
3256
3329
|
});
|
|
3257
3330
|
}
|
|
3258
|
-
function
|
|
3259
|
-
const
|
|
3260
|
-
|
|
3331
|
+
function Ss(t, e) {
|
|
3332
|
+
const n = [], s = (i) => {
|
|
3333
|
+
n.push(i), !e.some((o) => o === i.getId()) && i.getChildren().length > 0 && i.getChildren().forEach((o) => s(o));
|
|
3261
3334
|
};
|
|
3262
|
-
return
|
|
3335
|
+
return t.forEach((i) => s(i)), n;
|
|
3263
3336
|
}
|
|
3264
|
-
const
|
|
3265
|
-
const o =
|
|
3266
|
-
() =>
|
|
3267
|
-
[e,
|
|
3268
|
-
), l =
|
|
3269
|
-
const m = o[
|
|
3337
|
+
const As = (t, e, n, s, i, r) => {
|
|
3338
|
+
const o = F(
|
|
3339
|
+
() => Ss(e, n),
|
|
3340
|
+
[e, n]
|
|
3341
|
+
), l = C((d) => {
|
|
3342
|
+
const m = o[d];
|
|
3270
3343
|
return m && m.getMilestoneApis().some(
|
|
3271
|
-
(
|
|
3272
|
-
) ?
|
|
3273
|
-
}, [o,
|
|
3274
|
-
return { virtualizer:
|
|
3344
|
+
(u) => !u.getTime().isBefore(i) && !u.getTime().isAfter(r)
|
|
3345
|
+
) ? s * mt : s;
|
|
3346
|
+
}, [o, s, i, r]);
|
|
3347
|
+
return { virtualizer: vs({
|
|
3275
3348
|
count: o.length,
|
|
3276
|
-
getScrollElement: () =>
|
|
3349
|
+
getScrollElement: () => t.current,
|
|
3277
3350
|
estimateSize: l,
|
|
3278
3351
|
overscan: 5
|
|
3279
3352
|
}), visibleResources: o };
|
|
3280
|
-
},
|
|
3281
|
-
const { state: e, dispatch:
|
|
3282
|
-
start:
|
|
3353
|
+
}, Ys = (t) => /* @__PURE__ */ a($t, { children: /* @__PURE__ */ a(Ms, { ...t }) }), Ms = (t) => {
|
|
3354
|
+
const { state: e, dispatch: n } = De(), s = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
|
|
3355
|
+
start: d,
|
|
3283
3356
|
end: m,
|
|
3284
3357
|
editable: f,
|
|
3285
|
-
selectable:
|
|
3286
|
-
lineHeight:
|
|
3287
|
-
slotMinWidth:
|
|
3358
|
+
selectable: u,
|
|
3359
|
+
lineHeight: h,
|
|
3360
|
+
slotMinWidth: A,
|
|
3288
3361
|
schedulantMaxHeight: p,
|
|
3289
|
-
schedulantViewType:
|
|
3290
|
-
events:
|
|
3362
|
+
schedulantViewType: S,
|
|
3363
|
+
events: M,
|
|
3291
3364
|
resources: g,
|
|
3292
|
-
milestones:
|
|
3293
|
-
checkpoints:
|
|
3294
|
-
resourceAreaColumns:
|
|
3295
|
-
resourceAreaWidth:
|
|
3365
|
+
milestones: y,
|
|
3366
|
+
checkpoints: v,
|
|
3367
|
+
resourceAreaColumns: b,
|
|
3368
|
+
resourceAreaWidth: T,
|
|
3296
3369
|
companyHolidays: D,
|
|
3297
|
-
specialWorkdays:
|
|
3298
|
-
nationalHolidays:
|
|
3299
|
-
dragHintColor:
|
|
3300
|
-
selectionColor:
|
|
3301
|
-
} =
|
|
3302
|
-
() => new
|
|
3370
|
+
specialWorkdays: O,
|
|
3371
|
+
nationalHolidays: P,
|
|
3372
|
+
dragHintColor: Y,
|
|
3373
|
+
selectionColor: z
|
|
3374
|
+
} = t, _ = F(
|
|
3375
|
+
() => new Xn(t, s),
|
|
3303
3376
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3304
3377
|
[
|
|
3305
|
-
|
|
3378
|
+
d,
|
|
3306
3379
|
m,
|
|
3307
3380
|
f,
|
|
3381
|
+
u,
|
|
3308
3382
|
h,
|
|
3309
|
-
d,
|
|
3310
|
-
v,
|
|
3311
|
-
p,
|
|
3312
|
-
y,
|
|
3313
|
-
b,
|
|
3314
|
-
g,
|
|
3315
3383
|
A,
|
|
3384
|
+
p,
|
|
3316
3385
|
S,
|
|
3317
3386
|
M,
|
|
3318
|
-
|
|
3387
|
+
g,
|
|
3388
|
+
y,
|
|
3389
|
+
v,
|
|
3390
|
+
b,
|
|
3391
|
+
T,
|
|
3319
3392
|
D,
|
|
3393
|
+
O,
|
|
3320
3394
|
P,
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
H
|
|
3395
|
+
Y,
|
|
3396
|
+
z
|
|
3324
3397
|
]
|
|
3325
|
-
), R =
|
|
3326
|
-
R.updateProps(
|
|
3327
|
-
const
|
|
3398
|
+
), R = F(() => _.getScheduleApi(), [_]);
|
|
3399
|
+
R.updateProps(t);
|
|
3400
|
+
const V = F(() => ({
|
|
3328
3401
|
"--schedulant-drag-hint-color": R.getDragHintColor(),
|
|
3329
3402
|
"--schedulant-selection-color": R.getSelectionColor()
|
|
3330
3403
|
}), [R]), {
|
|
3331
|
-
datagridResizerMouseUp:
|
|
3332
|
-
datagridResizerMouseDown:
|
|
3333
|
-
datagridCellResizerMouseUp:
|
|
3334
|
-
datagridCellResizerMouseDownFunc:
|
|
3335
|
-
} =
|
|
3404
|
+
datagridResizerMouseUp: q,
|
|
3405
|
+
datagridResizerMouseDown: Q,
|
|
3406
|
+
datagridCellResizerMouseUp: Ie,
|
|
3407
|
+
datagridCellResizerMouseDownFunc: Oe
|
|
3408
|
+
} = cn(n, s, c), Pe = R.getTimelineApi(), { virtualizer: Le, visibleResources: ne } = As(
|
|
3336
3409
|
o,
|
|
3337
3410
|
R.getResourceApis(),
|
|
3338
3411
|
e.collapseIds,
|
|
3339
3412
|
R.getLineHeight(),
|
|
3340
|
-
|
|
3341
|
-
|
|
3413
|
+
Pe.getStart(),
|
|
3414
|
+
Pe.getEnd()
|
|
3342
3415
|
);
|
|
3343
|
-
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3346
|
-
|
|
3416
|
+
Jt(t.schedulantMaxHeight), os(s, _), tn(c, t.resourceAreaWidth), en(l, o, i, r);
|
|
3417
|
+
const ce = k(R.onResourceSelect());
|
|
3418
|
+
ce.current = R.onResourceSelect();
|
|
3419
|
+
const Ne = C((U) => {
|
|
3420
|
+
ce.current?.(U);
|
|
3421
|
+
}, []), Ye = F(
|
|
3422
|
+
() => ne.map((U) => U.getId()),
|
|
3423
|
+
[ne]
|
|
3424
|
+
), _e = C((U) => {
|
|
3425
|
+
R.isSelectable() && gn(U.nativeEvent, Ye, Ne);
|
|
3426
|
+
}, [R, Ye, Ne]);
|
|
3347
3427
|
return N(() => {
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3428
|
+
const U = (Mt) => {
|
|
3429
|
+
s.current && !s.current.contains(Mt.target) && Te(ce.current);
|
|
3350
3430
|
};
|
|
3351
|
-
return document.addEventListener("click",
|
|
3352
|
-
}, []), /* @__PURE__ */ a("div", { className: "schedulant", ref:
|
|
3353
|
-
/* @__PURE__ */
|
|
3431
|
+
return document.addEventListener("click", U), () => document.removeEventListener("click", U);
|
|
3432
|
+
}, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick: _e, onContextMenu: _e, style: V, children: /* @__PURE__ */ a("div", { id: "schedulant-view-harness", className: "schedulant-view-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-view", children: /* @__PURE__ */ I("table", { role: "grid", className: "schedulant-scrollgrid", children: [
|
|
3433
|
+
/* @__PURE__ */ I("colgroup", { children: [
|
|
3354
3434
|
/* @__PURE__ */ a("col", { style: { width: e.resourceAreaWidth }, ref: c }),
|
|
3355
3435
|
/* @__PURE__ */ a("col", {}),
|
|
3356
3436
|
/* @__PURE__ */ a("col", {})
|
|
3357
3437
|
] }),
|
|
3358
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ I(
|
|
3359
3439
|
"tr",
|
|
3360
3440
|
{
|
|
3361
3441
|
role: "presentation",
|
|
3362
3442
|
className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-head",
|
|
3363
3443
|
children: [
|
|
3364
3444
|
/* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-left", ref: i, children: /* @__PURE__ */ a(
|
|
3365
|
-
|
|
3445
|
+
Qn,
|
|
3366
3446
|
{
|
|
3367
|
-
schedulantView:
|
|
3368
|
-
cellResizerMouseUp:
|
|
3369
|
-
cellResizerMouseDownFunc:
|
|
3447
|
+
schedulantView: _,
|
|
3448
|
+
cellResizerMouseUp: Ie,
|
|
3449
|
+
cellResizerMouseDownFunc: Oe
|
|
3370
3450
|
}
|
|
3371
3451
|
) }) }) }),
|
|
3372
3452
|
/* @__PURE__ */ a(
|
|
@@ -3374,8 +3454,8 @@ const hs = (s, e, t, n, i, r) => {
|
|
|
3374
3454
|
{
|
|
3375
3455
|
role: "presentation",
|
|
3376
3456
|
className: "schedulant-resource-timeline-divider",
|
|
3377
|
-
onMouseUp:
|
|
3378
|
-
onMouseDown:
|
|
3457
|
+
onMouseUp: q,
|
|
3458
|
+
onMouseDown: Q
|
|
3379
3459
|
}
|
|
3380
3460
|
),
|
|
3381
3461
|
/* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-right", ref: r, children: /* @__PURE__ */ a(
|
|
@@ -3383,27 +3463,27 @@ const hs = (s, e, t, n, i, r) => {
|
|
|
3383
3463
|
{
|
|
3384
3464
|
id: "schedulant-timeline-head",
|
|
3385
3465
|
className: "schedulant-timeline-head",
|
|
3386
|
-
children: /* @__PURE__ */ a(
|
|
3466
|
+
children: /* @__PURE__ */ a(Kn, { schedulantView: _ })
|
|
3387
3467
|
}
|
|
3388
3468
|
) }) }) })
|
|
3389
3469
|
]
|
|
3390
3470
|
}
|
|
3391
3471
|
) }),
|
|
3392
|
-
/* @__PURE__ */ a("tbody", { children: /* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ I(
|
|
3393
3473
|
"tr",
|
|
3394
3474
|
{
|
|
3395
3475
|
role: "presentation",
|
|
3396
3476
|
className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-body",
|
|
3397
3477
|
children: [
|
|
3398
3478
|
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-left", ref: l, children: /* @__PURE__ */ a(
|
|
3399
|
-
|
|
3479
|
+
ns,
|
|
3400
3480
|
{
|
|
3401
|
-
schedulantView:
|
|
3402
|
-
virtualizer:
|
|
3403
|
-
visibleResources:
|
|
3481
|
+
schedulantView: _,
|
|
3482
|
+
virtualizer: Le,
|
|
3483
|
+
visibleResources: ne,
|
|
3404
3484
|
collapseIds: e.collapseIds,
|
|
3405
|
-
cellResizerMouseUp:
|
|
3406
|
-
cellResizerMouseDownFunc:
|
|
3485
|
+
cellResizerMouseUp: Ie,
|
|
3486
|
+
cellResizerMouseDownFunc: Oe
|
|
3407
3487
|
}
|
|
3408
3488
|
) }) }) }),
|
|
3409
3489
|
/* @__PURE__ */ a(
|
|
@@ -3411,18 +3491,18 @@ const hs = (s, e, t, n, i, r) => {
|
|
|
3411
3491
|
{
|
|
3412
3492
|
role: "presentation",
|
|
3413
3493
|
className: "schedulant-resource-timeline-divider",
|
|
3414
|
-
onMouseUp:
|
|
3415
|
-
onMouseDown:
|
|
3494
|
+
onMouseUp: q,
|
|
3495
|
+
onMouseDown: Q
|
|
3416
3496
|
}
|
|
3417
3497
|
),
|
|
3418
|
-
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-right", ref: o, children: /* @__PURE__ */
|
|
3419
|
-
/* @__PURE__ */ a(
|
|
3498
|
+
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-right", ref: o, children: /* @__PURE__ */ I("div", { className: "schedulant-timeline-body", children: [
|
|
3499
|
+
/* @__PURE__ */ a(ss, { schedulantView: _ }),
|
|
3420
3500
|
/* @__PURE__ */ a(
|
|
3421
|
-
|
|
3501
|
+
rs,
|
|
3422
3502
|
{
|
|
3423
|
-
schedulantView:
|
|
3424
|
-
virtualizer:
|
|
3425
|
-
visibleResources:
|
|
3503
|
+
schedulantView: _,
|
|
3504
|
+
virtualizer: Le,
|
|
3505
|
+
visibleResources: ne
|
|
3426
3506
|
}
|
|
3427
3507
|
)
|
|
3428
3508
|
] }) }) }) })
|
|
@@ -3432,5 +3512,5 @@ const hs = (s, e, t, n, i, r) => {
|
|
|
3432
3512
|
] }) }) }) });
|
|
3433
3513
|
};
|
|
3434
3514
|
export {
|
|
3435
|
-
|
|
3515
|
+
Ys as Schedulant
|
|
3436
3516
|
};
|