@baishuyun/ui-mobile 0.9.1 → 0.10.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-B1GiEoPE.js → AMap-BkfhkrnK.js} +106 -106
- package/dist/AMap/index.js +4 -4
- package/dist/ActionSheet/{ActionSheet-DVck9uyS.js → ActionSheet-DJyeduZq.js} +7 -7
- package/dist/ActionSheet/index.js +6 -6
- package/dist/Calendar/{Calendar-B1TwDL1q.js → Calendar-Cf81JVOC.js} +353 -356
- package/dist/Calendar/index.js +5 -4
- package/dist/Calendar/{cssVars-DNOooryc.js → timeUtils-t4A3-Hr6.js} +1 -3
- package/dist/ConfigProvider/{ConfigProvider-xyGx046s.js → ConfigProvider-CNWefxiV.js} +14 -2
- package/dist/ConfigProvider/index.js +4 -4
- package/dist/ConfigProvider/{useLocale-Bf81I-9U.js → useLocale-DiKogqPs.js} +6 -0
- package/dist/Editor/Editor-CfA-ye-u.js +2774 -0
- package/dist/Editor/index.js +8 -8
- package/dist/Gantt/{Gantt-CbHw9RMw.js → Gantt-Bhvbj3l8.js} +220 -219
- package/dist/Gantt/index.js +8 -8
- package/dist/Icon/Icon-BKlmJSoE.js +23 -0
- package/dist/Icon/index.js +2 -2
- package/dist/Overlay/index.js +2 -2
- package/dist/Popup/{Popup-BIIDAUmB.js → Popup-Cg3t422z.js} +2 -2
- package/dist/Popup/index.js +4 -4
- package/dist/Segmented/Segmented-CxQ3Pd05.js +85 -0
- package/dist/Segmented/index.js +3 -0
- package/dist/components/Editor/{EditorHtml.d.ts → EditorHtmlPreview.d.ts} +1 -1
- package/dist/components/Editor/color/EditorColorPicker.d.ts +11 -0
- package/dist/components/Editor/color/colorUtils.d.ts +32 -0
- package/dist/components/Editor/constants/codeLanguages.d.ts +6 -0
- package/dist/components/Editor/hooks/useEditorAiSession.d.ts +20 -0
- package/dist/components/Editor/hooks/useEditorFocus.d.ts +1 -0
- package/dist/components/Editor/hooks/useEditorImageUpload.d.ts +17 -0
- package/dist/components/Editor/hooks/useEditorLink.d.ts +15 -0
- package/dist/components/Editor/hooks/useEditorValueBridge.d.ts +10 -0
- package/dist/components/Editor/htmlConfig.d.ts +2 -0
- package/dist/components/Editor/index.d.ts +1 -1
- package/dist/components/Editor/nodes/ExtendedLinkNode.d.ts +9 -0
- package/dist/components/Editor/plugins/CodeHighlightPlugin.d.ts +2 -0
- package/dist/components/Editor/plugins/EnterKeyPlugin.d.ts +1 -0
- package/dist/components/Editor/plugins/TablePlugin.d.ts +2 -0
- package/dist/components/Editor/popups/AiResultPopup.d.ts +13 -0
- package/dist/components/Editor/popups/ImageUrlPopup.d.ts +7 -0
- package/dist/components/Editor/popups/LinkPopup.d.ts +13 -0
- package/dist/components/Editor/popups/OptionSheets.d.ts +23 -0
- package/dist/components/Editor/popups/index.d.ts +4 -0
- package/dist/components/Editor/popups/shared.d.ts +11 -0
- package/dist/components/Editor/toolbar/Toolbar.d.ts +7 -1
- package/dist/components/Editor/toolbar/useTextFormats.d.ts +2 -15
- package/dist/components/Editor/utils/codeHighlighter.d.ts +12 -0
- package/dist/components/Editor/utils/placeProgrammaticCaret.d.ts +4 -0
- package/dist/components/Editor/utils/readTextFormats.d.ts +21 -0
- package/dist/components/Editor/utils/retainCodeSelection.d.ts +3 -0
- package/dist/components/Segmented/Segmented.d.ts +7 -0
- package/dist/components/Segmented/index.d.ts +2 -0
- package/dist/components/Segmented/interface.d.ts +42 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/index.js +14 -13
- package/dist/locale/lang/en-US.json.d.ts +6 -0
- package/dist/locale/lang/zh-CN.json.d.ts +6 -0
- package/dist/locale/lang/zh-TW.json.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/vendors/cssVars-BbL_cmFM.js +6 -0
- package/dist/vendors/{version-CegBK2kS.js → version-C0got4sp.js} +1 -1
- package/package.json +7 -1
- package/dist/Editor/Editor-COxP3RpF.js +0 -2059
- package/dist/Icon/Icon-D3xi1oyo.js +0 -23
- package/dist/components/Editor/sheets.d.ts +0 -43
- /package/dist/Overlay/{Overlay-CqQWOqO4.js → Overlay-DFiZYsBs.js} +0 -0
|
@@ -1,92 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as e, i as t, t as n } from "../ConfigProvider/useLocale-DiKogqPs.js";
|
|
2
|
+
import { t as r } from "../ActionSheet/ActionSheet-DJyeduZq.js";
|
|
3
|
+
import { r as i } from "../Calendar/timeUtils-t4A3-Hr6.js";
|
|
4
|
+
import { t as a } from "../vendors/cssVars-BbL_cmFM.js";
|
|
4
5
|
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
6
|
import { createPortal as h } from "react-dom";
|
|
6
7
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
8
|
import { useControllableValue as y } from "ahooks";
|
|
8
9
|
import b from "dayjs";
|
|
9
10
|
import { useVirtualizer as x } from "@tanstack/react-virtual";
|
|
10
|
-
//#region src/components/Gantt/
|
|
11
|
-
var S = {
|
|
12
|
-
|
|
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);
|
|
11
|
+
//#region src/components/Gantt/context.ts
|
|
12
|
+
var S = o(null), C = o(null), w = () => {
|
|
13
|
+
let e = l(S);
|
|
51
14
|
if (!e) throw Error("useGanttState must be used within a GanttStateContext.Provider");
|
|
52
15
|
return e;
|
|
53
|
-
},
|
|
54
|
-
let e = l(
|
|
16
|
+
}, T = () => {
|
|
17
|
+
let e = l(C);
|
|
55
18
|
if (!e) throw Error("useGanttAction must be used within a GanttActionContext.Provider");
|
|
56
19
|
return e;
|
|
57
|
-
},
|
|
20
|
+
}, E = [
|
|
58
21
|
"day",
|
|
59
22
|
"week",
|
|
60
23
|
"month",
|
|
61
24
|
"quarter",
|
|
62
25
|
"quarterMonth",
|
|
63
26
|
"year"
|
|
64
|
-
],
|
|
27
|
+
], D = [
|
|
65
28
|
"halfDay",
|
|
66
29
|
"sixHour",
|
|
67
30
|
"hour",
|
|
68
31
|
"halfHour",
|
|
69
32
|
"tenMinute",
|
|
70
33
|
"oneMinute"
|
|
71
|
-
],
|
|
72
|
-
|
|
73
|
-
var
|
|
34
|
+
], O = [...E, ...D];
|
|
35
|
+
e.gantt.zoom;
|
|
36
|
+
var k = [...[...D].reverse(), ...E], A = 1440 * 60 * 1e3, j = A / 24, M = j / 60, N = {
|
|
74
37
|
halfDay: 12 * j,
|
|
75
38
|
sixHour: 6 * j,
|
|
76
39
|
hour: j,
|
|
77
40
|
halfHour: 30 * M,
|
|
78
41
|
tenMinute: 10 * M,
|
|
79
42
|
oneMinute: M
|
|
80
|
-
},
|
|
43
|
+
}, ee = {
|
|
81
44
|
halfDay: 80,
|
|
82
45
|
sixHour: 70,
|
|
83
46
|
hour: 50,
|
|
84
47
|
halfHour: 45,
|
|
85
48
|
tenMinute: 40,
|
|
86
49
|
oneMinute: 40
|
|
87
|
-
},
|
|
50
|
+
}, te = 30 / 40;
|
|
88
51
|
function P(e) {
|
|
89
|
-
return (e === "tenMinute" || e === "oneMinute" ? 30 : Math.round(
|
|
52
|
+
return (e === "tenMinute" || e === "oneMinute" ? 30 : Math.round(ee[e] * te)) * (A / N[e]);
|
|
90
53
|
}
|
|
91
54
|
var F = {
|
|
92
55
|
day: 30,
|
|
@@ -101,7 +64,7 @@ var F = {
|
|
|
101
64
|
halfHour: P("halfHour"),
|
|
102
65
|
tenMinute: P("tenMinute"),
|
|
103
66
|
oneMinute: P("oneMinute")
|
|
104
|
-
},
|
|
67
|
+
}, ne = {
|
|
105
68
|
halfDay: 30,
|
|
106
69
|
sixHour: 14,
|
|
107
70
|
hour: 7,
|
|
@@ -110,33 +73,33 @@ var F = {
|
|
|
110
73
|
oneMinute: 0
|
|
111
74
|
};
|
|
112
75
|
function I(e) {
|
|
113
|
-
return
|
|
76
|
+
return D.includes(e);
|
|
114
77
|
}
|
|
115
78
|
function L(e) {
|
|
116
79
|
return I(e) ? N[e] : A;
|
|
117
80
|
}
|
|
118
|
-
function
|
|
81
|
+
function re(e, t) {
|
|
119
82
|
return t * (L(e) / A);
|
|
120
83
|
}
|
|
121
84
|
function R(e, t, n) {
|
|
122
85
|
return (e.valueOf() - t.valueOf()) / A * n;
|
|
123
86
|
}
|
|
124
|
-
function
|
|
87
|
+
function ie(e, t, n) {
|
|
125
88
|
let r = e / n * A;
|
|
126
89
|
return t.add(r, "millisecond");
|
|
127
90
|
}
|
|
128
91
|
//#endregion
|
|
129
92
|
//#region src/components/Gantt/utils/time.ts
|
|
130
|
-
var z = (e) => e ? b().tz(e) : b(),
|
|
93
|
+
var z = (e) => e ? b().tz(e) : b(), B = (e, t) => i(e, t), V = (n, r) => t(e, n, r), H = (e) => `calendar.monthShort.${e}`, U = (e) => `gantt.quarter.${e + 1}`, ae = new Set([
|
|
131
94
|
"halfDay",
|
|
132
95
|
"sixHour",
|
|
133
96
|
"hour"
|
|
134
|
-
]),
|
|
97
|
+
]), oe = new Set([
|
|
135
98
|
"halfHour",
|
|
136
99
|
"tenMinute",
|
|
137
100
|
"oneMinute"
|
|
138
101
|
]);
|
|
139
|
-
function
|
|
102
|
+
function se(e, t, n) {
|
|
140
103
|
switch (t) {
|
|
141
104
|
case "halfDay": return e.hour() < 12 ? n("gantt.am") : n("gantt.pm");
|
|
142
105
|
case "sixHour": {
|
|
@@ -153,7 +116,7 @@ function ue(e, t, n) {
|
|
|
153
116
|
default: return e.format("HH:mm");
|
|
154
117
|
}
|
|
155
118
|
}
|
|
156
|
-
function
|
|
119
|
+
function ce(e, t) {
|
|
157
120
|
let n = e.hour();
|
|
158
121
|
if (n === 0) {
|
|
159
122
|
let r = e.month() + 1;
|
|
@@ -161,12 +124,12 @@ function de(e, t) {
|
|
|
161
124
|
month: r,
|
|
162
125
|
day: e.date(),
|
|
163
126
|
hour: n,
|
|
164
|
-
monthShort: t(
|
|
127
|
+
monthShort: t(H(r))
|
|
165
128
|
});
|
|
166
129
|
}
|
|
167
130
|
return t("gantt.hour", { hour: n });
|
|
168
131
|
}
|
|
169
|
-
function
|
|
132
|
+
function le(e, t) {
|
|
170
133
|
switch (t) {
|
|
171
134
|
case "halfDay": return e.add(12, "hour");
|
|
172
135
|
case "sixHour": return e.add(6, "hour");
|
|
@@ -177,26 +140,26 @@ function fe(e, t) {
|
|
|
177
140
|
default: return e.add(1, "hour");
|
|
178
141
|
}
|
|
179
142
|
}
|
|
180
|
-
function
|
|
143
|
+
function ue(e, t, n, r = V) {
|
|
181
144
|
let i = [], a = "", o = null;
|
|
182
145
|
return e.forEach((e, s) => {
|
|
183
146
|
let c, l, u = e.date.year(), d = e.date.month() + 1;
|
|
184
|
-
if (
|
|
147
|
+
if (ae.has(t)) c = e.date.format("YYYY-MM-DD"), l = r("gantt.yearMonthDay", {
|
|
185
148
|
year: u,
|
|
186
149
|
month: d,
|
|
187
150
|
day: e.date.date(),
|
|
188
|
-
monthShort: r(
|
|
151
|
+
monthShort: r(H(d))
|
|
189
152
|
});
|
|
190
|
-
else if (
|
|
153
|
+
else if (oe.has(t)) c = e.date.format("YYYY-MM-DD-HH"), l = ce(e.date, r);
|
|
191
154
|
else if (t === "day" || t === "week") c = e.date.format("YYYY-MM"), l = r("calendar.yearMonth", {
|
|
192
155
|
year: u,
|
|
193
|
-
monthShort: r(
|
|
156
|
+
monthShort: r(H(d))
|
|
194
157
|
});
|
|
195
158
|
else if (t === "quarterMonth") {
|
|
196
159
|
let t = Math.floor(e.date.month() / 3);
|
|
197
160
|
c = `${u}-Q${t + 1}`, l = r("gantt.yearQuarter", {
|
|
198
161
|
year: u,
|
|
199
|
-
quarter: r(
|
|
162
|
+
quarter: r(U(t))
|
|
200
163
|
});
|
|
201
164
|
} else c = e.date.format("YYYY"), l = r("gantt.year", { year: u });
|
|
202
165
|
c === a ? o && (o.span++, o.widthPx += e.days * n) : (o && i.push(o), a = c, o = {
|
|
@@ -207,14 +170,14 @@ function pe(e, t, n, r = se) {
|
|
|
207
170
|
});
|
|
208
171
|
}), o && i.push(o), i;
|
|
209
172
|
}
|
|
210
|
-
function
|
|
173
|
+
function W(e, t, n, r, i = V) {
|
|
211
174
|
let a = [];
|
|
212
175
|
if (I(n)) {
|
|
213
176
|
let o = N[n] / A, s = e;
|
|
214
177
|
for (let e = 0; e < t; e++) {
|
|
215
|
-
let e = s, t =
|
|
178
|
+
let e = s, t = le(e, n), c = !r.isBefore(e) && r.isBefore(t);
|
|
216
179
|
a.push({
|
|
217
|
-
label:
|
|
180
|
+
label: se(e, n, i),
|
|
218
181
|
isToday: c,
|
|
219
182
|
isWeekend: !1,
|
|
220
183
|
date: e,
|
|
@@ -238,12 +201,12 @@ function me(e, t, n, r, i = se) {
|
|
|
238
201
|
}
|
|
239
202
|
case "month":
|
|
240
203
|
case "quarterMonth":
|
|
241
|
-
t = e.add(o, "month").startOf("month"), s = t.add(1, "month"), c = i(
|
|
204
|
+
t = e.add(o, "month").startOf("month"), s = t.add(1, "month"), c = i(H(t.month() + 1)), l = r.month() === t.month() && r.year() === t.year();
|
|
242
205
|
break;
|
|
243
206
|
case "quarter": {
|
|
244
207
|
t = e.add(o * 3, "month").startOf("month"), s = t.add(3, "month");
|
|
245
208
|
let n = Math.floor(t.month() / 3);
|
|
246
|
-
c = i(
|
|
209
|
+
c = i(U(n)), l = Math.floor(r.month() / 3) === n && r.year() === t.year();
|
|
247
210
|
break;
|
|
248
211
|
}
|
|
249
212
|
case "year": {
|
|
@@ -267,21 +230,21 @@ function me(e, t, n, r, i = se) {
|
|
|
267
230
|
}
|
|
268
231
|
return a;
|
|
269
232
|
}
|
|
270
|
-
function
|
|
233
|
+
function de(e, t) {
|
|
271
234
|
if (t === "oneMinute") return {
|
|
272
235
|
startDate: e.subtract(12, "hour").startOf("minute"),
|
|
273
236
|
count: 1440,
|
|
274
237
|
totalDays: 1
|
|
275
238
|
};
|
|
276
|
-
let n =
|
|
239
|
+
let n = ne[t], r = L(t), i = e.startOf("day").subtract(n, "day"), a = e.startOf("day").add(n + 1, "day").diff(i, "day", !0);
|
|
277
240
|
return {
|
|
278
241
|
startDate: i,
|
|
279
242
|
count: Math.max(1, Math.round(a * A / r)),
|
|
280
243
|
totalDays: a
|
|
281
244
|
};
|
|
282
245
|
}
|
|
283
|
-
function
|
|
284
|
-
if (I(t)) return
|
|
246
|
+
function G(e, t, n, r, i = 30) {
|
|
247
|
+
if (I(t)) return de(e, t);
|
|
285
248
|
let a = Math.ceil((r > 0 ? r : 375) / n) * (1 + i * 2), o = Math.floor(a / 2), s, c;
|
|
286
249
|
switch (t) {
|
|
287
250
|
case "day":
|
|
@@ -342,8 +305,8 @@ function H(e, t, n, r, i = 30) {
|
|
|
342
305
|
}
|
|
343
306
|
//#endregion
|
|
344
307
|
//#region src/components/Gantt/hooks/useGanttViewport.ts
|
|
345
|
-
function
|
|
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(() =>
|
|
308
|
+
function fe({ timeZone: e, initialZoomLevel: t = "day" }) {
|
|
309
|
+
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(() => G(r, n, c, o), [
|
|
347
310
|
r,
|
|
348
311
|
n,
|
|
349
312
|
c,
|
|
@@ -372,26 +335,26 @@ function ge({ timeZone: e, initialZoomLevel: t = "day" }) {
|
|
|
372
335
|
}
|
|
373
336
|
//#endregion
|
|
374
337
|
//#region src/components/Gantt/utils/viewportDateUtils.ts
|
|
375
|
-
function
|
|
376
|
-
return
|
|
338
|
+
function K(e, t, n, r) {
|
|
339
|
+
return ie(e + t / 2, n, r);
|
|
377
340
|
}
|
|
378
|
-
function
|
|
341
|
+
function q(e, t, n, r) {
|
|
379
342
|
let i = R(e, t, n);
|
|
380
343
|
return Math.max(0, i - r / 2);
|
|
381
344
|
}
|
|
382
345
|
//#endregion
|
|
383
346
|
//#region src/components/Gantt/utils/zoomReanchor.ts
|
|
384
|
-
function
|
|
385
|
-
let a = F[e], o =
|
|
347
|
+
function pe({ currentZoomLevel: e, nextZoomLevel: t, currentAnchorDate: n, currentScrollLeft: r, viewportWidth: i }) {
|
|
348
|
+
let a = F[e], o = K(r, i, G(n, e, a, i).startDate, a), s = F[t];
|
|
386
349
|
return {
|
|
387
350
|
anchorDate: o,
|
|
388
|
-
scrollLeft:
|
|
351
|
+
scrollLeft: q(o, G(o, t, s, i).startDate, s, i)
|
|
389
352
|
};
|
|
390
353
|
}
|
|
391
354
|
//#endregion
|
|
392
355
|
//#region src/components/Gantt/hooks/useGanttScroll.ts
|
|
393
|
-
var
|
|
394
|
-
function
|
|
356
|
+
var me = 2;
|
|
357
|
+
function he(e, { onZoomLevelChange: t }) {
|
|
395
358
|
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
359
|
h.current = t;
|
|
397
360
|
let g = p({
|
|
@@ -429,7 +392,7 @@ function be(e, { onZoomLevelChange: t }) {
|
|
|
429
392
|
h.current(e);
|
|
430
393
|
return;
|
|
431
394
|
}
|
|
432
|
-
let { anchorDate: i, scrollLeft: a } =
|
|
395
|
+
let { anchorDate: i, scrollLeft: a } = pe({
|
|
433
396
|
currentZoomLevel: t,
|
|
434
397
|
nextZoomLevel: e,
|
|
435
398
|
currentAnchorDate: n,
|
|
@@ -438,12 +401,12 @@ function be(e, { onZoomLevelChange: t }) {
|
|
|
438
401
|
});
|
|
439
402
|
f(i), h.current(e), y.current = !0, b.current = a;
|
|
440
403
|
}, [f]), w = c(() => {
|
|
441
|
-
let { zoomLevel: e, pxPerDay: t, viewportWidth: r } = g.current, i = z(n), a =
|
|
404
|
+
let { zoomLevel: e, pxPerDay: t, viewportWidth: r } = g.current, i = z(n), a = q(i, G(i, e, t, r).startDate, t, r);
|
|
442
405
|
y.current = !0, b.current = a, f(i);
|
|
443
406
|
}, [n, f]);
|
|
444
407
|
return d(() => {
|
|
445
408
|
if (a <= 0 || v.current) return;
|
|
446
|
-
let e =
|
|
409
|
+
let e = q(i, o, l, a);
|
|
447
410
|
y.current = !0, b.current = e, v.current = !0;
|
|
448
411
|
}, [
|
|
449
412
|
i,
|
|
@@ -476,11 +439,11 @@ function be(e, { onZoomLevelChange: t }) {
|
|
|
476
439
|
}
|
|
477
440
|
let { viewportWidth: e, zoomLevel: t, pxPerDay: n, startDate: r, totalWidth: i } = g.current;
|
|
478
441
|
if (e <= 0) return;
|
|
479
|
-
let a = x(), o = Math.max(0, i - e), s = e *
|
|
442
|
+
let a = x(), o = Math.max(0, i - e), s = e * me, c = a < s, l = a > o - s;
|
|
480
443
|
if (!c && !l) return;
|
|
481
444
|
_.current = !0, y.current = !0;
|
|
482
|
-
let u =
|
|
483
|
-
b.current =
|
|
445
|
+
let u = K(a, e, r, n);
|
|
446
|
+
b.current = q(u, G(u, t, n, e).startDate, n, e), f(u);
|
|
484
447
|
}, [x, f]),
|
|
485
448
|
setZoomLevel: C,
|
|
486
449
|
handleTodayClick: w,
|
|
@@ -493,18 +456,18 @@ function be(e, { onZoomLevelChange: t }) {
|
|
|
493
456
|
S(o, Math.abs(o - t.scrollLeft) > i * 2 ? "auto" : "smooth");
|
|
494
457
|
return;
|
|
495
458
|
}
|
|
496
|
-
let c =
|
|
459
|
+
let c = q(e, G(e, a, n, i).startDate, n, i);
|
|
497
460
|
y.current = !0, b.current = c, f(e);
|
|
498
461
|
}, [S, f])
|
|
499
462
|
};
|
|
500
463
|
}
|
|
501
464
|
//#endregion
|
|
502
465
|
//#region src/components/Gantt/utils/color.ts
|
|
503
|
-
var
|
|
466
|
+
var ge = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, _e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, J = (e, t) => {
|
|
504
467
|
if (t < 0 || t > 1) return null;
|
|
505
|
-
let n = e.replace(
|
|
468
|
+
let n = e.replace(ge, (e, t, n, r) => t + t + n + n + r + r), r = _e.exec(n);
|
|
506
469
|
return r ? `rgba(${parseInt(r[1], 16)}, ${parseInt(r[2], 16)}, ${parseInt(r[3], 16)}, ${t})` : null;
|
|
507
|
-
},
|
|
470
|
+
}, ve = (e, t = 2.5) => {
|
|
508
471
|
if (!e) return "#121211";
|
|
509
472
|
let n, r, i;
|
|
510
473
|
if (e.startsWith("#")) {
|
|
@@ -524,7 +487,7 @@ var xe = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, Se = /^#?([a-f\d]{2})([a-f\d]{2})([
|
|
|
524
487
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
525
488
|
};
|
|
526
489
|
return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
|
|
527
|
-
},
|
|
490
|
+
}, ye = (e) => !e || !e.isValid() ? !1 : e.valueOf() !== e.startOf("day").valueOf(), be = (e, t) => {
|
|
528
491
|
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
492
|
return {
|
|
530
493
|
rawStart: n,
|
|
@@ -533,21 +496,21 @@ var xe = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, Se = /^#?([a-f\d]{2})([a-f\d]{2})([
|
|
|
533
496
|
baseEnd: a,
|
|
534
497
|
invalid: n !== null && r !== null && n.valueOf() > r.valueOf() || i === null || a === null || a.valueOf() <= i.valueOf()
|
|
535
498
|
};
|
|
536
|
-
},
|
|
499
|
+
}, xe = (e, t) => I(t) && (ye(e.rawStart) || ye(e.rawEnd)) ? {
|
|
537
500
|
start: e.rawStart,
|
|
538
501
|
end: e.rawEnd
|
|
539
502
|
} : {
|
|
540
503
|
start: e.baseStart,
|
|
541
504
|
end: e.baseEnd
|
|
542
|
-
},
|
|
543
|
-
function
|
|
544
|
-
let { startDate: r, pxPerDay: i, zoomLevel: a } = t, o = I(a) ?
|
|
505
|
+
}, Se = (e) => e === void 0 ? 1 : Number.isFinite(e) ? e < 0 || e > 1 ? 1 : e : 0;
|
|
506
|
+
function Ce(e, t, n) {
|
|
507
|
+
let { startDate: r, pxPerDay: i, zoomLevel: a } = t, o = I(a) ? re(a, i) : i, s = I(a) ? r : r.startOf("day");
|
|
545
508
|
return e.map((e, t) => {
|
|
546
|
-
let r =
|
|
509
|
+
let r = B(e.startTime, n), c = B(e.endTime, n), l = r.isValid(), u = c.isValid(), d = l ? r : null, f = u ? c : null, p = e.color || "#5170E8", m = J(p, .2) || `${p}33`, h = Se(e.progress), g = 0, _ = 0, v = !1;
|
|
547
510
|
if (d && f) {
|
|
548
|
-
let e =
|
|
511
|
+
let e = be(d, f);
|
|
549
512
|
if (!e.invalid) {
|
|
550
|
-
let { start: t, end: n } =
|
|
513
|
+
let { start: t, end: n } = xe(e, a);
|
|
551
514
|
if (t && n) {
|
|
552
515
|
v = !0, g = R(t, s, i);
|
|
553
516
|
let e = R(n, s, i);
|
|
@@ -573,14 +536,14 @@ function De(e, t, n) {
|
|
|
573
536
|
}
|
|
574
537
|
//#endregion
|
|
575
538
|
//#region src/components/Gantt/utils/theme/resolveGanttThemeVars.ts
|
|
576
|
-
var
|
|
539
|
+
var we = "#0265ff", Te = (e) => {
|
|
577
540
|
if (!e) return {};
|
|
578
|
-
let t = e.colorPrimary ??
|
|
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 ??
|
|
580
|
-
},
|
|
541
|
+
let t = e.colorPrimary ?? we, n = {};
|
|
542
|
+
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 ?? J(t, .2) ?? void 0), a(n, "--bsy-mobile-gantt-toolbar-today-hover-bg", e.toolbarTodayHoverBg ?? J(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;
|
|
543
|
+
}, Y = (...e) => e.filter(Boolean).join(" ");
|
|
581
544
|
//#endregion
|
|
582
545
|
//#region src/components/Gantt/utils/calcTodayLeft.ts
|
|
583
|
-
function
|
|
546
|
+
function Ee(e, t, n, r, i = "day") {
|
|
584
547
|
let a = r * n;
|
|
585
548
|
if (I(i)) {
|
|
586
549
|
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;
|
|
@@ -591,18 +554,18 @@ function q(e, t, n, r, i = "day") {
|
|
|
591
554
|
}
|
|
592
555
|
//#endregion
|
|
593
556
|
//#region src/components/Gantt/utils/msUntilNextDay.ts
|
|
594
|
-
function
|
|
557
|
+
function De(e) {
|
|
595
558
|
let t = z(e);
|
|
596
559
|
return t.add(1, "day").startOf("day").add(1, "millisecond").valueOf() - t.valueOf();
|
|
597
560
|
}
|
|
598
|
-
function
|
|
599
|
-
if (t <= 0) return
|
|
561
|
+
function Oe(e, t) {
|
|
562
|
+
if (t <= 0) return De(e);
|
|
600
563
|
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;
|
|
601
564
|
return Math.max(1, o - n.valueOf());
|
|
602
565
|
}
|
|
603
566
|
//#endregion
|
|
604
567
|
//#region src/components/Gantt/hooks/useTodayTracker.ts
|
|
605
|
-
function
|
|
568
|
+
function ke(e, t = "day") {
|
|
606
569
|
let [n, r] = m(() => z(e)), i = p(e);
|
|
607
570
|
i.current = e;
|
|
608
571
|
let a = p(t);
|
|
@@ -610,7 +573,7 @@ function Y(e, t = "day") {
|
|
|
610
573
|
let o = c(() => z(i.current), []);
|
|
611
574
|
return u(() => {
|
|
612
575
|
let e, t = () => {
|
|
613
|
-
let n = a.current, s = i.current, c = I(n) ?
|
|
576
|
+
let n = a.current, s = i.current, c = I(n) ? Oe(s, L(n)) : De(s);
|
|
614
577
|
e = setTimeout(() => {
|
|
615
578
|
r(o()), t();
|
|
616
579
|
}, c);
|
|
@@ -629,75 +592,113 @@ function Y(e, t = "day") {
|
|
|
629
592
|
]), n;
|
|
630
593
|
}
|
|
631
594
|
//#endregion
|
|
632
|
-
//#region src/components/Gantt/
|
|
633
|
-
var
|
|
634
|
-
|
|
595
|
+
//#region src/components/Gantt/Gantt.module.scss
|
|
596
|
+
var X = {
|
|
597
|
+
"bsy-mobile-gantt": "_bsy-mobile-gantt_1gpx8_1",
|
|
598
|
+
"bsy-mobile-gantt__scroll": "_bsy-mobile-gantt__scroll_1gpx8_18",
|
|
599
|
+
"bsy-mobile-gantt__canvas": "_bsy-mobile-gantt__canvas_1gpx8_28",
|
|
600
|
+
"bsy-mobile-gantt__overlay-host": "_bsy-mobile-gantt__overlay-host_1gpx8_34",
|
|
601
|
+
"bsy-mobile-gantt__header": "_bsy-mobile-gantt__header_1gpx8_43",
|
|
602
|
+
"bsy-mobile-gantt__header-row1": "_bsy-mobile-gantt__header-row1_1gpx8_50",
|
|
603
|
+
"bsy-mobile-gantt__header-row2": "_bsy-mobile-gantt__header-row2_1gpx8_54",
|
|
604
|
+
"bsy-mobile-gantt__header-cell": "_bsy-mobile-gantt__header-cell_1gpx8_57",
|
|
605
|
+
"bsy-mobile-gantt__header-cell-label": "_bsy-mobile-gantt__header-cell-label_1gpx8_62",
|
|
606
|
+
"bsy-mobile-gantt__header-cell-label--today": "_bsy-mobile-gantt__header-cell-label--today_1gpx8_73",
|
|
607
|
+
"bsy-mobile-gantt__today-dot": "_bsy-mobile-gantt__today-dot_1gpx8_77",
|
|
608
|
+
"bsy-mobile-gantt__sticky-label": "_bsy-mobile-gantt__sticky-label_1gpx8_87",
|
|
609
|
+
"bsy-mobile-gantt__sticky-label-text": "_bsy-mobile-gantt__sticky-label-text_1gpx8_95",
|
|
610
|
+
"bsy-mobile-gantt__toolbar": "_bsy-mobile-gantt__toolbar_1gpx8_102",
|
|
611
|
+
"bsy-mobile-gantt__toolbar-zoom": "_bsy-mobile-gantt__toolbar-zoom_1gpx8_119",
|
|
612
|
+
"bsy-mobile-gantt__toolbar-today": "_bsy-mobile-gantt__toolbar-today_1gpx8_119",
|
|
613
|
+
"bsy-mobile-gantt__toolbar-nav": "_bsy-mobile-gantt__toolbar-nav_1gpx8_119",
|
|
614
|
+
"bsy-mobile-gantt__toolbar-divider": "_bsy-mobile-gantt__toolbar-divider_1gpx8_137",
|
|
615
|
+
"bsy-mobile-gantt__chevron": "_bsy-mobile-gantt__chevron_1gpx8_166",
|
|
616
|
+
"bsy-mobile-gantt__chevron--left": "_bsy-mobile-gantt__chevron--left_1gpx8_170",
|
|
617
|
+
"bsy-mobile-gantt__chevron--right": "_bsy-mobile-gantt__chevron--right_1gpx8_173",
|
|
618
|
+
"bsy-mobile-gantt__timeline": "_bsy-mobile-gantt__timeline_1gpx8_176",
|
|
619
|
+
"bsy-mobile-gantt__timeline-inner": "_bsy-mobile-gantt__timeline-inner_1gpx8_187",
|
|
620
|
+
"bsy-mobile-gantt__column": "_bsy-mobile-gantt__column_1gpx8_191",
|
|
621
|
+
"bsy-mobile-gantt__column--weekend": "_bsy-mobile-gantt__column--weekend_1gpx8_202",
|
|
622
|
+
"bsy-mobile-gantt__today-line": "_bsy-mobile-gantt__today-line_1gpx8_205",
|
|
623
|
+
"bsy-mobile-gantt__bar": "_bsy-mobile-gantt__bar_1gpx8_213",
|
|
624
|
+
"bsy-mobile-gantt__bar-track": "_bsy-mobile-gantt__bar-track_1gpx8_220",
|
|
625
|
+
"bsy-mobile-gantt__bar-progress": "_bsy-mobile-gantt__bar-progress_1gpx8_220",
|
|
626
|
+
"bsy-mobile-gantt__bar-label": "_bsy-mobile-gantt__bar-label_1gpx8_230",
|
|
627
|
+
"bsy-mobile-gantt__bar-label-overlay": "_bsy-mobile-gantt__bar-label-overlay_1gpx8_240",
|
|
628
|
+
"bsy-mobile-gantt__offscreen": "_bsy-mobile-gantt__offscreen_1gpx8_252",
|
|
629
|
+
"bsy-mobile-gantt__offscreen-layer": "_bsy-mobile-gantt__offscreen-layer_1gpx8_261",
|
|
630
|
+
"bsy-mobile-gantt__offscreen-row": "_bsy-mobile-gantt__offscreen-row_1gpx8_271",
|
|
631
|
+
"bsy-mobile-gantt__offscreen-arrow": "_bsy-mobile-gantt__offscreen-arrow_1gpx8_279",
|
|
632
|
+
"bsy-mobile-gantt-arrow-enter": "_bsy-mobile-gantt-arrow-enter_1gpx8_1",
|
|
633
|
+
"bsy-mobile-gantt__offscreen-arrow--right": "_bsy-mobile-gantt__offscreen-arrow--right_1gpx8_300"
|
|
634
|
+
}, Ae = ({ cell: e }) => /* @__PURE__ */ _("div", {
|
|
635
|
+
className: X["bsy-mobile-gantt__sticky-label"],
|
|
635
636
|
style: { width: e.widthPx },
|
|
636
637
|
children: /* @__PURE__ */ _("div", {
|
|
637
|
-
className:
|
|
638
|
+
className: X["bsy-mobile-gantt__sticky-label-text"],
|
|
638
639
|
children: e.label
|
|
639
640
|
})
|
|
640
|
-
}),
|
|
641
|
-
let { t: e } =
|
|
641
|
+
}), je = 34, Me = 8, Ne = 5, Pe = () => {
|
|
642
|
+
let { t: e } = n(), { zoomLevel: t, pxPerDay: r, timeZone: i, startDate: a, count: o, totalWidth: s, totalDays: c } = w(), { horizontalScrollRef: l } = T(), u = ke(i, t), d = f(() => W(a, o, t, u, e), [
|
|
642
643
|
a,
|
|
643
644
|
o,
|
|
644
645
|
t,
|
|
645
646
|
u,
|
|
646
647
|
e
|
|
647
|
-
]), p = f(() =>
|
|
648
|
+
]), p = f(() => ue(d, t, r, e), [
|
|
648
649
|
d,
|
|
649
650
|
t,
|
|
650
|
-
|
|
651
|
+
r,
|
|
651
652
|
e
|
|
652
|
-
]), m = f(() =>
|
|
653
|
+
]), m = f(() => Ee(u, a, r, c, t), [
|
|
653
654
|
u,
|
|
654
655
|
a,
|
|
655
|
-
|
|
656
|
+
r,
|
|
656
657
|
c,
|
|
657
658
|
t
|
|
658
|
-
]), h = f(() => d.map((e) => e.days *
|
|
659
|
+
]), h = f(() => d.map((e) => e.days * r), [d, r]), g = x({
|
|
659
660
|
count: d.length,
|
|
660
661
|
getScrollElement: () => l.current,
|
|
661
662
|
estimateSize: (e) => h[e],
|
|
662
663
|
horizontal: !0,
|
|
663
|
-
overscan:
|
|
664
|
+
overscan: Ne
|
|
664
665
|
});
|
|
665
666
|
return /* @__PURE__ */ v("div", {
|
|
666
|
-
className:
|
|
667
|
+
className: X["bsy-mobile-gantt__header"],
|
|
667
668
|
style: { width: s },
|
|
668
669
|
children: [
|
|
669
670
|
/* @__PURE__ */ _("div", {
|
|
670
|
-
className:
|
|
671
|
-
children: p.map((e) => /* @__PURE__ */ _(
|
|
671
|
+
className: X["bsy-mobile-gantt__header-row1"],
|
|
672
|
+
children: p.map((e) => /* @__PURE__ */ _(Ae, { cell: e }, `${e.label}-${e.startIndex}`))
|
|
672
673
|
}),
|
|
673
674
|
/* @__PURE__ */ _("div", {
|
|
674
|
-
className:
|
|
675
|
-
style: { height:
|
|
675
|
+
className: X["bsy-mobile-gantt__header-row2"],
|
|
676
|
+
style: { height: je },
|
|
676
677
|
children: g.getVirtualItems().map((e) => {
|
|
677
678
|
let t = d[e.index], n = Math.round(e.start), r = Math.max(1, Math.round(e.size));
|
|
678
679
|
return /* @__PURE__ */ _("div", {
|
|
679
|
-
className:
|
|
680
|
+
className: X["bsy-mobile-gantt__header-cell"],
|
|
680
681
|
style: {
|
|
681
682
|
left: n,
|
|
682
683
|
width: r,
|
|
683
684
|
height: "100%"
|
|
684
685
|
},
|
|
685
686
|
children: /* @__PURE__ */ _("div", {
|
|
686
|
-
className:
|
|
687
|
-
style: { lineHeight: `${
|
|
687
|
+
className: Y(X["bsy-mobile-gantt__header-cell-label"], t.isToday && X["bsy-mobile-gantt__header-cell-label--today"]),
|
|
688
|
+
style: { lineHeight: `${je}px` },
|
|
688
689
|
children: t.label
|
|
689
690
|
})
|
|
690
691
|
}, e.index);
|
|
691
692
|
})
|
|
692
693
|
}),
|
|
693
694
|
m === null ? null : /* @__PURE__ */ _("div", {
|
|
694
|
-
className:
|
|
695
|
-
style: { left: m -
|
|
695
|
+
className: X["bsy-mobile-gantt__today-dot"],
|
|
696
|
+
style: { left: m - Me / 2 }
|
|
696
697
|
})
|
|
697
698
|
]
|
|
698
699
|
});
|
|
699
|
-
},
|
|
700
|
-
let a = f(() =>
|
|
700
|
+
}, Fe = 2, Ie = ({ today: e, startDate: t, pxPerDay: n, totalDays: r, zoomLevel: i }) => {
|
|
701
|
+
let a = f(() => Ee(e, t, n, r, i), [
|
|
701
702
|
e,
|
|
702
703
|
t,
|
|
703
704
|
n,
|
|
@@ -705,23 +706,23 @@ var je = ({ cell: e }) => /* @__PURE__ */ _("div", {
|
|
|
705
706
|
i
|
|
706
707
|
]);
|
|
707
708
|
return a === null ? null : /* @__PURE__ */ _("div", {
|
|
708
|
-
className:
|
|
709
|
+
className: X["bsy-mobile-gantt__today-line"],
|
|
709
710
|
style: {
|
|
710
|
-
left: a -
|
|
711
|
-
width:
|
|
711
|
+
left: a - Fe / 2,
|
|
712
|
+
width: Fe
|
|
712
713
|
}
|
|
713
714
|
});
|
|
714
|
-
},
|
|
715
|
-
function
|
|
716
|
-
if (r > t -
|
|
715
|
+
}, Le = 26, Re = 6, Z = 4;
|
|
716
|
+
function ze(e, t, n, r) {
|
|
717
|
+
if (r > t - Z * 2) return "outside";
|
|
717
718
|
if (e < n) {
|
|
718
719
|
let i = e + t - n;
|
|
719
|
-
return r +
|
|
720
|
+
return r + Z > i ? "outside" : "overlay-sticky";
|
|
720
721
|
}
|
|
721
722
|
return "inside";
|
|
722
723
|
}
|
|
723
|
-
var
|
|
724
|
-
let o = e.progress > 0 ? Math.max(4, e.width * e.progress) : 0, s =
|
|
724
|
+
var Be = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, overlayHost: i, onClick: a }) => {
|
|
725
|
+
let o = e.progress > 0 ? Math.max(4, e.width * e.progress) : 0, s = ve(e.bgColor), c = p(null), [l, u] = m(0);
|
|
725
726
|
return d(() => {
|
|
726
727
|
if (!c.current || !e.label) {
|
|
727
728
|
u(0);
|
|
@@ -732,10 +733,10 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
732
733
|
let a = c.current, o = n.current;
|
|
733
734
|
if (!a || !o || !e.label) return;
|
|
734
735
|
let u = document.createElement("span");
|
|
735
|
-
u.className =
|
|
736
|
+
u.className = X["bsy-mobile-gantt__bar-label-overlay"], u.textContent = e.label, u.style.display = "none", u.style.color = s, i?.appendChild(u);
|
|
736
737
|
let d = () => {
|
|
737
|
-
let { scrollLeft: n } = o, i =
|
|
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 -
|
|
738
|
+
let { scrollLeft: n } = o, i = ze(e.left, e.width, n, l), c = i === "outside", d = i === "overlay-sticky", f = e.left + e.width - n;
|
|
739
|
+
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 + Re}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);
|
|
739
740
|
};
|
|
740
741
|
d(), o.addEventListener("scroll", d, { passive: !0 });
|
|
741
742
|
let f = r.current;
|
|
@@ -753,21 +754,21 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
753
754
|
t,
|
|
754
755
|
r
|
|
755
756
|
]), /* @__PURE__ */ v("div", {
|
|
756
|
-
className:
|
|
757
|
+
className: X["bsy-mobile-gantt__bar"],
|
|
757
758
|
style: {
|
|
758
759
|
top: t,
|
|
759
760
|
left: e.left,
|
|
760
761
|
width: e.width,
|
|
761
|
-
height:
|
|
762
|
+
height: Le
|
|
762
763
|
},
|
|
763
764
|
onClick: () => a?.(e.task),
|
|
764
765
|
children: [
|
|
765
766
|
/* @__PURE__ */ _("div", {
|
|
766
|
-
className:
|
|
767
|
+
className: X["bsy-mobile-gantt__bar-track"],
|
|
767
768
|
style: { backgroundColor: e.bgColor }
|
|
768
769
|
}),
|
|
769
770
|
o > 0 ? /* @__PURE__ */ _("div", {
|
|
770
|
-
className:
|
|
771
|
+
className: X["bsy-mobile-gantt__bar-progress"],
|
|
771
772
|
style: {
|
|
772
773
|
width: o,
|
|
773
774
|
backgroundColor: e.color,
|
|
@@ -776,23 +777,23 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
776
777
|
}) : null,
|
|
777
778
|
e.label ? /* @__PURE__ */ _("span", {
|
|
778
779
|
ref: c,
|
|
779
|
-
className:
|
|
780
|
+
className: X["bsy-mobile-gantt__bar-label"],
|
|
780
781
|
style: {
|
|
781
|
-
left:
|
|
782
|
-
maxWidth: e.width -
|
|
783
|
-
lineHeight: `${
|
|
782
|
+
left: Z,
|
|
783
|
+
maxWidth: e.width - Z * 2,
|
|
784
|
+
lineHeight: `${Le}px`,
|
|
784
785
|
color: s
|
|
785
786
|
},
|
|
786
787
|
children: e.label
|
|
787
788
|
}) : null
|
|
788
789
|
]
|
|
789
790
|
});
|
|
790
|
-
}),
|
|
791
|
-
let { t: a } =
|
|
791
|
+
}), Ve = s(({ direction: e, edge: t, offset: r, onClick: i }) => {
|
|
792
|
+
let { t: a } = n();
|
|
792
793
|
return /* @__PURE__ */ _("button", {
|
|
793
794
|
type: "button",
|
|
794
|
-
className:
|
|
795
|
-
style: { [t]:
|
|
795
|
+
className: Y(X["bsy-mobile-gantt__offscreen-arrow"], t === "right" && X["bsy-mobile-gantt__offscreen-arrow--right"]),
|
|
796
|
+
style: { [t]: r },
|
|
796
797
|
onClick: i,
|
|
797
798
|
"aria-label": a("gantt.locateTask"),
|
|
798
799
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -813,7 +814,7 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
813
814
|
})
|
|
814
815
|
})
|
|
815
816
|
});
|
|
816
|
-
}),
|
|
817
|
+
}), He = 24, Ue = 4, We = s(({ virtualRows: e, bars: t, horizontalScrollRef: n, viewportWidth: r, rowHeight: i, onNavigate: a }) => {
|
|
817
818
|
let [o, s] = m(() => n.current?.scrollLeft ?? 0), c = p(0);
|
|
818
819
|
u(() => {
|
|
819
820
|
let e = n.current;
|
|
@@ -829,25 +830,25 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
829
830
|
}, [n]);
|
|
830
831
|
let l = o + r;
|
|
831
832
|
return /* @__PURE__ */ _("div", {
|
|
832
|
-
className:
|
|
833
|
+
className: X["bsy-mobile-gantt__offscreen"],
|
|
833
834
|
children: /* @__PURE__ */ _("div", {
|
|
834
|
-
className:
|
|
835
|
+
className: X["bsy-mobile-gantt__offscreen-layer"],
|
|
835
836
|
children: e.map((e) => {
|
|
836
837
|
let n = t[e.index];
|
|
837
838
|
if (!n || !n.hasTimeRange) return null;
|
|
838
839
|
let r = n.left + n.width < o, s = n.left > l;
|
|
839
840
|
return !r && !s ? null : /* @__PURE__ */ v("div", {
|
|
840
|
-
className:
|
|
841
|
+
className: X["bsy-mobile-gantt__offscreen-row"],
|
|
841
842
|
style: {
|
|
842
|
-
top: e.start + (i -
|
|
843
|
-
height:
|
|
843
|
+
top: e.start + (i - He) / 2,
|
|
844
|
+
height: He
|
|
844
845
|
},
|
|
845
|
-
children: [r ? /* @__PURE__ */ _(
|
|
846
|
+
children: [r ? /* @__PURE__ */ _(Ve, {
|
|
846
847
|
direction: "left",
|
|
847
848
|
edge: "left",
|
|
848
849
|
offset: Ue,
|
|
849
850
|
onClick: () => a(n.startDate)
|
|
850
|
-
}) : null, s ? /* @__PURE__ */ _(
|
|
851
|
+
}) : null, s ? /* @__PURE__ */ _(Ve, {
|
|
851
852
|
direction: "right",
|
|
852
853
|
edge: "right",
|
|
853
854
|
offset: Ue,
|
|
@@ -858,20 +859,20 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
858
859
|
})
|
|
859
860
|
});
|
|
860
861
|
}), 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 } =
|
|
862
|
+
let { zoomLevel: r, pxPerDay: i, timeZone: a, startDate: o, count: s, totalWidth: c, totalDays: l, viewportWidth: d } = w(), { horizontalScrollRef: y, navigateToBar: b } = T(), S = ke(a, r), C = f(() => W(o, s, r, S), [
|
|
862
863
|
o,
|
|
863
864
|
s,
|
|
864
865
|
r,
|
|
865
|
-
|
|
866
|
-
]),
|
|
867
|
-
count:
|
|
866
|
+
S
|
|
867
|
+
]), E = e.length, D = Math.max(E * Q + qe, 0), O = p(null), k = f(() => C.map((e) => e.days * i), [C, i]), A = x({
|
|
868
|
+
count: C.length,
|
|
868
869
|
getScrollElement: () => y.current,
|
|
869
|
-
estimateSize: (e) =>
|
|
870
|
+
estimateSize: (e) => k[e],
|
|
870
871
|
horizontal: !0,
|
|
871
872
|
overscan: Ge
|
|
872
873
|
}), j = x({
|
|
873
|
-
count:
|
|
874
|
-
getScrollElement: () =>
|
|
874
|
+
count: E,
|
|
875
|
+
getScrollElement: () => O.current,
|
|
875
876
|
estimateSize: () => Q,
|
|
876
877
|
paddingStart: qe,
|
|
877
878
|
overscan: Ke
|
|
@@ -879,7 +880,7 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
879
880
|
return u(() => {
|
|
880
881
|
N(n?.current ?? null);
|
|
881
882
|
}, [n]), u(() => {
|
|
882
|
-
let e =
|
|
883
|
+
let e = O.current, t = M;
|
|
883
884
|
if (!e || !t) return;
|
|
884
885
|
let n = 0, r = () => {
|
|
885
886
|
n ||= window.requestAnimationFrame(() => {
|
|
@@ -890,25 +891,25 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
890
891
|
e.removeEventListener("scroll", r), n && window.cancelAnimationFrame(n);
|
|
891
892
|
};
|
|
892
893
|
}, [M]), /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
893
|
-
ref:
|
|
894
|
-
className:
|
|
894
|
+
ref: O,
|
|
895
|
+
className: X["bsy-mobile-gantt__timeline"],
|
|
895
896
|
style: { width: c },
|
|
896
897
|
children: /* @__PURE__ */ v("div", {
|
|
897
|
-
className:
|
|
898
|
+
className: X["bsy-mobile-gantt__timeline-inner"],
|
|
898
899
|
style: {
|
|
899
900
|
width: c,
|
|
900
|
-
height:
|
|
901
|
+
height: D || "100%"
|
|
901
902
|
},
|
|
902
903
|
children: [
|
|
903
904
|
A.getVirtualItems().map((e) => /* @__PURE__ */ _("div", {
|
|
904
|
-
className:
|
|
905
|
+
className: Y(X["bsy-mobile-gantt__column"], r === "day" && C[e.index]?.isWeekend && X["bsy-mobile-gantt__column--weekend"]),
|
|
905
906
|
style: {
|
|
906
907
|
width: e.size,
|
|
907
908
|
transform: `translateX(${e.start}px)`
|
|
908
909
|
}
|
|
909
910
|
}, e.index)),
|
|
910
|
-
/* @__PURE__ */ _(
|
|
911
|
-
today:
|
|
911
|
+
/* @__PURE__ */ _(Ie, {
|
|
912
|
+
today: S,
|
|
912
913
|
startDate: o,
|
|
913
914
|
pxPerDay: i,
|
|
914
915
|
totalDays: l,
|
|
@@ -916,11 +917,11 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
916
917
|
}),
|
|
917
918
|
j.map((n) => {
|
|
918
919
|
let r = e[n.index];
|
|
919
|
-
return !r || !r.hasTimeRange ? null : /* @__PURE__ */ _(
|
|
920
|
+
return !r || !r.hasTimeRange ? null : /* @__PURE__ */ _(Be, {
|
|
920
921
|
bar: r,
|
|
921
922
|
top: n.start,
|
|
922
923
|
horizontalScrollRef: y,
|
|
923
|
-
verticalScrollRef:
|
|
924
|
+
verticalScrollRef: O,
|
|
924
925
|
overlayHost: M,
|
|
925
926
|
onClick: t
|
|
926
927
|
}, r.id);
|
|
@@ -936,7 +937,7 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
936
937
|
onNavigate: b
|
|
937
938
|
}), M) : null] });
|
|
938
939
|
}, $ = ({ direction: e }) => /* @__PURE__ */ _("svg", {
|
|
939
|
-
className:
|
|
940
|
+
className: Y(X["bsy-mobile-gantt__chevron"], e === "left" && X["bsy-mobile-gantt__chevron--left"], e === "right" && X["bsy-mobile-gantt__chevron--right"]),
|
|
940
941
|
width: "16",
|
|
941
942
|
height: "16",
|
|
942
943
|
viewBox: "0 0 16 16",
|
|
@@ -948,7 +949,7 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
948
949
|
strokeWidth: "1.5"
|
|
949
950
|
})
|
|
950
951
|
}), Ye = () => {
|
|
951
|
-
let { t } =
|
|
952
|
+
let { t: e } = n(), { zoomLevel: t, viewportWidth: i, totalWidth: a } = w(), { setZoomLevel: o, getScrollLeft: s, scrollToX: l, handleTodayClick: u } = T(), [d, f] = m(!1), p = c(() => {
|
|
952
953
|
l(Math.max(0, s() - i), "smooth");
|
|
953
954
|
}, [
|
|
954
955
|
s,
|
|
@@ -964,44 +965,44 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
964
965
|
a
|
|
965
966
|
]);
|
|
966
967
|
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
967
|
-
className:
|
|
968
|
+
className: X["bsy-mobile-gantt__toolbar"],
|
|
968
969
|
children: [
|
|
969
970
|
/* @__PURE__ */ v("button", {
|
|
970
971
|
type: "button",
|
|
971
|
-
className:
|
|
972
|
+
className: X["bsy-mobile-gantt__toolbar-zoom"],
|
|
972
973
|
onClick: () => f(!0),
|
|
973
|
-
children: [/* @__PURE__ */ _("span", { children:
|
|
974
|
+
children: [/* @__PURE__ */ _("span", { children: e(`gantt.zoom.${t}`) }), /* @__PURE__ */ _($, { direction: "down" })]
|
|
974
975
|
}),
|
|
975
|
-
/* @__PURE__ */ _("div", { className:
|
|
976
|
+
/* @__PURE__ */ _("div", { className: X["bsy-mobile-gantt__toolbar-divider"] }),
|
|
976
977
|
/* @__PURE__ */ _("button", {
|
|
977
978
|
type: "button",
|
|
978
|
-
className:
|
|
979
|
+
className: X["bsy-mobile-gantt__toolbar-today"],
|
|
979
980
|
onClick: u,
|
|
980
|
-
children:
|
|
981
|
+
children: e("gantt.today")
|
|
981
982
|
}),
|
|
982
983
|
/* @__PURE__ */ _("button", {
|
|
983
984
|
type: "button",
|
|
984
|
-
className:
|
|
985
|
+
className: X["bsy-mobile-gantt__toolbar-nav"],
|
|
985
986
|
onClick: p,
|
|
986
|
-
"aria-label":
|
|
987
|
+
"aria-label": e("gantt.prevScreen"),
|
|
987
988
|
children: /* @__PURE__ */ _($, { direction: "left" })
|
|
988
989
|
}),
|
|
989
990
|
/* @__PURE__ */ _("button", {
|
|
990
991
|
type: "button",
|
|
991
|
-
className:
|
|
992
|
+
className: X["bsy-mobile-gantt__toolbar-nav"],
|
|
992
993
|
onClick: h,
|
|
993
|
-
"aria-label":
|
|
994
|
+
"aria-label": e("gantt.nextScreen"),
|
|
994
995
|
children: /* @__PURE__ */ _($, { direction: "right" })
|
|
995
996
|
})
|
|
996
997
|
]
|
|
997
|
-
}), /* @__PURE__ */ _(
|
|
998
|
+
}), /* @__PURE__ */ _(r, {
|
|
998
999
|
open: d,
|
|
999
1000
|
onClose: () => f(!1),
|
|
1000
|
-
title:
|
|
1001
|
-
actions:
|
|
1002
|
-
key:
|
|
1003
|
-
text:
|
|
1004
|
-
selected:
|
|
1001
|
+
title: e("gantt.zoomSheetTitle"),
|
|
1002
|
+
actions: k.map((n) => ({
|
|
1003
|
+
key: n,
|
|
1004
|
+
text: e(`gantt.zoom.${n}`),
|
|
1005
|
+
selected: t === n
|
|
1005
1006
|
})),
|
|
1006
1007
|
onAction: (e) => {
|
|
1007
1008
|
o(e.key), f(!1);
|
|
@@ -1013,10 +1014,10 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
1013
1014
|
defaultValuePropName: "defaultZoomLevel",
|
|
1014
1015
|
valuePropName: "zoomLevel",
|
|
1015
1016
|
trigger: "onZoomChange"
|
|
1016
|
-
}), c = p(null), l =
|
|
1017
|
+
}), c = p(null), l = fe({
|
|
1017
1018
|
timeZone: n,
|
|
1018
1019
|
initialZoomLevel: o
|
|
1019
|
-
}), u =
|
|
1020
|
+
}), u = he(l, { onZoomLevelChange: s }), d = f(() => Ce(t, {
|
|
1020
1021
|
startDate: l.startDate,
|
|
1021
1022
|
pxPerDay: l.pxPerDay,
|
|
1022
1023
|
zoomLevel: l.zoomLevel
|
|
@@ -1060,24 +1061,24 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
1060
1061
|
u.getScrollLeft,
|
|
1061
1062
|
u.handleTodayClick,
|
|
1062
1063
|
u.navigateToBar
|
|
1063
|
-
]), g = f(() =>
|
|
1064
|
-
return /* @__PURE__ */ _(
|
|
1064
|
+
]), g = f(() => Te(a), [a]);
|
|
1065
|
+
return /* @__PURE__ */ _(S.Provider, {
|
|
1065
1066
|
value: m,
|
|
1066
|
-
children: /* @__PURE__ */ _(
|
|
1067
|
+
children: /* @__PURE__ */ _(C.Provider, {
|
|
1067
1068
|
value: h,
|
|
1068
1069
|
children: /* @__PURE__ */ v("div", {
|
|
1069
1070
|
ref: l.containerRef,
|
|
1070
|
-
className:
|
|
1071
|
+
className: Y(X["bsy-mobile-gantt"], r),
|
|
1071
1072
|
style: g,
|
|
1072
1073
|
children: [
|
|
1073
1074
|
/* @__PURE__ */ _("div", {
|
|
1074
1075
|
ref: u.horizontalScrollRef,
|
|
1075
|
-
className:
|
|
1076
|
+
className: X["bsy-mobile-gantt__scroll"],
|
|
1076
1077
|
onScroll: u.handleHorizontalScroll,
|
|
1077
1078
|
children: /* @__PURE__ */ v("div", {
|
|
1078
|
-
className:
|
|
1079
|
+
className: X["bsy-mobile-gantt__canvas"],
|
|
1079
1080
|
style: { width: l.totalWidth },
|
|
1080
|
-
children: [/* @__PURE__ */ _(
|
|
1081
|
+
children: [/* @__PURE__ */ _(Pe, {}), /* @__PURE__ */ _(Je, {
|
|
1081
1082
|
bars: d,
|
|
1082
1083
|
onTaskClick: i,
|
|
1083
1084
|
overlayHostRef: c
|
|
@@ -1086,7 +1087,7 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
1086
1087
|
}),
|
|
1087
1088
|
/* @__PURE__ */ _("div", {
|
|
1088
1089
|
ref: c,
|
|
1089
|
-
className:
|
|
1090
|
+
className: X["bsy-mobile-gantt__overlay-host"],
|
|
1090
1091
|
style: { top: Xe }
|
|
1091
1092
|
}),
|
|
1092
1093
|
/* @__PURE__ */ _(Ye, {})
|
|
@@ -1096,4 +1097,4 @@ var Ve = s(({ bar: e, top: t, horizontalScrollRef: n, verticalScrollRef: r, over
|
|
|
1096
1097
|
});
|
|
1097
1098
|
};
|
|
1098
1099
|
//#endregion
|
|
1099
|
-
export {
|
|
1100
|
+
export { O as n, Ze as t };
|