@baishuyun/ui-mobile 0.6.0 → 0.7.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.
- package/dist/AMap/{AMap-BWZ2lhXr.js → AMap-DwrSlwyV.js} +1 -1
- package/dist/AMap/index.js +2 -2
- package/dist/ActionSheet/index.js +1 -1
- package/dist/Calendar/{Calendar-Bd6CS8y7.js → Calendar-tYjpphMo.js} +610 -595
- package/dist/Calendar/{timeUtils-t4A3-Hr6.js → cssVars-UpgK6spf.js} +3 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/Gantt/{Gantt-CR7eRNVP.js → Gantt-D2ZGpS5p.js} +382 -377
- package/dist/Gantt/index.js +3 -3
- package/dist/Icon/index.js +1 -1
- package/dist/components/Calendar/context/CalendarContext.d.ts +1 -3
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Calendar/interface.d.ts +23 -2
- package/dist/components/Calendar/utils/colorUtils.d.ts +1 -2
- package/dist/components/Calendar/utils/index.d.ts +2 -1
- package/dist/components/Calendar/utils/theme/index.d.ts +1 -0
- package/dist/components/Calendar/utils/theme/resolveCalendarThemeVars.d.ts +4 -0
- package/dist/components/Gantt/index.d.ts +1 -1
- package/dist/components/Gantt/interface.d.ts +16 -0
- package/dist/components/Gantt/utils/theme/index.d.ts +1 -0
- package/dist/components/Gantt/utils/theme/resolveGanttThemeVars.d.ts +3 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/utils/cssVars.d.ts +1 -0
- package/dist/vendors/{version-qi3OapTz.js → version-Dg7dOJFj.js} +1 -1
- package/package.json +1 -1
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
import { t as e } from "../ActionSheet/ActionSheet-DbrKxa_y.js";
|
|
2
2
|
import { a as t, i as n, t as r } from "../ConfigProvider/useLocale-CP8NRZoj.js";
|
|
3
|
-
import {
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
import
|
|
9
|
-
import { useVirtualizer as
|
|
3
|
+
import { i, t as a } from "../Calendar/cssVars-UpgK6spf.js";
|
|
4
|
+
import { createContext as o, memo as s, useCallback as c, useContext as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
5
|
+
import { createPortal as h } from "react-dom";
|
|
6
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
+
import { useControllableValue as y } from "ahooks";
|
|
8
|
+
import b from "dayjs";
|
|
9
|
+
import { useVirtualizer as x } from "@tanstack/react-virtual";
|
|
10
10
|
//#region src/components/Gantt/Gantt.module.scss
|
|
11
|
-
var
|
|
12
|
-
"bsy-mobile-gantt": "_bsy-mobile-
|
|
13
|
-
"bsy-mobile-gantt__scroll": "_bsy-mobile-
|
|
14
|
-
"bsy-mobile-gantt__canvas": "_bsy-mobile-
|
|
15
|
-
"bsy-mobile-gantt__overlay-host": "_bsy-mobile-gantt__overlay-
|
|
16
|
-
"bsy-mobile-gantt__header": "_bsy-mobile-
|
|
17
|
-
"bsy-mobile-gantt__header-row1": "_bsy-mobile-gantt__header-
|
|
18
|
-
"bsy-mobile-gantt__header-row2": "_bsy-mobile-gantt__header-
|
|
19
|
-
"bsy-mobile-gantt__header-cell": "_bsy-mobile-gantt__header-
|
|
20
|
-
"bsy-mobile-gantt__header-cell-label": "_bsy-mobile-gantt__header-cell-
|
|
21
|
-
"bsy-mobile-gantt__header-cell-label--today": "_bsy-mobile-gantt__header-cell-label--
|
|
22
|
-
"bsy-mobile-gantt__today-dot": "_bsy-mobile-gantt__today-
|
|
23
|
-
"bsy-mobile-gantt__sticky-label": "_bsy-mobile-gantt__sticky-
|
|
24
|
-
"bsy-mobile-gantt__sticky-label-text": "_bsy-mobile-gantt__sticky-label-
|
|
25
|
-
"bsy-mobile-gantt__toolbar": "_bsy-mobile-
|
|
26
|
-
"bsy-mobile-gantt__toolbar-zoom": "_bsy-mobile-gantt__toolbar-
|
|
27
|
-
"bsy-mobile-gantt__toolbar-today": "_bsy-mobile-gantt__toolbar-
|
|
28
|
-
"bsy-mobile-gantt__toolbar-nav": "_bsy-mobile-gantt__toolbar-
|
|
29
|
-
"bsy-mobile-gantt__toolbar-divider": "_bsy-mobile-gantt__toolbar-
|
|
30
|
-
"bsy-mobile-gantt__chevron": "_bsy-mobile-
|
|
31
|
-
"bsy-mobile-gantt__chevron--left": "_bsy-mobile-gantt__chevron--
|
|
32
|
-
"bsy-mobile-gantt__chevron--right": "_bsy-mobile-gantt__chevron--
|
|
33
|
-
"bsy-mobile-gantt__timeline": "_bsy-mobile-
|
|
34
|
-
"bsy-mobile-gantt__timeline-inner": "_bsy-mobile-gantt__timeline-
|
|
35
|
-
"bsy-mobile-gantt__column": "_bsy-mobile-
|
|
36
|
-
"bsy-mobile-gantt__column--weekend": "_bsy-mobile-gantt__column--
|
|
37
|
-
"bsy-mobile-gantt__today-line": "_bsy-mobile-gantt__today-
|
|
38
|
-
"bsy-mobile-gantt__bar": "_bsy-mobile-
|
|
39
|
-
"bsy-mobile-gantt__bar-track": "_bsy-mobile-gantt__bar-
|
|
40
|
-
"bsy-mobile-gantt__bar-progress": "_bsy-mobile-gantt__bar-
|
|
41
|
-
"bsy-mobile-gantt__bar-label": "_bsy-mobile-gantt__bar-
|
|
42
|
-
"bsy-mobile-gantt__bar-label-overlay": "_bsy-mobile-gantt__bar-label-
|
|
43
|
-
"bsy-mobile-gantt__offscreen": "_bsy-mobile-
|
|
44
|
-
"bsy-mobile-gantt__offscreen-layer": "_bsy-mobile-gantt__offscreen-
|
|
45
|
-
"bsy-mobile-gantt__offscreen-row": "_bsy-mobile-gantt__offscreen-
|
|
46
|
-
"bsy-mobile-gantt__offscreen-arrow": "_bsy-mobile-gantt__offscreen-
|
|
47
|
-
"bsy-mobile-gantt-arrow-enter": "_bsy-mobile-gantt-arrow-
|
|
48
|
-
"bsy-mobile-gantt__offscreen-arrow--right": "_bsy-mobile-gantt__offscreen-arrow--
|
|
49
|
-
},
|
|
50
|
-
let e =
|
|
11
|
+
var S = {
|
|
12
|
+
"bsy-mobile-gantt": "_bsy-mobile-gantt_1gpx8_1",
|
|
13
|
+
"bsy-mobile-gantt__scroll": "_bsy-mobile-gantt__scroll_1gpx8_18",
|
|
14
|
+
"bsy-mobile-gantt__canvas": "_bsy-mobile-gantt__canvas_1gpx8_28",
|
|
15
|
+
"bsy-mobile-gantt__overlay-host": "_bsy-mobile-gantt__overlay-host_1gpx8_34",
|
|
16
|
+
"bsy-mobile-gantt__header": "_bsy-mobile-gantt__header_1gpx8_43",
|
|
17
|
+
"bsy-mobile-gantt__header-row1": "_bsy-mobile-gantt__header-row1_1gpx8_50",
|
|
18
|
+
"bsy-mobile-gantt__header-row2": "_bsy-mobile-gantt__header-row2_1gpx8_54",
|
|
19
|
+
"bsy-mobile-gantt__header-cell": "_bsy-mobile-gantt__header-cell_1gpx8_57",
|
|
20
|
+
"bsy-mobile-gantt__header-cell-label": "_bsy-mobile-gantt__header-cell-label_1gpx8_62",
|
|
21
|
+
"bsy-mobile-gantt__header-cell-label--today": "_bsy-mobile-gantt__header-cell-label--today_1gpx8_73",
|
|
22
|
+
"bsy-mobile-gantt__today-dot": "_bsy-mobile-gantt__today-dot_1gpx8_77",
|
|
23
|
+
"bsy-mobile-gantt__sticky-label": "_bsy-mobile-gantt__sticky-label_1gpx8_87",
|
|
24
|
+
"bsy-mobile-gantt__sticky-label-text": "_bsy-mobile-gantt__sticky-label-text_1gpx8_95",
|
|
25
|
+
"bsy-mobile-gantt__toolbar": "_bsy-mobile-gantt__toolbar_1gpx8_102",
|
|
26
|
+
"bsy-mobile-gantt__toolbar-zoom": "_bsy-mobile-gantt__toolbar-zoom_1gpx8_119",
|
|
27
|
+
"bsy-mobile-gantt__toolbar-today": "_bsy-mobile-gantt__toolbar-today_1gpx8_119",
|
|
28
|
+
"bsy-mobile-gantt__toolbar-nav": "_bsy-mobile-gantt__toolbar-nav_1gpx8_119",
|
|
29
|
+
"bsy-mobile-gantt__toolbar-divider": "_bsy-mobile-gantt__toolbar-divider_1gpx8_137",
|
|
30
|
+
"bsy-mobile-gantt__chevron": "_bsy-mobile-gantt__chevron_1gpx8_166",
|
|
31
|
+
"bsy-mobile-gantt__chevron--left": "_bsy-mobile-gantt__chevron--left_1gpx8_170",
|
|
32
|
+
"bsy-mobile-gantt__chevron--right": "_bsy-mobile-gantt__chevron--right_1gpx8_173",
|
|
33
|
+
"bsy-mobile-gantt__timeline": "_bsy-mobile-gantt__timeline_1gpx8_176",
|
|
34
|
+
"bsy-mobile-gantt__timeline-inner": "_bsy-mobile-gantt__timeline-inner_1gpx8_187",
|
|
35
|
+
"bsy-mobile-gantt__column": "_bsy-mobile-gantt__column_1gpx8_191",
|
|
36
|
+
"bsy-mobile-gantt__column--weekend": "_bsy-mobile-gantt__column--weekend_1gpx8_202",
|
|
37
|
+
"bsy-mobile-gantt__today-line": "_bsy-mobile-gantt__today-line_1gpx8_205",
|
|
38
|
+
"bsy-mobile-gantt__bar": "_bsy-mobile-gantt__bar_1gpx8_213",
|
|
39
|
+
"bsy-mobile-gantt__bar-track": "_bsy-mobile-gantt__bar-track_1gpx8_220",
|
|
40
|
+
"bsy-mobile-gantt__bar-progress": "_bsy-mobile-gantt__bar-progress_1gpx8_220",
|
|
41
|
+
"bsy-mobile-gantt__bar-label": "_bsy-mobile-gantt__bar-label_1gpx8_230",
|
|
42
|
+
"bsy-mobile-gantt__bar-label-overlay": "_bsy-mobile-gantt__bar-label-overlay_1gpx8_240",
|
|
43
|
+
"bsy-mobile-gantt__offscreen": "_bsy-mobile-gantt__offscreen_1gpx8_252",
|
|
44
|
+
"bsy-mobile-gantt__offscreen-layer": "_bsy-mobile-gantt__offscreen-layer_1gpx8_261",
|
|
45
|
+
"bsy-mobile-gantt__offscreen-row": "_bsy-mobile-gantt__offscreen-row_1gpx8_271",
|
|
46
|
+
"bsy-mobile-gantt__offscreen-arrow": "_bsy-mobile-gantt__offscreen-arrow_1gpx8_279",
|
|
47
|
+
"bsy-mobile-gantt-arrow-enter": "_bsy-mobile-gantt-arrow-enter_1gpx8_1",
|
|
48
|
+
"bsy-mobile-gantt__offscreen-arrow--right": "_bsy-mobile-gantt__offscreen-arrow--right_1gpx8_300"
|
|
49
|
+
}, C = o(null), w = o(null), T = () => {
|
|
50
|
+
let e = l(C);
|
|
51
51
|
if (!e) throw Error("useGanttState must be used within a GanttStateContext.Provider");
|
|
52
52
|
return e;
|
|
53
|
-
},
|
|
54
|
-
let e =
|
|
53
|
+
}, E = () => {
|
|
54
|
+
let e = l(w);
|
|
55
55
|
if (!e) throw Error("useGanttAction must be used within a GanttActionContext.Provider");
|
|
56
56
|
return e;
|
|
57
|
-
},
|
|
57
|
+
}, D = [
|
|
58
58
|
"day",
|
|
59
59
|
"week",
|
|
60
60
|
"month",
|
|
61
61
|
"quarter",
|
|
62
62
|
"quarterMonth",
|
|
63
63
|
"year"
|
|
64
|
-
],
|
|
64
|
+
], O = [
|
|
65
65
|
"halfDay",
|
|
66
66
|
"sixHour",
|
|
67
67
|
"hour",
|
|
68
68
|
"halfHour",
|
|
69
69
|
"tenMinute",
|
|
70
70
|
"oneMinute"
|
|
71
|
-
],
|
|
71
|
+
], k = [...D, ...O];
|
|
72
72
|
t.gantt.zoom;
|
|
73
|
-
var
|
|
73
|
+
var ee = [...[...O].reverse(), ...D], A = 1440 * 60 * 1e3, j = A / 24, M = j / 60, N = {
|
|
74
74
|
halfDay: 12 * j,
|
|
75
75
|
sixHour: 6 * j,
|
|
76
76
|
hour: j,
|
|
77
77
|
halfHour: 30 * M,
|
|
78
78
|
tenMinute: 10 * M,
|
|
79
79
|
oneMinute: M
|
|
80
|
-
},
|
|
80
|
+
}, te = {
|
|
81
81
|
halfDay: 80,
|
|
82
82
|
sixHour: 70,
|
|
83
83
|
hour: 50,
|
|
84
84
|
halfHour: 45,
|
|
85
85
|
tenMinute: 40,
|
|
86
86
|
oneMinute: 40
|
|
87
|
-
},
|
|
88
|
-
function
|
|
89
|
-
return (e === "tenMinute" || e === "oneMinute" ? 30 : Math.round(
|
|
87
|
+
}, ne = 30 / 40;
|
|
88
|
+
function P(e) {
|
|
89
|
+
return (e === "tenMinute" || e === "oneMinute" ? 30 : Math.round(te[e] * ne)) * (A / N[e]);
|
|
90
90
|
}
|
|
91
|
-
var
|
|
91
|
+
var F = {
|
|
92
92
|
day: 30,
|
|
93
93
|
week: 18,
|
|
94
94
|
month: 6.5,
|
|
95
95
|
quarter: 2.2,
|
|
96
96
|
quarterMonth: 100 / 30,
|
|
97
97
|
year: 1.1,
|
|
98
|
-
halfDay:
|
|
99
|
-
sixHour:
|
|
100
|
-
hour:
|
|
101
|
-
halfHour:
|
|
102
|
-
tenMinute:
|
|
103
|
-
oneMinute:
|
|
104
|
-
},
|
|
98
|
+
halfDay: P("halfDay"),
|
|
99
|
+
sixHour: P("sixHour"),
|
|
100
|
+
hour: P("hour"),
|
|
101
|
+
halfHour: P("halfHour"),
|
|
102
|
+
tenMinute: P("tenMinute"),
|
|
103
|
+
oneMinute: P("oneMinute")
|
|
104
|
+
}, re = {
|
|
105
105
|
halfDay: 30,
|
|
106
106
|
sixHour: 14,
|
|
107
107
|
hour: 7,
|
|
@@ -109,34 +109,34 @@ var I = {
|
|
|
109
109
|
tenMinute: 2,
|
|
110
110
|
oneMinute: 0
|
|
111
111
|
};
|
|
112
|
-
function
|
|
113
|
-
return
|
|
112
|
+
function I(e) {
|
|
113
|
+
return O.includes(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function L(e) {
|
|
116
|
+
return I(e) ? N[e] : A;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
return t * (
|
|
118
|
+
function ie(e, t) {
|
|
119
|
+
return t * (L(e) / A);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function R(e, t, n) {
|
|
122
122
|
return (e.valueOf() - t.valueOf()) / A * n;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function ae(e, t, n) {
|
|
125
125
|
let r = e / n * A;
|
|
126
126
|
return t.add(r, "millisecond");
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/components/Gantt/utils/time.ts
|
|
130
|
-
var
|
|
130
|
+
var z = (e) => e ? b().tz(e) : b(), oe = (e, t) => i(e, t), se = (e, r) => n(t, e, r), B = (e) => `calendar.monthShort.${e}`, V = (e) => `gantt.quarter.${e + 1}`, ce = new Set([
|
|
131
131
|
"halfDay",
|
|
132
132
|
"sixHour",
|
|
133
133
|
"hour"
|
|
134
|
-
]),
|
|
134
|
+
]), le = new Set([
|
|
135
135
|
"halfHour",
|
|
136
136
|
"tenMinute",
|
|
137
137
|
"oneMinute"
|
|
138
138
|
]);
|
|
139
|
-
function
|
|
139
|
+
function ue(e, t, n) {
|
|
140
140
|
switch (t) {
|
|
141
141
|
case "halfDay": return e.hour() < 12 ? n("gantt.am") : n("gantt.pm");
|
|
142
142
|
case "sixHour": {
|
|
@@ -153,7 +153,7 @@ function ce(e, t, n) {
|
|
|
153
153
|
default: return e.format("HH:mm");
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function de(e, t) {
|
|
157
157
|
let n = e.hour();
|
|
158
158
|
if (n === 0) {
|
|
159
159
|
let r = e.month() + 1;
|
|
@@ -161,12 +161,12 @@ function le(e, t) {
|
|
|
161
161
|
month: r,
|
|
162
162
|
day: e.date(),
|
|
163
163
|
hour: n,
|
|
164
|
-
monthShort: t(
|
|
164
|
+
monthShort: t(B(r))
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
return t("gantt.hour", { hour: n });
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function fe(e, t) {
|
|
170
170
|
switch (t) {
|
|
171
171
|
case "halfDay": return e.add(12, "hour");
|
|
172
172
|
case "sixHour": return e.add(6, "hour");
|
|
@@ -177,26 +177,26 @@ function ue(e, t) {
|
|
|
177
177
|
default: return e.add(1, "hour");
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function pe(e, t, n, r = se) {
|
|
181
181
|
let i = [], a = "", o = null;
|
|
182
182
|
return e.forEach((e, s) => {
|
|
183
183
|
let c, l, u = e.date.year(), d = e.date.month() + 1;
|
|
184
|
-
if (
|
|
184
|
+
if (ce.has(t)) c = e.date.format("YYYY-MM-DD"), l = r("gantt.yearMonthDay", {
|
|
185
185
|
year: u,
|
|
186
186
|
month: d,
|
|
187
187
|
day: e.date.date(),
|
|
188
|
-
monthShort: r(
|
|
188
|
+
monthShort: r(B(d))
|
|
189
189
|
});
|
|
190
|
-
else if (
|
|
190
|
+
else if (le.has(t)) c = e.date.format("YYYY-MM-DD-HH"), l = de(e.date, r);
|
|
191
191
|
else if (t === "day" || t === "week") c = e.date.format("YYYY-MM"), l = r("calendar.yearMonth", {
|
|
192
192
|
year: u,
|
|
193
|
-
monthShort: r(
|
|
193
|
+
monthShort: r(B(d))
|
|
194
194
|
});
|
|
195
195
|
else if (t === "quarterMonth") {
|
|
196
196
|
let t = Math.floor(e.date.month() / 3);
|
|
197
197
|
c = `${u}-Q${t + 1}`, l = r("gantt.yearQuarter", {
|
|
198
198
|
year: u,
|
|
199
|
-
quarter: r(
|
|
199
|
+
quarter: r(V(t))
|
|
200
200
|
});
|
|
201
201
|
} else c = e.date.format("YYYY"), l = r("gantt.year", { year: u });
|
|
202
202
|
c === a ? o && (o.span++, o.widthPx += e.days * n) : (o && i.push(o), a = c, o = {
|
|
@@ -207,14 +207,14 @@ function de(e, t, n, r = ae) {
|
|
|
207
207
|
});
|
|
208
208
|
}), o && i.push(o), i;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function me(e, t, n, r, i = se) {
|
|
211
211
|
let a = [];
|
|
212
|
-
if (
|
|
212
|
+
if (I(n)) {
|
|
213
213
|
let o = N[n] / A, s = e;
|
|
214
214
|
for (let e = 0; e < t; e++) {
|
|
215
|
-
let e = s, t =
|
|
215
|
+
let e = s, t = fe(e, n), c = !r.isBefore(e) && r.isBefore(t);
|
|
216
216
|
a.push({
|
|
217
|
-
label:
|
|
217
|
+
label: ue(e, n, i),
|
|
218
218
|
isToday: c,
|
|
219
219
|
isWeekend: !1,
|
|
220
220
|
date: e,
|
|
@@ -238,12 +238,12 @@ function U(e, t, n, r, i = ae) {
|
|
|
238
238
|
}
|
|
239
239
|
case "month":
|
|
240
240
|
case "quarterMonth":
|
|
241
|
-
t = e.add(o, "month").startOf("month"), s = t.add(1, "month"), c = i(
|
|
241
|
+
t = e.add(o, "month").startOf("month"), s = t.add(1, "month"), c = i(B(t.month() + 1)), l = r.month() === t.month() && r.year() === t.year();
|
|
242
242
|
break;
|
|
243
243
|
case "quarter": {
|
|
244
244
|
t = e.add(o * 3, "month").startOf("month"), s = t.add(3, "month");
|
|
245
245
|
let n = Math.floor(t.month() / 3);
|
|
246
|
-
c = i(
|
|
246
|
+
c = i(V(n)), l = Math.floor(r.month() / 3) === n && r.year() === t.year();
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
249
249
|
case "year": {
|
|
@@ -267,21 +267,21 @@ function U(e, t, n, r, i = ae) {
|
|
|
267
267
|
}
|
|
268
268
|
return a;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function he(e, t) {
|
|
271
271
|
if (t === "oneMinute") return {
|
|
272
272
|
startDate: e.subtract(12, "hour").startOf("minute"),
|
|
273
273
|
count: 1440,
|
|
274
274
|
totalDays: 1
|
|
275
275
|
};
|
|
276
|
-
let n =
|
|
276
|
+
let n = re[t], r = L(t), i = e.startOf("day").subtract(n, "day"), a = e.startOf("day").add(n + 1, "day").diff(i, "day", !0);
|
|
277
277
|
return {
|
|
278
278
|
startDate: i,
|
|
279
279
|
count: Math.max(1, Math.round(a * A / r)),
|
|
280
280
|
totalDays: a
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
283
|
+
function H(e, t, n, r, i = 30) {
|
|
284
|
+
if (I(t)) return he(e, t);
|
|
285
285
|
let a = Math.ceil((r > 0 ? r : 375) / n) * (1 + i * 2), o = Math.floor(a / 2), s, c;
|
|
286
286
|
switch (t) {
|
|
287
287
|
case "day":
|
|
@@ -342,14 +342,14 @@ function W(e, t, n, r, i = 30) {
|
|
|
342
342
|
}
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region src/components/Gantt/hooks/useGanttViewport.ts
|
|
345
|
-
function
|
|
346
|
-
let n = t, [r, i] =
|
|
345
|
+
function ge({ timeZone: e, initialZoomLevel: t = "day" }) {
|
|
346
|
+
let n = t, [r, i] = m(() => z(e)), a = p(null), [o, s] = m(0), c = F[n], { startDate: l, count: d, totalDays: h } = f(() => H(r, n, c, o), [
|
|
347
347
|
r,
|
|
348
348
|
n,
|
|
349
349
|
c,
|
|
350
350
|
o
|
|
351
351
|
]), g = h * c;
|
|
352
|
-
return
|
|
352
|
+
return u(() => {
|
|
353
353
|
let e = a.current;
|
|
354
354
|
if (!e) return;
|
|
355
355
|
let t = new ResizeObserver((e) => {
|
|
@@ -363,8 +363,8 @@ function pe({ timeZone: e, initialZoomLevel: t = "day" }) {
|
|
|
363
363
|
anchorDate: r,
|
|
364
364
|
containerRef: a,
|
|
365
365
|
viewportWidth: o,
|
|
366
|
-
startDate:
|
|
367
|
-
count:
|
|
366
|
+
startDate: l,
|
|
367
|
+
count: d,
|
|
368
368
|
totalDays: h,
|
|
369
369
|
totalWidth: g,
|
|
370
370
|
setAnchorDate: i
|
|
@@ -372,49 +372,49 @@ function pe({ timeZone: e, initialZoomLevel: t = "day" }) {
|
|
|
372
372
|
}
|
|
373
373
|
//#endregion
|
|
374
374
|
//#region src/components/Gantt/utils/viewportDateUtils.ts
|
|
375
|
-
function
|
|
376
|
-
return
|
|
375
|
+
function _e(e, t, n, r) {
|
|
376
|
+
return ae(e + t / 2, n, r);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
let i =
|
|
378
|
+
function U(e, t, n, r) {
|
|
379
|
+
let i = R(e, t, n);
|
|
380
380
|
return Math.max(0, i - r / 2);
|
|
381
381
|
}
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region src/components/Gantt/utils/zoomReanchor.ts
|
|
384
|
-
function
|
|
385
|
-
let a =
|
|
384
|
+
function ve({ currentZoomLevel: e, nextZoomLevel: t, currentAnchorDate: n, currentScrollLeft: r, viewportWidth: i }) {
|
|
385
|
+
let a = F[e], o = _e(r, i, H(n, e, a, i).startDate, a), s = F[t];
|
|
386
386
|
return {
|
|
387
387
|
anchorDate: o,
|
|
388
|
-
scrollLeft:
|
|
388
|
+
scrollLeft: U(o, H(o, t, s, i).startDate, s, i)
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/components/Gantt/hooks/useGanttScroll.ts
|
|
393
|
-
var
|
|
394
|
-
function
|
|
395
|
-
let { timeZone: n, zoomLevel: r, anchorDate: i, viewportWidth: a, startDate: o, totalWidth:
|
|
393
|
+
var ye = 2;
|
|
394
|
+
function be(e, { onZoomLevelChange: t }) {
|
|
395
|
+
let { timeZone: n, zoomLevel: r, anchorDate: i, viewportWidth: a, startDate: o, totalWidth: s, pxPerDay: l, totalDays: u, setAnchorDate: f } = e, m = p(null), h = p(t);
|
|
396
396
|
h.current = t;
|
|
397
|
-
let g =
|
|
397
|
+
let g = p({
|
|
398
398
|
zoomLevel: r,
|
|
399
399
|
anchorDate: i,
|
|
400
400
|
viewportWidth: a,
|
|
401
401
|
startDate: o,
|
|
402
|
-
totalWidth:
|
|
402
|
+
totalWidth: s,
|
|
403
403
|
pxPerDay: l,
|
|
404
|
-
totalDays:
|
|
404
|
+
totalDays: u
|
|
405
405
|
});
|
|
406
|
-
|
|
406
|
+
d(() => {
|
|
407
407
|
g.current = {
|
|
408
408
|
zoomLevel: r,
|
|
409
409
|
anchorDate: i,
|
|
410
410
|
viewportWidth: a,
|
|
411
411
|
startDate: o,
|
|
412
|
-
totalWidth:
|
|
412
|
+
totalWidth: s,
|
|
413
413
|
pxPerDay: l,
|
|
414
|
-
totalDays:
|
|
414
|
+
totalDays: u
|
|
415
415
|
};
|
|
416
416
|
});
|
|
417
|
-
let _ =
|
|
417
|
+
let _ = p(!1), v = p(!1), y = p(!1), b = p(null), x = c(() => m.current?.scrollLeft ?? 0, []), S = c((e, t = "auto") => {
|
|
418
418
|
let n = m.current;
|
|
419
419
|
if (!n) return;
|
|
420
420
|
let r = Math.max(0, n.scrollWidth - n.clientWidth), i = Math.max(0, Math.min(e, r));
|
|
@@ -422,28 +422,28 @@ function ge(e, { onZoomLevelChange: t }) {
|
|
|
422
422
|
left: i,
|
|
423
423
|
behavior: t
|
|
424
424
|
});
|
|
425
|
-
}, []), C =
|
|
425
|
+
}, []), C = c((e) => {
|
|
426
426
|
let { zoomLevel: t, anchorDate: n, viewportWidth: r } = g.current;
|
|
427
427
|
if (e === t) return;
|
|
428
428
|
if (r <= 0) {
|
|
429
429
|
h.current(e);
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
let { anchorDate: i, scrollLeft: a } =
|
|
432
|
+
let { anchorDate: i, scrollLeft: a } = ve({
|
|
433
433
|
currentZoomLevel: t,
|
|
434
434
|
nextZoomLevel: e,
|
|
435
435
|
currentAnchorDate: n,
|
|
436
436
|
currentScrollLeft: m.current?.scrollLeft ?? 0,
|
|
437
437
|
viewportWidth: r
|
|
438
438
|
});
|
|
439
|
-
|
|
440
|
-
}, [
|
|
441
|
-
let { zoomLevel: e, pxPerDay: t, viewportWidth: r } = g.current, i =
|
|
442
|
-
y.current = !0, b.current = a,
|
|
443
|
-
}, [n,
|
|
444
|
-
return
|
|
439
|
+
f(i), h.current(e), y.current = !0, b.current = a;
|
|
440
|
+
}, [f]), w = c(() => {
|
|
441
|
+
let { zoomLevel: e, pxPerDay: t, viewportWidth: r } = g.current, i = z(n), a = U(i, H(i, e, t, r).startDate, t, r);
|
|
442
|
+
y.current = !0, b.current = a, f(i);
|
|
443
|
+
}, [n, f]);
|
|
444
|
+
return d(() => {
|
|
445
445
|
if (a <= 0 || v.current) return;
|
|
446
|
-
let e =
|
|
446
|
+
let e = U(i, o, l, a);
|
|
447
447
|
y.current = !0, b.current = e, v.current = !0;
|
|
448
448
|
}, [
|
|
449
449
|
i,
|
|
@@ -451,7 +451,7 @@ function ge(e, { onZoomLevelChange: t }) {
|
|
|
451
451
|
l,
|
|
452
452
|
a,
|
|
453
453
|
o
|
|
454
|
-
]),
|
|
454
|
+
]), d(() => {
|
|
455
455
|
let e = b.current;
|
|
456
456
|
e !== null && (S(e), b.current = null);
|
|
457
457
|
}, [
|
|
@@ -459,12 +459,12 @@ function ge(e, { onZoomLevelChange: t }) {
|
|
|
459
459
|
i,
|
|
460
460
|
r,
|
|
461
461
|
a,
|
|
462
|
-
|
|
462
|
+
s
|
|
463
463
|
]), {
|
|
464
464
|
horizontalScrollRef: m,
|
|
465
465
|
scrollToX: S,
|
|
466
466
|
getScrollLeft: x,
|
|
467
|
-
handleHorizontalScroll:
|
|
467
|
+
handleHorizontalScroll: c(() => {
|
|
468
468
|
if (!v.current) return;
|
|
469
469
|
if (y.current) {
|
|
470
470
|
y.current = !1;
|
|
@@ -476,35 +476,35 @@ function ge(e, { onZoomLevelChange: t }) {
|
|
|
476
476
|
}
|
|
477
477
|
let { viewportWidth: e, zoomLevel: t, pxPerDay: n, startDate: r, totalWidth: i } = g.current;
|
|
478
478
|
if (e <= 0) return;
|
|
479
|
-
let a = x(), o = Math.max(0, i - e), s = e *
|
|
479
|
+
let a = x(), o = Math.max(0, i - e), s = e * ye, c = a < s, l = a > o - s;
|
|
480
480
|
if (!c && !l) return;
|
|
481
481
|
_.current = !0, y.current = !0;
|
|
482
|
-
let u =
|
|
483
|
-
b.current =
|
|
484
|
-
}, [x,
|
|
482
|
+
let u = _e(a, e, r, n);
|
|
483
|
+
b.current = U(u, H(u, t, n, e).startDate, n, e), f(u);
|
|
484
|
+
}, [x, f]),
|
|
485
485
|
setZoomLevel: C,
|
|
486
486
|
handleTodayClick: w,
|
|
487
|
-
navigateToBar:
|
|
487
|
+
navigateToBar: c((e) => {
|
|
488
488
|
if (!e) return;
|
|
489
489
|
let t = m.current;
|
|
490
490
|
if (!t) return;
|
|
491
|
-
let { pxPerDay: n, startDate: r, viewportWidth: i, zoomLevel: a } = g.current, o =
|
|
491
|
+
let { pxPerDay: n, startDate: r, viewportWidth: i, zoomLevel: a } = g.current, o = R(e, r, n) - i / 2, s = Math.max(0, t.scrollWidth - t.clientWidth);
|
|
492
492
|
if (o >= 0 && o <= s) {
|
|
493
493
|
S(o, Math.abs(o - t.scrollLeft) > i * 2 ? "auto" : "smooth");
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
|
-
let c =
|
|
497
|
-
y.current = !0, b.current = c,
|
|
498
|
-
}, [S,
|
|
496
|
+
let c = U(e, H(e, a, n, i).startDate, n, i);
|
|
497
|
+
y.current = !0, b.current = c, f(e);
|
|
498
|
+
}, [S, f])
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
501
|
//#endregion
|
|
502
502
|
//#region src/components/Gantt/utils/color.ts
|
|
503
|
-
var
|
|
503
|
+
var xe = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, Se = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, W = (e, t) => {
|
|
504
504
|
if (t < 0 || t > 1) return null;
|
|
505
|
-
let n = e.replace(
|
|
505
|
+
let n = e.replace(xe, (e, t, n, r) => t + t + n + n + r + r), r = Se.exec(n);
|
|
506
506
|
return r ? `rgba(${parseInt(r[1], 16)}, ${parseInt(r[2], 16)}, ${parseInt(r[3], 16)}, ${t})` : null;
|
|
507
|
-
},
|
|
507
|
+
}, Ce = (e, t = 2.5) => {
|
|
508
508
|
if (!e) return "#121211";
|
|
509
509
|
let n, r, i;
|
|
510
510
|
if (e.startsWith("#")) {
|
|
@@ -524,7 +524,7 @@ var _e = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, ve = /^#?([a-f\d]{2})([a-f\d]{2})([
|
|
|
524
524
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
525
525
|
};
|
|
526
526
|
return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
|
|
527
|
-
},
|
|
527
|
+
}, G = (e) => !e || !e.isValid() ? !1 : e.valueOf() !== e.startOf("day").valueOf(), we = (e, t) => {
|
|
528
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
529
|
return {
|
|
530
530
|
rawStart: n,
|
|
@@ -533,24 +533,24 @@ var _e = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, ve = /^#?([a-f\d]{2})([a-f\d]{2})([
|
|
|
533
533
|
baseEnd: a,
|
|
534
534
|
invalid: n !== null && r !== null && n.valueOf() > r.valueOf() || i === null || a === null || a.valueOf() <= i.valueOf()
|
|
535
535
|
};
|
|
536
|
-
},
|
|
536
|
+
}, Te = (e, t) => I(t) && (G(e.rawStart) || G(e.rawEnd)) ? {
|
|
537
537
|
start: e.rawStart,
|
|
538
538
|
end: e.rawEnd
|
|
539
539
|
} : {
|
|
540
540
|
start: e.baseStart,
|
|
541
541
|
end: e.baseEnd
|
|
542
|
-
},
|
|
543
|
-
function
|
|
544
|
-
let { startDate: r, pxPerDay: i, zoomLevel: a } = t, o =
|
|
542
|
+
}, Ee = (e) => e === void 0 ? 1 : Number.isFinite(e) ? e < 0 || e > 1 ? 1 : e : 0;
|
|
543
|
+
function De(e, t, n) {
|
|
544
|
+
let { startDate: r, pxPerDay: i, zoomLevel: a } = t, o = I(a) ? ie(a, i) : i, s = I(a) ? r : r.startOf("day");
|
|
545
545
|
return e.map((e, t) => {
|
|
546
|
-
let r =
|
|
546
|
+
let r = oe(e.startTime, n), c = oe(e.endTime, n), l = r.isValid(), u = c.isValid(), d = l ? r : null, f = u ? c : null, p = e.color || "#5170E8", m = W(p, .2) || `${p}33`, h = Ee(e.progress), g = 0, _ = 0, v = !1;
|
|
547
547
|
if (d && f) {
|
|
548
|
-
let e =
|
|
548
|
+
let e = we(d, f);
|
|
549
549
|
if (!e.invalid) {
|
|
550
|
-
let { start: t, end: n } =
|
|
550
|
+
let { start: t, end: n } = Te(e, a);
|
|
551
551
|
if (t && n) {
|
|
552
|
-
v = !0, g =
|
|
553
|
-
let e =
|
|
552
|
+
v = !0, g = R(t, s, i);
|
|
553
|
+
let e = R(n, s, i);
|
|
554
554
|
_ = Math.max(o, e - g);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -572,41 +572,45 @@ function we(e, t, n) {
|
|
|
572
572
|
});
|
|
573
573
|
}
|
|
574
574
|
//#endregion
|
|
575
|
-
//#region src/components/Gantt/utils/
|
|
576
|
-
var
|
|
575
|
+
//#region src/components/Gantt/utils/theme/resolveGanttThemeVars.ts
|
|
576
|
+
var Oe = "#0265ff", ke = (e) => {
|
|
577
|
+
if (!e) return {};
|
|
578
|
+
let t = e.colorPrimary ?? Oe, n = {};
|
|
579
|
+
return a(n, "--bsy-mobile-gantt-color-text", e.colorText), a(n, "--bsy-mobile-gantt-color-text-secondary", e.colorTextSecondary), a(n, "--bsy-mobile-gantt-color-split", e.colorSplit), a(n, "--bsy-mobile-gantt-color-border", e.colorBorder), a(n, "--bsy-mobile-gantt-color-primary", e.colorPrimary), a(n, "--bsy-mobile-gantt-color-bg-container", e.colorBgContainer), a(n, "--bsy-mobile-gantt-color-bg-weekend", e.colorBgWeekend), a(n, "--bsy-mobile-gantt-color-today-line", e.todayLineColor ?? W(t, .2) ?? void 0), a(n, "--bsy-mobile-gantt-toolbar-today-hover-bg", e.toolbarTodayHoverBg ?? W(t, .1) ?? void 0), a(n, "--bsy-mobile-gantt-toolbar-icon-color", e.toolbarIconColor), a(n, "--bsy-mobile-gantt-toolbar-icon-hover-color", e.toolbarIconHoverColor), a(n, "--bsy-mobile-gantt-arrow-bg", e.arrowBg), a(n, "--bsy-mobile-gantt-toolbar-bg", e.toolbarBg), n;
|
|
580
|
+
}, K = (...e) => e.filter(Boolean).join(" ");
|
|
577
581
|
//#endregion
|
|
578
582
|
//#region src/components/Gantt/utils/calcTodayLeft.ts
|
|
579
|
-
function
|
|
583
|
+
function q(e, t, n, r, i = "day") {
|
|
580
584
|
let a = r * n;
|
|
581
|
-
if (
|
|
582
|
-
let r =
|
|
585
|
+
if (I(i)) {
|
|
586
|
+
let r = L(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 = R(l, t, n) + u;
|
|
583
587
|
return d < 0 || d >= a ? null : d;
|
|
584
588
|
}
|
|
585
|
-
let o =
|
|
589
|
+
let o = R(e.startOf("day"), t.startOf("day"), n);
|
|
586
590
|
return o < 0 || o >= a ? null : o + n / 2;
|
|
587
591
|
}
|
|
588
592
|
//#endregion
|
|
589
593
|
//#region src/components/Gantt/utils/msUntilNextDay.ts
|
|
590
|
-
function
|
|
591
|
-
let t =
|
|
594
|
+
function J(e) {
|
|
595
|
+
let t = z(e);
|
|
592
596
|
return t.add(1, "day").startOf("day").add(1, "millisecond").valueOf() - t.valueOf();
|
|
593
597
|
}
|
|
594
|
-
function
|
|
595
|
-
if (t <= 0) return
|
|
596
|
-
let n =
|
|
598
|
+
function Ae(e, t) {
|
|
599
|
+
if (t <= 0) return J(e);
|
|
600
|
+
let n = z(e), r = n.startOf("day"), i = n.valueOf() - r.valueOf(), a = Math.floor(i / t), o = r.valueOf() + (a + 1) * t + 1;
|
|
597
601
|
return Math.max(1, o - n.valueOf());
|
|
598
602
|
}
|
|
599
603
|
//#endregion
|
|
600
604
|
//#region src/components/Gantt/hooks/useTodayTracker.ts
|
|
601
|
-
function
|
|
602
|
-
let [n, r] =
|
|
605
|
+
function Y(e, t = "day") {
|
|
606
|
+
let [n, r] = m(() => z(e)), i = p(e);
|
|
603
607
|
i.current = e;
|
|
604
|
-
let a =
|
|
608
|
+
let a = p(t);
|
|
605
609
|
a.current = t;
|
|
606
|
-
let o =
|
|
607
|
-
return
|
|
610
|
+
let o = c(() => z(i.current), []);
|
|
611
|
+
return u(() => {
|
|
608
612
|
let e, t = () => {
|
|
609
|
-
let n = a.current, s = i.current, c =
|
|
613
|
+
let n = a.current, s = i.current, c = I(n) ? Ae(s, L(n)) : J(s);
|
|
610
614
|
e = setTimeout(() => {
|
|
611
615
|
r(o()), t();
|
|
612
616
|
}, c);
|
|
@@ -626,112 +630,112 @@ function X(e, t = "day") {
|
|
|
626
630
|
}
|
|
627
631
|
//#endregion
|
|
628
632
|
//#region src/components/Gantt/StickyLabel.tsx
|
|
629
|
-
var
|
|
630
|
-
className:
|
|
633
|
+
var je = ({ cell: e }) => /* @__PURE__ */ _("div", {
|
|
634
|
+
className: S["bsy-mobile-gantt__sticky-label"],
|
|
631
635
|
style: { width: e.widthPx },
|
|
632
|
-
children: /* @__PURE__ */
|
|
633
|
-
className:
|
|
636
|
+
children: /* @__PURE__ */ _("div", {
|
|
637
|
+
className: S["bsy-mobile-gantt__sticky-label-text"],
|
|
634
638
|
children: e.label
|
|
635
639
|
})
|
|
636
|
-
}),
|
|
637
|
-
let { t: e } = r(), { zoomLevel: t, pxPerDay: n, timeZone: i, startDate: a, count: o, totalWidth: s, totalDays: c } =
|
|
640
|
+
}), Me = 34, Ne = 8, Pe = 5, Fe = () => {
|
|
641
|
+
let { t: e } = r(), { zoomLevel: t, pxPerDay: n, timeZone: i, startDate: a, count: o, totalWidth: s, totalDays: c } = T(), { horizontalScrollRef: l } = E(), u = Y(i, t), d = f(() => me(a, o, t, u, e), [
|
|
638
642
|
a,
|
|
639
643
|
o,
|
|
640
644
|
t,
|
|
641
645
|
u,
|
|
642
646
|
e
|
|
643
|
-
]), p =
|
|
644
|
-
|
|
647
|
+
]), p = f(() => pe(d, t, n, e), [
|
|
648
|
+
d,
|
|
645
649
|
t,
|
|
646
650
|
n,
|
|
647
651
|
e
|
|
648
|
-
]), m =
|
|
652
|
+
]), m = f(() => q(u, a, n, c, t), [
|
|
649
653
|
u,
|
|
650
654
|
a,
|
|
651
655
|
n,
|
|
652
656
|
c,
|
|
653
657
|
t
|
|
654
|
-
]), h =
|
|
655
|
-
count:
|
|
658
|
+
]), h = f(() => d.map((e) => e.days * n), [d, n]), g = x({
|
|
659
|
+
count: d.length,
|
|
656
660
|
getScrollElement: () => l.current,
|
|
657
661
|
estimateSize: (e) => h[e],
|
|
658
662
|
horizontal: !0,
|
|
659
|
-
overscan:
|
|
663
|
+
overscan: Pe
|
|
660
664
|
});
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
className:
|
|
665
|
+
return /* @__PURE__ */ v("div", {
|
|
666
|
+
className: S["bsy-mobile-gantt__header"],
|
|
663
667
|
style: { width: s },
|
|
664
668
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
className:
|
|
667
|
-
children: p.map((e) => /* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ _("div", {
|
|
670
|
+
className: S["bsy-mobile-gantt__header-row1"],
|
|
671
|
+
children: p.map((e) => /* @__PURE__ */ _(je, { cell: e }, `${e.label}-${e.startIndex}`))
|
|
668
672
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
className:
|
|
671
|
-
style: { height:
|
|
672
|
-
children:
|
|
673
|
-
let t =
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
-
className:
|
|
673
|
+
/* @__PURE__ */ _("div", {
|
|
674
|
+
className: S["bsy-mobile-gantt__header-row2"],
|
|
675
|
+
style: { height: Me },
|
|
676
|
+
children: g.getVirtualItems().map((e) => {
|
|
677
|
+
let t = d[e.index], n = Math.round(e.start), r = Math.max(1, Math.round(e.size));
|
|
678
|
+
return /* @__PURE__ */ _("div", {
|
|
679
|
+
className: S["bsy-mobile-gantt__header-cell"],
|
|
676
680
|
style: {
|
|
677
681
|
left: n,
|
|
678
682
|
width: r,
|
|
679
683
|
height: "100%"
|
|
680
684
|
},
|
|
681
|
-
children: /* @__PURE__ */
|
|
682
|
-
className:
|
|
683
|
-
style: { lineHeight: `${
|
|
685
|
+
children: /* @__PURE__ */ _("div", {
|
|
686
|
+
className: K(S["bsy-mobile-gantt__header-cell-label"], t.isToday && S["bsy-mobile-gantt__header-cell-label--today"]),
|
|
687
|
+
style: { lineHeight: `${Me}px` },
|
|
684
688
|
children: t.label
|
|
685
689
|
})
|
|
686
690
|
}, e.index);
|
|
687
691
|
})
|
|
688
692
|
}),
|
|
689
|
-
m === null ? null : /* @__PURE__ */
|
|
690
|
-
className:
|
|
691
|
-
style: { left: m -
|
|
693
|
+
m === null ? null : /* @__PURE__ */ _("div", {
|
|
694
|
+
className: S["bsy-mobile-gantt__today-dot"],
|
|
695
|
+
style: { left: m - Ne / 2 }
|
|
692
696
|
})
|
|
693
697
|
]
|
|
694
698
|
});
|
|
695
|
-
},
|
|
696
|
-
let a =
|
|
699
|
+
}, Ie = 2, Le = ({ today: e, startDate: t, pxPerDay: n, totalDays: r, zoomLevel: i }) => {
|
|
700
|
+
let a = f(() => q(e, t, n, r, i), [
|
|
697
701
|
e,
|
|
698
702
|
t,
|
|
699
703
|
n,
|
|
700
704
|
r,
|
|
701
705
|
i
|
|
702
706
|
]);
|
|
703
|
-
return a === null ? null : /* @__PURE__ */
|
|
704
|
-
className:
|
|
707
|
+
return a === null ? null : /* @__PURE__ */ _("div", {
|
|
708
|
+
className: S["bsy-mobile-gantt__today-line"],
|
|
705
709
|
style: {
|
|
706
|
-
left: a -
|
|
707
|
-
width:
|
|
710
|
+
left: a - Ie / 2,
|
|
711
|
+
width: Ie
|
|
708
712
|
}
|
|
709
713
|
});
|
|
710
|
-
},
|
|
711
|
-
function
|
|
712
|
-
if (r > t -
|
|
714
|
+
}, Re = 26, ze = 6, X = 4;
|
|
715
|
+
function Be(e, t, n, r) {
|
|
716
|
+
if (r > t - X * 2) return "outside";
|
|
713
717
|
if (e < n) {
|
|
714
718
|
let i = e + t - n;
|
|
715
|
-
return r +
|
|
719
|
+
return r + X > i ? "outside" : "overlay-sticky";
|
|
716
720
|
}
|
|
717
721
|
return "inside";
|
|
718
722
|
}
|
|
719
|
-
var
|
|
720
|
-
let o = e.progress > 0 ? Math.max(4, e.width * e.progress) : 0, s =
|
|
721
|
-
return
|
|
723
|
+
var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, overlayHost: i, onClick: a }) => {
|
|
724
|
+
let o = e.progress > 0 ? Math.max(4, e.width * e.progress) : 0, s = Ce(e.bgColor), c = p(null), [l, u] = m(0);
|
|
725
|
+
return d(() => {
|
|
722
726
|
if (!c.current || !e.label) {
|
|
723
|
-
|
|
727
|
+
u(0);
|
|
724
728
|
return;
|
|
725
729
|
}
|
|
726
|
-
|
|
727
|
-
}, [e.label]),
|
|
730
|
+
u(c.current.scrollWidth);
|
|
731
|
+
}, [e.label]), d(() => {
|
|
728
732
|
let a = c.current, o = n.current;
|
|
729
733
|
if (!a || !o || !e.label) return;
|
|
730
734
|
let u = document.createElement("span");
|
|
731
|
-
u.className =
|
|
735
|
+
u.className = S["bsy-mobile-gantt__bar-label-overlay"], u.textContent = e.label, u.style.display = "none", u.style.color = s, i?.appendChild(u);
|
|
732
736
|
let d = () => {
|
|
733
|
-
let { scrollLeft: n } = o, i =
|
|
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 -
|
|
737
|
+
let { scrollLeft: n } = o, i = Be(e.left, e.width, n, l), c = i === "outside", d = i === "overlay-sticky", f = e.left + e.width - n;
|
|
738
|
+
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 - X * 2)}px`) : (a.style.visibility = "visible", u.style.display = "none", a.style.left = c ? `${e.width + ze}px` : `${X}px`, a.style.maxWidth = c ? "none" : `${e.width - X * 2}px`, a.style.overflow = c ? "visible" : "hidden", a.style.textOverflow = c ? "clip" : "ellipsis", a.style.color = c ? "#000" : s);
|
|
735
739
|
};
|
|
736
740
|
d(), o.addEventListener("scroll", d, { passive: !0 });
|
|
737
741
|
let f = r.current;
|
|
@@ -748,70 +752,70 @@ var Le = o(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
748
752
|
i,
|
|
749
753
|
t,
|
|
750
754
|
r
|
|
751
|
-
]), /* @__PURE__ */
|
|
752
|
-
className:
|
|
755
|
+
]), /* @__PURE__ */ v("div", {
|
|
756
|
+
className: S["bsy-mobile-gantt__bar"],
|
|
753
757
|
style: {
|
|
754
758
|
top: t,
|
|
755
759
|
left: e.left,
|
|
756
760
|
width: e.width,
|
|
757
|
-
height:
|
|
761
|
+
height: Re
|
|
758
762
|
},
|
|
759
763
|
onClick: () => a?.(e.task),
|
|
760
764
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
className:
|
|
765
|
+
/* @__PURE__ */ _("div", {
|
|
766
|
+
className: S["bsy-mobile-gantt__bar-track"],
|
|
763
767
|
style: { backgroundColor: e.bgColor }
|
|
764
768
|
}),
|
|
765
|
-
o > 0 ? /* @__PURE__ */
|
|
766
|
-
className:
|
|
769
|
+
o > 0 ? /* @__PURE__ */ _("div", {
|
|
770
|
+
className: S["bsy-mobile-gantt__bar-progress"],
|
|
767
771
|
style: {
|
|
768
772
|
width: o,
|
|
769
773
|
backgroundColor: e.color,
|
|
770
774
|
borderRadius: e.progress === 1 ? 4 : "4px 0 0 4px"
|
|
771
775
|
}
|
|
772
776
|
}) : null,
|
|
773
|
-
e.label ? /* @__PURE__ */
|
|
777
|
+
e.label ? /* @__PURE__ */ _("span", {
|
|
774
778
|
ref: c,
|
|
775
|
-
className:
|
|
779
|
+
className: S["bsy-mobile-gantt__bar-label"],
|
|
776
780
|
style: {
|
|
777
|
-
left:
|
|
778
|
-
maxWidth: e.width -
|
|
779
|
-
lineHeight: `${
|
|
781
|
+
left: X,
|
|
782
|
+
maxWidth: e.width - X * 2,
|
|
783
|
+
lineHeight: `${Re}px`,
|
|
780
784
|
color: s
|
|
781
785
|
},
|
|
782
786
|
children: e.label
|
|
783
787
|
}) : null
|
|
784
788
|
]
|
|
785
789
|
});
|
|
786
|
-
}),
|
|
790
|
+
}), He = s(({ direction: e, edge: t, offset: n, onClick: i }) => {
|
|
787
791
|
let { t: a } = r();
|
|
788
|
-
return /* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ _("button", {
|
|
789
793
|
type: "button",
|
|
790
|
-
className:
|
|
794
|
+
className: K(S["bsy-mobile-gantt__offscreen-arrow"], t === "right" && S["bsy-mobile-gantt__offscreen-arrow--right"]),
|
|
791
795
|
style: { [t]: n },
|
|
792
796
|
onClick: i,
|
|
793
797
|
"aria-label": a("gantt.locateTask"),
|
|
794
|
-
children: /* @__PURE__ */
|
|
798
|
+
children: /* @__PURE__ */ _("svg", {
|
|
795
799
|
width: "16",
|
|
796
800
|
height: "16",
|
|
797
801
|
viewBox: "0 0 16 16",
|
|
798
802
|
"aria-hidden": "true",
|
|
799
|
-
children: e === "left" ? /* @__PURE__ */
|
|
803
|
+
children: e === "left" ? /* @__PURE__ */ _("path", {
|
|
800
804
|
d: "M10 12L6 8l4-4",
|
|
801
805
|
fill: "none",
|
|
802
|
-
stroke: "
|
|
806
|
+
stroke: "currentColor",
|
|
803
807
|
strokeWidth: "1.5"
|
|
804
|
-
}) : /* @__PURE__ */
|
|
808
|
+
}) : /* @__PURE__ */ _("path", {
|
|
805
809
|
d: "M6 4l4 4-4 4",
|
|
806
810
|
fill: "none",
|
|
807
|
-
stroke: "
|
|
811
|
+
stroke: "currentColor",
|
|
808
812
|
strokeWidth: "1.5"
|
|
809
813
|
})
|
|
810
814
|
})
|
|
811
815
|
});
|
|
812
|
-
}),
|
|
813
|
-
let [o, s] =
|
|
814
|
-
|
|
816
|
+
}), Z = 24, Ue = 4, We = s(({ virtualRows: e, bars: t, horizontalScrollRef: n, viewportWidth: r, rowHeight: i, onNavigate: a }) => {
|
|
817
|
+
let [o, s] = m(() => n.current?.scrollLeft ?? 0), c = p(0);
|
|
818
|
+
u(() => {
|
|
815
819
|
let e = n.current;
|
|
816
820
|
if (!e) return;
|
|
817
821
|
let t = () => {
|
|
@@ -823,59 +827,59 @@ var Le = o(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
823
827
|
e.removeEventListener("scroll", t), cancelAnimationFrame(c.current);
|
|
824
828
|
};
|
|
825
829
|
}, [n]);
|
|
826
|
-
let
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
className:
|
|
829
|
-
children: /* @__PURE__ */
|
|
830
|
-
className:
|
|
830
|
+
let l = o + r;
|
|
831
|
+
return /* @__PURE__ */ _("div", {
|
|
832
|
+
className: S["bsy-mobile-gantt__offscreen"],
|
|
833
|
+
children: /* @__PURE__ */ _("div", {
|
|
834
|
+
className: S["bsy-mobile-gantt__offscreen-layer"],
|
|
831
835
|
children: e.map((e) => {
|
|
832
836
|
let n = t[e.index];
|
|
833
837
|
if (!n || !n.hasTimeRange) return null;
|
|
834
|
-
let r = n.left + n.width < o, s = n.left >
|
|
835
|
-
return !r && !s ? null : /* @__PURE__ */
|
|
836
|
-
className:
|
|
838
|
+
let r = n.left + n.width < o, s = n.left > l;
|
|
839
|
+
return !r && !s ? null : /* @__PURE__ */ v("div", {
|
|
840
|
+
className: S["bsy-mobile-gantt__offscreen-row"],
|
|
837
841
|
style: {
|
|
838
|
-
top: e.start + (i -
|
|
839
|
-
height:
|
|
842
|
+
top: e.start + (i - Z) / 2,
|
|
843
|
+
height: Z
|
|
840
844
|
},
|
|
841
|
-
children: [r ? /* @__PURE__ */
|
|
845
|
+
children: [r ? /* @__PURE__ */ _(He, {
|
|
842
846
|
direction: "left",
|
|
843
847
|
edge: "left",
|
|
844
|
-
offset:
|
|
848
|
+
offset: Ue,
|
|
845
849
|
onClick: () => a(n.startDate)
|
|
846
|
-
}) : null, s ? /* @__PURE__ */
|
|
850
|
+
}) : null, s ? /* @__PURE__ */ _(He, {
|
|
847
851
|
direction: "right",
|
|
848
852
|
edge: "right",
|
|
849
|
-
offset:
|
|
853
|
+
offset: Ue,
|
|
850
854
|
onClick: () => a(n.startDate)
|
|
851
855
|
}) : null]
|
|
852
856
|
}, `overlay-${n.id}`);
|
|
853
857
|
})
|
|
854
858
|
})
|
|
855
859
|
});
|
|
856
|
-
}),
|
|
857
|
-
let { zoomLevel: r, pxPerDay: i, timeZone: a, startDate: o, count: s, totalWidth: c, totalDays:
|
|
860
|
+
}), Ge = 5, Ke = 5, Q = 28, qe = 4, Je = ({ bars: e, onTaskClick: t, overlayHostRef: n }) => {
|
|
861
|
+
let { zoomLevel: r, pxPerDay: i, timeZone: a, startDate: o, count: s, totalWidth: c, totalDays: l, viewportWidth: d } = T(), { horizontalScrollRef: y, navigateToBar: b } = E(), C = Y(a, r), w = f(() => me(o, s, r, C), [
|
|
858
862
|
o,
|
|
859
863
|
s,
|
|
860
864
|
r,
|
|
861
865
|
C
|
|
862
|
-
]), D = e.length, O = Math.max(D * Q +
|
|
863
|
-
count:
|
|
866
|
+
]), D = e.length, O = Math.max(D * Q + qe, 0), k = p(null), ee = f(() => w.map((e) => e.days * i), [w, i]), A = x({
|
|
867
|
+
count: w.length,
|
|
864
868
|
getScrollElement: () => y.current,
|
|
865
|
-
estimateSize: (e) =>
|
|
869
|
+
estimateSize: (e) => ee[e],
|
|
866
870
|
horizontal: !0,
|
|
867
|
-
overscan:
|
|
868
|
-
}),
|
|
871
|
+
overscan: Ge
|
|
872
|
+
}), j = x({
|
|
869
873
|
count: D,
|
|
870
874
|
getScrollElement: () => k.current,
|
|
871
875
|
estimateSize: () => Q,
|
|
872
|
-
paddingStart:
|
|
873
|
-
overscan:
|
|
874
|
-
}).getVirtualItems(), [
|
|
875
|
-
return
|
|
876
|
-
|
|
877
|
-
}, [n]),
|
|
878
|
-
let e = k.current, t =
|
|
876
|
+
paddingStart: qe,
|
|
877
|
+
overscan: Ke
|
|
878
|
+
}).getVirtualItems(), [M, N] = m(null);
|
|
879
|
+
return u(() => {
|
|
880
|
+
N(n?.current ?? null);
|
|
881
|
+
}, [n]), u(() => {
|
|
882
|
+
let e = k.current, t = M;
|
|
879
883
|
if (!e || !t) return;
|
|
880
884
|
let n = 0, r = () => {
|
|
881
885
|
n ||= window.requestAnimationFrame(() => {
|
|
@@ -885,116 +889,116 @@ var Le = o(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
885
889
|
return t.style.setProperty("--gantt-overlay-translate-y", `${-e.scrollTop}px`), e.addEventListener("scroll", r, { passive: !0 }), () => {
|
|
886
890
|
e.removeEventListener("scroll", r), n && window.cancelAnimationFrame(n);
|
|
887
891
|
};
|
|
888
|
-
}, [
|
|
892
|
+
}, [M]), /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
889
893
|
ref: k,
|
|
890
|
-
className:
|
|
894
|
+
className: S["bsy-mobile-gantt__timeline"],
|
|
891
895
|
style: { width: c },
|
|
892
|
-
children: /* @__PURE__ */
|
|
893
|
-
className:
|
|
896
|
+
children: /* @__PURE__ */ v("div", {
|
|
897
|
+
className: S["bsy-mobile-gantt__timeline-inner"],
|
|
894
898
|
style: {
|
|
895
899
|
width: c,
|
|
896
900
|
height: O || "100%"
|
|
897
901
|
},
|
|
898
902
|
children: [
|
|
899
|
-
|
|
900
|
-
className:
|
|
903
|
+
A.getVirtualItems().map((e) => /* @__PURE__ */ _("div", {
|
|
904
|
+
className: K(S["bsy-mobile-gantt__column"], r === "day" && w[e.index]?.isWeekend && S["bsy-mobile-gantt__column--weekend"]),
|
|
901
905
|
style: {
|
|
902
906
|
width: e.size,
|
|
903
907
|
transform: `translateX(${e.start}px)`
|
|
904
908
|
}
|
|
905
909
|
}, e.index)),
|
|
906
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ _(Le, {
|
|
907
911
|
today: C,
|
|
908
912
|
startDate: o,
|
|
909
913
|
pxPerDay: i,
|
|
910
|
-
totalDays:
|
|
914
|
+
totalDays: l,
|
|
911
915
|
zoomLevel: r
|
|
912
916
|
}),
|
|
913
|
-
|
|
917
|
+
j.map((n) => {
|
|
914
918
|
let r = e[n.index];
|
|
915
|
-
return !r || !r.hasTimeRange ? null : /* @__PURE__ */
|
|
919
|
+
return !r || !r.hasTimeRange ? null : /* @__PURE__ */ _(Ve, {
|
|
916
920
|
bar: r,
|
|
917
921
|
top: n.start,
|
|
918
922
|
horizontalScrollRef: y,
|
|
919
923
|
verticalScrollRef: k,
|
|
920
|
-
overlayHost:
|
|
924
|
+
overlayHost: M,
|
|
921
925
|
onClick: t
|
|
922
926
|
}, r.id);
|
|
923
927
|
})
|
|
924
928
|
]
|
|
925
929
|
})
|
|
926
|
-
}),
|
|
927
|
-
virtualRows:
|
|
930
|
+
}), M ? h(/* @__PURE__ */ _(We, {
|
|
931
|
+
virtualRows: j,
|
|
928
932
|
bars: e,
|
|
929
933
|
horizontalScrollRef: y,
|
|
930
|
-
viewportWidth:
|
|
934
|
+
viewportWidth: d,
|
|
931
935
|
rowHeight: Q,
|
|
932
|
-
onNavigate:
|
|
933
|
-
}),
|
|
934
|
-
}, $ = ({ direction: e }) => /* @__PURE__ */
|
|
935
|
-
className:
|
|
936
|
+
onNavigate: b
|
|
937
|
+
}), M) : null] });
|
|
938
|
+
}, $ = ({ direction: e }) => /* @__PURE__ */ _("svg", {
|
|
939
|
+
className: K(S["bsy-mobile-gantt__chevron"], e === "left" && S["bsy-mobile-gantt__chevron--left"], e === "right" && S["bsy-mobile-gantt__chevron--right"]),
|
|
936
940
|
width: "16",
|
|
937
941
|
height: "16",
|
|
938
942
|
viewBox: "0 0 16 16",
|
|
939
943
|
"aria-hidden": "true",
|
|
940
|
-
children: /* @__PURE__ */
|
|
944
|
+
children: /* @__PURE__ */ _("path", {
|
|
941
945
|
d: "M4 6l4 4 4-4",
|
|
942
946
|
fill: "none",
|
|
943
947
|
stroke: "currentColor",
|
|
944
948
|
strokeWidth: "1.5"
|
|
945
949
|
})
|
|
946
|
-
}),
|
|
947
|
-
let { t } = r(), { zoomLevel: n, viewportWidth: i, totalWidth: a } =
|
|
948
|
-
l(Math.max(0,
|
|
950
|
+
}), Ye = () => {
|
|
951
|
+
let { t } = r(), { zoomLevel: n, viewportWidth: i, totalWidth: a } = T(), { setZoomLevel: o, getScrollLeft: s, scrollToX: l, handleTodayClick: u } = E(), [d, f] = m(!1), p = c(() => {
|
|
952
|
+
l(Math.max(0, s() - i), "smooth");
|
|
949
953
|
}, [
|
|
950
|
-
|
|
954
|
+
s,
|
|
951
955
|
l,
|
|
952
956
|
i
|
|
953
|
-
]),
|
|
957
|
+
]), h = c(() => {
|
|
954
958
|
let e = Math.max(0, a - i);
|
|
955
|
-
l(Math.min(
|
|
959
|
+
l(Math.min(s() + i, e), "smooth");
|
|
956
960
|
}, [
|
|
957
|
-
|
|
961
|
+
s,
|
|
958
962
|
l,
|
|
959
963
|
i,
|
|
960
964
|
a
|
|
961
965
|
]);
|
|
962
|
-
return /* @__PURE__ */
|
|
963
|
-
className:
|
|
966
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
967
|
+
className: S["bsy-mobile-gantt__toolbar"],
|
|
964
968
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ v("button", {
|
|
966
970
|
type: "button",
|
|
967
|
-
className:
|
|
971
|
+
className: S["bsy-mobile-gantt__toolbar-zoom"],
|
|
968
972
|
onClick: () => f(!0),
|
|
969
|
-
children: [/* @__PURE__ */
|
|
973
|
+
children: [/* @__PURE__ */ _("span", { children: t(`gantt.zoom.${n}`) }), /* @__PURE__ */ _($, { direction: "down" })]
|
|
970
974
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ _("div", { className: S["bsy-mobile-gantt__toolbar-divider"] }),
|
|
976
|
+
/* @__PURE__ */ _("button", {
|
|
973
977
|
type: "button",
|
|
974
|
-
className:
|
|
978
|
+
className: S["bsy-mobile-gantt__toolbar-today"],
|
|
975
979
|
onClick: u,
|
|
976
980
|
children: t("gantt.today")
|
|
977
981
|
}),
|
|
978
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ _("button", {
|
|
979
983
|
type: "button",
|
|
980
|
-
className:
|
|
981
|
-
onClick:
|
|
984
|
+
className: S["bsy-mobile-gantt__toolbar-nav"],
|
|
985
|
+
onClick: p,
|
|
982
986
|
"aria-label": t("gantt.prevScreen"),
|
|
983
|
-
children: /* @__PURE__ */
|
|
987
|
+
children: /* @__PURE__ */ _($, { direction: "left" })
|
|
984
988
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ _("button", {
|
|
986
990
|
type: "button",
|
|
987
|
-
className:
|
|
988
|
-
onClick:
|
|
991
|
+
className: S["bsy-mobile-gantt__toolbar-nav"],
|
|
992
|
+
onClick: h,
|
|
989
993
|
"aria-label": t("gantt.nextScreen"),
|
|
990
|
-
children: /* @__PURE__ */
|
|
994
|
+
children: /* @__PURE__ */ _($, { direction: "right" })
|
|
991
995
|
})
|
|
992
996
|
]
|
|
993
|
-
}), /* @__PURE__ */
|
|
997
|
+
}), /* @__PURE__ */ _(e, {
|
|
994
998
|
open: d,
|
|
995
999
|
onClose: () => f(!1),
|
|
996
1000
|
title: t("gantt.zoomSheetTitle"),
|
|
997
|
-
actions:
|
|
1001
|
+
actions: ee.map((e) => ({
|
|
998
1002
|
key: e,
|
|
999
1003
|
text: t(`gantt.zoom.${e}`),
|
|
1000
1004
|
selected: n === e
|
|
@@ -1003,92 +1007,93 @@ var Le = o(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
1003
1007
|
o(e.key), f(!1);
|
|
1004
1008
|
}
|
|
1005
1009
|
})] });
|
|
1006
|
-
},
|
|
1007
|
-
let { tasks: t = [], timeZone: n, className: r, onTaskClick: i } = e, [
|
|
1010
|
+
}, Xe = 88, Ze = (e) => {
|
|
1011
|
+
let { tasks: t = [], timeZone: n, className: r, onTaskClick: i, theme: a } = e, [o, s] = y(e, {
|
|
1008
1012
|
defaultValue: "day",
|
|
1009
1013
|
defaultValuePropName: "defaultZoomLevel",
|
|
1010
1014
|
valuePropName: "zoomLevel",
|
|
1011
1015
|
trigger: "onZoomChange"
|
|
1012
|
-
}),
|
|
1016
|
+
}), c = p(null), l = ge({
|
|
1013
1017
|
timeZone: n,
|
|
1014
|
-
initialZoomLevel:
|
|
1015
|
-
}),
|
|
1016
|
-
startDate:
|
|
1017
|
-
pxPerDay:
|
|
1018
|
-
zoomLevel:
|
|
1018
|
+
initialZoomLevel: o
|
|
1019
|
+
}), u = be(l, { onZoomLevelChange: s }), d = f(() => De(t, {
|
|
1020
|
+
startDate: l.startDate,
|
|
1021
|
+
pxPerDay: l.pxPerDay,
|
|
1022
|
+
zoomLevel: l.zoomLevel
|
|
1019
1023
|
}, n), [
|
|
1020
1024
|
t,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1025
|
+
l.startDate,
|
|
1026
|
+
l.pxPerDay,
|
|
1027
|
+
l.zoomLevel,
|
|
1024
1028
|
n
|
|
1025
|
-
]),
|
|
1026
|
-
zoomLevel:
|
|
1027
|
-
pxPerDay:
|
|
1029
|
+
]), m = f(() => ({
|
|
1030
|
+
zoomLevel: l.zoomLevel,
|
|
1031
|
+
pxPerDay: l.pxPerDay,
|
|
1028
1032
|
timeZone: n,
|
|
1029
|
-
viewportWidth:
|
|
1030
|
-
anchorDate:
|
|
1031
|
-
startDate:
|
|
1032
|
-
count:
|
|
1033
|
-
totalDays:
|
|
1034
|
-
totalWidth:
|
|
1033
|
+
viewportWidth: l.viewportWidth,
|
|
1034
|
+
anchorDate: l.anchorDate,
|
|
1035
|
+
startDate: l.startDate,
|
|
1036
|
+
count: l.count,
|
|
1037
|
+
totalDays: l.totalDays,
|
|
1038
|
+
totalWidth: l.totalWidth
|
|
1035
1039
|
}), [
|
|
1036
|
-
|
|
1037
|
-
|
|
1040
|
+
l.zoomLevel,
|
|
1041
|
+
l.pxPerDay,
|
|
1038
1042
|
n,
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
]),
|
|
1046
|
-
setZoomLevel:
|
|
1047
|
-
horizontalScrollRef:
|
|
1048
|
-
scrollToX:
|
|
1049
|
-
getScrollLeft:
|
|
1050
|
-
handleTodayClick:
|
|
1051
|
-
navigateToBar:
|
|
1043
|
+
l.viewportWidth,
|
|
1044
|
+
l.anchorDate,
|
|
1045
|
+
l.startDate,
|
|
1046
|
+
l.count,
|
|
1047
|
+
l.totalDays,
|
|
1048
|
+
l.totalWidth
|
|
1049
|
+
]), h = f(() => ({
|
|
1050
|
+
setZoomLevel: u.setZoomLevel,
|
|
1051
|
+
horizontalScrollRef: u.horizontalScrollRef,
|
|
1052
|
+
scrollToX: u.scrollToX,
|
|
1053
|
+
getScrollLeft: u.getScrollLeft,
|
|
1054
|
+
handleTodayClick: u.handleTodayClick,
|
|
1055
|
+
navigateToBar: u.navigateToBar
|
|
1052
1056
|
}), [
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
]);
|
|
1060
|
-
return /* @__PURE__ */
|
|
1061
|
-
value:
|
|
1062
|
-
children: /* @__PURE__ */
|
|
1063
|
-
value:
|
|
1064
|
-
children: /* @__PURE__ */
|
|
1065
|
-
ref:
|
|
1066
|
-
className:
|
|
1057
|
+
u.setZoomLevel,
|
|
1058
|
+
u.horizontalScrollRef,
|
|
1059
|
+
u.scrollToX,
|
|
1060
|
+
u.getScrollLeft,
|
|
1061
|
+
u.handleTodayClick,
|
|
1062
|
+
u.navigateToBar
|
|
1063
|
+
]), g = f(() => ke(a), [a]);
|
|
1064
|
+
return /* @__PURE__ */ _(C.Provider, {
|
|
1065
|
+
value: m,
|
|
1066
|
+
children: /* @__PURE__ */ _(w.Provider, {
|
|
1067
|
+
value: h,
|
|
1068
|
+
children: /* @__PURE__ */ v("div", {
|
|
1069
|
+
ref: l.containerRef,
|
|
1070
|
+
className: K(S["bsy-mobile-gantt"], r),
|
|
1071
|
+
style: g,
|
|
1067
1072
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
ref:
|
|
1070
|
-
className:
|
|
1071
|
-
onScroll:
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1073
|
-
className:
|
|
1074
|
-
style: { width:
|
|
1075
|
-
children: [/* @__PURE__ */
|
|
1076
|
-
bars:
|
|
1073
|
+
/* @__PURE__ */ _("div", {
|
|
1074
|
+
ref: u.horizontalScrollRef,
|
|
1075
|
+
className: S["bsy-mobile-gantt__scroll"],
|
|
1076
|
+
onScroll: u.handleHorizontalScroll,
|
|
1077
|
+
children: /* @__PURE__ */ v("div", {
|
|
1078
|
+
className: S["bsy-mobile-gantt__canvas"],
|
|
1079
|
+
style: { width: l.totalWidth },
|
|
1080
|
+
children: [/* @__PURE__ */ _(Fe, {}), /* @__PURE__ */ _(Je, {
|
|
1081
|
+
bars: d,
|
|
1077
1082
|
onTaskClick: i,
|
|
1078
|
-
overlayHostRef:
|
|
1083
|
+
overlayHostRef: c
|
|
1079
1084
|
})]
|
|
1080
1085
|
})
|
|
1081
1086
|
}),
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
ref:
|
|
1084
|
-
className:
|
|
1085
|
-
style: { top:
|
|
1087
|
+
/* @__PURE__ */ _("div", {
|
|
1088
|
+
ref: c,
|
|
1089
|
+
className: S["bsy-mobile-gantt__overlay-host"],
|
|
1090
|
+
style: { top: Xe }
|
|
1086
1091
|
}),
|
|
1087
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ _(Ye, {})
|
|
1088
1093
|
]
|
|
1089
1094
|
})
|
|
1090
1095
|
})
|
|
1091
1096
|
});
|
|
1092
1097
|
};
|
|
1093
1098
|
//#endregion
|
|
1094
|
-
export {
|
|
1099
|
+
export { k as n, Ze as t };
|