schedulant 2.0.7-fixed.6 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icons/milestone-icon.d.ts +5 -0
- package/dist/schedulant.css +1 -1
- package/dist/schedulant.js +424 -401
- package/dist/utils/selection.d.ts +1 -0
- package/package.json +1 -1
package/dist/schedulant.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
1
|
+
import { jsx as a, Fragment as bt, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import * as ie from "react";
|
|
3
|
-
import { createContext as wt, useReducer as Et, useEffect as
|
|
3
|
+
import { createContext as wt, useReducer as Et, useEffect as N, useContext as Ct, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Tt } from "react";
|
|
4
4
|
import E from "dayjs";
|
|
5
5
|
import Dt from "dayjs/plugin/weekYear";
|
|
6
6
|
import Rt from "dayjs/plugin/weekOfYear";
|
|
7
7
|
import kt from "dayjs/plugin/quarterOfYear";
|
|
8
8
|
import xt from "dayjs/plugin/isSameOrBefore";
|
|
9
|
-
import { Dropdown as
|
|
9
|
+
import { Dropdown as Z, Space as It } from "antd";
|
|
10
|
+
import X from "@ant-design/icons/lib/components/Icon";
|
|
10
11
|
import { PlusSquareOutlined as Ot, MinusSquareOutlined as Pt } from "@ant-design/icons";
|
|
11
12
|
import { useSortable as Lt, SortableContext as Nt, verticalListSortingStrategy as Yt } from "@dnd-kit/sortable";
|
|
12
|
-
import
|
|
13
|
-
import { useSensors as _t, useSensor as Ye, PointerSensor as Wt, KeyboardSensor as Ht, DndContext as zt, closestCenter as Vt, DragOverlay as Ft } from "@dnd-kit/core";
|
|
13
|
+
import { useSensors as _t, useSensor as We, PointerSensor as Wt, KeyboardSensor as Ht, DndContext as zt, closestCenter as Vt, DragOverlay as Ft } from "@dnd-kit/core";
|
|
14
14
|
import { restrictToVerticalAxis as Bt } from "@dnd-kit/modifiers";
|
|
15
15
|
import { flushSync as qt } from "react-dom";
|
|
16
16
|
const de = {
|
|
17
17
|
EXPAND_RESOURCE: "EXPAND_RESOURCE",
|
|
18
18
|
COLLAPSE_RESOURCE: "COLLAPSE_RESOURCE",
|
|
19
19
|
SET_RESOURCE_AREA_WIDTH: "SET_RESOURCE_AREA_WIDTH"
|
|
20
|
-
},
|
|
20
|
+
}, ut = "schedulant.state", Ut = () => {
|
|
21
21
|
try {
|
|
22
|
-
const t = localStorage.getItem(
|
|
22
|
+
const t = localStorage.getItem(ut);
|
|
23
23
|
if (t)
|
|
24
24
|
return JSON.parse(t);
|
|
25
25
|
} catch {
|
|
@@ -49,22 +49,22 @@ const de = {
|
|
|
49
49
|
default:
|
|
50
50
|
return t;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, ht = wt(void 0), $t = ({ children: t }) => {
|
|
53
53
|
const [e, n] = Et(jt, void 0, Ut);
|
|
54
|
-
return
|
|
55
|
-
localStorage.setItem(
|
|
56
|
-
}, [e]), /* @__PURE__ */ a(
|
|
54
|
+
return N(() => {
|
|
55
|
+
localStorage.setItem(ut, JSON.stringify(e));
|
|
56
|
+
}, [e]), /* @__PURE__ */ a(ht.Provider, { value: { state: e, dispatch: n }, children: t });
|
|
57
57
|
}, De = () => {
|
|
58
|
-
const t = Ct(
|
|
58
|
+
const t = Ct(ht);
|
|
59
59
|
if (t === void 0)
|
|
60
60
|
throw new Error("useSchedulantContext must be used within a SchedulantProvider");
|
|
61
61
|
return t;
|
|
62
|
-
}, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")),
|
|
63
|
-
|
|
64
|
-
const e = document.getElementById("schedulant-view-harness"), n = document.getElementById("schedulant-datagrid-body"), s = document.getElementById("schedulant-timeline-head"), i = n ? n.getBoundingClientRect().height : 0, r = s ? s.getBoundingClientRect().height : 0, o = i + r +
|
|
62
|
+
}, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), He = (t) => document.querySelector(`.${t}`), mt = 1.5, Gt = 0.7, W = 10, gt = 16, ze = 13, Xt = 0.1, Ve = 0.5, Qt = 0.25, Kt = 0.75, Zt = 100, Jt = (t) => {
|
|
63
|
+
N(() => {
|
|
64
|
+
const e = document.getElementById("schedulant-view-harness"), n = document.getElementById("schedulant-datagrid-body"), s = document.getElementById("schedulant-timeline-head"), i = n ? n.getBoundingClientRect().height : 0, r = s ? s.getBoundingClientRect().height : 0, o = i + r + ze, l = t - o > 0 ? o : t;
|
|
65
65
|
e && (e.style.height = w(l));
|
|
66
66
|
const c = () => {
|
|
67
|
-
const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, u = m + f +
|
|
67
|
+
const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, u = m + f + ze, h = t - u > 0 ? u : t;
|
|
68
68
|
e && (e.style.height = w(h));
|
|
69
69
|
}, d = new ResizeObserver(() => {
|
|
70
70
|
c();
|
|
@@ -74,7 +74,7 @@ const de = {
|
|
|
74
74
|
};
|
|
75
75
|
}, [t]);
|
|
76
76
|
}, en = (t, e, n, s) => {
|
|
77
|
-
|
|
77
|
+
N(() => {
|
|
78
78
|
const i = t.current, r = e.current, o = n.current, l = s.current;
|
|
79
79
|
if (!i || !r || !o || !l) return;
|
|
80
80
|
const c = [], d = (m, f, u, h) => {
|
|
@@ -112,7 +112,7 @@ const de = {
|
|
|
112
112
|
}), { passive: !1 }), () => c.forEach((m) => m());
|
|
113
113
|
}, [t, e, n, s]);
|
|
114
114
|
}, tn = (t, e) => {
|
|
115
|
-
|
|
115
|
+
N(() => {
|
|
116
116
|
const n = t.current;
|
|
117
117
|
n && e && (n.style.width = e);
|
|
118
118
|
}, [t, e]);
|
|
@@ -296,15 +296,15 @@ class le {
|
|
|
296
296
|
const h = f.pop();
|
|
297
297
|
if (h) {
|
|
298
298
|
const { parentId: A, depth: p } = h, S = u.get(A);
|
|
299
|
-
S && S.sort(le.compare).forEach((
|
|
300
|
-
const g =
|
|
301
|
-
|
|
299
|
+
S && S.sort(le.compare).forEach((M) => {
|
|
300
|
+
const g = M.getId();
|
|
301
|
+
M.setDepth(p), M.setParent(c.get(A)), M.setChildren(u.get(g) || []);
|
|
302
302
|
const y = l.get(g) || [];
|
|
303
|
-
y.forEach((T) => T.setResourceApi(
|
|
303
|
+
y.forEach((T) => T.setResourceApi(M)), M.setEventApis(y);
|
|
304
304
|
const v = d.get(g) || [];
|
|
305
|
-
v.forEach((T) => T.setResourceApi(
|
|
306
|
-
const
|
|
307
|
-
|
|
305
|
+
v.forEach((T) => T.setResourceApi(M)), M.setMilestoneApis(v);
|
|
306
|
+
const b = m.get(g) || [];
|
|
307
|
+
b.forEach((T) => T.setResourceApi(M)), M.setCheckpointApis(b), f.push({ parentId: g, depth: p + 1 });
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
}
|
|
@@ -402,7 +402,7 @@ E.extend(xt);
|
|
|
402
402
|
E.extend(kt);
|
|
403
403
|
E.extend(Rt);
|
|
404
404
|
E.extend(Dt);
|
|
405
|
-
class
|
|
405
|
+
class K {
|
|
406
406
|
start;
|
|
407
407
|
end;
|
|
408
408
|
timelineData;
|
|
@@ -585,26 +585,26 @@ class ln {
|
|
|
585
585
|
switch (e.schedulantViewType) {
|
|
586
586
|
case "Week": {
|
|
587
587
|
const s = e.start.startOf("week"), i = e.end.endOf("week");
|
|
588
|
-
n = new
|
|
588
|
+
n = new K(s, i);
|
|
589
589
|
break;
|
|
590
590
|
}
|
|
591
591
|
case "Month": {
|
|
592
592
|
const s = e.start.startOf("month"), i = e.end.endOf("month");
|
|
593
|
-
n = new
|
|
593
|
+
n = new K(s, i);
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
case "Quarter": {
|
|
597
597
|
const s = e.start.startOf("quarter"), i = e.end.endOf("quarter");
|
|
598
|
-
n = new
|
|
598
|
+
n = new K(s, i);
|
|
599
599
|
break;
|
|
600
600
|
}
|
|
601
601
|
case "Year": {
|
|
602
602
|
const s = e.start.startOf("year"), i = e.end.endOf("year");
|
|
603
|
-
n = new
|
|
603
|
+
n = new K(s, i);
|
|
604
604
|
break;
|
|
605
605
|
}
|
|
606
606
|
default:
|
|
607
|
-
n = new
|
|
607
|
+
n = new K(e.start, e.end);
|
|
608
608
|
break;
|
|
609
609
|
}
|
|
610
610
|
return n.setSpecialWorkdays(e.specialWorkdays || []), n.setCompanyHolidays(e.companyHolidays || []), n.setNationalHolidays(e.nationalHolidays || []), n;
|
|
@@ -813,7 +813,7 @@ class ln {
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
const an = (t, e, n) => {
|
|
816
|
-
|
|
816
|
+
N(() => {
|
|
817
817
|
const s = t.current;
|
|
818
818
|
if (s)
|
|
819
819
|
return n.resourceLabelDidMount({
|
|
@@ -826,8 +826,8 @@ const an = (t, e, n) => {
|
|
|
826
826
|
});
|
|
827
827
|
};
|
|
828
828
|
}, [t, e, n]);
|
|
829
|
-
}, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(
|
|
830
|
-
const s = k(-1), i = C(() =>
|
|
829
|
+
}, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(bt, { children: t ? e : n }), cn = (t, e, n) => {
|
|
830
|
+
const s = k(-1), i = C(() => He("schedulant-datagrid-head"), []), r = C(() => He("schedulant-datagrid-body"), []), o = C((u) => {
|
|
831
831
|
u.preventDefault();
|
|
832
832
|
const h = n.current;
|
|
833
833
|
if (h) {
|
|
@@ -844,10 +844,10 @@ const an = (t, e, n) => {
|
|
|
844
844
|
h ? h.addEventListener("mousemove", o) : console.error("scheduleEl", h);
|
|
845
845
|
}, [o, e]), d = C((u) => {
|
|
846
846
|
u.preventDefault();
|
|
847
|
-
const h = s.current, A = i(), p = r(), S = A.firstElementChild,
|
|
847
|
+
const h = s.current, A = i(), p = r(), S = A.firstElementChild, M = p.firstElementChild, g = S?.children, y = M?.children;
|
|
848
848
|
if (g && y) {
|
|
849
|
-
const v = g[h],
|
|
850
|
-
v.style.width = w(T),
|
|
849
|
+
const v = g[h], b = y[h], T = u.clientX - v.getBoundingClientRect().left, D = u.clientX - b.getBoundingClientRect().left;
|
|
850
|
+
v.style.width = w(T), b.style.width = w(D);
|
|
851
851
|
}
|
|
852
852
|
}, [r, i, s]), m = C((u) => {
|
|
853
853
|
u.preventDefault(), s.current = -1;
|
|
@@ -861,8 +861,8 @@ const an = (t, e, n) => {
|
|
|
861
861
|
S.length === 0 && (S = p.getElementsByTagName("th"));
|
|
862
862
|
for (let y = 0; y < S.length; y++)
|
|
863
863
|
S[y] === A && (s.current = y);
|
|
864
|
-
const
|
|
865
|
-
|
|
864
|
+
const M = i(), g = r();
|
|
865
|
+
M.addEventListener("mousemove", d), g.addEventListener("mousemove", d);
|
|
866
866
|
} else
|
|
867
867
|
console.error("trElement", p);
|
|
868
868
|
}, [i, r, d, s]);
|
|
@@ -875,7 +875,7 @@ const an = (t, e, n) => {
|
|
|
875
875
|
}, dn = (t) => {
|
|
876
876
|
const e = k(null);
|
|
877
877
|
return an(e, t.resourceAreaColumn, t.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
|
|
878
|
-
|
|
878
|
+
Z,
|
|
879
879
|
{
|
|
880
880
|
disabled: !t.schedulantApi.isEnableResourceLabelContextMenu(),
|
|
881
881
|
destroyOnHidden: !0,
|
|
@@ -892,7 +892,7 @@ const an = (t, e, n) => {
|
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
894
|
},
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ I("div", { className: "schedulant-datagrid-cell-frame", ref: e, children: [
|
|
896
896
|
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ a(
|
|
897
897
|
"span",
|
|
898
898
|
{
|
|
@@ -912,7 +912,7 @@ const an = (t, e, n) => {
|
|
|
912
912
|
}
|
|
913
913
|
) });
|
|
914
914
|
}, un = (t, e, n, s) => {
|
|
915
|
-
|
|
915
|
+
N(() => {
|
|
916
916
|
const i = t.current;
|
|
917
917
|
if (i)
|
|
918
918
|
return n.resourceLaneDidMount({
|
|
@@ -929,23 +929,43 @@ const an = (t, e, n) => {
|
|
|
929
929
|
});
|
|
930
930
|
};
|
|
931
931
|
}, [t, e, n, s]);
|
|
932
|
-
},
|
|
933
|
-
|
|
934
|
-
|
|
932
|
+
}, hn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
933
|
+
"svg",
|
|
934
|
+
{
|
|
935
|
+
className: "milestone-icon",
|
|
936
|
+
viewBox: "0 0 1024 1024",
|
|
937
|
+
version: "1.1",
|
|
938
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
939
|
+
width: `${w(t.width)}`,
|
|
940
|
+
height: `${w(t.height)}`,
|
|
941
|
+
children: /* @__PURE__ */ a(
|
|
942
|
+
"path",
|
|
943
|
+
{
|
|
944
|
+
d: "M156 64v896l356-280 356 280V64H156z m511.8 556.4L512 538.5l-155.7 81.9L386 447 260 324.2l174.1-25.3L512 141.1l77.9 157.8L764 324.2 638 447l29.8 173.4z",
|
|
945
|
+
fill: t.color
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
}
|
|
949
|
+
), ...t }), L = /* @__PURE__ */ new Set();
|
|
950
|
+
let G = null;
|
|
951
|
+
function Re() {
|
|
935
952
|
document.querySelectorAll(".schedulant-resource-selected").forEach((t) => t.classList.remove("schedulant-resource-selected"));
|
|
936
|
-
for (const t of
|
|
953
|
+
for (const t of L)
|
|
937
954
|
document.querySelectorAll(`[data-resource-id="${t}"].schedulant-resource`).forEach((e) => e.classList.add("schedulant-resource-selected"));
|
|
938
955
|
}
|
|
939
|
-
function
|
|
940
|
-
t?.(Array.from(
|
|
956
|
+
function ke(t) {
|
|
957
|
+
t?.(Array.from(L));
|
|
941
958
|
}
|
|
942
959
|
function ft() {
|
|
943
|
-
return
|
|
960
|
+
return L;
|
|
944
961
|
}
|
|
945
962
|
function Te(t) {
|
|
946
|
-
|
|
963
|
+
L.size !== 0 && (L.clear(), G = null, Re(), ke(t));
|
|
964
|
+
}
|
|
965
|
+
function mn(t, e) {
|
|
966
|
+
L.clear(), L.add(t), G = t, Re(), ke(e);
|
|
947
967
|
}
|
|
948
|
-
function
|
|
968
|
+
function gn(t, e, n) {
|
|
949
969
|
const i = t.target.closest("[data-resource-id]");
|
|
950
970
|
if (!i) {
|
|
951
971
|
Te(n);
|
|
@@ -956,21 +976,21 @@ function hn(t, e, n) {
|
|
|
956
976
|
Te(n);
|
|
957
977
|
return;
|
|
958
978
|
}
|
|
959
|
-
if (t.button === 2 &&
|
|
979
|
+
if (t.button === 2 && L.has(r))
|
|
960
980
|
return;
|
|
961
981
|
const o = t.ctrlKey || t.metaKey;
|
|
962
|
-
if (t.shiftKey &&
|
|
963
|
-
const c = e.indexOf(
|
|
982
|
+
if (t.shiftKey && G) {
|
|
983
|
+
const c = e.indexOf(G), d = e.indexOf(r);
|
|
964
984
|
if (c !== -1 && d !== -1) {
|
|
965
985
|
const m = Math.min(c, d), f = Math.max(c, d);
|
|
966
|
-
o ||
|
|
986
|
+
o || L.clear();
|
|
967
987
|
for (let u = m; u <= f; u++)
|
|
968
|
-
|
|
988
|
+
L.add(e[u]);
|
|
969
989
|
}
|
|
970
|
-
} else o ? (
|
|
971
|
-
|
|
990
|
+
} else o ? (L.has(r) ? L.delete(r) : L.add(r), G = r) : (L.clear(), L.add(r), G = r);
|
|
991
|
+
Re(), ke(n);
|
|
972
992
|
}
|
|
973
|
-
function
|
|
993
|
+
function fn(t, e, n) {
|
|
974
994
|
const s = ft();
|
|
975
995
|
return s.size > 1 && s.has(e.getId()) ? {
|
|
976
996
|
items: t.getResourceLaneMultiSelectContextMenuItems(),
|
|
@@ -998,17 +1018,17 @@ function mn(t, e, n) {
|
|
|
998
1018
|
}
|
|
999
1019
|
};
|
|
1000
1020
|
}
|
|
1001
|
-
const
|
|
1021
|
+
const pn = (t) => {
|
|
1002
1022
|
const { dispatch: e } = De(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, v) => {
|
|
1003
|
-
const
|
|
1004
|
-
if (Object.keys(
|
|
1005
|
-
const
|
|
1006
|
-
if (typeof
|
|
1007
|
-
return
|
|
1023
|
+
const b = v.getResource();
|
|
1024
|
+
if (Object.keys(b).includes(y)) {
|
|
1025
|
+
const O = b[y];
|
|
1026
|
+
if (typeof O == "string")
|
|
1027
|
+
return O;
|
|
1008
1028
|
} else {
|
|
1009
|
-
const
|
|
1010
|
-
if (typeof
|
|
1011
|
-
return
|
|
1029
|
+
const O = b.extendedProps?.[y];
|
|
1030
|
+
if (typeof O == "string" || typeof O == "number")
|
|
1031
|
+
return O;
|
|
1012
1032
|
}
|
|
1013
1033
|
return "";
|
|
1014
1034
|
}, []);
|
|
@@ -1020,8 +1040,8 @@ const gn = (t) => {
|
|
|
1020
1040
|
}), u = t.overId === o && t.activeId !== o, h = () => {
|
|
1021
1041
|
const y = ["schedulant-datagrid-cell", "schedulant-resource"];
|
|
1022
1042
|
return ft().has(o) && y.push("schedulant-resource-selected"), t.isDraggable && f && y.push("schedulant-resource-dragging"), t.isDraggable && u && t.dropPosition && y.push(`schedulant-resource-drop-${t.dropPosition}`), y.join(" ");
|
|
1023
|
-
}, [A, p] = re(!1), [S,
|
|
1024
|
-
y &&
|
|
1043
|
+
}, [A, p] = re(!1), [S, M] = re({}), g = C((y) => {
|
|
1044
|
+
y && M(fn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
|
|
1025
1045
|
}, [t.schedulantApi, t.resourceApi, t.resourceAreaColumn]);
|
|
1026
1046
|
return /* @__PURE__ */ a(
|
|
1027
1047
|
"td",
|
|
@@ -1031,7 +1051,7 @@ const gn = (t) => {
|
|
|
1031
1051
|
className: h(),
|
|
1032
1052
|
...l ? {} : { ...c, ...d },
|
|
1033
1053
|
children: /* @__PURE__ */ a(
|
|
1034
|
-
|
|
1054
|
+
Z,
|
|
1035
1055
|
{
|
|
1036
1056
|
disabled: !t.schedulantApi.isEnableResourceLaneContextMenu(),
|
|
1037
1057
|
destroyOnHidden: !0,
|
|
@@ -1039,15 +1059,15 @@ const gn = (t) => {
|
|
|
1039
1059
|
open: A,
|
|
1040
1060
|
onOpenChange: g,
|
|
1041
1061
|
menu: S,
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ I(
|
|
1043
1063
|
"div",
|
|
1044
1064
|
{
|
|
1045
1065
|
className: "schedulant-datagrid-cell-frame",
|
|
1046
1066
|
style: { height: w(i) },
|
|
1047
1067
|
ref: n,
|
|
1048
1068
|
children: [
|
|
1049
|
-
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */
|
|
1050
|
-
t.showPlusSquare && /* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ I(It, { size: "small", children: [
|
|
1070
|
+
t.showPlusSquare && /* @__PURE__ */ I(
|
|
1051
1071
|
"span",
|
|
1052
1072
|
{
|
|
1053
1073
|
className: "schedulant-datagrid-expander schedulant-datagrid-expander-placeholder",
|
|
@@ -1073,7 +1093,10 @@ const gn = (t) => {
|
|
|
1073
1093
|
]
|
|
1074
1094
|
}
|
|
1075
1095
|
),
|
|
1076
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ I("div", { className: "schedulant-datagrid-cell-main", children: [
|
|
1097
|
+
r(t.resourceAreaColumn.field, t.resourceApi),
|
|
1098
|
+
t.showPlusSquare && t.resourceApi.getMilestoneApis().length > 0 && /* @__PURE__ */ a("span", { className: "schedulant-milestone-indicator", children: /* @__PURE__ */ a(hn, { width: 14, height: 14, color: "#91003c" }) })
|
|
1099
|
+
] })
|
|
1077
1100
|
] }) }),
|
|
1078
1101
|
/* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
|
|
1079
1102
|
]
|
|
@@ -1083,9 +1106,9 @@ const gn = (t) => {
|
|
|
1083
1106
|
)
|
|
1084
1107
|
}
|
|
1085
1108
|
);
|
|
1086
|
-
},
|
|
1109
|
+
}, yn = (t) => /* @__PURE__ */ a("colgroup", { children: t.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Zt } }, e.field)) }), vn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), Sn = (t, e, n) => {
|
|
1087
1110
|
const s = n.getStart(), i = n.getEnd(), r = i.isBefore(E(), "day"), o = s.isAfter(E(), "day"), l = s.isSameOrBefore(E(), "day") && (i.isAfter(E(), "day") || i.isSame(E(), "day"));
|
|
1088
|
-
return
|
|
1111
|
+
return N(() => {
|
|
1089
1112
|
const c = t.current;
|
|
1090
1113
|
if (c)
|
|
1091
1114
|
return e.eventDidMount({
|
|
@@ -1108,46 +1131,46 @@ const gn = (t) => {
|
|
|
1108
1131
|
}, [t, e, n, r, o, l]), { isPast: r, isFuture: o, isProcess: l };
|
|
1109
1132
|
};
|
|
1110
1133
|
var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1111
|
-
function
|
|
1134
|
+
function An(t) {
|
|
1112
1135
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1113
1136
|
}
|
|
1114
|
-
var ue,
|
|
1115
|
-
function
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
1137
|
+
var ue, Fe;
|
|
1138
|
+
function xe() {
|
|
1139
|
+
if (Fe) return ue;
|
|
1140
|
+
Fe = 1;
|
|
1118
1141
|
function t(e) {
|
|
1119
1142
|
var n = typeof e;
|
|
1120
1143
|
return e != null && (n == "object" || n == "function");
|
|
1121
1144
|
}
|
|
1122
1145
|
return ue = t, ue;
|
|
1123
1146
|
}
|
|
1124
|
-
var he,
|
|
1125
|
-
function
|
|
1126
|
-
if (
|
|
1127
|
-
|
|
1147
|
+
var he, Be;
|
|
1148
|
+
function Mn() {
|
|
1149
|
+
if (Be) return he;
|
|
1150
|
+
Be = 1;
|
|
1128
1151
|
var t = typeof se == "object" && se && se.Object === Object && se;
|
|
1129
1152
|
return he = t, he;
|
|
1130
1153
|
}
|
|
1131
|
-
var me,
|
|
1154
|
+
var me, qe;
|
|
1132
1155
|
function pt() {
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1135
|
-
var t =
|
|
1156
|
+
if (qe) return me;
|
|
1157
|
+
qe = 1;
|
|
1158
|
+
var t = Mn(), e = typeof self == "object" && self && self.Object === Object && self, n = t || e || Function("return this")();
|
|
1136
1159
|
return me = n, me;
|
|
1137
1160
|
}
|
|
1138
|
-
var ge,
|
|
1139
|
-
function
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1161
|
+
var ge, Ue;
|
|
1162
|
+
function bn() {
|
|
1163
|
+
if (Ue) return ge;
|
|
1164
|
+
Ue = 1;
|
|
1142
1165
|
var t = pt(), e = function() {
|
|
1143
1166
|
return t.Date.now();
|
|
1144
1167
|
};
|
|
1145
1168
|
return ge = e, ge;
|
|
1146
1169
|
}
|
|
1147
|
-
var fe,
|
|
1148
|
-
function
|
|
1149
|
-
if (
|
|
1150
|
-
|
|
1170
|
+
var fe, je;
|
|
1171
|
+
function wn() {
|
|
1172
|
+
if (je) return fe;
|
|
1173
|
+
je = 1;
|
|
1151
1174
|
var t = /\s/;
|
|
1152
1175
|
function e(n) {
|
|
1153
1176
|
for (var s = n.length; s-- && t.test(n.charAt(s)); )
|
|
@@ -1156,27 +1179,27 @@ function bn() {
|
|
|
1156
1179
|
}
|
|
1157
1180
|
return fe = e, fe;
|
|
1158
1181
|
}
|
|
1159
|
-
var pe,
|
|
1160
|
-
function
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1163
|
-
var t =
|
|
1182
|
+
var pe, $e;
|
|
1183
|
+
function En() {
|
|
1184
|
+
if ($e) return pe;
|
|
1185
|
+
$e = 1;
|
|
1186
|
+
var t = wn(), e = /^\s+/;
|
|
1164
1187
|
function n(s) {
|
|
1165
1188
|
return s && s.slice(0, t(s) + 1).replace(e, "");
|
|
1166
1189
|
}
|
|
1167
1190
|
return pe = n, pe;
|
|
1168
1191
|
}
|
|
1169
|
-
var ye,
|
|
1192
|
+
var ye, Ge;
|
|
1170
1193
|
function yt() {
|
|
1171
|
-
if (
|
|
1172
|
-
|
|
1194
|
+
if (Ge) return ye;
|
|
1195
|
+
Ge = 1;
|
|
1173
1196
|
var t = pt(), e = t.Symbol;
|
|
1174
1197
|
return ye = e, ye;
|
|
1175
1198
|
}
|
|
1176
|
-
var ve,
|
|
1177
|
-
function
|
|
1178
|
-
if (
|
|
1179
|
-
|
|
1199
|
+
var ve, Xe;
|
|
1200
|
+
function Cn() {
|
|
1201
|
+
if (Xe) return ve;
|
|
1202
|
+
Xe = 1;
|
|
1180
1203
|
var t = yt(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
|
|
1181
1204
|
function r(o) {
|
|
1182
1205
|
var l = n.call(o, i), c = o[i];
|
|
@@ -1190,50 +1213,50 @@ function wn() {
|
|
|
1190
1213
|
}
|
|
1191
1214
|
return ve = r, ve;
|
|
1192
1215
|
}
|
|
1193
|
-
var Se,
|
|
1194
|
-
function
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1216
|
+
var Se, Qe;
|
|
1217
|
+
function Tn() {
|
|
1218
|
+
if (Qe) return Se;
|
|
1219
|
+
Qe = 1;
|
|
1197
1220
|
var t = Object.prototype, e = t.toString;
|
|
1198
1221
|
function n(s) {
|
|
1199
1222
|
return e.call(s);
|
|
1200
1223
|
}
|
|
1201
1224
|
return Se = n, Se;
|
|
1202
1225
|
}
|
|
1203
|
-
var Ae,
|
|
1204
|
-
function
|
|
1205
|
-
if (
|
|
1206
|
-
|
|
1207
|
-
var t = yt(), e =
|
|
1226
|
+
var Ae, Ke;
|
|
1227
|
+
function Dn() {
|
|
1228
|
+
if (Ke) return Ae;
|
|
1229
|
+
Ke = 1;
|
|
1230
|
+
var t = yt(), e = Cn(), n = Tn(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
|
|
1208
1231
|
function o(l) {
|
|
1209
1232
|
return l == null ? l === void 0 ? i : s : r && r in Object(l) ? e(l) : n(l);
|
|
1210
1233
|
}
|
|
1211
1234
|
return Ae = o, Ae;
|
|
1212
1235
|
}
|
|
1213
|
-
var
|
|
1214
|
-
function
|
|
1215
|
-
if (
|
|
1216
|
-
|
|
1236
|
+
var Me, Ze;
|
|
1237
|
+
function Rn() {
|
|
1238
|
+
if (Ze) return Me;
|
|
1239
|
+
Ze = 1;
|
|
1217
1240
|
function t(e) {
|
|
1218
1241
|
return e != null && typeof e == "object";
|
|
1219
1242
|
}
|
|
1220
|
-
return
|
|
1243
|
+
return Me = t, Me;
|
|
1221
1244
|
}
|
|
1222
|
-
var
|
|
1223
|
-
function
|
|
1224
|
-
if (
|
|
1225
|
-
|
|
1226
|
-
var t =
|
|
1245
|
+
var be, Je;
|
|
1246
|
+
function kn() {
|
|
1247
|
+
if (Je) return be;
|
|
1248
|
+
Je = 1;
|
|
1249
|
+
var t = Dn(), e = Rn(), n = "[object Symbol]";
|
|
1227
1250
|
function s(i) {
|
|
1228
1251
|
return typeof i == "symbol" || e(i) && t(i) == n;
|
|
1229
1252
|
}
|
|
1230
|
-
return
|
|
1253
|
+
return be = s, be;
|
|
1231
1254
|
}
|
|
1232
|
-
var we,
|
|
1233
|
-
function
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
1236
|
-
var t =
|
|
1255
|
+
var we, et;
|
|
1256
|
+
function xn() {
|
|
1257
|
+
if (et) return we;
|
|
1258
|
+
et = 1;
|
|
1259
|
+
var t = En(), e = xe(), n = kn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
|
|
1237
1260
|
function c(d) {
|
|
1238
1261
|
if (typeof d == "number")
|
|
1239
1262
|
return d;
|
|
@@ -1251,41 +1274,41 @@ function Rn() {
|
|
|
1251
1274
|
}
|
|
1252
1275
|
return we = c, we;
|
|
1253
1276
|
}
|
|
1254
|
-
var Ee,
|
|
1255
|
-
function
|
|
1256
|
-
if (
|
|
1257
|
-
|
|
1258
|
-
var t =
|
|
1277
|
+
var Ee, tt;
|
|
1278
|
+
function In() {
|
|
1279
|
+
if (tt) return Ee;
|
|
1280
|
+
tt = 1;
|
|
1281
|
+
var t = xe(), e = bn(), n = xn(), s = "Expected a function", i = Math.max, r = Math.min;
|
|
1259
1282
|
function o(l, c, d) {
|
|
1260
|
-
var m, f, u, h, A, p, S = 0,
|
|
1283
|
+
var m, f, u, h, A, p, S = 0, M = !1, g = !1, y = !0;
|
|
1261
1284
|
if (typeof l != "function")
|
|
1262
1285
|
throw new TypeError(s);
|
|
1263
|
-
c = n(c) || 0, t(d) && (
|
|
1286
|
+
c = n(c) || 0, t(d) && (M = !!d.leading, g = "maxWait" in d, u = g ? i(n(d.maxWait) || 0, c) : u, y = "trailing" in d ? !!d.trailing : y);
|
|
1264
1287
|
function v(R) {
|
|
1265
1288
|
var V = m, q = f;
|
|
1266
1289
|
return m = f = void 0, S = R, h = l.apply(q, V), h;
|
|
1267
1290
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return S = R, A = setTimeout(
|
|
1291
|
+
function b(R) {
|
|
1292
|
+
return S = R, A = setTimeout(O, c), M ? v(R) : h;
|
|
1270
1293
|
}
|
|
1271
1294
|
function T(R) {
|
|
1272
|
-
var V = R - p, q = R - S,
|
|
1273
|
-
return g ? r(
|
|
1295
|
+
var V = R - p, q = R - S, Q = c - V;
|
|
1296
|
+
return g ? r(Q, u - q) : Q;
|
|
1274
1297
|
}
|
|
1275
1298
|
function D(R) {
|
|
1276
1299
|
var V = R - p, q = R - S;
|
|
1277
1300
|
return p === void 0 || V >= c || V < 0 || g && q >= u;
|
|
1278
1301
|
}
|
|
1279
|
-
function
|
|
1302
|
+
function O() {
|
|
1280
1303
|
var R = e();
|
|
1281
1304
|
if (D(R))
|
|
1282
1305
|
return P(R);
|
|
1283
|
-
A = setTimeout(
|
|
1306
|
+
A = setTimeout(O, T(R));
|
|
1284
1307
|
}
|
|
1285
1308
|
function P(R) {
|
|
1286
1309
|
return A = void 0, y && m ? v(R) : (m = f = void 0, h);
|
|
1287
1310
|
}
|
|
1288
|
-
function
|
|
1311
|
+
function Y() {
|
|
1289
1312
|
A !== void 0 && clearTimeout(A), S = 0, m = p = f = A = void 0;
|
|
1290
1313
|
}
|
|
1291
1314
|
function z() {
|
|
@@ -1295,21 +1318,21 @@ function kn() {
|
|
|
1295
1318
|
var R = e(), V = D(R);
|
|
1296
1319
|
if (m = arguments, f = this, p = R, V) {
|
|
1297
1320
|
if (A === void 0)
|
|
1298
|
-
return
|
|
1321
|
+
return b(p);
|
|
1299
1322
|
if (g)
|
|
1300
|
-
return clearTimeout(A), A = setTimeout(
|
|
1323
|
+
return clearTimeout(A), A = setTimeout(O, c), v(p);
|
|
1301
1324
|
}
|
|
1302
|
-
return A === void 0 && (A = setTimeout(
|
|
1325
|
+
return A === void 0 && (A = setTimeout(O, c)), h;
|
|
1303
1326
|
}
|
|
1304
|
-
return _.cancel =
|
|
1327
|
+
return _.cancel = Y, _.flush = z, _;
|
|
1305
1328
|
}
|
|
1306
1329
|
return Ee = o, Ee;
|
|
1307
1330
|
}
|
|
1308
|
-
var Ce,
|
|
1309
|
-
function
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
1312
|
-
var t =
|
|
1331
|
+
var Ce, nt;
|
|
1332
|
+
function On() {
|
|
1333
|
+
if (nt) return Ce;
|
|
1334
|
+
nt = 1;
|
|
1335
|
+
var t = In(), e = xe(), n = "Expected a function";
|
|
1313
1336
|
function s(i, r, o) {
|
|
1314
1337
|
var l = !0, c = !0;
|
|
1315
1338
|
if (typeof i != "function")
|
|
@@ -1322,18 +1345,18 @@ function xn() {
|
|
|
1322
1345
|
}
|
|
1323
1346
|
return Ce = s, Ce;
|
|
1324
1347
|
}
|
|
1325
|
-
var
|
|
1326
|
-
const vt = /* @__PURE__ */
|
|
1348
|
+
var Pn = On();
|
|
1349
|
+
const vt = /* @__PURE__ */ An(Pn), Ln = (t) => {
|
|
1327
1350
|
const e = F(() => "schedulant-timeline-event-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = k("none"), l = C((g) => {
|
|
1328
|
-
const
|
|
1329
|
-
return { moveSlots: P, distance:
|
|
1351
|
+
const b = t.schedulantApi.getScheduleView().getTimelineView(), T = g - n.current, D = t.timelineWidth, O = b.getTotalSlots(), P = Math.round(T / D * O), Y = P / O * D;
|
|
1352
|
+
return { moveSlots: P, distance: Y, deltaX: T };
|
|
1330
1353
|
}, [t]), c = C((g) => {
|
|
1331
|
-
const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left,
|
|
1354
|
+
const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left, b = g.style.right, T = y.calculateLaneHeight(t.resourceApi), D = document.createElement("div");
|
|
1332
1355
|
D.className = e, Object.assign(D.style, {
|
|
1333
1356
|
position: "absolute",
|
|
1334
1357
|
zIndex: 1,
|
|
1335
1358
|
left: v,
|
|
1336
|
-
right:
|
|
1359
|
+
right: b,
|
|
1337
1360
|
height: w(T),
|
|
1338
1361
|
backgroundColor: t.schedulantApi.getDragHintColor()
|
|
1339
1362
|
}), g.parentNode?.insertBefore(D, g);
|
|
@@ -1343,8 +1366,8 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1343
1366
|
}, [e]), m = C((g, y) => {
|
|
1344
1367
|
const v = g.previousElementSibling;
|
|
1345
1368
|
if (v && v.className === e) {
|
|
1346
|
-
const
|
|
1347
|
-
switch (
|
|
1369
|
+
const b = o.current, { distance: T } = l(y);
|
|
1370
|
+
switch (b) {
|
|
1348
1371
|
case "press_event": {
|
|
1349
1372
|
v.style.left = w(Math.max(s.current + T, 0)), v.style.right = w(i.current - T);
|
|
1350
1373
|
break;
|
|
@@ -1362,41 +1385,41 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1362
1385
|
}
|
|
1363
1386
|
}
|
|
1364
1387
|
}, [l, e]), f = C((g, y) => {
|
|
1365
|
-
const v = t.eventApi,
|
|
1388
|
+
const v = t.eventApi, b = t.schedulantApi, T = o.current, { moveSlots: D, distance: O } = l(y);
|
|
1366
1389
|
switch (T) {
|
|
1367
1390
|
case "press_event": {
|
|
1368
|
-
g.style.left = w(Math.max(s.current +
|
|
1369
|
-
const P = v.getStart().add(D, "day"),
|
|
1370
|
-
|
|
1391
|
+
g.style.left = w(Math.max(s.current + O, 0)), g.style.right = w(i.current - O);
|
|
1392
|
+
const P = v.getStart().add(D, "day"), Y = v.getEnd().add(D, "day");
|
|
1393
|
+
b.eventMove({
|
|
1371
1394
|
el: g,
|
|
1372
1395
|
startDate: P,
|
|
1373
|
-
endDate:
|
|
1396
|
+
endDate: Y,
|
|
1374
1397
|
eventApi: v,
|
|
1375
|
-
schedulantApi:
|
|
1398
|
+
schedulantApi: b
|
|
1376
1399
|
});
|
|
1377
1400
|
break;
|
|
1378
1401
|
}
|
|
1379
1402
|
case "press_event_left": {
|
|
1380
|
-
const P = Math.max(s.current +
|
|
1403
|
+
const P = Math.max(s.current + O, 0);
|
|
1381
1404
|
g.style.left = w(P);
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1405
|
+
const Y = v.getStart().add(D, "day");
|
|
1406
|
+
b.eventResizeStart({
|
|
1384
1407
|
el: g,
|
|
1385
|
-
date:
|
|
1408
|
+
date: Y,
|
|
1386
1409
|
eventApi: v,
|
|
1387
|
-
schedulantApi:
|
|
1410
|
+
schedulantApi: b
|
|
1388
1411
|
});
|
|
1389
1412
|
break;
|
|
1390
1413
|
}
|
|
1391
1414
|
case "press_event_right": {
|
|
1392
|
-
const P = i.current -
|
|
1415
|
+
const P = i.current - O;
|
|
1393
1416
|
g.style.right = w(P);
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1417
|
+
const Y = v.getEnd().add(D, "day");
|
|
1418
|
+
b.eventResizeEnd({
|
|
1396
1419
|
el: g,
|
|
1397
|
-
date:
|
|
1420
|
+
date: Y,
|
|
1398
1421
|
eventApi: v,
|
|
1399
|
-
schedulantApi:
|
|
1422
|
+
schedulantApi: b
|
|
1400
1423
|
});
|
|
1401
1424
|
break;
|
|
1402
1425
|
}
|
|
@@ -1405,7 +1428,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1405
1428
|
g.preventDefault();
|
|
1406
1429
|
const y = r.current, v = t.timelineEventHarnessRef.current;
|
|
1407
1430
|
if (y && v) {
|
|
1408
|
-
const { deltaX:
|
|
1431
|
+
const { deltaX: b } = l(g.clientX), T = s.current + b, D = i.current - b;
|
|
1409
1432
|
switch (o.current) {
|
|
1410
1433
|
case "press_event":
|
|
1411
1434
|
v.style.left = w(T), v.style.right = w(D);
|
|
@@ -1420,34 +1443,34 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1420
1443
|
m(v, g.clientX);
|
|
1421
1444
|
}
|
|
1422
1445
|
}, [t.timelineEventHarnessRef, m, l]), h = F(
|
|
1423
|
-
() => vt(u,
|
|
1446
|
+
() => vt(u, gt),
|
|
1424
1447
|
[u]
|
|
1425
1448
|
), A = C((g, y) => {
|
|
1426
1449
|
g.preventDefault();
|
|
1427
|
-
const v = t.schedulantApi.getSchedulantElRef().current,
|
|
1428
|
-
|
|
1450
|
+
const v = t.schedulantApi.getSchedulantElRef().current, b = t.timelineEventHarnessRef.current;
|
|
1451
|
+
b && v ? (r.current = !0, o.current = y, n.current = g.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), c(b), v.addEventListener("mousemove", h)) : (console.error("scheduleEl", v), console.error("timelineEventHarness", b));
|
|
1429
1452
|
}, [t.schedulantApi, t.timelineEventHarnessRef, c, h]), p = C((g) => {
|
|
1430
1453
|
A(g, "press_event");
|
|
1431
1454
|
}, [A]), S = C((g) => {
|
|
1432
1455
|
A(g, "press_event_left");
|
|
1433
|
-
}, [A]),
|
|
1456
|
+
}, [A]), M = C((g) => {
|
|
1434
1457
|
A(g, "press_event_right");
|
|
1435
1458
|
}, [A]);
|
|
1436
|
-
return
|
|
1459
|
+
return N(() => {
|
|
1437
1460
|
const g = t.timelineEventHarnessRef.current, y = t.schedulantApi.getSchedulantElRef().current;
|
|
1438
1461
|
if (y && g) {
|
|
1439
1462
|
const v = g.parentElement?.parentElement;
|
|
1440
1463
|
if (v) {
|
|
1441
|
-
const
|
|
1464
|
+
const b = (T) => {
|
|
1442
1465
|
T.preventDefault(), r.current && !v.contains(T.relatedTarget) && (d(g), f(g, T.clientX), y.removeEventListener("mousemove", h), r.current = !1, o.current = "none");
|
|
1443
1466
|
};
|
|
1444
|
-
return v.addEventListener("mouseup",
|
|
1445
|
-
v.removeEventListener("mouseup",
|
|
1467
|
+
return v.addEventListener("mouseup", b), v.addEventListener("mouseout", b), () => {
|
|
1468
|
+
v.removeEventListener("mouseup", b), v.removeEventListener("mouseout", b), y.removeEventListener("mousemove", h), h.cancel();
|
|
1446
1469
|
};
|
|
1447
1470
|
}
|
|
1448
1471
|
}
|
|
1449
|
-
}, [h, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown:
|
|
1450
|
-
},
|
|
1472
|
+
}, [h, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown: M };
|
|
1473
|
+
}, st = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1451
1474
|
"svg",
|
|
1452
1475
|
{
|
|
1453
1476
|
className: "triangle-left-icon",
|
|
@@ -1464,7 +1487,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1464
1487
|
}
|
|
1465
1488
|
)
|
|
1466
1489
|
}
|
|
1467
|
-
), ...t }),
|
|
1490
|
+
), ...t }), it = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1468
1491
|
"svg",
|
|
1469
1492
|
{
|
|
1470
1493
|
className: "drag-icon",
|
|
@@ -1475,7 +1498,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1475
1498
|
height: `${w(t.height)}`,
|
|
1476
1499
|
children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill: t.color })
|
|
1477
1500
|
}
|
|
1478
|
-
), ...t }),
|
|
1501
|
+
), ...t }), rt = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
|
|
1479
1502
|
"svg",
|
|
1480
1503
|
{
|
|
1481
1504
|
className: "triangle-left-icon",
|
|
@@ -1492,8 +1515,8 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1492
1515
|
}
|
|
1493
1516
|
)
|
|
1494
1517
|
}
|
|
1495
|
-
), ...t }),
|
|
1496
|
-
const e = k(null), n = k(null), s = t.schedulantApi.getTimelineApi(), i = t.schedulantApi.getScheduleView().getTimelineView(), r = t.eventApi.getTextColor().getOrElse("white"), o = t.eventApi.getBorderColor().getOrElse(t.eventApi.getColor()), l = t.eventApi.getBackgroundColor().getOrElse(t.eventApi.getColor()), c = i.calculateLaneHeight(t.resourceApi), d = i.calculateEventHeight(), m = (c - d) / 2 - 1, { isPast: f, isFuture: u, isProcess: h } =
|
|
1518
|
+
), ...t }), Nn = ae((t) => {
|
|
1519
|
+
const e = k(null), n = k(null), s = t.schedulantApi.getTimelineApi(), i = t.schedulantApi.getScheduleView().getTimelineView(), r = t.eventApi.getTextColor().getOrElse("white"), o = t.eventApi.getBorderColor().getOrElse(t.eventApi.getColor()), l = t.eventApi.getBackgroundColor().getOrElse(t.eventApi.getColor()), c = i.calculateLaneHeight(t.resourceApi), d = i.calculateEventHeight(), m = (c - d) / 2 - 1, { isPast: f, isFuture: u, isProcess: h } = Sn(e, t.schedulantApi, t.eventApi), { handleMouseDown: A, leftHandleMouseDown: p, rightHandleMouseDown: S } = Ln({
|
|
1497
1520
|
timelineEventHarnessRef: n,
|
|
1498
1521
|
timelineWidth: t.timelineWidth,
|
|
1499
1522
|
eventApi: t.eventApi,
|
|
@@ -1507,15 +1530,15 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1507
1530
|
left: w(t.position.left),
|
|
1508
1531
|
right: w(t.position.right)
|
|
1509
1532
|
}, children: /* @__PURE__ */ a(
|
|
1510
|
-
|
|
1533
|
+
Z,
|
|
1511
1534
|
{
|
|
1512
1535
|
disabled: !t.schedulantApi.isEnableEventContextMenu(),
|
|
1513
1536
|
destroyOnHidden: !0,
|
|
1514
1537
|
trigger: ["contextMenu"],
|
|
1515
1538
|
menu: {
|
|
1516
1539
|
items: t.schedulantApi.getEventContextMenuItems(),
|
|
1517
|
-
onClick: (
|
|
1518
|
-
const { key: g, keyPath: y, domEvent: v } =
|
|
1540
|
+
onClick: (M) => {
|
|
1541
|
+
const { key: g, keyPath: y, domEvent: v } = M;
|
|
1519
1542
|
t.schedulantApi.onEventContextMenuClick({
|
|
1520
1543
|
key: g,
|
|
1521
1544
|
keyPath: y,
|
|
@@ -1528,7 +1551,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1528
1551
|
});
|
|
1529
1552
|
}
|
|
1530
1553
|
},
|
|
1531
|
-
children: /* @__PURE__ */
|
|
1554
|
+
children: /* @__PURE__ */ I(
|
|
1532
1555
|
"div",
|
|
1533
1556
|
{
|
|
1534
1557
|
className: "schedulant-timeline-event",
|
|
@@ -1544,21 +1567,21 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1544
1567
|
{
|
|
1545
1568
|
condition: t.eventApi.getStart().isBefore(s.getStart()),
|
|
1546
1569
|
fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
|
|
1547
|
-
children: /* @__PURE__ */ a(
|
|
1570
|
+
children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
|
|
1548
1571
|
}
|
|
1549
1572
|
),
|
|
1550
1573
|
children: /* @__PURE__ */ a(
|
|
1551
1574
|
H,
|
|
1552
1575
|
{
|
|
1553
1576
|
condition: !t.eventApi.getStart().isBefore(s.getStart()),
|
|
1554
|
-
fallback: /* @__PURE__ */ a(
|
|
1577
|
+
fallback: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" }),
|
|
1555
1578
|
children: /* @__PURE__ */ a(
|
|
1556
1579
|
"div",
|
|
1557
1580
|
{
|
|
1558
1581
|
className: "schedulant-event-resize-handle",
|
|
1559
1582
|
onMouseDown: p,
|
|
1560
1583
|
style: { width: W, height: d, cursor: "ew-resize" },
|
|
1561
|
-
children: /* @__PURE__ */ a(
|
|
1584
|
+
children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
|
|
1562
1585
|
}
|
|
1563
1586
|
)
|
|
1564
1587
|
}
|
|
@@ -1625,21 +1648,21 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1625
1648
|
{
|
|
1626
1649
|
condition: t.eventApi.getEnd().isAfter(s.getEnd()),
|
|
1627
1650
|
fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
|
|
1628
|
-
children: /* @__PURE__ */ a(
|
|
1651
|
+
children: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" })
|
|
1629
1652
|
}
|
|
1630
1653
|
),
|
|
1631
1654
|
children: /* @__PURE__ */ a(
|
|
1632
1655
|
H,
|
|
1633
1656
|
{
|
|
1634
1657
|
condition: t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
|
|
1635
|
-
fallback: /* @__PURE__ */ a(
|
|
1658
|
+
fallback: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" }),
|
|
1636
1659
|
children: /* @__PURE__ */ a(
|
|
1637
1660
|
"div",
|
|
1638
1661
|
{
|
|
1639
1662
|
className: "schedulant-event-resize-handle",
|
|
1640
1663
|
onMouseDown: S,
|
|
1641
1664
|
style: { width: W, height: d, cursor: "ew-resize" },
|
|
1642
|
-
children: /* @__PURE__ */ a(
|
|
1665
|
+
children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
|
|
1643
1666
|
}
|
|
1644
1667
|
)
|
|
1645
1668
|
}
|
|
@@ -1651,9 +1674,9 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1651
1674
|
)
|
|
1652
1675
|
}
|
|
1653
1676
|
) });
|
|
1654
|
-
}),
|
|
1677
|
+
}), Yn = (t, e, n) => {
|
|
1655
1678
|
const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
|
|
1656
|
-
return
|
|
1679
|
+
return N(() => {
|
|
1657
1680
|
const l = t.current;
|
|
1658
1681
|
if (l)
|
|
1659
1682
|
return e.milestoneDidMount({
|
|
@@ -1676,37 +1699,37 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1676
1699
|
}, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
|
|
1677
1700
|
}, St = (t) => {
|
|
1678
1701
|
const e = F(() => "schedulant-timeline-marker-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = C((p) => {
|
|
1679
|
-
const S = p.style.left,
|
|
1680
|
-
|
|
1702
|
+
const S = p.style.left, M = p.style.right, g = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), v = g.calculateLaneHeight(y), b = document.createElement("div");
|
|
1703
|
+
b.className = e, Object.assign(b.style, {
|
|
1681
1704
|
position: "absolute",
|
|
1682
1705
|
zIndex: 1,
|
|
1683
1706
|
left: S,
|
|
1684
|
-
right:
|
|
1707
|
+
right: M,
|
|
1685
1708
|
height: w(v),
|
|
1686
1709
|
backgroundColor: t.schedulantApi.getDragHintColor()
|
|
1687
|
-
}), p.parentNode?.insertBefore(
|
|
1710
|
+
}), p.parentNode?.insertBefore(b, p);
|
|
1688
1711
|
}, [t, e]), l = C((p) => {
|
|
1689
1712
|
const S = p.previousElementSibling;
|
|
1690
1713
|
S?.className === e && p.parentElement?.removeChild(S);
|
|
1691
1714
|
}, [e]), c = C((p) => {
|
|
1692
|
-
const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth,
|
|
1715
|
+
const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth, b = g.getTotalSlots(), T = Math.round(y / v * b), D = T / b * t.timelineWidth;
|
|
1693
1716
|
return {
|
|
1694
1717
|
moveSlots: T,
|
|
1695
1718
|
distance: D,
|
|
1696
1719
|
deltaX: y,
|
|
1697
1720
|
totalWidth: v,
|
|
1698
|
-
totalSlots:
|
|
1721
|
+
totalSlots: b
|
|
1699
1722
|
};
|
|
1700
1723
|
}, [t]), d = C((p, S) => {
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1724
|
+
const M = p.previousElementSibling;
|
|
1725
|
+
if (M && M.className === e) {
|
|
1703
1726
|
const { distance: g } = c(S);
|
|
1704
|
-
|
|
1727
|
+
M.style.left = w(Math.max(s.current + g, 0)), M.style.right = w(i.current - g);
|
|
1705
1728
|
}
|
|
1706
1729
|
}, [e, c]), m = C((p, S) => {
|
|
1707
|
-
const { moveSlots:
|
|
1730
|
+
const { moveSlots: M, distance: g } = c(S);
|
|
1708
1731
|
if (p.style.left = w(Math.max(s.current + g, 0)), p.style.right = w(i.current - g), t.milestoneApi) {
|
|
1709
|
-
const y = t.milestoneApi.getTime().add(
|
|
1732
|
+
const y = t.milestoneApi.getTime().add(M, "day");
|
|
1710
1733
|
t.schedulantApi.milestoneMove({
|
|
1711
1734
|
el: p,
|
|
1712
1735
|
date: y,
|
|
@@ -1714,7 +1737,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1714
1737
|
milestoneApi: t.milestoneApi
|
|
1715
1738
|
});
|
|
1716
1739
|
} else if (t.checkpointApi) {
|
|
1717
|
-
const y = t.checkpointApi.getTime().add(
|
|
1740
|
+
const y = t.checkpointApi.getTime().add(M, "day");
|
|
1718
1741
|
t.schedulantApi.checkpointMove({
|
|
1719
1742
|
el: p,
|
|
1720
1743
|
date: y,
|
|
@@ -1725,38 +1748,38 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1725
1748
|
n.current = 0;
|
|
1726
1749
|
}, [t, c]), f = C((p) => {
|
|
1727
1750
|
p.preventDefault();
|
|
1728
|
-
const S = t.markerRef.current,
|
|
1729
|
-
if (S &&
|
|
1751
|
+
const S = t.markerRef.current, M = r.current;
|
|
1752
|
+
if (S && M) {
|
|
1730
1753
|
const g = p.clientX - n.current, y = s.current + g, v = i.current - g;
|
|
1731
1754
|
S.style.left = w(y), S.style.right = w(v), d(S, p.clientX);
|
|
1732
1755
|
}
|
|
1733
1756
|
}, [t.markerRef, d]), u = F(
|
|
1734
|
-
() => vt(f,
|
|
1757
|
+
() => vt(f, gt),
|
|
1735
1758
|
[f]
|
|
1736
1759
|
), h = C((p) => {
|
|
1737
1760
|
p.preventDefault();
|
|
1738
|
-
const S = t.markerRef.current,
|
|
1739
|
-
|
|
1761
|
+
const S = t.markerRef.current, M = r.current, g = t.schedulantApi.getSchedulantElRef().current;
|
|
1762
|
+
M && g && S && (l(S), m(S, p.clientX), g.removeEventListener("mousemove", u), r.current = !1);
|
|
1740
1763
|
}, [u, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
|
|
1741
1764
|
p.preventDefault();
|
|
1742
|
-
const S = t.schedulantApi.getSchedulantElRef().current,
|
|
1743
|
-
S &&
|
|
1765
|
+
const S = t.schedulantApi.getSchedulantElRef().current, M = t.markerRef.current;
|
|
1766
|
+
S && M && (r.current = !0, n.current = p.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), o(M), S.addEventListener("mousemove", u));
|
|
1744
1767
|
}, [o, u, t.markerRef, t.schedulantApi]);
|
|
1745
|
-
return
|
|
1768
|
+
return N(() => {
|
|
1746
1769
|
const p = t.schedulantApi.getSchedulantElRef().current, S = t.markerRef.current;
|
|
1747
1770
|
if (p && S) {
|
|
1748
|
-
const
|
|
1749
|
-
if (
|
|
1771
|
+
const M = S.parentElement?.parentElement;
|
|
1772
|
+
if (M) {
|
|
1750
1773
|
const g = (y) => {
|
|
1751
|
-
y.preventDefault(), r.current && !
|
|
1774
|
+
y.preventDefault(), r.current && !M.contains(y.relatedTarget) && (l(S), m(S, y.clientX), p.removeEventListener("mousemove", u), r.current = !1);
|
|
1752
1775
|
};
|
|
1753
|
-
return
|
|
1754
|
-
|
|
1776
|
+
return M.addEventListener("mouseup", g), M.addEventListener("mouseout", g), () => {
|
|
1777
|
+
M.removeEventListener("mouseup", g), M.removeEventListener("mouseout", g), p.removeEventListener("mousemove", u), u.cancel();
|
|
1755
1778
|
};
|
|
1756
1779
|
}
|
|
1757
1780
|
}
|
|
1758
1781
|
}, [u, t, l, m]), { handleMouseUp: h, handleMouseDown: A };
|
|
1759
|
-
},
|
|
1782
|
+
}, _n = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
|
|
1760
1783
|
"svg",
|
|
1761
1784
|
{
|
|
1762
1785
|
className: "flag-icon",
|
|
@@ -1782,8 +1805,8 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1782
1805
|
)
|
|
1783
1806
|
]
|
|
1784
1807
|
}
|
|
1785
|
-
), ...t }),
|
|
1786
|
-
const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.milestoneApi.getStatus(), r = t.milestoneApi.getColor().getOrElse(i === "Success" ? "green" : i === "Failure" ? "red" : "yellow"), l = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.milestoneApi.getResourceApi()), c = l * Xt * -1, { isPast: d, isFuture: m, isProcess: f } =
|
|
1808
|
+
), ...t }), Wn = ae((t) => {
|
|
1809
|
+
const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.milestoneApi.getStatus(), r = t.milestoneApi.getColor().getOrElse(i === "Success" ? "green" : i === "Failure" ? "red" : "yellow"), l = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.milestoneApi.getResourceApi()), c = l * Xt * -1, { isPast: d, isFuture: m, isProcess: f } = Yn(e, t.schedulantApi, t.milestoneApi), { handleMouseUp: u, handleMouseDown: h } = St({
|
|
1787
1810
|
markerRef: n,
|
|
1788
1811
|
timelineWidth: t.timelineWidth,
|
|
1789
1812
|
schedulantApi: t.schedulantApi,
|
|
@@ -1796,7 +1819,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1796
1819
|
left: w(t.position.left),
|
|
1797
1820
|
right: w(t.position.right)
|
|
1798
1821
|
}, onMouseUp: s ? u : void 0, onMouseDown: s ? h : void 0, ref: n, children: /* @__PURE__ */ a(
|
|
1799
|
-
|
|
1822
|
+
Z,
|
|
1800
1823
|
{
|
|
1801
1824
|
disabled: !t.schedulantApi.isEnableMilestoneContextMenu(),
|
|
1802
1825
|
destroyOnHidden: !0,
|
|
@@ -1804,11 +1827,11 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1804
1827
|
menu: {
|
|
1805
1828
|
items: t.schedulantApi.getMilestoneContextMenuItems(),
|
|
1806
1829
|
onClick: (A) => {
|
|
1807
|
-
const { key: p, keyPath: S, domEvent:
|
|
1830
|
+
const { key: p, keyPath: S, domEvent: M } = A;
|
|
1808
1831
|
t.schedulantApi.onMilestoneContextMenuClick({
|
|
1809
1832
|
key: p,
|
|
1810
1833
|
keyPath: S,
|
|
1811
|
-
domEvent:
|
|
1834
|
+
domEvent: M,
|
|
1812
1835
|
isPast: d,
|
|
1813
1836
|
isFuture: m,
|
|
1814
1837
|
isProcess: f,
|
|
@@ -1817,12 +1840,12 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1817
1840
|
});
|
|
1818
1841
|
}
|
|
1819
1842
|
},
|
|
1820
|
-
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(
|
|
1843
|
+
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(_n, { width: l * Ve, height: l * Ve, color: r }) }) })
|
|
1821
1844
|
}
|
|
1822
1845
|
) });
|
|
1823
|
-
}),
|
|
1846
|
+
}), Hn = (t, e, n) => {
|
|
1824
1847
|
const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
|
|
1825
|
-
return
|
|
1848
|
+
return N(() => {
|
|
1826
1849
|
const l = t.current;
|
|
1827
1850
|
if (l)
|
|
1828
1851
|
return e.checkpointDidMount({
|
|
@@ -1843,7 +1866,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1843
1866
|
});
|
|
1844
1867
|
};
|
|
1845
1868
|
}, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
|
|
1846
|
-
},
|
|
1869
|
+
}, zn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
|
|
1847
1870
|
"svg",
|
|
1848
1871
|
{
|
|
1849
1872
|
className: "droplet-icon",
|
|
@@ -1870,12 +1893,12 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1870
1893
|
/* @__PURE__ */ a("path", { d: "M 517,116 A 154,154 0 1 1 517,424 A 154,154 0 1 1 517,116 Z", fill: t.color })
|
|
1871
1894
|
]
|
|
1872
1895
|
}
|
|
1873
|
-
), ...t }),
|
|
1896
|
+
), ...t }), Vn = ae((t) => {
|
|
1874
1897
|
const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.checkpointApi.getColor().getOrElse("black"), r = t.schedulantApi.getScheduleView().getTimelineView(), o = r.calculateLaneHeight(t.checkpointApi.getResourceApi()), l = r.calculateEventHeight(), c = (o - l) / 2 + 2, {
|
|
1875
1898
|
isPast: d,
|
|
1876
1899
|
isFuture: m,
|
|
1877
1900
|
isProcess: f
|
|
1878
|
-
} =
|
|
1901
|
+
} = Hn(e, t.schedulantApi, t.checkpointApi), { handleMouseUp: u, handleMouseDown: h } = St({
|
|
1879
1902
|
markerRef: n,
|
|
1880
1903
|
timelineWidth: t.timelineWidth,
|
|
1881
1904
|
schedulantApi: t.schedulantApi,
|
|
@@ -1896,7 +1919,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1896
1919
|
onMouseDown: s ? h : void 0,
|
|
1897
1920
|
ref: n,
|
|
1898
1921
|
children: /* @__PURE__ */ a(
|
|
1899
|
-
|
|
1922
|
+
Z,
|
|
1900
1923
|
{
|
|
1901
1924
|
disabled: !t.schedulantApi.isEnableCheckpointContextMenu(),
|
|
1902
1925
|
destroyOnHidden: !0,
|
|
@@ -1904,11 +1927,11 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1904
1927
|
menu: {
|
|
1905
1928
|
items: t.schedulantApi.getCheckpointContextMenuItems(),
|
|
1906
1929
|
onClick: (A) => {
|
|
1907
|
-
const { key: p, keyPath: S, domEvent:
|
|
1930
|
+
const { key: p, keyPath: S, domEvent: M } = A;
|
|
1908
1931
|
t.schedulantApi.onCheckpointContextMenuClick({
|
|
1909
1932
|
key: p,
|
|
1910
1933
|
keyPath: S,
|
|
1911
|
-
domEvent:
|
|
1934
|
+
domEvent: M,
|
|
1912
1935
|
isPast: d,
|
|
1913
1936
|
isFuture: m,
|
|
1914
1937
|
isProcess: f,
|
|
@@ -1917,7 +1940,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
|
|
|
1917
1940
|
});
|
|
1918
1941
|
}
|
|
1919
1942
|
},
|
|
1920
|
-
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(
|
|
1943
|
+
children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(zn, { width: l, height: l, color: i }) }) })
|
|
1921
1944
|
}
|
|
1922
1945
|
)
|
|
1923
1946
|
}
|
|
@@ -1935,14 +1958,14 @@ class J {
|
|
|
1935
1958
|
return this.schedulantApi.getTimelineApi();
|
|
1936
1959
|
}
|
|
1937
1960
|
renderLane() {
|
|
1938
|
-
return /* @__PURE__ */ a(
|
|
1961
|
+
return /* @__PURE__ */ a(vn, {});
|
|
1939
1962
|
}
|
|
1940
1963
|
renderEvents(e, n) {
|
|
1941
1964
|
const s = this.schedulantApi.getTimelineApi(), i = e.getEventApis();
|
|
1942
1965
|
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-events schedulant-scrollgrid-sync-inner", children: i.filter((r) => !r.getStart().isAfter(s.getEnd()) && !r.getEnd().isBefore(s.getStart())).map((r) => {
|
|
1943
1966
|
const o = this.calculatePosition(n, r.getStart(), r.getEnd());
|
|
1944
1967
|
return /* @__PURE__ */ a(
|
|
1945
|
-
|
|
1968
|
+
Nn,
|
|
1946
1969
|
{
|
|
1947
1970
|
eventApi: r,
|
|
1948
1971
|
position: o,
|
|
@@ -1959,7 +1982,7 @@ class J {
|
|
|
1959
1982
|
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestones schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
|
|
1960
1983
|
const o = this.calculatePosition(n, r.getTime(), r.getTime());
|
|
1961
1984
|
return /* @__PURE__ */ a(
|
|
1962
|
-
|
|
1985
|
+
Wn,
|
|
1963
1986
|
{
|
|
1964
1987
|
position: o,
|
|
1965
1988
|
milestoneApi: r,
|
|
@@ -1975,7 +1998,7 @@ class J {
|
|
|
1975
1998
|
return /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoints schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
|
|
1976
1999
|
const o = this.calculatePosition(n, r.getTime(), r.getTime());
|
|
1977
2000
|
return /* @__PURE__ */ a(
|
|
1978
|
-
|
|
2001
|
+
Vn,
|
|
1979
2002
|
{
|
|
1980
2003
|
position: o,
|
|
1981
2004
|
timelineWidth: n,
|
|
@@ -1988,7 +2011,7 @@ class J {
|
|
|
1988
2011
|
}
|
|
1989
2012
|
calculateLaneHeight(e) {
|
|
1990
2013
|
const n = this.schedulantApi.getTimelineApi().getStart(), s = this.schedulantApi.getTimelineApi().getEnd();
|
|
1991
|
-
return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(n) && !r.getTime().isAfter(s)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() *
|
|
2014
|
+
return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(n) && !r.getTime().isAfter(s)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() * mt;
|
|
1992
2015
|
}
|
|
1993
2016
|
calculateEventHeight() {
|
|
1994
2017
|
return this.schedulantApi.getLineHeight() * Gt;
|
|
@@ -1997,9 +2020,9 @@ class J {
|
|
|
1997
2020
|
const ee = (t) => {
|
|
1998
2021
|
const { dates: e, minWidth: n } = t;
|
|
1999
2022
|
return /* @__PURE__ */ a("colgroup", { children: e.map((s) => /* @__PURE__ */ a("col", { style: { minWidth: n } }, s.format("YYYY-MM-DD"))) });
|
|
2000
|
-
},
|
|
2023
|
+
}, Fn = (t, e, n) => {
|
|
2001
2024
|
const s = n.isBefore(E(), "day"), i = n.isAfter(E(), "day"), r = n.isSame(E(), "day");
|
|
2002
|
-
|
|
2025
|
+
N(() => {
|
|
2003
2026
|
const o = t.current;
|
|
2004
2027
|
if (o)
|
|
2005
2028
|
return e.timelineSlotLaneDidMount({
|
|
@@ -2024,7 +2047,7 @@ const ee = (t) => {
|
|
|
2024
2047
|
}, [n, i, s, r, e, t]);
|
|
2025
2048
|
}, te = ae((t) => {
|
|
2026
2049
|
const e = k(null);
|
|
2027
|
-
return
|
|
2050
|
+
return Fn(e, t.schedulantApi, t.date), /* @__PURE__ */ a(
|
|
2028
2051
|
"td",
|
|
2029
2052
|
{
|
|
2030
2053
|
ref: e,
|
|
@@ -2034,9 +2057,9 @@ const ee = (t) => {
|
|
|
2034
2057
|
},
|
|
2035
2058
|
t.date.format("YYYY-MM-DD")
|
|
2036
2059
|
);
|
|
2037
|
-
}),
|
|
2060
|
+
}), Bn = (t, e, n, s, i) => {
|
|
2038
2061
|
const r = n.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSame(E(), "day");
|
|
2039
|
-
|
|
2062
|
+
N(() => {
|
|
2040
2063
|
const c = t.current;
|
|
2041
2064
|
if (c)
|
|
2042
2065
|
return e.timelineSlotLabelDidMount({
|
|
@@ -2065,7 +2088,7 @@ const ee = (t) => {
|
|
|
2065
2088
|
}, [n, o, r, l, s, e, i, t]);
|
|
2066
2089
|
}, B = (t) => {
|
|
2067
2090
|
const e = k(null);
|
|
2068
|
-
return
|
|
2091
|
+
return Bn(e, t.schedulantApi, t.date, t.level, t.timeText), /* @__PURE__ */ a(
|
|
2069
2092
|
"th",
|
|
2070
2093
|
{
|
|
2071
2094
|
ref: e,
|
|
@@ -2084,7 +2107,7 @@ const ee = (t) => {
|
|
|
2084
2107
|
t.date.format("YYYY-MM-DD")
|
|
2085
2108
|
);
|
|
2086
2109
|
};
|
|
2087
|
-
class
|
|
2110
|
+
class qn extends J {
|
|
2088
2111
|
renderColgroup() {
|
|
2089
2112
|
const e = this.getSchedulantApi(), s = this.getTimelineApi().getDays(), i = e.getSlotMinWidth();
|
|
2090
2113
|
return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
|
|
@@ -2104,7 +2127,7 @@ class Fn extends J {
|
|
|
2104
2127
|
}
|
|
2105
2128
|
renderHeaderSlots() {
|
|
2106
2129
|
const e = this.getTimelineApi(), n = e.getDays(), s = e.populateMonthsWithDays(), i = e.populateYearsWithDays();
|
|
2107
|
-
return /* @__PURE__ */
|
|
2130
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2108
2131
|
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: i.map((r) => /* @__PURE__ */ a(
|
|
2109
2132
|
B,
|
|
2110
2133
|
{
|
|
@@ -2167,7 +2190,7 @@ class Fn extends J {
|
|
|
2167
2190
|
return { left: o, right: l };
|
|
2168
2191
|
}
|
|
2169
2192
|
}
|
|
2170
|
-
class
|
|
2193
|
+
class Un extends J {
|
|
2171
2194
|
getTotalSlots() {
|
|
2172
2195
|
return this.getTimelineApi().getMonths().length;
|
|
2173
2196
|
}
|
|
@@ -2190,7 +2213,7 @@ class Bn extends J {
|
|
|
2190
2213
|
}
|
|
2191
2214
|
renderHeaderSlots() {
|
|
2192
2215
|
const e = this.getTimelineApi(), n = e.getMonths(), s = e.populateYearsWithMonths();
|
|
2193
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2194
2217
|
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
|
|
2195
2218
|
B,
|
|
2196
2219
|
{
|
|
@@ -2224,7 +2247,7 @@ class Bn extends J {
|
|
|
2224
2247
|
return { left: u, right: S };
|
|
2225
2248
|
}
|
|
2226
2249
|
}
|
|
2227
|
-
class
|
|
2250
|
+
class jn extends J {
|
|
2228
2251
|
getTotalSlots() {
|
|
2229
2252
|
return this.getTimelineApi().getQuarters().length;
|
|
2230
2253
|
}
|
|
@@ -2247,7 +2270,7 @@ class qn extends J {
|
|
|
2247
2270
|
}
|
|
2248
2271
|
renderHeaderSlots() {
|
|
2249
2272
|
const e = this.getTimelineApi(), n = e.getQuarters(), s = e.populateYearsWithQuarters();
|
|
2250
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2251
2274
|
/* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
|
|
2252
2275
|
B,
|
|
2253
2276
|
{
|
|
@@ -2277,11 +2300,11 @@ class qn extends J {
|
|
|
2277
2300
|
] });
|
|
2278
2301
|
}
|
|
2279
2302
|
calculatePosition(e, n, s) {
|
|
2280
|
-
const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = n.diff(l.startOf("quarter"), "day"), f = o / d, u = m * f, h = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, S = c.endOf("quarter").diff(c, "day"),
|
|
2303
|
+
const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = n.diff(l.startOf("quarter"), "day"), f = o / d, u = m * f, h = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, S = c.endOf("quarter").diff(c, "day"), M = o / p, g = S * M, y = (i.getQuarterPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
|
|
2281
2304
|
return { left: A, right: v };
|
|
2282
2305
|
}
|
|
2283
2306
|
}
|
|
2284
|
-
class
|
|
2307
|
+
class $n extends J {
|
|
2285
2308
|
getTotalSlots() {
|
|
2286
2309
|
return this.getTimelineApi().getWeeks().length;
|
|
2287
2310
|
}
|
|
@@ -2323,7 +2346,7 @@ class Un extends J {
|
|
|
2323
2346
|
return { left: u, right: p };
|
|
2324
2347
|
}
|
|
2325
2348
|
}
|
|
2326
|
-
class
|
|
2349
|
+
class Gn extends J {
|
|
2327
2350
|
getTotalSlots() {
|
|
2328
2351
|
return this.getTimelineApi().getYears().length;
|
|
2329
2352
|
}
|
|
@@ -2361,30 +2384,30 @@ class jn extends J {
|
|
|
2361
2384
|
)) }) });
|
|
2362
2385
|
}
|
|
2363
2386
|
calculatePosition(e, n, s) {
|
|
2364
|
-
const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / d, u = m * f, h = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, S = c.endOf("year").diff(c, "day"),
|
|
2387
|
+
const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / d, u = m * f, h = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, S = c.endOf("year").diff(c, "day"), M = o / p, g = S * M, y = (i.getYearPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
|
|
2365
2388
|
return { left: A, right: v };
|
|
2366
2389
|
}
|
|
2367
2390
|
}
|
|
2368
|
-
class
|
|
2391
|
+
class Xn {
|
|
2369
2392
|
schedulantApi;
|
|
2370
2393
|
timelineView;
|
|
2371
2394
|
schedulantElRef;
|
|
2372
2395
|
constructor(e, n) {
|
|
2373
2396
|
switch (this.schedulantElRef = n, this.schedulantApi = new ln(this, e), this.schedulantApi.getSchedulantViewType()) {
|
|
2374
2397
|
case "Day":
|
|
2375
|
-
this.timelineView = new
|
|
2398
|
+
this.timelineView = new qn(this.schedulantApi);
|
|
2376
2399
|
break;
|
|
2377
2400
|
case "Week":
|
|
2378
|
-
this.timelineView = new
|
|
2401
|
+
this.timelineView = new $n(this.schedulantApi);
|
|
2379
2402
|
break;
|
|
2380
2403
|
case "Month":
|
|
2381
|
-
this.timelineView = new
|
|
2404
|
+
this.timelineView = new Un(this.schedulantApi);
|
|
2382
2405
|
break;
|
|
2383
2406
|
case "Quarter":
|
|
2384
|
-
this.timelineView = new
|
|
2407
|
+
this.timelineView = new jn(this.schedulantApi);
|
|
2385
2408
|
break;
|
|
2386
2409
|
case "Year":
|
|
2387
|
-
this.timelineView = new
|
|
2410
|
+
this.timelineView = new Gn(this.schedulantApi);
|
|
2388
2411
|
break;
|
|
2389
2412
|
}
|
|
2390
2413
|
}
|
|
@@ -2405,7 +2428,7 @@ class $n {
|
|
|
2405
2428
|
{
|
|
2406
2429
|
"data-resource-id": c.getId(),
|
|
2407
2430
|
className: "schedulant-timeline-lane schedulant-resource",
|
|
2408
|
-
children: /* @__PURE__ */
|
|
2431
|
+
children: /* @__PURE__ */ I("div", { className: "schedulant-timeline-lane-frame", style: { height: d }, children: [
|
|
2409
2432
|
this.timelineView.renderLane(),
|
|
2410
2433
|
/* @__PURE__ */ a("div", { className: "schedulant-timeline-lane-bg" }),
|
|
2411
2434
|
this.timelineView.renderEvents(c, i),
|
|
@@ -2415,7 +2438,7 @@ class $n {
|
|
|
2415
2438
|
}
|
|
2416
2439
|
) }, c.getId());
|
|
2417
2440
|
}, o = n.length > 0 ? n[0].start : 0, l = n.length > 0 ? s - n[n.length - 1].end : 0;
|
|
2418
|
-
return /* @__PURE__ */
|
|
2441
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2419
2442
|
o > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { style: { height: o, padding: 0, border: "none" } }) }),
|
|
2420
2443
|
n.map((c) => {
|
|
2421
2444
|
const d = e[c.index];
|
|
@@ -2426,7 +2449,7 @@ class $n {
|
|
|
2426
2449
|
}
|
|
2427
2450
|
renderResourceTableColgroup() {
|
|
2428
2451
|
const e = this.schedulantApi.getResourceAreaColumns();
|
|
2429
|
-
return /* @__PURE__ */ a(
|
|
2452
|
+
return /* @__PURE__ */ a(yn, { resourceAreaColumns: e });
|
|
2430
2453
|
}
|
|
2431
2454
|
renderResourceLabel(e, n) {
|
|
2432
2455
|
const s = this.schedulantApi.getResourceAreaColumns();
|
|
@@ -2451,7 +2474,7 @@ class $n {
|
|
|
2451
2474
|
dropPosition: l.dragState.dropPosition
|
|
2452
2475
|
} : {};
|
|
2453
2476
|
return /* @__PURE__ */ a(
|
|
2454
|
-
|
|
2477
|
+
pn,
|
|
2455
2478
|
{
|
|
2456
2479
|
schedulantApi: this.schedulantApi,
|
|
2457
2480
|
resourceApi: u,
|
|
@@ -2467,7 +2490,7 @@ class $n {
|
|
|
2467
2490
|
h.field
|
|
2468
2491
|
);
|
|
2469
2492
|
}), m = n.length > 0 ? n[0].start : 0, f = n.length > 0 ? s - n[n.length - 1].end : 0;
|
|
2470
|
-
return /* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ I("tbody", { children: [
|
|
2471
2494
|
m > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: m, padding: 0, border: "none" } }) }),
|
|
2472
2495
|
n.map((u) => {
|
|
2473
2496
|
const h = e[u.index];
|
|
@@ -2486,21 +2509,21 @@ class $n {
|
|
|
2486
2509
|
return this.schedulantElRef;
|
|
2487
2510
|
}
|
|
2488
2511
|
}
|
|
2489
|
-
const
|
|
2512
|
+
const Qn = (t) => {
|
|
2490
2513
|
const { schedulantView: e, cellResizerMouseUp: n, cellResizerMouseDownFunc: s } = t;
|
|
2491
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ I("table", { role: "presentation", className: "schedulant-datagrid-head schedulant-scrollgrid-sync-table", children: [
|
|
2492
2515
|
e.renderResourceTableColgroup(),
|
|
2493
2516
|
e.renderResourceLabel(n, s)
|
|
2494
2517
|
] });
|
|
2495
|
-
},
|
|
2518
|
+
}, Kn = (t) => /* @__PURE__ */ I("table", { "aria-hidden": !0, className: "schedulant-scrollgrid-sync-table", children: [
|
|
2496
2519
|
t.schedulantView.renderTimelineTableColgroup(),
|
|
2497
2520
|
t.schedulantView.renderTimelineHeaderTableSlots()
|
|
2498
2521
|
] });
|
|
2499
|
-
function
|
|
2522
|
+
function Zn(t, e) {
|
|
2500
2523
|
const n = t - e.top, s = e.height;
|
|
2501
2524
|
return n < s * Qt ? "before" : n > s * Kt ? "after" : "child";
|
|
2502
2525
|
}
|
|
2503
|
-
function
|
|
2526
|
+
function Jn(t, e) {
|
|
2504
2527
|
let n = e;
|
|
2505
2528
|
for (; n; ) {
|
|
2506
2529
|
if (n.getId() === t) return !0;
|
|
@@ -2509,7 +2532,7 @@ function Kn(t, e) {
|
|
|
2509
2532
|
}
|
|
2510
2533
|
return !1;
|
|
2511
2534
|
}
|
|
2512
|
-
const
|
|
2535
|
+
const es = (t, e) => {
|
|
2513
2536
|
const [n, s] = re({
|
|
2514
2537
|
activeId: null,
|
|
2515
2538
|
overId: null,
|
|
@@ -2519,7 +2542,7 @@ const Zn = (t, e) => {
|
|
|
2519
2542
|
);
|
|
2520
2543
|
o.current = new Map(t.map((f) => [f.getId(), f]));
|
|
2521
2544
|
const l = C((f) => {
|
|
2522
|
-
i.current = null, r.current = null, s({
|
|
2545
|
+
i.current = null, r.current = null, mn(String(f.active.id)), s({
|
|
2523
2546
|
activeId: f.active.id,
|
|
2524
2547
|
overId: null,
|
|
2525
2548
|
dropPosition: null
|
|
@@ -2531,11 +2554,11 @@ const Zn = (t, e) => {
|
|
|
2531
2554
|
return;
|
|
2532
2555
|
}
|
|
2533
2556
|
const S = o.current.get(String(h.id));
|
|
2534
|
-
if (!S ||
|
|
2557
|
+
if (!S || Jn(String(u.id), S)) {
|
|
2535
2558
|
r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
|
|
2536
2559
|
return;
|
|
2537
2560
|
}
|
|
2538
|
-
const
|
|
2561
|
+
const M = A.clientY + p.y, g = Zn(M, {
|
|
2539
2562
|
top: h.rect.top,
|
|
2540
2563
|
height: h.rect.height
|
|
2541
2564
|
});
|
|
@@ -2568,29 +2591,29 @@ const Zn = (t, e) => {
|
|
|
2568
2591
|
handleDragEnd: d,
|
|
2569
2592
|
handleDragCancel: m
|
|
2570
2593
|
};
|
|
2571
|
-
},
|
|
2594
|
+
}, ts = ({ transform: t, activatorEvent: e }) => e ? {
|
|
2572
2595
|
...t,
|
|
2573
2596
|
x: t.x + 20,
|
|
2574
2597
|
y: t.y + 20
|
|
2575
|
-
} : t,
|
|
2576
|
-
const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (
|
|
2577
|
-
const P = c.find((z) => z.getId() === T),
|
|
2578
|
-
if (P &&
|
|
2598
|
+
} : t, ns = (t) => {
|
|
2599
|
+
const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (b, T, D, O) => {
|
|
2600
|
+
const P = c.find((z) => z.getId() === T), Y = c.find((z) => z.getId() === D);
|
|
2601
|
+
if (P && Y) {
|
|
2579
2602
|
const z = P.getParent();
|
|
2580
2603
|
l.resourceLaneMove({
|
|
2581
|
-
el:
|
|
2604
|
+
el: b,
|
|
2582
2605
|
schedulantApi: l,
|
|
2583
2606
|
draggedResourceApi: P,
|
|
2584
|
-
targetResourceApi:
|
|
2585
|
-
position:
|
|
2607
|
+
targetResourceApi: Y,
|
|
2608
|
+
position: O,
|
|
2586
2609
|
oldParentResourceApi: z.isDefined() ? z.get() : void 0
|
|
2587
2610
|
});
|
|
2588
2611
|
}
|
|
2589
|
-
}, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: u, handleDragEnd: h, handleDragCancel: A } =
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
), S = s.map((
|
|
2593
|
-
return /* @__PURE__ */
|
|
2612
|
+
}, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: u, handleDragEnd: h, handleDragCancel: A } = es(c, d), p = _t(
|
|
2613
|
+
We(Wt, { activationConstraint: { delay: 300, tolerance: 5 } }),
|
|
2614
|
+
We(Ht)
|
|
2615
|
+
), S = s.map((b) => b.getId()), M = l.isEditable(), g = n.getVirtualItems(), y = n.getTotalSize(), v = F(() => m.activeId ? c.find((b) => b.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
|
|
2616
|
+
return /* @__PURE__ */ I(
|
|
2594
2617
|
zt,
|
|
2595
2618
|
{
|
|
2596
2619
|
sensors: p,
|
|
@@ -2601,7 +2624,7 @@ const Zn = (t, e) => {
|
|
|
2601
2624
|
onDragEnd: h,
|
|
2602
2625
|
onDragCancel: A,
|
|
2603
2626
|
children: [
|
|
2604
|
-
/* @__PURE__ */ a(Nt, { items: S, strategy: Yt, children: /* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ a(Nt, { items: S, strategy: Yt, children: /* @__PURE__ */ I(
|
|
2605
2628
|
"table",
|
|
2606
2629
|
{
|
|
2607
2630
|
role: "presentation",
|
|
@@ -2610,20 +2633,20 @@ const Zn = (t, e) => {
|
|
|
2610
2633
|
children: [
|
|
2611
2634
|
e.renderResourceTableColgroup(),
|
|
2612
2635
|
e.renderResourceLane(s, g, y, i, r, o, {
|
|
2613
|
-
isDraggable:
|
|
2636
|
+
isDraggable: M,
|
|
2614
2637
|
dragState: m
|
|
2615
2638
|
})
|
|
2616
2639
|
]
|
|
2617
2640
|
}
|
|
2618
2641
|
) }),
|
|
2619
|
-
/* @__PURE__ */ a(Ft, { dropAnimation: null, modifiers: [
|
|
2642
|
+
/* @__PURE__ */ a(Ft, { dropAnimation: null, modifiers: [ts], children: v ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: v.getTitle() }) : null })
|
|
2620
2643
|
]
|
|
2621
2644
|
}
|
|
2622
2645
|
);
|
|
2623
|
-
},
|
|
2646
|
+
}, ss = (t) => /* @__PURE__ */ a("div", { id: "schedulant-timeline-slots", className: "schedulant-timeline-slots", children: /* @__PURE__ */ I("table", { "aria-hidden": !0, children: [
|
|
2624
2647
|
t.schedulantView.renderTimelineTableColgroup(),
|
|
2625
2648
|
t.schedulantView.renderTimelineBodyTableSlots()
|
|
2626
|
-
] }) }),
|
|
2649
|
+
] }) }), is = () => {
|
|
2627
2650
|
const t = C(() => {
|
|
2628
2651
|
const l = document.getElementsByClassName("schedulant-timeline-head").item(0).getElementsByTagName("table").item(0)?.offsetWidth;
|
|
2629
2652
|
return l || 0;
|
|
@@ -2649,8 +2672,8 @@ const Zn = (t, e) => {
|
|
|
2649
2672
|
window.removeEventListener("resize", r), c?.disconnect();
|
|
2650
2673
|
};
|
|
2651
2674
|
}, [t, s.resourceAreaWidth]), e;
|
|
2652
|
-
},
|
|
2653
|
-
const e =
|
|
2675
|
+
}, rs = (t) => {
|
|
2676
|
+
const e = is(), n = t.virtualizer.getVirtualItems(), s = t.virtualizer.getTotalSize();
|
|
2654
2677
|
return /* @__PURE__ */ a(
|
|
2655
2678
|
"table",
|
|
2656
2679
|
{
|
|
@@ -2660,8 +2683,8 @@ const Zn = (t, e) => {
|
|
|
2660
2683
|
children: t.schedulantView.renderTimelineDrawingBoardTable(t.visibleResources, n, s, e)
|
|
2661
2684
|
}
|
|
2662
2685
|
);
|
|
2663
|
-
},
|
|
2664
|
-
|
|
2686
|
+
}, os = (t, e) => {
|
|
2687
|
+
N(() => {
|
|
2665
2688
|
const n = t.current, s = e.getScheduleApi();
|
|
2666
2689
|
if (n)
|
|
2667
2690
|
return s.schedulantDidMount({
|
|
@@ -2687,13 +2710,13 @@ function $(t, e, n) {
|
|
|
2687
2710
|
s = f;
|
|
2688
2711
|
let h;
|
|
2689
2712
|
if (n.key && ((c = n.debug) != null && c.call(n)) && (h = Date.now()), i = e(...f), n.key && ((d = n.debug) != null && d.call(n))) {
|
|
2690
|
-
const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - h) * 100) / 100, S = p / 16,
|
|
2713
|
+
const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - h) * 100) / 100, S = p / 16, M = (g, y) => {
|
|
2691
2714
|
for (g = String(g); g.length < y; )
|
|
2692
2715
|
g = " " + g;
|
|
2693
2716
|
return g;
|
|
2694
2717
|
};
|
|
2695
2718
|
console.info(
|
|
2696
|
-
`%c⏱ ${
|
|
2719
|
+
`%c⏱ ${M(p, 5)} /${M(A, 5)} ms`,
|
|
2697
2720
|
`
|
|
2698
2721
|
font-size: .6rem;
|
|
2699
2722
|
font-weight: bold;
|
|
@@ -2710,25 +2733,25 @@ function $(t, e, n) {
|
|
|
2710
2733
|
s = l;
|
|
2711
2734
|
}, o;
|
|
2712
2735
|
}
|
|
2713
|
-
function
|
|
2736
|
+
function ot(t, e) {
|
|
2714
2737
|
if (t === void 0)
|
|
2715
2738
|
throw new Error("Unexpected undefined");
|
|
2716
2739
|
return t;
|
|
2717
2740
|
}
|
|
2718
|
-
const
|
|
2741
|
+
const ls = (t, e) => Math.abs(t - e) < 1.01, as = (t, e, n) => {
|
|
2719
2742
|
let s;
|
|
2720
2743
|
return function(...i) {
|
|
2721
2744
|
t.clearTimeout(s), s = t.setTimeout(() => e.apply(this, i), n);
|
|
2722
2745
|
};
|
|
2723
|
-
},
|
|
2746
|
+
}, lt = (t) => {
|
|
2724
2747
|
const { offsetWidth: e, offsetHeight: n } = t;
|
|
2725
2748
|
return { width: e, height: n };
|
|
2726
|
-
},
|
|
2749
|
+
}, cs = (t) => t, ds = (t) => {
|
|
2727
2750
|
const e = Math.max(t.startIndex - t.overscan, 0), n = Math.min(t.endIndex + t.overscan, t.count - 1), s = [];
|
|
2728
2751
|
for (let i = e; i <= n; i++)
|
|
2729
2752
|
s.push(i);
|
|
2730
2753
|
return s;
|
|
2731
|
-
},
|
|
2754
|
+
}, us = (t, e) => {
|
|
2732
2755
|
const n = t.scrollElement;
|
|
2733
2756
|
if (!n)
|
|
2734
2757
|
return;
|
|
@@ -2739,7 +2762,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2739
2762
|
const { width: l, height: c } = o;
|
|
2740
2763
|
e({ width: Math.round(l), height: Math.round(c) });
|
|
2741
2764
|
};
|
|
2742
|
-
if (i(
|
|
2765
|
+
if (i(lt(n)), !s.ResizeObserver)
|
|
2743
2766
|
return () => {
|
|
2744
2767
|
};
|
|
2745
2768
|
const r = new s.ResizeObserver((o) => {
|
|
@@ -2752,16 +2775,16 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2752
2775
|
return;
|
|
2753
2776
|
}
|
|
2754
2777
|
}
|
|
2755
|
-
i(
|
|
2778
|
+
i(lt(n));
|
|
2756
2779
|
};
|
|
2757
2780
|
t.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
2758
2781
|
});
|
|
2759
2782
|
return r.observe(n, { box: "border-box" }), () => {
|
|
2760
2783
|
r.unobserve(n);
|
|
2761
2784
|
};
|
|
2762
|
-
},
|
|
2785
|
+
}, at = {
|
|
2763
2786
|
passive: !0
|
|
2764
|
-
},
|
|
2787
|
+
}, ct = typeof window > "u" ? !0 : "onscrollend" in window, hs = (t, e) => {
|
|
2765
2788
|
const n = t.scrollElement;
|
|
2766
2789
|
if (!n)
|
|
2767
2790
|
return;
|
|
@@ -2769,8 +2792,8 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2769
2792
|
if (!s)
|
|
2770
2793
|
return;
|
|
2771
2794
|
let i = 0;
|
|
2772
|
-
const r = t.options.useScrollendEvent &&
|
|
2773
|
-
} :
|
|
2795
|
+
const r = t.options.useScrollendEvent && ct ? () => {
|
|
2796
|
+
} : as(
|
|
2774
2797
|
s,
|
|
2775
2798
|
() => {
|
|
2776
2799
|
e(i, !1);
|
|
@@ -2780,12 +2803,12 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2780
2803
|
const { horizontal: f, isRtl: u } = t.options;
|
|
2781
2804
|
i = f ? n.scrollLeft * (u && -1 || 1) : n.scrollTop, r(), e(i, m);
|
|
2782
2805
|
}, l = o(!0), c = o(!1);
|
|
2783
|
-
n.addEventListener("scroll", l,
|
|
2784
|
-
const d = t.options.useScrollendEvent &&
|
|
2785
|
-
return d && n.addEventListener("scrollend", c,
|
|
2806
|
+
n.addEventListener("scroll", l, at);
|
|
2807
|
+
const d = t.options.useScrollendEvent && ct;
|
|
2808
|
+
return d && n.addEventListener("scrollend", c, at), () => {
|
|
2786
2809
|
n.removeEventListener("scroll", l), d && n.removeEventListener("scrollend", c);
|
|
2787
2810
|
};
|
|
2788
|
-
},
|
|
2811
|
+
}, ms = (t, e, n) => {
|
|
2789
2812
|
if (e?.borderBoxSize) {
|
|
2790
2813
|
const s = e.borderBoxSize[0];
|
|
2791
2814
|
if (s)
|
|
@@ -2794,7 +2817,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2794
2817
|
);
|
|
2795
2818
|
}
|
|
2796
2819
|
return t[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
2797
|
-
},
|
|
2820
|
+
}, gs = (t, {
|
|
2798
2821
|
adjustments: e = 0,
|
|
2799
2822
|
behavior: n
|
|
2800
2823
|
}, s) => {
|
|
@@ -2805,7 +2828,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
|
|
|
2805
2828
|
behavior: n
|
|
2806
2829
|
});
|
|
2807
2830
|
};
|
|
2808
|
-
class
|
|
2831
|
+
class fs {
|
|
2809
2832
|
constructor(e) {
|
|
2810
2833
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
2811
2834
|
var n, s, i;
|
|
@@ -2846,11 +2869,11 @@ class ms {
|
|
|
2846
2869
|
scrollPaddingStart: 0,
|
|
2847
2870
|
scrollPaddingEnd: 0,
|
|
2848
2871
|
horizontal: !1,
|
|
2849
|
-
getItemKey:
|
|
2850
|
-
rangeExtractor:
|
|
2872
|
+
getItemKey: cs,
|
|
2873
|
+
rangeExtractor: ds,
|
|
2851
2874
|
onChange: () => {
|
|
2852
2875
|
},
|
|
2853
|
-
measureElement:
|
|
2876
|
+
measureElement: ms,
|
|
2854
2877
|
initialRect: { width: 0, height: 0 },
|
|
2855
2878
|
scrollMargin: 0,
|
|
2856
2879
|
gap: 0,
|
|
@@ -2970,13 +2993,13 @@ class ms {
|
|
|
2970
2993
|
let p, S;
|
|
2971
2994
|
if (A !== void 0 && this.options.lanes > 1) {
|
|
2972
2995
|
p = A;
|
|
2973
|
-
const v = f[p],
|
|
2974
|
-
S =
|
|
2996
|
+
const v = f[p], b = v !== void 0 ? m[v] : void 0;
|
|
2997
|
+
S = b ? b.end + this.options.gap : s + i;
|
|
2975
2998
|
} else {
|
|
2976
2999
|
const v = this.options.lanes === 1 ? m[u - 1] : this.getFurthestMeasurement(m, u);
|
|
2977
3000
|
S = v ? v.end + this.options.gap : s + i, p = v ? v.lane : u % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(u, p);
|
|
2978
3001
|
}
|
|
2979
|
-
const
|
|
3002
|
+
const M = c.get(h), g = typeof M == "number" ? M : this.options.estimateSize(u), y = S + g;
|
|
2980
3003
|
m[u] = {
|
|
2981
3004
|
index: u,
|
|
2982
3005
|
start: S,
|
|
@@ -2999,7 +3022,7 @@ class ms {
|
|
|
2999
3022
|
this.getScrollOffset(),
|
|
3000
3023
|
this.options.lanes
|
|
3001
3024
|
],
|
|
3002
|
-
(n, s, i, r) => this.range = n.length > 0 && s > 0 ?
|
|
3025
|
+
(n, s, i, r) => this.range = n.length > 0 && s > 0 ? ps({
|
|
3003
3026
|
measurements: n,
|
|
3004
3027
|
outerSize: s,
|
|
3005
3028
|
scrollOffset: i,
|
|
@@ -3097,11 +3120,11 @@ class ms {
|
|
|
3097
3120
|
), this.getVirtualItemForOffset = (n) => {
|
|
3098
3121
|
const s = this.getMeasurements();
|
|
3099
3122
|
if (s.length !== 0)
|
|
3100
|
-
return
|
|
3123
|
+
return ot(
|
|
3101
3124
|
s[At(
|
|
3102
3125
|
0,
|
|
3103
3126
|
s.length - 1,
|
|
3104
|
-
(i) =>
|
|
3127
|
+
(i) => ot(s[i]).start,
|
|
3105
3128
|
n
|
|
3106
3129
|
)]
|
|
3107
3130
|
);
|
|
@@ -3220,7 +3243,7 @@ class ms {
|
|
|
3220
3243
|
return;
|
|
3221
3244
|
}
|
|
3222
3245
|
const s = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = s ? s[0] : this.scrollState.lastTargetOffset, r = 1, o = i !== this.scrollState.lastTargetOffset;
|
|
3223
|
-
if (!o &&
|
|
3246
|
+
if (!o && ls(i, this.getScrollOffset())) {
|
|
3224
3247
|
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= r) {
|
|
3225
3248
|
this.scrollState = null;
|
|
3226
3249
|
return;
|
|
@@ -3245,7 +3268,7 @@ const At = (t, e, n, s) => {
|
|
|
3245
3268
|
}
|
|
3246
3269
|
return t > 0 ? t - 1 : 0;
|
|
3247
3270
|
};
|
|
3248
|
-
function
|
|
3271
|
+
function ps({
|
|
3249
3272
|
measurements: t,
|
|
3250
3273
|
outerSize: e,
|
|
3251
3274
|
scrollOffset: n,
|
|
@@ -3281,8 +3304,8 @@ function gs({
|
|
|
3281
3304
|
}
|
|
3282
3305
|
return { startIndex: o, endIndex: l };
|
|
3283
3306
|
}
|
|
3284
|
-
const
|
|
3285
|
-
function
|
|
3307
|
+
const dt = typeof document < "u" ? ie.useLayoutEffect : ie.useEffect;
|
|
3308
|
+
function ys({
|
|
3286
3309
|
useFlushSync: t = !0,
|
|
3287
3310
|
...e
|
|
3288
3311
|
}) {
|
|
@@ -3293,41 +3316,41 @@ function fs({
|
|
|
3293
3316
|
t && o ? qt(n) : n(), (l = e.onChange) == null || l.call(e, r, o);
|
|
3294
3317
|
}
|
|
3295
3318
|
}, [i] = ie.useState(
|
|
3296
|
-
() => new
|
|
3319
|
+
() => new fs(s)
|
|
3297
3320
|
);
|
|
3298
|
-
return i.setOptions(s),
|
|
3321
|
+
return i.setOptions(s), dt(() => i._didMount(), []), dt(() => i._willUpdate()), i;
|
|
3299
3322
|
}
|
|
3300
|
-
function
|
|
3301
|
-
return
|
|
3302
|
-
observeElementRect:
|
|
3303
|
-
observeElementOffset:
|
|
3304
|
-
scrollToFn:
|
|
3323
|
+
function vs(t) {
|
|
3324
|
+
return ys({
|
|
3325
|
+
observeElementRect: us,
|
|
3326
|
+
observeElementOffset: hs,
|
|
3327
|
+
scrollToFn: gs,
|
|
3305
3328
|
...t
|
|
3306
3329
|
});
|
|
3307
3330
|
}
|
|
3308
|
-
function
|
|
3331
|
+
function Ss(t, e) {
|
|
3309
3332
|
const n = [], s = (i) => {
|
|
3310
3333
|
n.push(i), !e.some((o) => o === i.getId()) && i.getChildren().length > 0 && i.getChildren().forEach((o) => s(o));
|
|
3311
3334
|
};
|
|
3312
3335
|
return t.forEach((i) => s(i)), n;
|
|
3313
3336
|
}
|
|
3314
|
-
const
|
|
3337
|
+
const As = (t, e, n, s, i, r) => {
|
|
3315
3338
|
const o = F(
|
|
3316
|
-
() =>
|
|
3339
|
+
() => Ss(e, n),
|
|
3317
3340
|
[e, n]
|
|
3318
3341
|
), l = C((d) => {
|
|
3319
3342
|
const m = o[d];
|
|
3320
3343
|
return m && m.getMilestoneApis().some(
|
|
3321
3344
|
(u) => !u.getTime().isBefore(i) && !u.getTime().isAfter(r)
|
|
3322
|
-
) ? s *
|
|
3345
|
+
) ? s * mt : s;
|
|
3323
3346
|
}, [o, s, i, r]);
|
|
3324
|
-
return { virtualizer:
|
|
3347
|
+
return { virtualizer: vs({
|
|
3325
3348
|
count: o.length,
|
|
3326
3349
|
getScrollElement: () => t.current,
|
|
3327
3350
|
estimateSize: l,
|
|
3328
3351
|
overscan: 5
|
|
3329
3352
|
}), visibleResources: o };
|
|
3330
|
-
},
|
|
3353
|
+
}, Ys = (t) => /* @__PURE__ */ a($t, { children: /* @__PURE__ */ a(Ms, { ...t }) }), Ms = (t) => {
|
|
3331
3354
|
const { state: e, dispatch: n } = De(), s = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
|
|
3332
3355
|
start: d,
|
|
3333
3356
|
end: m,
|
|
@@ -3337,19 +3360,19 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3337
3360
|
slotMinWidth: A,
|
|
3338
3361
|
schedulantMaxHeight: p,
|
|
3339
3362
|
schedulantViewType: S,
|
|
3340
|
-
events:
|
|
3363
|
+
events: M,
|
|
3341
3364
|
resources: g,
|
|
3342
3365
|
milestones: y,
|
|
3343
3366
|
checkpoints: v,
|
|
3344
|
-
resourceAreaColumns:
|
|
3367
|
+
resourceAreaColumns: b,
|
|
3345
3368
|
resourceAreaWidth: T,
|
|
3346
3369
|
companyHolidays: D,
|
|
3347
|
-
specialWorkdays:
|
|
3370
|
+
specialWorkdays: O,
|
|
3348
3371
|
nationalHolidays: P,
|
|
3349
|
-
dragHintColor:
|
|
3372
|
+
dragHintColor: Y,
|
|
3350
3373
|
selectionColor: z
|
|
3351
3374
|
} = t, _ = F(
|
|
3352
|
-
() => new
|
|
3375
|
+
() => new Xn(t, s),
|
|
3353
3376
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3354
3377
|
[
|
|
3355
3378
|
d,
|
|
@@ -3360,16 +3383,16 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3360
3383
|
A,
|
|
3361
3384
|
p,
|
|
3362
3385
|
S,
|
|
3363
|
-
|
|
3386
|
+
M,
|
|
3364
3387
|
g,
|
|
3365
3388
|
y,
|
|
3366
3389
|
v,
|
|
3367
|
-
|
|
3390
|
+
b,
|
|
3368
3391
|
T,
|
|
3369
3392
|
D,
|
|
3370
|
-
|
|
3393
|
+
O,
|
|
3371
3394
|
P,
|
|
3372
|
-
|
|
3395
|
+
Y,
|
|
3373
3396
|
z
|
|
3374
3397
|
]
|
|
3375
3398
|
), R = F(() => _.getScheduleApi(), [_]);
|
|
@@ -3379,51 +3402,51 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3379
3402
|
"--schedulant-selection-color": R.getSelectionColor()
|
|
3380
3403
|
}), [R]), {
|
|
3381
3404
|
datagridResizerMouseUp: q,
|
|
3382
|
-
datagridResizerMouseDown:
|
|
3383
|
-
datagridCellResizerMouseUp:
|
|
3384
|
-
datagridCellResizerMouseDownFunc:
|
|
3385
|
-
} = cn(n, s, c),
|
|
3405
|
+
datagridResizerMouseDown: Q,
|
|
3406
|
+
datagridCellResizerMouseUp: Ie,
|
|
3407
|
+
datagridCellResizerMouseDownFunc: Oe
|
|
3408
|
+
} = cn(n, s, c), Pe = R.getTimelineApi(), { virtualizer: Le, visibleResources: ne } = As(
|
|
3386
3409
|
o,
|
|
3387
3410
|
R.getResourceApis(),
|
|
3388
3411
|
e.collapseIds,
|
|
3389
3412
|
R.getLineHeight(),
|
|
3390
|
-
|
|
3391
|
-
|
|
3413
|
+
Pe.getStart(),
|
|
3414
|
+
Pe.getEnd()
|
|
3392
3415
|
);
|
|
3393
|
-
Jt(t.schedulantMaxHeight),
|
|
3416
|
+
Jt(t.schedulantMaxHeight), os(s, _), tn(c, t.resourceAreaWidth), en(l, o, i, r);
|
|
3394
3417
|
const ce = k(R.onResourceSelect());
|
|
3395
3418
|
ce.current = R.onResourceSelect();
|
|
3396
|
-
const
|
|
3419
|
+
const Ne = C((U) => {
|
|
3397
3420
|
ce.current?.(U);
|
|
3398
|
-
}, []),
|
|
3421
|
+
}, []), Ye = F(
|
|
3399
3422
|
() => ne.map((U) => U.getId()),
|
|
3400
3423
|
[ne]
|
|
3401
|
-
),
|
|
3402
|
-
R.isSelectable() &&
|
|
3403
|
-
}, [R,
|
|
3404
|
-
return
|
|
3405
|
-
const U = (
|
|
3406
|
-
s.current && !s.current.contains(
|
|
3424
|
+
), _e = C((U) => {
|
|
3425
|
+
R.isSelectable() && gn(U.nativeEvent, Ye, Ne);
|
|
3426
|
+
}, [R, Ye, Ne]);
|
|
3427
|
+
return N(() => {
|
|
3428
|
+
const U = (Mt) => {
|
|
3429
|
+
s.current && !s.current.contains(Mt.target) && Te(ce.current);
|
|
3407
3430
|
};
|
|
3408
3431
|
return document.addEventListener("click", U), () => document.removeEventListener("click", U);
|
|
3409
|
-
}, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick:
|
|
3410
|
-
/* @__PURE__ */
|
|
3432
|
+
}, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick: _e, onContextMenu: _e, style: V, children: /* @__PURE__ */ a("div", { id: "schedulant-view-harness", className: "schedulant-view-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-view", children: /* @__PURE__ */ I("table", { role: "grid", className: "schedulant-scrollgrid", children: [
|
|
3433
|
+
/* @__PURE__ */ I("colgroup", { children: [
|
|
3411
3434
|
/* @__PURE__ */ a("col", { style: { width: e.resourceAreaWidth }, ref: c }),
|
|
3412
3435
|
/* @__PURE__ */ a("col", {}),
|
|
3413
3436
|
/* @__PURE__ */ a("col", {})
|
|
3414
3437
|
] }),
|
|
3415
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ I(
|
|
3416
3439
|
"tr",
|
|
3417
3440
|
{
|
|
3418
3441
|
role: "presentation",
|
|
3419
3442
|
className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-head",
|
|
3420
3443
|
children: [
|
|
3421
3444
|
/* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-left", ref: i, children: /* @__PURE__ */ a(
|
|
3422
|
-
|
|
3445
|
+
Qn,
|
|
3423
3446
|
{
|
|
3424
3447
|
schedulantView: _,
|
|
3425
|
-
cellResizerMouseUp:
|
|
3426
|
-
cellResizerMouseDownFunc:
|
|
3448
|
+
cellResizerMouseUp: Ie,
|
|
3449
|
+
cellResizerMouseDownFunc: Oe
|
|
3427
3450
|
}
|
|
3428
3451
|
) }) }) }),
|
|
3429
3452
|
/* @__PURE__ */ a(
|
|
@@ -3432,7 +3455,7 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3432
3455
|
role: "presentation",
|
|
3433
3456
|
className: "schedulant-resource-timeline-divider",
|
|
3434
3457
|
onMouseUp: q,
|
|
3435
|
-
onMouseDown:
|
|
3458
|
+
onMouseDown: Q
|
|
3436
3459
|
}
|
|
3437
3460
|
),
|
|
3438
3461
|
/* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-right", ref: r, children: /* @__PURE__ */ a(
|
|
@@ -3440,27 +3463,27 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3440
3463
|
{
|
|
3441
3464
|
id: "schedulant-timeline-head",
|
|
3442
3465
|
className: "schedulant-timeline-head",
|
|
3443
|
-
children: /* @__PURE__ */ a(
|
|
3466
|
+
children: /* @__PURE__ */ a(Kn, { schedulantView: _ })
|
|
3444
3467
|
}
|
|
3445
3468
|
) }) }) })
|
|
3446
3469
|
]
|
|
3447
3470
|
}
|
|
3448
3471
|
) }),
|
|
3449
|
-
/* @__PURE__ */ a("tbody", { children: /* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ I(
|
|
3450
3473
|
"tr",
|
|
3451
3474
|
{
|
|
3452
3475
|
role: "presentation",
|
|
3453
3476
|
className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-body",
|
|
3454
3477
|
children: [
|
|
3455
3478
|
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-left", ref: l, children: /* @__PURE__ */ a(
|
|
3456
|
-
|
|
3479
|
+
ns,
|
|
3457
3480
|
{
|
|
3458
3481
|
schedulantView: _,
|
|
3459
|
-
virtualizer:
|
|
3482
|
+
virtualizer: Le,
|
|
3460
3483
|
visibleResources: ne,
|
|
3461
3484
|
collapseIds: e.collapseIds,
|
|
3462
|
-
cellResizerMouseUp:
|
|
3463
|
-
cellResizerMouseDownFunc:
|
|
3485
|
+
cellResizerMouseUp: Ie,
|
|
3486
|
+
cellResizerMouseDownFunc: Oe
|
|
3464
3487
|
}
|
|
3465
3488
|
) }) }) }),
|
|
3466
3489
|
/* @__PURE__ */ a(
|
|
@@ -3469,16 +3492,16 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3469
3492
|
role: "presentation",
|
|
3470
3493
|
className: "schedulant-resource-timeline-divider",
|
|
3471
3494
|
onMouseUp: q,
|
|
3472
|
-
onMouseDown:
|
|
3495
|
+
onMouseDown: Q
|
|
3473
3496
|
}
|
|
3474
3497
|
),
|
|
3475
|
-
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-right", ref: o, children: /* @__PURE__ */
|
|
3476
|
-
/* @__PURE__ */ a(
|
|
3498
|
+
/* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-right", ref: o, children: /* @__PURE__ */ I("div", { className: "schedulant-timeline-body", children: [
|
|
3499
|
+
/* @__PURE__ */ a(ss, { schedulantView: _ }),
|
|
3477
3500
|
/* @__PURE__ */ a(
|
|
3478
|
-
|
|
3501
|
+
rs,
|
|
3479
3502
|
{
|
|
3480
3503
|
schedulantView: _,
|
|
3481
|
-
virtualizer:
|
|
3504
|
+
virtualizer: Le,
|
|
3482
3505
|
visibleResources: ne
|
|
3483
3506
|
}
|
|
3484
3507
|
)
|
|
@@ -3489,5 +3512,5 @@ const vs = (t, e, n, s, i, r) => {
|
|
|
3489
3512
|
] }) }) }) });
|
|
3490
3513
|
};
|
|
3491
3514
|
export {
|
|
3492
|
-
|
|
3515
|
+
Ys as Schedulant
|
|
3493
3516
|
};
|