@baishuyun/ui-base 6.5.0 → 6.6.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.
@@ -5,25 +5,26 @@ import { a as r, f as i, g as a, i as o, m as s, n as c, o as l, r as u } from "
5
5
  import { t as d } from "./GanttHighlightContext-CtT98ZnK.js";
6
6
  import { n as f, r as p } from "./highlightTarget-DtCe7zto.js";
7
7
  import { a as m, d as h, i as g, n as _, r as v, t as y, u as b } from "./timelineViewConfig-Dl3AXO45.js";
8
- import { _ as x, a as S, b as C, c as w, d as T, f as ee, g as E, h as D, i as O, l as k, m as A, o as j, p as M, r as N, s as te, t as ne, u as re, v as ie, x as ae, y as oe } from "./collapseKeys-1N9ci2oJ.js";
9
- import { r as se, t as ce } from "./GanttToolBar-8jPQ9BAG.js";
10
- import { isFunction as P, isNumber as F, isString as I } from "lodash-es";
8
+ import { _ as x, a as S, b as C, c as w, d as T, f as ee, g as E, h as D, i as O, l as k, m as A, o as j, p as M, r as te, s as ne, t as N, u as re, v as ie, x as P, y as ae } from "./collapseKeys-1N9ci2oJ.js";
9
+ import { r as oe, t as F } from "./GanttToolBar-8jPQ9BAG.js";
10
+ import { isFunction as se, isNumber as ce, isString as I } from "lodash-es";
11
11
  import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
12
- import B, { forwardRef as V, memo as H, useCallback as U, useEffect as W, useImperativeHandle as le, useLayoutEffect as ue, useMemo as G, useRef as K, useState as q } from "react";
13
- import J from "clsx";
14
- import { useDocumentVisibility as de, useSize as fe } from "ahooks";
15
- import { createContext as pe, useContextSelector as Y } from "use-context-selector";
16
- import X from "dayjs";
17
- import me from "dayjs/plugin/isoWeek";
18
- import { useVirtualizer as he } from "@tanstack/react-virtual";
19
- import ge from "dayjs/plugin/quarterOfYear";
20
- import { OverlayScrollbars as _e } from "overlayscrollbars";
12
+ import B, { forwardRef as V, memo as H, useCallback as U, useEffect as W, useImperativeHandle as G, useLayoutEffect as le, useMemo as K, useRef as q, useState as J } from "react";
13
+ import Y from "clsx";
14
+ import { useDocumentVisibility as ue, useSize as de } from "ahooks";
15
+ import { AnimatePresence as fe, motion as X } from "motion/react";
16
+ import { createContext as pe, useContextSelector as me } from "use-context-selector";
17
+ import he from "dayjs";
18
+ import ge from "dayjs/plugin/isoWeek";
19
+ import { useVirtualizer as _e } from "@tanstack/react-virtual";
20
+ import ve from "dayjs/plugin/quarterOfYear";
21
+ import { OverlayScrollbars as ye } from "overlayscrollbars";
21
22
  //#region src/components/Gantt/GanttChart/utils/dragEngine.ts
