@baishuyun/ui-mobile 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +2 -11
  2. package/dist/AMap/AMap-BWZ2lhXr.js +683 -0
  3. package/dist/AMap/index.js +5 -0
  4. package/dist/ActionSheet/ActionSheet-DbrKxa_y.js +133 -0
  5. package/dist/ActionSheet/index.js +5 -0
  6. package/dist/Calendar/Calendar-Bd6CS8y7.js +1580 -0
  7. package/dist/Calendar/index.js +4 -3
  8. package/dist/Calendar/timeUtils-t4A3-Hr6.js +27 -0
  9. package/dist/ConfigProvider/ConfigProvider-DnlakyRE.js +208 -0
  10. package/dist/ConfigProvider/index.js +4 -4
  11. package/dist/ConfigProvider/useLocale-CP8NRZoj.js +115 -0
  12. package/dist/Gantt/Gantt-CR7eRNVP.js +1094 -0
  13. package/dist/Gantt/index.js +7 -3
  14. package/dist/Icon/Icon-CFvcrGGg.js +23 -0
  15. package/dist/Icon/index.js +3 -0
  16. package/dist/components/AMap/AMap.d.ts +3 -0
  17. package/dist/components/AMap/Controls/Controls.d.ts +3 -0
  18. package/dist/components/AMap/Controls/index.d.ts +1 -0
  19. package/dist/components/AMap/Locate/Locate.d.ts +3 -0
  20. package/dist/components/AMap/Locate/index.d.ts +1 -0
  21. package/dist/components/AMap/Markers/Markers.d.ts +3 -0
  22. package/dist/components/AMap/Markers/index.d.ts +1 -0
  23. package/dist/components/AMap/PoiSearch/PoiSearch.d.ts +3 -0
  24. package/dist/components/AMap/PoiSearch/index.d.ts +1 -0
  25. package/dist/components/AMap/context.d.ts +7 -0
  26. package/dist/components/AMap/ensureAMap.d.ts +7 -0
  27. package/dist/components/AMap/index.d.ts +15 -0
  28. package/dist/components/AMap/interface.d.ts +66 -0
  29. package/dist/components/AMap/utils/cx.d.ts +1 -0
  30. package/dist/components/AMap/utils/geometry.d.ts +21 -0
  31. package/dist/components/AMap/utils/markerHtml.d.ts +21 -0
  32. package/dist/components/AMap/utils/searchPois.d.ts +6 -0
  33. package/dist/components/ActionSheet/ActionSheet.d.ts +3 -0
  34. package/dist/components/ActionSheet/index.d.ts +2 -0
  35. package/dist/components/ActionSheet/interface.d.ts +75 -0
  36. package/dist/components/Calendar/index.d.ts +1 -1
  37. package/dist/components/Calendar/interface.d.ts +59 -1
  38. package/dist/components/ConfigProvider/ConfigContext.d.ts +11 -0
  39. package/dist/components/ConfigProvider/ConfigProvider.d.ts +1 -1
  40. package/dist/components/ConfigProvider/context.d.ts +18 -0
  41. package/dist/components/ConfigProvider/index.d.ts +2 -1
  42. package/dist/components/Gantt/Gantt.d.ts +1 -1
  43. package/dist/components/Gantt/GanttBar.d.ts +12 -0
  44. package/dist/components/Gantt/GanttHeader.d.ts +2 -0
  45. package/dist/components/Gantt/GanttTimeLine.d.ts +9 -0
  46. package/dist/components/Gantt/HeaderToolbar.d.ts +6 -0
  47. package/dist/components/Gantt/OffscreenIndicatorArrow.d.ts +8 -0
  48. package/dist/components/Gantt/OffscreenIndicatorOverlay.d.ts +14 -0
  49. package/dist/components/Gantt/StickyLabel.d.ts +10 -0
  50. package/dist/components/Gantt/TodayIndicator.d.ts +14 -0
  51. package/dist/components/Gantt/context.d.ts +27 -0
  52. package/dist/components/Gantt/hooks/useGanttScroll.d.ts +23 -0
  53. package/dist/components/Gantt/hooks/useGanttViewport.d.ts +20 -0
  54. package/dist/components/Gantt/hooks/useTodayTracker.d.ts +7 -0
  55. package/dist/components/Gantt/index.d.ts +2 -1
  56. package/dist/components/Gantt/interface.d.ts +27 -2
  57. package/dist/components/Gantt/utils/calcTodayLeft.d.ts +8 -0
  58. package/dist/components/Gantt/utils/color.d.ts +2 -0
  59. package/dist/components/Gantt/utils/cx.d.ts +1 -0
  60. package/dist/components/Gantt/utils/dateRangeNormalizer.d.ts +25 -0
  61. package/dist/components/Gantt/utils/dayScale.d.ts +30 -0
  62. package/dist/components/Gantt/utils/headerTimeUtils.d.ts +43 -0
  63. package/dist/components/Gantt/utils/layoutBars.d.ts +26 -0
  64. package/dist/components/Gantt/utils/msUntilNextDay.d.ts +2 -0
  65. package/dist/components/Gantt/utils/time.d.ts +4 -0
  66. package/dist/components/Gantt/utils/viewportDateUtils.d.ts +11 -0
  67. package/dist/components/Gantt/utils/zoomReanchor.d.ts +18 -0
  68. package/dist/components/Icon/Icon.d.ts +6 -0
  69. package/dist/components/Icon/index.d.ts +2 -0
  70. package/dist/components/Icon/interface.d.ts +19 -0
  71. package/dist/components/Icon/loadIconfont.d.ts +1 -0
  72. package/dist/components/index.d.ts +10 -3
  73. package/dist/index.js +10 -6
  74. package/dist/locale/index.d.ts +3 -0
  75. package/dist/locale/lang/en-US.json.d.ts +52 -0
  76. package/dist/locale/lang/zh-CN.json.d.ts +52 -0
  77. package/dist/locale/lang/zh-TW.json.d.ts +52 -0
  78. package/dist/style.css +1 -1
  79. package/dist/vendors/{version-v6TU1ff1.js → version-qi3OapTz.js} +1 -1
  80. package/dist/vite-env.d.ts +1 -0
  81. package/package.json +7 -1
  82. package/dist/Calendar/Calendar-C63wg0aw.js +0 -1601
  83. package/dist/ConfigProvider/ConfigProvider-E792q6ny.js +0 -99
  84. package/dist/Gantt/Gantt-DLmqZPAQ.js +0 -8
  85. package/dist/locale/context/LocaleContext.d.ts +0 -7
  86. package/dist/vendors/useLocale-BbUDQCzl.js +0 -57
