schedulant 2.0.9-fixed.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/schedulant.js +143 -152
  2. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { jsx as a, Fragment as At, jsxs as O } from "react/jsx-runtime";
2
2
  import * as ie from "react";
3
- import { createContext as bt, useReducer as Mt, useEffect as N, useContext as wt, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Et } from "react";
3
+ import { createContext as Mt, useReducer as bt, useEffect as N, useContext as wt, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Et } from "react";
4
4
  import E from "dayjs";
5
5
  import Ct from "dayjs/plugin/weekYear";
6
6
  import Dt from "dayjs/plugin/weekOfYear";
@@ -10,7 +10,7 @@ import { Dropdown as Z, Space as kt } from "antd";
10
10
  import X from "@ant-design/icons/lib/components/Icon";
11
11
  import { PlusSquareOutlined as xt, MinusSquareOutlined as Ot } from "@ant-design/icons";
12
12
  import { useSortable as It, SortableContext as Pt, verticalListSortingStrategy as Lt } from "@dnd-kit/sortable";
13
- import { useSensors as Nt, useSensor as _e, PointerSensor as Yt, KeyboardSensor as _t, DndContext as Wt, closestCenter as Ht, DragOverlay as zt } from "@dnd-kit/core";
13
+ import { useSensors as Nt, useSensor as _e, PointerSensor as Yt, KeyboardSensor as _t, DndContext as Wt, closestCenter as zt, DragOverlay as Ht } from "@dnd-kit/core";
14
14
  import { restrictToVerticalAxis as Vt } from "@dnd-kit/modifiers";
15
15
  import { flushSync as Ft } from "react-dom";
16
16
  const de = {
@@ -49,8 +49,8 @@ const de = {
49
49
  default:
50
50
  return t;
51
51
  }
52
- }, ut = bt(void 0), Ut = ({ children: t }) => {
53
- const [e, n] = Mt(qt, void 0, Bt);
52
+ }, ut = Mt(void 0), Ut = ({ children: t }) => {
53
+ const [e, n] = bt(qt, void 0, Bt);
54
54
  return N(() => {
55
55
  localStorage.setItem(dt, JSON.stringify(e));
56
56
  }, [e]), /* @__PURE__ */ a(ut.Provider, { value: { state: e, dispatch: n }, children: t });
@@ -59,12 +59,12 @@ const de = {
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$/, "")), We = (t) => document.querySelector(`.${t}`), jt = 0.7, W = 10, ht = 16, He = 13, $t = 0.3, ze = 0.8, Gt = 0.25, Xt = 0.75, Qt = 100, Kt = (t) => {
62
+ }, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), We = (t) => document.querySelector(`.${t}`), jt = 0.7, W = 10, ht = 16, ze = 13, $t = 0.3, He = 0.8, Gt = 0.25, Xt = 0.75, Qt = 100, Kt = (t) => {
63
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 + He, l = t - o > 0 ? o : t;
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, g = s ? s.getBoundingClientRect().height : 0, h = m + g + He, u = t - h > 0 ? h : t;
67
+ const m = n ? n.getBoundingClientRect().height : 0, g = s ? s.getBoundingClientRect().height : 0, h = m + g + ze, u = t - h > 0 ? h : t;
68
68
  e && (e.style.height = w(u));
69
69
  }, d = new ResizeObserver(() => {
70
70
  c();
@@ -296,15 +296,15 @@ class le {
296
296
  const u = g.pop();
297
297
  if (u) {
298
298
  const { parentId: A, depth: p } = u, v = h.get(A);
299
- v && v.sort(le.compare).forEach((b) => {
300
- const f = b.getId();
301
- b.setDepth(p), b.setParent(c.get(A)), b.setChildren(h.get(f) || []);
299
+ v && v.sort(le.compare).forEach((M) => {
300
+ const f = M.getId();
301
+ M.setDepth(p), M.setParent(c.get(A)), M.setChildren(h.get(f) || []);
302
302
  const y = l.get(f) || [];
303
- y.forEach((D) => D.setResourceApi(b)), b.setEventApis(y);
303
+ y.forEach((D) => D.setResourceApi(M)), M.setEventApis(y);
304
304
  const S = d.get(f) || [];
305
- S.forEach((D) => D.setResourceApi(b)), b.setMilestoneApis(S);
306
- const M = m.get(f) || [];
307
- M.forEach((D) => D.setResourceApi(b)), b.setCheckpointApis(M), g.push({ parentId: f, depth: p + 1 });
305
+ S.forEach((D) => D.setResourceApi(M)), M.setMilestoneApis(S);
306
+ const b = m.get(f) || [];
307
+ b.forEach((D) => D.setResourceApi(M)), M.setCheckpointApis(b), g.push({ parentId: f, depth: p + 1 });
308
308
  });
309
309
  }
310
310
  }
@@ -826,7 +826,7 @@ const on = (t, e, n) => {
826
826
  });
827
827
  };
828
828
  }, [t, e, n]);
