@xpyjs/gantt-core 0.0.1-rc.4 → 0.0.1-rc.5
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/x-gantt.js +442 -438
- package/dist/x-gantt.umd.cjs +2 -2
- package/package.json +1 -1
- package/types/rendering/Renderer.d.ts +1 -0
- package/types/types/options.d.ts +7 -1
package/dist/x-gantt.js
CHANGED
|
@@ -3,10 +3,10 @@ var Yt = (f, t, e) => t in f ? Pt(f, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var h = (f, t, e) => Yt(f, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import G from "dayjs";
|
|
5
5
|
import { default as ai } from "dayjs";
|
|
6
|
-
import { merge as rt, isArray as X, isString as
|
|
6
|
+
import { merge as rt, isArray as X, isString as V, isFunction as j, cloneDeep as Z, isObject as Et, isNumber as Ut, omit as yt, throttle as wt, isBoolean as ht, debounce as Xt } from "lodash-es";
|
|
7
7
|
import S from "konva";
|
|
8
|
-
const Ct = "0.0.1-rc.
|
|
9
|
-
function
|
|
8
|
+
const Ct = "0.0.1-rc.5";
|
|
9
|
+
function Vt() {
|
|
10
10
|
const f = "#eca710", t = "#ffffff", e = "#e7209e", i = "#ffffff", s = "#1c42e8";
|
|
11
11
|
[
|
|
12
12
|
" __ __ _____ _____ _____ _____ _____ ",
|
|
@@ -316,7 +316,7 @@ const lt = () => ({
|
|
|
316
316
|
opacity: 0.1
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
|
-
class
|
|
319
|
+
class Kt {
|
|
320
320
|
constructor() {
|
|
321
321
|
h(this, "options", lt());
|
|
322
322
|
}
|
|
@@ -354,7 +354,7 @@ class Vt {
|
|
|
354
354
|
var s;
|
|
355
355
|
let e = "";
|
|
356
356
|
const i = (s = this.options.row) == null ? void 0 : s.backgroundColor;
|
|
357
|
-
return
|
|
357
|
+
return V(i) ? e = i : X(i) && i.length > 0 ? e = i[t.level] : j(i) && (e = i(t.getEmitData())), e;
|
|
358
358
|
}
|
|
359
359
|
unpackFunc(t, e) {
|
|
360
360
|
return j(t) ? t(e.getEmitData()) : t;
|
|
@@ -413,7 +413,7 @@ function $(f, t, e) {
|
|
|
413
413
|
}
|
|
414
414
|
function nt(f, t) {
|
|
415
415
|
let e = f;
|
|
416
|
-
return
|
|
416
|
+
return V(e) && (/%$/.test(e) ? e = t * parseFloat(e) / 100 : e = parseFloat(e)), isNaN(e) ? 0 : e;
|
|
417
417
|
}
|
|
418
418
|
function ct(f, t) {
|
|
419
419
|
if (t === 0)
|
|
@@ -448,10 +448,10 @@ function bt(f, t = 16, e = 16) {
|
|
|
448
448
|
const s = new Promise((n, o) => {
|
|
449
449
|
let r = f;
|
|
450
450
|
if (!/viewBox\s*=\s*["'][^"']*["']/.test(r)) {
|
|
451
|
-
const l = r.match(/width\s*=\s*["']([^"']*)["']/), m = r.match(/height\s*=\s*["']([^"']*)["']/), p = l ? parseFloat(l[1]) : t,
|
|
451
|
+
const l = r.match(/width\s*=\s*["']([^"']*)["']/), m = r.match(/height\s*=\s*["']([^"']*)["']/), p = l ? parseFloat(l[1]) : t, u = m ? parseFloat(m[1]) : e;
|
|
452
452
|
r = r.replace(
|
|
453
453
|
/<svg([^>]*)>/,
|
|
454
|
-
`<svg$1 viewBox="0 0 ${p} ${
|
|
454
|
+
`<svg$1 viewBox="0 0 ${p} ${u}">`
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
457
|
r = r.replace(/width\s*=\s*["'][^"']*["']/, `width="${t}"`), r = r.replace(/height\s*=\s*["'][^"']*["']/, `height="${e}"`), /width\s*=/.test(r) || (r = r.replace(/<svg/, `<svg width="${t}"`)), /height\s*=/.test(r) || (r = r.replace(/<svg/, `<svg height="${e}"`)), /preserveAspectRatio\s*=/.test(r) || (r = r.replace(
|
|
@@ -464,7 +464,7 @@ function bt(f, t = 16, e = 16) {
|
|
|
464
464
|
}, c.onerror = (l) => {
|
|
465
465
|
URL.revokeObjectURL(c.src), dt.delete(f), o(l);
|
|
466
466
|
};
|
|
467
|
-
const
|
|
467
|
+
const g = new Blob([r], { type: "image/svg+xml" }), d = URL.createObjectURL(g);
|
|
468
468
|
c.src = d;
|
|
469
469
|
});
|
|
470
470
|
return dt.set(f, s), s;
|
|
@@ -532,7 +532,7 @@ class mt {
|
|
|
532
532
|
this.store = t, this.event = e, this.fields = this.store.getOptionManager().getOptions().fields, this.id = n || i[this.fields.id] || Q(), this.data = i, this.name = i[this.fields.name] || "", this.type = i[this.fields.type] || "task", this.updateMode(), this.progress = i[this.fields.progress], this.expanded = this.store.getOptionManager().getOptions().expand.show ? this.store.getOptionManager().getOptions().expand.enabled : !0, this.children = [], this.level = s && s.level !== void 0 ? s.level + 1 : 0, this.parent = s, this.flatIndex = 0, this.store.updateTime(this.startTime, this.endTime);
|
|
533
533
|
}
|
|
534
534
|
getField(t) {
|
|
535
|
-
if (!t ||
|
|
535
|
+
if (!t || V(t) && t.trim() === "")
|
|
536
536
|
return;
|
|
537
537
|
if (!t.includes("."))
|
|
538
538
|
return this.data[t];
|
|
@@ -635,8 +635,8 @@ class Qt {
|
|
|
635
635
|
if (!this.validate()) return null;
|
|
636
636
|
const t = this.store.getDataManager().getTaskById(this.taskId);
|
|
637
637
|
if (!t || !t.startTime || !t.endTime) return null;
|
|
638
|
-
const e = this.store.getTimeAxis().getCellUnit(), i = this.startTime.diff(t.startTime, e, !0), s = this.endTime.diff(t.endTime, e, !0), n = this.store.getOptionManager().getOptions().baselines.compare.tolerance, o = i < -n ? "delayed" : i > n ? "ahead" : "ontime", r = s < -n ? "delayed" : s > n ? "ahead" : "ontime", a = this.endTime.diff(this.startTime, e, !0), c = t.endTime.diff(t.startTime, e, !0),
|
|
639
|
-
return { startDiff: i, endDiff: s, startStatus: o, endStatus: r, progressDiff:
|
|
638
|
+
const e = this.store.getTimeAxis().getCellUnit(), i = this.startTime.diff(t.startTime, e, !0), s = this.endTime.diff(t.endTime, e, !0), n = this.store.getOptionManager().getOptions().baselines.compare.tolerance, o = i < -n ? "delayed" : i > n ? "ahead" : "ontime", r = s < -n ? "delayed" : s > n ? "ahead" : "ontime", a = this.endTime.diff(this.startTime, e, !0), c = t.endTime.diff(t.startTime, e, !0), g = a > 0 ? (c - a) / a * 100 : 0;
|
|
639
|
+
return { startDiff: i, endDiff: s, startStatus: o, endStatus: r, progressDiff: g, unit: e };
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
class Jt {
|
|
@@ -754,7 +754,7 @@ class Jt {
|
|
|
754
754
|
const s = this.store.getOptionManager().getOptions().fields.id, n = (o = e.parent) == null ? void 0 : o.children.findIndex((r) => r.id === t);
|
|
755
755
|
if (n !== void 0 && n > -1 && e.parent) {
|
|
756
756
|
e.parent.children.splice(n, 1);
|
|
757
|
-
const r = this.store.getOptionManager().getOptions().fields.children, a = e.parent.data[r] || [], c = a.findIndex((
|
|
757
|
+
const r = this.store.getOptionManager().getOptions().fields.children, a = e.parent.data[r] || [], c = a.findIndex((g) => g[s] === t);
|
|
758
758
|
c !== -1 && (a.splice(c, 1), i = !0);
|
|
759
759
|
} else {
|
|
760
760
|
const r = this.tasks.findIndex((a) => a.id === t);
|
|
@@ -966,21 +966,21 @@ class Jt {
|
|
|
966
966
|
}
|
|
967
967
|
updateTaskTime(t, e, i, s, n = []) {
|
|
968
968
|
let o = e, r = i;
|
|
969
|
-
const a = this.store.getOptionManager().getOptions().bar.move.link.child, c = this.store.getOptionManager().getOptions().bar.move.link.parent,
|
|
969
|
+
const a = this.store.getOptionManager().getOptions().bar.move.link.child, c = this.store.getOptionManager().getOptions().bar.move.link.parent, g = this.store.getTimeAxis().getCellUnit();
|
|
970
970
|
let d = t.parent;
|
|
971
971
|
for (; c !== "none" && d; ) {
|
|
972
972
|
if (c === "expand") {
|
|
973
973
|
let m = d.startTime || o, p = d.endTime || r;
|
|
974
|
-
(!d.startTime || o.isBefore(d.startTime)) && (m = o), (!d.endTime || r.isAfter(d.endTime)) && (p = r), (d.startTime === void 0 || d.endTime === void 0 || !m.isSame(d.startTime) || !p.isSame(d.endTime)) && (n.findIndex((
|
|
975
|
-
} else c === "strict" && (d.startTime && o.isBefore(d.startTime) && (o = d.startTime, r.isSameOrBefore(o) && (r = o.add(1,
|
|
974
|
+
(!d.startTime || o.isBefore(d.startTime)) && (m = o), (!d.endTime || r.isAfter(d.endTime)) && (p = r), (d.startTime === void 0 || d.endTime === void 0 || !m.isSame(d.startTime) || !p.isSame(d.endTime)) && (n.findIndex((u) => u.id === d.id) === -1 && n.push(d.clone()), d.updateTime(m, p));
|
|
975
|
+
} else c === "strict" && (d.startTime && o.isBefore(d.startTime) && (o = d.startTime, r.isSameOrBefore(o) && (r = o.add(1, g))), d.endTime && r.isAfter(d.endTime) && (r = d.endTime, o.isAfter(r) && (o = r.subtract(1, g))));
|
|
976
976
|
d = d.parent;
|
|
977
977
|
}
|
|
978
978
|
let l = t.children || [];
|
|
979
979
|
for (; a !== "none" && l.length > 0; ) {
|
|
980
980
|
const m = [];
|
|
981
981
|
l.forEach((p) => {
|
|
982
|
-
let
|
|
983
|
-
a === "scale" ? s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(
|
|
982
|
+
let u = p.startTime || o, y = p.endTime || r, x = o.diff(t.startTime), T = r.diff(t.endTime);
|
|
983
|
+
a === "scale" ? s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? (u = u.add(x), u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && (y = y.add(T), y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : a === "fixed" && (s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? u.isSameOrBefore(o) && (u = o, u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && y.isSameOrAfter(r) && (y = r, y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y))), p.children && p.children.length > 0 && m.push(...p.children);
|
|
984
984
|
}), l = m;
|
|
985
985
|
}
|
|
986
986
|
n.findIndex((m) => m.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, r);
|
|
@@ -1020,7 +1020,7 @@ function Zt(f) {
|
|
|
1020
1020
|
const e = (s = document == null ? void 0 : document.createElement("canvas")) == null ? void 0 : s.getContext("2d");
|
|
1021
1021
|
if (e && (e.fillStyle = t, t = e.fillStyle), t.startsWith("#")) {
|
|
1022
1022
|
const n = t.slice(1);
|
|
1023
|
-
let o, r, a, c,
|
|
1023
|
+
let o, r, a, c, g = 1;
|
|
1024
1024
|
try {
|
|
1025
1025
|
o = parseInt(n, 16);
|
|
1026
1026
|
} catch {
|
|
@@ -1031,10 +1031,10 @@ function Zt(f) {
|
|
|
1031
1031
|
else if (n.length === 6)
|
|
1032
1032
|
r = o >> 16 & 255, a = o >> 8 & 255, c = o & 255;
|
|
1033
1033
|
else if (n.length === 8)
|
|
1034
|
-
r = o >> 24 & 255, a = o >> 16 & 255, c = o >> 8 & 255,
|
|
1034
|
+
r = o >> 24 & 255, a = o >> 16 & 255, c = o >> 8 & 255, g = (o & 255) / 255;
|
|
1035
1035
|
else
|
|
1036
1036
|
return O.warn(`Invalid hex color length: ${f}`), null;
|
|
1037
|
-
return { r, g: a, b: c, a:
|
|
1037
|
+
return { r, g: a, b: c, a: g };
|
|
1038
1038
|
}
|
|
1039
1039
|
let i = t.match(
|
|
1040
1040
|
/rgba?\(\s*(\d+%?)\s*,\s*(\d+%?)\s*,\s*(\d+%?)\s*(?:,\s*([\d.]+)\s*)?\)/i
|
|
@@ -1054,12 +1054,12 @@ function te(f, t, e, i, s = !1, n = !1) {
|
|
|
1054
1054
|
const o = (l) => {
|
|
1055
1055
|
const m = Math.round($(l, 0, 255)).toString(16);
|
|
1056
1056
|
return m.length === 1 ? "0" + m : m;
|
|
1057
|
-
}, r = o(f), a = o(t), c = o(e),
|
|
1057
|
+
}, r = o(f), a = o(t), c = o(e), g = o(i * 255);
|
|
1058
1058
|
if (s && r[0] === r[1] && a[0] === a[1] && c[0] === c[1] && i === 1 && // Alpha 必须为 1 才能缩写
|
|
1059
1059
|
!n)
|
|
1060
1060
|
return `#${r[0]}${a[0]}${c[0]}`;
|
|
1061
1061
|
const d = `#${r}${a}${c}`;
|
|
1062
|
-
return n || i < 1 ? `${d}${
|
|
1062
|
+
return n || i < 1 ? `${d}${g}` : d;
|
|
1063
1063
|
}
|
|
1064
1064
|
class et {
|
|
1065
1065
|
/**
|
|
@@ -1424,15 +1424,15 @@ class ee {
|
|
|
1424
1424
|
const r = "children" in n && Array.isArray(n.children) && n.children.length > 0, a = !r;
|
|
1425
1425
|
let c = "";
|
|
1426
1426
|
r ? c = `group-${o}` : c = `field-${n.field}`;
|
|
1427
|
-
const
|
|
1428
|
-
c = "column-" + o + "-" +
|
|
1429
|
-
const d = n.label || (a ? n.field : ""), l = a ? ((p = this.temporaryLeafColumns.find((
|
|
1427
|
+
const g = [...(i == null ? void 0 : i.path) || [], c];
|
|
1428
|
+
c = "column-" + o + "-" + g.join("-");
|
|
1429
|
+
const d = n.label || (a ? n.field : ""), l = a ? ((p = this.temporaryLeafColumns.find((u) => u.key === c)) == null ? void 0 : p.width) || n.width || 100 : "auto", m = {
|
|
1430
1430
|
label: d,
|
|
1431
1431
|
level: s,
|
|
1432
1432
|
maxLevel: s,
|
|
1433
1433
|
column: n,
|
|
1434
1434
|
children: [],
|
|
1435
|
-
path:
|
|
1435
|
+
path: g,
|
|
1436
1436
|
key: c,
|
|
1437
1437
|
isLeaf: a,
|
|
1438
1438
|
width: l
|
|
@@ -1440,15 +1440,15 @@ class ee {
|
|
|
1440
1440
|
if (e.push(m), a)
|
|
1441
1441
|
this.leafColumns.push(m);
|
|
1442
1442
|
else if (r) {
|
|
1443
|
-
const
|
|
1443
|
+
const u = n.children;
|
|
1444
1444
|
this.processColumns(
|
|
1445
|
-
|
|
1445
|
+
u,
|
|
1446
1446
|
m.children,
|
|
1447
1447
|
m,
|
|
1448
1448
|
s + 1
|
|
1449
1449
|
), m.maxLevel = Math.max(
|
|
1450
1450
|
m.maxLevel,
|
|
1451
|
-
m.children.reduce((
|
|
1451
|
+
m.children.reduce((y, x) => Math.max(y, x.maxLevel), 0)
|
|
1452
1452
|
);
|
|
1453
1453
|
}
|
|
1454
1454
|
}), this.temporaryLeafColumns = Z(this.leafColumns);
|
|
@@ -1733,53 +1733,53 @@ const tt = class tt {
|
|
|
1733
1733
|
};
|
|
1734
1734
|
const i = this.forwardMemo.get(t), s = this.backwardMemo.get(t);
|
|
1735
1735
|
this.recordCacheAccess(t, !!(i && s));
|
|
1736
|
-
const n = (
|
|
1737
|
-
const w =
|
|
1736
|
+
const n = (x) => (this.fromLinksMap.get(x) || []).map((b) => this.getTask(b.to)).filter((b) => !!b), o = (x) => (this.toLinksMap.get(x) || []).map((b) => this.getTask(b.from)).filter((b) => !!b), r = (x, T, b = /* @__PURE__ */ new Set()) => {
|
|
1737
|
+
const w = x.id;
|
|
1738
1738
|
if (this.forwardMemo.has(w))
|
|
1739
1739
|
return this.recordCacheAccess(w, !0), this.forwardMemo.get(w);
|
|
1740
|
-
if (T.has(
|
|
1740
|
+
if (T.has(x.id) || b.has(x.id))
|
|
1741
1741
|
return [];
|
|
1742
|
-
T.add(
|
|
1743
|
-
const C = n(
|
|
1742
|
+
T.add(x.id), b.add(x.id);
|
|
1743
|
+
const C = n(x.id);
|
|
1744
1744
|
let L = [];
|
|
1745
1745
|
if (C.length === 0)
|
|
1746
|
-
L = [[
|
|
1746
|
+
L = [[x]];
|
|
1747
1747
|
else {
|
|
1748
1748
|
for (const E of C) {
|
|
1749
1749
|
const v = r(E, T, b);
|
|
1750
1750
|
for (const M of v)
|
|
1751
|
-
L.push([
|
|
1751
|
+
L.push([x, ...M]);
|
|
1752
1752
|
}
|
|
1753
|
-
L.length === 0 && (L = [[
|
|
1753
|
+
L.length === 0 && (L = [[x]]);
|
|
1754
1754
|
}
|
|
1755
|
-
return T.delete(
|
|
1756
|
-
}, a = (
|
|
1757
|
-
const w =
|
|
1755
|
+
return T.delete(x.id), L.length < 100 && (this.forwardMemo.set(w, L), this.recordCacheAccess(w, !1)), L;
|
|
1756
|
+
}, a = (x, T, b = /* @__PURE__ */ new Set()) => {
|
|
1757
|
+
const w = x.id;
|
|
1758
1758
|
if (this.backwardMemo.has(w))
|
|
1759
1759
|
return this.recordCacheAccess(w, !0), this.backwardMemo.get(w);
|
|
1760
|
-
if (T.has(
|
|
1760
|
+
if (T.has(x.id) || b.has(x.id))
|
|
1761
1761
|
return [];
|
|
1762
|
-
T.add(
|
|
1763
|
-
const C = o(
|
|
1762
|
+
T.add(x.id), b.add(x.id);
|
|
1763
|
+
const C = o(x.id);
|
|
1764
1764
|
let L = [];
|
|
1765
1765
|
if (C.length === 0)
|
|
1766
|
-
L = [[
|
|
1766
|
+
L = [[x]];
|
|
1767
1767
|
else {
|
|
1768
1768
|
for (const E of C) {
|
|
1769
1769
|
const v = a(E, T, b);
|
|
1770
1770
|
for (const M of v)
|
|
1771
|
-
L.push([...M,
|
|
1771
|
+
L.push([...M, x]);
|
|
1772
1772
|
}
|
|
1773
|
-
L.length === 0 && (L = [[
|
|
1773
|
+
L.length === 0 && (L = [[x]]);
|
|
1774
1774
|
}
|
|
1775
|
-
return T.delete(
|
|
1776
|
-
}, c = a(e, /* @__PURE__ */ new Set()),
|
|
1777
|
-
this.getDirectlyConnectedTasks(t).forEach((
|
|
1778
|
-
this.establishCacheDependency(t,
|
|
1775
|
+
return T.delete(x.id), L.length < 100 && (this.backwardMemo.set(w, L), this.recordCacheAccess(w, !1)), L;
|
|
1776
|
+
}, c = a(e, /* @__PURE__ */ new Set()), g = r(e, /* @__PURE__ */ new Set());
|
|
1777
|
+
this.getDirectlyConnectedTasks(t).forEach((x) => {
|
|
1778
|
+
this.establishCacheDependency(t, x.id), this.establishCacheDependency(x.id, t);
|
|
1779
1779
|
});
|
|
1780
|
-
const l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), p = (
|
|
1780
|
+
const l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), p = (x, T) => {
|
|
1781
1781
|
const b = [];
|
|
1782
|
-
for (const w of
|
|
1782
|
+
for (const w of x) {
|
|
1783
1783
|
w.forEach((C) => l.set(C.id, C));
|
|
1784
1784
|
for (let C = 0; C < w.length - 1; C++) {
|
|
1785
1785
|
const L = w[C].id, E = w[C + 1].id, v = this.findLinkFast(L, E);
|
|
@@ -1790,23 +1790,23 @@ const tt = class tt {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
1792
|
return b;
|
|
1793
|
-
},
|
|
1793
|
+
}, u = p(c), y = p(g);
|
|
1794
1794
|
return {
|
|
1795
1795
|
prev: {
|
|
1796
|
-
chain: c.map((
|
|
1796
|
+
chain: c.map((x) => x.map((T) => T.getEmitData().data)),
|
|
1797
1797
|
nodes: c.flat().filter(
|
|
1798
|
-
(
|
|
1799
|
-
).map((
|
|
1800
|
-
links:
|
|
1798
|
+
(x, T, b) => b.findIndex((w) => w.id === x.id) === T
|
|
1799
|
+
).map((x) => x.getEmitData().data),
|
|
1800
|
+
links: u
|
|
1801
1801
|
},
|
|
1802
1802
|
next: {
|
|
1803
|
-
chain:
|
|
1804
|
-
nodes:
|
|
1805
|
-
(
|
|
1806
|
-
).map((
|
|
1807
|
-
links:
|
|
1803
|
+
chain: g.map((x) => x.map((T) => T.getEmitData().data)),
|
|
1804
|
+
nodes: g.flat().filter(
|
|
1805
|
+
(x, T, b) => b.findIndex((w) => w.id === x.id) === T
|
|
1806
|
+
).map((x) => x.getEmitData().data),
|
|
1807
|
+
links: y
|
|
1808
1808
|
},
|
|
1809
|
-
allNodes: Array.from(l.values()).map((
|
|
1809
|
+
allNodes: Array.from(l.values()).map((x) => x.getEmitData().data),
|
|
1810
1810
|
allLinks: Array.from(m.values()),
|
|
1811
1811
|
current: e.getEmitData().data
|
|
1812
1812
|
};
|
|
@@ -1828,8 +1828,8 @@ const tt = class tt {
|
|
|
1828
1828
|
if (i.get(l) === e.get(l)) {
|
|
1829
1829
|
const p = [];
|
|
1830
1830
|
for (; ; ) {
|
|
1831
|
-
const
|
|
1832
|
-
if (s.delete(
|
|
1831
|
+
const u = n.pop();
|
|
1832
|
+
if (s.delete(u), p.push(u), u === l) break;
|
|
1833
1833
|
}
|
|
1834
1834
|
r.push(p);
|
|
1835
1835
|
}
|
|
@@ -1837,10 +1837,10 @@ const tt = class tt {
|
|
|
1837
1837
|
this.store.getDataManager().getTasks(!1).forEach((l) => {
|
|
1838
1838
|
e.has(l.id) || a(l.id);
|
|
1839
1839
|
});
|
|
1840
|
-
const c = r.filter((l) => l.length > 1 || this.hasSelfLoop(l[0])),
|
|
1840
|
+
const c = r.filter((l) => l.length > 1 || this.hasSelfLoop(l[0])), g = c.map((l) => l.slice()), d = {
|
|
1841
1841
|
hasCycle: c.length > 0,
|
|
1842
1842
|
sccs: c,
|
|
1843
|
-
cycles:
|
|
1843
|
+
cycles: g,
|
|
1844
1844
|
nodes: Array.from(new Set(c.flat()))
|
|
1845
1845
|
};
|
|
1846
1846
|
return this.lastCycleReport = d, t && d.hasCycle && O.warn("Cycle detected in task dependencies", d), d;
|
|
@@ -1856,8 +1856,8 @@ const tt = class tt {
|
|
|
1856
1856
|
n.forEach((d) => {
|
|
1857
1857
|
d.type && a.set(d.type, (a.get(d.type) || 0) + 1);
|
|
1858
1858
|
});
|
|
1859
|
-
const c = a.has("FS"),
|
|
1860
|
-
return c &&
|
|
1859
|
+
const c = a.has("FS"), g = a.has("SF");
|
|
1860
|
+
return c && g && (o.push(...n.filter((d) => d.type === "FS" || d.type === "SF")), r.push("FS-SF conflict")), {
|
|
1861
1861
|
hasConflict: o.length > 0,
|
|
1862
1862
|
conflicts: o,
|
|
1863
1863
|
conflictTypes: r
|
|
@@ -1904,9 +1904,9 @@ const tt = class tt {
|
|
|
1904
1904
|
n.add(r);
|
|
1905
1905
|
const a = this.fromLinksMap.get(r) || [];
|
|
1906
1906
|
for (const c of a) {
|
|
1907
|
-
const
|
|
1908
|
-
if (!n.has(
|
|
1909
|
-
o.has(
|
|
1907
|
+
const g = c.to;
|
|
1908
|
+
if (!n.has(g) && !o.has(g) && o.set(g, r), g === t) {
|
|
1909
|
+
o.has(g) || o.set(g, r);
|
|
1910
1910
|
const d = [];
|
|
1911
1911
|
let l = t;
|
|
1912
1912
|
for (; l !== void 0; )
|
|
@@ -1918,7 +1918,7 @@ const tt = class tt {
|
|
|
1918
1918
|
sccs: []
|
|
1919
1919
|
};
|
|
1920
1920
|
}
|
|
1921
|
-
s.push(
|
|
1921
|
+
s.push(g);
|
|
1922
1922
|
}
|
|
1923
1923
|
}
|
|
1924
1924
|
return null;
|
|
@@ -2154,27 +2154,27 @@ var Mt = { exports: {} };
|
|
|
2154
2154
|
(function(e, i) {
|
|
2155
2155
|
f.exports = i();
|
|
2156
2156
|
})(P, function() {
|
|
2157
|
-
var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, a = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6,
|
|
2157
|
+
var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, a = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, g = 2628e6, d = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, l = { years: c, months: g, days: r, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, m = function(L) {
|
|
2158
2158
|
return L instanceof w;
|
|
2159
2159
|
}, p = function(L, E, v) {
|
|
2160
2160
|
return new w(L, v, E.$l);
|
|
2161
|
-
},
|
|
2161
|
+
}, u = function(L) {
|
|
2162
2162
|
return i.p(L) + "s";
|
|
2163
|
-
}, x = function(L) {
|
|
2164
|
-
return L < 0;
|
|
2165
2163
|
}, y = function(L) {
|
|
2166
|
-
return
|
|
2164
|
+
return L < 0;
|
|
2165
|
+
}, x = function(L) {
|
|
2166
|
+
return y(L) ? Math.ceil(L) : Math.floor(L);
|
|
2167
2167
|
}, T = function(L) {
|
|
2168
2168
|
return Math.abs(L);
|
|
2169
2169
|
}, b = function(L, E) {
|
|
2170
|
-
return L ?
|
|
2170
|
+
return L ? y(L) ? { negative: !0, format: "" + T(L) + E } : { negative: !1, format: "" + L + E } : { negative: !1, format: "" };
|
|
2171
2171
|
}, w = function() {
|
|
2172
2172
|
function L(v, M, A) {
|
|
2173
2173
|
var _ = this;
|
|
2174
|
-
if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return p(v * l[
|
|
2174
|
+
if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return p(v * l[u(M)], this);
|
|
2175
2175
|
if (typeof v == "number") return this.$ms = v, this.parseFromMilliseconds(), this;
|
|
2176
2176
|
if (typeof v == "object") return Object.keys(v).forEach(function(W) {
|
|
2177
|
-
_.$d[
|
|
2177
|
+
_.$d[u(W)] = v[W];
|
|
2178
2178
|
}), this.calMilliseconds(), this;
|
|
2179
2179
|
if (typeof v == "string") {
|
|
2180
2180
|
var D = v.match(d);
|
|
@@ -2195,7 +2195,7 @@ var Mt = { exports: {} };
|
|
|
2195
2195
|
}, 0);
|
|
2196
2196
|
}, E.parseFromMilliseconds = function() {
|
|
2197
2197
|
var v = this.$ms;
|
|
2198
|
-
this.$d.years =
|
|
2198
|
+
this.$d.years = x(v / c), v %= c, this.$d.months = x(v / g), v %= g, this.$d.days = x(v / r), v %= r, this.$d.hours = x(v / o), v %= o, this.$d.minutes = x(v / n), v %= n, this.$d.seconds = x(v / s), v %= s, this.$d.milliseconds = v;
|
|
2199
2199
|
}, E.toISOString = function() {
|
|
2200
2200
|
var v = b(this.$d.years, "Y"), M = b(this.$d.months, "M"), A = +this.$d.days || 0;
|
|
2201
2201
|
this.$d.weeks && (A += 7 * this.$d.weeks);
|
|
@@ -2211,13 +2211,13 @@ var Mt = { exports: {} };
|
|
|
2211
2211
|
return D || String(A[_]);
|
|
2212
2212
|
});
|
|
2213
2213
|
}, E.as = function(v) {
|
|
2214
|
-
return this.$ms / l[
|
|
2214
|
+
return this.$ms / l[u(v)];
|
|
2215
2215
|
}, E.get = function(v) {
|
|
2216
|
-
var M = this.$ms, A =
|
|
2217
|
-
return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ?
|
|
2216
|
+
var M = this.$ms, A = u(v);
|
|
2217
|
+
return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ? x(M / l[A]) : this.$d[A], M || 0;
|
|
2218
2218
|
}, E.add = function(v, M, A) {
|
|
2219
2219
|
var _;
|
|
2220
|
-
return _ = M ? v * l[
|
|
2220
|
+
return _ = M ? v * l[u(M)] : m(v) ? v.$ms : p(v, this).$ms, p(this.$ms + _ * (A ? -1 : 1), this);
|
|
2221
2221
|
}, E.subtract = function(v, M) {
|
|
2222
2222
|
return this.add(v, M, !0);
|
|
2223
2223
|
}, E.locale = function(v) {
|
|
@@ -2288,8 +2288,8 @@ var Ot = { exports: {} };
|
|
|
2288
2288
|
})(P, function() {
|
|
2289
2289
|
return function(e, i, s) {
|
|
2290
2290
|
i.prototype.isBetween = function(n, o, r, a) {
|
|
2291
|
-
var c = s(n),
|
|
2292
|
-
return (d ? this.isAfter(c, r) : !this.isBefore(c, r)) && (l ? this.isBefore(
|
|
2291
|
+
var c = s(n), g = s(o), d = (a = a || "()")[0] === "(", l = a[1] === ")";
|
|
2292
|
+
return (d ? this.isAfter(c, r) : !this.isBefore(c, r)) && (l ? this.isBefore(g, r) : !this.isAfter(g, r)) || (d ? this.isBefore(c, r) : !this.isAfter(c, r)) && (l ? this.isAfter(g, r) : !this.isBefore(g, r));
|
|
2293
2293
|
};
|
|
2294
2294
|
};
|
|
2295
2295
|
});
|
|
@@ -2332,12 +2332,12 @@ var At = { exports: {} };
|
|
|
2332
2332
|
return function(e, i, s) {
|
|
2333
2333
|
var n = i.prototype, o = function(d) {
|
|
2334
2334
|
return d && (d.indexOf ? d : d.s);
|
|
2335
|
-
}, r = function(d, l, m, p,
|
|
2336
|
-
var
|
|
2335
|
+
}, r = function(d, l, m, p, u) {
|
|
2336
|
+
var y = d.name ? d : d.$locale(), x = o(y[l]), T = o(y[m]), b = x || T.map(function(C) {
|
|
2337
2337
|
return C.slice(0, p);
|
|
2338
2338
|
});
|
|
2339
|
-
if (!
|
|
2340
|
-
var w =
|
|
2339
|
+
if (!u) return b;
|
|
2340
|
+
var w = y.weekStart;
|
|
2341
2341
|
return b.map(function(C, L) {
|
|
2342
2342
|
return b[(L + (w || 0)) % 7];
|
|
2343
2343
|
});
|
|
@@ -2345,11 +2345,11 @@ var At = { exports: {} };
|
|
|
2345
2345
|
return s.Ls[s.locale()];
|
|
2346
2346
|
}, c = function(d, l) {
|
|
2347
2347
|
return d.formats[l] || function(m) {
|
|
2348
|
-
return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(p,
|
|
2349
|
-
return
|
|
2348
|
+
return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(p, u, y) {
|
|
2349
|
+
return u || y.slice(1);
|
|
2350
2350
|
});
|
|
2351
2351
|
}(d.formats[l.toUpperCase()]);
|
|
2352
|
-
},
|
|
2352
|
+
}, g = function() {
|
|
2353
2353
|
var d = this;
|
|
2354
2354
|
return { months: function(l) {
|
|
2355
2355
|
return l ? l.format("MMMM") : r(d, "months");
|
|
@@ -2368,7 +2368,7 @@ var At = { exports: {} };
|
|
|
2368
2368
|
}, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
|
|
2369
2369
|
};
|
|
2370
2370
|
n.localeData = function() {
|
|
2371
|
-
return
|
|
2371
|
+
return g.bind(this)();
|
|
2372
2372
|
}, s.localeData = function() {
|
|
2373
2373
|
var d = a();
|
|
2374
2374
|
return { firstDayOfWeek: function() {
|
|
@@ -2414,8 +2414,8 @@ var It = { exports: {} };
|
|
|
2414
2414
|
if (a === void 0 && (a = null), a !== null) return this.add(7 * (a - this.week()), "day");
|
|
2415
2415
|
var c = this.$locale().yearStart || 1;
|
|
2416
2416
|
if (this.month() === 11 && this.date() > 25) {
|
|
2417
|
-
var
|
|
2418
|
-
if (
|
|
2417
|
+
var g = o(this).startOf(i).add(1, i).date(c), d = o(this).endOf(e);
|
|
2418
|
+
if (g.isBefore(d)) return 1;
|
|
2419
2419
|
}
|
|
2420
2420
|
var l = o(this).startOf(i).date(c).startOf(e).subtract(1, "millisecond"), m = this.diff(l, e, !0);
|
|
2421
2421
|
return m < 0 ? o(this).startOf("week").week() : Math.ceil(m);
|
|
@@ -2452,7 +2452,7 @@ var Gt = { exports: {} };
|
|
|
2452
2452
|
s.format = function(o) {
|
|
2453
2453
|
var r = this, a = this.$locale();
|
|
2454
2454
|
if (!this.isValid()) return n.bind(this)(o);
|
|
2455
|
-
var c = this.$utils(),
|
|
2455
|
+
var c = this.$utils(), g = (o || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(d) {
|
|
2456
2456
|
switch (d) {
|
|
2457
2457
|
case "Q":
|
|
2458
2458
|
return Math.ceil((r.$M + 1) / 3);
|
|
@@ -2485,7 +2485,7 @@ var Gt = { exports: {} };
|
|
|
2485
2485
|
return d;
|
|
2486
2486
|
}
|
|
2487
2487
|
});
|
|
2488
|
-
return n.bind(this)(
|
|
2488
|
+
return n.bind(this)(g);
|
|
2489
2489
|
};
|
|
2490
2490
|
};
|
|
2491
2491
|
});
|
|
@@ -2523,15 +2523,15 @@ var Wt = { exports: {} };
|
|
|
2523
2523
|
return o(this).year();
|
|
2524
2524
|
}, r.isoWeek = function(c) {
|
|
2525
2525
|
if (!this.$utils().u(c)) return this.add(7 * (c - this.isoWeek()), e);
|
|
2526
|
-
var
|
|
2527
|
-
return p.diff(
|
|
2526
|
+
var g, d, l, m, p = o(this), u = (g = this.isoWeekYear(), d = this.$u, l = (d ? n.utc : n)().year(g).startOf("year"), m = 4 - l.isoWeekday(), l.isoWeekday() > 4 && (m += 7), l.add(m, e));
|
|
2527
|
+
return p.diff(u, "week") + 1;
|
|
2528
2528
|
}, r.isoWeekday = function(c) {
|
|
2529
2529
|
return this.$utils().u(c) ? this.day() || 7 : this.day(this.day() % 7 ? c : c - 7);
|
|
2530
2530
|
};
|
|
2531
2531
|
var a = r.startOf;
|
|
2532
|
-
r.startOf = function(c,
|
|
2533
|
-
var d = this.$utils(), l = !!d.u(
|
|
2534
|
-
return d.p(c) === "isoweek" ? l ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : a.bind(this)(c,
|
|
2532
|
+
r.startOf = function(c, g) {
|
|
2533
|
+
var d = this.$utils(), l = !!d.u(g) || g;
|
|
2534
|
+
return d.p(c) === "isoweek" ? l ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : a.bind(this)(c, g);
|
|
2535
2535
|
};
|
|
2536
2536
|
};
|
|
2537
2537
|
});
|
|
@@ -2547,50 +2547,50 @@ var $t = { exports: {} };
|
|
|
2547
2547
|
return function(s, n, o) {
|
|
2548
2548
|
var r, a = function(l, m, p) {
|
|
2549
2549
|
p === void 0 && (p = {});
|
|
2550
|
-
var
|
|
2550
|
+
var u = new Date(l), y = function(x, T) {
|
|
2551
2551
|
T === void 0 && (T = {});
|
|
2552
|
-
var b = T.timeZoneName || "short", w =
|
|
2553
|
-
return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone:
|
|
2552
|
+
var b = T.timeZoneName || "short", w = x + "|" + b, C = i[w];
|
|
2553
|
+
return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: x, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), i[w] = C), C;
|
|
2554
2554
|
}(m, p);
|
|
2555
|
-
return
|
|
2555
|
+
return y.formatToParts(u);
|
|
2556
2556
|
}, c = function(l, m) {
|
|
2557
|
-
for (var p = a(l, m),
|
|
2558
|
-
var
|
|
2559
|
-
w >= 0 && (
|
|
2557
|
+
for (var p = a(l, m), u = [], y = 0; y < p.length; y += 1) {
|
|
2558
|
+
var x = p[y], T = x.type, b = x.value, w = e[T];
|
|
2559
|
+
w >= 0 && (u[w] = parseInt(b, 10));
|
|
2560
2560
|
}
|
|
2561
|
-
var C =
|
|
2561
|
+
var C = u[3], L = C === 24 ? 0 : C, E = u[0] + "-" + u[1] + "-" + u[2] + " " + L + ":" + u[4] + ":" + u[5] + ":000", v = +l;
|
|
2562
2562
|
return (o.utc(E).valueOf() - (v -= v % 1e3)) / 6e4;
|
|
2563
|
-
},
|
|
2564
|
-
|
|
2563
|
+
}, g = n.prototype;
|
|
2564
|
+
g.tz = function(l, m) {
|
|
2565
2565
|
l === void 0 && (l = r);
|
|
2566
|
-
var p,
|
|
2566
|
+
var p, u = this.utcOffset(), y = this.toDate(), x = y.toLocaleString("en-US", { timeZone: l }), T = Math.round((y - new Date(x)) / 1e3 / 60), b = 15 * -Math.round(y.getTimezoneOffset() / 15) - T;
|
|
2567
2567
|
if (!Number(b)) p = this.utcOffset(0, m);
|
|
2568
|
-
else if (p = o(
|
|
2568
|
+
else if (p = o(x, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), m) {
|
|
2569
2569
|
var w = p.utcOffset();
|
|
2570
|
-
p = p.add(
|
|
2570
|
+
p = p.add(u - w, "minute");
|
|
2571
2571
|
}
|
|
2572
2572
|
return p.$x.$timezone = l, p;
|
|
2573
|
-
},
|
|
2574
|
-
var m = this.$x.$timezone || o.tz.guess(), p = a(this.valueOf(), m, { timeZoneName: l }).find(function(
|
|
2575
|
-
return
|
|
2573
|
+
}, g.offsetName = function(l) {
|
|
2574
|
+
var m = this.$x.$timezone || o.tz.guess(), p = a(this.valueOf(), m, { timeZoneName: l }).find(function(u) {
|
|
2575
|
+
return u.type.toLowerCase() === "timezonename";
|
|
2576
2576
|
});
|
|
2577
2577
|
return p && p.value;
|
|
2578
2578
|
};
|
|
2579
|
-
var d =
|
|
2580
|
-
|
|
2579
|
+
var d = g.startOf;
|
|
2580
|
+
g.startOf = function(l, m) {
|
|
2581
2581
|
if (!this.$x || !this.$x.$timezone) return d.call(this, l, m);
|
|
2582
2582
|
var p = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
2583
2583
|
return d.call(p, l, m).tz(this.$x.$timezone, !0);
|
|
2584
2584
|
}, o.tz = function(l, m, p) {
|
|
2585
|
-
var
|
|
2586
|
-
if (typeof l != "string") return o(l).tz(
|
|
2585
|
+
var u = p && m, y = p || m || r, x = c(+o(), y);
|
|
2586
|
+
if (typeof l != "string") return o(l).tz(y);
|
|
2587
2587
|
var T = function(L, E, v) {
|
|
2588
2588
|
var M = L - 60 * E * 1e3, A = c(M, v);
|
|
2589
2589
|
if (E === A) return [M, E];
|
|
2590
2590
|
var _ = c(M -= 60 * (A - E) * 1e3, v);
|
|
2591
2591
|
return A === _ ? [M, A] : [L - 60 * Math.min(A, _) * 1e3, Math.max(A, _)];
|
|
2592
|
-
}(o.utc(l,
|
|
2593
|
-
return C.$x.$timezone =
|
|
2592
|
+
}(o.utc(l, u).valueOf(), x, y), b = T[0], w = T[1], C = o(b).utcOffset(w);
|
|
2593
|
+
return C.$x.$timezone = y, C;
|
|
2594
2594
|
}, o.tz.guess = function() {
|
|
2595
2595
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2596
2596
|
}, o.tz.setDefault = function(l) {
|
|
@@ -2609,51 +2609,52 @@ var Ft = { exports: {} };
|
|
|
2609
2609
|
var e = "minute", i = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
|
|
2610
2610
|
return function(n, o, r) {
|
|
2611
2611
|
var a = o.prototype;
|
|
2612
|
-
r.utc = function(
|
|
2613
|
-
var
|
|
2614
|
-
return new o(
|
|
2615
|
-
}, a.utc = function(
|
|
2616
|
-
var
|
|
2617
|
-
return
|
|
2612
|
+
r.utc = function(u) {
|
|
2613
|
+
var y = { date: u, utc: !0, args: arguments };
|
|
2614
|
+
return new o(y);
|
|
2615
|
+
}, a.utc = function(u) {
|
|
2616
|
+
var y = r(this.toDate(), { locale: this.$L, utc: !0 });
|
|
2617
|
+
return u ? y.add(this.utcOffset(), e) : y;
|
|
2618
2618
|
}, a.local = function() {
|
|
2619
2619
|
return r(this.toDate(), { locale: this.$L, utc: !1 });
|
|
2620
2620
|
};
|
|
2621
2621
|
var c = a.parse;
|
|
2622
|
-
a.parse = function(
|
|
2623
|
-
|
|
2622
|
+
a.parse = function(u) {
|
|
2623
|
+
u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), c.call(this, u);
|
|
2624
2624
|
};
|
|
2625
|
-
var
|
|
2625
|
+
var g = a.init;
|
|
2626
2626
|
a.init = function() {
|
|
2627
2627
|
if (this.$u) {
|
|
2628
|
-
var
|
|
2629
|
-
this.$y =
|
|
2630
|
-
} else
|
|
2628
|
+
var u = this.$d;
|
|
2629
|
+
this.$y = u.getUTCFullYear(), this.$M = u.getUTCMonth(), this.$D = u.getUTCDate(), this.$W = u.getUTCDay(), this.$H = u.getUTCHours(), this.$m = u.getUTCMinutes(), this.$s = u.getUTCSeconds(), this.$ms = u.getUTCMilliseconds();
|
|
2630
|
+
} else g.call(this);
|
|
2631
2631
|
};
|
|
2632
2632
|
var d = a.utcOffset;
|
|
2633
|
-
a.utcOffset = function(
|
|
2634
|
-
var
|
|
2635
|
-
if (
|
|
2636
|
-
if (typeof
|
|
2633
|
+
a.utcOffset = function(u, y) {
|
|
2634
|
+
var x = this.$utils().u;
|
|
2635
|
+
if (x(u)) return this.$u ? 0 : x(this.$offset) ? d.call(this) : this.$offset;
|
|
2636
|
+
if (typeof u == "string" && (u = function(C) {
|
|
2637
2637
|
C === void 0 && (C = "");
|
|
2638
2638
|
var L = C.match(i);
|
|
2639
2639
|
if (!L) return null;
|
|
2640
2640
|
var E = ("" + L[0]).match(s) || ["-", 0, 0], v = E[0], M = 60 * +E[1] + +E[2];
|
|
2641
2641
|
return M === 0 ? 0 : v === "+" ? M : -M;
|
|
2642
|
-
}(
|
|
2643
|
-
var T = Math.abs(
|
|
2644
|
-
if (T === 0
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2642
|
+
}(u), u === null)) return this;
|
|
2643
|
+
var T = Math.abs(u) <= 16 ? 60 * u : u, b = this;
|
|
2644
|
+
if (y) return b.$offset = T, b.$u = u === 0, b;
|
|
2645
|
+
if (u !== 0) {
|
|
2646
|
+
var w = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
2647
|
+
(b = this.local().add(T + w, e)).$offset = T, b.$x.$localOffset = w;
|
|
2648
|
+
} else b = this.utc();
|
|
2649
|
+
return b;
|
|
2649
2650
|
};
|
|
2650
2651
|
var l = a.format;
|
|
2651
|
-
a.format = function(
|
|
2652
|
-
var
|
|
2653
|
-
return l.call(this,
|
|
2652
|
+
a.format = function(u) {
|
|
2653
|
+
var y = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
2654
|
+
return l.call(this, y);
|
|
2654
2655
|
}, a.valueOf = function() {
|
|
2655
|
-
var
|
|
2656
|
-
return this.$d.valueOf() - 6e4 *
|
|
2656
|
+
var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
2657
|
+
return this.$d.valueOf() - 6e4 * u;
|
|
2657
2658
|
}, a.isUTC = function() {
|
|
2658
2659
|
return !!this.$u;
|
|
2659
2660
|
}, a.toISOString = function() {
|
|
@@ -2662,14 +2663,14 @@ var Ft = { exports: {} };
|
|
|
2662
2663
|
return this.toDate().toUTCString();
|
|
2663
2664
|
};
|
|
2664
2665
|
var m = a.toDate;
|
|
2665
|
-
a.toDate = function(
|
|
2666
|
-
return
|
|
2666
|
+
a.toDate = function(u) {
|
|
2667
|
+
return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : m.call(this);
|
|
2667
2668
|
};
|
|
2668
2669
|
var p = a.diff;
|
|
2669
|
-
a.diff = function(
|
|
2670
|
-
if (
|
|
2671
|
-
var T = this.local(), b = r(
|
|
2672
|
-
return p.call(T, b,
|
|
2670
|
+
a.diff = function(u, y, x) {
|
|
2671
|
+
if (u && this.$u === u.$u) return p.call(this, u, y, x);
|
|
2672
|
+
var T = this.local(), b = r(u).local();
|
|
2673
|
+
return p.call(T, b, y, x);
|
|
2673
2674
|
};
|
|
2674
2675
|
};
|
|
2675
2676
|
});
|
|
@@ -2849,7 +2850,7 @@ class Oe {
|
|
|
2849
2850
|
week: s.cellWidth,
|
|
2850
2851
|
month: s.cellWidth,
|
|
2851
2852
|
quarter: s.cellWidth
|
|
2852
|
-
} :
|
|
2853
|
+
} : V(s.cellWidth) ? this.cellWidth = Z(
|
|
2853
2854
|
ut()[s.cellWidth] || ut().normal
|
|
2854
2855
|
) : Et(s.cellWidth) && (this.cellWidth = Object.assign(this.cellWidth, s.cellWidth))), this.headerCellFormat = s.headerCellFormat, this.headerGroupFormat = s.headerGroupFormat;
|
|
2855
2856
|
}
|
|
@@ -2929,7 +2930,7 @@ class Oe {
|
|
|
2929
2930
|
const i = this.headerGroupFormat(t.toDate(), this.unit);
|
|
2930
2931
|
if (i) return i;
|
|
2931
2932
|
}
|
|
2932
|
-
if (
|
|
2933
|
+
if (V(this.headerGroupFormat))
|
|
2933
2934
|
return t.format(this.headerGroupFormat);
|
|
2934
2935
|
switch (this.getGroupUnit()) {
|
|
2935
2936
|
case "month":
|
|
@@ -2949,7 +2950,7 @@ class Oe {
|
|
|
2949
2950
|
const i = this.headerCellFormat(t.toDate(), this.unit);
|
|
2950
2951
|
if (i) return i;
|
|
2951
2952
|
}
|
|
2952
|
-
if (
|
|
2953
|
+
if (V(this.headerCellFormat))
|
|
2953
2954
|
return t.format(this.headerCellFormat);
|
|
2954
2955
|
switch (this.getChildUnit()) {
|
|
2955
2956
|
case "hour":
|
|
@@ -2998,7 +2999,7 @@ class De {
|
|
|
2998
2999
|
const i = yt(e, ["data"]), s = e == null ? void 0 : e.data;
|
|
2999
3000
|
if (s && !X(s))
|
|
3000
3001
|
throw O.exception("Data should be a array.");
|
|
3001
|
-
this.optionManager = new
|
|
3002
|
+
this.optionManager = new Kt(), this.optionManager.setOptions(i), i.locale && vt(i.locale), this.timeAxis = new Oe(), this.timeAxis.init(this.optionManager.getOptions()), this.columnManager = new ee(this.context), i.table && i.table.columns && this.columnManager.init(i.table.columns), this.dataManager = new Jt(this, this.context.event), s && this.dataManager.setData(s, !0), (n = e == null ? void 0 : e.baselines) != null && n.data && this.dataManager.setBaselines(e.baselines.data), this.linkManager = new ft(this, this.context.event), X((o = e == null ? void 0 : e.links) == null ? void 0 : o.data) && this.linkManager.setLinks(e.links.data, !0), this.linkManager.setCycleDetection(((r = e == null ? void 0 : e.links) == null ? void 0 : r.enableCycleDetection) ?? !0);
|
|
3002
3003
|
}
|
|
3003
3004
|
getOptionManager() {
|
|
3004
3005
|
return this.optionManager;
|
|
@@ -3287,8 +3288,8 @@ class _e {
|
|
|
3287
3288
|
this.isAnimating = !0, this.animationStartTime = performance.now(), this.animationStartScrollLeft = this.scrollLeft, this.animationStartScrollTop = this.scrollTop, this.animationTargetScrollLeft = i.x, this.animationTargetScrollTop = i.y, this.animationSource = "wheel";
|
|
3288
3289
|
const s = 150, n = (o) => {
|
|
3289
3290
|
if (!this.isAnimating) return;
|
|
3290
|
-
const r = o - this.animationStartTime, a = Math.min(1, r / s), c = a * (2 - a),
|
|
3291
|
-
(l || m) && this.emit("wheel",
|
|
3291
|
+
const r = o - this.animationStartTime, a = Math.min(1, r / s), c = a * (2 - a), g = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * c, d = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * c, l = this.scrollLeft !== g, m = this.scrollTop !== d;
|
|
3292
|
+
(l || m) && this.emit("wheel", g, d), a < 1 ? this.animationFrameId = requestAnimationFrame(n) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit("wheel", this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
|
|
3292
3293
|
};
|
|
3293
3294
|
this.animationFrameId = requestAnimationFrame(n);
|
|
3294
3295
|
}
|
|
@@ -3338,13 +3339,13 @@ class _e {
|
|
|
3338
3339
|
this.viewportWidth = Math.max(0, t), this.viewportHeight = Math.max(0, e), this.contentWidth = Math.max(this.viewportWidth, i), this.contentHeight = Math.max(this.viewportHeight, s);
|
|
3339
3340
|
const r = this.canScrollHorizontal() && this.options.showHorizontal, a = this.canScrollVertical() && this.options.showVertical;
|
|
3340
3341
|
if (r) {
|
|
3341
|
-
const
|
|
3342
|
-
this.hScrollbar.style.display = "block", this.hScrollbar.style.transform = `translateX(${n}px)`, this.hScrollbar.style.width = `${Math.max(0,
|
|
3342
|
+
const g = this.viewportWidth - (a ? this.options.track.size : 0);
|
|
3343
|
+
this.hScrollbar.style.display = "block", this.hScrollbar.style.transform = `translateX(${n}px)`, this.hScrollbar.style.width = `${Math.max(0, g)}px`, this.hScrollbar.style.bottom = "0px", this.hScrollbar.style.right = a ? `${this.options.track.size}px` : "0px";
|
|
3343
3344
|
} else
|
|
3344
3345
|
this.hScrollbar.style.display = "none";
|
|
3345
3346
|
if (a) {
|
|
3346
|
-
const
|
|
3347
|
-
this.vScrollbar.style.display = "block", this.vScrollbar.style.transform = `translateY(${o}px)`, this.vScrollbar.style.height = `${Math.max(0,
|
|
3347
|
+
const g = this.viewportHeight - o - (r ? this.options.track.size : 0);
|
|
3348
|
+
this.vScrollbar.style.display = "block", this.vScrollbar.style.transform = `translateY(${o}px)`, this.vScrollbar.style.height = `${Math.max(0, g)}px`, this.vScrollbar.style.right = "0px", this.vScrollbar.style.bottom = r ? `${this.options.track.size}px` : "0px";
|
|
3348
3349
|
} else
|
|
3349
3350
|
this.vScrollbar.style.display = "none";
|
|
3350
3351
|
this.updateThumbStyles();
|
|
@@ -3567,7 +3568,7 @@ class St {
|
|
|
3567
3568
|
}), this.element.addEventListener("mouseleave", () => {
|
|
3568
3569
|
this.context.event.emit(k.ROW_UNHIGHLIGHT, this.task.id);
|
|
3569
3570
|
}), this.element.addEventListener("click", (t) => {
|
|
3570
|
-
this.context.store.getDataManager().isTaskSelected(this.task.id) ||
|
|
3571
|
+
this.context.store.getDataManager().isTaskSelected(this.task.id) || this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(k.ROW_CLICK, t, this.task);
|
|
3571
3572
|
}), this.element.addEventListener("dblclick", (t) => {
|
|
3572
3573
|
this.context.event.emit(k.ROW_DBL_CLICK, t, this.task);
|
|
3573
3574
|
}), this.element.addEventListener("contextmenu", (t) => {
|
|
@@ -3661,18 +3662,18 @@ class St {
|
|
|
3661
3662
|
}
|
|
3662
3663
|
} else {
|
|
3663
3664
|
let a = 1, c = 1;
|
|
3664
|
-
const
|
|
3665
|
+
const g = (s = (i = o.column).merge) == null ? void 0 : s.call(
|
|
3665
3666
|
i,
|
|
3666
3667
|
this.task.getField(o.column.field),
|
|
3667
3668
|
this.task.data,
|
|
3668
3669
|
n,
|
|
3669
3670
|
this.task.level + 1
|
|
3670
3671
|
);
|
|
3671
|
-
if (
|
|
3672
|
+
if (g && (typeof g.col != "number" ? O.error("colspan function must returned a number") : a = g.col, typeof g.row != "number" ? O.error("rowspan function must returned a number") : c = g.row), a > 1 || c > 1) {
|
|
3672
3673
|
if (c > 1)
|
|
3673
3674
|
for (let p = 1; p < c; p++) {
|
|
3674
|
-
const
|
|
3675
|
-
if (
|
|
3675
|
+
const u = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + p];
|
|
3676
|
+
if (u && this.task.level !== u.level) {
|
|
3676
3677
|
c = p;
|
|
3677
3678
|
break;
|
|
3678
3679
|
}
|
|
@@ -3686,8 +3687,8 @@ class St {
|
|
|
3686
3687
|
let m = this.task;
|
|
3687
3688
|
for (let p = c; p > 0; p--)
|
|
3688
3689
|
if (m) {
|
|
3689
|
-
for (let
|
|
3690
|
-
this.context.store.getColumnManager().addMergeInfo(m.id,
|
|
3690
|
+
for (let u = 0; u < a; u++)
|
|
3691
|
+
this.context.store.getColumnManager().addMergeInfo(m.id, u + n, l);
|
|
3691
3692
|
m = this.context.store.getDataManager().getVisibleTasks().at(m.flatIndex + 1);
|
|
3692
3693
|
}
|
|
3693
3694
|
for (let p = 0; p < a; p++)
|
|
@@ -3763,14 +3764,14 @@ class Ae {
|
|
|
3763
3764
|
a.create(), this.rows.set(r, a);
|
|
3764
3765
|
}
|
|
3765
3766
|
this.context.store.getColumnManager().getLeafColumns().forEach((a, c) => {
|
|
3766
|
-
const
|
|
3767
|
-
if (
|
|
3768
|
-
const d =
|
|
3767
|
+
const g = this.context.store.getColumnManager().getMergeInfo(n.id, c);
|
|
3768
|
+
if (g && g.rowspan > 1) {
|
|
3769
|
+
const d = g.task.id;
|
|
3769
3770
|
if (!this.rows.has(d) && !this.mergeRows.has(d)) {
|
|
3770
3771
|
const l = new St(
|
|
3771
3772
|
this.context,
|
|
3772
3773
|
this.element,
|
|
3773
|
-
|
|
3774
|
+
g.task,
|
|
3774
3775
|
t,
|
|
3775
3776
|
!0
|
|
3776
3777
|
);
|
|
@@ -3854,15 +3855,15 @@ class pt {
|
|
|
3854
3855
|
let e = 0, i = 0, s = null, n = 0;
|
|
3855
3856
|
const o = (c) => {
|
|
3856
3857
|
c.preventDefault(), c.stopPropagation(), e = c.clientX, i = this.columnElement.offsetWidth, s = this.root.getBoundingClientRect();
|
|
3857
|
-
const
|
|
3858
|
-
document.addEventListener("mousemove",
|
|
3858
|
+
const g = (l) => r(l), d = (l) => a(l, g, d);
|
|
3859
|
+
document.addEventListener("mousemove", g), document.addEventListener("mouseup", d), n = e - s.left, this.context.event.emit(k.SHOW_GUIDELINE, n);
|
|
3859
3860
|
}, r = (c) => {
|
|
3860
3861
|
if (c.preventDefault(), !s) return;
|
|
3861
|
-
const
|
|
3862
|
-
let
|
|
3863
|
-
|
|
3864
|
-
}, a = (c,
|
|
3865
|
-
document.removeEventListener("mousemove",
|
|
3862
|
+
const g = c.clientX - e, d = i + g, l = Math.max(50, d), m = e - s.left - i, u = this.root.clientWidth - 20;
|
|
3863
|
+
let y = m + l;
|
|
3864
|
+
y = Math.min(u, y), this.context.event.emit(k.MOVE_GUIDELINE, y);
|
|
3865
|
+
}, a = (c, g, d) => {
|
|
3866
|
+
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.context.event.emit(k.HIDE_GUIDELINE);
|
|
3866
3867
|
const l = c.clientX - e, m = Math.max(50, i + l);
|
|
3867
3868
|
this.setWidth(m);
|
|
3868
3869
|
};
|
|
@@ -4071,8 +4072,8 @@ class Ge {
|
|
|
4071
4072
|
);
|
|
4072
4073
|
const r = t.getTimeline();
|
|
4073
4074
|
let a = 0;
|
|
4074
|
-
for (let
|
|
4075
|
-
const d = r[
|
|
4075
|
+
for (let g = 0; g < r.length; g++) {
|
|
4076
|
+
const d = r[g], l = e * (((c = d.children) == null ? void 0 : c.length) ?? 0);
|
|
4076
4077
|
if (a + l < i) {
|
|
4077
4078
|
a += l;
|
|
4078
4079
|
continue;
|
|
@@ -4089,35 +4090,35 @@ class Ge {
|
|
|
4089
4090
|
d.label
|
|
4090
4091
|
);
|
|
4091
4092
|
if (this.groupHeader.add(p), X(d.children) && d.children.length > 0) {
|
|
4092
|
-
let
|
|
4093
|
-
for (let
|
|
4094
|
-
const
|
|
4093
|
+
let u = a;
|
|
4094
|
+
for (let y = 0; y < d.children.length; ) {
|
|
4095
|
+
const x = d.children[y];
|
|
4095
4096
|
let T = 1;
|
|
4096
|
-
for (; d.children[
|
|
4097
|
+
for (; d.children[y + T] && x.label === d.children[y + T].label; )
|
|
4097
4098
|
T++;
|
|
4098
|
-
if (
|
|
4099
|
+
if (y += T, y >= d.children.length && r[g + 1] && r[g + 1].children) {
|
|
4099
4100
|
let L = 0;
|
|
4100
|
-
for (; r[
|
|
4101
|
-
r[
|
|
4101
|
+
for (; r[g + 1].children[L] && x.label === r[g + 1].children[L].label; )
|
|
4102
|
+
r[g + 1].children[L].hide = !0, L++;
|
|
4102
4103
|
L > 0 && (T += L);
|
|
4103
4104
|
}
|
|
4104
4105
|
const b = e * T;
|
|
4105
|
-
if (
|
|
4106
|
-
|
|
4106
|
+
if (u + b < i) {
|
|
4107
|
+
u += b;
|
|
4107
4108
|
continue;
|
|
4108
4109
|
}
|
|
4109
|
-
if (
|
|
4110
|
+
if (u > s)
|
|
4110
4111
|
break;
|
|
4111
4112
|
const C = this.createCell(
|
|
4112
|
-
`cell-${
|
|
4113
|
-
|
|
4113
|
+
`cell-${x.date.format("YYYY-MM-DD")}`,
|
|
4114
|
+
u,
|
|
4114
4115
|
n,
|
|
4115
4116
|
b,
|
|
4116
4117
|
n,
|
|
4117
|
-
|
|
4118
|
-
|
|
4118
|
+
x.hide ? "transparent" : o,
|
|
4119
|
+
x.hide ? "" : x.label
|
|
4119
4120
|
);
|
|
4120
|
-
this.cellHeader.add(C),
|
|
4121
|
+
this.cellHeader.add(C), x.hide && C.visible(!1), u += b;
|
|
4121
4122
|
}
|
|
4122
4123
|
}
|
|
4123
4124
|
a += l;
|
|
@@ -4137,8 +4138,8 @@ class Ge {
|
|
|
4137
4138
|
name: "header-cell-bg"
|
|
4138
4139
|
});
|
|
4139
4140
|
a.add(c);
|
|
4140
|
-
let
|
|
4141
|
-
t.startsWith("cell-") && (this.cellCache.set(t, c),
|
|
4141
|
+
let g = this.context.getOptions().header.fontSize;
|
|
4142
|
+
t.startsWith("cell-") && (this.cellCache.set(t, c), g -= 2);
|
|
4142
4143
|
const d = new S.Line({
|
|
4143
4144
|
points: [s, 0, s, n],
|
|
4144
4145
|
stroke: o,
|
|
@@ -4152,7 +4153,7 @@ class Ge {
|
|
|
4152
4153
|
width: s,
|
|
4153
4154
|
height: n,
|
|
4154
4155
|
text: r,
|
|
4155
|
-
fontSize:
|
|
4156
|
+
fontSize: g,
|
|
4156
4157
|
fontFamily: this.context.getOptions().header.fontFamily,
|
|
4157
4158
|
fontStyle: `${this.context.getOptions().header.fontWeight}`,
|
|
4158
4159
|
fill: this.context.getOptions().header.color,
|
|
@@ -4266,7 +4267,7 @@ class Re {
|
|
|
4266
4267
|
), c = Math.max(
|
|
4267
4268
|
0,
|
|
4268
4269
|
Math.floor((-this.offsetY + t) / s) - 2
|
|
4269
|
-
),
|
|
4270
|
+
), g = Math.min(
|
|
4270
4271
|
n,
|
|
4271
4272
|
Math.ceil((-this.offsetY + this.height) / s) + 2
|
|
4272
4273
|
);
|
|
@@ -4280,7 +4281,7 @@ class Re {
|
|
|
4280
4281
|
});
|
|
4281
4282
|
this.verticalLines.add(m);
|
|
4282
4283
|
}
|
|
4283
|
-
for (let d = c; d <=
|
|
4284
|
+
for (let d = c; d <= g; d++) {
|
|
4284
4285
|
const l = d * s + t, m = new S.Line({
|
|
4285
4286
|
points: [0, l, Math.max(this.width, e), l],
|
|
4286
4287
|
stroke: this.context.getOptions().border.color,
|
|
@@ -4350,7 +4351,7 @@ class We {
|
|
|
4350
4351
|
});
|
|
4351
4352
|
}
|
|
4352
4353
|
render() {
|
|
4353
|
-
var p,
|
|
4354
|
+
var p, u, y, x, T, b, w, C, L, E, v, M, A;
|
|
4354
4355
|
if (!this.task.startTime || !this.task.endTime) return;
|
|
4355
4356
|
if (this.task.endTime.isBefore(this.task.startTime)) {
|
|
4356
4357
|
O.error("The endTime of the current task is earlier than the startTime.", this.task);
|
|
@@ -4361,7 +4362,7 @@ class We {
|
|
|
4361
4362
|
t
|
|
4362
4363
|
), i = (t - e) / 2, s = this.context.store.getTimeAxis().getTimeLeft(this.task.startTime), o = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime) - s, r = this.unpackFunc(this.context.getOptions().bar.backgroundColor) || this.context.getOptions().primaryColor, a = ot(
|
|
4363
4364
|
this.unpackFunc(this.context.getOptions().bar.radius)
|
|
4364
|
-
), c = this.unpackFunc(this.context.getOptions().bar.shadowColor) || "rgba(0, 0, 0, 0.2)",
|
|
4365
|
+
), c = this.unpackFunc(this.context.getOptions().bar.shadowColor) || "rgba(0, 0, 0, 0.2)", g = this.unpackFunc(this.context.getOptions().bar.shadowBlur) || 0, d = this.unpackFunc(this.context.getOptions().bar.shadowOffsetX) || 0, l = this.unpackFunc(this.context.getOptions().bar.shadowOffsetY) || 0;
|
|
4365
4366
|
this.slider || (this.slider = new S.Group({
|
|
4366
4367
|
dragBoundFunc: (_) => {
|
|
4367
4368
|
let D = Math.min(0, -(-this.offsetX - this.slider.x()));
|
|
@@ -4387,7 +4388,7 @@ class We {
|
|
|
4387
4388
|
if (this.slider.draggable(m), this.slider.on("mouseover", (_) => {
|
|
4388
4389
|
m && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
|
|
4389
4390
|
shadowColor: B(c).alpha(B(c).alpha() + 0.1).toHex(),
|
|
4390
|
-
shadowBlur: Math.max((
|
|
4391
|
+
shadowBlur: Math.max((g || 1) * 2, 4),
|
|
4391
4392
|
shadowOffsetX: Math.max(d || 1, 2),
|
|
4392
4393
|
shadowOffsetY: Math.max((l || 1) * 1.5, 4)
|
|
4393
4394
|
}), this.context.event.emit(k.SLIDER_ENTER, _.evt, this.task);
|
|
@@ -4396,7 +4397,7 @@ class We {
|
|
|
4396
4397
|
}), this.slider.on("mouseout", (_) => {
|
|
4397
4398
|
m && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
|
|
4398
4399
|
shadowColor: c,
|
|
4399
|
-
shadowBlur:
|
|
4400
|
+
shadowBlur: g,
|
|
4400
4401
|
shadowOffsetX: d,
|
|
4401
4402
|
shadowOffsetY: l
|
|
4402
4403
|
}), this.context.event.emit(k.SLIDER_LEAVE, _.evt, this.task);
|
|
@@ -4461,23 +4462,23 @@ class We {
|
|
|
4461
4462
|
fontFamily: zt
|
|
4462
4463
|
}), at = it.measureSize(F);
|
|
4463
4464
|
it.width(at.width);
|
|
4464
|
-
const
|
|
4465
|
+
const K = { x: 0, y: 0 };
|
|
4465
4466
|
switch (z) {
|
|
4466
4467
|
case "top-left":
|
|
4467
|
-
|
|
4468
|
+
K.x = -(12 + at.width), K.y = -8;
|
|
4468
4469
|
break;
|
|
4469
4470
|
case "bottom-left":
|
|
4470
|
-
|
|
4471
|
+
K.x = -(12 + at.width), K.y = 10;
|
|
4471
4472
|
break;
|
|
4472
4473
|
case "bottom-right":
|
|
4473
|
-
|
|
4474
|
+
K.x = 12, K.y = 10;
|
|
4474
4475
|
break;
|
|
4475
4476
|
case "top-right":
|
|
4476
4477
|
default:
|
|
4477
|
-
|
|
4478
|
+
K.x = 12, K.y = -8;
|
|
4478
4479
|
break;
|
|
4479
4480
|
}
|
|
4480
|
-
it.setAttrs(
|
|
4481
|
+
it.setAttrs(K), this.slider.add(it);
|
|
4481
4482
|
}
|
|
4482
4483
|
}
|
|
4483
4484
|
this.sliderType = "milestone";
|
|
@@ -4491,7 +4492,7 @@ class We {
|
|
|
4491
4492
|
width: I,
|
|
4492
4493
|
fill: _,
|
|
4493
4494
|
shadowColor: c,
|
|
4494
|
-
shadowBlur:
|
|
4495
|
+
shadowBlur: g,
|
|
4495
4496
|
shadowOffsetX: d,
|
|
4496
4497
|
shadowOffsetY: l,
|
|
4497
4498
|
y: -(H + D) / 2 - i / 2
|
|
@@ -4499,7 +4500,7 @@ class We {
|
|
|
4499
4500
|
!this.sliderBar || this.sliderBar.width() !== o ? (this.sliderBar && this.sliderBar.destroy(), this.sliderBar = W(o), this.slider.add(this.sliderBar)) : this.sliderBar.setAttrs({
|
|
4500
4501
|
fill: _,
|
|
4501
4502
|
shadowColor: c,
|
|
4502
|
-
shadowBlur:
|
|
4503
|
+
shadowBlur: g,
|
|
4503
4504
|
shadowOffsetX: d,
|
|
4504
4505
|
shadowOffsetY: l
|
|
4505
4506
|
}), this.sliderType = "summary";
|
|
@@ -4513,7 +4514,7 @@ class We {
|
|
|
4513
4514
|
fill: r,
|
|
4514
4515
|
cornerRadius: a
|
|
4515
4516
|
}), this.renderProgress(o, e);
|
|
4516
|
-
const _ = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, D = (
|
|
4517
|
+
const _ = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, D = (u = this.context.getOptions().bar.move.single) == null ? void 0 : u.backgroundColor, H = D ? B(D).alpha(((y = this.context.getOptions().bar.move.single) == null ? void 0 : y.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((x = this.context.getOptions().bar.progress) == null ? void 0 : x.show) ? -1 : 1)).alpha(((T = this.context.getOptions().bar.move.single) == null ? void 0 : T.opacity) ?? 1).toHex();
|
|
4517
4518
|
if (!!this.unpackFunc((b = this.context.getOptions().bar.move.single) == null ? void 0 : b.left)) {
|
|
4518
4519
|
if (!this.leftHandleGroup) {
|
|
4519
4520
|
this.leftHandleGroup = new S.Group({
|
|
@@ -4605,7 +4606,7 @@ class We {
|
|
|
4605
4606
|
}
|
|
4606
4607
|
this.isDragging || this.sliderBar.setAttrs({
|
|
4607
4608
|
shadowColor: c,
|
|
4608
|
-
shadowBlur:
|
|
4609
|
+
shadowBlur: g,
|
|
4609
4610
|
shadowOffsetX: d,
|
|
4610
4611
|
shadowOffsetY: l
|
|
4611
4612
|
}), this.sliderGroup.add(this.slider), this.unpackFunc(this.context.getOptions().bar.show) === !1 ? this.sliderGroup.hide() : this.sliderGroup.show();
|
|
@@ -4642,28 +4643,28 @@ class We {
|
|
|
4642
4643
|
}
|
|
4643
4644
|
}
|
|
4644
4645
|
renderProgress(t, e) {
|
|
4645
|
-
var i, s, n, o, r, a, c,
|
|
4646
|
+
var i, s, n, o, r, a, c, g, d, l, m, p;
|
|
4646
4647
|
if (!this.unpackFunc((i = this.context.getOptions().bar.progress) == null ? void 0 : i.show)) {
|
|
4647
4648
|
this.progressGroup && (this.progressGroup.destroy(), this.progressGroup = null);
|
|
4648
4649
|
return;
|
|
4649
4650
|
}
|
|
4650
4651
|
if (this.task.progress) {
|
|
4651
|
-
const
|
|
4652
|
+
const u = qt(
|
|
4652
4653
|
this.task.progress,
|
|
4653
4654
|
((s = this.context.getOptions().bar.progress) == null ? void 0 : s.targetVal) ?? 100
|
|
4654
4655
|
);
|
|
4655
|
-
if (
|
|
4656
|
-
const
|
|
4656
|
+
if (u === 0) return;
|
|
4657
|
+
const y = this.unpackFunc(
|
|
4657
4658
|
this.context.getOptions().bar.backgroundColor
|
|
4658
|
-
) || this.context.getOptions().primaryColor,
|
|
4659
|
+
) || this.context.getOptions().primaryColor, x = this.unpackFunc((n = this.context.getOptions().bar.progress) == null ? void 0 : n.backgroundColor) || B(y).brighten(((o = this.context.getOptions().bar.progress) == null ? void 0 : o.amount) || 30).toHex(), T = ot(
|
|
4659
4660
|
this.unpackFunc(this.context.getOptions().bar.radius)
|
|
4660
4661
|
), b = ot(
|
|
4661
4662
|
this.unpackFunc((r = this.context.getOptions().bar.progress) == null ? void 0 : r.radius),
|
|
4662
4663
|
2
|
|
4663
4664
|
// 默认 2
|
|
4664
4665
|
);
|
|
4665
|
-
b[0] = T[0], b[3] = T[3],
|
|
4666
|
-
const w = t *
|
|
4666
|
+
b[0] = T[0], b[3] = T[3], u === 1 && (b[1] = T[1], b[2] = T[2]);
|
|
4667
|
+
const w = t * u;
|
|
4667
4668
|
this.progressGroup ? (this.progressGroup.width(w), this.progressGroup.destroyChildren()) : (this.progressGroup = new S.Group({
|
|
4668
4669
|
x: 0,
|
|
4669
4670
|
y: 0,
|
|
@@ -4676,20 +4677,20 @@ class We {
|
|
|
4676
4677
|
y: 0,
|
|
4677
4678
|
width: w,
|
|
4678
4679
|
height: e,
|
|
4679
|
-
fill:
|
|
4680
|
+
fill: x,
|
|
4680
4681
|
cornerRadius: b,
|
|
4681
4682
|
opacity: this.unpackFunc((a = this.context.getOptions().bar.progress) == null ? void 0 : a.opacity)
|
|
4682
4683
|
});
|
|
4683
4684
|
this.progressGroup.add(C);
|
|
4684
4685
|
const L = `${gt(
|
|
4685
|
-
|
|
4686
|
+
u * 100,
|
|
4686
4687
|
(c = this.context.getOptions().bar.progress) == null ? void 0 : c.decimal
|
|
4687
|
-
)}%`, E = new S.Text().measureSize(L).width, v = this.unpackFunc((
|
|
4688
|
+
)}%`, E = new S.Text().measureSize(L).width, v = this.unpackFunc((g = this.context.getOptions().bar.progress) == null ? void 0 : g.textAlign), M = new S.Text({
|
|
4688
4689
|
x: 0,
|
|
4689
4690
|
y: v === "top" ? -e : 0,
|
|
4690
4691
|
width: v === "right" ? w + E : Math.max(w, E),
|
|
4691
4692
|
height: e,
|
|
4692
|
-
fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(
|
|
4693
|
+
fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(x, 50).alpha(0.7).toHex(),
|
|
4693
4694
|
text: L,
|
|
4694
4695
|
fontSize: this.unpackFunc((l = this.context.getOptions().bar.progress) == null ? void 0 : l.fontSize) || 10,
|
|
4695
4696
|
fontStyle: this.unpackFunc((m = this.context.getOptions().bar.progress) == null ? void 0 : m.fontStyle) || "italic",
|
|
@@ -4751,12 +4752,12 @@ class We {
|
|
|
4751
4752
|
if (i) {
|
|
4752
4753
|
const s = this.context.getOptions().row.height, n = this.y + this.offsetY, o = n + s;
|
|
4753
4754
|
if (i.y < n || i.y > o) {
|
|
4754
|
-
const r = this.unpackFunc(this.context.getOptions().bar.shadowColor) || "rgba(0, 0, 0, 0.2)", a = this.unpackFunc(this.context.getOptions().bar.shadowBlur) || 0, c = this.unpackFunc(this.context.getOptions().bar.shadowOffsetX) || 0,
|
|
4755
|
+
const r = this.unpackFunc(this.context.getOptions().bar.shadowColor) || "rgba(0, 0, 0, 0.2)", a = this.unpackFunc(this.context.getOptions().bar.shadowBlur) || 0, c = this.unpackFunc(this.context.getOptions().bar.shadowOffsetX) || 0, g = this.unpackFunc(this.context.getOptions().bar.shadowOffsetY) || 0;
|
|
4755
4756
|
this.handleBarHighlight({
|
|
4756
4757
|
shadowColor: r,
|
|
4757
4758
|
shadowBlur: a,
|
|
4758
4759
|
shadowOffsetX: c,
|
|
4759
|
-
shadowOffsetY:
|
|
4760
|
+
shadowOffsetY: g
|
|
4760
4761
|
}), this.handleResizeHighlight(0), e.container().style.cursor = "default";
|
|
4761
4762
|
}
|
|
4762
4763
|
}
|
|
@@ -4764,12 +4765,12 @@ class We {
|
|
|
4764
4765
|
this.context.event.emit(k.SLIDER_DRAGGING, !1);
|
|
4765
4766
|
}
|
|
4766
4767
|
handleMove(t, e) {
|
|
4767
|
-
const i = e.width(), s = !!this.context.getOptions().bar.move.lock, n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = t.target.width(), a = t.target.x(), c = a + r,
|
|
4768
|
+
const i = e.width(), s = !!this.context.getOptions().bar.move.lock, n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = t.target.width(), a = t.target.x(), c = a + r, g = Math.max(0, -this.offsetX - a), d = Math.max(0, c - (-this.offsetX + i));
|
|
4768
4769
|
this.autoMoveTimer = window.setInterval(() => {
|
|
4769
|
-
const l = t.target.width(), m = t.target.x(), p = m + l,
|
|
4770
|
+
const l = t.target.width(), m = t.target.x(), p = m + l, u = -this.offsetX, y = u + i, x = this.context.store.getTimeAxis().getTotalWidth(), T = m <= u + this.EDGE_THRESHOLD, b = p >= y - this.EDGE_THRESHOLD;
|
|
4770
4771
|
if (T)
|
|
4771
|
-
if (
|
|
4772
|
-
this.draggingDirection === "left" && t.target.x(-
|
|
4772
|
+
if (u <= 0)
|
|
4773
|
+
this.draggingDirection === "left" && t.target.x(-g), this.stopAutoScroll(), s || (this.draggingDirection === "left" ? this.startAutoExpand("left", -g) : this.stopAutoExpand());
|
|
4773
4774
|
else if (this.draggingDirection === "left") {
|
|
4774
4775
|
const w = n ? -o : -this.SCROLL_STEP;
|
|
4775
4776
|
this.startAutoScroll(
|
|
@@ -4778,13 +4779,13 @@ class We {
|
|
|
4778
4779
|
() => {
|
|
4779
4780
|
t.target.x(t.target.x() + w);
|
|
4780
4781
|
},
|
|
4781
|
-
() => t.target.x(t.target.x() -
|
|
4782
|
+
() => t.target.x(t.target.x() - g)
|
|
4782
4783
|
);
|
|
4783
4784
|
} else
|
|
4784
4785
|
this.stopAutoScroll();
|
|
4785
4786
|
else if (b)
|
|
4786
|
-
if (
|
|
4787
|
-
this.draggingDirection === "right" && t.target.x(
|
|
4787
|
+
if (y >= x)
|
|
4788
|
+
this.draggingDirection === "right" && t.target.x(x - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
|
|
4788
4789
|
else if (this.draggingDirection === "right") {
|
|
4789
4790
|
const w = n ? o : this.SCROLL_STEP;
|
|
4790
4791
|
this.startAutoScroll(w, n, () => {
|
|
@@ -4799,16 +4800,16 @@ class We {
|
|
|
4799
4800
|
}
|
|
4800
4801
|
// 左右操作拖拽
|
|
4801
4802
|
resizeMove(t, e) {
|
|
4802
|
-
var
|
|
4803
|
+
var y;
|
|
4803
4804
|
t.cancelBubble = !0;
|
|
4804
4805
|
const i = t.target.getStage();
|
|
4805
4806
|
if (!i) return;
|
|
4806
4807
|
this.isDragging = !0, this.context.event.emit(k.SLIDER_DRAGGING, !0);
|
|
4807
|
-
let s = ((
|
|
4808
|
+
let s = ((y = i.getPointerPosition()) == null ? void 0 : y.x) || 0;
|
|
4808
4809
|
const n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = !!this.context.getOptions().bar.move.lock, a = i.width();
|
|
4809
|
-
let c = 0,
|
|
4810
|
+
let c = 0, g = 0;
|
|
4810
4811
|
this.autoMoveTimer = window.setInterval(() => {
|
|
4811
|
-
const
|
|
4812
|
+
const x = this.slider.width(), T = this.slider.x(), b = T + x, w = -this.offsetX, C = w + a, L = T <= w + this.EDGE_THRESHOLD, E = b >= C - this.EDGE_THRESHOLD;
|
|
4812
4813
|
if (L && e === "left") {
|
|
4813
4814
|
if (w <= 0)
|
|
4814
4815
|
this.slider.x(0), this.stopAutoScroll(), r || (this.draggingDirection === "left" ? this.startAutoExpand("left") : this.stopAutoExpand());
|
|
@@ -4828,7 +4829,7 @@ class We {
|
|
|
4828
4829
|
else if (this.draggingDirection === "right") {
|
|
4829
4830
|
const v = n ? o : this.SCROLL_STEP;
|
|
4830
4831
|
this.startAutoScroll(v, n, () => {
|
|
4831
|
-
|
|
4832
|
+
g += v, this.slider.x(this.slider.x() + v);
|
|
4832
4833
|
});
|
|
4833
4834
|
} else
|
|
4834
4835
|
this.stopAutoScroll();
|
|
@@ -4836,7 +4837,7 @@ class We {
|
|
|
4836
4837
|
} else if (e === "right" && T <= w && b <= w + this.EDGE_THRESHOLD + o) {
|
|
4837
4838
|
const v = n ? -o : -this.SCROLL_STEP;
|
|
4838
4839
|
this.startAutoScroll(v, n, () => {
|
|
4839
|
-
|
|
4840
|
+
g += v, this.slider.width(Math.max(this.slider.width(), o)), this.slider.width() > o && this.slider.x(this.slider.x() + v), this.emitUpdate("right");
|
|
4840
4841
|
});
|
|
4841
4842
|
} else if (e === "left" && b >= C && T >= C - this.EDGE_THRESHOLD - o) {
|
|
4842
4843
|
const v = n ? o : this.SCROLL_STEP;
|
|
@@ -4847,16 +4848,16 @@ class We {
|
|
|
4847
4848
|
this.stopAutoExpand(), this.stopAutoScroll();
|
|
4848
4849
|
}, this.MOVE_INTERVAL);
|
|
4849
4850
|
let d;
|
|
4850
|
-
const l = this.slider.x(), m = this.slider.width(), p = (
|
|
4851
|
+
const l = this.slider.x(), m = this.slider.width(), p = (x) => {
|
|
4851
4852
|
var w;
|
|
4852
|
-
|
|
4853
|
+
x.movementX > 0 ? this.draggingDirection = "right" : x.movementX < 0 && (this.draggingDirection = "left");
|
|
4853
4854
|
const T = Math.max(((w = i.getPointerPosition()) == null ? void 0 : w.x) || 0, 0);
|
|
4854
4855
|
let b = T - s;
|
|
4855
|
-
n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && T < a - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b +
|
|
4856
|
-
},
|
|
4857
|
-
this.handleDragEnd(t), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup",
|
|
4856
|
+
n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && T < a - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b + g >= o && T > this.EDGE_THRESHOLD && (this.slider.width(m + b + g), this.emitUpdate("right")), d = b);
|
|
4857
|
+
}, u = () => {
|
|
4858
|
+
this.handleDragEnd(t), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
|
|
4858
4859
|
};
|
|
4859
|
-
document.addEventListener("mousemove", p), document.addEventListener("mouseup",
|
|
4860
|
+
document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
|
|
4860
4861
|
}
|
|
4861
4862
|
// 开始自动扩展
|
|
4862
4863
|
startAutoExpand(t, e = 0, i = 0) {
|
|
@@ -5016,7 +5017,7 @@ class Fe {
|
|
|
5016
5017
|
this.width,
|
|
5017
5018
|
e
|
|
5018
5019
|
), r.setOffset(this.offsetX, this.offsetY), this.rowsGroup.add(r.row), this.rowsCache.set(o, r)), r.cacheKey = i, this.context.store.getDataManager().isTaskSelected(s.id) && this.selectRow(s.id);
|
|
5019
|
-
const
|
|
5020
|
+
const g = new S.Rect({
|
|
5020
5021
|
x: 0,
|
|
5021
5022
|
y: c + this.offsetY,
|
|
5022
5023
|
width: this.width,
|
|
@@ -5026,7 +5027,7 @@ class Fe {
|
|
|
5026
5027
|
listening: !1
|
|
5027
5028
|
// 不需要监听事件
|
|
5028
5029
|
});
|
|
5029
|
-
this.rowBgGroup.add(
|
|
5030
|
+
this.rowBgGroup.add(g), this.rowBgGroup.moveToBottom();
|
|
5030
5031
|
}), this.rowsCache.forEach((s, n) => {
|
|
5031
5032
|
s.cacheKey !== i && (s.destroy(), this.rowsCache.delete(n));
|
|
5032
5033
|
}), this.layer.batchDraw();
|
|
@@ -5087,10 +5088,7 @@ class Fe {
|
|
|
5087
5088
|
const e = this.stage.getPointerPosition();
|
|
5088
5089
|
if (!e) return;
|
|
5089
5090
|
const i = this.getTaskByPosition(e);
|
|
5090
|
-
|
|
5091
|
-
if (this.context.store.getDataManager().isTaskSelected(i.id)) return;
|
|
5092
|
-
this.context.store.getDataManager().selectTask(i.id), this.context.event.emit(k.ROW_CLICK, t.evt, i);
|
|
5093
|
-
}
|
|
5091
|
+
i && (this.context.store.getDataManager().isTaskSelected(i.id) || this.context.store.getDataManager().selectTask(i.id), this.context.event.emit(k.ROW_CLICK, t.evt, i));
|
|
5094
5092
|
}
|
|
5095
5093
|
/**
|
|
5096
5094
|
* 处理双击
|
|
@@ -5261,12 +5259,12 @@ class Bt {
|
|
|
5261
5259
|
} = t || {}, o = s % 180, r = o * Math.PI / 180;
|
|
5262
5260
|
let a, c;
|
|
5263
5261
|
o === 0 ? (a = n, c = i + n) : o === 90 ? (a = i + n, c = n) : (a = Math.abs(Math.ceil((i + n) / Math.sin(r))), c = Math.abs(Math.ceil((i + n) / Math.cos(r))));
|
|
5264
|
-
const
|
|
5262
|
+
const g = new S.Stage({
|
|
5265
5263
|
container: document.createElement("div"),
|
|
5266
5264
|
width: a,
|
|
5267
5265
|
height: c
|
|
5268
5266
|
}), d = new S.Layer();
|
|
5269
|
-
|
|
5267
|
+
g.add(d);
|
|
5270
5268
|
const l = new S.Group();
|
|
5271
5269
|
if (o === 0 || o === 90) {
|
|
5272
5270
|
const p = new S.Line({
|
|
@@ -5278,8 +5276,8 @@ class Bt {
|
|
|
5278
5276
|
l.add(p);
|
|
5279
5277
|
} else
|
|
5280
5278
|
for (let p = -a; p < a * 2; p += a) {
|
|
5281
|
-
const
|
|
5282
|
-
points: [Math.ceil(
|
|
5279
|
+
const u = p + i / 2, y = 0, x = p + i / 2 + (Math.cos(r) < 0 ? -a : a), T = c, b = new S.Line({
|
|
5280
|
+
points: [Math.ceil(u), Math.ceil(y), Math.ceil(x), Math.ceil(T)],
|
|
5283
5281
|
stroke: e,
|
|
5284
5282
|
strokeWidth: i,
|
|
5285
5283
|
perfectDrawEnabled: !0,
|
|
@@ -5290,7 +5288,7 @@ class Bt {
|
|
|
5290
5288
|
}
|
|
5291
5289
|
d.add(l), d.draw();
|
|
5292
5290
|
const m = new Image();
|
|
5293
|
-
return m.src =
|
|
5291
|
+
return m.src = g.toDataURL(), g.destroy(), m;
|
|
5294
5292
|
}
|
|
5295
5293
|
/**
|
|
5296
5294
|
* 创建圆点图案
|
|
@@ -5345,22 +5343,22 @@ class Bt {
|
|
|
5345
5343
|
height: r
|
|
5346
5344
|
}), c = new S.Layer();
|
|
5347
5345
|
a.add(c);
|
|
5348
|
-
const
|
|
5349
|
-
|
|
5346
|
+
const g = new S.Group();
|
|
5347
|
+
g.add(
|
|
5350
5348
|
new S.Line({
|
|
5351
5349
|
points: [0, 0, o, r],
|
|
5352
5350
|
stroke: e,
|
|
5353
5351
|
strokeWidth: i,
|
|
5354
5352
|
perfectDrawEnabled: !0
|
|
5355
5353
|
})
|
|
5356
|
-
),
|
|
5354
|
+
), g.add(
|
|
5357
5355
|
new S.Line({
|
|
5358
5356
|
points: [0, r, o, 0],
|
|
5359
5357
|
stroke: e,
|
|
5360
5358
|
strokeWidth: i,
|
|
5361
5359
|
perfectDrawEnabled: !0
|
|
5362
5360
|
})
|
|
5363
|
-
), c.add(
|
|
5361
|
+
), c.add(g), c.draw();
|
|
5364
5362
|
const d = new Image();
|
|
5365
5363
|
return d.src = a.toDataURL(), a.destroy(), d;
|
|
5366
5364
|
}
|
|
@@ -5415,26 +5413,26 @@ class Be {
|
|
|
5415
5413
|
*/
|
|
5416
5414
|
async calculateWeekend() {
|
|
5417
5415
|
if (this.clearWeekend(), !this.context.getOptions().weekend.show) return;
|
|
5418
|
-
const t = this.context.store.getTimeAxis().getStartTime(), e = this.context.store.getTimeAxis().getEndTime(), i = this.context.store.getTimeAxis().getCellUnit(), s = this.context.store.getTimeAxis().getCellWidth(), n = this.context.getOptions().header.height, o = this.context.getOptions().row.height, a = this.context.store.getDataManager().getVisibleSize() * o, c = Math.max(0, -this.offsetX),
|
|
5416
|
+
const t = this.context.store.getTimeAxis().getStartTime(), e = this.context.store.getTimeAxis().getEndTime(), i = this.context.store.getTimeAxis().getCellUnit(), s = this.context.store.getTimeAxis().getCellWidth(), n = this.context.getOptions().header.height, o = this.context.getOptions().row.height, a = this.context.store.getDataManager().getVisibleSize() * o, c = Math.max(0, -this.offsetX), g = c + this.width;
|
|
5419
5417
|
for (let d = t; d <= e; ) {
|
|
5420
5418
|
let l = s;
|
|
5421
5419
|
if (l = s * 2 * (i === "day" ? 1 : 24), this.isWeekend(d)) {
|
|
5422
|
-
const m = this.context.store.getTimeAxis().getTimeLeft(d), p = n,
|
|
5420
|
+
const m = this.context.store.getTimeAxis().getTimeLeft(d), p = n, u = a;
|
|
5423
5421
|
if (m + l < c) {
|
|
5424
5422
|
d = d.add(2, "day");
|
|
5425
5423
|
continue;
|
|
5426
5424
|
}
|
|
5427
|
-
if (m >
|
|
5425
|
+
if (m > g)
|
|
5428
5426
|
break;
|
|
5429
5427
|
!this.patternImage && this.context.getOptions().weekend.pattern && (this.patternImage = await Bt.createPattern(
|
|
5430
5428
|
this.context.getOptions().weekend
|
|
5431
5429
|
));
|
|
5432
|
-
const
|
|
5430
|
+
const x = new S.Rect({
|
|
5433
5431
|
name: "weekend-rect",
|
|
5434
5432
|
x: m,
|
|
5435
5433
|
y: p,
|
|
5436
5434
|
width: l,
|
|
5437
|
-
height:
|
|
5435
|
+
height: u,
|
|
5438
5436
|
// 根据模式设置填充
|
|
5439
5437
|
...this.patternImage ? {
|
|
5440
5438
|
fillPatternImage: this.patternImage,
|
|
@@ -5446,7 +5444,7 @@ class Be {
|
|
|
5446
5444
|
},
|
|
5447
5445
|
opacity: this.context.getOptions().weekend.opacity
|
|
5448
5446
|
});
|
|
5449
|
-
this.weekendGroup.add(
|
|
5447
|
+
this.weekendGroup.add(x), d = d.add(2, "day");
|
|
5450
5448
|
} else
|
|
5451
5449
|
d = d.add(1, "day");
|
|
5452
5450
|
}
|
|
@@ -5482,7 +5480,7 @@ class ze {
|
|
|
5482
5480
|
* 渲染今日线
|
|
5483
5481
|
*/
|
|
5484
5482
|
render() {
|
|
5485
|
-
var d, l, m, p,
|
|
5483
|
+
var d, l, m, p, u, y, x;
|
|
5486
5484
|
const t = Object.assign(
|
|
5487
5485
|
{
|
|
5488
5486
|
show: !0,
|
|
@@ -5497,18 +5495,18 @@ class ze {
|
|
|
5497
5495
|
let e = G();
|
|
5498
5496
|
const i = this.context.store.getTimeAxis().getCellUnit();
|
|
5499
5497
|
t.type === "block" && (e = e.startOf(i));
|
|
5500
|
-
const s = this.context.store.getTimeAxis().getTimeLeft(e), n = this.context.store.getTimeAxis().getCellWidth(), o = this.context.getOptions().header.height, r = B(t.backgroundColor).alpha(t.opacity).toHex(), a = (t.type === "block" ? s + n / 2 : s) + this.offsetX, c = [a, o, a, this.height],
|
|
5501
|
-
if (this.todayLine ? (this.todayLine.points(c), this.todayLine.stroke(r), this.todayLine.strokeWidth(
|
|
5498
|
+
const s = this.context.store.getTimeAxis().getTimeLeft(e), n = this.context.store.getTimeAxis().getCellWidth(), o = this.context.getOptions().header.height, r = B(t.backgroundColor).alpha(t.opacity).toHex(), a = (t.type === "block" ? s + n / 2 : s) + this.offsetX, c = [a, o, a, this.height], g = t.type === "line" ? t.width : n;
|
|
5499
|
+
if (this.todayLine ? (this.todayLine.points(c), this.todayLine.stroke(r), this.todayLine.strokeWidth(g)) : (this.todayLine = new S.Line({
|
|
5502
5500
|
points: c,
|
|
5503
5501
|
stroke: r,
|
|
5504
|
-
strokeWidth:
|
|
5502
|
+
strokeWidth: g
|
|
5505
5503
|
}), this.bgLayer.add(this.todayLine)), (d = this.context.getOptions().today.text) != null && d.show) {
|
|
5506
|
-
const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((m = this.context.getOptions().today.text) == null ? void 0 : m.fontFamily) || "Arial", w = ((p = this.context.getOptions().today.text) == null ? void 0 : p.content) || "今天", C = new S.Text({ fontSize: T, fontFamily: b }).measureSize(w), L = ((
|
|
5504
|
+
const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((m = this.context.getOptions().today.text) == null ? void 0 : m.fontFamily) || "Arial", w = ((p = this.context.getOptions().today.text) == null ? void 0 : p.content) || "今天", C = new S.Text({ fontSize: T, fontFamily: b }).measureSize(w), L = ((u = this.context.getOptions().today.text) == null ? void 0 : u.color) || "white", E = ((y = this.context.getOptions().today.text) == null ? void 0 : y.backgroundColor) || r;
|
|
5507
5505
|
if (!this.todayTextGroup)
|
|
5508
5506
|
this.todayTextGroup = new S.Group({
|
|
5509
|
-
x: s + this.offsetX +
|
|
5507
|
+
x: s + this.offsetX + g,
|
|
5510
5508
|
y: o,
|
|
5511
|
-
opacity: (
|
|
5509
|
+
opacity: (x = this.context.getOptions().today.text) == null ? void 0 : x.opacity
|
|
5512
5510
|
}), this.todayTextGroup.add(new S.Rect({
|
|
5513
5511
|
x: 0,
|
|
5514
5512
|
y: 0,
|
|
@@ -5530,7 +5528,7 @@ class ze {
|
|
|
5530
5528
|
name: "today-text"
|
|
5531
5529
|
})), this.bgLayer.add(this.todayTextGroup);
|
|
5532
5530
|
else {
|
|
5533
|
-
this.todayTextGroup.x(s + this.offsetX +
|
|
5531
|
+
this.todayTextGroup.x(s + this.offsetX + g);
|
|
5534
5532
|
const v = this.todayTextGroup.findOne(".today-text");
|
|
5535
5533
|
v == null || v.setAttrs({
|
|
5536
5534
|
text: w,
|
|
@@ -5612,13 +5610,13 @@ class Ne {
|
|
|
5612
5610
|
* 计算假期
|
|
5613
5611
|
*/
|
|
5614
5612
|
async calculateHoliday() {
|
|
5615
|
-
var d, l, m, p,
|
|
5613
|
+
var d, l, m, p, u, y, x, T;
|
|
5616
5614
|
if (this.clearHoliday(), !this.context.getOptions().holiday.show) return;
|
|
5617
5615
|
const t = this.context.getOptions().holiday.holidays;
|
|
5618
5616
|
if (!t || t.length === 0) return;
|
|
5619
5617
|
const e = Math.max(0, -this.offsetX), i = e + this.width, s = this.context.store.getTimeAxis().getStartTime(), n = this.context.store.getTimeAxis().getEndTime();
|
|
5620
5618
|
this.context.store.getTimeAxis().getCellUnit();
|
|
5621
|
-
const o = this.context.store.getTimeAxis().getCellWidth(), r = this.context.getOptions().header.height, a = this.context.getOptions().row.height,
|
|
5619
|
+
const o = this.context.store.getTimeAxis().getCellWidth(), r = this.context.getOptions().header.height, a = this.context.getOptions().row.height, g = this.context.store.getDataManager().getVisibleSize() * a;
|
|
5622
5620
|
for (let b = s; b <= n; b = b.add(1, "day")) {
|
|
5623
5621
|
const w = t.find((C) => {
|
|
5624
5622
|
if (X(C.date)) {
|
|
@@ -5628,7 +5626,7 @@ class Ne {
|
|
|
5628
5626
|
return C;
|
|
5629
5627
|
});
|
|
5630
5628
|
if (w) {
|
|
5631
|
-
const C = this.context.store.getTimeAxis().getTimeLeft(b), L = r, E =
|
|
5629
|
+
const C = this.context.store.getTimeAxis().getTimeLeft(b), L = r, E = g;
|
|
5632
5630
|
if (C + o < e)
|
|
5633
5631
|
continue;
|
|
5634
5632
|
if (C > i)
|
|
@@ -5662,7 +5660,7 @@ class Ne {
|
|
|
5662
5660
|
if (this.holidayGroup.add(M), (d = w.text) != null && d.show) {
|
|
5663
5661
|
if (X(w.date) && !G(w.date[0]).isSame(b, "day"))
|
|
5664
5662
|
continue;
|
|
5665
|
-
const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, _ = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", D = ((p = w.text) == null ? void 0 : p.content) || "", H = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((
|
|
5663
|
+
const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, _ = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", D = ((p = w.text) == null ? void 0 : p.content) || "", H = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((u = w.text) == null ? void 0 : u.color) || "white", I = ((y = w.text) == null ? void 0 : y.backgroundColor) || w.backgroundColor || ((x = this.context.getOptions().holiday) == null ? void 0 : x.backgroundColor) || this.context.getOptions().primaryColor, R = new S.Group({
|
|
5666
5664
|
name: "holiday-text-group",
|
|
5667
5665
|
x: C,
|
|
5668
5666
|
y: L,
|
|
@@ -5729,16 +5727,16 @@ class Pe {
|
|
|
5729
5727
|
* 计算标志日期
|
|
5730
5728
|
*/
|
|
5731
5729
|
async calculateFlag() {
|
|
5732
|
-
var d, l, m, p,
|
|
5730
|
+
var d, l, m, p, u, y, x;
|
|
5733
5731
|
if (this.clearFlag(), !((d = this.context.getOptions().flag) != null && d.show)) return;
|
|
5734
5732
|
const t = (l = this.context.getOptions().flag) == null ? void 0 : l.data;
|
|
5735
5733
|
if (!t || t.length === 0) return;
|
|
5736
|
-
const e = ((m = this.context.getOptions().flag) == null ? void 0 : m.backgroundColor) || this.context.getOptions().primaryColor, i = ((p = this.context.getOptions().flag) == null ? void 0 : p.opacity) || 1, s = ((
|
|
5734
|
+
const e = ((m = this.context.getOptions().flag) == null ? void 0 : m.backgroundColor) || this.context.getOptions().primaryColor, i = ((p = this.context.getOptions().flag) == null ? void 0 : p.opacity) || 1, s = ((u = this.context.getOptions().flag) == null ? void 0 : u.color) || (B(e).isDark() ? "white" : "black"), n = ((y = this.context.getOptions().flag) == null ? void 0 : y.fontFamily) || "Arial", o = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontSize) || 10, r = Math.max(0, -this.offsetX), a = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), g = this.context.getOptions().header.height;
|
|
5737
5735
|
this.context.getOptions().row.height, this.context.store.getDataManager().getVisibleSize(), t.forEach((T) => {
|
|
5738
|
-
const b = G(T.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C =
|
|
5736
|
+
const b = G(T.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C = g;
|
|
5739
5737
|
if (w + c < r || w > a)
|
|
5740
5738
|
return;
|
|
5741
|
-
const E = [w,
|
|
5739
|
+
const E = [w, g, w, this.height], v = new S.Line({
|
|
5742
5740
|
points: E,
|
|
5743
5741
|
stroke: T.backgroundColor || e,
|
|
5744
5742
|
opacity: T.opacity || i,
|
|
@@ -5896,32 +5894,32 @@ class Ye {
|
|
|
5896
5894
|
* 计算点组位置
|
|
5897
5895
|
*/
|
|
5898
5896
|
calculatePoints(t) {
|
|
5899
|
-
var
|
|
5897
|
+
var g, d;
|
|
5900
5898
|
if (!this.context.getOptions().links.show || !this.context.getOptions().links.create.enabled) {
|
|
5901
5899
|
this.pointGroup.destroyChildren();
|
|
5902
5900
|
return;
|
|
5903
5901
|
}
|
|
5904
|
-
t ? ((
|
|
5902
|
+
t ? ((g = this.pointGroup.findOne(`#point-${t.id}-left`)) == null || g.destroy(), (d = this.pointGroup.findOne(`#point-${t.id}-right`)) == null || d.destroy()) : this.pointGroup.destroyChildren();
|
|
5905
5903
|
const e = this.context.getOptions().header.height, i = this.context.getOptions().row.height, s = i / 2 + e, n = this.context.getOptions().links.create.radius, o = this.context.getOptions().links.create.mode === "always" ? 0.5 : 0, r = this.context.getOptions().links.create.color || this.context.getOptions().primaryColor, a = B(r).alpha(this.context.getOptions().links.create.opacity ?? 1).toHex(), c = this.context.getOptions().links.create.width;
|
|
5906
5904
|
this.tasks.forEach((l) => {
|
|
5907
5905
|
if (!(t && l.id !== t.id) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, l) && l.startTime && l.endTime) {
|
|
5908
5906
|
const m = this.context.store.getTimeAxis().getTimeLeft(l.startTime), p = this.context.store.getTimeAxis().getTimeLeft(l.endTime);
|
|
5909
|
-
let
|
|
5910
|
-
l.isMilestone() && (
|
|
5911
|
-
const
|
|
5912
|
-
let
|
|
5913
|
-
if (ht(b) ?
|
|
5907
|
+
let u = this.context.getOptions().links.gap;
|
|
5908
|
+
l.isMilestone() && (u += i / 2);
|
|
5909
|
+
const y = s + i * l.flatIndex;
|
|
5910
|
+
let x = !0, T = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
|
|
5911
|
+
if (ht(b) ? x = T = b : V(b) && (x = b === "S", T = b === "F"), x) {
|
|
5914
5912
|
const w = new S.Circle({
|
|
5915
5913
|
id: `point-${l.id}-left`,
|
|
5916
|
-
x: m -
|
|
5917
|
-
y
|
|
5914
|
+
x: m - u,
|
|
5915
|
+
y,
|
|
5918
5916
|
radius: n,
|
|
5919
5917
|
opacity: o,
|
|
5920
5918
|
stroke: a,
|
|
5921
5919
|
strokeWidth: c
|
|
5922
5920
|
});
|
|
5923
5921
|
this.pointGroup.add(w), w.on("mousedown", (C) => {
|
|
5924
|
-
this.isDragging = !0, this.createLink(C, "S", r, [m -
|
|
5922
|
+
this.isDragging = !0, this.createLink(C, "S", r, [m - u, y], l.id);
|
|
5925
5923
|
}), w.on("mouseover", (C) => {
|
|
5926
5924
|
this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
|
|
5927
5925
|
}), w.on("mouseout", (C) => {
|
|
@@ -5931,15 +5929,15 @@ class Ye {
|
|
|
5931
5929
|
if (T) {
|
|
5932
5930
|
const w = new S.Circle({
|
|
5933
5931
|
id: `point-${l.id}-right`,
|
|
5934
|
-
x: p +
|
|
5935
|
-
y
|
|
5932
|
+
x: p + u,
|
|
5933
|
+
y,
|
|
5936
5934
|
radius: n,
|
|
5937
5935
|
opacity: o,
|
|
5938
5936
|
stroke: a,
|
|
5939
5937
|
strokeWidth: c
|
|
5940
5938
|
});
|
|
5941
5939
|
this.pointGroup.add(w), w.on("mousedown", (C) => {
|
|
5942
|
-
this.isDragging = !0, this.createLink(C, "F", r, [p +
|
|
5940
|
+
this.isDragging = !0, this.createLink(C, "F", r, [p + u, y], l.id);
|
|
5943
5941
|
}), w.on("mouseover", (C) => {
|
|
5944
5942
|
this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
|
|
5945
5943
|
}), w.on("mouseout", (C) => {
|
|
@@ -5968,7 +5966,7 @@ class Ye {
|
|
|
5968
5966
|
});
|
|
5969
5967
|
const i = Q();
|
|
5970
5968
|
e.forEach((s) => {
|
|
5971
|
-
var
|
|
5969
|
+
var g, d, l, m, p, u, y, x;
|
|
5972
5970
|
if (s.valid === !1) return;
|
|
5973
5971
|
const n = this.createId(s), o = this.context.store.getDataManager().getTaskById(s.from), r = this.context.store.getDataManager().getTaskById(s.to);
|
|
5974
5972
|
if (!o) {
|
|
@@ -5988,12 +5986,12 @@ class Ye {
|
|
|
5988
5986
|
if (!this.context.store.getDataManager().isTaskVisible(o) || !this.context.store.getDataManager().isTaskVisible(r) || o.flatIndex < this.tasks[0].flatIndex && r.flatIndex < this.tasks[0].flatIndex || o.flatIndex > this.tasks[this.tasks.length - 1].flatIndex && r.flatIndex > this.tasks[this.tasks.length - 1].flatIndex)
|
|
5989
5987
|
return;
|
|
5990
5988
|
const a = Math.max(0, -this.offsetX), c = a + this.width;
|
|
5991
|
-
if (!(this.context.store.getTimeAxis().getTimeLeft(((
|
|
5989
|
+
if (!(this.context.store.getTimeAxis().getTimeLeft(((g = s.type) == null ? void 0 : g[0]) === "S" ? o.startTime : o.endTime) < a && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < a) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((m = s.type) == null ? void 0 : m[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
|
|
5992
5990
|
const T = this.getPoints(o, r, s);
|
|
5993
5991
|
if (T.length <= 2)
|
|
5994
5992
|
O.warn("The link position has some error.", s);
|
|
5995
5993
|
else {
|
|
5996
|
-
const b = s.radius ?? this.context.getOptions().links.radius, w = ((p = s.arrow) == null ? void 0 : p.width) ?? this.context.getOptions().links.arrow.width, C = ((
|
|
5994
|
+
const b = s.radius ?? this.context.getOptions().links.radius, w = ((p = s.arrow) == null ? void 0 : p.width) ?? this.context.getOptions().links.arrow.width, C = ((u = s.arrow) == null ? void 0 : u.height) ?? this.context.getOptions().links.arrow.height, L = s.width ?? this.context.getOptions().links.width;
|
|
5997
5995
|
let E = this.linkCache.get(n);
|
|
5998
5996
|
E === void 0 && (E = new S.Group({ id: n })), t != null && t.length || (E._ = i);
|
|
5999
5997
|
const v = E.findOne("Circle");
|
|
@@ -6043,7 +6041,7 @@ class Ye {
|
|
|
6043
6041
|
W.points(D), W.stroke(
|
|
6044
6042
|
s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
|
|
6045
6043
|
), W.strokeWidth(L + (this.selectedMap.has(n) ? 2 : 0)), W.pointerLength(C), W.pointerWidth(w), W.fill(
|
|
6046
|
-
((
|
|
6044
|
+
((y = s.arrow) == null ? void 0 : y.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
|
|
6047
6045
|
), W.lineJoin("round"), W.dash(s.dash || this.context.getOptions().links.dash);
|
|
6048
6046
|
else {
|
|
6049
6047
|
const I = new S.Arrow({
|
|
@@ -6052,7 +6050,7 @@ class Ye {
|
|
|
6052
6050
|
strokeWidth: L,
|
|
6053
6051
|
pointerLength: C,
|
|
6054
6052
|
pointerWidth: w,
|
|
6055
|
-
fill: ((
|
|
6053
|
+
fill: ((x = s.arrow) == null ? void 0 : x.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
|
|
6056
6054
|
// 箭头填充色
|
|
6057
6055
|
lineJoin: "round",
|
|
6058
6056
|
dash: s.dash || this.context.getOptions().links.dash,
|
|
@@ -6119,21 +6117,21 @@ class Ye {
|
|
|
6119
6117
|
}
|
|
6120
6118
|
getPoints(t, e, i) {
|
|
6121
6119
|
if (t.startTime && t.endTime && e.startTime && e.endTime) {
|
|
6122
|
-
const s = this.context.getOptions().row.height, n = t.isMilestone() ? s / 2 : 0, o = this.context.store.getTimeAxis().getTimeLeft(t.startTime) - n, r = this.context.store.getTimeAxis().getTimeLeft(t.endTime) + n, a = e.isMilestone() ? s / 2 : 0, c = this.context.store.getTimeAxis().getTimeLeft(e.startTime) - a,
|
|
6120
|
+
const s = this.context.getOptions().row.height, n = t.isMilestone() ? s / 2 : 0, o = this.context.store.getTimeAxis().getTimeLeft(t.startTime) - n, r = this.context.store.getTimeAxis().getTimeLeft(t.endTime) + n, a = e.isMilestone() ? s / 2 : 0, c = this.context.store.getTimeAxis().getTimeLeft(e.startTime) - a, g = this.context.store.getTimeAxis().getTimeLeft(e.endTime) + a;
|
|
6123
6121
|
let d = [];
|
|
6124
6122
|
switch (i.type || "FS") {
|
|
6125
6123
|
case "FF":
|
|
6126
|
-
d = this.createFF(i, t, e, o, r, c,
|
|
6124
|
+
d = this.createFF(i, t, e, o, r, c, g);
|
|
6127
6125
|
break;
|
|
6128
6126
|
case "SS":
|
|
6129
|
-
d = this.createSS(i, t, e, o, r, c,
|
|
6127
|
+
d = this.createSS(i, t, e, o, r, c, g);
|
|
6130
6128
|
break;
|
|
6131
6129
|
case "SF":
|
|
6132
|
-
d = this.createSF(i, t, e, o, r, c,
|
|
6130
|
+
d = this.createSF(i, t, e, o, r, c, g);
|
|
6133
6131
|
break;
|
|
6134
6132
|
case "FS":
|
|
6135
6133
|
default:
|
|
6136
|
-
d = this.createFS(i, t, e, o, r, c,
|
|
6134
|
+
d = this.createFS(i, t, e, o, r, c, g);
|
|
6137
6135
|
}
|
|
6138
6136
|
return d;
|
|
6139
6137
|
}
|
|
@@ -6141,108 +6139,108 @@ class Ye {
|
|
|
6141
6139
|
}
|
|
6142
6140
|
/** 生成 FS 连线 */
|
|
6143
6141
|
createFS(t, e, i, s, n, o, r) {
|
|
6144
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6142
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = t.gap || this.context.getOptions().links.gap, l = [
|
|
6145
6143
|
n + d,
|
|
6146
|
-
0.05 +
|
|
6144
|
+
0.05 + g + c * e.flatIndex
|
|
6147
6145
|
];
|
|
6148
6146
|
{
|
|
6149
6147
|
const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
|
|
6150
6148
|
if (isNaN(m))
|
|
6151
6149
|
O.error("Link's distance must be a Numeric");
|
|
6152
6150
|
else {
|
|
6153
|
-
const p = n + d + m,
|
|
6154
|
-
Math.max(p,
|
|
6155
|
-
|
|
6151
|
+
const p = n + d + m, u = o - d - m, y = [
|
|
6152
|
+
Math.max(p, u),
|
|
6153
|
+
g + c * e.flatIndex
|
|
6156
6154
|
];
|
|
6157
|
-
l.push(...
|
|
6158
|
-
const
|
|
6159
|
-
l.push(
|
|
6155
|
+
l.push(...y);
|
|
6156
|
+
const x = c * e.flatIndex + a + (e.flatIndex <= i.flatIndex ? c : 0);
|
|
6157
|
+
l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
|
|
6160
6158
|
}
|
|
6161
6159
|
}
|
|
6162
|
-
return l.push(o - d,
|
|
6160
|
+
return l.push(o - d, g + c * i.flatIndex), l;
|
|
6163
6161
|
}
|
|
6164
6162
|
/** 生成 FF 连线 */
|
|
6165
6163
|
createFF(t, e, i, s, n, o, r) {
|
|
6166
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6164
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = t.gap || this.context.getOptions().links.gap, l = [
|
|
6167
6165
|
n + d,
|
|
6168
|
-
0.05 +
|
|
6166
|
+
0.05 + g + c * e.flatIndex
|
|
6169
6167
|
];
|
|
6170
6168
|
{
|
|
6171
6169
|
const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
|
|
6172
6170
|
if (isNaN(m))
|
|
6173
6171
|
O.error("Link's distance must be a Numeric");
|
|
6174
6172
|
else {
|
|
6175
|
-
const p = n + d + m,
|
|
6176
|
-
p <=
|
|
6177
|
-
|
|
6173
|
+
const p = n + d + m, u = r + d + m, y = [
|
|
6174
|
+
p <= u ? u : p,
|
|
6175
|
+
g + c * e.flatIndex
|
|
6178
6176
|
];
|
|
6179
|
-
l.push(...
|
|
6180
|
-
Math.max(
|
|
6181
|
-
|
|
6177
|
+
l.push(...y), l.push(
|
|
6178
|
+
Math.max(u, p),
|
|
6179
|
+
g + c * i.flatIndex
|
|
6182
6180
|
);
|
|
6183
6181
|
}
|
|
6184
6182
|
}
|
|
6185
|
-
return l.push(r + d,
|
|
6183
|
+
return l.push(r + d, g + c * i.flatIndex), l;
|
|
6186
6184
|
}
|
|
6187
6185
|
/** 生成 SS 连线 */
|
|
6188
6186
|
createSS(t, e, i, s, n, o, r) {
|
|
6189
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6187
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = t.gap || this.context.getOptions().links.gap, l = [
|
|
6190
6188
|
s - d,
|
|
6191
|
-
0.05 +
|
|
6189
|
+
0.05 + g + c * e.flatIndex
|
|
6192
6190
|
];
|
|
6193
6191
|
{
|
|
6194
6192
|
const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
|
|
6195
6193
|
if (isNaN(m))
|
|
6196
6194
|
O.error("Link's distance must be a Numeric");
|
|
6197
6195
|
else {
|
|
6198
|
-
const p = s - d - m,
|
|
6196
|
+
const p = s - d - m, u = o - d - m;
|
|
6199
6197
|
l.push(
|
|
6200
|
-
Math.min(
|
|
6201
|
-
|
|
6198
|
+
Math.min(u, p),
|
|
6199
|
+
g + c * e.flatIndex
|
|
6202
6200
|
), l.push(
|
|
6203
|
-
Math.min(
|
|
6204
|
-
|
|
6201
|
+
Math.min(u, p),
|
|
6202
|
+
g + c * i.flatIndex
|
|
6205
6203
|
);
|
|
6206
6204
|
}
|
|
6207
6205
|
}
|
|
6208
|
-
return l.push(o - d,
|
|
6206
|
+
return l.push(o - d, g + c * i.flatIndex), l;
|
|
6209
6207
|
}
|
|
6210
6208
|
/** 生成 SF 连线 */
|
|
6211
6209
|
createSF(t, e, i, s, n, o, r) {
|
|
6212
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6210
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = t.gap || this.context.getOptions().links.gap, l = [
|
|
6213
6211
|
s - d,
|
|
6214
|
-
0.05 +
|
|
6212
|
+
0.05 + g + c * e.flatIndex
|
|
6215
6213
|
];
|
|
6216
6214
|
{
|
|
6217
6215
|
const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
|
|
6218
6216
|
if (isNaN(m))
|
|
6219
6217
|
O.error("Link's distance must be a Numeric");
|
|
6220
6218
|
else {
|
|
6221
|
-
const p = s - d - m,
|
|
6222
|
-
Math.min(p,
|
|
6223
|
-
|
|
6219
|
+
const p = s - d - m, u = r + d + m, y = [
|
|
6220
|
+
Math.min(p, u),
|
|
6221
|
+
g + c * e.flatIndex
|
|
6224
6222
|
];
|
|
6225
|
-
l.push(...
|
|
6226
|
-
const
|
|
6227
|
-
l.push(
|
|
6223
|
+
l.push(...y);
|
|
6224
|
+
const x = c * e.flatIndex + a + (e.flatIndex <= i.flatIndex ? c : 0);
|
|
6225
|
+
l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
|
|
6228
6226
|
}
|
|
6229
6227
|
}
|
|
6230
|
-
return l.push(r + d,
|
|
6228
|
+
return l.push(r + d, g + c * i.flatIndex), l;
|
|
6231
6229
|
}
|
|
6232
6230
|
/**
|
|
6233
6231
|
* 处理连线被点击后的移动
|
|
6234
6232
|
*/
|
|
6235
6233
|
handleDrag(t, e, i, s, n) {
|
|
6236
|
-
var
|
|
6234
|
+
var y, x, T;
|
|
6237
6235
|
if (!this.isDragging || this.context.getOptions().links.move.enabled !== !0) return;
|
|
6238
6236
|
this.stage.container().style.cursor = "pointer";
|
|
6239
6237
|
const o = this.linksGroup.findOne(`#${n}`);
|
|
6240
6238
|
this.templateArrow.setAttrs({
|
|
6241
6239
|
stroke: e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
|
|
6242
6240
|
strokeWidth: e.width ?? this.context.getOptions().links.width,
|
|
6243
|
-
pointerLength: ((
|
|
6241
|
+
pointerLength: ((y = e.arrow) == null ? void 0 : y.height) ?? this.context.getOptions().links.arrow.height,
|
|
6244
6242
|
// 箭头长度
|
|
6245
|
-
pointerWidth: ((
|
|
6243
|
+
pointerWidth: ((x = e.arrow) == null ? void 0 : x.width) ?? this.context.getOptions().links.arrow.width,
|
|
6246
6244
|
// 箭头宽度
|
|
6247
6245
|
fill: ((T = e.arrow) == null ? void 0 : T.color) || this.context.getOptions().links.arrow.color || e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
|
|
6248
6246
|
// 箭头填充色
|
|
@@ -6250,7 +6248,7 @@ class Ye {
|
|
|
6250
6248
|
dash: e.data || this.context.getOptions().links.dash
|
|
6251
6249
|
}), this.templateArrow.visible(!1);
|
|
6252
6250
|
let r = null;
|
|
6253
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6251
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = e.gap || this.context.getOptions().links.gap;
|
|
6254
6252
|
let l = null;
|
|
6255
6253
|
const m = () => {
|
|
6256
6254
|
const b = this.stage.getPointerPosition();
|
|
@@ -6263,7 +6261,7 @@ class Ye {
|
|
|
6263
6261
|
const { allowLeft: M, allowRight: A } = this.isAllowStartDrop(l, e.to, v);
|
|
6264
6262
|
this.templateArrow.points([
|
|
6265
6263
|
E,
|
|
6266
|
-
|
|
6264
|
+
g + c * l.flatIndex,
|
|
6267
6265
|
...s
|
|
6268
6266
|
]), A ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
|
|
6269
6267
|
} else if (i === "F") {
|
|
@@ -6271,7 +6269,7 @@ class Ye {
|
|
|
6271
6269
|
this.templateArrow.points([
|
|
6272
6270
|
...s,
|
|
6273
6271
|
E,
|
|
6274
|
-
|
|
6272
|
+
g + c * l.flatIndex
|
|
6275
6273
|
]), M ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
|
|
6276
6274
|
}
|
|
6277
6275
|
}
|
|
@@ -6286,10 +6284,10 @@ class Ye {
|
|
|
6286
6284
|
} else
|
|
6287
6285
|
this.context.event.emit(k.ERROR, Y.TASK_NOT_FOUND);
|
|
6288
6286
|
this.cleanupTempLink(), this.calculateLinks([l, this.context.store.getDataManager().getTaskById(e.from), this.context.store.getDataManager().getTaskById(e.to)].filter((E) => !!E)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
|
|
6289
|
-
},
|
|
6290
|
-
b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown",
|
|
6287
|
+
}, u = (b) => {
|
|
6288
|
+
b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
|
|
6291
6289
|
};
|
|
6292
|
-
document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown",
|
|
6290
|
+
document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
|
|
6293
6291
|
}
|
|
6294
6292
|
/**
|
|
6295
6293
|
* 处理连线被点击后的移动
|
|
@@ -6308,42 +6306,42 @@ class Ye {
|
|
|
6308
6306
|
}), this.templateArrow.visible(!1);
|
|
6309
6307
|
const o = this.context.store.getLinkManager();
|
|
6310
6308
|
let r = null;
|
|
6311
|
-
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height,
|
|
6309
|
+
const a = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + a, d = this.context.getOptions().links.gap;
|
|
6312
6310
|
let l = null;
|
|
6313
6311
|
const m = () => {
|
|
6314
|
-
const
|
|
6315
|
-
if (
|
|
6316
|
-
const
|
|
6317
|
-
let w =
|
|
6318
|
-
|
|
6312
|
+
const y = this.stage.getPointerPosition();
|
|
6313
|
+
if (y && (l = this.getTaskByPosition(y), !!l && (this.templateArrow.visible(!0), l.startTime && l.endTime))) {
|
|
6314
|
+
const x = this.context.store.getTimeAxis().getTimeLeft(l.startTime), T = this.context.store.getTimeAxis().getTimeLeft(l.endTime), b = (T + x) / 2 + this.offsetX;
|
|
6315
|
+
let w = x - d;
|
|
6316
|
+
y.x <= b ? r = "S" : (r = "F", w = T + d), this.templateArrow.points([
|
|
6319
6317
|
...s,
|
|
6320
6318
|
w,
|
|
6321
|
-
|
|
6319
|
+
g + c * l.flatIndex
|
|
6322
6320
|
]);
|
|
6323
6321
|
const { allowLeft: C, allowRight: L } = this.isAllowEndDrop(l, n, o.convertPointsToLinkType(e, r));
|
|
6324
6322
|
r === "S" && !C ? this.stage.container().style.cursor = "not-allowed" : r === "F" && !L ? this.stage.container().style.cursor = "not-allowed" : this.stage.container().style.cursor = "pointer";
|
|
6325
6323
|
}
|
|
6326
6324
|
}, p = () => {
|
|
6327
|
-
let
|
|
6328
|
-
if (r && (
|
|
6329
|
-
if (o.isLinkExist(n, l.id,
|
|
6325
|
+
let y;
|
|
6326
|
+
if (r && (y = o.convertPointsToLinkType(e, r)), y && l)
|
|
6327
|
+
if (o.isLinkExist(n, l.id, y))
|
|
6330
6328
|
this.context.event.emit(k.ERROR, Y.LINK_EXIST);
|
|
6331
6329
|
else if (n === l.id && e === r)
|
|
6332
6330
|
this.context.event.emit(k.ERROR, Y.LINK_SAME);
|
|
6333
6331
|
else {
|
|
6334
|
-
const { allowLeft:
|
|
6335
|
-
r === "S" &&
|
|
6332
|
+
const { allowLeft: x, allowRight: T, reason: b } = this.isAllowEndDrop(l, n, y, !0);
|
|
6333
|
+
r === "S" && x || r === "F" && T ? (this.context.event.emit(k.CREATE_LINK, {
|
|
6336
6334
|
from: n,
|
|
6337
6335
|
to: l.id,
|
|
6338
|
-
type:
|
|
6336
|
+
type: y,
|
|
6339
6337
|
color: i
|
|
6340
6338
|
}), this.context.store.getLinkManager().update()) : this.context.event.emit(k.ERROR, b || Y.LINK_NOT_ALLOWED);
|
|
6341
6339
|
}
|
|
6342
|
-
this.cleanupTempLink(), this.calculateLinks([l].filter((
|
|
6343
|
-
},
|
|
6344
|
-
|
|
6340
|
+
this.cleanupTempLink(), this.calculateLinks([l].filter((x) => !!x)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
|
|
6341
|
+
}, u = (y) => {
|
|
6342
|
+
y.key === "Escape" && (this.cleanupTempLink(), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
|
|
6345
6343
|
};
|
|
6346
|
-
document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown",
|
|
6344
|
+
document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
|
|
6347
6345
|
}
|
|
6348
6346
|
/**
|
|
6349
6347
|
* 清理临时连线状态
|
|
@@ -6370,7 +6368,7 @@ class Ye {
|
|
|
6370
6368
|
j(r) && (r = r(
|
|
6371
6369
|
t.getEmitData(),
|
|
6372
6370
|
this.context.store.getDataManager().getTaskById(e).getEmitData()
|
|
6373
|
-
)), ht(r) ? n = o = r :
|
|
6371
|
+
)), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
|
|
6374
6372
|
const a = this.validateChain(t.id, e, i, s);
|
|
6375
6373
|
return {
|
|
6376
6374
|
allowLeft: n && a.ok,
|
|
@@ -6386,7 +6384,7 @@ class Ye {
|
|
|
6386
6384
|
j(r) && (r = r(
|
|
6387
6385
|
t.getEmitData(),
|
|
6388
6386
|
this.context.store.getDataManager().getTaskById(e).getEmitData()
|
|
6389
|
-
)), ht(r) ? n = o = r :
|
|
6387
|
+
)), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
|
|
6390
6388
|
const a = this.validateChain(e, t.id, i, s);
|
|
6391
6389
|
return {
|
|
6392
6390
|
allowLeft: n && a.ok,
|
|
@@ -6405,7 +6403,7 @@ class Ye {
|
|
|
6405
6403
|
* 操作高亮关联线
|
|
6406
6404
|
*/
|
|
6407
6405
|
handleHighlight(t, e, i, s, n, o, r = !1) {
|
|
6408
|
-
const a = t.findOne("Circle"), c = t.findOne("Arrow"),
|
|
6406
|
+
const a = t.findOne("Circle"), c = t.findOne("Arrow"), g = t.findOne("Line");
|
|
6409
6407
|
a && new S.Tween({
|
|
6410
6408
|
node: a,
|
|
6411
6409
|
radius: e + o,
|
|
@@ -6416,8 +6414,8 @@ class Ye {
|
|
|
6416
6414
|
pointerLength: s + o,
|
|
6417
6415
|
strokeWidth: n + o,
|
|
6418
6416
|
duration: r ? 0 : 0.1
|
|
6419
|
-
}).play(),
|
|
6420
|
-
node:
|
|
6417
|
+
}).play(), g && new S.Tween({
|
|
6418
|
+
node: g,
|
|
6421
6419
|
strokeWidth: n + o,
|
|
6422
6420
|
duration: r ? 0 : 0.1
|
|
6423
6421
|
}).play();
|
|
@@ -6514,58 +6512,58 @@ class Ue {
|
|
|
6514
6512
|
const a = this.context.store.getDataManager().getBaselinesByTaskId(r.id), c = nt(
|
|
6515
6513
|
this.context.getOptions().baselines.height || this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.height, r),
|
|
6516
6514
|
e
|
|
6517
|
-
),
|
|
6515
|
+
), g = this.context.getOptions().baselines.offset ?? 0;
|
|
6518
6516
|
a.forEach((d, l) => {
|
|
6519
6517
|
if (!d.validate()) return;
|
|
6520
|
-
const m = this.context.store.getTimeAxis().getTimeLeft(d.startTime), p = this.context.store.getTimeAxis().getTimeLeft(d.endTime),
|
|
6521
|
-
this.renderBaselineBar(
|
|
6522
|
-
const
|
|
6523
|
-
if (!
|
|
6524
|
-
const T =
|
|
6525
|
-
d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(
|
|
6518
|
+
const m = this.context.store.getTimeAxis().getTimeLeft(d.startTime), p = this.context.store.getTimeAxis().getTimeLeft(d.endTime), u = new S.Group({ id: `baseline-group-${d.id}` });
|
|
6519
|
+
this.renderBaselineBar(u, r, d, m, p, i, e, c, t, o, n, s, g), this.baselineGroup.add(u);
|
|
6520
|
+
const y = this.context.getOptions().baselines.compare, x = d.getTimeDiff();
|
|
6521
|
+
if (!y.enabled || !x) return;
|
|
6522
|
+
const T = y.mode;
|
|
6523
|
+
d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(u, r, d, x), l === 0 && (T === "indicator" || T === "both") && this.renderCompareIndicator(r, d, x), this.bindEvents(u, r, d);
|
|
6526
6524
|
});
|
|
6527
6525
|
}
|
|
6528
6526
|
});
|
|
6529
6527
|
}
|
|
6530
|
-
renderBaselineBar(t, e, i, s, n, o, r, a, c,
|
|
6528
|
+
renderBaselineBar(t, e, i, s, n, o, r, a, c, g, d, l, m) {
|
|
6531
6529
|
if (this.context.getOptions().baselines.mode === "shadow") {
|
|
6532
|
-
const p = o + r * e.flatIndex - a / 2 + m,
|
|
6530
|
+
const p = o + r * e.flatIndex - a / 2 + m, u = new S.Rect({
|
|
6533
6531
|
id: `baseline-item-${i.id}`,
|
|
6534
6532
|
x: s,
|
|
6535
6533
|
y: p,
|
|
6536
6534
|
width: n - s,
|
|
6537
6535
|
height: a,
|
|
6538
6536
|
cornerRadius: l,
|
|
6539
|
-
fill:
|
|
6537
|
+
fill: g,
|
|
6540
6538
|
opacity: d
|
|
6541
6539
|
});
|
|
6542
|
-
t.add(
|
|
6540
|
+
t.add(u), this.renderText(t, e, i, s, n, p, a);
|
|
6543
6541
|
} else if (this.context.getOptions().baselines.mode === "line") {
|
|
6544
6542
|
const p = nt(this.context.getOptions().baselines.height ?? 5, r);
|
|
6545
|
-
let
|
|
6546
|
-
const
|
|
6547
|
-
let
|
|
6548
|
-
|
|
6543
|
+
let u = c + r * e.flatIndex + m;
|
|
6544
|
+
const y = this.context.getOptions().baselines.position;
|
|
6545
|
+
let x = "";
|
|
6546
|
+
y === "top" ? (u += +p / 2, x = "line_top") : y === "center" ? (u += r / 2, x = "line_center") : (u += r - p / 2, x = "line_bottom");
|
|
6549
6547
|
const T = new S.Line({
|
|
6550
6548
|
id: `baseline-item-${i.id}`,
|
|
6551
|
-
points: [s,
|
|
6552
|
-
stroke:
|
|
6549
|
+
points: [s, u, n, u],
|
|
6550
|
+
stroke: g,
|
|
6553
6551
|
opacity: d,
|
|
6554
6552
|
strokeWidth: p,
|
|
6555
6553
|
lineCap: "butt",
|
|
6556
6554
|
lineJoin: "round"
|
|
6557
6555
|
});
|
|
6558
|
-
t.add(T), this.renderText(t, e, i, s, n,
|
|
6556
|
+
t.add(T), this.renderText(t, e, i, s, n, u, p, x);
|
|
6559
6557
|
}
|
|
6560
6558
|
}
|
|
6561
6559
|
renderText(t, e, i, s, n, o, r, a) {
|
|
6562
6560
|
const c = `chart-baseline-text-${i.id}`;
|
|
6563
6561
|
if ((() => {
|
|
6564
|
-
this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((
|
|
6562
|
+
this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((x) => x.remove());
|
|
6565
6563
|
})(), !this.context.getOptions().baselines.label.show) return;
|
|
6566
6564
|
const d = this.context.getOptions().baselines.label.field, l = d ? i.getField(d) : i.name;
|
|
6567
6565
|
if (!l || l === "") return;
|
|
6568
|
-
const m = n - s - 10, p = Math.max(this.context.getOptions().baselines.label.fontSize, r),
|
|
6566
|
+
const m = n - s - 10, p = Math.max(this.context.getOptions().baselines.label.fontSize, r), u = new S.Text({
|
|
6569
6567
|
text: l,
|
|
6570
6568
|
id: c,
|
|
6571
6569
|
x: s + 5,
|
|
@@ -6578,20 +6576,20 @@ class Ue {
|
|
|
6578
6576
|
align: this.context.getOptions().baselines.label.position,
|
|
6579
6577
|
verticalAlign: "bottom"
|
|
6580
6578
|
});
|
|
6581
|
-
a === "line_bottom" ?
|
|
6579
|
+
a === "line_bottom" ? u.setAttrs({
|
|
6582
6580
|
y: o - p / 2,
|
|
6583
6581
|
verticalAlign: "top"
|
|
6584
|
-
}) : a === "line_center" ?
|
|
6582
|
+
}) : a === "line_center" ? u.setAttrs({
|
|
6585
6583
|
y: o - p / 2,
|
|
6586
6584
|
verticalAlign: "middle"
|
|
6587
|
-
}) : a === "line_top" &&
|
|
6585
|
+
}) : a === "line_top" && u.setAttrs({
|
|
6588
6586
|
y: o - r / 2,
|
|
6589
6587
|
verticalAlign: "bottom"
|
|
6590
|
-
}), r >= p &&
|
|
6588
|
+
}), r >= p && u.setAttrs({
|
|
6591
6589
|
verticalAlign: "middle"
|
|
6592
6590
|
});
|
|
6593
|
-
const
|
|
6594
|
-
(this.context.getOptions().baselines.label.forceDisplay || m >
|
|
6591
|
+
const y = u.measureSize(l);
|
|
6592
|
+
(this.context.getOptions().baselines.label.forceDisplay || m > y.width) && t.add(u);
|
|
6595
6593
|
}
|
|
6596
6594
|
renderCompareHighlight(t, e, i, s) {
|
|
6597
6595
|
const n = s[`${this.context.getOptions().baselines.compare.target}Status`];
|
|
@@ -6615,30 +6613,30 @@ class Ue {
|
|
|
6615
6613
|
r
|
|
6616
6614
|
);
|
|
6617
6615
|
let c = s.backgroundColor;
|
|
6618
|
-
const
|
|
6616
|
+
const g = this.context.store.getTimeAxis().getTimeLeft(t.startTime), d = this.context.store.getTimeAxis().getTimeLeft(t.endTime);
|
|
6619
6617
|
let l = (r - a) / 2 + r * t.flatIndex + o;
|
|
6620
6618
|
if (n.position === "bottom" && (l += a), n.show === "start" || n.show === "both" || n.show === !0) {
|
|
6621
6619
|
const m = i.startStatus;
|
|
6622
6620
|
if (m && s.compare.indicator[m].show) {
|
|
6623
6621
|
c = B(s.compare.indicator[m].color).alpha(s.compare.indicator[m].opacity).toHex();
|
|
6624
6622
|
const p = new S.Circle({
|
|
6625
|
-
x:
|
|
6623
|
+
x: g - n.size,
|
|
6626
6624
|
y: l,
|
|
6627
6625
|
fill: c,
|
|
6628
6626
|
radius: n.size / 2
|
|
6629
6627
|
});
|
|
6630
6628
|
this.indicatorGroup.add(p);
|
|
6631
|
-
let
|
|
6632
|
-
const
|
|
6633
|
-
j(
|
|
6634
|
-
const
|
|
6629
|
+
let u = `${gt(i.startDiff)}${i.unit} ${m}`;
|
|
6630
|
+
const y = s.compare.indicator[m].text;
|
|
6631
|
+
j(y) ? u = y(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
|
|
6632
|
+
const x = new S.Text({
|
|
6635
6633
|
y: l - n.fontSize / 2,
|
|
6636
|
-
text:
|
|
6634
|
+
text: u,
|
|
6637
6635
|
fill: c,
|
|
6638
6636
|
fontSize: n.fontSize,
|
|
6639
6637
|
fontFamily: n.fontFamily || "Arial"
|
|
6640
|
-
}), T =
|
|
6641
|
-
|
|
6638
|
+
}), T = x.measureSize(u);
|
|
6639
|
+
x.x(g - n.size - T.width - 5), this.indicatorGroup.add(x);
|
|
6642
6640
|
}
|
|
6643
6641
|
}
|
|
6644
6642
|
if (n.show === "end" || n.show === "both" || n.show === !0) {
|
|
@@ -6652,18 +6650,18 @@ class Ue {
|
|
|
6652
6650
|
radius: n.size / 2
|
|
6653
6651
|
});
|
|
6654
6652
|
this.indicatorGroup.add(p);
|
|
6655
|
-
let
|
|
6656
|
-
const
|
|
6657
|
-
j(
|
|
6658
|
-
const
|
|
6653
|
+
let u = `${gt(i.endDiff)}${i.unit} ${m}`;
|
|
6654
|
+
const y = s.compare.indicator[m].text;
|
|
6655
|
+
j(y) ? u = y(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
|
|
6656
|
+
const x = new S.Text({
|
|
6659
6657
|
x: d + n.size + 5,
|
|
6660
6658
|
y: l - n.fontSize / 2,
|
|
6661
|
-
text:
|
|
6659
|
+
text: u,
|
|
6662
6660
|
fill: c,
|
|
6663
6661
|
fontSize: n.fontSize,
|
|
6664
6662
|
fontFamily: n.fontFamily || "Arial"
|
|
6665
6663
|
});
|
|
6666
|
-
this.indicatorGroup.add(
|
|
6664
|
+
this.indicatorGroup.add(x);
|
|
6667
6665
|
}
|
|
6668
6666
|
}
|
|
6669
6667
|
}
|
|
@@ -6728,8 +6726,8 @@ class Xe {
|
|
|
6728
6726
|
this.headerLayer.destroy(), this.gridGroup.destroy(), this.bodyLayer.destroy(), this.todayLayer.destroy(), this.holidayGroup.destroy(), this.flagGroup.destroy(), this.weekendGroup.destroy(), this.linkGroup.destroy(), this.baselineGroup.destroy(), this.axisLayer.destroy(), this.bgLayer.destroy(), this.stage.destroy();
|
|
6729
6727
|
}
|
|
6730
6728
|
}
|
|
6731
|
-
const
|
|
6732
|
-
class
|
|
6729
|
+
const Ve = '<svg style="transition: all 0.3s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M8.293 12.707a1 1 0 0 1 0-1.414l5.657-5.657a1 1 0 1 1 1.414 1.414L10.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414z"/></g></svg>';
|
|
6730
|
+
class Ke {
|
|
6733
6731
|
constructor(t, e) {
|
|
6734
6732
|
h(this, "line");
|
|
6735
6733
|
h(this, "initialX", 0);
|
|
@@ -6739,7 +6737,7 @@ class Ve {
|
|
|
6739
6737
|
"border-left-color",
|
|
6740
6738
|
this.root.store.getOptionManager().getOptions().border.color,
|
|
6741
6739
|
"important"
|
|
6742
|
-
), this.line.style.cursor = "col-resize", this.collapseButton = document.createElement("div"), this.collapseButton.className = "x-gantt-collapse-button", this.collapseButton.style.position = "absolute", this.collapseButton.style.top = "50%", this.collapseButton.style.left = "0", this.collapseButton.style.transform = "translateY(-50%)", this.collapseButton.style.cursor = "pointer", this.collapseButton.style.width = "16px", this.collapseButton.style.height = "30px", this.collapseButton.style.backgroundColor = "#fff", this.collapseButton.style.borderRadius = "0 6px 6px 0", this.collapseButton.style.boxShadow = "0 0 2px rgba(0, 0, 0, 0.2)", this.collapseButton.style.display = "flex", this.collapseButton.style.alignItems = "center", this.collapseButton.style.justifyContent = "center", this.collapseButton.innerHTML =
|
|
6740
|
+
), this.line.style.cursor = "col-resize", this.collapseButton = document.createElement("div"), this.collapseButton.className = "x-gantt-collapse-button", this.collapseButton.style.position = "absolute", this.collapseButton.style.top = "50%", this.collapseButton.style.left = "0", this.collapseButton.style.transform = "translateY(-50%)", this.collapseButton.style.cursor = "pointer", this.collapseButton.style.width = "16px", this.collapseButton.style.height = "30px", this.collapseButton.style.backgroundColor = "#fff", this.collapseButton.style.borderRadius = "0 6px 6px 0", this.collapseButton.style.boxShadow = "0 0 2px rgba(0, 0, 0, 0.2)", this.collapseButton.style.display = "flex", this.collapseButton.style.alignItems = "center", this.collapseButton.style.justifyContent = "center", this.collapseButton.innerHTML = Ve, this.collapseButton.addEventListener("click", (i) => {
|
|
6743
6741
|
i.stopPropagation(), this.root.store.getColumnManager().collapse();
|
|
6744
6742
|
}), this.line.appendChild(this.collapseButton), this.container.appendChild(this.line), this.addDragEvents();
|
|
6745
6743
|
}
|
|
@@ -6755,18 +6753,18 @@ class Ve {
|
|
|
6755
6753
|
a.preventDefault(), a.stopPropagation(), t = a.clientX, e = this.container.getBoundingClientRect();
|
|
6756
6754
|
const c = s[s.length - 1].key;
|
|
6757
6755
|
this.initialWidth = i.getColumnWidth(c);
|
|
6758
|
-
const
|
|
6759
|
-
this.root.event.emit(k.SHOW_GUIDELINE,
|
|
6756
|
+
const g = this.initialX;
|
|
6757
|
+
this.root.event.emit(k.SHOW_GUIDELINE, g);
|
|
6760
6758
|
const d = (m) => o(m), l = (m) => r(m, d, l);
|
|
6761
6759
|
document.addEventListener("mousemove", d), document.addEventListener("mouseup", l);
|
|
6762
6760
|
}, o = (a) => {
|
|
6763
6761
|
if (a.preventDefault(), !e) return;
|
|
6764
6762
|
const c = a.clientX - t;
|
|
6765
6763
|
s[s.length - 1].key;
|
|
6766
|
-
const
|
|
6764
|
+
const g = 50 - this.initialWidth, l = e.width - 20 - this.initialX, m = Math.max(g, Math.min(l, c)), p = this.initialX + m;
|
|
6767
6765
|
this.root.event.emit(k.MOVE_GUIDELINE, p);
|
|
6768
|
-
}, r = (a, c,
|
|
6769
|
-
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup",
|
|
6766
|
+
}, r = (a, c, g) => {
|
|
6767
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", g), this.root.event.emit(k.HIDE_GUIDELINE);
|
|
6770
6768
|
const d = a.clientX - t, l = s[s.length - 1].key, m = Math.max(50, this.initialWidth + d);
|
|
6771
6769
|
i.setColumnWidth(l, m), this.root.event.emit(k.UPDATE_TABLE_HEADER);
|
|
6772
6770
|
};
|
|
@@ -7008,6 +7006,7 @@ class Qe {
|
|
|
7008
7006
|
h(this, "width", 0);
|
|
7009
7007
|
h(this, "height", 0);
|
|
7010
7008
|
h(this, "isInitialized", !0);
|
|
7009
|
+
h(this, "resizeObserver");
|
|
7011
7010
|
// 更新尺寸
|
|
7012
7011
|
h(this, "updateSize", () => {
|
|
7013
7012
|
this.width = this.context.store.getOptionManager().getOptions().width || this.container.clientWidth, this.height = this.context.store.getOptionManager().getOptions().height || this.container.clientHeight, this.rootElement.style.width = this.width ? `${this.width}px` : "100%", this.rootElement.style.height = this.height ? `${this.height}px` : "100%";
|
|
@@ -7057,12 +7056,17 @@ class Qe {
|
|
|
7057
7056
|
h(this, "handleColumnWidthChange", () => {
|
|
7058
7057
|
this.table.updateWidth(), this.updateSize();
|
|
7059
7058
|
});
|
|
7060
|
-
|
|
7059
|
+
var i;
|
|
7060
|
+
this.context = t, this.container = e, this.rootElement = document.createElement("div"), this.rootElement.id = `x-gantt-${this._id}`, this.rootElement.className = "x-gantt", this.rootElement.style.overflow = "hidden", this.rootElement.style.display = "flex", this.rootElement.style.position = "relative", this.container.appendChild(this.rootElement), this.tableContainer = document.createElement("div"), this.tableContainer.className = "x-gantt-table", this.rootElement.appendChild(this.tableContainer), new je(this.context, this.container), this.middleLine = new Ke(this.context, this.rootElement), this.chartContainer = document.createElement("div"), this.chartContainer.className = "x-gantt-chart", this.rootElement.appendChild(this.chartContainer), this.table = new He(this.context, this.tableContainer), this.chart = new Xe(this.context, this.chartContainer), this.scrollbar = new _e(
|
|
7061
7061
|
this.context,
|
|
7062
7062
|
this.rootElement,
|
|
7063
7063
|
this.context.store.getOptionManager().getOptions().scrollbar || {}
|
|
7064
7064
|
// 传入配置项
|
|
7065
|
-
), this.renderScheduler = new qe(16), this.setupTaskHandlers(), this.updateSize(), this.setupEventListeners()
|
|
7065
|
+
), this.renderScheduler = new qe(16), this.setupTaskHandlers(), this.updateSize(), this.setupEventListeners(), (i = this.context.store.getOptionManager().getOptions().resize) != null && i.enabled && (typeof window.ResizeObserver > "u" ? O.warn(
|
|
7066
|
+
"Current environment does not support ResizeObserver, please include a polyfill to enable auto-resize feature."
|
|
7067
|
+
) : (this.resizeObserver = new ResizeObserver(() => {
|
|
7068
|
+
this.updateSize(), this.renderScheduler.scheduleTask("VIEW_UPDATE", [!1]);
|
|
7069
|
+
}), this.resizeObserver.observe(this.container)));
|
|
7066
7070
|
}
|
|
7067
7071
|
getScrollbar() {
|
|
7068
7072
|
return this.scrollbar;
|
|
@@ -7124,7 +7128,7 @@ class Qe {
|
|
|
7124
7128
|
*/
|
|
7125
7129
|
performRender(t = !1, e = !1) {
|
|
7126
7130
|
this.setStyleValue();
|
|
7127
|
-
const { x: i, y: s } = this.scrollbar.getScrollPosition(), n = this.context.store.getOptionManager().getOptions().row.height, o = this.context.store.getOptionManager().getOptions().header.height, r = Math.floor(s / n), a = Math.ceil((this.height - o) / n), c = 2,
|
|
7131
|
+
const { x: i, y: s } = this.scrollbar.getScrollPosition(), n = this.context.store.getOptionManager().getOptions().row.height, o = this.context.store.getOptionManager().getOptions().header.height, r = Math.floor(s / n), a = Math.ceil((this.height - o) / n), c = 2, g = Math.max(0, r), d = a + c, l = this.context.store.getDataManager().getVisibleTasks().slice(g, g + d);
|
|
7128
7132
|
this.updateSize(), e ? (this.table.refresh(s, l), this.chart.refresh(i, s, l, !0)) : t ? (this.table.refresh(s, l), this.chart.refresh(i, s, l)) : (this.table.render(s, l), this.chart.render(i, s, l)), this.isInitialized && (this.context.event.emit(k.LOADED), this.isInitialized = !1), O.debug("execute render");
|
|
7129
7133
|
}
|
|
7130
7134
|
/**
|
|
@@ -7146,7 +7150,7 @@ class Qe {
|
|
|
7146
7150
|
);
|
|
7147
7151
|
}
|
|
7148
7152
|
destroy() {
|
|
7149
|
-
O.debug("Renderer destroy"), this.renderScheduler.destroy(), this.scrollbar.destroy(), this.context.event.offAll();
|
|
7153
|
+
O.debug("Renderer destroy"), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.renderScheduler.destroy(), this.scrollbar.destroy(), this.context.event.offAll();
|
|
7150
7154
|
}
|
|
7151
7155
|
}
|
|
7152
7156
|
class Je {
|
|
@@ -7653,7 +7657,7 @@ class si {
|
|
|
7653
7657
|
return this.context.store.getDataManager().deleteTaskById(t);
|
|
7654
7658
|
}
|
|
7655
7659
|
}
|
|
7656
|
-
|
|
7660
|
+
Vt();
|
|
7657
7661
|
const ni = Ct;
|
|
7658
7662
|
export {
|
|
7659
7663
|
si as XGantt,
|