22
- var ve = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, ye = {
23
+ var be = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, xe = {
23
24
  canMove: !1,
24
25
  canResizeStart: !1,
25
26
  canResizeEnd: !1
26
- }, be = (e) => !e || e.invalid || e.type === "summary" || e.draggable === !1 ? ye : e.dragPermission ? {
27
+ }, Se = (e) => !e || e.invalid || e.type === "summary" || e.draggable === !1 ? xe : e.dragPermission ? {
27
28
  canMove: e.dragPermission.canMove === !0,
28
29
  canResizeStart: e.dragPermission.canResizeStart === !0,
29
30
  canResizeEnd: e.dragPermission.canResizeEnd === !0
@@ -31,14 +32,14 @@ var ve = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, ye = {
31
32
  canMove: !0,
32
33
  canResizeStart: !0,
33
34
  canResizeEnd: !0
34
- }, xe = (e, t) => ve(e) ? e?.dragPermission ? t === "move" ? e.dragPermission.canMove === !0 : t === "resize-start" ? e.dragPermission.canResizeStart === !0 : t === "resize-end" ? e.dragPermission.canResizeEnd === !0 : !1 : !0 : !1, Se = (e, t) => !t || Math.abs(e) < Math.min(5, t) ? 0 : Math.round(e / t), Ce = (e, t) => Se(e, t), we = (e, t, n = "round") => {
35
+ }, Ce = (e, t) => be(e) ? e?.dragPermission ? t === "move" ? e.dragPermission.canMove === !0 : t === "resize-start" ? e.dragPermission.canResizeStart === !0 : t === "resize-end" ? e.dragPermission.canResizeEnd === !0 : !1 : !0 : !1, we = (e, t) => !t || Math.abs(e) < Math.min(5, t) ? 0 : Math.round(e / t), Te = (e, t) => we(e, t), Ee = (e, t, n = "round") => {
35
36
  if (!t || !Number.isFinite(e)) return e;
36
- let r = ae(e), i = X(r).startOf("day").valueOf(), a = (r - i) / t, o;
37
+ let r = P(e), i = he(r).startOf("day").valueOf(), a = (r - i) / t, o;
37
38
  return o = n === "floor" ? Math.floor(a) : n === "ceil" ? Math.ceil(a) : Math.round(a), ie(i + o * t);
38
- }, Te = (e, t, n) => ({
39
+ }, De = (e, t, n) => ({
39
40
  startMs: e + n,
40
41
  endMs: t + n
41
- }), Ee = ({ startMs: e, endMs: t, deltaMs: n, edge: r, minDurationMs: i }) => {
42
+ }), Oe = ({ startMs: e, endMs: t, deltaMs: n, edge: r, minDurationMs: i }) => {
42
43
  if (r === "start") {
43
44
  let r = t - i;
44
45
  return {
@@ -51,12 +52,12 @@ var ve = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, ye = {
51
52
  startMs: e,
52
53
  endMs: Math.max(t + n, a)
53
54
  };
54
- }, De = (e, t, n, r) => {
55
+ }, ke = (e, t, n, r) => {
55
56
  let i = e.originStartMs, a = e.originEndMs, o = e.originAnchorPx ?? e.originLeftPx, c = e.originAnchorMs ?? n.timeAtX(o), l = o + t, u = n.timeAtX(l);
56
57
  if (e.dragMode === "move") {
57
58
  let t = Math.round((u - c) / s) * s;
58
59
  i = e.originStartMs + t, a = e.originEndMs + t;
59
- } else e.dragMode === "resize-start" ? (i = we(u, r, "round"), a = e.originEndMs, a - i < r && (i = a - r)) : (a = we(u, r, "round"), i = e.originStartMs, a - i < r && (a = i + r));
60
+ } else e.dragMode === "resize-start" ? (i = Ee(u, r, "round"), a = e.originEndMs, a - i < r && (i = a - r)) : (a = Ee(u, r, "round"), i = e.originStartMs, a - i < r && (a = i + r));
60
61
  return {
61
62
  deltaUnits: e.dragMode === "resize-end" ? Math.round((a - e.originEndMs) / r) : Math.round((i - e.originStartMs) / r),
62
63
  previewStartMs: i,
@@ -64,7 +65,7 @@ var ve = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, ye = {
64
65
  previewLeftPx: e.dragMode === "resize-end" ? e.originLeftPx : l
65
66
  };
66
67
  };
67
- function Oe(e) {
68
+ function Ae(e) {
68
69
  let t = {
69
70
  taskId: String(e.item.id),
70
71
  newStart: e.startMs,
@@ -95,14 +96,14 @@ function Oe(e) {
95
96
  deltaDays: n.deltaDays
96
97
  };
97
98
  }
98
- var ke = (e) => e && P(e.then) ? e : Promise.resolve(e);
99
+ var je = (e) => e && se(e.then) ? e : Promise.resolve(e);
99
100
  //#endregion
100
101
  //#region src/components/Gantt/GanttChart/hooks/useEdgeScroll.tsx
101
- function Ae(e, t) {
102
- return e < 0 ? t * 10 : e >= 60 ? 0 : t * (2 + 8 * (1 - e / 60));
102
+ function Me(e, t) {
103
+ return e < 0 ? t * 10 : e >= 20 ? 0 : t * (2 + 8 * (1 - e / 20));
103
104
  }
104
- function je(e, t) {
105
- let n = K(null), r = K(0), i = U(() => {
105
+ function Ne(e, t) {
106
+ let n = q(null), r = q(0), i = U(() => {
106
107
  n.current !== null && cancelAnimationFrame(n.current), n.current = null, r.current = 0;
107
108
  }, []);
108
109
  W(() => () => {
@@ -125,7 +126,7 @@ function je(e, t) {
125
126
  startEdgeDetection: U((t, n) => {
126
127
  let o = e.current;
127
128
  if (!o) return 0;
128
- let s = n ?? o.getBoundingClientRect(), c = t - s.left, l = s.right - t, u = c < 60 ? Ae(c, -1) : l < 60 ? Ae(l, 1) : 0;
129
+ let s = n ?? o.getBoundingClientRect(), c = t - s.left, l = s.right - t, u = c < 20 ? Me(c, -1) : l < 20 ? Me(l, 1) : 0;
129
130
  return r.current = u, u === 0 ? i() : a(), u;
130
131
  }, [
131
132
  e,
@@ -137,13 +138,13 @@ function je(e, t) {
137
138
  }
138
139
  //#endregion
139
140
  //#region src/components/Gantt/GanttChart/hooks/useGanttDrag.tsx
140
- function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange: i, containerRef: c, onDragInteractionChange: u }) {
141
- let d = h(t), f = m(t), p = f / s * e, g = K(n);
141
+ function Pe({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange: i, containerRef: c, onDragInteractionChange: u }) {
142
+ let d = h(t), f = m(t), p = f / s * e, g = q(n);
142
143
  g.current = n;
143
- let [_, v] = q({}), [y, b] = q(null), x = K(null), S = K({
144
+ let [_, v] = J({}), [y, b] = J(null), x = q(null), S = q({
144
145
  shouldSuppressClick: !1,
145
146
  at: 0
146
- }), C = K(0), w = K(null), { startEdgeDetection: T, stopEdgeScroll: ee } = je(c ?? { current: null }, w), E = K({});
147
+ }), C = q(0), w = q(null), { startEdgeDetection: T, stopEdgeScroll: ee } = Ne(c ?? { current: null }, w), E = q({});
147
148
  W(() => {
148
149
  x.current = y;
149
150
  }, [y]), W(() => () => {
@@ -167,7 +168,7 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
167
168
  at: 0
168
169
  };
169
170
  }, []), k = U((e, t, n, r, i = 1) => {
170
- if (!xe(t, r) || t.invalid) return;
171
+ if (!Ce(t, r) || t.invalid) return;
171
172
  e.preventDefault(), e.stopPropagation();
172
173
  let a = c?.current, o = a?.scrollLeft ?? 0, s = a?.getBoundingClientRect(), l = s ? e.clientX - s.left : 0, d = t.endMs ?? 0, f = t.startMs ?? 0, p = Math.max(1, i), m = r === "resize-end" ? n + p : n, h = l - (m - o), _ = {
173
174
  taskId: t.id,
@@ -214,7 +215,7 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
214
215
  let m = l - r.originAnchorPx;
215
216
  if (!d) {
216
217
  let e = {
217
- ...De(r, m, s, f),
218
+ ...ke(r, m, s, f),
218
219
  previewLeftPx: u
219
220
  };
220
221
  if (e.deltaUnits === r.deltaUnits && e.previewLeftPx === r.previewLeftPx && e.previewStartMs === r.previewStartMs && e.previewEndMs === r.previewEndMs) return;
@@ -225,16 +226,16 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
225
226
  x.current = t, b(t);
226
227
  return;
227
228
  }
228
- let h = Ce(m, p), _ = {
229
+ let h = Te(m, p), _ = {
229
230
  ...r,
230
231
  deltaUnits: h,
231
232
  previewLeftPx: u
232
233
  };
233
234
  if (r.dragMode === "move") {
234
- let e = Te(r.originStartMs, r.originEndMs, h * f);
235
+ let e = De(r.originStartMs, r.originEndMs, h * f);
235
236
  _.previewStartMs = e.startMs, _.previewEndMs = e.endMs;
236
237
  } else {
237
- let e = Ee({
238
+ let e = Oe({
238
239
  startMs: r.originStartMs,
239
240
  endMs: r.originEndMs,
240
241
  deltaMs: h * f,
@@ -267,7 +268,7 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
267
268
  at: Date.now()
268
269
  };
269
270
  let o = r;
270
- if (!xe(n.item, n.dragMode) || !o || !i) {
271
+ if (!Ce(n.item, n.dragMode) || !o || !i) {
271
272
  x.current = null, b(null);
272
273
  return;
273
274
  }
@@ -294,15 +295,15 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
294
295
  };
295
296
  let m, g;
296
297
  if (d) if (n.dragMode === "move") {
297
- let e = we(n.previewStartMs, f, "round"), t = e - n.previewStartMs;
298
+ let e = Ee(n.previewStartMs, f, "round"), t = e - n.previewStartMs;
298
299
  m = e, g = n.previewEndMs + t;
299
- } else n.dragMode === "resize-start" ? (m = we(n.previewStartMs, f, "round"), g = n.previewEndMs) : (m = n.previewStartMs, g = we(n.previewEndMs, f, "round"));
300
+ } else n.dragMode === "resize-start" ? (m = Ee(n.previewStartMs, f, "round"), g = n.previewEndMs) : (m = n.previewStartMs, g = Ee(n.previewEndMs, f, "round"));
300
301
  else {
301
302
  let e = Number.isFinite(n.item.rawStartMs) && Number.isFinite(n.item.baseStartMs) && Number.isFinite(n.previewStartMs), t = Number.isFinite(n.item.rawEndMs) && Number.isFinite(n.item.baseEndMs) && Number.isFinite(n.previewEndMs), r = e ? Math.round((n.previewStartMs - (n.item.baseStartMs ?? 0)) / s) : 0, i = t ? Math.round((n.previewEndMs - (n.item.baseEndMs ?? 0)) / s) : 0;
302
303
  m = e ? (n.item.rawStartMs ?? 0) + r * s : n.item.rawStartMs ?? 0, g = t ? (n.item.rawEndMs ?? 0) + i * s : n.item.rawEndMs ?? 0;
303
304
  }
304
305
  let _;
305
- _ = h(t) ? Oe({
306
+ _ = h(t) ? Ae({
306
307
  item: n.item,
307
308
  startMs: m,
308
309
  endMs: g,
@@ -310,7 +311,7 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
310
311
  snapUnitMs: f,
311
312
  changeType: n.dragMode,
312
313
  viewMode: t
313
- }) : Oe({
314
+ }) : Ae({
314
315
  item: n.item,
315
316
  startMs: m,
316
317
  endMs: g,
@@ -319,7 +320,7 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
319
320
  snapUnitMs: f,
320
321
  changeType: n.dragMode,
321
322
  viewMode: t
322
- }), ke(i(_)).catch((e) => {
323
+ }), je(i(_)).catch((e) => {
323
324
  console.error("[GanttChart] onTaskTimeChange rejected", e), E.current[c]?.opId === l && v((e) => {
324
325
  let t = { ...e };
325
326
  return delete t[c], t;
@@ -363,25 +364,25 @@ function Me({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
363
364
  }
364
365
  //#endregion
365
366
  //#region src/components/Gantt/GanttChart/utils/timelineFocus.ts
366
- function Ne(e, t, n) {
367
+ function Fe(e, t, n) {
367
368
  let r = Number(t) > 0 ? Number(t) : 0, i = Number(n) > 0 ? Number(n) : 0, a = Math.max(0, i - r);
368
369
  return Number.isFinite(e) ? Math.min(Math.max(0, e), a) : 0;
369
370
  }
370
- function Pe({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
371
+ function Ie({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
371
372
  let i = Number(n) > 0 ? Number(n) : 0;
372
373
  if (!Number.isFinite(e) || typeof t != "function" || i <= 0) return 0;
373
374
  let a = t(e);
374
- return Number.isFinite(a) ? Ne(a - i / 2, i, r) : 0;
375
+ return Number.isFinite(a) ? Fe(a - i / 2, i, r) : 0;
375
376
  }
376
377
  //#endregion
377
378
  //#region src/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.ts
378
- function Fe(e) {
379
+ function Le(e) {
379
380
  let t = Number(e);
380
381
  return Math.max((Number.isFinite(t) && t > 0 ? t : 0) * 4, 240);
381
382
  }
382
- function Ie(e, t) {
383
+ function Re(e, t) {
383
384
  if (!Array.isArray(e) || e.length === 0) return [];
384
- let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a = Fe(Number(e[0]?.width) > 0 ? Number(e[0].width) : i), o = e[e.length - 1], s = Ne(n, r, Number(o?.left) + Number(o?.width) > 0 ? Number(o.left) + Number(o.width) : 0), c = Math.max(0, s - a), l = s + r + a, u = e.length, d = 0, f = u - 1, p = u;
385
+ let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a = Le(Number(e[0]?.width) > 0 ? Number(e[0].width) : i), o = e[e.length - 1], s = Fe(n, r, Number(o?.left) + Number(o?.width) > 0 ? Number(o.left) + Number(o.width) : 0), c = Math.max(0, s - a), l = s + r + a, u = e.length, d = 0, f = u - 1, p = u;
385
386
  for (; d <= f;) {
386
387
  let t = d + f >> 1, n = e[t];
387
388
  n.left + n.width > c ? (p = t, f = t - 1) : d = t + 1;
@@ -397,9 +398,9 @@ function Ie(e, t) {
397
398
  for (let e = p; e <= m; e += 1) h.push({ index: e });
398
399
  return h;
399
400
  }
400
- function Le({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r, showWeekendHighlight: i, timelineStartMs: a, timelineWidth: o, viewMode: c }) {
401
+ function ze({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r, showWeekendHighlight: i, timelineStartMs: a, timelineWidth: o, viewMode: c }) {
401
402
  return {
402
- virtualColumns: G(() => Ie(e, {
403
+ virtualColumns: K(() => Re(e, {
403
404
  scrollLeft: n,
404
405
  viewportWidth: r,
405
406
  pixelsPerDay: t
@@ -409,11 +410,11 @@ function Le({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r
409
410
  n,
410
411
  r
411
412
  ]),
412
- weekendSegments: G(() => {
413
+ weekendSegments: K(() => {
413
414
  if (!i || o <= 0 || c !== "day") return [];
414
415
  let e = Math.max(0, n - 120), l = n + r + 120, u = Math.max(0, Math.floor(e / t)), d = Math.ceil(l / t), f = [];
415
416
  for (let e = u; e <= d; e += 1) {
416
- let n = a + e * s, r = oe(n);
417
+ let n = a + e * s, r = ae(n);
417
418
  (r === 0 || r === 6) && f.push({
418
419
  id: `weekend-${n}`,
419
420
  left: e * t,
@@ -432,8 +433,8 @@ function Le({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r
432
433
  ])
433
434
  };
434
435
  }
435
- X.extend(me), X.extend(ge);
436
- var Re = {
436
+ he.extend(ge), he.extend(ve);
437
+ var Be = {
437
438
  day: {
438
439
  amount: 1,
439
440
  unit: "day"
@@ -486,7 +487,7 @@ var Re = {
486
487
  amount: 1,
487
488
  unit: "minute"
488
489
  }
489
- }, ze = (e, t, n) => {
490
+ }, Ve = (e, t, n) => {
490
491
  switch (t) {
491
492
  case "halfDay": return e.hour() < 12 ? n("header.lower.halfDayAm") : n("header.lower.halfDayPm");
492
493
  case "sixHour": {
@@ -502,7 +503,7 @@ var Re = {
502
503
  case "oneMinute": return e.format("mm");
503
504
  default: return e.format("DD");
504
505
  }
505
- }, Be = (e, t, n) => {
506
+ }, He = (e, t, n) => {
506
507
  let r = C(e.valueOf());
507
508
  switch (t) {
508
509
  case "day": return r.format("DD");
@@ -511,25 +512,38 @@ var Re = {
511
512
  case "quarterMonth": return D(e.valueOf(), n);
512
513
  case "quarter": return n("header.lower.quarter", { quarter: r.quarter() });
513
514
  case "year": return r.month() < 6 ? n("firstHalf") : n("secondHalf");
514
- default: return ze(r, t, n);
515
+ default: return Ve(r, t, n);
515
516
  }
516
- }, Ve = (e, t) => {
517
+ }, Ue = (e, t) => {
517
518
  let n = C(e.valueOf()), r = y(t).headerLayout;
518
519
  return r === "dayNested" ? `day-${n.format("YYYY-MM-DD")}` : r === "hourNested" ? `hour-${n.format("YYYY-MM-DD-HH")}` : r === "quarterNested" ? `quarter-${n.format("YYYY")}-Q${n.quarter()}` : t === "day" || t === "week" ? `month-${n.format("YYYY-MM")}` : `year-${n.format("YYYY")}`;
519
- }, He = (e, t, n) => {
520
+ }, We = (e, t, n) => {
520
521
  let r = C(e.valueOf()), i = y(t).headerLayout;
521
- return i === "dayNested" ? n("header.top.monthDay", {
522
+ if (i === "dayNested") return { label: n("header.top.monthDay", {
522
523
  month: r.month() + 1,
523
524
  day: r.date()
524
- }) : i === "hourNested" ? r.hour() === 0 ? n("header.top.hourWithDate", {
525
- month: r.month() + 1,
526
- day: r.date(),
527
- hour: 0
528
- }) : n("header.top.hourOnly", { hour: r.hour() }) : i === "quarterNested" ? E(e.valueOf(), n) : t === "day" || t === "week" ? n("header.top.yearMonth", {
525
+ }) };
526
+ if (i === "hourNested") {
527
+ let e = r.hour();
528
+ if (e === 0) return { label: n("header.top.hourWithDate", {
529
+ month: r.month() + 1,
530
+ day: r.date(),
531
+ hour: 0
532
+ }) };
533
+ let i = n("header.top.hourOnly", { hour: e });
534
+ return t === "tenMinute" || t === "oneMinute" ? {
535
+ label: i,
536
+ dateLabel: n("header.top.monthDay", {
537
+ month: r.month() + 1,
538
+ day: r.date()
539
+ })
540
+ } : { label: i };
541
+ }
542
+ return i === "quarterNested" ? { label: E(e.valueOf(), n) } : t === "day" || t === "week" ? { label: n("header.top.yearMonth", {
529
543
  year: r.year(),
530
544
  month: r.month() + 1
531
- }) : n("header.top.year", { year: r.year() });
532
- }, Ue = (e, t, n, r, i, a, o) => {
545
+ }) } : { label: n("header.top.year", { year: r.year() }) };
546
+ }, Ge = (e, t, n, r, i, a, o) => {
533
547
  let s = _(r), c = A ?? 100;
534
548
  e.push({
535
549
  id: `${r}-${t}`,
@@ -537,64 +551,54 @@ var Re = {
537
551
  endMs: n,
538
552
  left: s ? e.length * c : M(t, i, a, r),
539
553
  width: s ? c : Math.max(1, ee(t, n, a, r)),
540
- label: Be(X(t), r, o)
554
+ label: He(he(t), r, o)
541
555
  });
542
- }, We = ({ viewMode: e, timelineStartMs: t, timelineEndMs: n, pixelsPerDay: r, formatMessage: i }) => {
543
- let a = [], o = Re[e] || Re.day, s = X(ae(t));
556
+ }, Ke = ({ viewMode: e, timelineStartMs: t, timelineEndMs: n, pixelsPerDay: r, formatMessage: i }) => {
557
+ let a = [], o = Be[e] || Be.day, s = he(P(t));
544
558
  _(e) && (s = s.startOf("month"));
545
- let c = X(ae(n));
559
+ let c = he(P(n));
546
560
  for (; s.isBefore(c);) {
547
561
  o.align && (s = o.align(s));
548
562
  let n = s.add(o.amount, o.unit);
549
- Ue(a, ie(s.valueOf()), ie(n.valueOf()), e, t, r, i), s = n;
563
+ Ge(a, ie(s.valueOf()), ie(n.valueOf()), e, t, r, i), s = n;
550
564
  }
551
565
  return a;
552
- }, Ge = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
566
+ }, qe = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
553
567
  if (!Array.isArray(e) || e.length === 0) return [];
554
568
  let r = [], i = null;
555
569
  for (let a of e) {
556
- let e = X(a.startMs), o = Ve(e, t);
557
- if (!i || i.key !== o) {
558
- i && r.push({
559
- id: i.key,
560
- left: i.left,
561
- width: i.width,
562
- label: i.label
563
- }), i = {
564
- key: o,
570
+ let e = he(a.startMs), o = Ue(e, t);
571
+ if (!i || i.id !== o) {
572
+ i && r.push(i), i = {
573
+ id: o,
565
574
  left: a.left,
566
575
  width: a.width,
567
- label: He(e, t, n)
576
+ ...We(e, t, n)
568
577
  };
569
578
  continue;
570
579
  }
571
580
  i.width += a.width;
572
581
  }
573
- return i !== null && r.push({
574
- id: i.key,
575
- left: i.left,
576
- width: i.width,
577
- label: i.label
578
- }), r;
579
- }, Ke = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.startMs < e.endMs, qe = (e) => {
580
- if (!Ke(e)) throw RangeError("Timeline range must be finite and satisfy startMs < endMs");
581
- }, Je = (e, t) => {
582
- if (qe(e), !Number.isFinite(t)) throw RangeError("Timeline time must be finite");
582
+ return i !== null && r.push(i), r;
583
+ }, Je = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.startMs < e.endMs, Ye = (e) => {
584
+ if (!Je(e)) throw RangeError("Timeline range must be finite and satisfy startMs < endMs");
585
+ }, Xe = (e, t) => {
586
+ if (Ye(e), !Number.isFinite(t)) throw RangeError("Timeline time must be finite");
583
587
  return e.startMs <= t && t < e.endMs;
584
- }, Ye = (e, t) => (qe(e), qe(t), e.startMs < t.endMs && t.startMs < e.endMs), Xe = (e, t) => {
585
- qe(e), qe(t);
588
+ }, Ze = (e, t) => (Ye(e), Ye(t), e.startMs < t.endMs && t.startMs < e.endMs), Qe = (e, t) => {
589
+ Ye(e), Ye(t);
586
590
  let n = Math.max(e.startMs, t.startMs), r = Math.min(e.endMs, t.endMs);
587
591
  return n < r ? {
588
592
  startMs: n,
589
593
  endMs: r
590
594
  } : null;
591
- }, Ze = (e, t) => {
595
+ }, $e = (e, t) => {
592
596
  if (!Number.isFinite(e) || e <= 0) throw RangeError(`${t} must be finite and greater than zero`);
593
- }, Qe = (e, t) => {
597
+ }, et = (e, t) => {
594
598
  if (Number.isFinite(e)) return e;
595
599
  if (Number.isFinite(t)) return t;
596
600
  throw RangeError("focusMs or fallbackFocusMs must be finite");
597
- }, $e = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
601
+ }, tt = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
598
602
  let a = (t - e) / s;
599
603
  if (a * i >= r) return {
600
604
  startMs: e,
@@ -602,24 +606,24 @@ var Re = {
602
606
  };
603
607
  let o = Math.ceil(r / i), c = Math.ceil((o - a) / 2) * s;
604
608
  return S(e - c, t + c, n);
605
- }, et = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
609
+ }, nt = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
606
610
  let a = (r / 2 + 281) / i * s;
607
- return $e({
611
+ return tt({
608
612
  ...S(Math.min(e.startMs, t - a), Math.max(e.endMs, t + a), n),
609
613
  viewMode: n,
610
614
  viewportWidth: r,
611
615
  pixelsPerDay: i
612
616
  });
613
- }, tt = ({ renderWindow: e, timelineCoords: t, scrollLeft: n, viewportWidth: r }) => {
614
- if (!Ke(e)) throw RangeError("renderWindow must be a valid timeline range");
617
+ }, rt = ({ renderWindow: e, timelineCoords: t, scrollLeft: n, viewportWidth: r }) => {
618
+ if (!Je(e)) throw RangeError("renderWindow must be a valid timeline range");
615
619
  if (!Number.isFinite(n) || n < 0) throw RangeError("scrollLeft must be finite and non-negative");
616
- Ze(r, "viewportWidth");
620
+ $e(r, "viewportWidth");
617
621
  let i = {
618
622
  startMs: t.timeAtX(n),
619
623
  endMs: t.timeAtX(n + r)
620
624
  };
621
- if (!Ke(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
622
- let a = Xe(i, e);
625
+ if (!Je(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
626
+ let a = Qe(i, e);
623
627
  if (!a) throw RangeError("Visible range must intersect renderWindow");
624
628
  let o = t.timeAtX(n + r / 2);
625
629
  if (!Number.isFinite(o)) throw RangeError("TimelineCoords must produce a finite focus");
@@ -628,65 +632,65 @@ var Re = {
628
632
  visibleRange: a,
629
633
  focusMs: o
630
634
  };
631
- }, nt = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
635
+ }, it = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
632
636
  if (!Number.isFinite(e) || e < 0) throw RangeError("scrollLeft must be finite and non-negative");
633
- if (Ze(t, "viewportWidth"), Ze(n, "timelineWidth"), !Number.isFinite(r) || r < 0) throw RangeError("guardBandPx must be finite and non-negative");
637
+ if ($e(t, "viewportWidth"), $e(n, "timelineWidth"), !Number.isFinite(r) || r < 0) throw RangeError("guardBandPx must be finite and non-negative");
634
638
  let i = Math.max(0, n - t);
635
639
  if (i === 0) return null;
636
640
  let a = Math.min(e, i), o = a <= r;
637
641
  return o === i - a <= r ? null : o ? "left" : "right";
638
- }, rt = ({ focusMs: e, fallbackFocusMs: t, viewMode: n, timeRangeConfig: r, viewportWidth: i, pixelsPerDay: a }) => {
639
- Ze(i, "viewportWidth"), Ze(a, "pixelsPerDay");
640
- let o = Qe(e, t), s = et({
642
+ }, at = ({ focusMs: e, fallbackFocusMs: t, viewMode: n, timeRangeConfig: r, viewportWidth: i, pixelsPerDay: a }) => {
643
+ $e(i, "viewportWidth"), $e(a, "pixelsPerDay");
644
+ let o = et(e, t), s = nt({
641
645
  range: j(r, o),
642
646
  focusMs: o,
643
647
  viewMode: n,
644
648
  viewportWidth: i,
645
649
  pixelsPerDay: a
646
650
  });
647
- if (!Ke(s)) throw RangeError("Viewport engine produced an invalid render window");
651
+ if (!Je(s)) throw RangeError("Viewport engine produced an invalid render window");
648
652
  return s;
649
- }, it = ({ focusMs: e, fallbackFocusMs: t, timelineCoords: n, viewportWidth: r, timelineWidth: i }) => {
650
- let a = Qe(e, t);
651
- return Ze(r, "viewportWidth"), Ze(i, "timelineWidth"), {
653
+ }, ot = ({ focusMs: e, fallbackFocusMs: t, timelineCoords: n, viewportWidth: r, timelineWidth: i }) => {
654
+ let a = et(e, t);
655
+ return $e(r, "viewportWidth"), $e(i, "timelineWidth"), {
652
656
  focusMs: a,
653
- scrollLeft: Pe({
657
+ scrollLeft: Ie({
654
658
  anchorMs: a,
655
659
  toX: n.toX,
656
660
  viewportWidth: r,
657
661
  timelineWidth: i
658
662
  })
659
663
  };
660
- }, at = (e) => {
664
+ }, st = (e) => {
661
665
  if (v(e)) {
662
666
  let t = g(e);
663
- return we(Date.now(), t, "floor") + t / 2;
667
+ return Ee(Date.now(), t, "floor") + t / 2;
664
668
  }
665
669
  return T(Date.now()) + s / 2;
666
- }, ot = (e, t) => {
670
+ }, ct = (e, t) => {
667
671
  if (v(t)) {
668
672
  let n = g(t);
669
- return we(e, n, "floor") + n + 1;
673
+ return Ee(e, n, "floor") + n + 1;
670
674
  }
671
675
  return T(e) + s + 1;
672
- }, st = (e) => {
673
- let [t, n] = q(() => at(e)), r = K(null), i = U(() => {
676
+ }, lt = (e) => {
677
+ let [t, n] = J(() => st(e)), r = q(null), i = U(() => {
674
678
  r.current &&= (clearTimeout(r.current), null);
675
679
  }, []), a = U(() => {
676
680
  i();
677
- let t = Date.now(), o = ot(t, e);
681
+ let t = Date.now(), o = ct(t, e);
678
682
  r.current = setTimeout(() => {
679
- n(at(e)), a();
683
+ n(st(e)), a();
680
684
  }, Math.max(1, o - t));
681
685
  }, [i, e]);
682
- W(() => (n(at(e)), a(), i), [
686
+ W(() => (n(st(e)), a(), i), [
683
687
  e,
684
688
  a,
685
689
  i
686
690
  ]);
687
- let o = de();
691
+ let o = ue();
688
692
  return W(() => {
689
- o === "visible" && (n(at(e)), a());
693
+ o === "visible" && (n(st(e)), a());
690
694
  }, [
691
695
  o,
692
696
  a,
@@ -695,59 +699,61 @@ var Re = {
695
699
  };
696
700
  //#endregion
697
701
  //#region src/components/Gantt/GanttChart/hooks/useTimelineViewportController.ts
698
- function ct({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef: r, contentSize: i, headerTrackRef: a, formatMessage: o, isHorizontalScrollbarInteracting: s, isTaskBarInteracting: c = !1 }) {
699
- let l = k(n, t), u = G(() => re(n, e), [n, e]), d = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, f = K(!1), [p, m] = q(!1), [h, g] = q(d), _ = K(null), v = K(!1), y = K(!1), b = K(null), x = K(null), S = K(null), [C, w] = q(0), T = U((e) => {
702
+ function ut({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef: r, contentSize: i, headerTrackRef: a, formatMessage: o, isHorizontalScrollbarInteracting: s, isTaskBarInteracting: c = !1 }) {
703
+ let l = k(n, t), u = K(() => re(n, e), [n, e]), d = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, f = q(!1), [p, m] = J(!1), [h, g] = J(d), _ = q(null), v = q(!1), y = q(!1), b = q(null), x = q(null), S = q(null), [C, w] = J(0), T = q(null), ee = U((e) => {
700
704
  let t = S.current;
701
705
  if (!t || !e) return !1;
702
706
  let n = e.scrollLeft || 0;
703
707
  return Math.abs(n - t.targetLeft) > 1;
704
- }, []), ee = U((e) => {
708
+ }, []), E = U((e) => {
705
709
  let t = S.current;
706
710
  t && Math.abs(e - t.targetLeft) <= 1 && (S.current = null);
707
- }, []), E = U(() => {
711
+ }, []), D = U(() => {
708
712
  x.current !== null && (cancelAnimationFrame(x.current), x.current = null), b.current = null;
709
- }, []), D = U((e) => {
710
- E();
713
+ }, []), O = U((e) => {
714
+ D();
711
715
  let t = { left: e };
712
716
  b.current = t, x.current = requestAnimationFrame(() => {
713
717
  x.current = null, b.current === t && (b.current = null);
714
718
  });
715
- }, [E]), [O, A] = q(0), j = K(0), M = K(0), N = K(null), ne = U((e) => {
716
- M.current = e, N.current === null && (N.current = requestAnimationFrame(() => {
719
+ }, [D]), [A, j] = J(0), M = q(0), te = q(0), N = q(null), ie = U((e) => {
720
+ te.current = e, N.current === null && (N.current = requestAnimationFrame(() => {
717
721
  N.current = null;
718
- let e = M.current;
719
- A((t) => t === e ? t : e);
722
+ let e = te.current;
723
+ j((t) => t === e ? t : e);
720
724
  }));
725
+ }, []), P = U(() => {
726
+ T.current !== null && (cancelAnimationFrame(T.current), T.current = null);
721
727
  }, []);
722
728
  W(() => () => {
723
- N.current !== null && cancelAnimationFrame(N.current), E();
724
- }, [E]);
725
- let [ie, ae] = q(null), oe = K(n), se = oe.current === n, ce = se ? ie : null, P = U(() => {
729
+ N.current !== null && cancelAnimationFrame(N.current), P(), D();
730
+ }, [P, D]);
731
+ let [ae, oe] = J(null), F = q(n), se = F.current === n, ce = se ? ae : null, I = U(() => {
726
732
  let e = _.current;
727
- return e !== null && Number.isFinite(e) ? e : at(n);
728
- }, [n]), F = U((e) => {
733
+ return e !== null && Number.isFinite(e) ? e : st(n);
734
+ }, [n]), L = U((e) => {
729
735
  Number.isFinite(e) && (_.current = e);
730
- }, []), I = U((e) => {
736
+ }, []), R = U((e) => {
731
737
  S.current = null;
732
- let t = rt({
738
+ let t = at({
733
739
  focusMs: e,
734
- fallbackFocusMs: P(),
740
+ fallbackFocusMs: I(),
735
741
  viewMode: n,
736
742
  timeRangeConfig: u,
737
743
  viewportWidth: h || 1e3,
738
744
  pixelsPerDay: l
739
745
  });
740
- return ae(t), v.current = !0, t;
746
+ return oe(t), v.current = !0, t;
741
747
  }, [
742
748
  u,
743
749
  l,
744
- P,
750
+ I,
745
751
  n,
746
752
  h
747
753
  ]);
748
754
  W(() => {
749
- oe.current = n, I(P());
750
- }, [e?.bufferDaysBefore, e?.bufferDaysAfter]), ue(() => {
755
+ F.current = n, R(I());
756
+ }, [e?.bufferDaysBefore, e?.bufferDaysAfter]), le(() => {
751
757
  let e = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, t = r.current?.clientWidth !== null && r.current?.clientWidth !== void 0 && Number(r.current.clientWidth) > 0 ? Number(r.current.clientWidth) : 0, n = e > 0 ? e : f.current ? t : 0;
752
758
  n > 0 && n !== h && g(n);
753
759
  }, [
@@ -755,8 +761,8 @@ function ct({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
755
761
  i?.width,
756
762
  h
757
763
  ]);
758
- let L = G(() => ce || rt({
759
- focusMs: P(),
764
+ let z = K(() => ce || at({
765
+ focusMs: I(),
760
766
  viewMode: n,
761
767
  timeRangeConfig: u,
762
768
  viewportWidth: h || 1e3,
@@ -765,247 +771,266 @@ function ct({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
765
771
  ce,
766
772
  u,
767
773
  l,
768
- P,
774
+ I,
769
775
  n,
770
776
  h
771
- ]), { timelineStartMs: R, timelineEndMs: z } = G(() => ({
772
- timelineStartMs: L.startMs,
773
- timelineEndMs: L.endMs
774
- }), [L]), B = G(() => We({
777
+ ]), { timelineStartMs: B, timelineEndMs: V } = K(() => ({
778
+ timelineStartMs: z.startMs,
779
+ timelineEndMs: z.endMs
780
+ }), [z]), H = K(() => Ke({
775
781
  viewMode: n,
776
- timelineStartMs: R,
777
- timelineEndMs: z,
782
+ timelineStartMs: B,
783
+ timelineEndMs: V,
778
784
  pixelsPerDay: l,
779
785
  formatMessage: o
780
786
  }), [
781
787
  n,
782
- R,
783
- z,
788
+ B,
789
+ V,
784
790
  l,
785
791
  o
786
- ]), V = G(() => te({
792
+ ]), G = K(() => ne({
787
793
  viewMode: n,
788
- timelineStartMs: R,
789
- timelineEndMs: z,
794
+ timelineStartMs: B,
795
+ timelineEndMs: V,
790
796
  pixelsPerDay: l,
791
- lowerSegments: B
797
+ lowerSegments: H
792
798
  }), [
793
799
  n,
794
- R,
795
- z,
800
+ B,
801
+ V,
796
802
  l,
797
- B
798
- ]), H = G(() => {
799
- if (B.length === 0) return 0;
800
- let e = B[B.length - 1];
803
+ H
804
+ ]), Y = K(() => {
805
+ if (H.length === 0) return 0;
806
+ let e = H[H.length - 1];
801
807
  return e.left + e.width;
802
- }, [B]), le = U(() => v.current ? !1 : (I(P()), !0), [P, I]);
803
- ue(() => {
804
- oe.current !== n && (oe.current = n, I(P()));
808
+ }, [H]), ue = U(() => v.current ? !1 : (R(I()), !0), [I, R]);
809
+ le(() => {
810
+ F.current !== n && (F.current = n, R(I()));
805
811
  }, [
806
812
  n,
807
- P,
808
- I
813
+ I,
814
+ R
809
815
  ]);
810
- let J = st(n), de = G(() => H <= 0 ? null : V.toX(J), [
811
- J,
812
- V,
813
- H
814
- ]), fe = U((e) => {
816
+ let de = lt(n), fe = K(() => Y <= 0 ? null : G.toX(de), [
817
+ de,
818
+ G,
819
+ Y
820
+ ]), X = U((e) => {
815
821
  let t = a?.current;
816
822
  t && t.style.setProperty("--gantt-scroll-left", `${e}px`);
817
823
  }, [a]), pe = U((e, t) => {
818
- D(t), e.scrollLeft = t, fe(t), A(t), j.current = t;
819
- }, [fe, D]), Y = U(() => {
824
+ e.scrollLeft = t;
825
+ let n = e.scrollLeft || 0, r = !(Math.abs(n - t) <= 1) && e.scrollWidth + 1 < Y;
826
+ return O(n), X(n), j(n), M.current = n, !r;
827
+ }, [
828
+ X,
829
+ O,
830
+ Y
831
+ ]), me = U(() => {
820
832
  let e = r.current, t = h;
821
- if (!e || t <= 0 || H <= 0) return !1;
822
- let { scrollLeft: n } = it({
833
+ if (!e || t <= 0 || Y <= 0) return !1;
834
+ let { scrollLeft: n } = ot({
823
835
  focusMs: _.current ?? NaN,
824
- fallbackFocusMs: P(),
825
- timelineCoords: V,
836
+ fallbackFocusMs: I(),
837
+ timelineCoords: G,
826
838
  viewportWidth: t,
827
- timelineWidth: H
839
+ timelineWidth: Y
828
840
  });
829
- return pe(e, n), !0;
841
+ return pe(e, n);
830
842
  }, [
831
843
  pe,
832
844
  r,
833
- P,
834
- V,
835
- H,
845
+ I,
846
+ G,
847
+ Y,
836
848
  h
837
- ]), X = U((e) => {
849
+ ]), he = U(() => {
850
+ v.current = !1, P(), f.current || (f.current = !0, m(!0));
851
+ }, [P]), ge = U(() => me() ? (he(), !0) : !1, [me, he]), _e = U(() => {
852
+ if (T.current !== null) return;
853
+ let e = 0, t = () => {
854
+ T.current = null, v.current && (ge() || (e += 1, e < 30 && (T.current = requestAnimationFrame(t))));
855
+ };
856
+ T.current = requestAnimationFrame(t);
857
+ }, [ge]), ve = U((e) => {
838
858
  let t = e.currentTarget.scrollLeft, n = h, r = b.current, i = r !== null && Math.abs(t - r.left) <= 1;
839
- r && E(), !i && f.current && (y.current = !0), fe(t);
840
- let a = t !== j.current;
841
- if (j.current = t, a && ne(t), n > 0 && !i) {
842
- let e = Ne(t, n, H);
843
- F(tt({
859
+ if (v.current && ge()) return;
860
+ let a = v.current, o = n > 0 && !i && !a;
861
+ r && D(), !i && !a && f.current && (y.current = !0), X(t);
862
+ let s = t !== M.current;
863
+ if (M.current = t, s && ie(t), o) {
864
+ let e = Fe(t, n, Y);
865
+ L(rt({
844
866
  renderWindow: {
845
- startMs: R,
846
- endMs: z
867
+ startMs: B,
868
+ endMs: V
847
869
  },
848
- timelineCoords: V,
870
+ timelineCoords: G,
849
871
  scrollLeft: e,
850
872
  viewportWidth: n
851
873
  }).focusMs);
852
874
  }
853
- ee(t);
875
+ E(t);
854
876
  }, [
855
- fe,
877
+ X,
878
+ D,
879
+ ge,
880
+ G,
881
+ h,
882
+ ie,
883
+ L,
856
884
  E,
857
885
  V,
858
- h,
859
- ne,
860
- F,
861
- ee,
862
- z,
863
- R,
864
- H
865
- ]), me = U(() => {
866
- let e = at(n);
867
- F(e), I(e);
886
+ B,
887
+ Y
888
+ ]), ye = U(() => {
889
+ let e = st(n);
890
+ L(e), R(e);
868
891
  }, [
869
- I,
870
- F,
892
+ R,
893
+ L,
871
894
  n
872
- ]), he = U((e) => {
895
+ ]), be = U((e) => {
873
896
  let t = r.current, n = e?.targetMs;
874
897
  if (!t || !Number.isFinite(n)) return;
875
898
  let i = t.clientWidth > 0 ? t.clientWidth : h;
876
- if (n < R || n >= z) {
877
- S.current = null, F(n), I(n);
899
+ if (n < B || n >= V) {
900
+ S.current = null, L(n), R(n);
878
901
  return;
879
902
  }
880
- let a = Pe({
903
+ let a = Ie({
881
904
  anchorMs: n,
882
- toX: V.toX,
905
+ toX: G.toX,
883
906
  viewportWidth: i,
884
- timelineWidth: H
907
+ timelineWidth: Y
885
908
  }), o = t.scrollLeft || 0;
886
909
  if (!(i > 0 && Math.abs(a - o) <= i * 1.5)) {
887
- F(n), I(n);
910
+ L(n), R(n);
888
911
  return;
889
912
  }
890
913
  let s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
891
- s === "smooth" ? S.current = { targetLeft: a } : (S.current = null, D(a)), t.scrollTo({
914
+ s === "smooth" ? S.current = { targetLeft: a } : (S.current = null, O(a)), t.scrollTo({
892
915
  left: a,
893
916
  behavior: s
894
- }), F(n), s === "auto" && (fe(a), A(a), j.current = a);
917
+ }), L(n), s === "auto" && (X(a), j(a), M.current = a);
895
918
  }, [
896
- fe,
919
+ X,
897
920
  r,
898
- D,
899
- I,
900
- F,
901
- V,
902
- z,
921
+ O,
903
922
  R,
904
- H,
923
+ L,
924
+ G,
925
+ V,
926
+ B,
927
+ Y,
905
928
  h
906
929
  ]);
907
930
  W(() => {
908
- if (!f.current || !h || !H || v.current || !y.current) return;
909
- let e = r.current, t = e?.scrollLeft ?? O, n = nt({
931
+ if (!f.current || !h || !Y || v.current || !y.current) return;
932
+ let e = r.current, t = e?.scrollLeft ?? A, n = it({
910
933
  scrollLeft: Math.max(0, t),
911
934
  viewportWidth: h,
912
- timelineWidth: H,
935
+ timelineWidth: Y,
913
936
  guardBandPx: 280
914
937
  });
915
- s || c || T(e) || (e && ee(e.scrollLeft || 0), n && le());
938
+ s || c || ee(e) || (e && E(e.scrollLeft || 0), n && ue());
916
939
  }, [
917
- O,
918
- H,
940
+ A,
941
+ Y,
919
942
  h,
920
943
  r,
921
- T,
922
944
  ee,
923
- le,
945
+ E,
946
+ ue,
924
947
  s,
925
948
  c,
926
949
  C
927
- ]), ue(() => {
928
- !f.current || h <= 0 || I(P());
950
+ ]), le(() => {
951
+ !f.current || h <= 0 || R(I());
929
952
  }, [
930
- P,
931
953
  I,
954
+ R,
932
955
  h
933
- ]), ue(() => {
934
- v.current && (h <= 0 || H <= 0 || Y() && (v.current = !1, f.current || (f.current = !0, m(!0))));
956
+ ]), le(() => {
957
+ v.current && (h <= 0 || Y <= 0 || ge() || _e());
935
958
  }, [
959
+ ge,
960
+ _e,
936
961
  Y,
937
- H,
938
962
  h,
939
- ie
940
- ]), ue(() => {
941
- if (!f.current && h > 0 && H > 0) {
942
- if (Number.isFinite(_.current ?? NaN) || F(at(n)), !ie) {
943
- I(P());
963
+ ae
964
+ ]), le(() => {
965
+ if (!f.current && h > 0 && Y > 0) {
966
+ if (Number.isFinite(_.current ?? NaN) || L(st(n)), !ae) {
967
+ R(I());
944
968
  return;
945
969
  }
946
- v.current = !0, Y(), v.current = !1, f.current = !0, m(!0);
970
+ v.current = !0, ge() || _e();
947
971
  }
948
972
  }, [
949
- Y,
950
- P,
951
973
  I,
952
- F,
953
- ie,
954
- H,
974
+ R,
975
+ ge,
976
+ _e,
977
+ L,
978
+ ae,
979
+ Y,
955
980
  h,
956
981
  n
957
982
  ]);
958
- let ge = U((e) => {
983
+ let xe = U((e) => {
959
984
  let t = h;
960
- t <= 0 || F(V.timeAtX(e + t / 2));
985
+ t <= 0 || L(G.timeAtX(e + t / 2));
961
986
  }, [
962
987
  h,
963
- V,
964
- F
965
- ]), _e = U(() => {
988
+ G,
989
+ L
990
+ ]), Se = U(() => {
966
991
  let e = r.current;
967
992
  if (!e) return;
968
993
  let t = h, n = e.scrollLeft || 0, i = Math.max(0, n - t);
969
994
  if (Math.abs(i - n) <= 1) {
970
995
  S.current = null;
971
- let e = V.timeAtX(n - t / 2);
972
- F(e), I(e);
996
+ let e = G.timeAtX(n - t / 2);
997
+ L(e), R(e);
973
998
  return;
974
999
  }
975
1000
  S.current = { targetLeft: i }, e.scrollTo({
976
1001
  left: i,
977
1002
  behavior: "smooth"
978
- }), ge(i);
1003
+ }), xe(i);
979
1004
  }, [
980
1005
  r,
981
- I,
982
- F,
983
- V,
984
- ge,
1006
+ R,
1007
+ L,
1008
+ G,
1009
+ xe,
985
1010
  h
986
- ]), ve = U(() => {
1011
+ ]), Ce = U(() => {
987
1012
  let e = r.current;
988
1013
  if (!e) return;
989
- let t = h, n = e.scrollLeft || 0, i = Math.max(0, H - t), a = Ne(n + t, t, H);
1014
+ let t = h, n = e.scrollLeft || 0, i = Math.max(0, Y - t), a = Fe(n + t, t, Y);
990
1015
  if (Math.abs(a - n) <= 1) {
991
1016
  if (S.current = null, a >= i - 1) {
992
- let e = V.timeAtX(n + t * 1.5);
993
- F(e), I(e);
1017
+ let e = G.timeAtX(n + t * 1.5);
1018
+ L(e), R(e);
994
1019
  }
995
1020
  return;
996
1021
  }
997
1022
  S.current = { targetLeft: a }, e.scrollTo({
998
1023
  left: a,
999
1024
  behavior: "smooth"
1000
- }), ge(a);
1025
+ }), xe(a);
1001
1026
  }, [
1002
1027
  r,
1003
- I,
1004
- F,
1005
- V,
1028
+ R,
1029
+ L,
1030
+ G,
1006
1031
  h,
1007
- H,
1008
- ge
1032
+ Y,
1033
+ xe
1009
1034
  ]);
1010
1035
  W(() => {
1011
1036
  let e = r.current;
@@ -1015,23 +1040,23 @@ function ct({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
1015
1040
  };
1016
1041
  return e.addEventListener("scrollend", t), () => e.removeEventListener("scrollend", t);
1017
1042
  }, [r]);
1018
- let ye = (!se || v.current) && H > 0 && h > 0 ? it({
1043
+ let we = (!se || v.current) && Y > 0 && h > 0 ? ot({
1019
1044
  focusMs: _.current ?? NaN,
1020
- fallbackFocusMs: P(),
1021
- timelineCoords: V,
1045
+ fallbackFocusMs: I(),
1046
+ timelineCoords: G,
1022
1047
  viewportWidth: h,
1023
- timelineWidth: H
1024
- }).scrollLeft : O, { visibleStartMs: be, visibleEndMs: xe } = G(() => {
1025
- if (H <= 0 || h <= 0) return {
1026
- visibleStartMs: R,
1027
- visibleEndMs: R
1048
+ timelineWidth: Y
1049
+ }).scrollLeft : A, { visibleStartMs: Te, visibleEndMs: Ee } = K(() => {
1050
+ if (Y <= 0 || h <= 0) return {
1051
+ visibleStartMs: B,
1052
+ visibleEndMs: B
1028
1053
  };
1029
- let e = Ne(ye, h, H), { visibleRange: t } = tt({
1054
+ let e = Fe(we, h, Y), { visibleRange: t } = rt({
1030
1055
  renderWindow: {
1031
- startMs: R,
1032
- endMs: z
1056
+ startMs: B,
1057
+ endMs: V
1033
1058
  },
1034
- timelineCoords: V,
1059
+ timelineCoords: G,
1035
1060
  scrollLeft: e,
1036
1061
  viewportWidth: h
1037
1062
  });
@@ -1040,41 +1065,41 @@ function ct({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
1040
1065
  visibleEndMs: t.endMs
1041
1066
  };
1042
1067
  }, [
1043
- ye,
1068
+ we,
1069
+ G,
1044
1070
  V,
1045
- z,
1046
- R,
1047
- H,
1071
+ B,
1072
+ Y,
1048
1073
  h
1049
1074
  ]);
1050
1075
  return {
1051
1076
  pixelsPerDay: l,
1052
1077
  viewportWidth: h,
1053
- scrollLeft: ye,
1054
- timelineStartMs: R,
1055
- timelineEndMs: z,
1056
- visibleStartMs: be,
1057
- visibleEndMs: xe,
1058
- lowerSegments: B,
1059
- timelineCoords: V,
1060
- timelineWidth: H,
1061
- todayCenterMs: J,
1062
- todayLineLeft: de,
1078
+ scrollLeft: we,
1079
+ timelineStartMs: B,
1080
+ timelineEndMs: V,
1081
+ visibleStartMs: Te,
1082
+ visibleEndMs: Ee,
1083
+ lowerSegments: H,
1084
+ timelineCoords: G,
1085
+ timelineWidth: Y,
1086
+ todayCenterMs: de,
1087
+ todayLineLeft: fe,
1063
1088
  isInitialLayoutReady: p,
1064
- handleContentScroll: X,
1065
- handleTodayClick: me,
1066
- handleOffscreenJump: he,
1067
- handleScrollPrev: _e,
1068
- handleScrollNext: ve
1089
+ handleContentScroll: ve,
1090
+ handleTodayClick: ye,
1091
+ handleOffscreenJump: be,
1092
+ handleScrollPrev: Se,
1093
+ handleScrollNext: Ce
1069
1094
  };
1070
1095
  }
1071
1096
  //#endregion
1072
1097
  //#region src/components/Gantt/GanttChart/hooks/useNormalizedItems.ts
1073
- function lt({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
1074
- return { normalizedItems: G(() => {
1098
+ function dt({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
1099
+ return { normalizedItems: K(() => {
1075
1100
  let r = Array.isArray(e) ? e : [], i = [], a = b(n) ? n : "day";
1076
1101
  for (let e = 0; e < r.length; e++) {
1077
- let n = r[e], o = String(n?.id ?? `row-${e}`), { rawStartMs: s, rawEndMs: c, baseStartMs: l, baseEndMs: u, invalid: d } = N(n?.start, n?.end), f = t[o], p = n?.type === "summary" ? !1 : d, m = O({
1102
+ let n = r[e], o = String(n?.id ?? `row-${e}`), { rawStartMs: s, rawEndMs: c, baseStartMs: l, baseEndMs: u, invalid: d } = te(n?.start, n?.end), f = t[o], p = n?.type === "summary" ? !1 : d, m = O({
1078
1103
  rawStartMs: s,
1079
1104
  rawEndMs: c,
1080
1105
  baseStartMs: l,
@@ -1110,12 +1135,12 @@ function lt({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }
1110
1135
  }
1111
1136
  //#endregion
1112
1137
  //#region src/components/Gantt/GanttChart/hooks/useGanttScrollbars.tsx
1113
- function ut(e, t) {
1114
- let [n, r] = q(!1);
1115
- return ue(() => {
1138
+ function ft(e, t) {
1139
+ let [n, r] = J(!1);
1140
+ return le(() => {
1116
1141
  let n = e.current, i = t.current;
1117
1142
  if (!n || !i) return;
1118
- let a = _e({
1143
+ let a = ye({
1119
1144
  target: n,
1120
1145
  elements: { viewport: i }
1121
1146
  }, { scrollbars: {
@@ -1127,7 +1152,7 @@ function ut(e, t) {
1127
1152
  e.pointerType === "mouse" && e.button !== 0 || (s = !0, c = e.pointerId, r(!0));
1128
1153
  }, u = (e) => {
1129
1154
  if (!s) return;
1130
- let t = e.pointerId, n = "pointerId" in e && F(t) ? t : null;
1155
+ let t = e.pointerId, n = "pointerId" in e && ce(t) ? t : null;
1131
1156
  n !== null && c !== null && n !== c || (s = !1, c = null, r(!1));
1132
1157
  }, d = { capture: !0 };
1133
1158
  return o.addEventListener("pointerdown", l, d), o.addEventListener("lostpointercapture", u, d), document.addEventListener("pointerup", u, d), document.addEventListener("pointercancel", u, d), document.addEventListener("lostpointercapture", u, d), window.addEventListener("blur", u), () => {
@@ -1137,50 +1162,92 @@ function ut(e, t) {
1137
1162
  }
1138
1163
  //#endregion
1139
1164
  //#region src/components/Gantt/GanttChart/utils/timelineMarkers.ts
1140
- function dt(e, t, n, r, i) {
1141
- return !!e && Number.isFinite(r) && Je(i, r) && t !== null && Number.isFinite(t) && t >= 0 && t <= n;
1165
+ function pt(e, t, n, r, i) {
1166
+ return !!e && Number.isFinite(r) && Xe(i, r) && t !== null && Number.isFinite(t) && t >= 0 && t <= n;
1142
1167
  }
1143
1168
  var Z = {
1144
- root: "_root_1m9dr_1",
1145
- timelineHost: "_timelineHost_1m9dr_12",
1146
- timelineContent: "_timelineContent_1m9dr_19",
1147
- canvas: "_canvas_1m9dr_27",
1148
- weekendBg: "_weekendBg_1m9dr_33",
1149
- colLine: "_colLine_1m9dr_40",
1150
- rowLine: "_rowLine_1m9dr_49",
1151
- rowHoverBg: "_rowHoverBg_1m9dr_56",
1152
- todayIndicator: "_todayIndicator_1m9dr_65",
1153
- todayIndicatorContentLine: "_todayIndicatorContentLine_1m9dr_73",
1154
- todayIndicatorLine: "_todayIndicatorLine_1m9dr_77",
1155
- todayIndicatorHeaderDot: "_todayIndicatorHeaderDot_1m9dr_86",
1156
- calendar: "_calendar_1m9dr_98",
1157
- calendarTrack: "_calendarTrack_1m9dr_105",
1158
- calendarToolbar: "_calendarToolbar_1m9dr_112",
1159
- headerCell: "_headerCell_1m9dr_126",
1160
- headerCellTop: "_headerCellTop_1m9dr_140",
1161
- headerCellBottom: "_headerCellBottom_1m9dr_147",
1162
- isActive: "_isActive_1m9dr_152",
1163
- headerColLine: "_headerColLine_1m9dr_156",
1164
- headerCellStickyText: "_headerCellStickyText_1m9dr_164",
1165
- offscreenRow: "_offscreenRow_1m9dr_171",
1166
- offscreenTrack: "_offscreenTrack_1m9dr_179",
1167
- offscreenBtn: "_offscreenBtn_1m9dr_185",
1168
- offscreenBtnLeft: "_offscreenBtnLeft_1m9dr_209",
1169
- offscreenBtnRight: "_offscreenBtnRight_1m9dr_214",
1170
- bar: "_bar_1m9dr_220",
1171
- barProgress: "_barProgress_1m9dr_238",
1172
- barResizeHandle: "_barResizeHandle_1m9dr_241",
1173
- isReadonly: "_isReadonly_1m9dr_251",
1174
- isDragging: "_isDragging_1m9dr_255",
1175
- isMicro: "_isMicro_1m9dr_267",
1176
- isFull: "_isFull_1m9dr_292",
1177
- barLabel: "_barLabel_1m9dr_296",
1178
- isHidden: "_isHidden_1m9dr_306",
1179
- isOutside: "_isOutside_1m9dr_310",
1180
- barResizeHandleLeft: "_barResizeHandleLeft_1m9dr_348",
1181
- barResizeHandleRight: "_barResizeHandleRight_1m9dr_356"
1182
- }, ft = B.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackRef: r, virtualColumns: i, lowerSegments: a, todayLineLeft: o, todayCenterMs: s, showTodayLine: c, viewMode: l, availableModes: u, formatMessage: d, onViewModeChange: f, onTodayClick: p, onScrollPrev: m, onScrollNext: h }) => {
1183
- let g = G(() => Ge({
1169
+ root: "_root_1ncav_1",
1170
+ timelineHost: "_timelineHost_1ncav_12",
1171
+ timelineContent: "_timelineContent_1ncav_19",
1172
+ canvas: "_canvas_1ncav_27",
1173
+ weekendBg: "_weekendBg_1ncav_33",
1174
+ colLine: "_colLine_1ncav_40",
1175
+ rowLine: "_rowLine_1ncav_49",
1176
+ rowHoverBg: "_rowHoverBg_1ncav_56",
1177
+ todayIndicator: "_todayIndicator_1ncav_65",
1178
+ todayIndicatorContentLine: "_todayIndicatorContentLine_1ncav_73",
1179
+ todayIndicatorLine: "_todayIndicatorLine_1ncav_77",
1180
+ todayIndicatorHeaderDot: "_todayIndicatorHeaderDot_1ncav_86",
1181
+ calendar: "_calendar_1ncav_98",
1182
+ calendarTrack: "_calendarTrack_1ncav_105",
1183
+ calendarToolbar: "_calendarToolbar_1ncav_112",
1184
+ headerCell: "_headerCell_1ncav_126",
1185
+ headerCellTop: "_headerCellTop_1ncav_140",
1186
+ headerCellBottom: "_headerCellBottom_1ncav_147",
1187
+ isActive: "_isActive_1ncav_152",
1188
+ headerColLine: "_headerColLine_1ncav_156",
1189
+ headerCellStickyText: "_headerCellStickyText_1ncav_164",
1190
+ headerCellDatePrefix: "_headerCellDatePrefix_1ncav_172",
1191
+ offscreenRow: "_offscreenRow_1ncav_178",
1192
+ offscreenTrack: "_offscreenTrack_1ncav_186",
1193
+ offscreenBtn: "_offscreenBtn_1ncav_192",
1194
+ offscreenBtnLeft: "_offscreenBtnLeft_1ncav_216",
1195
+ offscreenBtnRight: "_offscreenBtnRight_1ncav_221",
1196
+ bar: "_bar_1ncav_227",
1197
+ barProgress: "_barProgress_1ncav_245",
1198
+ barResizeHandle: "_barResizeHandle_1ncav_248",
1199
+ isReadonly: "_isReadonly_1ncav_258",
1200
+ isDragging: "_isDragging_1ncav_262",
1201
+ isMicro: "_isMicro_1ncav_274",
1202
+ isFull: "_isFull_1ncav_299",
1203
+ barLabel: "_barLabel_1ncav_303",
1204
+ isHidden: "_isHidden_1ncav_313",
1205
+ isOutside: "_isOutside_1ncav_317",
1206
+ barResizeHandleLeft: "_barResizeHandleLeft_1ncav_355",
1207
+ barResizeHandleRight: "_barResizeHandleRight_1ncav_363"
1208
+ }, mt = {
1209
+ initial: {
1210
+ opacity: 0,
1211
+ x: -10
1212
+ },
1213
+ animate: {
1214
+ opacity: 1,
1215
+ x: 0
1216
+ },
1217
+ exit: {
1218
+ opacity: 0,
1219
+ x: -10
1220
+ },
1221
+ transition: {
1222
+ duration: .16,
1223
+ ease: "easeOut"
1224
+ }
1225
+ }, ht = {
1226
+ duration: .16,
1227
+ ease: "easeOut"
1228
+ }, gt = B.memo(({ label: e, dateLabel: t, isReadingAnchor: n }) => t ? /* @__PURE__ */ z("span", {
1229
+ className: Z.headerCellStickyText,
1230
+ children: [/* @__PURE__ */ R(fe, {
1231
+ initial: !1,
1232
+ mode: "popLayout",
1233
+ children: n ? /* @__PURE__ */ R(X.span, {
1234
+ className: Z.headerCellDatePrefix,
1235
+ initial: mt.initial,
1236
+ animate: mt.animate,
1237
+ exit: mt.exit,
1238
+ transition: mt.transition,
1239
+ children: t
1240
+ }, "date-prefix") : null
1241
+ }), /* @__PURE__ */ R(X.span, {
1242
+ layout: "position",
1243
+ transition: ht,
1244
+ children: e
1245
+ })]
1246
+ }) : /* @__PURE__ */ R("span", {
1247
+ className: Z.headerCellStickyText,
1248
+ children: e
1249
+ })), _t = B.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackRef: r, virtualColumns: i, lowerSegments: a, todayLineLeft: o, todayCenterMs: s, showTodayLine: c, viewMode: l, availableModes: u, formatMessage: d, onViewModeChange: f, onTodayClick: p, onScrollPrev: m, onScrollNext: h }) => {
1250
+ let g = K(() => qe({
1184
1251
  lowerSegments: a,
1185
1252
  viewMode: l,
1186
1253
  formatMessage: d
@@ -1188,17 +1255,16 @@ var Z = {
1188
1255
  a,
1189
1256
  l,
1190
1257
  d
1191
- ]), _ = G(() => {
1192
- let r = Ne(n, t, e), i = r - 240, a = r + t + 240;
1193
- return g.filter((e) => e.left < a && e.left + e.width > i);
1258
+ ]), _ = Fe(n, t, e), v = K(() => {
1259
+ let e = _ - 240, n = _ + t + 240;
1260
+ return g.filter((t) => t.left < n && t.left + t.width > e);
1194
1261
  }, [
1195
1262
  g,
1196
- n,
1197
- t,
1198
- e
1199
- ]), v = G(() => a.length && a.find((e) => s != null && s >= e.startMs && s < e.endMs)?.id || null, [a, s]), y = a[0]?.startMs ?? 0, b = a[a.length - 1]?.endMs ?? 0, x = dt(c, o, e, s ?? NaN, {
1200
- startMs: y,
1201
- endMs: b
1263
+ _,
1264
+ t
1265
+ ]), y = K(() => a.length && a.find((e) => s != null && s >= e.startMs && s < e.endMs)?.id || null, [a, s]), b = a[0]?.startMs ?? 0, x = a[a.length - 1]?.endMs ?? 0, S = pt(c, o, e, s ?? NaN, {
1266
+ startMs: b,
1267
+ endMs: x
1202
1268
  });
1203
1269
  return /* @__PURE__ */ z("div", {
1204
1270
  className: Z.calendar,
@@ -1219,33 +1285,37 @@ var Z = {
1219
1285
  }
1220
1286
  }, `header-line-${t.id}`) : null;
1221
1287
  }),
1222
- _.map((e) => /* @__PURE__ */ z(B.Fragment, { children: [/* @__PURE__ */ R("div", {
1223
- className: J(Z.headerCell, Z.headerCellTop),
1224
- "data-testid": "gantt-header-cell-top",
1225
- style: {
1226
- left: e.left,
1227
- width: e.width,
1228
- height: 34,
1229
- "--segment-left": `${e.left}px`
1230
- },
1231
- children: /* @__PURE__ */ R("span", {
1232
- className: Z.headerCellStickyText,
1233
- children: e.label
1234
- })
1235
- }), /* @__PURE__ */ R("div", {
1236
- className: Z.headerColLine,
1237
- style: {
1238
- left: e.left + e.width,
1239
- top: 0,
1240
- height: 34
1241
- }
1242
- })] }, `top-group-${e.id}`)),
1288
+ v.map((e) => {
1289
+ let t = _ >= e.left && _ < e.left + e.width;
1290
+ return /* @__PURE__ */ z(B.Fragment, { children: [/* @__PURE__ */ R("div", {
1291
+ className: Y(Z.headerCell, Z.headerCellTop),
1292
+ "data-testid": "gantt-header-cell-top",
1293
+ style: {
1294
+ left: e.left,
1295
+ width: e.width,
1296
+ height: 34,
1297
+ "--segment-left": `${e.left}px`
1298
+ },
1299
+ children: /* @__PURE__ */ R(gt, {
1300
+ label: e.label,
1301
+ dateLabel: e.dateLabel,
1302
+ isReadingAnchor: t
1303
+ })
1304
+ }), /* @__PURE__ */ R("div", {
1305
+ className: Z.headerColLine,
1306
+ style: {
1307
+ left: e.left + e.width,
1308
+ top: 0,
1309
+ height: 34
1310
+ }
1311
+ })] }, `top-group-${e.id}`);
1312
+ }),
1243
1313
  i.map((e) => {
1244
1314
  let t = a[e.index];
1245
1315
  if (!t) return null;
1246
- let n = t.id === v;
1316
+ let n = t.id === y;
1247
1317
  return /* @__PURE__ */ R("div", {
1248
- className: J(Z.headerCell, Z.headerCellBottom, n && Z.isActive),
1318
+ className: Y(Z.headerCell, Z.headerCellBottom, n && Z.isActive),
1249
1319
  "data-testid": "gantt-header-cell-bottom",
1250
1320
  style: {
1251
1321
  left: t.left,
@@ -1256,7 +1326,7 @@ var Z = {
1256
1326
  children: t.label
1257
1327
  }, t.id);
1258
1328
  }),
1259
- x && /* @__PURE__ */ R("span", {
1329
+ S && /* @__PURE__ */ R("span", {
1260
1330
  className: Z.todayIndicatorHeaderDot,
1261
1331
  style: { left: o ?? void 0 }
1262
1332
  })
@@ -1264,7 +1334,7 @@ var Z = {
1264
1334
  }), /* @__PURE__ */ R("div", {
1265
1335
  className: Z.calendarToolbar,
1266
1336
  "data-testid": "gantt-calendar-toolbar",
1267
- children: /* @__PURE__ */ R(ce, {
1337
+ children: /* @__PURE__ */ R(F, {
1268
1338
  viewMode: l,
1269
1339
  availableModes: u,
1270
1340
  onViewModeChange: f,
@@ -1277,8 +1347,8 @@ var Z = {
1277
1347
  });
1278
1348
  //#endregion
1279
1349
  //#region src/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.ts
1280
- function pt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
1281
- let [a, o] = q(!1), s = he({
1350
+ function vt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
1351
+ let [a, o] = J(!1), s = _e({
1282
1352
  count: e.length,
1283
1353
  getScrollElement: () => t.current,
1284
1354
  estimateSize: () => n,
@@ -1296,8 +1366,8 @@ function pt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, over
1296
1366
  }
1297
1367
  //#endregion
1298
1368
  //#region src/components/Gantt/GanttChart/hooks/useOffscreenIndicators.ts
1299
- function mt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
1300
- return G(() => {
1369
+ function yt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
1370
+ return K(() => {
1301
1371
  if (!i || !Array.isArray(e) || !Array.isArray(t) || !Number.isFinite(n) || !Number.isFinite(r) || n >= r) return [];
1302
1372
  let o = [];
1303
1373
  return e.forEach((e) => {
@@ -1325,8 +1395,8 @@ function mt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndM
1325
1395
  }
1326
1396
  //#endregion
1327
1397
  //#region src/components/Gantt/GanttChart/hooks/useRowHoverHighlight.ts
1328
- function ht({ normalizedItems: e, safeRowHeight: t }) {
1329
- let n = Y(d, (e) => e.setHighlightTarget), r = Y(d, (e) => e.subscribeHighlight), i = Y(d, (e) => e.getIsScrollActive), a = K(null), o = K(null), s = K(null), c = K(!1), l = G(() => {
1398
+ function bt({ normalizedItems: e, safeRowHeight: t }) {
1399
+ let n = me(d, (e) => e.setHighlightTarget), r = me(d, (e) => e.subscribeHighlight), i = me(d, (e) => e.getIsScrollActive), a = q(null), o = q(null), s = q(null), c = q(!1), l = K(() => {
1330
1400
  let t = /* @__PURE__ */ new Map(), n = 0;
1331
1401
  for (; n < e.length;) {
1332
1402
  let r = e[n]?.parentId;
@@ -1341,7 +1411,7 @@ function ht({ normalizedItems: e, safeRowHeight: t }) {
1341
1411
  } else t.set(n, null), n += 1;
1342
1412
  }
1343
1413
  return t;
1344
- }, [e]), u = K(l);
1414
+ }, [e]), u = q(l);
1345
1415
  u.current = l;
1346
1416
  let m = U((e, n) => {
1347
1417
  let r = o.current;
@@ -1412,14 +1482,14 @@ function ht({ normalizedItems: e, safeRowHeight: t }) {
1412
1482
  }
1413
1483
  //#endregion
1414
1484
  //#region src/components/Gantt/GanttChart/GanttInteractionContext.ts
1415
- var gt = pe({
1485
+ var xt = pe({
1416
1486
  tooltip: null,
1417
1487
  isScrolling: !1,
1418
1488
  collapsedKeys: void 0,
1419
1489
  onBarClick: () => {},
1420
1490
  onTaskMouseDown: () => {},
1421
1491
  onResizeMouseDown: () => {}
1422
- }), _t = (e) => Y(gt, e), vt = pe({
1492
+ }), St = (e) => me(xt, e), Ct = pe({
1423
1493
  viewMode: "day",
1424
1494
  pixelsPerDay: 1,
1425
1495
  timelineStartMs: 0,
@@ -1435,14 +1505,14 @@ var gt = pe({
1435
1505
  viewportWidth: 0,
1436
1506
  timelineWidth: 0,
1437
1507
  isInitialLayoutReady: !1
1438
- }), Q = (e) => Y(vt, e), yt = (e, t) => {
1508
+ }), Q = (e) => me(Ct, e), wt = (e, t) => {
1439
1509
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
1440
1510
  return `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
1441
- }, bt = (e, t) => {
1511
+ }, Tt = (e, t) => {
1442
1512
  if (!I(e)) return null;
1443
1513
  let n = e.trim();
1444
- return i.test(n) ? yt(n, t) : null;
1445
- }, xt = (e, t = 2.5) => {
1514
+ return i.test(n) ? wt(n, t) : null;
1515
+ }, Et = (e, t = 2.5) => {
1446
1516
  if (!e || !I(e)) return "#121211";
1447
1517
  let n, r, i;
1448
1518
  if (e.startsWith("#")) {
@@ -1461,23 +1531,23 @@ var gt = pe({
1461
1531
  return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1462
1532
  };
1463
1533
  return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
1464
- }, St, Ct = () => {
1465
- if (St !== void 0) return St;
1534
+ }, Dt, Ot = () => {
1535
+ if (Dt !== void 0) return Dt;
1466
1536
  try {
1467
- St = document.createElement("canvas").getContext("2d");
1537
+ Dt = document.createElement("canvas").getContext("2d");
1468
1538
  } catch {
1469
- St = null;
1539
+ Dt = null;
1470
1540
  }
1471
- return St;
1472
- }, wt = (e, t = "12px -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, PingFang SC, Noto Sans, Noto Sans CJK SC, Microsoft YaHei, \"微软雅黑\", sans-serif") => {
1541
+ return Dt;
1542
+ }, kt = (e, t = "12px -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, PingFang SC, Noto Sans, Noto Sans CJK SC, Microsoft YaHei, \"微软雅黑\", sans-serif") => {
1473
1543
  if (!e) return 0;
1474
- let n = String(e), r = Ct();
1544
+ let n = String(e), r = Ot();
1475
1545
  return r ? (r.font = t, r.measureText(n).width + 20) : n.length * 12 + 20;
1476
1546
  };
1477
1547
  //#endregion
1478
1548
  //#region src/components/Gantt/GanttChart/hooks/useBarTooltipHover.ts
1479
- function Tt() {
1480
- let [e, t] = q(null), n = K("idle"), r = U((e) => {
1549
+ function At() {
1550
+ let [e, t] = J(null), n = q("idle"), r = U((e) => {
1481
1551
  n.current === "frozen" && (n.current = "open");
1482
1552
  let r = e.currentTarget.getBoundingClientRect();
1483
1553
  t({
@@ -1493,7 +1563,7 @@ function Tt() {
1493
1563
  n.current = e ? "open" : "idle", e || t(null);
1494
1564
  }, []);
1495
1565
  return {
1496
- virtualReference: G(() => {
1566
+ virtualReference: K(() => {
1497
1567
  if (e) return { getBoundingClientRect: () => ({
1498
1568
  width: 0,
1499
1569
  height: e.height,
@@ -1513,13 +1583,13 @@ function Tt() {
1513
1583
  }
1514
1584
  //#endregion
1515
1585
  //#region src/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.tsx
1516
- var Et = {
1586
+ var jt = {
1517
1587
  borderRadius: "10px",
1518
1588
  padding: 0,
1519
1589
  backgroundColor: "#fff",
1520
1590
  boxShadow: "0 0 12px 0 rgba(0, 0, 0, 0.08)"
1521
- }, Dt = ({ item: e, tooltip: t, disabled: r = !1, children: i }) => {
1522
- let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } = Tt(), l = G(() => r || !t ? null : t(e), [
1591
+ }, Mt = ({ item: e, tooltip: t, disabled: r = !1, children: i }) => {
1592
+ let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } = At(), l = K(() => r || !t ? null : t(e), [
1523
1593
  r,
1524
1594
  t,
1525
1595
  e
@@ -1536,7 +1606,7 @@ var Et = {
1536
1606
  zIndex: 8001,
1537
1607
  virtualReference: a,
1538
1608
  onVisibleChange: c,
1539
- style: Et,
1609
+ style: jt,
1540
1610
  children: i({
1541
1611
  onMouseMove: o,
1542
1612
  onMouseLeave: s
@@ -1545,15 +1615,15 @@ var Et = {
1545
1615
  onMouseMove: () => {},
1546
1616
  onMouseLeave: () => {}
1547
1617
  }) });
1548
- }, Ot = (e, t, n) => ({
1618
+ }, Nt = (e, t, n) => ({
1549
1619
  ...e,
1550
1620
  clientX: t,
1551
1621
  clientY: n,
1552
1622
  preventDefault: () => e.preventDefault(),
1553
1623
  stopPropagation: () => e.stopPropagation()
1554
1624
  });
1555
- function kt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1556
- let r = K(null), i = K(null), a = K(t), o = K(n);
1625
+ function Pt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1626
+ let r = q(null), i = q(null), a = q(t), o = q(n);
1557
1627
  W(() => {
1558
1628
  a.current = t, o.current = n;
1559
1629
  }, [t, n]);
@@ -1577,7 +1647,7 @@ function kt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1577
1647
  let d = (e) => {
1578
1648
  if (r.current !== u || u.dragStarted) return;
1579
1649
  let t = e.clientX - u.startClientX, i = e.clientY - u.startClientY;
1580
- Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(Ot(e, u.startClientX, u.startClientY), n, c, u.width));
1650
+ Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(Nt(e, u.startClientX, u.startClientY), n, c, u.width));
1581
1651
  }, f = (e) => {
1582
1652
  r.current === u && (s(), u.dragStarted || o.current?.(e, n));
1583
1653
  };
@@ -1587,18 +1657,18 @@ function kt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1587
1657
  }, document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
1588
1658
  }, [e, s]) };
1589
1659
  }
1590
- var At = B.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermission: a }) => {
1591
- let { t: o } = t(), s = Q((e) => e.viewMode), c = Q((e) => e.timelineCoords), l = Q((e) => e.timelineStartMs), u = Q((e) => e.timelineEndMs), d = Q((e) => e.timelineWidth), f = _t((e) => e.tooltip), p = _t((e) => e.isScrolling), m = _t((e) => e.onBarClick), h = _t((e) => e.onTaskMouseDown), g = _t((e) => e.onResizeMouseDown), _ = p ? null : f, v = r === e.id, y = v && i ? i.previewStartMs : e.startMs, b = v && i ? i.previewEndMs : e.endMs, S = G(() => {
1660
+ var Ft = B.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermission: a }) => {
1661
+ let { t: o } = t(), s = Q((e) => e.viewMode), c = Q((e) => e.timelineCoords), l = Q((e) => e.timelineStartMs), u = Q((e) => e.timelineEndMs), d = Q((e) => e.timelineWidth), f = St((e) => e.tooltip), p = St((e) => e.isScrolling), m = St((e) => e.onBarClick), h = St((e) => e.onTaskMouseDown), g = St((e) => e.onResizeMouseDown), _ = p ? null : f, v = r === e.id, y = v && i ? i.previewStartMs : e.startMs, b = v && i ? i.previewEndMs : e.endMs, S = K(() => {
1592
1662
  let t = e.color;
1593
1663
  return {
1594
1664
  baseColor: t,
1595
- containerBgColor: bt(t, .2) || t,
1596
- hoverBorderColor: bt(t, .5) || "transparent",
1597
- insideLabelColor: xt(t)
1665
+ containerBgColor: Tt(t, .2) || t,
1666
+ hoverBorderColor: Tt(t, .5) || "transparent",
1667
+ insideLabelColor: Et(t)
1598
1668
  };
1599
- }, [e.color]), C = G(() => {
1669
+ }, [e.color]), C = K(() => {
1600
1670
  if (y == null || b == null || y >= b || l >= u) return null;
1601
- let e = Xe({
1671
+ let e = Qe({
1602
1672
  startMs: y,
1603
1673
  endMs: b
1604
1674
  }, {
@@ -1624,71 +1694,71 @@ var At = B.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
1624
1694
  c,
1625
1695
  v,
1626
1696
  i
1627
- ]), { baseColor: w, containerBgColor: T, hoverBorderColor: ee, insideLabelColor: E } = S, D = C?.calculatedBarWidth ?? 0, O = e.progress === null, k = !C || y === null || b === null ? 0 : Math.max(0, Math.min(1, (C.rawBarLeft + c.toWidth(C.clippedRange.startMs, Math.min(C.clippedRange.endMs, Math.max(C.clippedRange.startMs, y + (b - y) * Math.max(0, e.progress ?? 0)))) - C.calculatedBarLeft) / C.calculatedBarWidth)), A = O || k >= 1, j = A ? "100%" : `${k * 100}%`, M = a || ye, N = M.canMove, te = e.label ?? "", ne = typeof te == "string" ? te : "", re = D < 40, ie = Math.max(0, D - 10), ae = G(() => ne ? wt(ne) : 0, [ne]), oe = !!ne && ae > ie && !!C && C.calculatedBarLeft + C.calculatedBarWidth + 4 + ae <= d, { handlePointerMouseDown: se } = kt({
1628
- enabled: N,
1697
+ ]), { baseColor: w, containerBgColor: T, hoverBorderColor: ee, insideLabelColor: E } = S, D = C?.calculatedBarWidth ?? 0, O = e.progress === null, k = !C || y === null || b === null ? 0 : Math.max(0, Math.min(1, (C.rawBarLeft + c.toWidth(C.clippedRange.startMs, Math.min(C.clippedRange.endMs, Math.max(C.clippedRange.startMs, y + (b - y) * Math.max(0, e.progress ?? 0)))) - C.calculatedBarLeft) / C.calculatedBarWidth)), A = O || k >= 1, j = A ? "100%" : `${k * 100}%`, M = a || xe, te = M.canMove, ne = e.label ?? "", N = typeof ne == "string" ? ne : "", re = D < 40, ie = Math.max(0, D - 10), P = K(() => N ? kt(N) : 0, [N]), ae = !!N && P > ie && !!C && C.calculatedBarLeft + C.calculatedBarWidth + 4 + P <= d, { handlePointerMouseDown: oe } = Pt({
1698
+ enabled: te,
1629
1699
  onTaskMouseDown: h,
1630
1700
  onBarClick: m
1631
1701
  });
1632
1702
  if (!C) return null;
1633
- let { calculatedBarLeft: ce, clippedStart: P, clippedEnd: F } = C, I = ce + D, B = ce + Math.max(40, D + 12) <= d, V = y !== null && b !== null ? s === "quarterMonth" ? x(y, b) : c.toWidth(y, b) : D, H = V < 40 ? Math.max(40, V + 12) : V, U = I + 4 <= d, W = {
1634
- left: ce,
1703
+ let { calculatedBarLeft: F, clippedStart: se, clippedEnd: ce } = C, I = F + D, B = F + Math.max(40, D + 12) <= d, V = y !== null && b !== null ? s === "quarterMonth" ? x(y, b) : c.toWidth(y, b) : D, H = V < 40 ? Math.max(40, V + 12) : V, U = I + 4 <= d, W = {
1704
+ left: F,
1635
1705
  top: n,
1636
1706
  width: `var(--bsy-gantt-bar-actual-width, ${D}px)`,
1637
1707
  height: 26,
1638
1708
  background: T,
1639
- cursor: N ? "move" : "default",
1709
+ cursor: te ? "move" : "default",
1640
1710
  "--bsy-gantt-bar-fill-color": w,
1641
1711
  "--bsy-gantt-bar-hover-border-color": ee,
1642
1712
  "--bsy-gantt-bar-calc-width": `${D}px`,
1643
1713
  "--bsy-gantt-bar-label-color": E
1644
1714
  };
1645
- return /* @__PURE__ */ R(Dt, {
1715
+ return /* @__PURE__ */ R(Mt, {
1646
1716
  item: e,
1647
1717
  tooltip: _,
1648
1718
  disabled: v,
1649
1719
  children: ({ onMouseMove: t, onMouseLeave: n }) => /* @__PURE__ */ z("div", {
1650
- className: J(Z.bar, {
1651
- [Z.isReadonly]: !N,
1720
+ className: Y(Z.bar, {
1721
+ [Z.isReadonly]: !te,
1652
1722
  [Z.isDragging]: v,
1653
1723
  [Z.isMicro]: re && B
1654
1724
  }),
1655
1725
  "data-testid": "gantt-bar",
1656
1726
  style: W,
1657
1727
  onMouseDown: (t) => {
1658
- N && se(t, e, ce, H);
1728
+ te && oe(t, e, F, H);
1659
1729
  },
1660
1730
  onClick: (t) => {
1661
- N || m(t, e);
1731
+ te || m(t, e);
1662
1732
  },
1663
1733
  onMouseMove: t,
1664
1734
  onMouseLeave: n,
1665
1735
  children: [
1666
1736
  e.type === "task" ? /* @__PURE__ */ R("div", {
1667
- className: J(Z.barProgress, { [Z.isFull]: A }),
1737
+ className: Y(Z.barProgress, { [Z.isFull]: A }),
1668
1738
  "data-testid": "gantt-bar-progress",
1669
1739
  style: { width: j }
1670
1740
  }) : null,
1671
1741
  /* @__PURE__ */ R("span", {
1672
- className: J(Z.barLabel, { [Z.isHidden]: oe }),
1742
+ className: Y(Z.barLabel, { [Z.isHidden]: ae }),
1673
1743
  style: { color: "var(--bsy-gantt-bar-label-color)" },
1674
- children: te
1744
+ children: ne
1675
1745
  }),
1676
- oe ? /* @__PURE__ */ R("span", {
1677
- className: J(Z.barLabel, Z.isOutside),
1746
+ ae ? /* @__PURE__ */ R("span", {
1747
+ className: Y(Z.barLabel, Z.isOutside),
1678
1748
  "data-testid": "gantt-bar-label-outside",
1679
- children: te
1749
+ children: ne
1680
1750
  }) : null,
1681
- M.canResizeStart && !P || M.canResizeEnd && !F && U ? /* @__PURE__ */ z(L, { children: [M.canResizeStart && !P ? /* @__PURE__ */ R("button", {
1751
+ M.canResizeStart && !se || M.canResizeEnd && !ce && U ? /* @__PURE__ */ z(L, { children: [M.canResizeStart && !se ? /* @__PURE__ */ R("button", {
1682
1752
  type: "button",
1683
- className: J(Z.barResizeHandle, Z.barResizeHandleLeft),
1753
+ className: Y(Z.barResizeHandle, Z.barResizeHandleLeft),
1684
1754
  "data-testid": "gantt-bar-resize-left",
1685
- onMouseDown: (t) => g(t, e, ce, "start", D),
1755
+ onMouseDown: (t) => g(t, e, F, "start", D),
1686
1756
  "aria-label": o("gantt.timeBegin")
1687
- }) : null, M.canResizeEnd && !F && U ? /* @__PURE__ */ R("button", {
1757
+ }) : null, M.canResizeEnd && !ce && U ? /* @__PURE__ */ R("button", {
1688
1758
  type: "button",
1689
- className: J(Z.barResizeHandle, Z.barResizeHandleRight),
1759
+ className: Y(Z.barResizeHandle, Z.barResizeHandleRight),
1690
1760
  "data-testid": "gantt-bar-resize-right",
1691
- onMouseDown: (t) => g(t, e, ce, "end", D),
1761
+ onMouseDown: (t) => g(t, e, F, "end", D),
1692
1762
  "aria-label": o("gantt.timeEnd")
1693
1763
  }) : null] }) : null
1694
1764
  ]
@@ -1708,21 +1778,21 @@ var At = B.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
1708
1778
  progress: "_progress_8s9va_46",
1709
1779
  summaryTooltip: "_summaryTooltip_8s9va_56",
1710
1780
  summaryTooltipLine: "_summaryTooltipLine_8s9va_66"
1711
- }, jt = (e) => String(e).padStart(2, "0");
1712
- function Mt(e, t) {
1781
+ }, It = (e) => String(e).padStart(2, "0");
1782
+ function Lt(e, t) {
1713
1783
  if (e == null) return t("summary.empty");
1714
1784
  let n = C(e);
1715
1785
  return t("summary.datetime", {
1716
1786
  year: n.year(),
1717
- month: jt(n.month() + 1),
1718
- day: jt(n.date()),
1719
- hour: jt(n.hour()),
1720
- minute: jt(n.minute()),
1721
- second: jt(n.second())
1787
+ month: It(n.month() + 1),
1788
+ day: It(n.date()),
1789
+ hour: It(n.hour()),
1790
+ minute: It(n.minute()),
1791
+ second: It(n.second())
1722
1792
  });
1723
1793
  }
1724
- function Nt(e, t) {
1725
- let n = F(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i = Mt(e?.rawStartMs, t), a = Mt(e?.rawEndMs, t);
1794
+ function Rt(e, t) {
1795
+ let n = ce(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i = Lt(e?.rawStartMs, t), a = Lt(e?.rawEndMs, t);
1726
1796
  return /* @__PURE__ */ z("div", {
1727
1797
  className: $.summaryTooltip,
1728
1798
  children: [
@@ -1743,17 +1813,17 @@ function Nt(e, t) {
1743
1813
  }
1744
1814
  //#endregion
1745
1815
  //#region src/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.tsx
1746
- var Pt = 24, Ft = {
1816
+ var zt = 24, Bt = {
1747
1817
  borderRadius: "6px",
1748
1818
  padding: 0,
1749
1819
  backgroundColor: "rgba(0, 0, 0, 0.5)",
1750
1820
  boxShadow: "none"
1751
1821
  };
1752
- function It(e, t) {
1822
+ function Vt(e, t) {
1753
1823
  return e == null || e === "__empty__" ? t : e;
1754
1824
  }
1755
- var Lt = ({ item: r, barTop: i }) => {
1756
- let { t: a } = t(), o = U((e, t) => a(se(e), t), [a]), s = Q((e) => e.timelineCoords), c = Q((e) => e.timelineStartMs), l = Q((e) => e.timelineEndMs), u = Q((e) => e.timelineWidth), d = _t((e) => e.collapsedKeys), f = _t((e) => e.onBarClick), { virtualReference: p, handleMouseMove: m, handleMouseLeave: h, handleTooltipVisibleChange: g } = Tt(), _ = F(r.progress) ? Math.max(0, Math.min(1, r.progress ?? 0)) : 0, v = G(() => Nt({
1825
+ var Ht = ({ item: r, barTop: i }) => {
1826
+ let { t: a } = t(), o = U((e, t) => a(oe(e), t), [a]), s = Q((e) => e.timelineCoords), c = Q((e) => e.timelineStartMs), l = Q((e) => e.timelineEndMs), u = Q((e) => e.timelineWidth), d = St((e) => e.collapsedKeys), f = St((e) => e.onBarClick), { virtualReference: p, handleMouseMove: m, handleMouseLeave: h, handleTooltipVisibleChange: g } = At(), _ = ce(r.progress) ? Math.max(0, Math.min(1, r.progress ?? 0)) : 0, v = K(() => Rt({
1757
1827
  rawStartMs: r.rawStartMs,
1758
1828
  rawEndMs: r.rawEndMs,
1759
1829
  progress: r.progress
@@ -1762,9 +1832,9 @@ var Lt = ({ item: r, barTop: i }) => {
1762
1832
  r.rawEndMs,
1763
1833
  r.progress,
1764
1834
  o
1765
- ]), y = G(() => {
1835
+ ]), y = K(() => {
1766
1836
  if (r.startMs === null || r.endMs === null || r.startMs >= r.endMs || c >= l) return null;
1767
- let e = Xe({
1837
+ let e = Qe({
1768
1838
  startMs: r.startMs,
1769
1839
  endMs: r.endMs
1770
1840
  }, {
@@ -1774,7 +1844,7 @@ var Lt = ({ item: r, barTop: i }) => {
1774
1844
  return e ? {
1775
1845
  barLeft: s.toX(e.startMs),
1776
1846
  barWidth: s.toWidth(e.startMs, e.endMs),
1777
- wrapperTop: i + (26 - Pt) / 2,
1847
+ wrapperTop: i + (26 - zt) / 2,
1778
1848
  clippedEnd: e.endMs !== r.endMs,
1779
1849
  clippedRange: e,
1780
1850
  itemStartMs: r.startMs,
@@ -1789,7 +1859,7 @@ var Lt = ({ item: r, barTop: i }) => {
1789
1859
  i
1790
1860
  ]);
1791
1861
  if (!y) return null;
1792
- let { barLeft: b, barWidth: x, wrapperTop: S, clippedEnd: C, clippedRange: w, itemStartMs: T, itemEndMs: ee } = y, E = T + (ee - T) * _, D = Math.min(w.endMs, Math.max(w.startMs, E)), O = s.toWidth(w.startMs, D), k = `${Math.max(0, Math.min(1, O / x)) * 100}%`, A = Math.max(0, u - b), j = It(r.label, a("gantt.emptyGroup")), M = ne(d, r.groupKey);
1862
+ let { barLeft: b, barWidth: x, wrapperTop: S, clippedEnd: C, clippedRange: w, itemStartMs: T, itemEndMs: ee } = y, E = T + (ee - T) * _, D = Math.min(w.endMs, Math.max(w.startMs, E)), O = s.toWidth(w.startMs, D), k = `${Math.max(0, Math.min(1, O / x)) * 100}%`, A = Math.max(0, u - b), j = Vt(r.label, a("gantt.emptyGroup")), M = N(d, r.groupKey);
1793
1863
  return /* @__PURE__ */ R(n, {
1794
1864
  content: v,
1795
1865
  placement: "bottom-start",
@@ -1801,7 +1871,7 @@ var Lt = ({ item: r, barTop: i }) => {
1801
1871
  zIndex: 8001,
1802
1872
  virtualReference: p,
1803
1873
  onVisibleChange: g,
1804
- style: Ft,
1874
+ style: Bt,
1805
1875
  children: /* @__PURE__ */ z("div", {
1806
1876
  className: $.root,
1807
1877
  "data-testid": "gantt-summary-bar",
@@ -1824,7 +1894,7 @@ var Lt = ({ item: r, barTop: i }) => {
1824
1894
  children: [/* @__PURE__ */ R(e, {
1825
1895
  name: "xiangxiazhankai1",
1826
1896
  size: 16,
1827
- className: J($.arrow, { [$.isCollapsed]: M })
1897
+ className: Y($.arrow, { [$.isCollapsed]: M })
1828
1898
  }), /* @__PURE__ */ R("span", {
1829
1899
  className: $.labelText,
1830
1900
  children: j
@@ -1840,10 +1910,10 @@ var Lt = ({ item: r, barTop: i }) => {
1840
1910
  })
1841
1911
  });
1842
1912
  };
1843
- function Rt(e, t) {
1913
+ function Ut(e, t) {
1844
1914
  return e.barTop === t.barTop && e.item === t.item;
1845
1915
  }
1846
- var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1916
+ var Wt = B.memo(Ht, Ut), Gt = B.memo(({ indicators: n = [], onJump: r }) => {
1847
1917
  let { t: i } = t();
1848
1918
  if (!Array.isArray(n) || n.length === 0) return null;
1849
1919
  let a = (e, t) => {
@@ -1862,7 +1932,7 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1862
1932
  className: Z.offscreenTrack,
1863
1933
  children: [t.showLeft ? /* @__PURE__ */ R("button", {
1864
1934
  type: "button",
1865
- className: J(Z.offscreenBtn, Z.offscreenBtnLeft),
1935
+ className: Y(Z.offscreenBtn, Z.offscreenBtnLeft),
1866
1936
  "data-testid": "gantt-offscreen-btn-left",
1867
1937
  "aria-label": i("gantt.aria.jumpLeft"),
1868
1938
  onClick: (e) => a(e, t),
@@ -1872,7 +1942,7 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1872
1942
  })
1873
1943
  }) : null, t.showRight ? /* @__PURE__ */ R("button", {
1874
1944
  type: "button",
1875
- className: J(Z.offscreenBtn, Z.offscreenBtnRight),
1945
+ className: Y(Z.offscreenBtn, Z.offscreenBtnRight),
1876
1946
  "data-testid": "gantt-offscreen-btn-right",
1877
1947
  "aria-label": i("gantt.aria.jumpRight"),
1878
1948
  onClick: (e) => a(e, t),
@@ -1883,15 +1953,15 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1883
1953
  }) : null]
1884
1954
  })
1885
1955
  }, t.rowKey)) });
1886
- }), Vt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ R("div", {
1887
- className: J(Z.todayIndicator, n),
1956
+ }), Kt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ R("div", {
1957
+ className: Y(Z.todayIndicator, n),
1888
1958
  "data-testid": "gantt-today-indicator-content-line",
1889
1959
  style: {
1890
1960
  left: e,
1891
1961
  height: t
1892
1962
  },
1893
1963
  children: /* @__PURE__ */ R("span", { className: Z.todayIndicatorLine })
1894
- }), Ht = H(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
1964
+ }), qt = H(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
1895
1965
  return /* @__PURE__ */ z(L, { children: [
1896
1966
  t.map((t) => /* @__PURE__ */ R("div", {
1897
1967
  className: Z.weekendBg,
@@ -1911,19 +1981,19 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1911
1981
  }
1912
1982
  }, `line-${n.id}`) : null;
1913
1983
  }),
1914
- i ? /* @__PURE__ */ R(Vt, {
1984
+ i ? /* @__PURE__ */ R(Kt, {
1915
1985
  left: a ?? 0,
1916
1986
  height: e,
1917
1987
  className: Z.todayIndicatorContentLine
1918
1988
  }) : null
1919
1989
  ] });
1920
- }), Ut = ({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, timelineStartMs: i, timelineEndMs: a }) => {
1990
+ }), Jt = ({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, timelineStartMs: i, timelineEndMs: a }) => {
1921
1991
  let o = n?.taskId ?? null;
1922
1992
  return e.map((e) => {
1923
1993
  let s = t[e.index];
1924
1994
  if (!s || s.invalid) return null;
1925
1995
  let c = o === s.id;
1926
- if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !Ye({
1996
+ if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !Ze({
1927
1997
  startMs: s.startMs,
1928
1998
  endMs: s.endMs
1929
1999
  }, {
@@ -1931,10 +2001,10 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1931
2001
  endMs: a
1932
2002
  }))) return null;
1933
2003
  let l = e.start + (e.size - 26) / 2;
1934
- return s.type === "summary" ? /* @__PURE__ */ R(zt, {
2004
+ return s.type === "summary" ? /* @__PURE__ */ R(Wt, {
1935
2005
  item: s,
1936
2006
  barTop: l
1937
- }, `summary-${s.id}`) : /* @__PURE__ */ R(At, {
2007
+ }, `summary-${s.id}`) : /* @__PURE__ */ R(Ft, {
1938
2008
  item: s,
1939
2009
  barTop: l,
1940
2010
  dragTaskId: o,
@@ -1942,8 +2012,8 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1942
2012
  dragPermission: r[s.id]
1943
2013
  }, `bar-${s.id}`);
1944
2014
  });
1945
- }, Wt = H(function({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, handleOffscreenJump: i, hoverBgRef: a }) {
1946
- let o = Q((e) => e.timelineStartMs), s = Q((e) => e.timelineEndMs), c = Q((e) => e.visibleStartMs), l = Q((e) => e.visibleEndMs), u = Q((e) => e.isInitialLayoutReady), d = mt({
2015
+ }, Yt = H(function({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, handleOffscreenJump: i, hoverBgRef: a }) {
2016
+ let o = Q((e) => e.timelineStartMs), s = Q((e) => e.timelineEndMs), c = Q((e) => e.visibleStartMs), l = Q((e) => e.visibleEndMs), u = Q((e) => e.isInitialLayoutReady), d = yt({
1947
2017
  virtualRows: e,
1948
2018
  normalizedItems: t,
1949
2019
  visibleStartMs: c,
@@ -1966,7 +2036,7 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1966
2036
  "data-testid": "gantt-row-hover-bg",
1967
2037
  style: { display: "none" }
1968
2038
  }),
1969
- u && Ut({
2039
+ u && Jt({
1970
2040
  virtualRows: e,
1971
2041
  normalizedItems: t,
1972
2042
  dragState: n,
@@ -1974,24 +2044,24 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
1974
2044
  timelineStartMs: o,
1975
2045
  timelineEndMs: s
1976
2046
  }),
1977
- u ? /* @__PURE__ */ R(Bt, {
2047
+ u ? /* @__PURE__ */ R(Gt, {
1978
2048
  indicators: d,
1979
2049
  onJump: i
1980
2050
  }) : null
1981
2051
  ] });
1982
- }), Gt = H(function({ contentRef: e, normalizedItems: t, safeRowHeight: n, viewportHeight: r, lowerSegments: i, virtualColumns: a, weekendSegments: o, dragState: s, dragPermissionById: c, tooltip: l, handleTaskMouseDown: u, handleResizeMouseDown: d, handleBarClick: f, collapsedKeys: p, handleOffscreenJump: m, todayLineLeft: h, shouldShowTodayMarker: g }) {
1983
- let _ = Q((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } = pt({
2052
+ }), Xt = H(function({ contentRef: e, normalizedItems: t, safeRowHeight: n, viewportHeight: r, lowerSegments: i, virtualColumns: a, weekendSegments: o, dragState: s, dragPermissionById: c, tooltip: l, handleTaskMouseDown: u, handleResizeMouseDown: d, handleBarClick: f, collapsedKeys: p, handleOffscreenJump: m, todayLineLeft: h, shouldShowTodayMarker: g }) {
2053
+ let _ = Q((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } = vt({
1984
2054
  items: t,
1985
2055
  contentRef: e,
1986
2056
  safeRowHeight: n,
1987
2057
  viewportHeight: r
1988
- }), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = ht({
2058
+ }), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = bt({
1989
2059
  normalizedItems: t,
1990
2060
  safeRowHeight: n
1991
- }), w = G(() => ({
2061
+ }), w = K(() => ({
1992
2062
  width: _,
1993
2063
  height: y
1994
- }), [_, y]), T = G(() => ({
2064
+ }), [_, y]), T = K(() => ({
1995
2065
  tooltip: l ?? null,
1996
2066
  isScrolling: b,
1997
2067
  collapsedKeys: p,
@@ -2012,16 +2082,16 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
2012
2082
  style: w,
2013
2083
  onMouseMove: S,
2014
2084
  onMouseLeave: C,
2015
- children: [/* @__PURE__ */ R(Ht, {
2085
+ children: [/* @__PURE__ */ R(qt, {
2016
2086
  canvasHeight: y,
2017
2087
  weekendSegments: o,
2018
2088
  virtualColumns: a,
2019
2089
  lowerSegments: i,
2020
2090
  shouldShowTodayMarker: g,
2021
2091
  todayLineLeft: h
2022
- }), /* @__PURE__ */ R(gt.Provider, {
2092
+ }), /* @__PURE__ */ R(xt.Provider, {
2023
2093
  value: T,
2024
- children: /* @__PURE__ */ R(Wt, {
2094
+ children: /* @__PURE__ */ R(Yt, {
2025
2095
  virtualRows: v,
2026
2096
  normalizedItems: t,
2027
2097
  dragState: s,
@@ -2034,8 +2104,8 @@ var zt = B.memo(Lt, Rt), Bt = B.memo(({ indicators: n = [], onJump: r }) => {
2034
2104
  });
2035
2105
  //#endregion
2036
2106
  //#region src/components/Gantt/GanttChart/GanttChart.tsx
2037
- function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeChange: i, timeRangeConfig: a = u, pixelsPerDayConfig: o = c, onTaskTimeChange: s, onRowClick: l, tooltip: d, verticalScrollController: f, showWeekendHighlight: p = !0, showTodayLine: m = !0, collapsedKeys: h, onToggleCollapse: g }, _) {
2038
- let { t: v } = t(), y = U((e, t) => v(se(e), t), [v]), b = K(null), x = K(null), S = K(null), C = fe(x), w = K(null), T = ut(b, x), [ee, E] = q(!1), { pixelsPerDay: D, viewportWidth: O, scrollLeft: k, timelineStartMs: A, timelineEndMs: j, visibleStartMs: M, visibleEndMs: N, lowerSegments: te, timelineCoords: ne, timelineWidth: re, todayCenterMs: ie, todayLineLeft: ae, isInitialLayoutReady: oe, handleContentScroll: ce, handleTodayClick: P, handleOffscreenJump: F, handleScrollPrev: I, handleScrollNext: L } = ct({
2107
+ function Zt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeChange: i, timeRangeConfig: a = u, pixelsPerDayConfig: o = c, onTaskTimeChange: s, onRowClick: l, tooltip: d, verticalScrollController: f, showWeekendHighlight: p = !0, showTodayLine: m = !0, collapsedKeys: h, onToggleCollapse: g }, _) {
2108
+ let { t: v } = t(), y = U((e, t) => v(oe(e), t), [v]), b = q(null), x = q(null), S = q(null), C = de(x), w = q(null), T = ft(b, x), [ee, E] = J(!1), { pixelsPerDay: D, viewportWidth: O, scrollLeft: k, timelineStartMs: A, timelineEndMs: j, visibleStartMs: M, visibleEndMs: te, lowerSegments: ne, timelineCoords: N, timelineWidth: re, todayCenterMs: ie, todayLineLeft: P, isInitialLayoutReady: ae, handleContentScroll: F, handleTodayClick: se, handleOffscreenJump: ce, handleScrollPrev: I, handleScrollNext: L } = ut({
2039
2109
  timeRangeConfig: a,
2040
2110
  pixelsPerDayConfig: o,
2041
2111
  viewMode: n,
@@ -2046,19 +2116,19 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2046
2116
  isHorizontalScrollbarInteracting: T,
2047
2117
  isTaskBarInteracting: ee
2048
2118
  });
2049
- le(_, () => ({
2050
- scrollToToday: P,
2119
+ G(_, () => ({
2120
+ scrollToToday: se,
2051
2121
  scrollPrev: I,
2052
2122
  scrollNext: L
2053
2123
  }), [
2054
- P,
2124
+ se,
2055
2125
  I,
2056
2126
  L
2057
2127
  ]);
2058
- let { dragState: B, committedRangeById: V, resetCommittedRanges: H, forceResetAllCommittedRanges: ue, handleTaskMouseDown: J, handleResizeMouseDown: de, consumeRecentDragResult: pe } = Me({
2128
+ let { dragState: B, committedRangeById: V, resetCommittedRanges: H, forceResetAllCommittedRanges: le, handleTaskMouseDown: Y, handleResizeMouseDown: ue, consumeRecentDragResult: fe } = Pe({
2059
2129
  pixelsPerDay: D,
2060
2130
  viewMode: n,
2061
- timelineCoords: ne,
2131
+ timelineCoords: N,
2062
2132
  onTaskTimeChange: s,
2063
2133
  containerRef: x,
2064
2134
  onDragInteractionChange: E
@@ -2073,37 +2143,37 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2073
2143
  }
2074
2144
  }
2075
2145
  if (w.current = t, r) {
2076
- ue();
2146
+ le();
2077
2147
  return;
2078
2148
  }
2079
2149
  H();
2080
2150
  }, [
2081
2151
  e,
2082
2152
  H,
2083
- ue
2153
+ le
2084
2154
  ]);
2085
- let { normalizedItems: Y } = lt({
2155
+ let { normalizedItems: X } = dt({
2086
2156
  visibleItems: e,
2087
2157
  committedRangeById: V,
2088
2158
  viewMode: n
2089
- }), X = G(() => {
2159
+ }), pe = K(() => {
2090
2160
  let e = {};
2091
- return Y.forEach((t) => {
2092
- e[t.id] = be(t);
2161
+ return X.forEach((t) => {
2162
+ e[t.id] = Se(t);
2093
2163
  }), e;
2094
- }, [Y]), me = U((e, t, n, r) => {
2095
- let i = X[t.id];
2096
- i?.canMove && J(e, {
2164
+ }, [X]), me = U((e, t, n, r) => {
2165
+ let i = pe[t.id];
2166
+ i?.canMove && Y(e, {
2097
2167
  ...t,
2098
2168
  dragPermission: i
2099
2169
  }, n, r);
2100
- }, [X, J]), he = U((e, t, n, r, i) => {
2101
- let a = X[t.id];
2102
- (r === "start" ? a?.canResizeStart : a?.canResizeEnd) && de(e, {
2170
+ }, [pe, Y]), he = U((e, t, n, r, i) => {
2171
+ let a = pe[t.id];
2172
+ (r === "start" ? a?.canResizeStart : a?.canResizeEnd) && ue(e, {
2103
2173
  ...t,
2104
2174
  dragPermission: a
2105
2175
  }, n, r, i);
2106
- }, [X, de]);
2176
+ }, [pe, ue]);
2107
2177
  W(() => {
2108
2178
  if (!f || !x.current) return;
2109
2179
  let e = x.current;
@@ -2111,8 +2181,8 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2111
2181
  e.scrollTop = t;
2112
2182
  } });
2113
2183
  }, [f]);
2114
- let ge = C?.height || 0, { virtualColumns: _e, weekendSegments: ve } = Le({
2115
- lowerSegments: te,
2184
+ let ge = C?.height || 0, { virtualColumns: _e, weekendSegments: ve } = ze({
2185
+ lowerSegments: ne,
2116
2186
  pixelsPerDay: D,
2117
2187
  scrollLeft: k,
2118
2188
  viewportWidth: O,
@@ -2120,11 +2190,11 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2120
2190
  timelineStartMs: A,
2121
2191
  timelineWidth: re,
2122
2192
  viewMode: n
2123
- }), ye = dt(m, ae, re, ie, {
2193
+ }), ye = pt(m, P, re, ie, {
2124
2194
  startMs: A,
2125
2195
  endMs: j
2126
- }), xe = U((e, t) => {
2127
- if (!(e.target instanceof Element && e.target.closest(`.${Z.barResizeHandle}`)) && !pe()) {
2196
+ }), be = U((e, t) => {
2197
+ if (!(e.target instanceof Element && e.target.closest(`.${Z.barResizeHandle}`)) && !fe()) {
2128
2198
  if (t?.type === "summary") {
2129
2199
  let e = t.groupKey;
2130
2200
  if (!e || !g) return;
@@ -2134,55 +2204,55 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2134
2204
  l && l(t, t.rowIndex, e);
2135
2205
  }
2136
2206
  }, [
2137
- pe,
2207
+ fe,
2138
2208
  l,
2139
2209
  g
2140
- ]), Se = G(() => ({
2210
+ ]), xe = K(() => ({
2141
2211
  viewMode: n,
2142
2212
  pixelsPerDay: D,
2143
2213
  timelineStartMs: A,
2144
2214
  timelineEndMs: j,
2145
2215
  visibleStartMs: M,
2146
- visibleEndMs: N,
2147
- timelineCoords: ne,
2216
+ visibleEndMs: te,
2217
+ timelineCoords: N,
2148
2218
  scrollLeft: k,
2149
2219
  viewportWidth: O,
2150
2220
  timelineWidth: re,
2151
- isInitialLayoutReady: oe
2221
+ isInitialLayoutReady: ae
2152
2222
  }), [
2153
2223
  n,
2154
2224
  D,
2155
2225
  A,
2156
2226
  j,
2157
2227
  M,
2228
+ te,
2158
2229
  N,
2159
- ne,
2160
2230
  k,
2161
2231
  O,
2162
2232
  re,
2163
- oe
2233
+ ae
2164
2234
  ]);
2165
- return /* @__PURE__ */ R(vt.Provider, {
2166
- value: Se,
2235
+ return /* @__PURE__ */ R(Ct.Provider, {
2236
+ value: xe,
2167
2237
  children: /* @__PURE__ */ z("div", {
2168
2238
  className: Z.root,
2169
2239
  "data-testid": "gantt-chart",
2170
- style: { visibility: oe ? "visible" : "hidden" },
2171
- children: [/* @__PURE__ */ R(ft, {
2240
+ style: { visibility: ae ? "visible" : "hidden" },
2241
+ children: [/* @__PURE__ */ R(_t, {
2172
2242
  timelineWidth: re,
2173
2243
  viewportWidth: O,
2174
2244
  scrollLeft: k,
2175
2245
  trackRef: S,
2176
2246
  virtualColumns: _e,
2177
- lowerSegments: te,
2178
- todayLineLeft: ae,
2247
+ lowerSegments: ne,
2248
+ todayLineLeft: P,
2179
2249
  todayCenterMs: ie,
2180
2250
  showTodayLine: m,
2181
2251
  viewMode: n,
2182
2252
  availableModes: r,
2183
2253
  formatMessage: y,
2184
2254
  onViewModeChange: i,
2185
- onTodayClick: P,
2255
+ onTodayClick: se,
2186
2256
  onScrollPrev: I,
2187
2257
  onScrollNext: L
2188
2258
  }), /* @__PURE__ */ R("div", {
@@ -2195,25 +2265,25 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2195
2265
  role: "region",
2196
2266
  "aria-label": v("gantt.aria.timeline"),
2197
2267
  onScroll: (e) => {
2198
- ce(e), f && f.sync("timeline", e.currentTarget.scrollTop);
2268
+ F(e), f && f.sync("timeline", e.currentTarget.scrollTop);
2199
2269
  },
2200
- children: /* @__PURE__ */ R(Gt, {
2270
+ children: /* @__PURE__ */ R(Xt, {
2201
2271
  contentRef: x,
2202
- normalizedItems: Y,
2272
+ normalizedItems: X,
2203
2273
  safeRowHeight: 34,
2204
2274
  viewportHeight: ge,
2205
- lowerSegments: te,
2275
+ lowerSegments: ne,
2206
2276
  virtualColumns: _e,
2207
2277
  weekendSegments: ve,
2208
2278
  dragState: B,
2209
- dragPermissionById: X,
2279
+ dragPermissionById: pe,
2210
2280
  tooltip: d,
2211
2281
  handleTaskMouseDown: me,
2212
2282
  handleResizeMouseDown: he,
2213
- handleBarClick: xe,
2283
+ handleBarClick: be,
2214
2284
  collapsedKeys: h,
2215
- handleOffscreenJump: F,
2216
- todayLineLeft: ae,
2285
+ handleOffscreenJump: ce,
2286
+ todayLineLeft: P,
2217
2287
  shouldShowTodayMarker: ye
2218
2288
  })
2219
2289
  })
@@ -2221,6 +2291,6 @@ function Kt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2221
2291
  })
2222
2292
  });
2223
2293
  }
2224
- var qt = V(Kt);
2294
+ var Qt = V(Zt);
2225
2295
  //#endregion
2226
- export { qt as t };
2296
+ export { Qt as t };