829
- }, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(At, { children: t ? e : n }), ln = (t, e, n) => {
829
+ }, z = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(At, { children: t ? e : n }), ln = (t, e, n) => {
830
830
  const s = k(-1), i = C(() => We("schedulant-datagrid-head"), []), r = C(() => We("schedulant-datagrid-body"), []), o = C((h) => {
831
831
  h.preventDefault();
832
832
  const u = n.current;
@@ -844,10 +844,10 @@ const on = (t, e, n) => {
844
844
  u ? u.addEventListener("mousemove", o) : console.error("scheduleEl", u);
845
845
  }, [o, e]), d = C((h) => {
846
846
  h.preventDefault();
847
- const u = s.current, A = i(), p = r(), v = A.firstElementChild, b = p.firstElementChild, f = v?.children, y = b?.children;
847
+ const u = s.current, A = i(), p = r(), v = A.firstElementChild, M = p.firstElementChild, f = v?.children, y = M?.children;
848
848
  if (f && y) {
849
- const S = f[u], M = y[u], D = h.clientX - S.getBoundingClientRect().left, T = h.clientX - M.getBoundingClientRect().left;
850
- S.style.width = w(D), M.style.width = w(T);
849
+ const S = f[u], b = y[u], D = h.clientX - S.getBoundingClientRect().left, T = h.clientX - b.getBoundingClientRect().left;
850
+ S.style.width = w(D), b.style.width = w(T);
851
851
  }
852
852
  }, [r, i, s]), m = C((h) => {
853
853
  h.preventDefault(), s.current = -1;
@@ -861,8 +861,8 @@ const on = (t, e, n) => {
861
861
  v.length === 0 && (v = p.getElementsByTagName("th"));
862
862
  for (let y = 0; y < v.length; y++)
863
863
  v[y] === A && (s.current = y);
864
- const b = i(), f = r();
865
- b.addEventListener("mousemove", d), f.addEventListener("mousemove", d);
864
+ const M = i(), f = r();
865
+ M.addEventListener("mousemove", d), f.addEventListener("mousemove", d);
866
866
  } else
867
867
  console.error("trElement", p);
868
868
  }, [i, r, d, s]);
@@ -900,7 +900,7 @@ const on = (t, e, n) => {
900
900
  children: t.resourceAreaColumn.headerContent
901
901
  }
902
902
  ) }),
