@baishuyun/ui-base 6.4.2 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/Amap/{Amap-DL5dLiUm.js → Amap-Dnvu_pUP.js} +1 -1
  2. package/dist/Amap/AmapCircle/index.js +3 -3
  3. package/dist/Amap/{AmapCircle-mh92P2l6.js → AmapCircle-Wfn43qco.js} +1 -1
  4. package/dist/Amap/AmapMarker/index.js +4 -4
  5. package/dist/Amap/{AmapMarker-DYW0-8Hd.js → AmapMarker-CB66dQIG.js} +2 -2
  6. package/dist/Amap/AmapMarkerCluster/index.js +4 -4
  7. package/dist/Amap/{AmapMarkerCluster-BRVHHMbi.js → AmapMarkerCluster-DvXchCC0.js} +2 -2
  8. package/dist/Amap/AmapProvider/index.js +4 -4
  9. package/dist/Amap/{AmapProvider-CwKdpmCg.js → AmapProvider-XCrqzo9W.js} +2 -2
  10. package/dist/Amap/hooks/index.js +2 -2
  11. package/dist/Amap/{hooks-D1m8KgVM.js → hooks-DwRvpafb.js} +1 -1
  12. package/dist/Amap/index.js +10 -10
  13. package/dist/Calendar/{AllDaySection-CseF1DuB.js → AllDaySection-M-b9tRHh.js} +4 -4
  14. package/dist/Calendar/{Calendar-Yu2HfA5D.js → Calendar-C9PhASp0.js} +13 -13
  15. package/dist/Calendar/{CurrentTimeIndicator-CUeblc9r.js → CurrentTimeIndicator-Dpi36eVJ.js} +1 -1
  16. package/dist/Calendar/{EventCard-L6jaKgEw.js → EventCard-BIfRqCk5.js} +3 -3
  17. package/dist/Calendar/{TimeGrid-B8lvUb1W.js → TimeGrid-Dk3soSo4.js} +2 -2
  18. package/dist/Calendar/context/index.js +1 -1
  19. package/dist/Calendar/index.js +19 -19
  20. package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
  21. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -4
  22. package/dist/Calendar/subcomponents/EventCard/index.js +5 -5
  23. package/dist/Calendar/subcomponents/TimeAxis/index.js +3 -3
  24. package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
  25. package/dist/Calendar/{theme-BzNDRi0U.js → theme-Cgn0zQoC.js} +2 -2
  26. package/dist/Calendar/utils/index.js +3 -3
  27. package/dist/Calendar/utils/layout/index.js +2 -2
  28. package/dist/Calendar/utils/theme/index.js +1 -1
  29. package/dist/Card/{Card-CRrtIjNT.js → Card-BjWdQRjq.js} +1 -1
  30. package/dist/Card/index.js +2 -2
  31. package/dist/CheckBox/{CheckBox-DIunYcfS.js → CheckBox-81R8QKHb.js} +1 -1
  32. package/dist/CheckBox/{CheckBox-CkVe5Boq.js → CheckBox-ejvbDr-a.js} +1 -1
  33. package/dist/CheckBox/index.js +3 -3
  34. package/dist/ColorPicker/{ColorPicker-By-Y8Tyz.js → ColorPicker-aj57lMA5.js} +5 -5
  35. package/dist/ColorPicker/index.js +6 -6
  36. package/dist/ConfigProvider/index.js +2 -2
  37. package/dist/DatePicker/{DatePicker-PCdNachD.js → DatePicker-EIFyC9zF.js} +6 -6
  38. package/dist/DatePicker/{DatePickerPanel-HoxXteK0.js → DatePickerPanel-BjnLfncu.js} +5 -5
  39. package/dist/DatePicker/index.js +7 -7
  40. package/dist/DatePicker/style/index.js +1 -1
  41. package/dist/DatePicker/{style-DZaSSoNs.js → style-BxWyBhZ3.js} +1 -1
  42. package/dist/DropDown/DropDown-B34vfoOs.js +172 -0
  43. package/dist/DropDown/index.js +8 -7
  44. package/dist/DropDown/style/index.js +2 -0
  45. package/dist/DropDown/style-4LK6rNHe.js +9 -0
  46. package/dist/Editor/{Buttons-DmSUkHWl.js → Buttons-Ds6bLmnl.js} +6 -6
  47. package/dist/Editor/ToolbarPlugin/Buttons/index.js +15 -14
  48. package/dist/Editor/index.js +15 -14
  49. package/dist/Gantt/GanttChart/index.js +15 -14
  50. package/dist/Gantt/{GanttChart-BgDJOyW1.js → GanttChart-DbI1fvxe.js} +757 -605
  51. package/dist/Gantt/GanttTable/index.js +9 -9
  52. package/dist/Gantt/{GanttTable-Di_p-0M1.js → GanttTable-C3PLGmKr.js} +20 -19
  53. package/dist/Gantt/GanttToolBar/index.js +11 -10
  54. package/dist/Gantt/GanttToolBar-8jPQ9BAG.js +121 -0
  55. package/dist/Gantt/{collapseKeys-C8139wvy.js → collapseKeys-1N9ci2oJ.js} +2 -2
  56. package/dist/Gantt/index.js +195 -162
  57. package/dist/Gantt/theme-C197Dtjy.js +31 -0
  58. package/dist/Gantt/{timelineViewConfig-BXl2UkN8.js → timelineViewConfig-Dl3AXO45.js} +1 -1
  59. package/dist/Gantt/utils/index.js +5 -5
  60. package/dist/Gantt/utils/theme/index.js +2 -0
  61. package/dist/Icon/index.js +1 -1
  62. package/dist/InputTag/InputTag-CGQ5dXyf.js +143 -0
  63. package/dist/InputTag/index.js +3 -2
  64. package/dist/Loading/index.js +1 -1
  65. package/dist/Modal/{Modal-D3LFqIV4.js → Modal-GGHNlZv3.js} +1 -1
  66. package/dist/Modal/index.js +2 -2
  67. package/dist/NotFoundContent/index.js +1 -1
  68. package/dist/Radio/index.js +1 -1
  69. package/dist/ScrollBar/ScrollBar-CSGBOE3e.js +68 -0
  70. package/dist/ScrollBar/index.js +2 -0
  71. package/dist/Segmented/{Segmented-BTW445jc.js → Segmented-CzVKrL6o.js} +1 -1
  72. package/dist/Segmented/index.js +1 -1
  73. package/dist/Select/{Select-OjCjCogR.js → Select-B0r9VgF6.js} +199 -200
  74. package/dist/Select/{SelectInputSearch-DXPTGSc2.js → SelectInputSearch-BDwg-Noi.js} +2 -2
  75. package/dist/Select/index.js +12 -11
  76. package/dist/Table/Table-BtH9Oa14.js +545 -0
  77. package/dist/Table/hooks/index.js +1 -1
  78. package/dist/Table/{hooks-CJ2CnSep.js → hooks-DK8Pf7iH.js} +1 -1
  79. package/dist/Table/index.js +8 -7
  80. package/dist/Table/{processRowspan-BCzfI5un.js → processRowspan-D4uv6zLk.js} +1 -1
  81. package/dist/Table/style/index.js +2 -0
  82. package/dist/Table/style-BwcnT2ee.js +9 -0
  83. package/dist/Table/utils/index.js +1 -1
  84. package/dist/Tabs/{Tabs-DVQcB3YG.js → Tabs-7wEcxUv6.js} +4 -4
  85. package/dist/Tabs/index.js +4 -4
  86. package/dist/Tooltip/{Tooltip-DW_XP13m.js → Tooltip-B_SZOy6k.js} +41 -44
  87. package/dist/Tooltip/index.js +1 -1
  88. package/dist/Tree/index.js +4 -4
  89. package/dist/components/DropDown/index.d.ts +1 -0
  90. package/dist/components/DropDown/interface.d.ts +45 -0
  91. package/dist/components/DropDown/style/__tests__/resolveDropDownThemeVars.test.d.ts +1 -0
  92. package/dist/components/DropDown/style/index.d.ts +1 -0
  93. package/dist/components/DropDown/style/resolveDropDownThemeVars.d.ts +2 -0
  94. package/dist/components/Gantt/Gantt.d.ts +1 -1
  95. package/dist/components/Gantt/GanttChart/GanttTimelineHeader/HeaderStickyTopLabel.d.ts +9 -0
  96. package/dist/components/Gantt/GanttChart/hooks/useEdgeScroll.d.ts +1 -1
  97. package/dist/components/Gantt/GanttChart/utils/constants.d.ts +1 -1
  98. package/dist/components/Gantt/GanttTable/GanttTable.d.ts +1 -1
  99. package/dist/components/Gantt/GanttThemeContext.d.ts +3 -0
  100. package/dist/components/Gantt/index.d.ts +2 -1
  101. package/dist/components/Gantt/interface.d.ts +39 -0
  102. package/dist/components/Gantt/internal/GanttLayout.d.ts +1 -1
  103. package/dist/components/Gantt/types.internal.d.ts +4 -0
  104. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttTheme.test.d.ts +1 -0
  105. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttThemeVars.test.d.ts +1 -0
  106. package/dist/components/Gantt/utils/theme/__tests__/resolveTableThemeFromGantt.test.d.ts +1 -0
  107. package/dist/components/Gantt/utils/theme/index.d.ts +3 -0
  108. package/dist/components/Gantt/utils/theme/resolveGanttTheme.d.ts +3 -0
  109. package/dist/components/Gantt/utils/theme/resolveGanttThemeVars.d.ts +5 -0
  110. package/dist/components/Gantt/utils/theme/resolveTableThemeFromGantt.d.ts +4 -0
  111. package/dist/components/ScrollBar/ScrollBar.d.ts +3 -0
  112. package/dist/components/ScrollBar/__tests__/ScrollBar.test.d.ts +1 -0
  113. package/dist/components/ScrollBar/index.d.ts +3 -0
  114. package/dist/components/ScrollBar/interface.d.ts +23 -0
  115. package/dist/components/Table/index.d.ts +2 -1
  116. package/dist/components/Table/interface.d.ts +17 -0
  117. package/dist/components/Table/style/__tests__/resolveTableThemeVars.test.d.ts +1 -0
  118. package/dist/components/Table/style/index.d.ts +1 -0
  119. package/dist/components/Table/style/resolveTableThemeVars.d.ts +3 -0
  120. package/dist/components/index.d.ts +5 -2
  121. package/dist/index.js +50 -47
  122. package/dist/style.css +1 -1
  123. package/dist/utils/mergeRefs.d.ts +1 -0
  124. package/dist/vendors/{ConfigProvider-DwmA94S2.js → ConfigProvider-AQTr7T_c.js} +1 -1
  125. package/dist/vendors/{Tree-C7BgkjCQ.js → Tree-DqnOGJtB.js} +3 -3
  126. package/dist/vendors/mergeRefs-TiJ0xjUN.js +9 -0
  127. package/dist/vendors/{useLocale-BTz4slNW.js → useLocale-DZ8XW2VL.js} +1 -1
  128. package/package.json +3 -4
  129. package/dist/DropDown/DropDown-CvQAbsEo.js +0 -168
  130. package/dist/Gantt/GanttToolBar-D5pQdrzv.js +0 -105
  131. package/dist/InputTag/InputTag-zP5QdId7.js +0 -139
  132. package/dist/Table/Table-3-kFIm5v.js +0 -543
  133. /package/dist/Amap/{AmapContext-JaYk1a3H.js → AmapContext-CFmsMycg.js} +0 -0
  134. /package/dist/Amap/{useMarkerInfoWindowController-CRgf2I0Q.js → useMarkerInfoWindowController-G-Bg-NDJ.js} +0 -0
  135. /package/dist/Calendar/{TimeAxis-cK2_3FeM.js → TimeAxis-Chwxo6Yj.js} +0 -0
  136. /package/dist/Calendar/{colorUtils-DcpqM3KR.js → colorUtils-FNbm3zBQ.js} +0 -0
  137. /package/dist/Calendar/{context-DNOJ9LW_.js → context-CzS6P3nk.js} +0 -0
  138. /package/dist/Calendar/{layout-CaPxiRd-.js → layout-Cb39seCc.js} +0 -0
  139. /package/dist/DatePicker/{ensureDayjsPlugins-C3aqki6i.js → ensureDayjsPlugins-DxqbKqon.js} +0 -0
  140. /package/dist/DatePicker/{pickerLocale-VqSP_iIm.js → pickerLocale-CtDOOxxD.js} +0 -0
  141. /package/dist/Gantt/{GanttHighlightContext-AIpN3-af.js → GanttHighlightContext-CtT98ZnK.js} +0 -0
  142. /package/dist/Gantt/{columnResize-By_1E48E.js → columnResize-DFe7F98O.js} +0 -0
  143. /package/dist/Gantt/{constants-D4ur8WRs.js → constants-CrBb5i5p.js} +0 -0
  144. /package/dist/Gantt/{highlightTarget-DmzCIiQb.js → highlightTarget-DtCe7zto.js} +0 -0
  145. /package/dist/Icon/{Icon-BQ3Whub2.js → Icon-SQ5tu-yG.js} +0 -0
  146. /package/dist/Loading/{Loading-WjmzBabh.js → Loading-ho-6d72M.js} +0 -0
  147. /package/dist/NotFoundContent/{NotFoundContent-7xV-zOG2.js → NotFoundContent-CV9fTylQ.js} +0 -0
  148. /package/dist/Radio/{Radio-DkrZHoG1.js → Radio-C2zJzZc3.js} +0 -0
  149. /package/dist/Table/{constants-CKqc9Os_.js → constants-CuBlYZLO.js} +0 -0
  150. /package/dist/vendors/{LocaleContext-BJdHS0sH.js → LocaleContext-CBcJzvUD.js} +0 -0
  151. /package/dist/vendors/{animations-BeI8JZp1.js → animations-Mlw78WYo.js} +0 -0
  152. /package/dist/vendors/{color-BeQo449h.js → color-BQYy0Wgy.js} +0 -0
  153. /package/dist/vendors/{cssVars-C4BlzyxA.js → cssVars-DoQgQ2CM.js} +0 -0
  154. /package/dist/vendors/{useFloatingOverlay-3KB88hpZ.js → useFloatingOverlay-WbbHmuT-.js} +0 -0
  155. /package/dist/vendors/{useFloatingPortal-DsEtsAGW.js → useFloatingPortal-B2SDNV5C.js} +0 -0