@@ -0,0 +1,1094 @@
1
+ import { t as e } from "../ActionSheet/ActionSheet-DbrKxa_y.js";
2
+ import { a as t, i as n, t as r } from "../ConfigProvider/useLocale-CP8NRZoj.js";
3
+ import { r as i } from "../Calendar/timeUtils-t4A3-Hr6.js";
4
+ import { createContext as a, memo as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
5
+ import { createPortal as m } from "react-dom";
6
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ import { useControllableValue as v } from "ahooks";
8
+ import y from "dayjs";
9
+ import { useVirtualizer as b } from "@tanstack/react-virtual";
10
+ //#region src/components/Gantt/Gantt.module.scss
11
+ var x = {
12
+ "bsy-mobile-gantt": "_bsy-mobile-gantt_1ni8r_1",
13
+ "bsy-mobile-gantt__scroll": "_bsy-mobile-gantt__scroll_1ni8r_18",
14
+ "bsy-mobile-gantt__canvas": "_bsy-mobile-gantt__canvas_1ni8r_28",
15
+ "bsy-mobile-gantt__overlay-host": "_bsy-mobile-gantt__overlay-host_1ni8r_34",
16
+ "bsy-mobile-gantt__header": "_bsy-mobile-gantt__header_1ni8r_43",
17
+ "bsy-mobile-gantt__header-row1": "_bsy-mobile-gantt__header-row1_1ni8r_50",
18
+ "bsy-mobile-gantt__header-row2": "_bsy-mobile-gantt__header-row2_1ni8r_54",
19
+ "bsy-mobile-gantt__header-cell": "_bsy-mobile-gantt__header-cell_1ni8r_57",
20
+ "bsy-mobile-gantt__header-cell-label": "_bsy-mobile-gantt__header-cell-label_1ni8r_62",
21
+ "bsy-mobile-gantt__header-cell-label--today": "_bsy-mobile-gantt__header-cell-label--today_1ni8r_73",
22
+ "bsy-mobile-gantt__today-dot": "_bsy-mobile-gantt__today-dot_1ni8r_77",
23
+ "bsy-mobile-gantt__sticky-label": "_bsy-mobile-gantt__sticky-label_1ni8r_87",
24
+ "bsy-mobile-gantt__sticky-label-text": "_bsy-mobile-gantt__sticky-label-text_1ni8r_95",
25
+ "bsy-mobile-gantt__toolbar": "_bsy-mobile-gantt__toolbar_1ni8r_102",
26
+ "bsy-mobile-gantt__toolbar-zoom": "_bsy-mobile-gantt__toolbar-zoom_1ni8r_115",
27
+ "bsy-mobile-gantt__toolbar-today": "_bsy-mobile-gantt__toolbar-today_1ni8r_115",
28
+ "bsy-mobile-gantt__toolbar-nav": "_bsy-mobile-gantt__toolbar-nav_1ni8r_115",
29
+ "bsy-mobile-gantt__toolbar-divider": "_bsy-mobile-gantt__toolbar-divider_1ni8r_130",
30
+ "bsy-mobile-gantt__chevron": "_bsy-mobile-gantt__chevron_1ni8r_156",
31
+ "bsy-mobile-gantt__chevron--left": "_bsy-mobile-gantt__chevron--left_1ni8r_160",
32
+ "bsy-mobile-gantt__chevron--right": "_bsy-mobile-gantt__chevron--right_1ni8r_163",
33
+ "bsy-mobile-gantt__timeline": "_bsy-mobile-gantt__timeline_1ni8r_166",
34
+ "bsy-mobile-gantt__timeline-inner": "_bsy-mobile-gantt__timeline-inner_1ni8r_177",
35
+ "bsy-mobile-gantt__column": "_bsy-mobile-gantt__column_1ni8r_181",
36
+ "bsy-mobile-gantt__column--weekend": "_bsy-mobile-gantt__column--weekend_1ni8r_192",
37
+ "bsy-mobile-gantt__today-line": "_bsy-mobile-gantt__today-line_1ni8r_195",
38
+ "bsy-mobile-gantt__bar": "_bsy-mobile-gantt__bar_1ni8r_203",
39
+ "bsy-mobile-gantt__bar-track": "_bsy-mobile-gantt__bar-track_1ni8r_210",
40
+ "bsy-mobile-gantt__bar-progress": "_bsy-mobile-gantt__bar-progress_1ni8r_210",
41
+ "bsy-mobile-gantt__bar-label": "_bsy-mobile-gantt__bar-label_1ni8r_220",
42
+ "bsy-mobile-gantt__bar-label-overlay": "_bsy-mobile-gantt__bar-label-overlay_1ni8r_230",
43
+ "bsy-mobile-gantt__offscreen": "_bsy-mobile-gantt__offscreen_1ni8r_242",
44
+ "bsy-mobile-gantt__offscreen-layer": "_bsy-mobile-gantt__offscreen-layer_1ni8r_251",
45
+ "bsy-mobile-gantt__offscreen-row": "_bsy-mobile-gantt__offscreen-row_1ni8r_261",
46
+ "bsy-mobile-gantt__offscreen-arrow": "_bsy-mobile-gantt__offscreen-arrow_1ni8r_269",
47
+ "bsy-mobile-gantt-arrow-enter": "_bsy-mobile-gantt-arrow-enter_1ni8r_1",
48
+ "bsy-mobile-gantt__offscreen-arrow--right": "_bsy-mobile-gantt__offscreen-arrow--right_1ni8r_289"
49
+ }, S = a(null), C = a(null), w = () => {
50
+ let e = c(S);
51
+ if (!e) throw Error("useGanttState must be used within a GanttStateContext.Provider");
52
+ return e;
53
+ }, T = () => {
54
+ let e = c(C);
55
+ if (!e) throw Error("useGanttAction must be used within a GanttActionContext.Provider");
56
+ return e;
57
+ }, E = [
58
+ "day",
59
+ "week",
60
+ "month",
61
+ "quarter",
62
+ "quarterMonth",
63
+ "year"
64
+ ], D = [
65
+ "halfDay",
66
+ "sixHour",
67
+ "hour",
68
+ "halfHour",
69
+ "tenMinute",
70
+ "oneMinute"
71
+ ], O = [...E, ...D];
72
+ t.gantt.zoom;
73
+ var k = [...[...D].reverse(), ...E], A = 1440 * 60 * 1e3, j = A / 24, M = j / 60, N = {
74
+ halfDay: 12 * j,
75
+ sixHour: 6 * j,
76
+ hour: j,
77
+ halfHour: 30 * M,
78
+ tenMinute: 10 * M,
79
+ oneMinute: M
80
+ }, P = {
81
+ halfDay: 80,
82
+ sixHour: 70,
83
+ hour: 50,
84
+ halfHour: 45,
85
+ tenMinute: 40,
86
+ oneMinute: 40
87
+ }, ee = 30 / 40;
88
+ function F(e) {
89
+ return (e === "tenMinute" || e === "oneMinute" ? 30 : Math.round(P[e] * ee)) * (A / N[e]);
90
+ }
91
+ var I = {
92
+ day: 30,
93
+ week: 18,
94
+ month: 6.5,
95
+ quarter: 2.2,
96
+ quarterMonth: 100 / 30,
97
+ year: 1.1,
98
+ halfDay: F("halfDay"),
99
+ sixHour: F("sixHour"),
100
+ hour: F("hour"),
101
+ halfHour: F("halfHour"),
102
+ tenMinute: F("tenMinute"),
103
+ oneMinute: F("oneMinute")
104
+ }, te = {
105
+ halfDay: 30,
106
+ sixHour: 14,
107
+ hour: 7,
108
+ halfHour: 3,
109
+ tenMinute: 2,
110
+ oneMinute: 0
111
+ };
112
+ function L(e) {
113
+ return D.includes(e);
114
+ }
115
+ function R(e) {
116
+ return L(e) ? N[e] : A;
117
+ }
118
+ function ne(e, t) {
119
+ return t * (R(e) / A);
120
+ }
121
+ function z(e, t, n) {
122
+ return (e.valueOf() - t.valueOf()) / A * n;
123
+ }
124
+ function re(e, t, n) {
125
+ let r = e / n * A;
126
+ return t.add(r, "millisecond");
127
+ }
128
+ //#endregion
129
+ //#region src/components/Gantt/utils/time.ts
130
+ var B = (e) => e ? y().tz(e) : y(), ie = (e, t) => i(e, t), ae = (e, r) => n(t, e, r), V = (e) => `calendar.monthShort.${e}`, H = (e) => `gantt.quarter.${e + 1}`, oe = new Set([
131
+ "halfDay",
132
+ "sixHour",
133
+ "hour"
134
+ ]), se = new Set([
135
+ "halfHour",
136
+ "tenMinute",
137
+ "oneMinute"
138
+ ]);
139
+ function ce(e, t, n) {
140
+ switch (t) {
141
+ case "halfDay": return e.hour() < 12 ? n("gantt.am") : n("gantt.pm");
142
+ case "sixHour": {
143
+ let t = e.hour();
144
+ return n("gantt.hourRange", {
145
+ start: t,
146
+ end: t + 6
147
+ });
148
+ }
149
+ case "hour": return String(e.hour());
150
+ case "halfHour": return e.format("HH:mm");
151
+ case "tenMinute": return String(e.minute());
152
+ case "oneMinute": return e.format("mm");
153
+ default: return e.format("HH:mm");
154
+ }
155
+ }
156
+ function le(e, t) {
157
+ let n = e.hour();
158
+ if (n === 0) {
159
+ let r = e.month() + 1;
160
+ return t("gantt.monthDayHour", {
161
+ month: r,
162
+ day: e.date(),
163
+ hour: n,
164
+ monthShort: t(V(r))
165
+ });
166
+ }
167
+ return t("gantt.hour", { hour: n });
168
+ }
169
+ function ue(e, t) {
170
+ switch (t) {
171
+ case "halfDay": return e.add(12, "hour");
172
+ case "sixHour": return e.add(6, "hour");
173
+ case "hour": return e.add(1, "hour");
174
+ case "halfHour": return e.add(30, "minute");
175
+ case "tenMinute": return e.add(10, "minute");
176
+ case "oneMinute": return e.add(1, "minute");
177
+ default: return e.add(1, "hour");
178
+ }
179
+ }
180
+ function de(e, t, n, r = ae) {
181
+ let i = [], a = "", o = null;
182
+ return e.forEach((e, s) => {
183
+ let c, l, u = e.date.year(), d = e.date.month() + 1;
184
+ if (oe.has(t)) c = e.date.format("YYYY-MM-DD"), l = r("gantt.yearMonthDay", {
185
+ year: u,
186
+ month: d,
187
+ day: e.date.date(),
188
+ monthShort: r(V(d))
189
+ });
190
+ else if (se.has(t)) c = e.date.format("YYYY-MM-DD-HH"), l = le(e.date, r);
191
+ else if (t === "day" || t === "week") c = e.date.format("YYYY-MM"), l = r("calendar.yearMonth", {
192
+ year: u,
193
+ monthShort: r(V(d))
194
+ });
195
+ else if (t === "quarterMonth") {
196
+ let t = Math.floor(e.date.month() / 3);
197
+ c = `${u}-Q${t + 1}`, l = r("gantt.yearQuarter", {
198
+ year: u,
199
+ quarter: r(H(t))
200
+ });
201
+ } else c = e.date.format("YYYY"), l = r("gantt.year", { year: u });
202
+ c === a ? o && (o.span++, o.widthPx += e.days * n) : (o && i.push(o), a = c, o = {
203
+ label: l,
204
+ startIndex: s,
205
+ span: 1,
206
+ widthPx: e.days * n
207
+ });
208
+ }), o && i.push(o), i;
209
+ }
210
+ function U(e, t, n, r, i = ae) {
211
+ let a = [];
212
+ if (L(n)) {
213
+ let o = N[n] / A, s = e;
214
+ for (let e = 0; e < t; e++) {
215
+ let e = s, t = ue(e, n), c = !r.isBefore(e) && r.isBefore(t);
216
+ a.push({
217
+ label: ce(e, n, i),
218
+ isToday: c,
219
+ isWeekend: !1,
220
+ date: e,
221
+ endDate: t,
222
+ days: o
223
+ }), s = t;
224
+ }
225
+ return a;
226
+ }
227
+ for (let o = 0; o < t; o++) {
228
+ let t, s, c, l = !1, u = !1;
229
+ switch (n) {
230
+ case "day":
231
+ t = e.add(o, "day"), s = t.add(1, "day"), c = String(t.date()), l = t.isSame(r, "day"), u = t.day() === 0 || t.day() === 6;
232
+ break;
233
+ case "week": {
234
+ t = e.add(o, "week").startOf("isoWeek"), s = t.add(1, "week");
235
+ let n = t.isoWeek();
236
+ c = i("gantt.week", { week: n }), l = r.isoWeek() === n && r.year() === t.year();
237
+ break;
238
+ }
239
+ case "month":
240
+ case "quarterMonth":
241
+ t = e.add(o, "month").startOf("month"), s = t.add(1, "month"), c = i(V(t.month() + 1)), l = r.month() === t.month() && r.year() === t.year();
242
+ break;
243
+ case "quarter": {
244
+ t = e.add(o * 3, "month").startOf("month"), s = t.add(3, "month");
245
+ let n = Math.floor(t.month() / 3);
246
+ c = i(H(n)), l = Math.floor(r.month() / 3) === n && r.year() === t.year();
247
+ break;
248
+ }
249
+ case "year": {
250
+ let n = e.month() < 6 ? 0 : 1, a = o + n, u = a % 2, d = Math.floor(a / 2), f = e.year() + d;
251
+ u === 0 ? (t = e.year(f).month(0).startOf("month"), s = e.year(f).month(6).startOf("month"), c = i("gantt.firstHalfYear")) : (t = e.year(f).month(6).startOf("month"), s = e.year(f + 1).month(0).startOf("month"), c = i("gantt.secondHalfYear")), l = r.isSame(t, "day") || r.isAfter(t) && r.isBefore(s);
252
+ break;
253
+ }
254
+ default:
255
+ t = e.add(o, "day"), s = t.add(1, "day"), c = String(t.date());
256
+ break;
257
+ }
258
+ let d = s.diff(t, "day");
259
+ a.push({
260
+ label: c,
261
+ isToday: l,
262
+ isWeekend: u,
263
+ date: t,
264
+ endDate: s,
265
+ days: d
266
+ });
267
+ }
268
+ return a;
269
+ }
270
+ function fe(e, t) {
271
+ if (t === "oneMinute") return {
272
+ startDate: e.subtract(12, "hour").startOf("minute"),
273
+ count: 1440,
274
+ totalDays: 1
275
+ };
276
+ let n = te[t], r = R(t), i = e.startOf("day").subtract(n, "day"), a = e.startOf("day").add(n + 1, "day").diff(i, "day", !0);
277
+ return {
278
+ startDate: i,
279
+ count: Math.max(1, Math.round(a * A / r)),
280
+ totalDays: a
281
+ };
282
+ }
283
+ function W(e, t, n, r, i = 30) {
284
+ if (L(t)) return fe(e, t);
285
+ let a = Math.ceil((r > 0 ? r : 375) / n) * (1 + i * 2), o = Math.floor(a / 2), s, c;
286
+ switch (t) {
287
+ case "day":
288
+ s = e.startOf("day").subtract(o, "day"), c = a;
289
+ break;
290
+ case "week": {
291
+ let t = Math.floor(o / 7);
292
+ s = e.startOf("isoWeek").subtract(t, "week"), c = Math.ceil(a / 7);
293
+ break;
294
+ }
295
+ case "month":
296
+ case "quarterMonth": {
297
+ let t = Math.floor(o / 30.44);
298
+ s = e.startOf("month").subtract(t, "month"), c = Math.ceil(a / 30.44);
299
+ break;
300
+ }
301
+ case "quarter": {
302
+ let t = Math.floor(o / 91.31);
303
+ s = e.startOf("month").subtract(Math.floor(e.month() % 3), "month").subtract(t * 3, "month"), c = Math.ceil(a / 91.31);
304
+ break;
305
+ }
306
+ case "year": {
307
+ let t = Math.floor(o / 182.5), n = e.month() < 6 ? 0 : 6;
308
+ s = e.startOf("year").add(n, "month").subtract(t * 6, "month"), s = s.month() >= 6 ? s.month(6).startOf("month") : s.month(0).startOf("month"), c = Math.ceil(a / 182.5);
309
+ break;
310
+ }
311
+ default:
312
+ s = e.startOf("day").subtract(o, "day"), c = a;
313
+ break;
314
+ }
315
+ let l;
316
+ switch (t) {
317
+ case "day":
318
+ l = c;
319
+ break;
320
+ case "week":
321
+ l = c * 7;
322
+ break;
323
+ case "month":
324
+ case "quarterMonth":
325
+ l = s.add(c, "month").diff(s, "day");
326
+ break;
327
+ case "quarter":
328
+ l = s.add(c * 3, "month").diff(s, "day");
329
+ break;
330
+ case "year":
331
+ l = s.add(c * 6, "month").diff(s, "day");
332
+ break;
333
+ default:
334
+ l = c;
335
+ break;
336
+ }
337
+ return {
338
+ startDate: s,
339
+ count: c,
340
+ totalDays: l
341
+ };
342
+ }
343
+ //#endregion
344
+ //#region src/components/Gantt/hooks/useGanttViewport.ts
345
+ function pe({ timeZone: e, initialZoomLevel: t = "day" }) {
346
+ let n = t, [r, i] = p(() => B(e)), a = f(null), [o, s] = p(0), c = I[n], { startDate: u, count: m, totalDays: h } = d(() => W(r, n, c, o), [
347
+ r,
348
+ n,
349
+ c,
350
+ o
351
+ ]), g = h * c;
352
+ return l(() => {
353
+ let e = a.current;
354
+ if (!e) return;
355
+ let t = new ResizeObserver((e) => {
356
+ for (let t of e) s(t.contentRect.width);
357
+ });
358
+ return t.observe(e), s(e.clientWidth), () => t.disconnect();
359
+ }, []), {
360
+ timeZone: e,
361
+ zoomLevel: n,
362
+ pxPerDay: c,
363
+ anchorDate: r,
364
+ containerRef: a,
365
+ viewportWidth: o,
366
+ startDate: u,
367
+ count: m,
368
+ totalDays: h,
369
+ totalWidth: g,
370
+ setAnchorDate: i
371
+ };
372
+ }
373
+ //#endregion
374
+ //#region src/components/Gantt/utils/viewportDateUtils.ts
375
+ function G(e, t, n, r) {
376
+ return re(e + t / 2, n, r);
377
+ }
378
+ function K(e, t, n, r) {
379
+ let i = z(e, t, n);
380
+ return Math.max(0, i - r / 2);
381
+ }
382
+ //#endregion
383
+ //#region src/components/Gantt/utils/zoomReanchor.ts
384
+ function me({ currentZoomLevel: e, nextZoomLevel: t, currentAnchorDate: n, currentScrollLeft: r, viewportWidth: i }) {
385
+ let a = I[e], o = G(r, i, W(n, e, a, i).startDate, a), s = I[t];
386
+ return {
387
+ anchorDate: o,
388
+ scrollLeft: K(o, W(o, t, s, i).startDate, s, i)
389
+ };
390
+ }
391
+ //#endregion
392
+ //#region src/components/Gantt/hooks/useGanttScroll.ts
393
+ var he = 2;
394
+ function ge(e, { onZoomLevelChange: t }) {
395
+ let { timeZone: n, zoomLevel: r, anchorDate: i, viewportWidth: a, startDate: o, totalWidth: c, pxPerDay: l, totalDays: d, setAnchorDate: p } = e, m = f(null), h = f(t);
396
+ h.current = t;
397
+ let g = f({
398
+ zoomLevel: r,
399
+ anchorDate: i,
400
+ viewportWidth: a,
401
+ startDate: o,
402
+ totalWidth: c,
403
+ pxPerDay: l,
404
+ totalDays: d
405
+ });
406
+ u(() => {
407
+ g.current = {
408
+ zoomLevel: r,
409
+ anchorDate: i,
410
+ viewportWidth: a,
411
+ startDate: o,
412
+ totalWidth: c,
413
+ pxPerDay: l,
414
+ totalDays: d
415
+ };
416
+ });
417
+ let _ = f(!1), v = f(!1), y = f(!1), b = f(null), x = s(() => m.current?.scrollLeft ?? 0, []), S = s((e, t = "auto") => {
418
+ let n = m.current;
419
+ if (!n) return;
420
+ let r = Math.max(0, n.scrollWidth - n.clientWidth), i = Math.max(0, Math.min(e, r));
421
+ Math.abs(n.scrollLeft - i) <= 1 || n.scrollTo({
422
+ left: i,
423
+ behavior: t
424
+ });
425
+ }, []), C = s((e) => {
426
+ let { zoomLevel: t, anchorDate: n, viewportWidth: r } = g.current;
427
+ if (e === t) return;
428
+ if (r <= 0) {
429
+ h.current(e);
430
+ return;
431
+ }
432
+ let { anchorDate: i, scrollLeft: a } = me({
433
+ currentZoomLevel: t,
434
+ nextZoomLevel: e,
435
+ currentAnchorDate: n,
436
+ currentScrollLeft: m.current?.scrollLeft ?? 0,
437
+ viewportWidth: r
438
+ });
439
+ p(i), h.current(e), y.current = !0, b.current = a;
440
+ }, [p]), w = s(() => {
441
+ let { zoomLevel: e, pxPerDay: t, viewportWidth: r } = g.current, i = B(n), a = K(i, W(i, e, t, r).startDate, t, r);
442
+ y.current = !0, b.current = a, p(i);
443
+ }, [n, p]);
444
+ return u(() => {
445
+ if (a <= 0 || v.current) return;
446
+ let e = K(i, o, l, a);
447
+ y.current = !0, b.current = e, v.current = !0;
448
+ }, [
449
+ i,
450
+ r,
451
+ l,
452
+ a,
453
+ o
454
+ ]), u(() => {
455
+ let e = b.current;
456
+ e !== null && (S(e), b.current = null);
457
+ }, [
458
+ S,
459
+ i,
460
+ r,
461
+ a,
462
+ c
463
+ ]), {
464
+ horizontalScrollRef: m,
465
+ scrollToX: S,
466
+ getScrollLeft: x,
467
+ handleHorizontalScroll: s(() => {
468
+ if (!v.current) return;
469
+ if (y.current) {
470
+ y.current = !1;
471
+ return;
472
+ }
473
+ if (_.current) {
474
+ _.current = !1;
475
+ return;
476
+ }
477
+ let { viewportWidth: e, zoomLevel: t, pxPerDay: n, startDate: r, totalWidth: i } = g.current;
478
+ if (e <= 0) return;
479
+ let a = x(), o = Math.max(0, i - e), s = e * he, c = a < s, l = a > o - s;
480
+ if (!c && !l) return;
481
+ _.current = !0, y.current = !0;
482
+ let u = G(a, e, r, n);
483
+ b.current = K(u, W(u, t, n, e).startDate, n, e), p(u);
484
+ }, [x, p]),
485
+ setZoomLevel: C,
486
+ handleTodayClick: w,
487
+ navigateToBar: s((e) => {
488
+ if (!e) return;
489
+ let t = m.current;
490
+ if (!t) return;
491
+ let { pxPerDay: n, startDate: r, viewportWidth: i, zoomLevel: a } = g.current, o = z(e, r, n) - i / 2, s = Math.max(0, t.scrollWidth - t.clientWidth);
492
+ if (o >= 0 && o <= s) {
493
+ S(o, Math.abs(o - t.scrollLeft) > i * 2 ? "auto" : "smooth");
494
+ return;
495
+ }
496
+ let c = K(e, W(e, a, n, i).startDate, n, i);
497
+ y.current = !0, b.current = c, p(e);
498
+ }, [S, p])
499
+ };
500
+ }
501
+ //#endregion
502
+ //#region src/components/Gantt/utils/color.ts
503
+ var _e = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, ve = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, ye = (e, t) => {
504
+ if (t < 0 || t > 1) return null;
505
+ let n = e.replace(_e, (e, t, n, r) => t + t + n + n + r + r), r = ve.exec(n);
506
+ return r ? `rgba(${parseInt(r[1], 16)}, ${parseInt(r[2], 16)}, ${parseInt(r[3], 16)}, ${t})` : null;
507
+ }, be = (e, t = 2.5) => {
508
+ if (!e) return "#121211";
509
+ let n, r, i;
510
+ if (e.startsWith("#")) {
511
+ let t = e.replace("#", ""), a = t.length === 3 ? [...t].map((e) => e + e) : [
512
+ t.slice(0, 2),
513
+ t.slice(2, 4),
514
+ t.slice(4, 6)
515
+ ];
516
+ [n, r, i] = a.map((e) => parseInt(e, 16));
517
+ } else {
518
+ let t = (e.match(/\d+/g) || []).map(Number);
519
+ [n, r, i] = t.slice(0, 3);
520
+ }
521
+ if (n === void 0 || r === void 0 || i === void 0 || Number.isNaN(n)) return "#121211";
522
+ let a = (e) => {
523
+ let t = e / 255;
524
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
525
+ };
526
+ return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
527
+ }, q = (e) => !e || !e.isValid() ? !1 : e.valueOf() !== e.startOf("day").valueOf(), xe = (e, t) => {
528
+ let n = e?.isValid() ? e : null, r = t?.isValid() ? t : null, i = n ? n.startOf("day") : null, a = r ? r.startOf("day").add(1, "day") : null;
529
+ return {
530
+ rawStart: n,
531
+ rawEnd: r,
532
+ baseStart: i,
533
+ baseEnd: a,
534
+ invalid: n !== null && r !== null && n.valueOf() > r.valueOf() || i === null || a === null || a.valueOf() <= i.valueOf()
535
+ };
536
+ }, Se = (e, t) => L(t) && (q(e.rawStart) || q(e.rawEnd)) ? {
537
+ start: e.rawStart,
538
+ end: e.rawEnd
539
+ } : {
540
+ start: e.baseStart,
541
+ end: e.baseEnd
542
+ }, Ce = (e) => e === void 0 ? 1 : Number.isFinite(e) ? e < 0 || e > 1 ? 1 : e : 0;
543
+ function we(e, t, n) {
544
+ let { startDate: r, pxPerDay: i, zoomLevel: a } = t, o = L(a) ? ne(a, i) : i, s = L(a) ? r : r.startOf("day");
545
+ return e.map((e, t) => {
546
+ let r = ie(e.startTime, n), c = ie(e.endTime, n), l = r.isValid(), u = c.isValid(), d = l ? r : null, f = u ? c : null, p = e.color || "#5170E8", m = ye(p, .2) || `${p}33`, h = Ce(e.progress), g = 0, _ = 0, v = !1;
547
+ if (d && f) {
548
+ let e = xe(d, f);
549
+ if (!e.invalid) {
550
+ let { start: t, end: n } = Se(e, a);
551
+ if (t && n) {
552
+ v = !0, g = z(t, s, i);
553
+ let e = z(n, s, i);
554
+ _ = Math.max(o, e - g);
555
+ }
556
+ }
557
+ }
558
+ return {
559
+ id: e.id,
560
+ label: e.label,
561
+ hasTimeRange: v,
562
+ left: g,
563
+ width: _,
564
+ color: p,
565
+ bgColor: m,
566
+ progress: h,
567
+ rowIndex: t,
568
+ startDate: d,
569
+ endDate: f,
570
+ task: e
571
+ };
572
+ });
573
+ }
574
+ //#endregion
575
+ //#region src/components/Gantt/utils/cx.ts
576
+ var J = (...e) => e.filter(Boolean).join(" ");
577
+ //#endregion
578
+ //#region src/components/Gantt/utils/calcTodayLeft.ts
579
+ function Y(e, t, n, r, i = "day") {
580
+ let a = r * n;
581
+ if (L(i)) {
582
+ let r = R(i), o = e.startOf("day"), s = e.diff(o, "millisecond"), c = Math.floor(s / r), l = o.add(c * r, "millisecond"), u = r / A / 2 * n, d = z(l, t, n) + u;
583
+ return d < 0 || d >= a ? null : d;
584
+ }
585
+ let o = z(e.startOf("day"), t.startOf("day"), n);
586
+ return o < 0 || o >= a ? null : o + n / 2;
587
+ }
588
+ //#endregion
589
+ //#region src/components/Gantt/utils/msUntilNextDay.ts
590
+ function Te(e) {
591
+ let t = B(e);
592
+ return t.add(1, "day").startOf("day").add(1, "millisecond").valueOf() - t.valueOf();
593
+ }
594
+ function Ee(e, t) {
595
+ if (t <= 0) return Te(e);
596
+ let n = B(e), r = n.startOf("day"), i = n.valueOf() - r.valueOf(), a = Math.floor(i / t), o = r.valueOf() + (a + 1) * t + 1;
597
+ return Math.max(1, o - n.valueOf());
598
+ }
599
+ //#endregion
600
+ //#region src/components/Gantt/hooks/useTodayTracker.ts
601
+ function X(e, t = "day") {
602
+ let [n, r] = p(() => B(e)), i = f(e);
603
+ i.current = e;
604
+ let a = f(t);
605
+ a.current = t;
606
+ let o = s(() => B(i.current), []);
607
+ return l(() => {
608
+ let e, t = () => {
609
+ let n = a.current, s = i.current, c = L(n) ? Ee(s, R(n)) : Te(s);
610
+ e = setTimeout(() => {
611
+ r(o()), t();
612
+ }, c);
613
+ };
614
+ r(o()), t();
615
+ let n = () => {
616
+ document.visibilityState === "visible" && (clearTimeout(e), r(o()), t());
617
+ };
618
+ return document.addEventListener("visibilitychange", n), () => {
619
+ clearTimeout(e), document.removeEventListener("visibilitychange", n);
620
+ };
621
+ }, [
622
+ o,
623
+ t,
624
+ e
625
+ ]), n;
626
+ }
627
+ //#endregion
628
+ //#region src/components/Gantt/StickyLabel.tsx
629
+ var De = ({ cell: e }) => /* @__PURE__ */ g("div", {
630
+ className: x["bsy-mobile-gantt__sticky-label"],
631
+ style: { width: e.widthPx },
632
+ children: /* @__PURE__ */ g("div", {
633
+ className: x["bsy-mobile-gantt__sticky-label-text"],
634
+ children: e.label
635
+ })
636
+ }), Oe = 34, ke = 8, Ae = 5, je = () => {
637
+ let { t: e } = r(), { zoomLevel: t, pxPerDay: n, timeZone: i, startDate: a, count: o, totalWidth: s, totalDays: c } = w(), { horizontalScrollRef: l } = T(), u = X(i, t), f = d(() => U(a, o, t, u, e), [
638
+ a,
639
+ o,
640
+ t,
641
+ u,
642
+ e
643
+ ]), p = d(() => de(f, t, n, e), [
644
+ f,
645
+ t,
646
+ n,
647
+ e
648
+ ]), m = d(() => Y(u, a, n, c, t), [
649
+ u,
650
+ a,
651
+ n,
652
+ c,
653
+ t
654
+ ]), h = d(() => f.map((e) => e.days * n), [f, n]), v = b({
655
+ count: f.length,
656
+ getScrollElement: () => l.current,
657
+ estimateSize: (e) => h[e],
658
+ horizontal: !0,
659
+ overscan: Ae
660
+ });
661
+ return /* @__PURE__ */ _("div", {
662
+ className: x["bsy-mobile-gantt__header"],
663
+ style: { width: s },
664
+ children: [
665
+ /* @__PURE__ */ g("div", {
666
+ className: x["bsy-mobile-gantt__header-row1"],
667
+ children: p.map((e) => /* @__PURE__ */ g(De, { cell: e }, `${e.label}-${e.startIndex}`))
668
+ }),
669
+ /* @__PURE__ */ g("div", {
670
+ className: x["bsy-mobile-gantt__header-row2"],
671
+ style: { height: Oe },
672
+ children: v.getVirtualItems().map((e) => {
673
+ let t = f[e.index], n = Math.round(e.start), r = Math.max(1, Math.round(e.size));
674
+ return /* @__PURE__ */ g("div", {
675
+ className: x["bsy-mobile-gantt__header-cell"],
676
+ style: {
677
+ left: n,
678
+ width: r,
679
+ height: "100%"
680
+ },
681
+ children: /* @__PURE__ */ g("div", {
682
+ className: J(x["bsy-mobile-gantt__header-cell-label"], t.isToday && x["bsy-mobile-gantt__header-cell-label--today"]),
683
+ style: { lineHeight: `${Oe}px` },
684
+ children: t.label
685
+ })
686
+ }, e.index);
687
+ })
688
+ }),
689
+ m === null ? null : /* @__PURE__ */ g("div", {
690
+ className: x["bsy-mobile-gantt__today-dot"],
691
+ style: { left: m - ke / 2 }
692
+ })
693
+ ]
694
+ });
695
+ }, Me = 2, Ne = ({ today: e, startDate: t, pxPerDay: n, totalDays: r, zoomLevel: i }) => {
696
+ let a = d(() => Y(e, t, n, r, i), [
697
+ e,
698
+ t,
699
+ n,
700
+ r,
701
+ i
702
+ ]);
703
+ return a === null ? null : /* @__PURE__ */ g("div", {
704
+ className: x["bsy-mobile-gantt__today-line"],
705
+ style: {
706
+ left: a - Me / 2,
707
+ width: Me
708
+ }
709
+ });
710
+ }, Pe = 26, Fe = 6, Z = 4;
711
+ function Ie(e, t, n, r) {
712
+ if (r > t - Z * 2) return "outside";
713
+ if (e < n) {
714
+ let i = e + t - n;
715
+ return r + Z > i ? "outside" : "overlay-sticky";
716
+ }
717
+ return "inside";
718
+ }
719
+ var Le = o(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, overlayHost: i, onClick: a }) => {
720
+ let o = e.progress > 0 ? Math.max(4, e.width * e.progress) : 0, s = be(e.bgColor), c = f(null), [l, d] = p(0);
721
+ return u(() => {
722
+ if (!c.current || !e.label) {
723
+ d(0);
724
+ return;
725
+ }
726
+ d(c.current.scrollWidth);
727
+ }, [e.label]), u(() => {
728
+ let a = c.current, o = n.current;
729
+ if (!a || !o || !e.label) return;
730
+ let u = document.createElement("span");
731
+ u.className = x["bsy-mobile-gantt__bar-label-overlay"], u.textContent = e.label, u.style.display = "none", u.style.color = s, i?.appendChild(u);
732
+ let d = () => {
733
+ let { scrollLeft: n } = o, i = Ie(e.left, e.width, n, l), c = i === "outside", d = i === "overlay-sticky", f = e.left + e.width - n;
734
+ d ? (a.style.visibility = "hidden", u.style.display = "block", u.style.top = `${t - (r.current?.scrollTop ?? 0)}px`, u.style.maxWidth = `${Math.max(0, f - Z * 2)}px`) : (a.style.visibility = "visible", u.style.display = "none", a.style.left = c ? `${e.width + Fe}px` : `${Z}px`, a.style.maxWidth = c ? "none" : `${e.width - Z * 2}px`, a.style.overflow = c ? "visible" : "hidden", a.style.textOverflow = c ? "clip" : "ellipsis", a.style.color = c ? "#000" : s);
735
+ };
736
+ d(), o.addEventListener("scroll", d, { passive: !0 });
737
+ let f = r.current;
738
+ return f?.addEventListener("scroll", d, { passive: !0 }), () => {
739
+ o.removeEventListener("scroll", d), f?.removeEventListener("scroll", d), u.remove();
740
+ };
741
+ }, [
742
+ e.label,
743
+ e.left,
744
+ e.width,
745
+ n,
746
+ s,
747
+ l,
748
+ i,
749
+ t,
750
+ r
751
+ ]), /* @__PURE__ */ _("div", {
752
+ className: x["bsy-mobile-gantt__bar"],
753
+ style: {
754
+ top: t,
755
+ left: e.left,
756
+ width: e.width,
757
+ height: Pe
758
+ },
759
+ onClick: () => a?.(e.task),
760
+ children: [
761
+ /* @__PURE__ */ g("div", {
762
+ className: x["bsy-mobile-gantt__bar-track"],
763
+ style: { backgroundColor: e.bgColor }
764
+ }),
765
+ o > 0 ? /* @__PURE__ */ g("div", {
766
+ className: x["bsy-mobile-gantt__bar-progress"],
767
+ style: {
768
+ width: o,
769
+ backgroundColor: e.color,
770
+ borderRadius: e.progress === 1 ? 4 : "4px 0 0 4px"
771
+ }
772
+ }) : null,
773
+ e.label ? /* @__PURE__ */ g("span", {
774
+ ref: c,
775
+ className: x["bsy-mobile-gantt__bar-label"],
776
+ style: {
777
+ left: Z,
778
+ maxWidth: e.width - Z * 2,
779
+ lineHeight: `${Pe}px`,
780
+ color: s
781
+ },
782
+ children: e.label
783
+ }) : null
784
+ ]
785
+ });
786
+ }), Re = o(({ direction: e, edge: t, offset: n, onClick: i }) => {
787
+ let { t: a } = r();
788
+ return /* @__PURE__ */ g("button", {
789
+ type: "button",
790
+ className: J(x["bsy-mobile-gantt__offscreen-arrow"], t === "right" && x["bsy-mobile-gantt__offscreen-arrow--right"]),
791
+ style: { [t]: n },
792
+ onClick: i,
793
+ "aria-label": a("gantt.locateTask"),
794
+ children: /* @__PURE__ */ g("svg", {
795
+ width: "16",
796
+ height: "16",
797
+ viewBox: "0 0 16 16",
798
+ "aria-hidden": "true",
799
+ children: e === "left" ? /* @__PURE__ */ g("path", {
800
+ d: "M10 12L6 8l4-4",
801
+ fill: "none",
802
+ stroke: "#666",
803
+ strokeWidth: "1.5"
804
+ }) : /* @__PURE__ */ g("path", {
805
+ d: "M6 4l4 4-4 4",
806
+ fill: "none",
807
+ stroke: "#666",
808
+ strokeWidth: "1.5"
809
+ })
810
+ })
811
+ });
812
+ }), ze = 24, Be = 4, Ve = o(({ virtualRows: e, bars: t, horizontalScrollRef: n, viewportWidth: r, rowHeight: i, onNavigate: a }) => {
813
+ let [o, s] = p(() => n.current?.scrollLeft ?? 0), c = f(0);
814
+ l(() => {
815
+ let e = n.current;
816
+ if (!e) return;
817
+ let t = () => {
818
+ cancelAnimationFrame(c.current), c.current = requestAnimationFrame(() => {
819
+ s(e.scrollLeft);
820
+ });
821
+ };
822
+ return e.addEventListener("scroll", t, { passive: !0 }), s(e.scrollLeft), () => {
823
+ e.removeEventListener("scroll", t), cancelAnimationFrame(c.current);
824
+ };
825
+ }, [n]);
826
+ let u = o + r;
827
+ return /* @__PURE__ */ g("div", {
828
+ className: x["bsy-mobile-gantt__offscreen"],
829
+ children: /* @__PURE__ */ g("div", {
830
+ className: x["bsy-mobile-gantt__offscreen-layer"],
831
+ children: e.map((e) => {
832
+ let n = t[e.index];
833
+ if (!n || !n.hasTimeRange) return null;
834
+ let r = n.left + n.width < o, s = n.left > u;
835
+ return !r && !s ? null : /* @__PURE__ */ _("div", {
836
+ className: x["bsy-mobile-gantt__offscreen-row"],
837
+ style: {
838
+ top: e.start + (i - ze) / 2,
839
+ height: ze
840
+ },
841
+ children: [r ? /* @__PURE__ */ g(Re, {
842
+ direction: "left",
843
+ edge: "left",
844
+ offset: Be,
845
+ onClick: () => a(n.startDate)
846
+ }) : null, s ? /* @__PURE__ */ g(Re, {
847
+ direction: "right",
848
+ edge: "right",
849
+ offset: Be,
850
+ onClick: () => a(n.startDate)
851
+ }) : null]
852
+ }, `overlay-${n.id}`);
853
+ })
854
+ })
855
+ });
856
+ }), He = 5, Ue = 5, Q = 28, We = 4, Ge = ({ bars: e, onTaskClick: t, overlayHostRef: n }) => {
857
+ let { zoomLevel: r, pxPerDay: i, timeZone: a, startDate: o, count: s, totalWidth: c, totalDays: u, viewportWidth: v } = w(), { horizontalScrollRef: y, navigateToBar: S } = T(), C = X(a, r), E = d(() => U(o, s, r, C), [
858
+ o,
859
+ s,
860
+ r,
861
+ C
862
+ ]), D = e.length, O = Math.max(D * Q + We, 0), k = f(null), A = d(() => E.map((e) => e.days * i), [E, i]), j = b({
863
+ count: E.length,
864
+ getScrollElement: () => y.current,
865
+ estimateSize: (e) => A[e],
866
+ horizontal: !0,
867
+ overscan: He
868
+ }), M = b({
869
+ count: D,
870
+ getScrollElement: () => k.current,
871
+ estimateSize: () => Q,
872
+ paddingStart: We,
873
+ overscan: Ue
874
+ }).getVirtualItems(), [N, P] = p(null);
875
+ return l(() => {
876
+ P(n?.current ?? null);
877
+ }, [n]), l(() => {
878
+ let e = k.current, t = N;
879
+ if (!e || !t) return;
880
+ let n = 0, r = () => {
881
+ n ||= window.requestAnimationFrame(() => {
882
+ t.style.setProperty("--gantt-overlay-translate-y", `${-e.scrollTop}px`), n = 0;
883
+ });
884
+ };
885
+ return t.style.setProperty("--gantt-overlay-translate-y", `${-e.scrollTop}px`), e.addEventListener("scroll", r, { passive: !0 }), () => {
886
+ e.removeEventListener("scroll", r), n && window.cancelAnimationFrame(n);
887
+ };
888
+ }, [N]), /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
889
+ ref: k,
890
+ className: x["bsy-mobile-gantt__timeline"],
891
+ style: { width: c },
892
+ children: /* @__PURE__ */ _("div", {
893
+ className: x["bsy-mobile-gantt__timeline-inner"],
894
+ style: {
895
+ width: c,
896
+ height: O || "100%"
897
+ },
898
+ children: [
899
+ j.getVirtualItems().map((e) => /* @__PURE__ */ g("div", {
900
+ className: J(x["bsy-mobile-gantt__column"], r === "day" && E[e.index]?.isWeekend && x["bsy-mobile-gantt__column--weekend"]),
901
+ style: {
902
+ width: e.size,
903
+ transform: `translateX(${e.start}px)`
904
+ }
905
+ }, e.index)),
906
+ /* @__PURE__ */ g(Ne, {
907
+ today: C,
908
+ startDate: o,
909
+ pxPerDay: i,
910
+ totalDays: u,
911
+ zoomLevel: r
912
+ }),
913
+ M.map((n) => {
914
+ let r = e[n.index];
915
+ return !r || !r.hasTimeRange ? null : /* @__PURE__ */ g(Le, {
916
+ bar: r,
917
+ top: n.start,
918
+ horizontalScrollRef: y,
919
+ verticalScrollRef: k,
920
+ overlayHost: N,
921
+ onClick: t
922
+ }, r.id);
923
+ })
924
+ ]
925
+ })
926
+ }), N ? m(/* @__PURE__ */ g(Ve, {
927
+ virtualRows: M,
928
+ bars: e,
929
+ horizontalScrollRef: y,
930
+ viewportWidth: v,
931
+ rowHeight: Q,
932
+ onNavigate: S
933
+ }), N) : null] });
934
+ }, $ = ({ direction: e }) => /* @__PURE__ */ g("svg", {
935
+ className: J(x["bsy-mobile-gantt__chevron"], e === "left" && x["bsy-mobile-gantt__chevron--left"], e === "right" && x["bsy-mobile-gantt__chevron--right"]),
936
+ width: "16",
937
+ height: "16",
938
+ viewBox: "0 0 16 16",
939
+ "aria-hidden": "true",
940
+ children: /* @__PURE__ */ g("path", {
941
+ d: "M4 6l4 4 4-4",
942
+ fill: "none",
943
+ stroke: "currentColor",
944
+ strokeWidth: "1.5"
945
+ })
946
+ }), Ke = () => {
947
+ let { t } = r(), { zoomLevel: n, viewportWidth: i, totalWidth: a } = w(), { setZoomLevel: o, getScrollLeft: c, scrollToX: l, handleTodayClick: u } = T(), [d, f] = p(!1), m = s(() => {
948
+ l(Math.max(0, c() - i), "smooth");
949
+ }, [
950
+ c,
951
+ l,
952
+ i
953
+ ]), v = s(() => {
954
+ let e = Math.max(0, a - i);
955
+ l(Math.min(c() + i, e), "smooth");
956
+ }, [
957
+ c,
958
+ l,
959
+ i,
960
+ a
961
+ ]);
962
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
963
+ className: x["bsy-mobile-gantt__toolbar"],
964
+ children: [
965
+ /* @__PURE__ */ _("button", {
966
+ type: "button",
967
+ className: x["bsy-mobile-gantt__toolbar-zoom"],
968
+ onClick: () => f(!0),
969
+ children: [/* @__PURE__ */ g("span", { children: t(`gantt.zoom.${n}`) }), /* @__PURE__ */ g($, { direction: "down" })]
970
+ }),
971
+ /* @__PURE__ */ g("div", { className: x["bsy-mobile-gantt__toolbar-divider"] }),
972
+ /* @__PURE__ */ g("button", {
973
+ type: "button",
974
+ className: x["bsy-mobile-gantt__toolbar-today"],
975
+ onClick: u,
976
+ children: t("gantt.today")
977
+ }),
978
+ /* @__PURE__ */ g("button", {
979
+ type: "button",
980
+ className: x["bsy-mobile-gantt__toolbar-nav"],
981
+ onClick: m,
982
+ "aria-label": t("gantt.prevScreen"),
983
+ children: /* @__PURE__ */ g($, { direction: "left" })
984
+ }),
985
+ /* @__PURE__ */ g("button", {
986
+ type: "button",
987
+ className: x["bsy-mobile-gantt__toolbar-nav"],
988
+ onClick: v,
989
+ "aria-label": t("gantt.nextScreen"),
990
+ children: /* @__PURE__ */ g($, { direction: "right" })
991
+ })
992
+ ]
993
+ }), /* @__PURE__ */ g(e, {
994
+ open: d,
995
+ onClose: () => f(!1),
996
+ title: t("gantt.zoomSheetTitle"),
997
+ actions: k.map((e) => ({
998
+ key: e,
999
+ text: t(`gantt.zoom.${e}`),
1000
+ selected: n === e
1001
+ })),
1002
+ onAction: (e) => {
1003
+ o(e.key), f(!1);
1004
+ }
1005
+ })] });
1006
+ }, qe = 88, Je = (e) => {
1007
+ let { tasks: t = [], timeZone: n, className: r, onTaskClick: i } = e, [a, o] = v(e, {
1008
+ defaultValue: "day",
1009
+ defaultValuePropName: "defaultZoomLevel",
1010
+ valuePropName: "zoomLevel",
1011
+ trigger: "onZoomChange"
1012
+ }), s = f(null), c = pe({
1013
+ timeZone: n,
1014
+ initialZoomLevel: a
1015
+ }), l = ge(c, { onZoomLevelChange: o }), u = d(() => we(t, {
1016
+ startDate: c.startDate,
1017
+ pxPerDay: c.pxPerDay,
1018
+ zoomLevel: c.zoomLevel
1019
+ }, n), [
1020
+ t,
1021
+ c.startDate,
1022
+ c.pxPerDay,
1023
+ c.zoomLevel,
1024
+ n
1025
+ ]), p = d(() => ({
1026
+ zoomLevel: c.zoomLevel,
1027
+ pxPerDay: c.pxPerDay,
1028
+ timeZone: n,
1029
+ viewportWidth: c.viewportWidth,
1030
+ anchorDate: c.anchorDate,
1031
+ startDate: c.startDate,
1032
+ count: c.count,
1033
+ totalDays: c.totalDays,
1034
+ totalWidth: c.totalWidth
1035
+ }), [
1036
+ c.zoomLevel,
1037
+ c.pxPerDay,
1038
+ n,
1039
+ c.viewportWidth,
1040
+ c.anchorDate,
1041
+ c.startDate,
1042
+ c.count,
1043
+ c.totalDays,
1044
+ c.totalWidth
1045
+ ]), m = d(() => ({
1046
+ setZoomLevel: l.setZoomLevel,
1047
+ horizontalScrollRef: l.horizontalScrollRef,
1048
+ scrollToX: l.scrollToX,
1049
+ getScrollLeft: l.getScrollLeft,
1050
+ handleTodayClick: l.handleTodayClick,
1051
+ navigateToBar: l.navigateToBar
1052
+ }), [
1053
+ l.setZoomLevel,
1054
+ l.horizontalScrollRef,
1055
+ l.scrollToX,
1056
+ l.getScrollLeft,
1057
+ l.handleTodayClick,
1058
+ l.navigateToBar
1059
+ ]);
1060
+ return /* @__PURE__ */ g(S.Provider, {
1061
+ value: p,
1062
+ children: /* @__PURE__ */ g(C.Provider, {
1063
+ value: m,
1064
+ children: /* @__PURE__ */ _("div", {
1065
+ ref: c.containerRef,
1066
+ className: J(x["bsy-mobile-gantt"], r),
1067
+ children: [
1068
+ /* @__PURE__ */ g("div", {
1069
+ ref: l.horizontalScrollRef,
1070
+ className: x["bsy-mobile-gantt__scroll"],
1071
+ onScroll: l.handleHorizontalScroll,
1072
+ children: /* @__PURE__ */ _("div", {
1073
+ className: x["bsy-mobile-gantt__canvas"],
1074
+ style: { width: c.totalWidth },
1075
+ children: [/* @__PURE__ */ g(je, {}), /* @__PURE__ */ g(Ge, {
1076
+ bars: u,
1077
+ onTaskClick: i,
1078
+ overlayHostRef: s
1079
+ })]
1080
+ })
1081
+ }),
1082
+ /* @__PURE__ */ g("div", {
1083
+ ref: s,
1084
+ className: x["bsy-mobile-gantt__overlay-host"],
1085
+ style: { top: qe }
1086
+ }),
1087
+ /* @__PURE__ */ g(Ke, {})
1088
+ ]
1089
+ })
1090
+ })
1091
+ });
1092
+ };
1093
+ //#endregion
1094
+ export { O as n, Je as t };