903
- /* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a(
903
+ /* @__PURE__ */ a(z, { condition: t.isResizable, children: /* @__PURE__ */ a(
904
904
  "div",
905
905
  {
906
906
  className: "schedulant-datagrid-cell-resizer",
@@ -1020,13 +1020,13 @@ function mn(t, e, n) {
1020
1020
  }
1021
1021
  const gn = (t) => {
1022
1022
  const { dispatch: e } = Te(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, S) => {
1023
- const M = S.getResource();
1024
- if (Object.keys(M).includes(y)) {
1025
- const I = M[y];
1023
+ const b = S.getResource();
1024
+ if (Object.keys(b).includes(y)) {
1025
+ const I = b[y];
1026
1026
  if (typeof I == "string")
1027
1027
  return I;
1028
1028
  } else {
1029
- const I = M.extendedProps?.[y];
1029
+ const I = b.extendedProps?.[y];
1030
1030
  if (typeof I == "string" || typeof I == "number")
1031
1031
  return I;
1032
1032
  }
@@ -1040,8 +1040,8 @@ const gn = (t) => {
1040
1040
  }), h = t.overId === o && t.activeId !== o, u = () => {
1041
1041
  const y = ["schedulant-datagrid-cell", "schedulant-resource"];
1042
1042
  return mt().has(o) && y.push("schedulant-resource-selected"), t.isDraggable && g && y.push("schedulant-resource-dragging"), t.isDraggable && h && t.dropPosition && y.push(`schedulant-resource-drop-${t.dropPosition}`), y.join(" ");
1043
- }, [A, p] = re(!1), [v, b] = re({}), f = C((y) => {
1044
- y && b(mn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
1043
+ }, [A, p] = re(!1), [v, M] = re({}), f = C((y) => {
1044
+ y && M(mn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
1045
1045
  }, [t.schedulantApi, t.resourceApi, t.resourceAreaColumn]);
1046
1046
  return /* @__PURE__ */ a(
1047
1047
  "td",
@@ -1098,7 +1098,7 @@ const gn = (t) => {
1098
1098
  t.showPlusSquare && t.resourceApi.getMilestoneApis().length > 0 && /* @__PURE__ */ a("span", { className: "schedulant-milestone-indicator", children: /* @__PURE__ */ a(dn, { width: 14, height: 14, color: "#91003c" }) })
1099
1099
  ] })
1100
1100
  ] }) }),
1101
- /* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
1101
+ /* @__PURE__ */ a(z, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
1102
1102
  ]
1103
1103
  }
1104
1104
  )
@@ -1180,7 +1180,7 @@ function An() {
1180
1180
  return fe = e, fe;
1181
1181
  }
1182
1182
  var pe, je;
1183
- function bn() {
1183
+ function Mn() {
1184
1184
  if (je) return pe;
1185
1185
  je = 1;
1186
1186
  var t = An(), e = /^\s+/;
@@ -1197,7 +1197,7 @@ function ft() {
1197
1197
  return ye = e, ye;
1198
1198
  }
1199
1199
  var ve, Ge;
1200
- function Mn() {
1200
+ function bn() {
1201
1201
  if (Ge) return ve;
1202
1202
  Ge = 1;
1203
1203
  var t = ft(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
@@ -1227,36 +1227,36 @@ var Ae, Qe;
1227
1227
  function En() {
1228
1228
  if (Qe) return Ae;
1229
1229
  Qe = 1;
1230
- var t = ft(), e = Mn(), n = wn(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
1230
+ var t = ft(), e = bn(), n = wn(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
1231
1231
  function o(l) {
1232
1232
  return l == null ? l === void 0 ? i : s : r && r in Object(l) ? e(l) : n(l);
1233
1233
  }
1234
1234
  return Ae = o, Ae;
1235
1235
  }
1236
- var be, Ke;
1236
+ var Me, Ke;
1237
1237
  function Cn() {
1238
- if (Ke) return be;
1238
+ if (Ke) return Me;
1239
1239
  Ke = 1;
1240
1240
  function t(e) {
1241
1241
  return e != null && typeof e == "object";
1242
1242
  }
1243
- return be = t, be;
1243
+ return Me = t, Me;
1244
1244
  }
1245
- var Me, Ze;
1245
+ var be, Ze;
1246
1246
  function Dn() {
1247
- if (Ze) return Me;
1247
+ if (Ze) return be;
1248
1248
  Ze = 1;
1249
1249
  var t = En(), e = Cn(), n = "[object Symbol]";
1250
1250
  function s(i) {
1251
1251
  return typeof i == "symbol" || e(i) && t(i) == n;
1252
1252
  }
1253
- return Me = s, Me;
1253
+ return be = s, be;
1254
1254
  }
1255
1255
  var we, Je;
1256
1256
  function Tn() {
1257
1257
  if (Je) return we;
1258
1258
  Je = 1;
1259
- var t = bn(), e = xe(), n = Dn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1259
+ var t = Mn(), e = xe(), n = Dn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1260
1260
  function c(d) {
1261
1261
  if (typeof d == "number")
1262
1262
  return d;
@@ -1280,16 +1280,16 @@ function Rn() {
1280
1280
  et = 1;
1281
1281
  var t = xe(), e = Sn(), n = Tn(), s = "Expected a function", i = Math.max, r = Math.min;
1282
1282
  function o(l, c, d) {
1283
- var m, g, h, u, A, p, v = 0, b = !1, f = !1, y = !0;
1283
+ var m, g, h, u, A, p, v = 0, M = !1, f = !1, y = !0;
1284
1284
  if (typeof l != "function")
1285
1285
  throw new TypeError(s);
1286
- c = n(c) || 0, t(d) && (b = !!d.leading, f = "maxWait" in d, h = f ? i(n(d.maxWait) || 0, c) : h, y = "trailing" in d ? !!d.trailing : y);
1286
+ c = n(c) || 0, t(d) && (M = !!d.leading, f = "maxWait" in d, h = f ? i(n(d.maxWait) || 0, c) : h, y = "trailing" in d ? !!d.trailing : y);
1287
1287
  function S(R) {
1288
1288
  var V = m, q = g;
1289
1289
  return m = g = void 0, v = R, u = l.apply(q, V), u;
1290
1290
  }
1291
- function M(R) {
1292
- return v = R, A = setTimeout(I, c), b ? S(R) : u;
1291
+ function b(R) {
1292
+ return v = R, A = setTimeout(I, c), M ? S(R) : u;
1293
1293
  }
1294
1294
  function D(R) {
1295
1295
  var V = R - p, q = R - v, Q = c - V;
@@ -1311,20 +1311,20 @@ function Rn() {
1311
1311
  function Y() {
1312
1312
  A !== void 0 && clearTimeout(A), v = 0, m = p = g = A = void 0;
1313
1313
  }
1314
- function z() {
1314
+ function H() {
1315
1315
  return A === void 0 ? u : P(e());
1316
1316
  }
1317
1317
  function _() {
1318
1318
  var R = e(), V = T(R);
1319
1319
  if (m = arguments, g = this, p = R, V) {
1320
1320
  if (A === void 0)
1321
- return M(p);
1321
+ return b(p);
1322
1322
  if (f)
1323
1323
  return clearTimeout(A), A = setTimeout(I, c), S(p);
1324
1324
  }
1325
1325
  return A === void 0 && (A = setTimeout(I, c)), u;
1326
1326
  }
1327
- return _.cancel = Y, _.flush = z, _;
1327
+ return _.cancel = Y, _.flush = H, _;
1328
1328
  }
1329
1329
  return Ee = o, Ee;
1330
1330
  }
@@ -1348,15 +1348,15 @@ function kn() {
1348
1348
  var xn = kn();
1349
1349
  const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1350
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((f) => {
1351
- const M = t.schedulantApi.getScheduleView().getTimelineView(), D = f - n.current, T = t.timelineWidth, I = M.getTotalSlots(), P = Math.round(D / T * I), Y = P / I * T;
1351
+ const b = t.schedulantApi.getScheduleView().getTimelineView(), D = f - n.current, T = t.timelineWidth, I = b.getTotalSlots(), P = Math.round(D / T * I), Y = P / I * T;
1352
1352
  return { moveSlots: P, distance: Y, deltaX: D };
1353
1353
  }, [t]), c = C((f) => {
1354
- const y = t.schedulantApi.getScheduleView().getTimelineView(), S = f.style.left, M = f.style.right, D = y.calculateLaneHeight(t.resourceApi), T = document.createElement("div");
1354
+ const y = t.schedulantApi.getScheduleView().getTimelineView(), S = f.style.left, b = f.style.right, D = y.calculateLaneHeight(t.resourceApi), T = document.createElement("div");
1355
1355
  T.className = e, Object.assign(T.style, {
1356
1356
  position: "absolute",
1357
1357
  zIndex: 1,
1358
1358
  left: S,
1359
- right: M,
1359
+ right: b,
1360
1360
  height: w(D),
1361
1361
  backgroundColor: t.schedulantApi.getDragHintColor()
1362
1362
  }), f.parentNode?.insertBefore(T, f);
@@ -1366,8 +1366,8 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1366
1366
  }, [e]), m = C((f, y) => {
1367
1367
  const S = f.previousElementSibling;
1368
1368
  if (S && S.className === e) {
1369
- const M = o.current, { distance: D } = l(y);
1370
- switch (M) {
1369
+ const b = o.current, { distance: D } = l(y);
1370
+ switch (b) {
1371
1371
  case "press_event": {
1372
1372
  S.style.left = w(Math.max(s.current + D, 0)), S.style.right = w(i.current - D);
1373
1373
  break;
@@ -1385,17 +1385,17 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1385
1385
  }
1386
1386
  }
1387
1387
  }, [l, e]), g = C((f, y) => {
1388
- const S = t.eventApi, M = t.schedulantApi, D = o.current, { moveSlots: T, distance: I } = l(y);
1388
+ const S = t.eventApi, b = t.schedulantApi, D = o.current, { moveSlots: T, distance: I } = l(y);
1389
1389
  switch (D) {
1390
1390
  case "press_event": {
1391
1391
  f.style.left = w(Math.max(s.current + I, 0)), f.style.right = w(i.current - I);
1392
1392
  const P = S.getStart().add(T, "day"), Y = S.getEnd().add(T, "day");
1393
- M.eventMove({
1393
+ b.eventMove({
1394
1394
  el: f,
1395
1395
  startDate: P,
1396
1396
  endDate: Y,
1397
1397
  eventApi: S,
1398
- schedulantApi: M
1398
+ schedulantApi: b
1399
1399
  });
1400
1400
  break;
1401
1401
  }
@@ -1403,11 +1403,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1403
1403
  const P = Math.max(s.current + I, 0);
1404
1404
  f.style.left = w(P);
1405
1405
  const Y = S.getStart().add(T, "day");
1406
- M.eventResizeStart({
1406
+ b.eventResizeStart({
1407
1407
  el: f,
1408
1408
  date: Y,
1409
1409
  eventApi: S,
1410
- schedulantApi: M
1410
+ schedulantApi: b
1411
1411
  });
1412
1412
  break;
1413
1413
  }
@@ -1415,11 +1415,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1415
1415
  const P = i.current - I;
1416
1416
  f.style.right = w(P);
1417
1417
  const Y = S.getEnd().add(T, "day");
1418
- M.eventResizeEnd({
1418
+ b.eventResizeEnd({
1419
1419
  el: f,
1420
1420
  date: Y,
1421
1421
  eventApi: S,
1422
- schedulantApi: M
1422
+ schedulantApi: b
1423
1423
  });
1424
1424
  break;
1425
1425
  }
@@ -1428,7 +1428,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1428
1428
  f.preventDefault();
1429
1429
  const y = r.current, S = t.timelineEventHarnessRef.current;
1430
1430
  if (y && S) {
1431
- const { deltaX: M } = l(f.clientX), D = s.current + M, T = i.current - M;
1431
+ const { deltaX: b } = l(f.clientX), D = s.current + b, T = i.current - b;
1432
1432
  switch (o.current) {
1433
1433
  case "press_event":
1434
1434
  S.style.left = w(D), S.style.right = w(T);
@@ -1447,26 +1447,26 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1447
1447
  [h]
1448
1448
  ), A = C((f, y) => {
1449
1449
  f.preventDefault();
1450
- const S = t.schedulantApi.getSchedulantElRef().current, M = t.timelineEventHarnessRef.current;
1451
- M && S ? (r.current = !0, o.current = y, n.current = f.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), c(M), S.addEventListener("mousemove", u)) : (console.error("scheduleEl", S), console.error("timelineEventHarness", M));
1450
+ const S = t.schedulantApi.getSchedulantElRef().current, b = t.timelineEventHarnessRef.current;
1451
+ b && S ? (r.current = !0, o.current = y, n.current = f.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), c(b), S.addEventListener("mousemove", u)) : (console.error("scheduleEl", S), console.error("timelineEventHarness", b));
1452
1452
  }, [t.schedulantApi, t.timelineEventHarnessRef, c, u]), p = C((f) => {
1453
1453
  A(f, "press_event");
1454
1454
  }, [A]), v = C((f) => {
1455
1455
  A(f, "press_event_left");
1456
- }, [A]), b = C((f) => {
1456
+ }, [A]), M = C((f) => {
1457
1457
  A(f, "press_event_right");
1458
1458
  }, [A]);
1459
1459
  return N(() => {
1460
1460
  const f = t.timelineEventHarnessRef.current, y = t.schedulantApi.getSchedulantElRef().current;
1461
1461
  if (y && f) {
1462
- const S = (M) => {
1463
- M.preventDefault(), r.current && (d(f), g(f, M.clientX), y.removeEventListener("mousemove", u), r.current = !1, o.current = "none");
1462
+ const S = (b) => {
1463
+ b.preventDefault(), r.current && (d(f), g(f, b.clientX), y.removeEventListener("mousemove", u), r.current = !1, o.current = "none");
1464
1464
  };
1465
1465
  return document.addEventListener("mouseup", S), () => {
1466
1466
  document.removeEventListener("mouseup", S), y.removeEventListener("mousemove", u), u.cancel();
1467
1467
  };
1468
1468
  }
1469
- }, [u, t, d, g]), { handleMouseDown: p, leftHandleMouseDown: v, rightHandleMouseDown: b };
1469
+ }, [u, t, d, g]), { handleMouseDown: p, leftHandleMouseDown: v, rightHandleMouseDown: M };
1470
1470
  }, nt = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1471
1471
  "svg",
1472
1472
  {
@@ -1534,8 +1534,8 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1534
1534
  trigger: ["contextMenu"],
1535
1535
  menu: {
1536
1536
  items: t.schedulantApi.getEventContextMenuItems(),
1537
- onClick: (b) => {
1538
- const { key: f, keyPath: y, domEvent: S } = b;
1537
+ onClick: (M) => {
1538
+ const { key: f, keyPath: y, domEvent: S } = M;
1539
1539
  t.schedulantApi.onEventContextMenuClick({
1540
1540
  key: f,
1541
1541
  keyPath: y,
@@ -1556,11 +1556,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1556
1556
  ref: e,
1557
1557
  children: [
1558
1558
  /* @__PURE__ */ a(
1559
- H,
1559
+ z,
1560
1560
  {
1561
1561
  condition: t.schedulantApi.isEditable(),
1562
1562
  fallback: /* @__PURE__ */ a(
1563
- H,
1563
+ z,
1564
1564
  {
1565
1565
  condition: t.eventApi.getStart().isBefore(s.getStart()),
1566
1566
  fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
@@ -1568,7 +1568,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1568
1568
  }
1569
1569
  ),
1570
1570
  children: /* @__PURE__ */ a(
1571
- H,
1571
+ z,
1572
1572
  {
1573
1573
  condition: !t.eventApi.getStart().isBefore(s.getStart()),
1574
1574
  fallback: /* @__PURE__ */ a(nt, { width: W, height: d, color: "#FFFFFF" }),
@@ -1586,7 +1586,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1586
1586
  }
1587
1587
  ),
1588
1588
  /* @__PURE__ */ a(
1589
- H,
1589
+ z,
1590
1590
  {
1591
1591
  condition: t.schedulantApi.isEditable() && !t.eventApi.getStart().isBefore(s.getStart()) && t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
1592
1592
  fallback: /* @__PURE__ */ a(
@@ -1595,7 +1595,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1595
1595
  className: "schedulant-event-main",
1596
1596
  style: { color: r, width: `calc(100% - ${W * 2}px)` },
1597
1597
  children: /* @__PURE__ */ a(
1598
- H,
1598
+ z,
1599
1599
  {
1600
1600
  condition: t.eventApi.getUrl().isDefined(),
1601
1601
  fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
@@ -1618,7 +1618,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1618
1618
  style: { color: r, width: `calc(100% - ${W * 2}px)`, cursor: "grab" },
1619
1619
  onMouseDown: A,
1620
1620
  children: /* @__PURE__ */ a(
1621
- H,
1621
+ z,
1622
1622
  {
1623
1623
  condition: t.eventApi.getUrl().isDefined(),
1624
1624
  fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
@@ -1637,11 +1637,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1637
1637
  }
1638
1638
  ),
1639
1639
  /* @__PURE__ */ a(
1640
- H,
1640
+ z,
1641
1641
  {
1642
1642
  condition: t.schedulantApi.isEditable(),
1643
1643
  fallback: /* @__PURE__ */ a(
1644
- H,
1644
+ z,
1645
1645
  {
1646
1646
  condition: t.eventApi.getEnd().isAfter(s.getEnd()),
1647
1647
  fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
@@ -1649,7 +1649,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1649
1649
  }
1650
1650
  ),
1651
1651
  children: /* @__PURE__ */ a(
1652
- H,
1652
+ z,
1653
1653
  {
1654
1654
  condition: t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
1655
1655
  fallback: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" }),
@@ -1696,37 +1696,37 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1696
1696
  }, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1697
1697
  }, yt = (t) => {
1698
1698
  const e = F(() => "schedulant-timeline-marker-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = C((p) => {
1699
- const v = p.style.left, b = p.style.right, f = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), S = f.calculateLaneHeight(y), M = document.createElement("div");
1700
- M.className = e, Object.assign(M.style, {
1699
+ const v = p.style.left, M = p.style.right, f = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), S = f.calculateLaneHeight(y), b = document.createElement("div");
1700
+ b.className = e, Object.assign(b.style, {
1701
1701
  position: "absolute",
1702
1702
  zIndex: 1,
1703
1703
  left: v,
1704
- right: b,
1704
+ right: M,
1705
1705
  height: w(S),
1706
1706
  backgroundColor: t.schedulantApi.getDragHintColor()
1707
- }), p.parentNode?.insertBefore(M, p);
1707
+ }), p.parentNode?.insertBefore(b, p);
1708
1708
  }, [t, e]), l = C((p) => {
1709
1709
  const v = p.previousElementSibling;
1710
1710
  v?.className === e && p.parentElement?.removeChild(v);
1711
1711
  }, [e]), c = C((p) => {
1712
- const f = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, S = t.timelineWidth, M = f.getTotalSlots(), D = Math.round(y / S * M), T = D / M * t.timelineWidth;
1712
+ const f = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, S = t.timelineWidth, b = f.getTotalSlots(), D = Math.round(y / S * b), T = D / b * t.timelineWidth;
1713
1713
  return {
1714
1714
  moveSlots: D,
1715
1715
  distance: T,
1716
1716
  deltaX: y,
1717
1717
  totalWidth: S,
1718
- totalSlots: M
1718
+ totalSlots: b
1719
1719
  };
1720
1720
  }, [t]), d = C((p, v) => {
1721
- const b = p.previousElementSibling;
1722
- if (b && b.className === e) {
1721
+ const M = p.previousElementSibling;
1722
+ if (M && M.className === e) {
1723
1723
  const { distance: f } = c(v);
1724
- b.style.left = w(Math.max(s.current + f, 0)), b.style.right = w(i.current - f);
1724
+ M.style.left = w(Math.max(s.current + f, 0)), M.style.right = w(i.current - f);
1725
1725
  }
1726
1726
  }, [e, c]), m = C((p, v) => {
1727
- const { moveSlots: b, distance: f } = c(v);
1727
+ const { moveSlots: M, distance: f } = c(v);
1728
1728
  if (p.style.left = w(Math.max(s.current + f, 0)), p.style.right = w(i.current - f), t.milestoneApi) {
1729
- const y = t.milestoneApi.getTime().add(b, "day");
1729
+ const y = t.milestoneApi.getTime().add(M, "day");
1730
1730
  t.schedulantApi.milestoneMove({
1731
1731
  el: p,
1732
1732
  date: y,
@@ -1734,7 +1734,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1734
1734
  milestoneApi: t.milestoneApi
1735
1735
  });
1736
1736
  } else if (t.checkpointApi) {
1737
- const y = t.checkpointApi.getTime().add(b, "day");
1737
+ const y = t.checkpointApi.getTime().add(M, "day");
1738
1738
  t.schedulantApi.checkpointMove({
1739
1739
  el: p,
1740
1740
  date: y,
@@ -1745,8 +1745,8 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1745
1745
  n.current = 0;
1746
1746
  }, [t, c]), g = C((p) => {
1747
1747
  p.preventDefault();
1748
- const v = t.markerRef.current, b = r.current;
1749
- if (v && b) {
1748
+ const v = t.markerRef.current, M = r.current;
1749
+ if (v && M) {
1750
1750
  const f = p.clientX - n.current, y = s.current + f, S = i.current - f;
1751
1751
  v.style.left = w(y), v.style.right = w(S), d(v, p.clientX);
1752
1752
  }
@@ -1755,23 +1755,23 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1755
1755
  [g]
1756
1756
  ), u = C((p) => {
1757
1757
  p.preventDefault();
1758
- const v = t.markerRef.current, b = r.current, f = t.schedulantApi.getSchedulantElRef().current;
1759
- b && f && v && (l(v), m(v, p.clientX), f.removeEventListener("mousemove", h), r.current = !1);
1758
+ const v = t.markerRef.current, M = r.current, f = t.schedulantApi.getSchedulantElRef().current;
1759
+ M && f && v && (l(v), m(v, p.clientX), f.removeEventListener("mousemove", h), r.current = !1);
1760
1760
  }, [h, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
1761
1761
  p.preventDefault();
1762
- const v = t.schedulantApi.getSchedulantElRef().current, b = t.markerRef.current;
1763
- v && b && (r.current = !0, n.current = p.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), o(b), v.addEventListener("mousemove", h));
1762
+ const v = t.schedulantApi.getSchedulantElRef().current, M = t.markerRef.current;
1763
+ v && M && (r.current = !0, n.current = p.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), o(M), v.addEventListener("mousemove", h));
1764
1764
  }, [o, h, t.markerRef, t.schedulantApi]);
1765
1765
  return N(() => {
1766
1766
  const p = t.schedulantApi.getSchedulantElRef().current, v = t.markerRef.current;
1767
1767
  if (p && v) {
1768
- const b = v.parentElement?.parentElement;
1769
- if (b) {
1768
+ const M = v.parentElement?.parentElement;
1769
+ if (M) {
1770
1770
  const f = (y) => {
1771
- y.preventDefault(), r.current && !b.contains(y.relatedTarget) && (l(v), m(v, y.clientX), p.removeEventListener("mousemove", h), r.current = !1);
1771
+ y.preventDefault(), r.current && !M.contains(y.relatedTarget) && (l(v), m(v, y.clientX), p.removeEventListener("mousemove", h), r.current = !1);
1772
1772
  };
1773
- return b.addEventListener("mouseup", f), b.addEventListener("mouseout", f), () => {
1774
- b.removeEventListener("mouseup", f), b.removeEventListener("mouseout", f), p.removeEventListener("mousemove", h), h.cancel();
1773
+ return M.addEventListener("mouseup", f), M.addEventListener("mouseout", f), () => {
1774
+ M.removeEventListener("mouseup", f), M.removeEventListener("mouseout", f), p.removeEventListener("mousemove", h), h.cancel();
1775
1775
  };
1776
1776
  }
1777
1777
  }
@@ -1826,11 +1826,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1826
1826
  menu: {
1827
1827
  items: t.schedulantApi.getMilestoneContextMenuItems(),
1828
1828
  onClick: (A) => {
1829
- const { key: p, keyPath: v, domEvent: b } = A;
1829
+ const { key: p, keyPath: v, domEvent: M } = A;
1830
1830
  t.schedulantApi.onMilestoneContextMenuClick({
1831
1831
  key: p,
1832
1832
  keyPath: v,
1833
- domEvent: b,
1833
+ domEvent: M,
1834
1834
  isPast: c,
1835
1835
  isFuture: d,
1836
1836
  isProcess: m,
@@ -1845,7 +1845,7 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1845
1845
  className: `schedulant-timeline-milestone${m ? " schedulant-milestone-today" : ""}`,
1846
1846
  style: m ? { "--milestone-glow-color": g } : void 0,
1847
1847
  ref: e,
1848
- children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(Ln, { width: o * ze, height: o * ze, color: g }) })
1848
+ children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(Ln, { width: o * He, height: o * He, color: g }) })
1849
1849
  }
1850
1850
  )
1851
1851
  }
@@ -1934,11 +1934,11 @@ const pt = /* @__PURE__ */ yn(xn), On = (t) => {
1934
1934
  menu: {
1935
1935
  items: t.schedulantApi.getCheckpointContextMenuItems(),
1936
1936
  onClick: (A) => {
1937
- const { key: p, keyPath: v, domEvent: b } = A;
1937
+ const { key: p, keyPath: v, domEvent: M } = A;
1938
1938
  t.schedulantApi.onCheckpointContextMenuClick({
1939
1939
  key: p,
1940
1940
  keyPath: v,
1941
- domEvent: b,
1941
+ domEvent: M,
1942
1942
  isPast: d,
1943
1943
  isFuture: m,
1944
1944
  isProcess: g,
@@ -2023,7 +2023,7 @@ class J {
2023
2023
  const ee = (t) => {
2024
2024
  const { dates: e, minWidth: n } = t;
2025
2025
  return /* @__PURE__ */ a("colgroup", { children: e.map((s) => /* @__PURE__ */ a("col", { style: { minWidth: n } }, s.format("YYYY-MM-DD"))) });
2026
- }, Hn = (t, e, n) => {
2026
+ }, zn = (t, e, n) => {
2027
2027
  const s = n.isBefore(E(), "day"), i = n.isAfter(E(), "day"), r = n.isSame(E(), "day");
2028
2028
  N(() => {
2029
2029
  const o = t.current;
@@ -2050,7 +2050,7 @@ const ee = (t) => {
2050
2050
  }, [n, i, s, r, e, t]);
2051
2051
  }, te = ae((t) => {
2052
2052
  const e = k(null);
2053
- return Hn(e, t.schedulantApi, t.date), /* @__PURE__ */ a(
2053
+ return zn(e, t.schedulantApi, t.date), /* @__PURE__ */ a(
2054
2054
  "td",
2055
2055
  {
2056
2056
  ref: e,
@@ -2060,7 +2060,7 @@ const ee = (t) => {
2060
2060
  },
2061
2061
  t.date.format("YYYY-MM-DD")
2062
2062
  );
2063
- }), zn = (t, e, n, s, i) => {
2063
+ }), Hn = (t, e, n, s, i) => {
2064
2064
  const r = n.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSame(E(), "day");
2065
2065
  N(() => {
2066
2066
  const c = t.current;
@@ -2091,7 +2091,7 @@ const ee = (t) => {
2091
2091
  }, [n, o, r, l, s, e, i, t]);
2092
2092
  }, B = (t) => {
2093
2093
  const e = k(null);
2094
- return zn(e, t.schedulantApi, t.date, t.level, t.timeText), /* @__PURE__ */ a(
2094
+ return Hn(e, t.schedulantApi, t.date, t.level, t.timeText), /* @__PURE__ */ a(
2095
2095
  "th",
2096
2096
  {
2097
2097
  ref: e,
@@ -2303,7 +2303,7 @@ class Bn extends J {
2303
2303
  ] });
2304
2304
  }
2305
2305
  calculatePosition(e, n, s) {
2306
- 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"), g = o / d, h = m * g, u = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, v = c.endOf("quarter").diff(c, "day"), b = o / p, f = v * b, y = (i.getQuarterPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? y + f : y;
2306
+ 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"), g = o / d, h = m * g, u = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, v = c.endOf("quarter").diff(c, "day"), M = o / p, f = v * M, y = (i.getQuarterPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? y + f : y;
2307
2307
  return { left: A, right: S };
2308
2308
  }
2309
2309
  }
@@ -2387,7 +2387,7 @@ class Un extends J {
2387
2387
  )) }) });
2388
2388
  }
2389
2389
  calculatePosition(e, n, s) {
2390
- 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"), g = o / d, h = m * g, u = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, v = c.endOf("year").diff(c, "day"), b = o / p, f = v * b, y = (i.getYearPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? y + f : y;
2390
+ 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"), g = o / d, h = m * g, u = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, v = c.endOf("year").diff(c, "day"), M = o / p, f = v * M, y = (i.getYearPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? y + f : y;
2391
2391
  return { left: A, right: S };
2392
2392
  }
2393
2393
  }
@@ -2559,7 +2559,7 @@ const Kn = (t, e) => {
2559
2559
  r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
2560
2560
  return;
2561
2561
  }
2562
- const b = A.clientY + p.y, f = Xn(b, {
2562
+ const M = A.clientY + p.y, f = Xn(M, {
2563
2563
  top: u.rect.top,
2564
2564
  height: u.rect.height
2565
2565
  });
@@ -2597,28 +2597,28 @@ const Kn = (t, e) => {
2597
2597
  x: t.x + 20,
2598
2598
  y: t.y + 20
2599
2599
  } : t, Jn = (t) => {
2600
- const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (M, D, T, I) => {
2601
- const P = c.find((z) => z.getId() === D), Y = c.find((z) => z.getId() === T);
2600
+ const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (b, D, T, I) => {
2601
+ const P = c.find((H) => H.getId() === D), Y = c.find((H) => H.getId() === T);
2602
2602
  if (P && Y) {
2603
- const z = P.getParent();
2603
+ const H = P.getParent();
2604
2604
  l.resourceLaneMove({
2605
- el: M,
2605
+ el: b,
2606
2606
  schedulantApi: l,
2607
2607
  draggedResourceApi: P,
2608
2608
  targetResourceApi: Y,
2609
2609
  position: I,
2610
- oldParentResourceApi: z.isDefined() ? z.get() : void 0
2610
+ oldParentResourceApi: H.isDefined() ? H.get() : void 0
2611
2611
  });
2612
2612
  }
2613
2613
  }, [l, c]), { dragState: m, handleDragStart: g, handleDragMove: h, handleDragEnd: u, handleDragCancel: A } = Kn(c, d), p = Nt(
2614
2614
  _e(Yt, { activationConstraint: { delay: 300, tolerance: 5 } }),
2615
2615
  _e(_t)
2616
- ), v = s.map((M) => M.getId()), b = l.isEditable(), f = n.getVirtualItems(), y = n.getTotalSize(), S = F(() => m.activeId ? c.find((M) => M.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
2616
+ ), v = s.map((b) => b.getId()), M = l.isEditable(), f = n.getVirtualItems(), y = n.getTotalSize(), S = F(() => m.activeId ? c.find((b) => b.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
2617
2617
  return /* @__PURE__ */ O(
2618
2618
  Wt,
2619
2619
  {
2620
2620
  sensors: p,
2621
- collisionDetection: Ht,
2621
+ collisionDetection: zt,
2622
2622
  modifiers: [Vt],
2623
2623
  onDragStart: g,
2624
2624
  onDragMove: h,
@@ -2634,13 +2634,13 @@ const Kn = (t, e) => {
2634
2634
  children: [
2635
2635
  e.renderResourceTableColgroup(),
2636
2636
  e.renderResourceLane(s, f, y, i, r, o, {
2637
- isDraggable: b,
2637
+ isDraggable: M,
2638
2638
  dragState: m
2639
2639
  })
2640
2640
  ]
2641
2641
  }
2642
2642
  ) }),
2643
- /* @__PURE__ */ a(zt, { dropAnimation: null, modifiers: [Zn], children: S ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: S.getTitle() }) : null })
2643
+ /* @__PURE__ */ a(Ht, { dropAnimation: null, modifiers: [Zn], children: S ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: S.getTitle() }) : null })
2644
2644
  ]
2645
2645
  }
2646
2646
  );
@@ -2648,31 +2648,22 @@ const Kn = (t, e) => {
2648
2648
  t.schedulantView.renderTimelineTableColgroup(),
2649
2649
  t.schedulantView.renderTimelineBodyTableSlots()
2650
2650
  ] }) }), ts = () => {
2651
- const t = C(() => {
2652
- const l = document.getElementsByClassName("schedulant-timeline-head").item(0).getElementsByTagName("table").item(0)?.offsetWidth;
2653
- return l || 0;
2654
- }, []), [e, n] = re(0), { state: s } = Te();
2651
+ const [t, e] = re(0), { state: n } = Te();
2655
2652
  return Et(() => {
2656
- const i = () => {
2657
- const d = t();
2658
- n(d);
2653
+ const r = document.getElementsByClassName("schedulant-timeline-head").item(0)?.getElementsByTagName("table").item(0);
2654
+ if (!r) return;
2655
+ const o = () => {
2656
+ const c = r.offsetWidth;
2657
+ e((d) => d !== c ? c : d);
2659
2658
  };
2660
- i();
2661
- const r = () => i();
2662
- window.addEventListener("resize", r);
2663
- const l = document.getElementsByClassName("schedulant-timeline-head").item(0);
2664
- let c = null;
2665
- return l && (c = new MutationObserver(() => {
2666
- requestAnimationFrame(i);
2667
- }), c.observe(l, {
2668
- childList: !0,
2669
- subtree: !0,
2670
- attributes: !0,
2671
- attributeFilter: ["style", "class"]
2672
- })), () => {
2673
- window.removeEventListener("resize", r), c?.disconnect();
2659
+ o();
2660
+ const l = new ResizeObserver(() => {
2661
+ o();
2662
+ });
2663
+ return l.observe(r), window.addEventListener("resize", o), () => {
2664
+ l.disconnect(), window.removeEventListener("resize", o);
2674
2665
  };
2675
- }, [t, s.resourceAreaWidth]), e;
2666
+ }, [n.resourceAreaWidth]), t;
2676
2667
  }, ns = (t) => {
2677
2668
  const e = ts(), n = t.virtualizer.getVirtualItems(), s = t.virtualizer.getTotalSize();
2678
2669
  return /* @__PURE__ */ a(
@@ -2711,13 +2702,13 @@ function $(t, e, n) {
2711
2702
  s = g;
2712
2703
  let u;
2713
2704
  if (n.key && ((c = n.debug) != null && c.call(n)) && (u = Date.now()), i = e(...g), n.key && ((d = n.debug) != null && d.call(n))) {
2714
- const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - u) * 100) / 100, v = p / 16, b = (f, y) => {
2705
+ const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - u) * 100) / 100, v = p / 16, M = (f, y) => {
2715
2706
  for (f = String(f); f.length < y; )
2716
2707
  f = " " + f;
2717
2708
  return f;
2718
2709
  };
2719
2710
  console.info(
2720
- `%c⏱ ${b(p, 5)} /${b(A, 5)} ms`,
2711
+ `%c⏱ ${M(p, 5)} /${M(A, 5)} ms`,
2721
2712
  `
2722
2713
  font-size: .6rem;
2723
2714
  font-weight: bold;
@@ -2994,13 +2985,13 @@ class hs {
2994
2985
  let p, v;
2995
2986
  if (A !== void 0 && this.options.lanes > 1) {
2996
2987
  p = A;
2997
- const S = g[p], M = S !== void 0 ? m[S] : void 0;
2998
- v = M ? M.end + this.options.gap : s + i;
2988
+ const S = g[p], b = S !== void 0 ? m[S] : void 0;
2989
+ v = b ? b.end + this.options.gap : s + i;
2999
2990
  } else {
3000
2991
  const S = this.options.lanes === 1 ? m[h - 1] : this.getFurthestMeasurement(m, h);
3001
2992
  v = S ? S.end + this.options.gap : s + i, p = S ? S.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, p);
3002
2993
  }
3003
- const b = c.get(u), f = typeof b == "number" ? b : this.options.estimateSize(h), y = v + f;
2994
+ const M = c.get(u), f = typeof M == "number" ? M : this.options.estimateSize(h), y = v + f;
3004
2995
  m[h] = {
3005
2996
  index: h,
3006
2997
  start: v,
@@ -3356,17 +3347,17 @@ const ys = (t, e, n, s) => {
3356
3347
  slotMinWidth: A,
3357
3348
  schedulantMaxHeight: p,
3358
3349
  schedulantViewType: v,
3359
- events: b,
3350
+ events: M,
3360
3351
  resources: f,
3361
3352
  milestones: y,
3362
3353
  checkpoints: S,
3363
- resourceAreaColumns: M,
3354
+ resourceAreaColumns: b,
3364
3355
  resourceAreaWidth: D,
3365
3356
  companyHolidays: T,
3366
3357
  specialWorkdays: I,
3367
3358
  nationalHolidays: P,
3368
3359
  dragHintColor: Y,
3369
- selectionColor: z
3360
+ selectionColor: H
3370
3361
  } = t, _ = F(
3371
3362
  () => new jn(t, s),
3372
3363
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -3379,17 +3370,17 @@ const ys = (t, e, n, s) => {
3379
3370
  A,
3380
3371
  p,
3381
3372
  v,
3382
- b,
3373
+ M,
3383
3374
  f,
3384
3375
  y,
3385
3376
  S,
3386
- M,
3377
+ b,
3387
3378
  D,
3388
3379
  T,
3389
3380
  I,
3390
3381
  P,
3391
3382
  Y,
3392
- z
3383
+ H
3393
3384
  ]
3394
3385
  ), R = F(() => _.getScheduleApi(), [_]);
3395
3386
  R.updateProps(t);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "license": "MIT",
9
9
  "author": "mengen.dai@outlook.com",
10
- "version": "2.0.9-fixed.3",
10
+ "version": "2.1.0",
11
11
  "main": "dist/schedulant.js",
12
12
  "typings": "dist/schedulant.d.ts",
13
13
  "keywords": [