@@ -1,29 +1,30 @@
1
- import { t as e } from "../Icon/Icon-BQ3Whub2.js";
2
- import { t } from "../vendors/useLocale-BTz4slNW.js";
3
- import { t as n } from "../Tooltip/Tooltip-DW_XP13m.js";
4
- 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 "./constants-D4ur8WRs.js";
5
- import { t as d } from "./GanttHighlightContext-AIpN3-af.js";
6
- import { n as f, r as p } from "./highlightTarget-DmzCIiQb.js";
7
- import { a as m, d as h, i as g, n as _, r as v, t as y, u as b } from "./timelineViewConfig-BXl2UkN8.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 P } from "./collapseKeys-C8139wvy.js";
9
- import { n as oe, t as F } from "./GanttToolBar-D5pQdrzv.js";
10
- import { isFunction as I, isNumber as L, isString as R } from "lodash-es";
11
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
12
- import H, { forwardRef as U, memo as W, useCallback as G, useEffect as K, useImperativeHandle as se, useLayoutEffect as ce, useMemo as q, useRef as J, useState as Y } from "react";
13
- import X from "clsx";
14
- import { useDocumentVisibility as le, useSize as ue } from "ahooks";
15
- import { createContext as de, useContextSelector as Z } from "use-context-selector";
16
- import Q from "dayjs";
17
- import fe from "dayjs/plugin/isoWeek";
18
- import { useVirtualizer as pe } from "@tanstack/react-virtual";
19
- import me from "dayjs/plugin/quarterOfYear";
20
- import { OverlayScrollbars as he } from "overlayscrollbars";
1
+ import { t as e } from "../Icon/Icon-SQ5tu-yG.js";
2
+ import { t } from "../vendors/useLocale-DZ8XW2VL.js";
3
+ import { t as n } from "../Tooltip/Tooltip-B_SZOy6k.js";
4
+ 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 "./constants-CrBb5i5p.js";
5
+ import { t as d } from "./GanttHighlightContext-CtT98ZnK.js";
6
+ import { n as f, r as p } from "./highlightTarget-DtCe7zto.js";
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 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
+ 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 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 ge = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, _e = {
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
- }, ve = (e) => !e || e.invalid || e.type === "summary" || e.draggable === !1 ? _e : 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 ge = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, _e = {
31
32
  canMove: !0,
32
33
  canResizeStart: !0,
33
34
  canResizeEnd: !0
34
- }, ye = (e, t) => ge(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, be = (e, t) => !t || Math.abs(e) < Math.min(5, t) ? 0 : Math.round(e / t), xe = (e, t) => be(e, t), Se = (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 = Q(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
- }, Ce = (e, t, n) => ({
39
+ }, De = (e, t, n) => ({
39
40
  startMs: e + n,
40
41
  endMs: t + n
41
- }), we = ({ 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 ge = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, _e = {
51
52
  startMs: e,
52
53
  endMs: Math.max(t + n, a)
53
54
  };
54
- }, Te = (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 = Se(u, r, "round"), a = e.originEndMs, a - i < r && (i = a - r)) : (a = Se(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 ge = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, _e = {
64
65
  previewLeftPx: e.dragMode === "resize-end" ? e.originLeftPx : l
65
66
  };
66
67
  };
67
- function Ee(e) {
68
+ function Ae(e) {
68
69
  let t = {
69
70
  taskId: String(e.item.id),
70
71
  newStart: e.startMs,
@@ -95,20 +96,20 @@ function Ee(e) {
95
96
  deltaDays: n.deltaDays
96
97
  };
97
98
  }
98
- var De = (e) => e && I(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 Oe(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 ke(e, t) {
105
- let n = J(null), r = J(0), i = G(() => {
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
- K(() => () => {
109
+ W(() => () => {
109
110
  n.current !== null && cancelAnimationFrame(n.current);
110
111
  }, []);
111
- let a = G(() => {
112
+ let a = U(() => {
112
113
  if (n.current !== null) return;
113
114
  let i = () => {
114
115
  let a = e.current, o = r.current;
@@ -122,11 +123,11 @@ function ke(e, t) {
122
123
  n.current = requestAnimationFrame(i);
123
124
  }, [e, t]);
124
125
  return {
125
- startEdgeDetection: G((t, n) => {
126
+ startEdgeDetection: U((t, n) => {
126
127
  let o = e.current;
127
- if (!o) return;
128
- let s = n ?? o.getBoundingClientRect(), c = t - s.left, l = s.right - t, u = c < 60 ? Oe(c, -1) : l < 60 ? Oe(l, 1) : 0;
129
- r.current = u, u === 0 ? i() : a();
128
+ if (!o) return 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;
130
+ return r.current = u, u === 0 ? i() : a(), u;
130
131
  }, [
131
132
  e,
132
133
  a,
@@ -137,19 +138,19 @@ function ke(e, t) {
137
138
  }
138
139
  //#endregion
139
140
  //#region src/components/Gantt/GanttChart/hooks/useGanttDrag.tsx
140
- function Ae({ 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 = J(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] = Y({}), [y, b] = Y(null), x = J(null), S = J({
144
+ let [_, v] = J({}), [y, b] = J(null), x = q(null), S = q({
144
145
  shouldSuppressClick: !1,
145
146
  at: 0
146
- }), C = J(0), w = J(null), { startEdgeDetection: T, stopEdgeScroll: ee } = ke(c ?? { current: null }, w), E = J({});
147
- K(() => {
147
+ }), C = q(0), w = q(null), { startEdgeDetection: T, stopEdgeScroll: ee } = Ne(c ?? { current: null }, w), E = q({});
148
+ W(() => {
148
149
  x.current = y;
149
- }, [y]), K(() => () => {
150
+ }, [y]), W(() => () => {
150
151
  for (let e of Object.values(E.current)) e.timeoutId && clearTimeout(e.timeoutId);
151
152
  }, []);
152
- let D = G(() => {
153
+ let D = U(() => {
153
154
  v((e) => {
154
155
  let t = Object.keys(E.current);
155
156
  if (t.length === 0) return {};
@@ -160,14 +161,14 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
160
161
  shouldSuppressClick: !1,
161
162
  at: 0
162
163
  };
163
- }, []), O = G(() => {
164
+ }, []), O = U(() => {
164
165
  for (let e of Object.values(E.current)) e.timeoutId && clearTimeout(e.timeoutId);
165
166
  E.current = {}, v({}), S.current = {
166
167
  shouldSuppressClick: !1,
167
168
  at: 0
168
169
  };
169
- }, []), k = G((e, t, n, r, i = 1) => {
170
- if (!ye(t, r) || t.invalid) return;
170
+ }, []), k = U((e, t, n, r, i = 1) => {
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,
@@ -190,61 +191,73 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
190
191
  shouldSuppressClick: !1,
191
192
  at: 0
192
193
  }, x.current = _, b(_), u?.(!0);
193
- }, [c, u]), A = G((e, t, n, r) => {
194
+ }, [c, u]), A = U((e, t, n, r) => {
194
195
  k(e, t, n, o, r);
195
- }, [k]), j = G((e, t, n, i, a) => {
196
+ }, [k]), j = U((e, t, n, i, a) => {
196
197
  k(e, t, n, i === "start" ? l : r, a);
197
198
  }, [k]);
198
- return K(() => {
199
+ return W(() => {
199
200
  if (!y?.taskId) return;
200
- let e = (e, t) => {
201
- let n = x.current;
202
- if (!n) return;
203
- let r = c?.current, i = t ?? r?.getBoundingClientRect(), a = r?.scrollLeft ?? 0, o = g.current, s = a + (i ? e - i.left : 0) - n.grabOffsetInBar, l = n.dragMode === "resize-end" ? n.originLeftPx : s, u = s - n.originAnchorPx;
201
+ let e = (e, t, n = "mousemove") => {
202
+ let r = x.current;
203
+ if (!r) return;
204
+ let i = c?.current, a = t ?? i?.getBoundingClientRect(), o = i?.scrollLeft ?? 0, s = g.current, l = o + (a ? e - a.left : 0) - r.grabOffsetInBar, u = r.dragMode === "resize-end" ? r.originLeftPx : l;
205
+ if (n === "edgeScroll") {
206
+ let e = r.dragMode === "resize-end" ? r.originLeftPx : u;
207
+ if (e === r.previewLeftPx) return;
208
+ let t = {
209
+ ...r,
210
+ previewLeftPx: e
211
+ };
212
+ x.current = t, b(t);
213
+ return;
214
+ }
215
+ let m = l - r.originAnchorPx;
204
216
  if (!d) {
205
217
  let e = {
206
- ...Te(n, u, o, f),
207
- previewLeftPx: l
218
+ ...ke(r, m, s, f),
219
+ previewLeftPx: u
208
220
  };
209
- if (e.deltaUnits === n.deltaUnits && e.previewLeftPx === n.previewLeftPx && e.previewStartMs === n.previewStartMs && e.previewEndMs === n.previewEndMs) return;
221
+ if (e.deltaUnits === r.deltaUnits && e.previewLeftPx === r.previewLeftPx && e.previewStartMs === r.previewStartMs && e.previewEndMs === r.previewEndMs) return;
210
222
  let t = {
211
- ...n,
223
+ ...r,
212
224
  ...e
213
225
  };
214
226
  x.current = t, b(t);
215
227
  return;
216
228
  }
217
- let m = xe(u, p), h = {
218
- ...n,
219
- deltaUnits: m,
220
- previewLeftPx: l
229
+ let h = Te(m, p), _ = {
230
+ ...r,
231
+ deltaUnits: h,
232
+ previewLeftPx: u
221
233
  };
222
- if (n.dragMode === "move") {
223
- let e = Ce(n.originStartMs, n.originEndMs, m * f);
224
- h.previewStartMs = e.startMs, h.previewEndMs = e.endMs;
234
+ if (r.dragMode === "move") {
235
+ let e = De(r.originStartMs, r.originEndMs, h * f);
236
+ _.previewStartMs = e.startMs, _.previewEndMs = e.endMs;
225
237
  } else {
226
- let e = we({
227
- startMs: n.originStartMs,
228
- endMs: n.originEndMs,
229
- deltaMs: m * f,
230
- edge: n.dragMode === "resize-start" ? "start" : "end",
238
+ let e = Oe({
239
+ startMs: r.originStartMs,
240
+ endMs: r.originEndMs,
241
+ deltaMs: h * f,
242
+ edge: r.dragMode === "resize-start" ? "start" : "end",
231
243
  minDurationMs: f
232
244
  });
233
- h.previewStartMs = e.startMs, h.previewEndMs = e.endMs;
245
+ _.previewStartMs = e.startMs, _.previewEndMs = e.endMs;
234
246
  }
235
- let _ = Math.round((h.previewStartMs - n.originStartMs) / f), v = {
236
- ...h,
237
- deltaUnits: n.dragMode === "resize-end" ? Math.round((h.previewEndMs - n.originEndMs) / f) : _
247
+ let v = Math.round((_.previewStartMs - r.originStartMs) / f), y = {
248
+ ..._,
249
+ deltaUnits: r.dragMode === "resize-end" ? Math.round((_.previewEndMs - r.originEndMs) / f) : v
238
250
  };
239
- v.deltaUnits === n.deltaUnits && v.previewLeftPx === n.previewLeftPx && v.previewStartMs === n.previewStartMs && v.previewEndMs === n.previewEndMs || (x.current = v, b(v));
251
+ y.deltaUnits === r.deltaUnits && y.previewLeftPx === r.previewLeftPx && y.previewStartMs === r.previewStartMs && y.previewEndMs === r.previewEndMs || (x.current = y, b(y));
240
252
  };
241
253
  w.current = () => {
242
- e(C.current);
254
+ let t = c?.current?.getBoundingClientRect() ?? null;
255
+ e(C.current, t, "edgeScroll");
243
256
  };
244
257
  let n = (t) => {
245
258
  C.current = t.clientX;
246
- let n = c?.current?.getBoundingClientRect() ?? null;
247
- e(t.clientX, n), T(t.clientX, n ?? void 0);
259
+ let n = c?.current?.getBoundingClientRect() ?? null, r = T(t.clientX, n ?? void 0);
260
+ e(t.clientX, n, r === 0 ? "mousemove" : "edgeScroll");
248
261
  }, r = () => {
249
262
  ee(), w.current = null, e(C.current);
250
263
  let n = x.current;
@@ -255,7 +268,7 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
255
268
  at: Date.now()
256
269
  };
257
270
  let o = r;
258
- if (!ye(n.item, n.dragMode) || !o || !i) {
271
+ if (!Ce(n.item, n.dragMode) || !o || !i) {
259
272
  x.current = null, b(null);
260
273
  return;
261
274
  }
@@ -282,15 +295,15 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
282
295
  };
283
296
  let m, g;
284
297
  if (d) if (n.dragMode === "move") {
285
- let e = Se(n.previewStartMs, f, "round"), t = e - n.previewStartMs;
298
+ let e = Ee(n.previewStartMs, f, "round"), t = e - n.previewStartMs;
286
299
  m = e, g = n.previewEndMs + t;
287
- } else n.dragMode === "resize-start" ? (m = Se(n.previewStartMs, f, "round"), g = n.previewEndMs) : (m = n.previewStartMs, g = Se(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"));
288
301
  else {
289
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;
290
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;
291
304
  }
292
305
  let _;
293
- _ = h(t) ? Ee({
306
+ _ = h(t) ? Ae({
294
307
  item: n.item,
295
308
  startMs: m,
296
309
  endMs: g,
@@ -298,7 +311,7 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
298
311
  snapUnitMs: f,
299
312
  changeType: n.dragMode,
300
313
  viewMode: t
301
- }) : Ee({
314
+ }) : Ae({
302
315
  item: n.item,
303
316
  startMs: m,
304
317
  endMs: g,
@@ -307,7 +320,7 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
307
320
  snapUnitMs: f,
308
321
  changeType: n.dragMode,
309
322
  viewMode: t
310
- }), De(i(_)).catch((e) => {
323
+ }), je(i(_)).catch((e) => {
311
324
  console.error("[GanttChart] onTaskTimeChange rejected", e), E.current[c]?.opId === l && v((e) => {
312
325
  let t = { ...e };
313
326
  return delete t[c], t;
@@ -340,7 +353,7 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
340
353
  forceResetAllCommittedRanges: O,
341
354
  handleTaskMouseDown: A,
342
355
  handleResizeMouseDown: j,
343
- consumeRecentDragResult: G(() => {
356
+ consumeRecentDragResult: U(() => {
344
357
  let { shouldSuppressClick: e, at: t } = S.current;
345
358
  return S.current = {
346
359
  shouldSuppressClick: !1,
@@ -351,25 +364,25 @@ function Ae({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange:
351
364
  }
352
365
  //#endregion
353
366
  //#region src/components/Gantt/GanttChart/utils/timelineFocus.ts
354
- function je(e, t, n) {
367
+ function Fe(e, t, n) {
355
368
  let r = Number(t) > 0 ? Number(t) : 0, i = Number(n) > 0 ? Number(n) : 0, a = Math.max(0, i - r);
356
369
  return Number.isFinite(e) ? Math.min(Math.max(0, e), a) : 0;
357
370
  }
358
- function Me({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
371
+ function Ie({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
359
372
  let i = Number(n) > 0 ? Number(n) : 0;
360
373
  if (!Number.isFinite(e) || typeof t != "function" || i <= 0) return 0;
361
374
  let a = t(e);
362
- return Number.isFinite(a) ? je(a - i / 2, i, r) : 0;
375
+ return Number.isFinite(a) ? Fe(a - i / 2, i, r) : 0;
363
376
  }
364
377
  //#endregion
365
378
  //#region src/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.ts
366
- function Ne(e) {
379
+ function Le(e) {
367
380
  let t = Number(e);
368
381
  return Math.max((Number.isFinite(t) && t > 0 ? t : 0) * 4, 240);
369
382
  }
370
- function Pe(e, t) {
383
+ function Re(e, t) {
371
384
  if (!Array.isArray(e) || e.length === 0) return [];
372
- let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a = Ne(Number(e[0]?.width) > 0 ? Number(e[0].width) : i), o = e[e.length - 1], s = je(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;
373
386
  for (; d <= f;) {
374
387
  let t = d + f >> 1, n = e[t];
375
388
  n.left + n.width > c ? (p = t, f = t - 1) : d = t + 1;
@@ -385,9 +398,9 @@ function Pe(e, t) {
385
398
  for (let e = p; e <= m; e += 1) h.push({ index: e });
386
399
  return h;
387
400
  }
388
- function Fe({ 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 }) {
389
402
  return {
390
- virtualColumns: q(() => Pe(e, {
403
+ virtualColumns: K(() => Re(e, {
391
404
  scrollLeft: n,
392
405
  viewportWidth: r,
393
406
  pixelsPerDay: t
@@ -397,11 +410,11 @@ function Fe({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r
397
410
  n,
398
411
  r
399
412
  ]),
400
- weekendSegments: q(() => {
413
+ weekendSegments: K(() => {
401
414
  if (!i || o <= 0 || c !== "day") return [];
402
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 = [];
403
416
  for (let e = u; e <= d; e += 1) {
404
- let n = a + e * s, r = P(n);
417
+ let n = a + e * s, r = ae(n);
405
418
  (r === 0 || r === 6) && f.push({
406
419
  id: `weekend-${n}`,
407
420
  left: e * t,
@@ -420,8 +433,8 @@ function Fe({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r
420
433
  ])
421
434
  };
422
435
  }
423
- Q.extend(fe), Q.extend(me);
424
- var Ie = {
436
+ he.extend(ge), he.extend(ve);
437
+ var Be = {
425
438
  day: {
426
439
  amount: 1,
427
440
  unit: "day"
@@ -474,7 +487,7 @@ var Ie = {
474
487
  amount: 1,
475
488
  unit: "minute"
476
489
  }
477
- }, Le = (e, t, n) => {
490
+ }, Ve = (e, t, n) => {
478
491
  switch (t) {
479
492
  case "halfDay": return e.hour() < 12 ? n("header.lower.halfDayAm") : n("header.lower.halfDayPm");
480
493
  case "sixHour": {
@@ -490,7 +503,7 @@ var Ie = {
490
503
  case "oneMinute": return e.format("mm");
491
504
  default: return e.format("DD");
492
505
  }
493
- }, Re = (e, t, n) => {
506
+ }, He = (e, t, n) => {
494
507
  let r = C(e.valueOf());
495
508
  switch (t) {
496
509
  case "day": return r.format("DD");
@@ -499,25 +512,38 @@ var Ie = {
499
512
  case "quarterMonth": return D(e.valueOf(), n);
500
513
  case "quarter": return n("header.lower.quarter", { quarter: r.quarter() });
501
514
  case "year": return r.month() < 6 ? n("firstHalf") : n("secondHalf");
502
- default: return Le(r, t, n);
515
+ default: return Ve(r, t, n);
503
516
  }
504
- }, ze = (e, t) => {
517
+ }, Ue = (e, t) => {
505
518
  let n = C(e.valueOf()), r = y(t).headerLayout;
506
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")}`;
507
- }, Be = (e, t, n) => {
520
+ }, We = (e, t, n) => {
508
521
  let r = C(e.valueOf()), i = y(t).headerLayout;
509
- return i === "dayNested" ? n("header.top.monthDay", {
522
+ if (i === "dayNested") return { label: n("header.top.monthDay", {
510
523
  month: r.month() + 1,
511
524
  day: r.date()
512
- }) : i === "hourNested" ? r.hour() === 0 ? n("header.top.hourWithDate", {
513
- month: r.month() + 1,
514
- day: r.date(),
515
- hour: 0
516
- }) : 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", {
517
543
  year: r.year(),
518
544
  month: r.month() + 1
519
- }) : n("header.top.year", { year: r.year() });
520
- }, Ve = (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) => {
521
547
  let s = _(r), c = A ?? 100;
522
548
  e.push({
523
549
  id: `${r}-${t}`,
@@ -525,64 +551,54 @@ var Ie = {
525
551
  endMs: n,
526
552
  left: s ? e.length * c : M(t, i, a, r),
527
553
  width: s ? c : Math.max(1, ee(t, n, a, r)),
528
- label: Re(Q(t), r, o)
554
+ label: He(he(t), r, o)
529
555
  });
530
- }, He = ({ viewMode: e, timelineStartMs: t, timelineEndMs: n, pixelsPerDay: r, formatMessage: i }) => {
531
- let a = [], o = Ie[e] || Ie.day, s = Q(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));
532
558
  _(e) && (s = s.startOf("month"));
533
- let c = Q(ae(n));
559
+ let c = he(P(n));
534
560
  for (; s.isBefore(c);) {
535
561
  o.align && (s = o.align(s));
536
562
  let n = s.add(o.amount, o.unit);
537
- Ve(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;
538
564
  }
539
565
  return a;
540
- }, Ue = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
566
+ }, qe = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
541
567
  if (!Array.isArray(e) || e.length === 0) return [];
542
568
  let r = [], i = null;
543
569
  for (let a of e) {
544
- let e = Q(a.startMs), o = ze(e, t);
545
- if (!i || i.key !== o) {
546
- i && r.push({
547
- id: i.key,
548
- left: i.left,
549
- width: i.width,
550
- label: i.label
551
- }), i = {
552
- 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,
553
574
  left: a.left,
554
575
  width: a.width,
555
- label: Be(e, t, n)
576
+ ...We(e, t, n)
556
577
  };
557
578
  continue;
558
579
  }
559
580
  i.width += a.width;
560
581
  }
561
- return i !== null && r.push({
562
- id: i.key,
563
- left: i.left,
564
- width: i.width,
565
- label: i.label
566
- }), r;
567
- }, We = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.startMs < e.endMs, Ge = (e) => {
568
- if (!We(e)) throw RangeError("Timeline range must be finite and satisfy startMs < endMs");
569
- }, Ke = (e, t) => {
570
- if (Ge(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");
571
587
  return e.startMs <= t && t < e.endMs;
572
- }, qe = (e, t) => (Ge(e), Ge(t), e.startMs < t.endMs && t.startMs < e.endMs), Je = (e, t) => {
573
- Ge(e), Ge(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);
574
590
  let n = Math.max(e.startMs, t.startMs), r = Math.min(e.endMs, t.endMs);
575
591
  return n < r ? {
576
592
  startMs: n,
577
593
  endMs: r
578
594
  } : null;
579
- }, Ye = (e, t) => {
595
+ }, $e = (e, t) => {
580
596
  if (!Number.isFinite(e) || e <= 0) throw RangeError(`${t} must be finite and greater than zero`);
581
- }, Xe = (e, t) => {
597
+ }, et = (e, t) => {
582
598
  if (Number.isFinite(e)) return e;
583
599
  if (Number.isFinite(t)) return t;
584
600
  throw RangeError("focusMs or fallbackFocusMs must be finite");
585
- }, Ze = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
601
+ }, tt = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
586
602
  let a = (t - e) / s;
587
603
  if (a * i >= r) return {
588
604
  startMs: e,
@@ -590,24 +606,24 @@ var Ie = {
590
606
  };
591
607
  let o = Math.ceil(r / i), c = Math.ceil((o - a) / 2) * s;
592
608
  return S(e - c, t + c, n);
593
- }, Qe = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
609
+ }, nt = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
594
610
  let a = (r / 2 + 281) / i * s;
595
- return Ze({
611
+ return tt({
596
612
  ...S(Math.min(e.startMs, t - a), Math.max(e.endMs, t + a), n),
597
613
  viewMode: n,
598
614
  viewportWidth: r,
599
615
  pixelsPerDay: i
600
616
  });
601
- }, $e = ({ renderWindow: e, timelineCoords: t, scrollLeft: n, viewportWidth: r }) => {
602
- if (!We(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");
603
619
  if (!Number.isFinite(n) || n < 0) throw RangeError("scrollLeft must be finite and non-negative");
604
- Ye(r, "viewportWidth");
620
+ $e(r, "viewportWidth");
605
621
  let i = {
606
622
  startMs: t.timeAtX(n),
607
623
  endMs: t.timeAtX(n + r)
608
624
  };
609
- if (!We(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
610
- let a = Je(i, e);
625
+ if (!Je(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
626
+ let a = Qe(i, e);
611
627
  if (!a) throw RangeError("Visible range must intersect renderWindow");
612
628
  let o = t.timeAtX(n + r / 2);
613
629
  if (!Number.isFinite(o)) throw RangeError("TimelineCoords must produce a finite focus");
@@ -616,65 +632,65 @@ var Ie = {
616
632
  visibleRange: a,
617
633
  focusMs: o
618
634
  };
619
- }, et = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
635
+ }, it = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
620
636
  if (!Number.isFinite(e) || e < 0) throw RangeError("scrollLeft must be finite and non-negative");
621
- if (Ye(t, "viewportWidth"), Ye(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");
622
638
  let i = Math.max(0, n - t);
623
639
  if (i === 0) return null;
624
640
  let a = Math.min(e, i), o = a <= r;
625
641
  return o === i - a <= r ? null : o ? "left" : "right";
626
- }, tt = ({ focusMs: e, fallbackFocusMs: t, viewMode: n, timeRangeConfig: r, viewportWidth: i, pixelsPerDay: a }) => {
627
- Ye(i, "viewportWidth"), Ye(a, "pixelsPerDay");
628
- let o = Xe(e, t), s = Qe({
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({
629
645
  range: j(r, o),
630
646
  focusMs: o,
631
647
  viewMode: n,
632
648
  viewportWidth: i,
633
649
  pixelsPerDay: a
634
650
  });
635
- if (!We(s)) throw RangeError("Viewport engine produced an invalid render window");
651
+ if (!Je(s)) throw RangeError("Viewport engine produced an invalid render window");
636
652
  return s;
637
- }, nt = ({ focusMs: e, fallbackFocusMs: t, timelineCoords: n, viewportWidth: r, timelineWidth: i }) => {
638
- let a = Xe(e, t);
639
- return Ye(r, "viewportWidth"), Ye(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"), {
640
656
  focusMs: a,
641
- scrollLeft: Me({
657
+ scrollLeft: Ie({
642
658
  anchorMs: a,
643
659
  toX: n.toX,
644
660
  viewportWidth: r,
645
661
  timelineWidth: i
646
662
  })
647
663
  };
648
- }, rt = (e) => {
664
+ }, st = (e) => {
649
665
  if (v(e)) {
650
666
  let t = g(e);
651
- return Se(Date.now(), t, "floor") + t / 2;
667
+ return Ee(Date.now(), t, "floor") + t / 2;
652
668
  }
653
669
  return T(Date.now()) + s / 2;
654
- }, it = (e, t) => {
670
+ }, ct = (e, t) => {
655
671
  if (v(t)) {
656
672
  let n = g(t);
657
- return Se(e, n, "floor") + n + 1;
673
+ return Ee(e, n, "floor") + n + 1;
658
674
  }
659
675
  return T(e) + s + 1;
660
- }, at = (e) => {
661
- let [t, n] = Y(() => rt(e)), r = J(null), i = G(() => {
676
+ }, lt = (e) => {
677
+ let [t, n] = J(() => st(e)), r = q(null), i = U(() => {
662
678
  r.current &&= (clearTimeout(r.current), null);
663
- }, []), a = G(() => {
679
+ }, []), a = U(() => {
664
680
  i();
665
- let t = Date.now(), o = it(t, e);
681
+ let t = Date.now(), o = ct(t, e);
666
682
  r.current = setTimeout(() => {
667
- n(rt(e)), a();
683
+ n(st(e)), a();
668
684
  }, Math.max(1, o - t));
669
685
  }, [i, e]);
670
- K(() => (n(rt(e)), a(), i), [
686
+ W(() => (n(st(e)), a(), i), [
671
687
  e,
672
688
  a,
673
689
  i
674
690
  ]);
675
- let o = le();
676
- return K(() => {
677
- o === "visible" && (n(rt(e)), a());
691
+ let o = ue();
692
+ return W(() => {
693
+ o === "visible" && (n(st(e)), a());
678
694
  }, [
679
695
  o,
680
696
  a,
@@ -683,41 +699,43 @@ var Ie = {
683
699
  };
684
700
  //#endregion
685
701
  //#region src/components/Gantt/GanttChart/hooks/useTimelineViewportController.ts
686
- function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef: r, contentSize: i, headerTrackRef: a, formatMessage: o, isHorizontalScrollbarInteracting: s, isTaskBarInteracting: c = !1 }) {
687
- let l = k(n, t), u = q(() => re(n, e), [n, e]), d = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, f = J(!1), [p, m] = Y(!1), [h, g] = Y(d), _ = J(null), v = J(!1), y = J(!1), b = J(null), x = J(null), S = J(null), [C, w] = Y(0), T = G((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) => {
688
704
  let t = S.current;
689
705
  if (!t || !e) return !1;
690
706
  let n = e.scrollLeft || 0;
691
707
  return Math.abs(n - t.targetLeft) > 1;
692
- }, []), ee = G((e) => {
708
+ }, []), E = U((e) => {
693
709
  let t = S.current;
694
710
  t && Math.abs(e - t.targetLeft) <= 1 && (S.current = null);
695
- }, []), E = G(() => {
711
+ }, []), D = U(() => {
696
712
  x.current !== null && (cancelAnimationFrame(x.current), x.current = null), b.current = null;
697
- }, []), D = G((e) => {
698
- E();
713
+ }, []), O = U((e) => {
714
+ D();
699
715
  let t = { left: e };
700
716
  b.current = t, x.current = requestAnimationFrame(() => {
701
717
  x.current = null, b.current === t && (b.current = null);
702
718
  });
703
- }, [E]), [O, A] = Y(0), j = J(0), M = J(0), N = J(null), ne = G((e) => {
704
- 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(() => {
705
721
  N.current = null;
706
- let e = M.current;
707
- A((t) => t === e ? t : e);
722
+ let e = te.current;
723
+ j((t) => t === e ? t : e);
708
724
  }));
725
+ }, []), P = U(() => {
726
+ T.current !== null && (cancelAnimationFrame(T.current), T.current = null);
709
727
  }, []);
710
- K(() => () => {
711
- N.current !== null && cancelAnimationFrame(N.current), E();
712
- }, [E]);
713
- let [ie, ae] = Y(null), P = J(n), oe = P.current === n, F = oe ? ie : null, I = G(() => {
728
+ W(() => () => {
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(() => {
714
732
  let e = _.current;
715
- return e !== null && Number.isFinite(e) ? e : rt(n);
716
- }, [n]), L = G((e) => {
733
+ return e !== null && Number.isFinite(e) ? e : st(n);
734
+ }, [n]), L = U((e) => {
717
735
  Number.isFinite(e) && (_.current = e);
718
- }, []), R = G((e) => {
736
+ }, []), R = U((e) => {
719
737
  S.current = null;
720
- let t = tt({
738
+ let t = at({
721
739
  focusMs: e,
722
740
  fallbackFocusMs: I(),
723
741
  viewMode: n,
@@ -725,7 +743,7 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
725
743
  viewportWidth: h || 1e3,
726
744
  pixelsPerDay: l
727
745
  });
728
- return ae(t), v.current = !0, t;
746
+ return oe(t), v.current = !0, t;
729
747
  }, [
730
748
  u,
731
749
  l,
@@ -733,9 +751,9 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
733
751
  n,
734
752
  h
735
753
  ]);
736
- K(() => {
737
- P.current = n, R(I());
738
- }, [e?.bufferDaysBefore, e?.bufferDaysAfter]), ce(() => {
754
+ W(() => {
755
+ F.current = n, R(I());
756
+ }, [e?.bufferDaysBefore, e?.bufferDaysAfter]), le(() => {
739
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;
740
758
  n > 0 && n !== h && g(n);
741
759
  }, [
@@ -743,23 +761,23 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
743
761
  i?.width,
744
762
  h
745
763
  ]);
746
- let z = q(() => F || tt({
764
+ let z = K(() => ce || at({
747
765
  focusMs: I(),
748
766
  viewMode: n,
749
767
  timeRangeConfig: u,
750
768
  viewportWidth: h || 1e3,
751
769
  pixelsPerDay: l
752
770
  }), [
753
- F,
771
+ ce,
754
772
  u,
755
773
  l,
756
774
  I,
757
775
  n,
758
776
  h
759
- ]), { timelineStartMs: B, timelineEndMs: V } = q(() => ({
777
+ ]), { timelineStartMs: B, timelineEndMs: V } = K(() => ({
760
778
  timelineStartMs: z.startMs,
761
779
  timelineEndMs: z.endMs
762
- }), [z]), H = q(() => He({
780
+ }), [z]), H = K(() => Ke({
763
781
  viewMode: n,
764
782
  timelineStartMs: B,
765
783
  timelineEndMs: V,
@@ -771,7 +789,7 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
771
789
  V,
772
790
  l,
773
791
  o
774
- ]), U = q(() => te({
792
+ ]), G = K(() => ne({
775
793
  viewMode: n,
776
794
  timelineStartMs: B,
777
795
  timelineEndMs: V,
@@ -783,81 +801,98 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
783
801
  V,
784
802
  l,
785
803
  H
786
- ]), W = q(() => {
804
+ ]), Y = K(() => {
787
805
  if (H.length === 0) return 0;
788
806
  let e = H[H.length - 1];
789
807
  return e.left + e.width;
790
- }, [H]), se = G(() => v.current ? !1 : (R(I()), !0), [I, R]);
791
- ce(() => {
792
- P.current !== n && (P.current = n, R(I()));
808
+ }, [H]), ue = U(() => v.current ? !1 : (R(I()), !0), [I, R]);
809
+ le(() => {
810
+ F.current !== n && (F.current = n, R(I()));
793
811
  }, [
794
812
  n,
795
813
  I,
796
814
  R
797
815
  ]);
798
- let X = at(n), le = q(() => W <= 0 ? null : U.toX(X), [
799
- X,
800
- U,
801
- W
802
- ]), ue = G((e) => {
816
+ let de = lt(n), fe = K(() => Y <= 0 ? null : G.toX(de), [
817
+ de,
818
+ G,
819
+ Y
820
+ ]), X = U((e) => {
803
821
  let t = a?.current;
804
822
  t && t.style.setProperty("--gantt-scroll-left", `${e}px`);
805
- }, [a]), de = G((e, t) => {
806
- D(t), e.scrollLeft = t, ue(t), A(t), j.current = t;
807
- }, [ue, D]), Z = G(() => {
823
+ }, [a]), pe = U((e, t) => {
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(() => {
808
832
  let e = r.current, t = h;
809
- if (!e || t <= 0 || W <= 0) return !1;
810
- let { scrollLeft: n } = nt({
833
+ if (!e || t <= 0 || Y <= 0) return !1;
834
+ let { scrollLeft: n } = ot({
811
835
  focusMs: _.current ?? NaN,
812
836
  fallbackFocusMs: I(),
813
- timelineCoords: U,
837
+ timelineCoords: G,
814
838
  viewportWidth: t,
815
- timelineWidth: W
839
+ timelineWidth: Y
816
840
  });
817
- return de(e, n), !0;
841
+ return pe(e, n);
818
842
  }, [
819
- de,
843
+ pe,
820
844
  r,
821
845
  I,
822
- U,
823
- W,
846
+ G,
847
+ Y,
824
848
  h
825
- ]), Q = G((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) => {
826
858
  let t = e.currentTarget.scrollLeft, n = h, r = b.current, i = r !== null && Math.abs(t - r.left) <= 1;
827
- r && E(), !i && f.current && (y.current = !0), ue(t);
828
- let a = t !== j.current;
829
- if (j.current = t, a && ne(t), n > 0 && !i) {
830
- let e = je(t, n, W);
831
- L($e({
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({
832
866
  renderWindow: {
833
867
  startMs: B,
834
868
  endMs: V
835
869
  },
836
- timelineCoords: U,
870
+ timelineCoords: G,
837
871
  scrollLeft: e,
838
872
  viewportWidth: n
839
873
  }).focusMs);
840
874
  }
841
- ee(t);
875
+ E(t);
842
876
  }, [
843
- ue,
844
- E,
845
- U,
877
+ X,
878
+ D,
879
+ ge,
880
+ G,
846
881
  h,
847
- ne,
882
+ ie,
848
883
  L,
849
- ee,
884
+ E,
850
885
  V,
851
886
  B,
852
- W
853
- ]), fe = G(() => {
854
- let e = rt(n);
887
+ Y
888
+ ]), ye = U(() => {
889
+ let e = st(n);
855
890
  L(e), R(e);
856
891
  }, [
857
892
  R,
858
893
  L,
859
894
  n
860
- ]), pe = G((e) => {
895
+ ]), be = U((e) => {
861
896
  let t = r.current, n = e?.targetMs;
862
897
  if (!t || !Number.isFinite(n)) return;
863
898
  let i = t.clientWidth > 0 ? t.clientWidth : h;
@@ -865,119 +900,121 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
865
900
  S.current = null, L(n), R(n);
866
901
  return;
867
902
  }
868
- let a = Me({
903
+ let a = Ie({
869
904
  anchorMs: n,
870
- toX: U.toX,
905
+ toX: G.toX,
871
906
  viewportWidth: i,
872
- timelineWidth: W
907
+ timelineWidth: Y
873
908
  }), o = t.scrollLeft || 0;
874
909
  if (!(i > 0 && Math.abs(a - o) <= i * 1.5)) {
875
910
  L(n), R(n);
876
911
  return;
877
912
  }
878
913
  let s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
879
- 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({
880
915
  left: a,
881
916
  behavior: s
882
- }), L(n), s === "auto" && (ue(a), A(a), j.current = a);
917
+ }), L(n), s === "auto" && (X(a), j(a), M.current = a);
883
918
  }, [
884
- ue,
919
+ X,
885
920
  r,
886
- D,
921
+ O,
887
922
  R,
888
923
  L,
889
- U,
924
+ G,
890
925
  V,
891
926
  B,
892
- W,
927
+ Y,
893
928
  h
894
929
  ]);
895
- K(() => {
896
- if (!f.current || !h || !W || v.current || !y.current) return;
897
- let e = r.current, t = e?.scrollLeft ?? O, n = et({
930
+ W(() => {
931
+ if (!f.current || !h || !Y || v.current || !y.current) return;
932
+ let e = r.current, t = e?.scrollLeft ?? A, n = it({
898
933
  scrollLeft: Math.max(0, t),
899
934
  viewportWidth: h,
900
- timelineWidth: W,
935
+ timelineWidth: Y,
901
936
  guardBandPx: 280
902
937
  });
903
- s || c || T(e) || (e && ee(e.scrollLeft || 0), n && se());
938
+ s || c || ee(e) || (e && E(e.scrollLeft || 0), n && ue());
904
939
  }, [
905
- O,
906
- W,
940
+ A,
941
+ Y,
907
942
  h,
908
943
  r,
909
- T,
910
944
  ee,
911
- se,
945
+ E,
946
+ ue,
912
947
  s,
913
948
  c,
914
949
  C
915
- ]), ce(() => {
950
+ ]), le(() => {
916
951
  !f.current || h <= 0 || R(I());
917
952
  }, [
918
953
  I,
919
954
  R,
920
955
  h
921
- ]), ce(() => {
922
- v.current && (h <= 0 || W <= 0 || Z() && (v.current = !1, f.current || (f.current = !0, m(!0))));
956
+ ]), le(() => {
957
+ v.current && (h <= 0 || Y <= 0 || ge() || _e());
923
958
  }, [
924
- Z,
925
- W,
959
+ ge,
960
+ _e,
961
+ Y,
926
962
  h,
927
- ie
928
- ]), ce(() => {
929
- if (!f.current && h > 0 && W > 0) {
930
- if (Number.isFinite(_.current ?? NaN) || L(rt(n)), !ie) {
963
+ ae
964
+ ]), le(() => {
965
+ if (!f.current && h > 0 && Y > 0) {
966
+ if (Number.isFinite(_.current ?? NaN) || L(st(n)), !ae) {
931
967
  R(I());
932
968
  return;
933
969
  }
934
- v.current = !0, Z(), v.current = !1, f.current = !0, m(!0);
970
+ v.current = !0, ge() || _e();
935
971
  }
936
972
  }, [
937
- Z,
938
973
  I,
939
974
  R,
975
+ ge,
976
+ _e,
940
977
  L,
941
- ie,
942
- W,
978
+ ae,
979
+ Y,
943
980
  h,
944
981
  n
945
982
  ]);
946
- let me = G((e) => {
983
+ let xe = U((e) => {
947
984
  let t = h;
948
- t <= 0 || L(U.timeAtX(e + t / 2));
985
+ t <= 0 || L(G.timeAtX(e + t / 2));
949
986
  }, [
950
987
  h,
951
- U,
988
+ G,
952
989
  L
953
- ]), he = G(() => {
990
+ ]), Se = U(() => {
954
991
  let e = r.current;
955
992
  if (!e) return;
956
993
  let t = h, n = e.scrollLeft || 0, i = Math.max(0, n - t);
957
994
  if (Math.abs(i - n) <= 1) {
958
995
  S.current = null;
959
- let e = U.timeAtX(n - t / 2);
996
+ let e = G.timeAtX(n - t / 2);
960
997
  L(e), R(e);
961
998
  return;
962
999
  }
963
1000
  S.current = { targetLeft: i }, e.scrollTo({
964
1001
  left: i,
965
1002
  behavior: "smooth"
966
- }), me(i);
1003
+ }), xe(i);
967
1004
  }, [
968
1005
  r,
969
1006
  R,
970
1007
  L,
971
- U,
972
- me,
1008
+ G,
1009
+ xe,
973
1010
  h
974
- ]), ge = G(() => {
1011
+ ]), Ce = U(() => {
975
1012
  let e = r.current;
976
1013
  if (!e) return;
977
- let t = h, n = e.scrollLeft || 0, i = Math.max(0, W - t), a = je(n + t, t, W);
1014
+ let t = h, n = e.scrollLeft || 0, i = Math.max(0, Y - t), a = Fe(n + t, t, Y);
978
1015
  if (Math.abs(a - n) <= 1) {
979
1016
  if (S.current = null, a >= i - 1) {
980
- let e = U.timeAtX(n + t * 1.5);
1017
+ let e = G.timeAtX(n + t * 1.5);
981
1018
  L(e), R(e);
982
1019
  }
983
1020
  return;
@@ -985,17 +1022,17 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
985
1022
  S.current = { targetLeft: a }, e.scrollTo({
986
1023
  left: a,
987
1024
  behavior: "smooth"
988
- }), me(a);
1025
+ }), xe(a);
989
1026
  }, [
990
1027
  r,
991
1028
  R,
992
1029
  L,
993
- U,
1030
+ G,
994
1031
  h,
995
- W,
996
- me
1032
+ Y,
1033
+ xe
997
1034
  ]);
998
- K(() => {
1035
+ W(() => {
999
1036
  let e = r.current;
1000
1037
  if (!e) return;
1001
1038
  let t = () => {
@@ -1003,23 +1040,23 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
1003
1040
  };
1004
1041
  return e.addEventListener("scrollend", t), () => e.removeEventListener("scrollend", t);
1005
1042
  }, [r]);
1006
- let _e = (!oe || v.current) && W > 0 && h > 0 ? nt({
1043
+ let we = (!se || v.current) && Y > 0 && h > 0 ? ot({
1007
1044
  focusMs: _.current ?? NaN,
1008
1045
  fallbackFocusMs: I(),
1009
- timelineCoords: U,
1046
+ timelineCoords: G,
1010
1047
  viewportWidth: h,
1011
- timelineWidth: W
1012
- }).scrollLeft : O, { visibleStartMs: ve, visibleEndMs: ye } = q(() => {
1013
- if (W <= 0 || h <= 0) return {
1048
+ timelineWidth: Y
1049
+ }).scrollLeft : A, { visibleStartMs: Te, visibleEndMs: Ee } = K(() => {
1050
+ if (Y <= 0 || h <= 0) return {
1014
1051
  visibleStartMs: B,
1015
1052
  visibleEndMs: B
1016
1053
  };
1017
- let e = je(_e, h, W), { visibleRange: t } = $e({
1054
+ let e = Fe(we, h, Y), { visibleRange: t } = rt({
1018
1055
  renderWindow: {
1019
1056
  startMs: B,
1020
1057
  endMs: V
1021
1058
  },
1022
- timelineCoords: U,
1059
+ timelineCoords: G,
1023
1060
  scrollLeft: e,
1024
1061
  viewportWidth: h
1025
1062
  });
@@ -1028,41 +1065,41 @@ function ot({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef
1028
1065
  visibleEndMs: t.endMs
1029
1066
  };
1030
1067
  }, [
1031
- _e,
1032
- U,
1068
+ we,
1069
+ G,
1033
1070
  V,
1034
1071
  B,
1035
- W,
1072
+ Y,
1036
1073
  h
1037
1074
  ]);
1038
1075
  return {
1039
1076
  pixelsPerDay: l,
1040
1077
  viewportWidth: h,
1041
- scrollLeft: _e,
1078
+ scrollLeft: we,
1042
1079
  timelineStartMs: B,
1043
1080
  timelineEndMs: V,
1044
- visibleStartMs: ve,
1045
- visibleEndMs: ye,
1081
+ visibleStartMs: Te,
1082
+ visibleEndMs: Ee,
1046
1083
  lowerSegments: H,
1047
- timelineCoords: U,
1048
- timelineWidth: W,
1049
- todayCenterMs: X,
1050
- todayLineLeft: le,
1084
+ timelineCoords: G,
1085
+ timelineWidth: Y,
1086
+ todayCenterMs: de,
1087
+ todayLineLeft: fe,
1051
1088
  isInitialLayoutReady: p,
1052
- handleContentScroll: Q,
1053
- handleTodayClick: fe,
1054
- handleOffscreenJump: pe,
1055
- handleScrollPrev: he,
1056
- handleScrollNext: ge
1089
+ handleContentScroll: ve,
1090
+ handleTodayClick: ye,
1091
+ handleOffscreenJump: be,
1092
+ handleScrollPrev: Se,
1093
+ handleScrollNext: Ce
1057
1094
  };
1058
1095
  }
1059
1096
  //#endregion
1060
1097
  //#region src/components/Gantt/GanttChart/hooks/useNormalizedItems.ts
1061
- function st({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
1062
- return { normalizedItems: q(() => {
1098
+ function dt({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
1099
+ return { normalizedItems: K(() => {
1063
1100
  let r = Array.isArray(e) ? e : [], i = [], a = b(n) ? n : "day";
1064
1101
  for (let e = 0; e < r.length; e++) {
1065
- 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({
1066
1103
  rawStartMs: s,
1067
1104
  rawEndMs: c,
1068
1105
  baseStartMs: l,
@@ -1098,12 +1135,12 @@ function st({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }
1098
1135
  }
1099
1136
  //#endregion
1100
1137
  //#region src/components/Gantt/GanttChart/hooks/useGanttScrollbars.tsx
1101
- function ct(e, t) {
1102
- let [n, r] = Y(!1);
1103
- return ce(() => {
1138
+ function ft(e, t) {
1139
+ let [n, r] = J(!1);
1140
+ return le(() => {
1104
1141
  let n = e.current, i = t.current;
1105
1142
  if (!n || !i) return;
1106
- let a = he({
1143
+ let a = ye({
1107
1144
  target: n,
1108
1145
  elements: { viewport: i }
1109
1146
  }, { scrollbars: {
@@ -1115,7 +1152,7 @@ function ct(e, t) {
1115
1152
  e.pointerType === "mouse" && e.button !== 0 || (s = !0, c = e.pointerId, r(!0));
1116
1153
  }, u = (e) => {
1117
1154
  if (!s) return;
1118
- let t = e.pointerId, n = "pointerId" in e && L(t) ? t : null;
1155
+ let t = e.pointerId, n = "pointerId" in e && ce(t) ? t : null;
1119
1156
  n !== null && c !== null && n !== c || (s = !1, c = null, r(!1));
1120
1157
  }, d = { capture: !0 };
1121
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), () => {
@@ -1125,11 +1162,92 @@ function ct(e, t) {
1125
1162
  }
1126
1163
  //#endregion
1127
1164
  //#region src/components/Gantt/GanttChart/utils/timelineMarkers.ts
1128
- function lt(e, t, n, r, i) {
1129
- return !!e && Number.isFinite(r) && Ke(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;
1130
1167
  }
1131
- var ut = H.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 }) => {
1132
- let g = q(() => Ue({
1168
+ var Z = {
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({
1133
1251
  lowerSegments: a,
1134
1252
  viewMode: l,
1135
1253
  formatMessage: d
@@ -1137,29 +1255,29 @@ var ut = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
1137
1255
  a,
1138
1256
  l,
1139
1257
  d
1140
- ]), _ = q(() => {
1141
- let r = je(n, t, e), i = r - 240, a = r + t + 240;
1142
- 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);
1143
1261
  }, [
1144
1262
  g,
1145
- n,
1146
- t,
1147
- e
1148
- ]), v = q(() => 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 = lt(c, o, e, s ?? NaN, {
1149
- startMs: y,
1150
- 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
1151
1268
  });
1152
- return /* @__PURE__ */ V("div", {
1153
- className: "bsy-gantt-chart__calendar",
1154
- children: [/* @__PURE__ */ V("div", {
1269
+ return /* @__PURE__ */ z("div", {
1270
+ className: Z.calendar,
1271
+ children: [/* @__PURE__ */ z("div", {
1155
1272
  ref: r,
1156
- className: "bsy-gantt-chart__calendar-track",
1273
+ className: Z.calendarTrack,
1274
+ "data-testid": "gantt-calendar-track",
1157
1275
  style: { width: e },
1158
1276
  children: [
1159
1277
  i.map((e) => {
1160
1278
  let t = a[e.index];
1161
- return t ? /* @__PURE__ */ B("div", {
1162
- className: "bsy-gantt-chart__header-col-line",
1279
+ return t ? /* @__PURE__ */ R("div", {
1280
+ className: Z.headerColLine,
1163
1281
  style: {
1164
1282
  left: t.left,
1165
1283
  top: 34,
@@ -1167,30 +1285,38 @@ var ut = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
1167
1285
  }
1168
1286
  }, `header-line-${t.id}`) : null;
1169
1287
  }),
1170
- _.map((e) => /* @__PURE__ */ V(H.Fragment, { children: [/* @__PURE__ */ B("div", {
1171
- className: "bsy-gantt-chart__header-cell bsy-gantt-chart__header-cell--top",
1172
- style: {
1173
- left: e.left,
1174
- width: e.width,
1175
- height: 34,
1176
- "--segment-left": `${e.left}px`
1177
- },
1178
- children: /* @__PURE__ */ B("span", {
1179
- className: "bsy-gantt-chart__header-cell-sticky-text",
1180
- children: e.label
1181
- })
1182
- }), /* @__PURE__ */ B("div", {
1183
- className: "bsy-gantt-chart__header-col-line",
1184
- style: {
1185
- left: e.left + e.width,
1186
- top: 0,
1187
- height: 34
1188
- }
1189
- })] }, `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
+ }),
1190
1313
  i.map((e) => {
1191
1314
  let t = a[e.index];
1192
- return t ? /* @__PURE__ */ B("div", {
1193
- className: X("bsy-gantt-chart__header-cell", "bsy-gantt-chart__header-cell--bottom", t.id === v && "bsy-gantt-chart__header-cell--bottom-active"),
1315
+ if (!t) return null;
1316
+ let n = t.id === y;
1317
+ return /* @__PURE__ */ R("div", {
1318
+ className: Y(Z.headerCell, Z.headerCellBottom, n && Z.isActive),
1319
+ "data-testid": "gantt-header-cell-bottom",
1194
1320
  style: {
1195
1321
  left: t.left,
1196
1322
  width: t.width,
@@ -1198,16 +1324,17 @@ var ut = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
1198
1324
  top: 34
1199
1325
  },
1200
1326
  children: t.label
1201
- }, t.id) : null;
1327
+ }, t.id);
1202
1328
  }),
1203
- x && /* @__PURE__ */ B("span", {
1204
- className: "bsy-gantt-chart__today-indicator--header-dot",
1329
+ S && /* @__PURE__ */ R("span", {
1330
+ className: Z.todayIndicatorHeaderDot,
1205
1331
  style: { left: o ?? void 0 }
1206
1332
  })
1207
1333
  ]
1208
- }), /* @__PURE__ */ B("div", {
1209
- className: "bsy-gantt-chart__calendar-toolbar",
1210
- children: /* @__PURE__ */ B(F, {
1334
+ }), /* @__PURE__ */ R("div", {
1335
+ className: Z.calendarToolbar,
1336
+ "data-testid": "gantt-calendar-toolbar",
1337
+ children: /* @__PURE__ */ R(F, {
1211
1338
  viewMode: l,
1212
1339
  availableModes: u,
1213
1340
  onViewModeChange: f,
@@ -1220,8 +1347,8 @@ var ut = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackR
1220
1347
  });
1221
1348
  //#endregion
1222
1349
  //#region src/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.ts
1223
- function dt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
1224
- let [a, o] = Y(!1), s = pe({
1350
+ function vt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
1351
+ let [a, o] = J(!1), s = _e({
1225
1352
  count: e.length,
1226
1353
  getScrollElement: () => t.current,
1227
1354
  estimateSize: () => n,
@@ -1239,8 +1366,8 @@ function dt({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, over
1239
1366
  }
1240
1367
  //#endregion
1241
1368
  //#region src/components/Gantt/GanttChart/hooks/useOffscreenIndicators.ts
1242
- function ft({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
1243
- return q(() => {
1369
+ function yt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
1370
+ return K(() => {
1244
1371
  if (!i || !Array.isArray(e) || !Array.isArray(t) || !Number.isFinite(n) || !Number.isFinite(r) || n >= r) return [];
1245
1372
  let o = [];
1246
1373
  return e.forEach((e) => {
@@ -1268,8 +1395,8 @@ function ft({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndM
1268
1395
  }
1269
1396
  //#endregion
1270
1397
  //#region src/components/Gantt/GanttChart/hooks/useRowHoverHighlight.ts
1271
- function pt({ normalizedItems: e, safeRowHeight: t }) {
1272
- let n = Z(d, (e) => e.setHighlightTarget), r = Z(d, (e) => e.subscribeHighlight), i = Z(d, (e) => e.getIsScrollActive), a = J(null), o = J(null), s = J(null), c = J(!1), l = q(() => {
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(() => {
1273
1400
  let t = /* @__PURE__ */ new Map(), n = 0;
1274
1401
  for (; n < e.length;) {
1275
1402
  let r = e[n]?.parentId;
@@ -1284,15 +1411,15 @@ function pt({ normalizedItems: e, safeRowHeight: t }) {
1284
1411
  } else t.set(n, null), n += 1;
1285
1412
  }
1286
1413
  return t;
1287
- }, [e]), u = J(l);
1414
+ }, [e]), u = q(l);
1288
1415
  u.current = l;
1289
- let m = G((e, n) => {
1416
+ let m = U((e, n) => {
1290
1417
  let r = o.current;
1291
1418
  r && (r.style.top = `${e * t}px`, r.style.height = `${(n - e + 1) * t}px`, r.style.display = "block");
1292
- }, [t]), h = G(() => {
1419
+ }, [t]), h = U(() => {
1293
1420
  let e = o.current;
1294
1421
  e && (e.style.display = "none");
1295
- }, []), g = G((t) => {
1422
+ }, []), g = U((t) => {
1296
1423
  if (!t) {
1297
1424
  h();
1298
1425
  return;
@@ -1311,7 +1438,7 @@ function pt({ normalizedItems: e, safeRowHeight: t }) {
1311
1438
  e,
1312
1439
  m,
1313
1440
  h
1314
- ]), _ = G((r) => {
1441
+ ]), _ = U((r) => {
1315
1442
  if (i?.()) {
1316
1443
  a.current !== null && (a.current = null, h()), c.current = !1;
1317
1444
  return;
@@ -1336,10 +1463,10 @@ function pt({ normalizedItems: e, safeRowHeight: t }) {
1336
1463
  m,
1337
1464
  h,
1338
1465
  i
1339
- ]), v = G(() => {
1466
+ ]), v = U(() => {
1340
1467
  c.current = !1, a.current = null, h(), s.current !== null && (s.current = null, n?.(null));
1341
1468
  }, [n, h]);
1342
- return K(() => {
1469
+ return W(() => {
1343
1470
  if (r) return r((e, t) => {
1344
1471
  if (t?.source === "table") {
1345
1472
  c.current = !1, a.current = null, s.current = e, g(e);
@@ -1355,14 +1482,14 @@ function pt({ normalizedItems: e, safeRowHeight: t }) {
1355
1482
  }
1356
1483
  //#endregion
1357
1484
  //#region src/components/Gantt/GanttChart/GanttInteractionContext.ts
1358
- var mt = de({
1485
+ var xt = pe({
1359
1486
  tooltip: null,
1360
1487
  isScrolling: !1,
1361
1488
  collapsedKeys: void 0,
1362
1489
  onBarClick: () => {},
1363
1490
  onTaskMouseDown: () => {},
1364
1491
  onResizeMouseDown: () => {}
1365
- }), ht = (e) => Z(mt, e), gt = de({
1492
+ }), St = (e) => me(xt, e), Ct = pe({
1366
1493
  viewMode: "day",
1367
1494
  pixelsPerDay: 1,
1368
1495
  timelineStartMs: 0,
@@ -1378,15 +1505,15 @@ var mt = de({
1378
1505
  viewportWidth: 0,
1379
1506
  timelineWidth: 0,
1380
1507
  isInitialLayoutReady: !1
1381
- }), $ = (e) => Z(gt, e), _t = (e, t) => {
1508
+ }), Q = (e) => me(Ct, e), wt = (e, t) => {
1382
1509
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
1383
1510
  return `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
1384
- }, vt = (e, t) => {
1385
- if (!R(e)) return null;
1511
+ }, Tt = (e, t) => {
1512
+ if (!I(e)) return null;
1386
1513
  let n = e.trim();
1387
- return i.test(n) ? _t(n, t) : null;
1388
- }, yt = (e, t = 2.5) => {
1389
- if (!e || !R(e)) return "#121211";
1514
+ return i.test(n) ? wt(n, t) : null;
1515
+ }, Et = (e, t = 2.5) => {
1516
+ if (!e || !I(e)) return "#121211";
1390
1517
  let n, r, i;
1391
1518
  if (e.startsWith("#")) {
1392
1519
  let t = e.replace("#", ""), a = t.length === 3 ? [...t].map((e) => e + e) : [
@@ -1404,23 +1531,23 @@ var mt = de({
1404
1531
  return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1405
1532
  };
1406
1533
  return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
1407
- }, bt, xt = () => {
1408
- if (bt !== void 0) return bt;
1534
+ }, Dt, Ot = () => {
1535
+ if (Dt !== void 0) return Dt;
1409
1536
  try {
1410
- bt = document.createElement("canvas").getContext("2d");
1537
+ Dt = document.createElement("canvas").getContext("2d");
1411
1538
  } catch {
1412
- bt = null;
1539
+ Dt = null;
1413
1540
  }
1414
- return bt;
1415
- }, St = (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") => {
1416
1543
  if (!e) return 0;
1417
- let n = String(e), r = xt();
1544
+ let n = String(e), r = Ot();
1418
1545
  return r ? (r.font = t, r.measureText(n).width + 20) : n.length * 12 + 20;
1419
1546
  };
1420
1547
  //#endregion
1421
1548
  //#region src/components/Gantt/GanttChart/hooks/useBarTooltipHover.ts
1422
- function Ct() {
1423
- let [e, t] = Y(null), n = J("idle"), r = G((e) => {
1549
+ function At() {
1550
+ let [e, t] = J(null), n = q("idle"), r = U((e) => {
1424
1551
  n.current === "frozen" && (n.current = "open");
1425
1552
  let r = e.currentTarget.getBoundingClientRect();
1426
1553
  t({
@@ -1430,13 +1557,13 @@ function Ct() {
1430
1557
  bottom: r.bottom,
1431
1558
  height: r.height
1432
1559
  });
1433
- }, []), i = G(() => {
1560
+ }, []), i = U(() => {
1434
1561
  n.current === "open" ? n.current = "frozen" : t(null);
1435
- }, []), a = G((e) => {
1562
+ }, []), a = U((e) => {
1436
1563
  n.current = e ? "open" : "idle", e || t(null);
1437
1564
  }, []);
1438
1565
  return {
1439
- virtualReference: q(() => {
1566
+ virtualReference: K(() => {
1440
1567
  if (e) return { getBoundingClientRect: () => ({
1441
1568
  width: 0,
1442
1569
  height: e.height,
@@ -1456,18 +1583,18 @@ function Ct() {
1456
1583
  }
1457
1584
  //#endregion
1458
1585
  //#region src/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.tsx
1459
- var wt = {
1586
+ var jt = {
1460
1587
  borderRadius: "10px",
1461
1588
  padding: 0,
1462
1589
  backgroundColor: "#fff",
1463
1590
  boxShadow: "0 0 12px 0 rgba(0, 0, 0, 0.08)"
1464
- }, Tt = ({ item: e, tooltip: t, disabled: r = !1, children: i }) => {
1465
- let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } = Ct(), l = q(() => 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), [
1466
1593
  r,
1467
1594
  t,
1468
1595
  e
1469
1596
  ]);
1470
- return l ? /* @__PURE__ */ B(n, {
1597
+ return l ? /* @__PURE__ */ R(n, {
1471
1598
  content: l,
1472
1599
  placement: "bottom",
1473
1600
  showArrow: !1,
@@ -1479,33 +1606,33 @@ var wt = {
1479
1606
  zIndex: 8001,
1480
1607
  virtualReference: a,
1481
1608
  onVisibleChange: c,
1482
- style: wt,
1609
+ style: jt,
1483
1610
  children: i({
1484
1611
  onMouseMove: o,
1485
1612
  onMouseLeave: s
1486
1613
  })
1487
- }) : /* @__PURE__ */ B(z, { children: i({
1614
+ }) : /* @__PURE__ */ R(L, { children: i({
1488
1615
  onMouseMove: () => {},
1489
1616
  onMouseLeave: () => {}
1490
1617
  }) });
1491
- }, Et = (e, t, n) => ({
1618
+ }, Nt = (e, t, n) => ({
1492
1619
  ...e,
1493
1620
  clientX: t,
1494
1621
  clientY: n,
1495
1622
  preventDefault: () => e.preventDefault(),
1496
1623
  stopPropagation: () => e.stopPropagation()
1497
1624
  });
1498
- function Dt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1499
- let r = J(null), i = J(null), a = J(t), o = J(n);
1500
- K(() => {
1625
+ function Pt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1626
+ let r = q(null), i = q(null), a = q(t), o = q(n);
1627
+ W(() => {
1501
1628
  a.current = t, o.current = n;
1502
1629
  }, [t, n]);
1503
- let s = G(() => {
1630
+ let s = U(() => {
1504
1631
  r.current = null;
1505
1632
  let e = i.current;
1506
1633
  e && (document.removeEventListener("mousemove", e.move), document.removeEventListener("mouseup", e.up), i.current = null);
1507
1634
  }, []);
1508
- return K(() => () => s(), [s]), { handlePointerMouseDown: G((t, n, c, l = 1) => {
1635
+ return W(() => () => s(), [s]), { handlePointerMouseDown: U((t, n, c, l = 1) => {
1509
1636
  if (!e) return;
1510
1637
  s();
1511
1638
  let u = {
@@ -1520,7 +1647,7 @@ function Dt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1520
1647
  let d = (e) => {
1521
1648
  if (r.current !== u || u.dragStarted) return;
1522
1649
  let t = e.clientX - u.startClientX, i = e.clientY - u.startClientY;
1523
- Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(Et(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));
1524
1651
  }, f = (e) => {
1525
1652
  r.current === u && (s(), u.dragStarted || o.current?.(e, n));
1526
1653
  };
@@ -1530,18 +1657,18 @@ function Dt({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1530
1657
  }, document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
1531
1658
  }, [e, s]) };
1532
1659
  }
1533
- var Ot = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermission: a }) => {
1534
- let { t: o } = t(), s = $((e) => e.viewMode), c = $((e) => e.timelineCoords), l = $((e) => e.timelineStartMs), u = $((e) => e.timelineEndMs), d = $((e) => e.timelineWidth), f = ht((e) => e.tooltip), p = ht((e) => e.isScrolling), m = ht((e) => e.onBarClick), h = ht((e) => e.onTaskMouseDown), g = ht((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 = q(() => {
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(() => {
1535
1662
  let t = e.color;
1536
1663
  return {
1537
1664
  baseColor: t,
1538
- containerBgColor: vt(t, .2) || t,
1539
- hoverBorderColor: vt(t, .5) || "transparent",
1540
- insideLabelColor: yt(t)
1665
+ containerBgColor: Tt(t, .2) || t,
1666
+ hoverBorderColor: Tt(t, .5) || "transparent",
1667
+ insideLabelColor: Et(t)
1541
1668
  };
1542
- }, [e.color]), C = q(() => {
1669
+ }, [e.color]), C = K(() => {
1543
1670
  if (y == null || b == null || y >= b || l >= u) return null;
1544
- let e = Je({
1671
+ let e = Qe({
1545
1672
  startMs: y,
1546
1673
  endMs: b
1547
1674
  }, {
@@ -1549,14 +1676,14 @@ var Ot = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
1549
1676
  endMs: u
1550
1677
  });
1551
1678
  if (!e) return null;
1552
- let t = c.toX(e.startMs), n = c.toWidth(e.startMs, e.endMs), r = t + n, a = e.startMs !== y, o = e.endMs !== b, s = v && i && Number.isFinite(i.previewLeftPx), f = s && !a ? i.previewLeftPx : t, p = s && !o ? f + n : r, m = Math.max(0, f), h = Math.min(d, p);
1553
- return m >= h ? null : {
1679
+ let t = c.toX(e.startMs), n = c.toWidth(e.startMs, e.endMs), r = t + n, a = e.startMs !== y, o = e.endMs !== b, s = v && i && Number.isFinite(i.previewLeftPx), f = s ? c.toWidth(y, b) : n, p = s ? i.previewLeftPx : t, m = s ? p + f : r, h = s ? p : Math.max(0, p), g = Math.min(d, m);
1680
+ return g <= 0 || h >= d || h >= g ? null : {
1554
1681
  clippedRange: e,
1555
- rawBarLeft: f,
1556
- calculatedBarLeft: m,
1557
- calculatedBarWidth: h - m,
1558
- clippedStart: a || m !== f,
1559
- clippedEnd: o || h !== p
1682
+ rawBarLeft: p,
1683
+ calculatedBarLeft: h,
1684
+ calculatedBarWidth: g - h,
1685
+ clippedStart: s ? !1 : a || h !== p,
1686
+ clippedEnd: o || g !== m
1560
1687
  };
1561
1688
  }, [
1562
1689
  y,
@@ -1567,66 +1694,70 @@ var Ot = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
1567
1694
  c,
1568
1695
  v,
1569
1696
  i
1570
- ]), { 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 || _e, N = M.canMove, te = e.label ?? "", ne = typeof te == "string" ? te : "", re = D < 40, ie = Math.max(0, D - 10), ae = q(() => ne ? St(ne) : 0, [ne]), P = !!ne && ae > ie && !!C && C.calculatedBarLeft + C.calculatedBarWidth + 4 + ae <= d, { handlePointerMouseDown: oe } = Dt({
1571
- 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,
1572
1699
  onTaskMouseDown: h,
1573
1700
  onBarClick: m
1574
1701
  });
1575
1702
  if (!C) return null;
1576
- let { calculatedBarLeft: F, clippedStart: I, clippedEnd: L } = C, R = F + D, H = F + Math.max(40, D + 12) <= d, U = y !== null && b !== null ? s === "quarterMonth" ? x(y, b) : c.toWidth(y, b) : D, W = U < 40 ? Math.max(40, U + 12) : U, G = R + 4 <= d, K = {
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 = {
1577
1704
  left: F,
1578
1705
  top: n,
1579
1706
  width: `var(--bsy-gantt-bar-actual-width, ${D}px)`,
1580
1707
  height: 26,
1581
1708
  background: T,
1582
- cursor: N ? "move" : "default",
1709
+ cursor: te ? "move" : "default",
1583
1710
  "--bsy-gantt-bar-fill-color": w,
1584
1711
  "--bsy-gantt-bar-hover-border-color": ee,
1585
1712
  "--bsy-gantt-bar-calc-width": `${D}px`,
1586
1713
  "--bsy-gantt-bar-label-color": E
1587
1714
  };
1588
- return /* @__PURE__ */ B(Tt, {
1715
+ return /* @__PURE__ */ R(Mt, {
1589
1716
  item: e,
1590
1717
  tooltip: _,
1591
1718
  disabled: v,
1592
- children: ({ onMouseMove: t, onMouseLeave: n }) => /* @__PURE__ */ V("div", {
1593
- className: X("bsy-gantt-chart__bar", `bsy-gantt-chart__bar--${e.type || "task"}`, {
1594
- "bsy-gantt-chart__bar--readonly": !N,
1595
- "bsy-gantt-chart__bar--dragging": v,
1596
- "bsy-gantt-chart__bar--micro": re && H
1719
+ children: ({ onMouseMove: t, onMouseLeave: n }) => /* @__PURE__ */ z("div", {
1720
+ className: Y(Z.bar, {
1721
+ [Z.isReadonly]: !te,
1722
+ [Z.isDragging]: v,
1723
+ [Z.isMicro]: re && B
1597
1724
  }),
1598
- style: K,
1725
+ "data-testid": "gantt-bar",
1726
+ style: W,
1599
1727
  onMouseDown: (t) => {
1600
- N && oe(t, e, F, W);
1728
+ te && oe(t, e, F, H);
1601
1729
  },
1602
1730
  onClick: (t) => {
1603
- N || m(t, e);
1731
+ te || m(t, e);
1604
1732
  },
1605
1733
  onMouseMove: t,
1606
1734
  onMouseLeave: n,
1607
1735
  children: [
1608
- e.type === "task" ? /* @__PURE__ */ B("div", {
1609
- className: X("bsy-gantt-chart__bar-progress", { "bsy-gantt-chart__bar-progress--full": A }),
1736
+ e.type === "task" ? /* @__PURE__ */ R("div", {
1737
+ className: Y(Z.barProgress, { [Z.isFull]: A }),
1738
+ "data-testid": "gantt-bar-progress",
1610
1739
  style: { width: j }
1611
1740
  }) : null,
1612
- /* @__PURE__ */ B("span", {
1613
- className: X("bsy-gantt-chart__bar-label", { "bsy-gantt-chart__bar-label--hidden": P }),
1741
+ /* @__PURE__ */ R("span", {
1742
+ className: Y(Z.barLabel, { [Z.isHidden]: ae }),
1614
1743
  style: { color: "var(--bsy-gantt-bar-label-color)" },
1615
- children: te
1744
+ children: ne
1616
1745
  }),
1617
- P ? /* @__PURE__ */ B("span", {
1618
- className: "bsy-gantt-chart__bar-label bsy-gantt-chart__bar-label--outside",
1619
- style: { color: "#121211" },
1620
- children: te
1746
+ ae ? /* @__PURE__ */ R("span", {
1747
+ className: Y(Z.barLabel, Z.isOutside),
1748
+ "data-testid": "gantt-bar-label-outside",
1749
+ children: ne
1621
1750
  }) : null,
1622
- M.canResizeStart && !I || M.canResizeEnd && !L && G ? /* @__PURE__ */ V(z, { children: [M.canResizeStart && !I ? /* @__PURE__ */ B("button", {
1751
+ M.canResizeStart && !se || M.canResizeEnd && !ce && U ? /* @__PURE__ */ z(L, { children: [M.canResizeStart && !se ? /* @__PURE__ */ R("button", {
1623
1752
  type: "button",
1624
- className: "bsy-gantt-chart__bar-resize-handle bsy-gantt-chart__bar-resize-handle--left",
1753
+ className: Y(Z.barResizeHandle, Z.barResizeHandleLeft),
1754
+ "data-testid": "gantt-bar-resize-left",
1625
1755
  onMouseDown: (t) => g(t, e, F, "start", D),
1626
1756
  "aria-label": o("gantt.timeBegin")
1627
- }) : null, M.canResizeEnd && !L && G ? /* @__PURE__ */ B("button", {
1757
+ }) : null, M.canResizeEnd && !ce && U ? /* @__PURE__ */ R("button", {
1628
1758
  type: "button",
1629
- className: "bsy-gantt-chart__bar-resize-handle bsy-gantt-chart__bar-resize-handle--right",
1759
+ className: Y(Z.barResizeHandle, Z.barResizeHandleRight),
1760
+ "data-testid": "gantt-bar-resize-right",
1630
1761
  onMouseDown: (t) => g(t, e, F, "end", D),
1631
1762
  "aria-label": o("gantt.timeEnd")
1632
1763
  }) : null] }) : null
@@ -1637,34 +1768,44 @@ var Ot = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermis
1637
1768
  if (e.barTop !== t.barTop || e.dragTaskId !== t.dragTaskId || e.dragPermission?.canMove !== t.dragPermission?.canMove || e.dragPermission?.canResizeStart !== t.dragPermission?.canResizeStart || e.dragPermission?.canResizeEnd !== t.dragPermission?.canResizeEnd || e.item !== t.item) return !1;
1638
1769
  let n = e.dragPreview, r = t.dragPreview;
1639
1770
  return !(n !== r && (!n || !r || n.previewStartMs !== r.previewStartMs || n.previewEndMs !== r.previewEndMs || n.previewLeftPx !== r.previewLeftPx));
1640
- }), kt = (e) => String(e).padStart(2, "0");
1641
- function At(e, t) {
1771
+ }), $ = {
1772
+ root: "_root_8s9va_1",
1773
+ arrow: "_arrow_8s9va_9",
1774
+ label: "_label_8s9va_13",
1775
+ isCollapsed: "_isCollapsed_8s9va_28",
1776
+ labelText: "_labelText_8s9va_32",
1777
+ track: "_track_8s9va_39",
1778
+ progress: "_progress_8s9va_46",
1779
+ summaryTooltip: "_summaryTooltip_8s9va_56",
1780
+ summaryTooltipLine: "_summaryTooltipLine_8s9va_66"
1781
+ }, It = (e) => String(e).padStart(2, "0");
1782
+ function Lt(e, t) {
1642
1783
  if (e == null) return t("summary.empty");
1643
1784
  let n = C(e);
1644
1785
  return t("summary.datetime", {
1645
1786
  year: n.year(),
1646
- month: kt(n.month() + 1),
1647
- day: kt(n.date()),
1648
- hour: kt(n.hour()),
1649
- minute: kt(n.minute()),
1650
- second: kt(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())
1651
1792
  });
1652
1793
  }
1653
- function jt(e, t) {
1654
- let n = L(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i = At(e?.rawStartMs, t), a = At(e?.rawEndMs, t);
1655
- return /* @__PURE__ */ V("div", {
1656
- className: "bsy-gantt-summary-tooltip",
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);
1796
+ return /* @__PURE__ */ z("div", {
1797
+ className: $.summaryTooltip,
1657
1798
  children: [
1658
- /* @__PURE__ */ B("p", {
1659
- className: "bsy-gantt-summary-tooltip__line",
1799
+ /* @__PURE__ */ R("p", {
1800
+ className: $.summaryTooltipLine,
1660
1801
  children: t("summary.startTime", { datetime: i })
1661
1802
  }),
1662
- /* @__PURE__ */ B("p", {
1663
- className: "bsy-gantt-summary-tooltip__line",
1803
+ /* @__PURE__ */ R("p", {
1804
+ className: $.summaryTooltipLine,
1664
1805
  children: t("summary.endTime", { datetime: a })
1665
1806
  }),
1666
- n ? /* @__PURE__ */ B("p", {
1667
- className: "bsy-gantt-summary-tooltip__line",
1807
+ n ? /* @__PURE__ */ R("p", {
1808
+ className: $.summaryTooltipLine,
1668
1809
  children: t("summary.progress", { percent: Math.round(r * 100) })
1669
1810
  }) : null
1670
1811
  ]
@@ -1672,17 +1813,17 @@ function jt(e, t) {
1672
1813
  }
1673
1814
  //#endregion
1674
1815
  //#region src/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.tsx
1675
- var Mt = 24, Nt = {
1816
+ var zt = 24, Bt = {
1676
1817
  borderRadius: "6px",
1677
1818
  padding: 0,
1678
1819
  backgroundColor: "rgba(0, 0, 0, 0.5)",
1679
1820
  boxShadow: "none"
1680
1821
  };
1681
- function Pt(e, t) {
1822
+ function Vt(e, t) {
1682
1823
  return e == null || e === "__empty__" ? t : e;
1683
1824
  }
1684
- var Ft = ({ item: r, barTop: i }) => {
1685
- let { t: a } = t(), o = G((e, t) => a(oe(e), t), [a]), s = $((e) => e.timelineCoords), c = $((e) => e.timelineStartMs), l = $((e) => e.timelineEndMs), u = $((e) => e.timelineWidth), d = ht((e) => e.collapsedKeys), f = ht((e) => e.onBarClick), { virtualReference: p, handleMouseMove: m, handleMouseLeave: h, handleTooltipVisibleChange: g } = Ct(), _ = L(r.progress) ? Math.max(0, Math.min(1, r.progress ?? 0)) : 0, v = q(() => jt({
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({
1686
1827
  rawStartMs: r.rawStartMs,
1687
1828
  rawEndMs: r.rawEndMs,
1688
1829
  progress: r.progress
@@ -1691,9 +1832,9 @@ var Ft = ({ item: r, barTop: i }) => {
1691
1832
  r.rawEndMs,
1692
1833
  r.progress,
1693
1834
  o
1694
- ]), y = q(() => {
1835
+ ]), y = K(() => {
1695
1836
  if (r.startMs === null || r.endMs === null || r.startMs >= r.endMs || c >= l) return null;
1696
- let e = Je({
1837
+ let e = Qe({
1697
1838
  startMs: r.startMs,
1698
1839
  endMs: r.endMs
1699
1840
  }, {
@@ -1703,7 +1844,7 @@ var Ft = ({ item: r, barTop: i }) => {
1703
1844
  return e ? {
1704
1845
  barLeft: s.toX(e.startMs),
1705
1846
  barWidth: s.toWidth(e.startMs, e.endMs),
1706
- wrapperTop: i + (26 - Mt) / 2,
1847
+ wrapperTop: i + (26 - zt) / 2,
1707
1848
  clippedEnd: e.endMs !== r.endMs,
1708
1849
  clippedRange: e,
1709
1850
  itemStartMs: r.startMs,
@@ -1718,8 +1859,8 @@ var Ft = ({ item: r, barTop: i }) => {
1718
1859
  i
1719
1860
  ]);
1720
1861
  if (!y) return null;
1721
- 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 = Pt(r.label, a("gantt.emptyGroup")), M = ne(d, r.groupKey);
1722
- return /* @__PURE__ */ B(n, {
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);
1863
+ return /* @__PURE__ */ R(n, {
1723
1864
  content: v,
1724
1865
  placement: "bottom-start",
1725
1866
  showArrow: !1,
@@ -1730,9 +1871,10 @@ var Ft = ({ item: r, barTop: i }) => {
1730
1871
  zIndex: 8001,
1731
1872
  virtualReference: p,
1732
1873
  onVisibleChange: g,
1733
- style: Nt,
1734
- children: /* @__PURE__ */ V("div", {
1735
- className: "bsy-gantt-summary-bar",
1874
+ style: Bt,
1875
+ children: /* @__PURE__ */ z("div", {
1876
+ className: $.root,
1877
+ "data-testid": "gantt-summary-bar",
1736
1878
  style: {
1737
1879
  left: b,
1738
1880
  top: S,
@@ -1742,34 +1884,36 @@ var Ft = ({ item: r, barTop: i }) => {
1742
1884
  onClick: (e) => f?.(e, r),
1743
1885
  onMouseMove: m,
1744
1886
  onMouseLeave: h,
1745
- children: [/* @__PURE__ */ V("div", {
1746
- className: "bsy-gantt-summary-bar__label",
1887
+ children: [/* @__PURE__ */ z("div", {
1888
+ className: $.label,
1889
+ "data-testid": "gantt-summary-bar-label",
1747
1890
  style: {
1748
1891
  maxWidth: A,
1749
1892
  overflow: "hidden"
1750
1893
  },
1751
- children: [/* @__PURE__ */ B(e, {
1894
+ children: [/* @__PURE__ */ R(e, {
1752
1895
  name: "xiangxiazhankai1",
1753
1896
  size: 16,
1754
- className: X("bsy-gantt-summary-bar__arrow", { "bsy-gantt-summary-bar__arrow--collapsed": M })
1755
- }), /* @__PURE__ */ B("span", {
1756
- className: "bsy-gantt-summary-bar__label-text",
1897
+ className: Y($.arrow, { [$.isCollapsed]: M })
1898
+ }), /* @__PURE__ */ R("span", {
1899
+ className: $.labelText,
1757
1900
  children: j
1758
1901
  })]
1759
- }), /* @__PURE__ */ B("div", {
1760
- className: "bsy-gantt-summary-bar__track",
1761
- children: /* @__PURE__ */ B("div", {
1762
- className: "bsy-gantt-summary-bar__progress",
1902
+ }), /* @__PURE__ */ R("div", {
1903
+ className: $.track,
1904
+ children: /* @__PURE__ */ R("div", {
1905
+ className: $.progress,
1906
+ "data-testid": "gantt-summary-bar-progress",
1763
1907
  style: { width: k }
1764
1908
  })
1765
1909
  })]
1766
1910
  })
1767
1911
  });
1768
1912
  };
1769
- function It(e, t) {
1913
+ function Ut(e, t) {
1770
1914
  return e.barTop === t.barTop && e.item === t.item;
1771
1915
  }
1772
- var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1916
+ var Wt = B.memo(Ht, Ut), Gt = B.memo(({ indicators: n = [], onJump: r }) => {
1773
1917
  let { t: i } = t();
1774
1918
  if (!Array.isArray(n) || n.length === 0) return null;
1775
1919
  let a = (e, t) => {
@@ -1778,46 +1922,49 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1778
1922
  taskId: t.taskId
1779
1923
  });
1780
1924
  };
1781
- return /* @__PURE__ */ B(z, { children: n.map((t) => /* @__PURE__ */ B("div", {
1782
- className: "bsy-gantt-chart__offscreen-row",
1925
+ return /* @__PURE__ */ R(L, { children: n.map((t) => /* @__PURE__ */ R("div", {
1926
+ className: Z.offscreenRow,
1783
1927
  style: {
1784
1928
  top: t.rowTop,
1785
1929
  height: t.rowHeight
1786
1930
  },
1787
- children: /* @__PURE__ */ V("div", {
1788
- className: "bsy-gantt-chart__offscreen-track",
1789
- children: [t.showLeft ? /* @__PURE__ */ B("button", {
1931
+ children: /* @__PURE__ */ z("div", {
1932
+ className: Z.offscreenTrack,
1933
+ children: [t.showLeft ? /* @__PURE__ */ R("button", {
1790
1934
  type: "button",
1791
- className: "bsy-gantt-chart__offscreen-btn bsy-gantt-chart__offscreen-btn--left",
1935
+ className: Y(Z.offscreenBtn, Z.offscreenBtnLeft),
1936
+ "data-testid": "gantt-offscreen-btn-left",
1792
1937
  "aria-label": i("gantt.aria.jumpLeft"),
1793
1938
  onClick: (e) => a(e, t),
1794
- children: /* @__PURE__ */ B(e, {
1939
+ children: /* @__PURE__ */ R(e, {
1795
1940
  name: "left",
1796
1941
  size: 16
1797
1942
  })
1798
- }) : null, t.showRight ? /* @__PURE__ */ B("button", {
1943
+ }) : null, t.showRight ? /* @__PURE__ */ R("button", {
1799
1944
  type: "button",
1800
- className: "bsy-gantt-chart__offscreen-btn bsy-gantt-chart__offscreen-btn--right",
1945
+ className: Y(Z.offscreenBtn, Z.offscreenBtnRight),
1946
+ "data-testid": "gantt-offscreen-btn-right",
1801
1947
  "aria-label": i("gantt.aria.jumpRight"),
1802
1948
  onClick: (e) => a(e, t),
1803
- children: /* @__PURE__ */ B(e, {
1949
+ children: /* @__PURE__ */ R(e, {
1804
1950
  name: "arrow-right",
1805
1951
  size: 16
1806
1952
  })
1807
1953
  }) : null]
1808
1954
  })
1809
1955
  }, t.rowKey)) });
1810
- }), zt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ B("div", {
1811
- className: X("bsy-gantt-chart__today-indicator", n),
1956
+ }), Kt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ R("div", {
1957
+ className: Y(Z.todayIndicator, n),
1958
+ "data-testid": "gantt-today-indicator-content-line",
1812
1959
  style: {
1813
1960
  left: e,
1814
1961
  height: t
1815
1962
  },
1816
- children: /* @__PURE__ */ B("span", { className: "bsy-gantt-chart__today-indicator-line" })
1817
- }), Bt = W(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
1818
- return /* @__PURE__ */ V(z, { children: [
1819
- t.map((t) => /* @__PURE__ */ B("div", {
1820
- className: "bsy-gantt-chart__weekend-bg",
1963
+ children: /* @__PURE__ */ R("span", { className: Z.todayIndicatorLine })
1964
+ }), qt = H(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
1965
+ return /* @__PURE__ */ z(L, { children: [
1966
+ t.map((t) => /* @__PURE__ */ R("div", {
1967
+ className: Z.weekendBg,
1821
1968
  style: {
1822
1969
  left: t.left,
1823
1970
  width: t.width,
@@ -1826,27 +1973,27 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1826
1973
  }, t.id)),
1827
1974
  n.map((t) => {
1828
1975
  let n = r[t.index];
1829
- return n ? /* @__PURE__ */ B("div", {
1830
- className: "bsy-gantt-chart__col-line",
1976
+ return n ? /* @__PURE__ */ R("div", {
1977
+ className: Z.colLine,
1831
1978
  style: {
1832
1979
  left: n.left,
1833
1980
  height: e
1834
1981
  }
1835
1982
  }, `line-${n.id}`) : null;
1836
1983
  }),
1837
- i ? /* @__PURE__ */ B(zt, {
1984
+ i ? /* @__PURE__ */ R(Kt, {
1838
1985
  left: a ?? 0,
1839
1986
  height: e,
1840
- className: "bsy-gantt-chart__today-indicator--content-line"
1987
+ className: Z.todayIndicatorContentLine
1841
1988
  }) : null
1842
1989
  ] });
1843
- }), Vt = ({ 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 }) => {
1844
1991
  let o = n?.taskId ?? null;
1845
1992
  return e.map((e) => {
1846
1993
  let s = t[e.index];
1847
1994
  if (!s || s.invalid) return null;
1848
1995
  let c = o === s.id;
1849
- if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !qe({
1996
+ if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !Ze({
1850
1997
  startMs: s.startMs,
1851
1998
  endMs: s.endMs
1852
1999
  }, {
@@ -1854,10 +2001,10 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1854
2001
  endMs: a
1855
2002
  }))) return null;
1856
2003
  let l = e.start + (e.size - 26) / 2;
1857
- return s.type === "summary" ? /* @__PURE__ */ B(Lt, {
2004
+ return s.type === "summary" ? /* @__PURE__ */ R(Wt, {
1858
2005
  item: s,
1859
2006
  barTop: l
1860
- }, `summary-${s.id}`) : /* @__PURE__ */ B(Ot, {
2007
+ }, `summary-${s.id}`) : /* @__PURE__ */ R(Ft, {
1861
2008
  item: s,
1862
2009
  barTop: l,
1863
2010
  dragTaskId: o,
@@ -1865,8 +2012,8 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1865
2012
  dragPermission: r[s.id]
1866
2013
  }, `bar-${s.id}`);
1867
2014
  });
1868
- }, Ht = W(function({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, handleOffscreenJump: i, hoverBgRef: a }) {
1869
- let o = $((e) => e.timelineStartMs), s = $((e) => e.timelineEndMs), c = $((e) => e.visibleStartMs), l = $((e) => e.visibleEndMs), u = $((e) => e.isInitialLayoutReady), d = ft({
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({
1870
2017
  virtualRows: e,
1871
2018
  normalizedItems: t,
1872
2019
  visibleStartMs: c,
@@ -1874,20 +2021,22 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1874
2021
  enabled: u,
1875
2022
  excludeTaskId: n?.taskId ?? null
1876
2023
  });
1877
- return /* @__PURE__ */ V(z, { children: [
1878
- e.map((e) => /* @__PURE__ */ B("div", {
1879
- className: "bsy-gantt-chart__row-line",
2024
+ return /* @__PURE__ */ z(L, { children: [
2025
+ e.map((e) => /* @__PURE__ */ R("div", {
2026
+ className: Z.rowLine,
2027
+ "data-testid": "gantt-row-line",
1880
2028
  style: {
1881
2029
  top: e.start,
1882
2030
  height: e.size
1883
2031
  }
1884
2032
  }, `row-line-${e.key}`)),
1885
- /* @__PURE__ */ B("div", {
2033
+ /* @__PURE__ */ R("div", {
1886
2034
  ref: a,
1887
- className: "bsy-gantt-chart__row-hover-bg",
2035
+ className: Z.rowHoverBg,
2036
+ "data-testid": "gantt-row-hover-bg",
1888
2037
  style: { display: "none" }
1889
2038
  }),
1890
- u && Vt({
2039
+ u && Jt({
1891
2040
  virtualRows: e,
1892
2041
  normalizedItems: t,
1893
2042
  dragState: n,
@@ -1895,24 +2044,24 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1895
2044
  timelineStartMs: o,
1896
2045
  timelineEndMs: s
1897
2046
  }),
1898
- u ? /* @__PURE__ */ B(Rt, {
2047
+ u ? /* @__PURE__ */ R(Gt, {
1899
2048
  indicators: d,
1900
2049
  onJump: i
1901
2050
  }) : null
1902
2051
  ] });
1903
- }), Ut = W(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 }) {
1904
- let _ = $((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } = dt({
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({
1905
2054
  items: t,
1906
2055
  contentRef: e,
1907
2056
  safeRowHeight: n,
1908
2057
  viewportHeight: r
1909
- }), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = pt({
2058
+ }), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = bt({
1910
2059
  normalizedItems: t,
1911
2060
  safeRowHeight: n
1912
- }), w = q(() => ({
2061
+ }), w = K(() => ({
1913
2062
  width: _,
1914
2063
  height: y
1915
- }), [_, y]), T = q(() => ({
2064
+ }), [_, y]), T = K(() => ({
1916
2065
  tooltip: l ?? null,
1917
2066
  isScrolling: b,
1918
2067
  collapsedKeys: p,
@@ -1927,21 +2076,22 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1927
2076
  u,
1928
2077
  d
1929
2078
  ]);
1930
- return /* @__PURE__ */ V("div", {
1931
- className: "bsy-gantt-chart__canvas",
2079
+ return /* @__PURE__ */ z("div", {
2080
+ className: Z.canvas,
2081
+ "data-testid": "gantt-canvas",
1932
2082
  style: w,
1933
2083
  onMouseMove: S,
1934
2084
  onMouseLeave: C,
1935
- children: [/* @__PURE__ */ B(Bt, {
2085
+ children: [/* @__PURE__ */ R(qt, {
1936
2086
  canvasHeight: y,
1937
2087
  weekendSegments: o,
1938
2088
  virtualColumns: a,
1939
2089
  lowerSegments: i,
1940
2090
  shouldShowTodayMarker: g,
1941
2091
  todayLineLeft: h
1942
- }), /* @__PURE__ */ B(mt.Provider, {
2092
+ }), /* @__PURE__ */ R(xt.Provider, {
1943
2093
  value: T,
1944
- children: /* @__PURE__ */ B(Ht, {
2094
+ children: /* @__PURE__ */ R(Yt, {
1945
2095
  virtualRows: v,
1946
2096
  normalizedItems: t,
1947
2097
  dragState: s,
@@ -1954,8 +2104,8 @@ var Lt = H.memo(Ft, It), Rt = H.memo(({ indicators: n = [], onJump: r }) => {
1954
2104
  });
1955
2105
  //#endregion
1956
2106
  //#region src/components/Gantt/GanttChart/GanttChart.tsx
1957
- function Wt({ 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 }, _) {
1958
- let { t: v } = t(), y = G((e, t) => v(oe(e), t), [v]), b = J(null), x = J(null), S = J(null), C = ue(x), w = J(null), T = ct(b, x), [ee, E] = Y(!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: P, handleContentScroll: F, handleTodayClick: I, handleOffscreenJump: L, handleScrollPrev: R, handleScrollNext: z } = ot({
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({
1959
2109
  timeRangeConfig: a,
1960
2110
  pixelsPerDayConfig: o,
1961
2111
  viewMode: n,
@@ -1966,24 +2116,24 @@ function Wt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
1966
2116
  isHorizontalScrollbarInteracting: T,
1967
2117
  isTaskBarInteracting: ee
1968
2118
  });
1969
- se(_, () => ({
1970
- scrollToToday: I,
1971
- scrollPrev: R,
1972
- scrollNext: z
2119
+ G(_, () => ({
2120
+ scrollToToday: se,
2121
+ scrollPrev: I,
2122
+ scrollNext: L
1973
2123
  }), [
2124
+ se,
1974
2125
  I,
1975
- R,
1976
- z
2126
+ L
1977
2127
  ]);
1978
- let { dragState: H, committedRangeById: U, resetCommittedRanges: W, forceResetAllCommittedRanges: ce, handleTaskMouseDown: X, handleResizeMouseDown: le, consumeRecentDragResult: de } = Ae({
2128
+ let { dragState: B, committedRangeById: V, resetCommittedRanges: H, forceResetAllCommittedRanges: le, handleTaskMouseDown: Y, handleResizeMouseDown: ue, consumeRecentDragResult: fe } = Pe({
1979
2129
  pixelsPerDay: D,
1980
2130
  viewMode: n,
1981
- timelineCoords: ne,
2131
+ timelineCoords: N,
1982
2132
  onTaskTimeChange: s,
1983
2133
  containerRef: x,
1984
2134
  onDragInteractionChange: E
1985
2135
  });
1986
- K(() => {
2136
+ W(() => {
1987
2137
  let t = new Set((e || []).map((e) => String(e?.id ?? ""))), n = w.current, r = !1;
1988
2138
  if (n) {
1989
2139
  if (n.size !== t.size) r = !0;
@@ -1993,46 +2143,46 @@ function Wt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
1993
2143
  }
1994
2144
  }
1995
2145
  if (w.current = t, r) {
1996
- ce();
2146
+ le();
1997
2147
  return;
1998
2148
  }
1999
- W();
2149
+ H();
2000
2150
  }, [
2001
2151
  e,
2002
- W,
2003
- ce
2152
+ H,
2153
+ le
2004
2154
  ]);
2005
- let { normalizedItems: Z } = st({
2155
+ let { normalizedItems: X } = dt({
2006
2156
  visibleItems: e,
2007
- committedRangeById: U,
2157
+ committedRangeById: V,
2008
2158
  viewMode: n
2009
- }), Q = q(() => {
2159
+ }), pe = K(() => {
2010
2160
  let e = {};
2011
- return Z.forEach((t) => {
2012
- e[t.id] = ve(t);
2161
+ return X.forEach((t) => {
2162
+ e[t.id] = Se(t);
2013
2163
  }), e;
2014
- }, [Z]), fe = G((e, t, n, r) => {
2015
- let i = Q[t.id];
2016
- i?.canMove && X(e, {
2164
+ }, [X]), me = U((e, t, n, r) => {
2165
+ let i = pe[t.id];
2166
+ i?.canMove && Y(e, {
2017
2167
  ...t,
2018
2168
  dragPermission: i
2019
2169
  }, n, r);
2020
- }, [Q, X]), pe = G((e, t, n, r, i) => {
2021
- let a = Q[t.id];
2022
- (r === "start" ? a?.canResizeStart : a?.canResizeEnd) && le(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, {
2023
2173
  ...t,
2024
2174
  dragPermission: a
2025
2175
  }, n, r, i);
2026
- }, [Q, le]);
2027
- K(() => {
2176
+ }, [pe, ue]);
2177
+ W(() => {
2028
2178
  if (!f || !x.current) return;
2029
2179
  let e = x.current;
2030
2180
  return f.registerTimelineScroller({ setScrollTop: (t) => {
2031
2181
  e.scrollTop = t;
2032
2182
  } });
2033
2183
  }, [f]);
2034
- let me = C?.height || 0, { virtualColumns: he, weekendSegments: ge } = Fe({
2035
- lowerSegments: te,
2184
+ let ge = C?.height || 0, { virtualColumns: _e, weekendSegments: ve } = ze({
2185
+ lowerSegments: ne,
2036
2186
  pixelsPerDay: D,
2037
2187
  scrollLeft: k,
2038
2188
  viewportWidth: O,
@@ -2040,11 +2190,11 @@ function Wt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2040
2190
  timelineStartMs: A,
2041
2191
  timelineWidth: re,
2042
2192
  viewMode: n
2043
- }), _e = lt(m, ae, re, ie, {
2193
+ }), ye = pt(m, P, re, ie, {
2044
2194
  startMs: A,
2045
2195
  endMs: j
2046
- }), ye = G((e, t) => {
2047
- if (!(e.target instanceof Element && e.target.closest(".bsy-gantt-chart__bar-resize-handle")) && !de()) {
2196
+ }), be = U((e, t) => {
2197
+ if (!(e.target instanceof Element && e.target.closest(`.${Z.barResizeHandle}`)) && !fe()) {
2048
2198
  if (t?.type === "summary") {
2049
2199
  let e = t.groupKey;
2050
2200
  if (!e || !g) return;
@@ -2054,91 +2204,93 @@ function Wt({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeC
2054
2204
  l && l(t, t.rowIndex, e);
2055
2205
  }
2056
2206
  }, [
2057
- de,
2207
+ fe,
2058
2208
  l,
2059
2209
  g
2060
- ]), be = q(() => ({
2210
+ ]), xe = K(() => ({
2061
2211
  viewMode: n,
2062
2212
  pixelsPerDay: D,
2063
2213
  timelineStartMs: A,
2064
2214
  timelineEndMs: j,
2065
2215
  visibleStartMs: M,
2066
- visibleEndMs: N,
2067
- timelineCoords: ne,
2216
+ visibleEndMs: te,
2217
+ timelineCoords: N,
2068
2218
  scrollLeft: k,
2069
2219
  viewportWidth: O,
2070
2220
  timelineWidth: re,
2071
- isInitialLayoutReady: P
2221
+ isInitialLayoutReady: ae
2072
2222
  }), [
2073
2223
  n,
2074
2224
  D,
2075
2225
  A,
2076
2226
  j,
2077
2227
  M,
2228
+ te,
2078
2229
  N,
2079
- ne,
2080
2230
  k,
2081
2231
  O,
2082
2232
  re,
2083
- P
2233
+ ae
2084
2234
  ]);
2085
- return /* @__PURE__ */ B(gt.Provider, {
2086
- value: be,
2087
- children: /* @__PURE__ */ V("div", {
2088
- className: "bsy-gantt-chart",
2089
- style: { visibility: P ? "visible" : "hidden" },
2090
- children: [/* @__PURE__ */ B(ut, {
2235
+ return /* @__PURE__ */ R(Ct.Provider, {
2236
+ value: xe,
2237
+ children: /* @__PURE__ */ z("div", {
2238
+ className: Z.root,
2239
+ "data-testid": "gantt-chart",
2240
+ style: { visibility: ae ? "visible" : "hidden" },
2241
+ children: [/* @__PURE__ */ R(_t, {
2091
2242
  timelineWidth: re,
2092
2243
  viewportWidth: O,
2093
2244
  scrollLeft: k,
2094
2245
  trackRef: S,
2095
- virtualColumns: he,
2096
- lowerSegments: te,
2097
- todayLineLeft: ae,
2246
+ virtualColumns: _e,
2247
+ lowerSegments: ne,
2248
+ todayLineLeft: P,
2098
2249
  todayCenterMs: ie,
2099
2250
  showTodayLine: m,
2100
2251
  viewMode: n,
2101
2252
  availableModes: r,
2102
2253
  formatMessage: y,
2103
2254
  onViewModeChange: i,
2104
- onTodayClick: I,
2105
- onScrollPrev: R,
2106
- onScrollNext: z
2107
- }), /* @__PURE__ */ B("div", {
2255
+ onTodayClick: se,
2256
+ onScrollPrev: I,
2257
+ onScrollNext: L
2258
+ }), /* @__PURE__ */ R("div", {
2108
2259
  ref: b,
2109
- className: "bsy-gantt-chart__timeline-host",
2110
- children: /* @__PURE__ */ B("div", {
2260
+ className: Z.timelineHost,
2261
+ children: /* @__PURE__ */ R("div", {
2111
2262
  ref: x,
2112
- className: "bsy-gantt-chart__timeline-content",
2263
+ className: Z.timelineContent,
2264
+ "data-testid": "gantt-timeline-content",
2113
2265
  role: "region",
2114
2266
  "aria-label": v("gantt.aria.timeline"),
2115
2267
  onScroll: (e) => {
2116
2268
  F(e), f && f.sync("timeline", e.currentTarget.scrollTop);
2117
2269
  },
2118
- children: /* @__PURE__ */ B(Ut, {
2270
+ children: /* @__PURE__ */ R(Xt, {
2119
2271
  contentRef: x,
2120
- normalizedItems: Z,
2272
+ normalizedItems: X,
2121
2273
  safeRowHeight: 34,
2122
- viewportHeight: me,
2123
- lowerSegments: te,
2124
- virtualColumns: he,
2125
- weekendSegments: ge,
2126
- dragState: H,
2127
- dragPermissionById: Q,
2274
+ viewportHeight: ge,
2275
+ lowerSegments: ne,
2276
+ virtualColumns: _e,
2277
+ weekendSegments: ve,
2278
+ dragState: B,
2279
+ dragPermissionById: pe,
2128
2280
  tooltip: d,
2129
- handleTaskMouseDown: fe,
2130
- handleResizeMouseDown: pe,
2131
- handleBarClick: ye,
2281
+ handleTaskMouseDown: me,
2282
+ handleResizeMouseDown: he,
2283
+ handleBarClick: be,
2132
2284
  collapsedKeys: h,
2133
- handleOffscreenJump: L,
2134
- todayLineLeft: ae,
2135
- shouldShowTodayMarker: _e
2285
+ handleOffscreenJump: ce,
2286
+ todayLineLeft: P,
2287
+ shouldShowTodayMarker: ye
2136
2288
  })
2137
2289
  })
2138
2290
  })]
2139
2291
  })
2140
2292
  });
2141
2293
  }
2142
- var Gt = U(Wt);
2294
+ var Qt = V(Zt);
2143
2295
  //#endregion
2144
- export { Gt as t };
2296
+ export { Qt as t };