@baishuyun/ui-mobile 0.6.1 → 0.8.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-DwrSlwyV.js → AMap-BwIa29WQ.js} +2 -2
- package/dist/AMap/index.js +4 -4
- package/dist/ActionSheet/ActionSheet-8cPpwho3.js +85 -0
- package/dist/ActionSheet/index.js +6 -4
- package/dist/Calendar/{Calendar-Bd6CS8y7.js → Calendar-B9IuDHRd.js} +611 -596
- package/dist/Calendar/{timeUtils-t4A3-Hr6.js → cssVars-E8Cq0tta.js} +3 -1
- package/dist/Calendar/index.js +4 -4
- package/dist/ConfigProvider/{ConfigProvider-DnlakyRE.js → ConfigProvider-CCXPxdJt.js} +29 -21
- package/dist/ConfigProvider/index.js +4 -3
- package/dist/ConfigProvider/{useLocale-CP8NRZoj.js → useLocale-D12uIZ9q.js} +1 -0
- package/dist/Gantt/{Gantt-CR7eRNVP.js → Gantt-fRNTYViS.js} +384 -379
- package/dist/Gantt/index.js +8 -6
- package/dist/Icon/{Icon-CFvcrGGg.js → Icon-OUPXAIEn.js} +1 -1
- package/dist/Icon/index.js +2 -2
- package/dist/Overlay/Overlay-YzAfhILA.js +61 -0
- package/dist/Overlay/index.js +3 -0
- package/dist/Popup/Popup-C1uwPnxj.js +78 -0
- package/dist/Popup/index.js +5 -0
- package/dist/components/ActionSheet/ActionSheet.d.ts +1 -1
- package/dist/components/ActionSheet/interface.d.ts +1 -2
- 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/ConfigProvider/ConfigProvider.d.ts +1 -1
- package/dist/components/ConfigProvider/context.d.ts +14 -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/Overlay/OverlayContext.d.ts +17 -0
- package/dist/components/Overlay/index.d.ts +2 -0
- package/dist/components/Popup/Popup.d.ts +3 -0
- package/dist/components/Popup/index.d.ts +2 -0
- package/dist/components/Popup/interface.d.ts +46 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/index.js +12 -10
- package/dist/locale/lang/en-US.json.d.ts +3 -0
- package/dist/locale/lang/zh-CN.json.d.ts +3 -0
- package/dist/locale/lang/zh-TW.json.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/utils/cssVars.d.ts +1 -0
- package/dist/vendors/{version-DsM7d69k.js → version-DdP63VFD.js} +1 -1
- package/package.json +2 -2
- package/dist/ActionSheet/ActionSheet-DbrKxa_y.js +0 -133
|
@@ -1,68 +1,66 @@
|
|
|
1
|
-
import { t as e } from "../ConfigProvider/useLocale-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useControllableValue as
|
|
6
|
-
import
|
|
1
|
+
import { t as e } from "../ConfigProvider/useLocale-D12uIZ9q.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "./cssVars-E8Cq0tta.js";
|
|
3
|
+
import a, { createContext as o, forwardRef 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";
|
|
4
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { useControllableValue as _, useLatest as v, useSize as y } from "ahooks";
|
|
6
|
+
import b from "dayjs";
|
|
7
7
|
//#region src/components/Calendar/Calendar.module.scss
|
|
8
|
-
var
|
|
9
|
-
"bsy-mobile-calendar": "_bsy-mobile-
|
|
10
|
-
"bsy-mobile-calendar__body": "_bsy-mobile-
|
|
11
|
-
},
|
|
12
|
-
let { t:
|
|
13
|
-
let e =
|
|
14
|
-
|
|
8
|
+
var x = {
|
|
9
|
+
"bsy-mobile-calendar": "_bsy-mobile-calendar_1c2fd_1",
|
|
10
|
+
"bsy-mobile-calendar__body": "_bsy-mobile-calendar__body_1c2fd_19"
|
|
11
|
+
}, S = o(null), C = ({ children: t, currentDate: i, setCurrentDate: a, viewMode: o, setViewMode: s, timeZone: l, events: u, onEventClick: d, onDayClick: p }) => {
|
|
12
|
+
let { t: m } = e(), g = f(() => r(l), [l]), _ = c(() => {
|
|
13
|
+
let e = n(l);
|
|
14
|
+
b(i).isSame(e, "day") || a(e.toDate());
|
|
15
15
|
}, [
|
|
16
16
|
i,
|
|
17
17
|
a,
|
|
18
|
-
|
|
19
|
-
]),
|
|
18
|
+
l
|
|
19
|
+
]), v = f(() => m("calendar.yearMonth", {
|
|
20
20
|
year: i.getFullYear(),
|
|
21
|
-
monthShort:
|
|
22
|
-
}), [i,
|
|
21
|
+
monthShort: m(`calendar.monthShort.${i.getMonth() + 1}`)
|
|
22
|
+
}), [i, m]), y = f(() => ({
|
|
23
23
|
currentDate: i,
|
|
24
24
|
setCurrentDate: a,
|
|
25
|
-
goToToday:
|
|
25
|
+
goToToday: _,
|
|
26
26
|
viewMode: o,
|
|
27
|
-
setViewMode:
|
|
28
|
-
yearMonthText:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onDayClick: h
|
|
27
|
+
setViewMode: s,
|
|
28
|
+
yearMonthText: v,
|
|
29
|
+
timeZone: l,
|
|
30
|
+
timezoneLabel: g,
|
|
31
|
+
events: u,
|
|
32
|
+
onEventClick: d,
|
|
33
|
+
onDayClick: p
|
|
35
34
|
}), [
|
|
36
35
|
i,
|
|
37
36
|
a,
|
|
38
|
-
|
|
37
|
+
_,
|
|
39
38
|
o,
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
s,
|
|
40
|
+
v,
|
|
42
41
|
l,
|
|
42
|
+
g,
|
|
43
43
|
u,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
p,
|
|
47
|
-
h
|
|
44
|
+
d,
|
|
45
|
+
p
|
|
48
46
|
]);
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
value:
|
|
51
|
-
children:
|
|
47
|
+
return /* @__PURE__ */ h(S.Provider, {
|
|
48
|
+
value: y,
|
|
49
|
+
children: t
|
|
52
50
|
});
|
|
53
|
-
},
|
|
54
|
-
let e =
|
|
51
|
+
}, w = () => {
|
|
52
|
+
let e = l(S);
|
|
55
53
|
if (!e) throw Error("useCalendarContext must be used within a CalendarProvider");
|
|
56
54
|
return e;
|
|
57
|
-
},
|
|
58
|
-
"bsy-mobile-calendar-header": "_bsy-mobile-calendar-
|
|
59
|
-
"bsy-mobile-calendar-header__left": "_bsy-mobile-calendar-
|
|
60
|
-
"bsy-mobile-calendar-header__year-month": "_bsy-mobile-calendar-header__year-
|
|
61
|
-
"bsy-mobile-calendar-header__today": "_bsy-mobile-calendar-
|
|
62
|
-
"bsy-mobile-calendar-segmented": "_bsy-mobile-calendar-
|
|
63
|
-
"bsy-mobile-calendar-segmented__item": "_bsy-mobile-calendar-
|
|
64
|
-
"bsy-mobile-calendar-segmented__item--active": "_bsy-mobile-calendar-segmented__item--
|
|
65
|
-
},
|
|
55
|
+
}, T = (...e) => e.filter(Boolean).join(" "), E = {
|
|
56
|
+
"bsy-mobile-calendar-header": "_bsy-mobile-calendar-header_arzu9_1",
|
|
57
|
+
"bsy-mobile-calendar-header__left": "_bsy-mobile-calendar-header__left_arzu9_12",
|
|
58
|
+
"bsy-mobile-calendar-header__year-month": "_bsy-mobile-calendar-header__year-month_arzu9_18",
|
|
59
|
+
"bsy-mobile-calendar-header__today": "_bsy-mobile-calendar-header__today_arzu9_23",
|
|
60
|
+
"bsy-mobile-calendar-segmented": "_bsy-mobile-calendar-segmented_arzu9_33",
|
|
61
|
+
"bsy-mobile-calendar-segmented__item": "_bsy-mobile-calendar-segmented__item_arzu9_39",
|
|
62
|
+
"bsy-mobile-calendar-segmented__item--active": "_bsy-mobile-calendar-segmented__item--active_arzu9_50"
|
|
63
|
+
}, D = [
|
|
66
64
|
{
|
|
67
65
|
key: "calendar.viewDay",
|
|
68
66
|
value: "day"
|
|
@@ -75,40 +73,40 @@ var b = {
|
|
|
75
73
|
key: "calendar.viewMonth",
|
|
76
74
|
value: "month"
|
|
77
75
|
}
|
|
78
|
-
],
|
|
79
|
-
let { yearMonthText: t, goToToday: n, viewMode: r, setViewMode: i } =
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
className:
|
|
82
|
-
children: [/* @__PURE__ */
|
|
83
|
-
className:
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
className:
|
|
76
|
+
], O = () => {
|
|
77
|
+
let { yearMonthText: t, goToToday: n, viewMode: r, setViewMode: i } = w(), { t: a } = e();
|
|
78
|
+
return /* @__PURE__ */ g("div", {
|
|
79
|
+
className: E["bsy-mobile-calendar-header"],
|
|
80
|
+
children: [/* @__PURE__ */ g("div", {
|
|
81
|
+
className: E["bsy-mobile-calendar-header__left"],
|
|
82
|
+
children: [/* @__PURE__ */ h("span", {
|
|
83
|
+
className: E["bsy-mobile-calendar-header__year-month"],
|
|
86
84
|
children: t
|
|
87
|
-
}), /* @__PURE__ */
|
|
88
|
-
className:
|
|
85
|
+
}), /* @__PURE__ */ h("button", {
|
|
86
|
+
className: E["bsy-mobile-calendar-header__today"],
|
|
89
87
|
onClick: n,
|
|
90
88
|
type: "button",
|
|
91
89
|
children: a("calendar.today")
|
|
92
90
|
})]
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
-
className:
|
|
91
|
+
}), /* @__PURE__ */ h("div", {
|
|
92
|
+
className: E["bsy-mobile-calendar-segmented"],
|
|
95
93
|
role: "tablist",
|
|
96
|
-
children:
|
|
94
|
+
children: D.map((e) => /* @__PURE__ */ h("button", {
|
|
97
95
|
type: "button",
|
|
98
96
|
role: "tab",
|
|
99
97
|
"aria-selected": r === e.value,
|
|
100
|
-
className:
|
|
98
|
+
className: T(E["bsy-mobile-calendar-segmented__item"], r === e.value && E["bsy-mobile-calendar-segmented__item--active"]),
|
|
101
99
|
onClick: () => i(e.value),
|
|
102
100
|
children: a(e.key)
|
|
103
101
|
}, e.value))
|
|
104
102
|
})]
|
|
105
103
|
});
|
|
106
|
-
},
|
|
104
|
+
}, k = "0.4s", A = "cubic-bezier(0.25, 0.8, 0.25, 1)", j = 26, M = {
|
|
107
105
|
HEADER_HEIGHT: 24,
|
|
108
106
|
SLOT_HEIGHT: 22,
|
|
109
107
|
SLOT_GAP: 4,
|
|
110
108
|
WEEK_PADDING_X: 10
|
|
111
|
-
},
|
|
109
|
+
}, N = [
|
|
112
110
|
1,
|
|
113
111
|
2,
|
|
114
112
|
3,
|
|
@@ -116,58 +114,58 @@ var b = {
|
|
|
116
114
|
5,
|
|
117
115
|
6,
|
|
118
116
|
7
|
|
119
|
-
],
|
|
120
|
-
"bsy-mobile-calendar-month": "_bsy-mobile-calendar-
|
|
121
|
-
"bsy-mobile-calendar-weekday-header": "_bsy-mobile-calendar-weekday-
|
|
122
|
-
"bsy-mobile-calendar-weekday-header__item": "_bsy-mobile-calendar-weekday-
|
|
123
|
-
"bsy-mobile-calendar-carousel": "_bsy-mobile-calendar-
|
|
124
|
-
"bsy-mobile-calendar-month-slide": "_bsy-mobile-calendar-month-
|
|
125
|
-
"bsy-mobile-calendar-week-row": "_bsy-mobile-calendar-week-
|
|
126
|
-
"bsy-mobile-calendar-week-row__cells": "_bsy-mobile-calendar-week-
|
|
127
|
-
"bsy-mobile-calendar-day-cell": "_bsy-mobile-calendar-day-
|
|
128
|
-
"bsy-mobile-calendar-day-cell__header": "_bsy-mobile-calendar-day-
|
|
129
|
-
"bsy-mobile-calendar-day-cell__body": "_bsy-mobile-calendar-day-
|
|
130
|
-
"bsy-mobile-calendar-day-cell__text": "_bsy-mobile-calendar-day-
|
|
131
|
-
"bsy-mobile-calendar-day-cell__text--today": "_bsy-mobile-calendar-day-cell__text--
|
|
132
|
-
"bsy-mobile-calendar-day-cell__text--other": "_bsy-mobile-calendar-day-cell__text--
|
|
133
|
-
"bsy-mobile-calendar-day-cell__badge": "_bsy-mobile-calendar-day-
|
|
134
|
-
"bsy-mobile-calendar-week-events": "_bsy-mobile-calendar-week-
|
|
135
|
-
"bsy-mobile-calendar-week-events__segment": "_bsy-mobile-calendar-week-
|
|
117
|
+
], P = {
|
|
118
|
+
"bsy-mobile-calendar-month": "_bsy-mobile-calendar-month_1t8o8_1",
|
|
119
|
+
"bsy-mobile-calendar-weekday-header": "_bsy-mobile-calendar-weekday-header_1t8o8_7",
|
|
120
|
+
"bsy-mobile-calendar-weekday-header__item": "_bsy-mobile-calendar-weekday-header__item_1t8o8_13",
|
|
121
|
+
"bsy-mobile-calendar-carousel": "_bsy-mobile-calendar-carousel_1t8o8_21",
|
|
122
|
+
"bsy-mobile-calendar-month-slide": "_bsy-mobile-calendar-month-slide_1t8o8_29",
|
|
123
|
+
"bsy-mobile-calendar-week-row": "_bsy-mobile-calendar-week-row_1t8o8_36",
|
|
124
|
+
"bsy-mobile-calendar-week-row__cells": "_bsy-mobile-calendar-week-row__cells_1t8o8_45",
|
|
125
|
+
"bsy-mobile-calendar-day-cell": "_bsy-mobile-calendar-day-cell_1t8o8_50",
|
|
126
|
+
"bsy-mobile-calendar-day-cell__header": "_bsy-mobile-calendar-day-cell__header_1t8o8_56",
|
|
127
|
+
"bsy-mobile-calendar-day-cell__body": "_bsy-mobile-calendar-day-cell__body_1t8o8_64",
|
|
128
|
+
"bsy-mobile-calendar-day-cell__text": "_bsy-mobile-calendar-day-cell__text_1t8o8_68",
|
|
129
|
+
"bsy-mobile-calendar-day-cell__text--today": "_bsy-mobile-calendar-day-cell__text--today_1t8o8_77",
|
|
130
|
+
"bsy-mobile-calendar-day-cell__text--other": "_bsy-mobile-calendar-day-cell__text--other_1t8o8_83",
|
|
131
|
+
"bsy-mobile-calendar-day-cell__badge": "_bsy-mobile-calendar-day-cell__badge_1t8o8_86",
|
|
132
|
+
"bsy-mobile-calendar-week-events": "_bsy-mobile-calendar-week-events_1t8o8_102",
|
|
133
|
+
"bsy-mobile-calendar-week-events__segment": "_bsy-mobile-calendar-week-events__segment_1t8o8_113"
|
|
136
134
|
}, ee = () => {
|
|
137
135
|
let { t } = e();
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
className:
|
|
140
|
-
children:
|
|
141
|
-
className:
|
|
136
|
+
return /* @__PURE__ */ h("div", {
|
|
137
|
+
className: P["bsy-mobile-calendar-weekday-header"],
|
|
138
|
+
children: N.map((e) => /* @__PURE__ */ h("div", {
|
|
139
|
+
className: P["bsy-mobile-calendar-weekday-header__item"],
|
|
142
140
|
children: t(`calendar.weekday.${e}`)
|
|
143
141
|
}, e))
|
|
144
142
|
});
|
|
145
|
-
}, te =
|
|
146
|
-
return /* @__PURE__ */
|
|
143
|
+
}, te = s(function({ date: e, isCurrentMonth: t, isToday: n, hiddenCount: r = 0 }, i) {
|
|
144
|
+
return /* @__PURE__ */ g("div", {
|
|
147
145
|
ref: i,
|
|
148
|
-
className:
|
|
149
|
-
children: [/* @__PURE__ */
|
|
150
|
-
className:
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
-
className:
|
|
146
|
+
className: P["bsy-mobile-calendar-day-cell"],
|
|
147
|
+
children: [/* @__PURE__ */ g("div", {
|
|
148
|
+
className: P["bsy-mobile-calendar-day-cell__header"],
|
|
149
|
+
children: [/* @__PURE__ */ h("div", {
|
|
150
|
+
className: T(P["bsy-mobile-calendar-day-cell__text"], !t && P["bsy-mobile-calendar-day-cell__text--other"], n && P["bsy-mobile-calendar-day-cell__text--today"]),
|
|
153
151
|
children: e.date()
|
|
154
|
-
}), r > 0 ? /* @__PURE__ */
|
|
155
|
-
className:
|
|
152
|
+
}), r > 0 ? /* @__PURE__ */ g("div", {
|
|
153
|
+
className: P["bsy-mobile-calendar-day-cell__badge"],
|
|
156
154
|
children: ["+", r]
|
|
157
155
|
}) : null]
|
|
158
|
-
}), /* @__PURE__ */
|
|
156
|
+
}), /* @__PURE__ */ h("div", { className: P["bsy-mobile-calendar-day-cell__body"] })]
|
|
159
157
|
});
|
|
160
|
-
}),
|
|
161
|
-
"bsy-mobile-calendar-event-card": "_bsy-mobile-calendar-event-
|
|
162
|
-
"bsy-mobile-calendar-event-card--timed": "_bsy-mobile-calendar-event-card--
|
|
163
|
-
"bsy-mobile-calendar-event-card--start": "_bsy-mobile-calendar-event-card--
|
|
164
|
-
"bsy-mobile-calendar-event-card--end": "_bsy-mobile-calendar-event-card--
|
|
165
|
-
"bsy-mobile-calendar-event-card--continue": "_bsy-mobile-calendar-event-card--
|
|
166
|
-
"bsy-mobile-calendar-event-card__timed-body": "_bsy-mobile-calendar-event-card__timed-
|
|
167
|
-
"bsy-mobile-calendar-event-card__title": "_bsy-mobile-calendar-event-
|
|
168
|
-
"bsy-mobile-calendar-event-card__time": "_bsy-mobile-calendar-event-
|
|
169
|
-
},
|
|
170
|
-
className:
|
|
158
|
+
}), F = {
|
|
159
|
+
"bsy-mobile-calendar-event-card": "_bsy-mobile-calendar-event-card_v4uo1_1",
|
|
160
|
+
"bsy-mobile-calendar-event-card--timed": "_bsy-mobile-calendar-event-card--timed_v4uo1_17",
|
|
161
|
+
"bsy-mobile-calendar-event-card--start": "_bsy-mobile-calendar-event-card--start_v4uo1_30",
|
|
162
|
+
"bsy-mobile-calendar-event-card--end": "_bsy-mobile-calendar-event-card--end_v4uo1_34",
|
|
163
|
+
"bsy-mobile-calendar-event-card--continue": "_bsy-mobile-calendar-event-card--continue_v4uo1_38",
|
|
164
|
+
"bsy-mobile-calendar-event-card__timed-body": "_bsy-mobile-calendar-event-card__timed-body_v4uo1_42",
|
|
165
|
+
"bsy-mobile-calendar-event-card__title": "_bsy-mobile-calendar-event-card__title_v4uo1_46",
|
|
166
|
+
"bsy-mobile-calendar-event-card__time": "_bsy-mobile-calendar-event-card__time_v4uo1_42"
|
|
167
|
+
}, I = a.memo(({ label: e, showLabel: t = !0, isStart: n = !0, isEnd: r = !0, isContinue: i = !1, height: a = 22, style: o, className: s, onClick: c, variant: l = "allDay", timeText: u }) => /* @__PURE__ */ h("div", {
|
|
168
|
+
className: T(F["bsy-mobile-calendar-event-card"], l === "timed" && F["bsy-mobile-calendar-event-card--timed"], n && F["bsy-mobile-calendar-event-card--start"], r && F["bsy-mobile-calendar-event-card--end"], i && F["bsy-mobile-calendar-event-card--continue"], s),
|
|
171
169
|
style: {
|
|
172
170
|
height: a,
|
|
173
171
|
lineHeight: l === "timed" ? "normal" : `${a}px`,
|
|
@@ -177,13 +175,13 @@ var b = {
|
|
|
177
175
|
e.stopPropagation(), c();
|
|
178
176
|
} : void 0,
|
|
179
177
|
role: c ? "button" : void 0,
|
|
180
|
-
children: t ? l === "timed" ? /* @__PURE__ */
|
|
181
|
-
className:
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
-
className:
|
|
178
|
+
children: t ? l === "timed" ? /* @__PURE__ */ g("div", {
|
|
179
|
+
className: F["bsy-mobile-calendar-event-card__timed-body"],
|
|
180
|
+
children: [/* @__PURE__ */ h("div", {
|
|
181
|
+
className: F["bsy-mobile-calendar-event-card__title"],
|
|
184
182
|
children: e
|
|
185
|
-
}), !!u && /* @__PURE__ */
|
|
186
|
-
className:
|
|
183
|
+
}), !!u && /* @__PURE__ */ h("div", {
|
|
184
|
+
className: F["bsy-mobile-calendar-event-card__time"],
|
|
187
185
|
children: u
|
|
188
186
|
})]
|
|
189
187
|
}) : e : null
|
|
@@ -191,7 +189,7 @@ var b = {
|
|
|
191
189
|
//#endregion
|
|
192
190
|
//#region src/components/Calendar/utils/monthLayoutAlgorithm.ts
|
|
193
191
|
function ne(e) {
|
|
194
|
-
let { startCol: t, endCol: n, row: r } = e, { HEADER_HEIGHT: i, SLOT_HEIGHT: a, SLOT_GAP: o, WEEK_PADDING_X: s } =
|
|
192
|
+
let { startCol: t, endCol: n, row: r } = e, { HEADER_HEIGHT: i, SLOT_HEIGHT: a, SLOT_GAP: o, WEEK_PADDING_X: s } = M, c = 100 / 7, l = s;
|
|
195
193
|
return {
|
|
196
194
|
top: i + r * (a + o),
|
|
197
195
|
height: a,
|
|
@@ -199,8 +197,8 @@ function ne(e) {
|
|
|
199
197
|
width: `calc(${(n - t) * c}% - ${l}px)`
|
|
200
198
|
};
|
|
201
199
|
}
|
|
202
|
-
function
|
|
203
|
-
let r =
|
|
200
|
+
function L(e, t, n) {
|
|
201
|
+
let r = b(e.startTime), i = b(e.endTime), a = t.add(n, "day"), o = r.isBefore(t) ? t : r, s = i.isAfter(a) ? a : i, c = o.diff(t, "day"), l = r.startOf("day").diff(t.startOf("day"), "day"), u = s.hour() === 0 && s.minute() === 0 && s.second() === 0 ? s.diff(t, "day") : s.diff(t, "day") + 1;
|
|
204
202
|
return o.valueOf() === s.valueOf() && c >= 0 && c < n && (u = Math.min(c + 1, n)), {
|
|
205
203
|
event: e,
|
|
206
204
|
startDayIndex: c,
|
|
@@ -211,7 +209,7 @@ function I(e, t, n) {
|
|
|
211
209
|
}
|
|
212
210
|
function re(e, t, n) {
|
|
213
211
|
if (!e || e.length === 0) return /* @__PURE__ */ new Map();
|
|
214
|
-
let r = e.map((e) =>
|
|
212
|
+
let r = e.map((e) => L(e, t, n));
|
|
215
213
|
r.sort((e, t) => e.startDayIndex === t.startDayIndex ? t.span - e.span : e.startDayIndex - t.startDayIndex);
|
|
216
214
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
217
215
|
for (let e of r) {
|
|
@@ -254,7 +252,7 @@ function ie(e, t) {
|
|
|
254
252
|
function ae(e, t, n, r, i) {
|
|
255
253
|
let a = /* @__PURE__ */ new Set();
|
|
256
254
|
if (!t || t.length === 0) return a;
|
|
257
|
-
let o = t.map((e) =>
|
|
255
|
+
let o = t.map((e) => L(e, n, r)), s = Array.from({ length: r }, () => []);
|
|
258
256
|
for (let e of o) for (let t = e.startDayIndex; t < e.endDayIndex; t += 1) s[t].push(e);
|
|
259
257
|
for (let t = 0; t < r; t += 1) {
|
|
260
258
|
let n = s[t].filter((e) => !a.has(e.event.id));
|
|
@@ -269,7 +267,7 @@ function oe(e, t, n = 6) {
|
|
|
269
267
|
eventRowMap: /* @__PURE__ */ new Map(),
|
|
270
268
|
gridEvents: []
|
|
271
269
|
};
|
|
272
|
-
let i = re(e, t, r), a = e.map((e) =>
|
|
270
|
+
let i = re(e, t, r), a = e.map((e) => L(e, t, r)), o = Array.from({ length: n }, () => []);
|
|
273
271
|
for (let e of a) {
|
|
274
272
|
let t = ie(e, i.get(e.event.id) ?? 0);
|
|
275
273
|
for (let e of t) o[e.weekIndex].push(e);
|
|
@@ -288,14 +286,14 @@ function se(e, t, n) {
|
|
|
288
286
|
}
|
|
289
287
|
return r;
|
|
290
288
|
}
|
|
291
|
-
var ce =
|
|
292
|
-
let { onEventClick: r } =
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
-
className:
|
|
289
|
+
var ce = a.memo(({ segments: e, hiddenScheduleIds: t, maxVisibleRows: n }) => {
|
|
290
|
+
let { onEventClick: r } = w(), i = e.filter((e) => !t.has(e.event.id) && e.row < n);
|
|
291
|
+
return /* @__PURE__ */ h("div", {
|
|
292
|
+
className: P["bsy-mobile-calendar-week-events"],
|
|
295
293
|
children: i.map((e) => {
|
|
296
294
|
let t = ne(e), { event: n, isStart: i, isEnd: a, isWeekStart: o } = e, s = i || o;
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
className:
|
|
295
|
+
return /* @__PURE__ */ h(I, {
|
|
296
|
+
className: P["bsy-mobile-calendar-week-events__segment"],
|
|
299
297
|
label: n.label,
|
|
300
298
|
showLabel: s,
|
|
301
299
|
isStart: i,
|
|
@@ -315,7 +313,7 @@ var ce = i.memo(({ segments: e, hiddenScheduleIds: t, maxVisibleRows: n }) => {
|
|
|
315
313
|
//#endregion
|
|
316
314
|
//#region src/components/Calendar/utils/dateUtils.ts
|
|
317
315
|
function le(e) {
|
|
318
|
-
let t =
|
|
316
|
+
let t = b(e).startOf("isoWeek");
|
|
319
317
|
return Array.from({ length: 7 }, (e, n) => t.add(n, "day"));
|
|
320
318
|
}
|
|
321
319
|
function ue(e) {
|
|
@@ -328,47 +326,47 @@ function de(e) {
|
|
|
328
326
|
for (let n = 0; n < e.length; n += 7) t.push(e.slice(n, n + 7));
|
|
329
327
|
return t;
|
|
330
328
|
}
|
|
331
|
-
function
|
|
332
|
-
return e.isSame(
|
|
329
|
+
function R(e, t) {
|
|
330
|
+
return e.isSame(n(t), "day");
|
|
333
331
|
}
|
|
334
332
|
function fe(e, t) {
|
|
335
333
|
return e.isSame(t, "month");
|
|
336
334
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
335
|
+
function z(e) {
|
|
336
|
+
return b(e.startTime).format("YYYY-MM-DD") !== b(e.endTime).format("YYYY-MM-DD");
|
|
339
337
|
}
|
|
340
338
|
function pe(e, t) {
|
|
341
|
-
let n = t.startOf("day"), r =
|
|
339
|
+
let n = t.startOf("day"), r = b(e.startTime).startOf("day"), i = b(e.endTime).startOf("day");
|
|
342
340
|
return !n.isBefore(r) && !n.isAfter(i);
|
|
343
341
|
}
|
|
344
342
|
function me(e, t) {
|
|
345
343
|
let n = t.startOf("day");
|
|
346
344
|
return e.filter((e) => {
|
|
347
|
-
let t =
|
|
345
|
+
let t = b(e.startTime), r = b(e.endTime), i = t.startOf("day"), a = r.hour() === 0 && r.minute() === 0 && r.second() === 0, o = t.valueOf() === r.valueOf(), s = r.startOf("day");
|
|
348
346
|
return a && !o && (s = r.subtract(1, "day").startOf("day")), !n.isBefore(i) && !n.isAfter(s);
|
|
349
347
|
});
|
|
350
348
|
}
|
|
351
349
|
//#endregion
|
|
352
350
|
//#region src/components/Calendar/CalendarMonth/WeekRow/WeekRow.tsx
|
|
353
351
|
var he = ({ dates: e, monthDate: t, segments: n, hiddenCounts: r, hiddenScheduleIds: i, maxVisibleRows: a, cellRef: o, onDayClick: s }) => {
|
|
354
|
-
let { timeZone: c } =
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
className:
|
|
352
|
+
let { timeZone: c } = w();
|
|
353
|
+
return /* @__PURE__ */ g("div", {
|
|
354
|
+
className: P["bsy-mobile-calendar-week-row"],
|
|
357
355
|
onClick: (t) => {
|
|
358
356
|
if (!s) return;
|
|
359
357
|
let n = t.currentTarget.getBoundingClientRect(), r = t.clientX - n.left, i = n.width / 7, a = Math.floor(r / i);
|
|
360
358
|
a >= 0 && a < e.length && s(e[a]);
|
|
361
359
|
},
|
|
362
|
-
children: [/* @__PURE__ */
|
|
363
|
-
className:
|
|
364
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ h("div", {
|
|
361
|
+
className: P["bsy-mobile-calendar-week-row__cells"],
|
|
362
|
+
children: e.map((e, n) => /* @__PURE__ */ h(te, {
|
|
365
363
|
ref: n === 0 ? o : void 0,
|
|
366
364
|
date: e,
|
|
367
365
|
isCurrentMonth: fe(e, t),
|
|
368
|
-
isToday:
|
|
366
|
+
isToday: R(e, c),
|
|
369
367
|
hiddenCount: r[n] || 0
|
|
370
368
|
}, e.format("YYYY-MM-DD")))
|
|
371
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ h(ce, {
|
|
372
370
|
segments: n,
|
|
373
371
|
hiddenScheduleIds: i,
|
|
374
372
|
maxVisibleRows: a
|
|
@@ -378,14 +376,14 @@ var he = ({ dates: e, monthDate: t, segments: n, hiddenCounts: r, hiddenSchedule
|
|
|
378
376
|
//#endregion
|
|
379
377
|
//#region src/components/Calendar/hooks/useMonthDates.ts
|
|
380
378
|
function ge(e) {
|
|
381
|
-
return { weeks:
|
|
379
|
+
return { weeks: f(() => de(ue(e)), [e.format("YYYY-MM")]) };
|
|
382
380
|
}
|
|
383
381
|
//#endregion
|
|
384
382
|
//#region src/components/Calendar/hooks/useCellHeight.ts
|
|
385
|
-
var { HEADER_HEIGHT: _e, SLOT_HEIGHT: ve, SLOT_GAP: ye } =
|
|
383
|
+
var { HEADER_HEIGHT: _e, SLOT_HEIGHT: ve, SLOT_GAP: ye } = M;
|
|
386
384
|
function be() {
|
|
387
|
-
let e =
|
|
388
|
-
return
|
|
385
|
+
let e = p(null), [t, n] = m(2);
|
|
386
|
+
return u(() => {
|
|
389
387
|
let t = e.current;
|
|
390
388
|
if (!t) return;
|
|
391
389
|
let r = (e) => {
|
|
@@ -408,7 +406,7 @@ function be() {
|
|
|
408
406
|
//#endregion
|
|
409
407
|
//#region src/components/Calendar/hooks/useMonthEventLayout.ts
|
|
410
408
|
function xe({ events: e, monthDate: t, maxVisibleRows: n }) {
|
|
411
|
-
return
|
|
409
|
+
return f(() => {
|
|
412
410
|
if (!e || e.length === 0) return {
|
|
413
411
|
weekLayouts: Array.from({ length: 6 }, () => []),
|
|
414
412
|
hiddenScheduleIds: /* @__PURE__ */ new Set(),
|
|
@@ -434,13 +432,13 @@ var Se = ({ monthDate: e, containerWidth: t, events: n, style: r, onDayClick: i
|
|
|
434
432
|
monthDate: e,
|
|
435
433
|
maxVisibleRows: s
|
|
436
434
|
});
|
|
437
|
-
return /* @__PURE__ */
|
|
438
|
-
className:
|
|
435
|
+
return /* @__PURE__ */ h("div", {
|
|
436
|
+
className: P["bsy-mobile-calendar-month-slide"],
|
|
439
437
|
style: {
|
|
440
438
|
width: t,
|
|
441
439
|
...r
|
|
442
440
|
},
|
|
443
|
-
children: a.map((t, n) => /* @__PURE__ */
|
|
441
|
+
children: a.map((t, n) => /* @__PURE__ */ h(he, {
|
|
444
442
|
dates: t,
|
|
445
443
|
monthDate: e,
|
|
446
444
|
segments: c[n] || [],
|
|
@@ -451,20 +449,20 @@ var Se = ({ monthDate: e, containerWidth: t, events: n, style: r, onDayClick: i
|
|
|
451
449
|
onDayClick: i
|
|
452
450
|
}, `week-${n}`))
|
|
453
451
|
});
|
|
454
|
-
},
|
|
455
|
-
function
|
|
456
|
-
let r =
|
|
457
|
-
|
|
452
|
+
}, B = (e) => e.subtract(1, "month"), V = (e) => e.add(1, "month");
|
|
453
|
+
function Ce({ currentDate: e, setCurrentDate: t, containerWidth: n }) {
|
|
454
|
+
let r = f(() => [
|
|
455
|
+
B(e),
|
|
458
456
|
e,
|
|
459
|
-
|
|
460
|
-
], [e.format("YYYY-MM")]), [i, a] =
|
|
457
|
+
V(e)
|
|
458
|
+
], [e.format("YYYY-MM")]), [i, a] = m(0), [o, s] = m(!1), l = p({
|
|
461
459
|
startX: 0,
|
|
462
460
|
startY: 0,
|
|
463
461
|
startTime: 0,
|
|
464
462
|
isDragging: !1,
|
|
465
463
|
isVerticalScroll: !1,
|
|
466
464
|
directionLocked: !1
|
|
467
|
-
}), u =
|
|
465
|
+
}), u = v(e), d = v(t), h = v(n), g = v(i), _ = c((e) => {
|
|
468
466
|
if (l.current.isDragging) return;
|
|
469
467
|
let t = e.touches[0];
|
|
470
468
|
l.current = {
|
|
@@ -474,8 +472,8 @@ function we({ currentDate: e, setCurrentDate: t, containerWidth: n }) {
|
|
|
474
472
|
isDragging: !0,
|
|
475
473
|
isVerticalScroll: !1,
|
|
476
474
|
directionLocked: !1
|
|
477
|
-
},
|
|
478
|
-
}, []), y =
|
|
475
|
+
}, s(!1);
|
|
476
|
+
}, []), y = c((e) => {
|
|
479
477
|
if (!l.current.isDragging) return;
|
|
480
478
|
let t = e.touches[0], n = t.clientX - l.current.startX, r = t.clientY - l.current.startY;
|
|
481
479
|
if (!l.current.directionLocked && (Math.abs(n) > 10 || Math.abs(r) > 10) && (l.current.directionLocked = !0, Math.abs(r) > Math.abs(n))) {
|
|
@@ -483,34 +481,34 @@ function we({ currentDate: e, setCurrentDate: t, containerWidth: n }) {
|
|
|
483
481
|
return;
|
|
484
482
|
}
|
|
485
483
|
l.current.isVerticalScroll || a(n);
|
|
486
|
-
}, []), b =
|
|
484
|
+
}, []), b = c(() => {
|
|
487
485
|
if (!l.current.isDragging) return;
|
|
488
486
|
let e = h.current ?? 0, t = g.current ?? 0;
|
|
489
487
|
if (l.current.isDragging = !1, !e || l.current.isVerticalScroll) return;
|
|
490
488
|
let n = Date.now() - l.current.startTime, r = Math.abs(t) / n, i = Math.abs(t) > e * .35 || r > .3;
|
|
491
|
-
|
|
492
|
-
}, [h, g]), x =
|
|
493
|
-
let e = g.current ?? 0, t = u.current, n =
|
|
489
|
+
s(!0), a(i && t !== 0 ? -(t > 0 ? -1 : 1) * e : 0);
|
|
490
|
+
}, [h, g]), x = c(() => {
|
|
491
|
+
let e = g.current ?? 0, t = u.current, n = d.current;
|
|
494
492
|
if (e !== 0 && t && n) {
|
|
495
|
-
let r = (e > 0 ? -1 : 1) == 1 ?
|
|
496
|
-
|
|
493
|
+
let r = (e > 0 ? -1 : 1) == 1 ? V(t) : B(t);
|
|
494
|
+
s(!1), a(0), n(r);
|
|
497
495
|
}
|
|
498
496
|
}, [
|
|
499
497
|
g,
|
|
500
498
|
u,
|
|
501
|
-
|
|
499
|
+
d
|
|
502
500
|
]);
|
|
503
501
|
return {
|
|
504
502
|
months: r,
|
|
505
503
|
translateX: i,
|
|
506
504
|
transitionEnabled: o,
|
|
507
|
-
bindEvents:
|
|
508
|
-
onTouchStart:
|
|
505
|
+
bindEvents: f(() => ({
|
|
506
|
+
onTouchStart: _,
|
|
509
507
|
onTouchMove: y,
|
|
510
508
|
onTouchEnd: b,
|
|
511
509
|
onTouchCancel: b
|
|
512
510
|
}), [
|
|
513
|
-
|
|
511
|
+
_,
|
|
514
512
|
y,
|
|
515
513
|
b
|
|
516
514
|
]),
|
|
@@ -519,8 +517,8 @@ function we({ currentDate: e, setCurrentDate: t, containerWidth: n }) {
|
|
|
519
517
|
}
|
|
520
518
|
//#endregion
|
|
521
519
|
//#region src/components/Calendar/CalendarMonth/MonthCarousel/MonthCarousel.tsx
|
|
522
|
-
var
|
|
523
|
-
let { onDayClick: i } =
|
|
520
|
+
var we = ({ currentDate: e, setCurrentDate: t, containerWidth: n, events: r }) => {
|
|
521
|
+
let { onDayClick: i } = w(), { months: a, translateX: o, transitionEnabled: s, bindEvents: c, handleTransitionEnd: l } = Ce({
|
|
524
522
|
currentDate: e,
|
|
525
523
|
setCurrentDate: t,
|
|
526
524
|
containerWidth: n
|
|
@@ -528,10 +526,10 @@ var Te = ({ currentDate: e, setCurrentDate: t, containerWidth: n, events: r }) =
|
|
|
528
526
|
let t = me(r, e);
|
|
529
527
|
i?.(e.toDate(), t);
|
|
530
528
|
};
|
|
531
|
-
return n ? /* @__PURE__ */
|
|
532
|
-
className:
|
|
529
|
+
return n ? /* @__PURE__ */ h("div", {
|
|
530
|
+
className: P["bsy-mobile-calendar-carousel"],
|
|
533
531
|
...c,
|
|
534
|
-
children: /* @__PURE__ */
|
|
532
|
+
children: /* @__PURE__ */ h("div", {
|
|
535
533
|
style: {
|
|
536
534
|
width: n * 3,
|
|
537
535
|
marginLeft: -n,
|
|
@@ -542,7 +540,7 @@ var Te = ({ currentDate: e, setCurrentDate: t, containerWidth: n, events: r }) =
|
|
|
542
540
|
willChange: "transform"
|
|
543
541
|
},
|
|
544
542
|
onTransitionEnd: l,
|
|
545
|
-
children: a.map((e) => /* @__PURE__ */
|
|
543
|
+
children: a.map((e) => /* @__PURE__ */ h(Se, {
|
|
546
544
|
monthDate: e,
|
|
547
545
|
containerWidth: n,
|
|
548
546
|
events: r,
|
|
@@ -554,34 +552,34 @@ var Te = ({ currentDate: e, setCurrentDate: t, containerWidth: n, events: r }) =
|
|
|
554
552
|
}, e.format("YYYY-MM")))
|
|
555
553
|
})
|
|
556
554
|
}) : null;
|
|
557
|
-
},
|
|
558
|
-
let e =
|
|
555
|
+
}, Te = () => {
|
|
556
|
+
let e = p(null), t = y(e), { currentDate: n, setCurrentDate: r, events: i } = w(), a = f(() => b(n), [n]), o = c((e) => {
|
|
559
557
|
r(e.toDate());
|
|
560
558
|
}, [r]);
|
|
561
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ g("div", {
|
|
562
560
|
ref: e,
|
|
563
|
-
className:
|
|
564
|
-
children: [/* @__PURE__ */
|
|
561
|
+
className: P["bsy-mobile-calendar-month"],
|
|
562
|
+
children: [/* @__PURE__ */ h(ee, {}), /* @__PURE__ */ h(we, {
|
|
565
563
|
currentDate: a,
|
|
566
564
|
setCurrentDate: o,
|
|
567
565
|
containerWidth: t?.width ?? 0,
|
|
568
566
|
events: i
|
|
569
567
|
})]
|
|
570
568
|
});
|
|
571
|
-
},
|
|
572
|
-
function
|
|
573
|
-
let r =
|
|
574
|
-
|
|
569
|
+
}, H = (e) => e.subtract(1, "week"), U = (e) => e.add(1, "week");
|
|
570
|
+
function Ee({ selectedDate: e, setSelectedDate: t, containerWidth: n }) {
|
|
571
|
+
let r = f(() => [
|
|
572
|
+
H(e),
|
|
575
573
|
e,
|
|
576
|
-
|
|
577
|
-
], [e.format("YYYY-MM-DD")]), [i, a] =
|
|
574
|
+
U(e)
|
|
575
|
+
], [e.format("YYYY-MM-DD")]), [i, a] = m(0), [o, s] = m(!1), l = p({
|
|
578
576
|
startX: 0,
|
|
579
577
|
startY: 0,
|
|
580
578
|
startTime: 0,
|
|
581
579
|
isDragging: !1,
|
|
582
580
|
isVerticalScroll: !1,
|
|
583
581
|
directionLocked: !1
|
|
584
|
-
}), u =
|
|
582
|
+
}), u = v(e), d = v(t), h = v(n), g = v(i), _ = c((e) => {
|
|
585
583
|
if (l.current.isDragging) return;
|
|
586
584
|
let t = e.touches[0];
|
|
587
585
|
l.current = {
|
|
@@ -591,8 +589,8 @@ function De({ selectedDate: e, setSelectedDate: t, containerWidth: n }) {
|
|
|
591
589
|
isDragging: !0,
|
|
592
590
|
isVerticalScroll: !1,
|
|
593
591
|
directionLocked: !1
|
|
594
|
-
},
|
|
595
|
-
}, []), y =
|
|
592
|
+
}, s(!1);
|
|
593
|
+
}, []), y = c((e) => {
|
|
596
594
|
if (!l.current.isDragging) return;
|
|
597
595
|
let t = e.touches[0], n = t.clientX - l.current.startX, r = t.clientY - l.current.startY;
|
|
598
596
|
if (!l.current.directionLocked && (Math.abs(n) > 10 || Math.abs(r) > 10) && (l.current.directionLocked = !0, Math.abs(r) > Math.abs(n))) {
|
|
@@ -600,34 +598,34 @@ function De({ selectedDate: e, setSelectedDate: t, containerWidth: n }) {
|
|
|
600
598
|
return;
|
|
601
599
|
}
|
|
602
600
|
l.current.isVerticalScroll || a(n);
|
|
603
|
-
}, []), b =
|
|
601
|
+
}, []), b = c(() => {
|
|
604
602
|
if (!l.current.isDragging) return;
|
|
605
603
|
let e = h.current ?? 0, t = g.current ?? 0;
|
|
606
604
|
if (l.current.isDragging = !1, !e || l.current.isVerticalScroll) return;
|
|
607
605
|
let n = Date.now() - l.current.startTime, r = Math.abs(t) / n, i = Math.abs(t) > e * .35 || r > .3;
|
|
608
|
-
|
|
609
|
-
}, [h, g]), x =
|
|
610
|
-
let e = g.current ?? 0, t = u.current, n =
|
|
606
|
+
s(!0), a(i && t !== 0 ? -(t > 0 ? -1 : 1) * e : 0);
|
|
607
|
+
}, [h, g]), x = c(() => {
|
|
608
|
+
let e = g.current ?? 0, t = u.current, n = d.current;
|
|
611
609
|
if (e !== 0 && t && n) {
|
|
612
|
-
let r = (e > 0 ? -1 : 1) == 1 ?
|
|
613
|
-
|
|
610
|
+
let r = (e > 0 ? -1 : 1) == 1 ? U(t) : H(t);
|
|
611
|
+
s(!1), a(0), n(r);
|
|
614
612
|
}
|
|
615
613
|
}, [
|
|
616
614
|
g,
|
|
617
615
|
u,
|
|
618
|
-
|
|
616
|
+
d
|
|
619
617
|
]);
|
|
620
618
|
return {
|
|
621
619
|
weeks: r,
|
|
622
620
|
translateX: i,
|
|
623
621
|
transitionEnabled: o,
|
|
624
|
-
bindEvents:
|
|
625
|
-
onTouchStart:
|
|
622
|
+
bindEvents: f(() => ({
|
|
623
|
+
onTouchStart: _,
|
|
626
624
|
onTouchMove: y,
|
|
627
625
|
onTouchEnd: b,
|
|
628
626
|
onTouchCancel: b
|
|
629
627
|
}), [
|
|
630
|
-
|
|
628
|
+
_,
|
|
631
629
|
y,
|
|
632
630
|
b
|
|
633
631
|
]),
|
|
@@ -636,79 +634,79 @@ function De({ selectedDate: e, setSelectedDate: t, containerWidth: n }) {
|
|
|
636
634
|
}
|
|
637
635
|
//#endregion
|
|
638
636
|
//#region src/components/Calendar/CalendarDay/CalendarDay.module.scss
|
|
639
|
-
var
|
|
640
|
-
"bsy-mobile-calendar-day": "_bsy-mobile-calendar-
|
|
641
|
-
"bsy-mobile-calendar-day__header-wrap": "_bsy-mobile-calendar-day__header-
|
|
642
|
-
"bsy-mobile-calendar-day__header": "_bsy-mobile-calendar-
|
|
643
|
-
"bsy-mobile-calendar-day__tz": "_bsy-mobile-calendar-
|
|
644
|
-
"bsy-mobile-calendar-day__body": "_bsy-mobile-calendar-
|
|
645
|
-
"bsy-mobile-calendar-day__time-grid": "_bsy-mobile-calendar-day__time-
|
|
646
|
-
"bsy-mobile-calendar-day__time-col": "_bsy-mobile-calendar-day__time-
|
|
647
|
-
"bsy-mobile-calendar-day__time-label": "_bsy-mobile-calendar-day__time-
|
|
648
|
-
"bsy-mobile-calendar-day__content-col": "_bsy-mobile-calendar-day__content-
|
|
649
|
-
"bsy-mobile-calendar-day__hour-cell": "_bsy-mobile-calendar-day__hour-
|
|
650
|
-
"bsy-mobile-calendar-day__timed-layer": "_bsy-mobile-calendar-day__timed-
|
|
651
|
-
"bsy-mobile-calendar-day__timed-item": "_bsy-mobile-calendar-day__timed-
|
|
652
|
-
"bsy-mobile-calendar-week-carousel": "_bsy-mobile-calendar-week-
|
|
653
|
-
"bsy-mobile-calendar-week-slide": "_bsy-mobile-calendar-week-
|
|
654
|
-
"bsy-mobile-calendar-week-slide__weekdays": "_bsy-mobile-calendar-week-
|
|
655
|
-
"bsy-mobile-calendar-week-slide__dates": "_bsy-mobile-calendar-week-
|
|
656
|
-
"bsy-mobile-calendar-week-slide__weekday": "_bsy-mobile-calendar-week-
|
|
657
|
-
"bsy-mobile-calendar-week-slide__weekday--
|
|
658
|
-
"bsy-mobile-calendar-week-slide__weekday--
|
|
659
|
-
"bsy-mobile-calendar-week-slide__weekday--future": "_bsy-mobile-calendar-week-slide__weekday--
|
|
660
|
-
"bsy-mobile-calendar-week-slide__date-item": "_bsy-mobile-calendar-week-slide__date-
|
|
661
|
-
"bsy-mobile-calendar-week-slide__date-circle": "_bsy-mobile-calendar-week-slide__date-
|
|
662
|
-
"bsy-mobile-calendar-week-slide__date-circle--today": "_bsy-mobile-calendar-week-slide__date-circle--
|
|
663
|
-
"bsy-mobile-calendar-week-slide__date-circle--today-idle": "_bsy-mobile-calendar-week-slide__date-circle--today-
|
|
664
|
-
"bsy-mobile-calendar-week-slide__date-circle--past": "_bsy-mobile-calendar-week-slide__date-circle--
|
|
665
|
-
"bsy-mobile-calendar-week-slide__date-circle--future": "_bsy-mobile-calendar-week-slide__date-circle--
|
|
666
|
-
"bsy-mobile-calendar-week-slide__date-circle--selected": "_bsy-mobile-calendar-week-slide__date-circle--
|
|
667
|
-
"bsy-mobile-calendar-now-line": "_bsy-mobile-calendar-now-
|
|
668
|
-
"bsy-mobile-calendar-now-dot": "_bsy-mobile-calendar-now-
|
|
669
|
-
"bsy-mobile-calendar-allday": "_bsy-mobile-calendar-
|
|
670
|
-
"bsy-mobile-calendar-allday__content": "_bsy-mobile-calendar-
|
|
671
|
-
"bsy-mobile-calendar-allday__list": "_bsy-mobile-calendar-
|
|
672
|
-
"bsy-mobile-calendar-allday__expand": "_bsy-mobile-calendar-
|
|
673
|
-
},
|
|
674
|
-
let { timeZone: o } =
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
className:
|
|
637
|
+
var W = {
|
|
638
|
+
"bsy-mobile-calendar-day": "_bsy-mobile-calendar-day_dugny_1",
|
|
639
|
+
"bsy-mobile-calendar-day__header-wrap": "_bsy-mobile-calendar-day__header-wrap_dugny_7",
|
|
640
|
+
"bsy-mobile-calendar-day__header": "_bsy-mobile-calendar-day__header_dugny_7",
|
|
641
|
+
"bsy-mobile-calendar-day__tz": "_bsy-mobile-calendar-day__tz_dugny_15",
|
|
642
|
+
"bsy-mobile-calendar-day__body": "_bsy-mobile-calendar-day__body_dugny_25",
|
|
643
|
+
"bsy-mobile-calendar-day__time-grid": "_bsy-mobile-calendar-day__time-grid_dugny_30",
|
|
644
|
+
"bsy-mobile-calendar-day__time-col": "_bsy-mobile-calendar-day__time-col_dugny_34",
|
|
645
|
+
"bsy-mobile-calendar-day__time-label": "_bsy-mobile-calendar-day__time-label_dugny_39",
|
|
646
|
+
"bsy-mobile-calendar-day__content-col": "_bsy-mobile-calendar-day__content-col_dugny_47",
|
|
647
|
+
"bsy-mobile-calendar-day__hour-cell": "_bsy-mobile-calendar-day__hour-cell_dugny_52",
|
|
648
|
+
"bsy-mobile-calendar-day__timed-layer": "_bsy-mobile-calendar-day__timed-layer_dugny_57",
|
|
649
|
+
"bsy-mobile-calendar-day__timed-item": "_bsy-mobile-calendar-day__timed-item_dugny_69",
|
|
650
|
+
"bsy-mobile-calendar-week-carousel": "_bsy-mobile-calendar-week-carousel_dugny_75",
|
|
651
|
+
"bsy-mobile-calendar-week-slide": "_bsy-mobile-calendar-week-slide_dugny_81",
|
|
652
|
+
"bsy-mobile-calendar-week-slide__weekdays": "_bsy-mobile-calendar-week-slide__weekdays_dugny_86",
|
|
653
|
+
"bsy-mobile-calendar-week-slide__dates": "_bsy-mobile-calendar-week-slide__dates_dugny_91",
|
|
654
|
+
"bsy-mobile-calendar-week-slide__weekday": "_bsy-mobile-calendar-week-slide__weekday_dugny_86",
|
|
655
|
+
"bsy-mobile-calendar-week-slide__weekday--today": "_bsy-mobile-calendar-week-slide__weekday--today_dugny_103",
|
|
656
|
+
"bsy-mobile-calendar-week-slide__weekday--past": "_bsy-mobile-calendar-week-slide__weekday--past_dugny_106",
|
|
657
|
+
"bsy-mobile-calendar-week-slide__weekday--future": "_bsy-mobile-calendar-week-slide__weekday--future_dugny_109",
|
|
658
|
+
"bsy-mobile-calendar-week-slide__date-item": "_bsy-mobile-calendar-week-slide__date-item_dugny_112",
|
|
659
|
+
"bsy-mobile-calendar-week-slide__date-circle": "_bsy-mobile-calendar-week-slide__date-circle_dugny_118",
|
|
660
|
+
"bsy-mobile-calendar-week-slide__date-circle--today": "_bsy-mobile-calendar-week-slide__date-circle--today_dugny_128",
|
|
661
|
+
"bsy-mobile-calendar-week-slide__date-circle--today-idle": "_bsy-mobile-calendar-week-slide__date-circle--today-idle_dugny_132",
|
|
662
|
+
"bsy-mobile-calendar-week-slide__date-circle--past": "_bsy-mobile-calendar-week-slide__date-circle--past_dugny_136",
|
|
663
|
+
"bsy-mobile-calendar-week-slide__date-circle--future": "_bsy-mobile-calendar-week-slide__date-circle--future_dugny_139",
|
|
664
|
+
"bsy-mobile-calendar-week-slide__date-circle--selected": "_bsy-mobile-calendar-week-slide__date-circle--selected_dugny_142",
|
|
665
|
+
"bsy-mobile-calendar-now-line": "_bsy-mobile-calendar-now-line_dugny_146",
|
|
666
|
+
"bsy-mobile-calendar-now-dot": "_bsy-mobile-calendar-now-dot_dugny_156",
|
|
667
|
+
"bsy-mobile-calendar-allday": "_bsy-mobile-calendar-allday_dugny_166",
|
|
668
|
+
"bsy-mobile-calendar-allday__content": "_bsy-mobile-calendar-allday__content_dugny_170",
|
|
669
|
+
"bsy-mobile-calendar-allday__list": "_bsy-mobile-calendar-allday__list_dugny_176",
|
|
670
|
+
"bsy-mobile-calendar-allday__expand": "_bsy-mobile-calendar-allday__expand_dugny_180"
|
|
671
|
+
}, De = ({ weekDate: t, currentDate: r, containerWidth: i, onDateClick: a }) => {
|
|
672
|
+
let { timeZone: o } = w(), { t: s } = e(), c = le(t.toDate()), l = n(o).startOf("day"), u = c.some((e) => R(e, o)), d = l.day(), f = r.isSame(l, "day");
|
|
673
|
+
return /* @__PURE__ */ g("div", {
|
|
674
|
+
className: W["bsy-mobile-calendar-week-slide"],
|
|
677
675
|
style: { width: i },
|
|
678
|
-
children: [/* @__PURE__ */
|
|
679
|
-
className:
|
|
680
|
-
children:
|
|
681
|
-
let n = t
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
className:
|
|
676
|
+
children: [/* @__PURE__ */ h("div", {
|
|
677
|
+
className: W["bsy-mobile-calendar-week-slide__weekdays"],
|
|
678
|
+
children: N.map((e, t) => {
|
|
679
|
+
let n = t === 6 ? 0 : t + 1, r = c.find((e) => e.day() === n), i = u && n === d, a = r ? r.isBefore(l, "day") : !1, o = r ? r.isAfter(l) : !1;
|
|
680
|
+
return /* @__PURE__ */ h("div", {
|
|
681
|
+
className: T(W["bsy-mobile-calendar-week-slide__weekday"], i && W["bsy-mobile-calendar-week-slide__weekday--today"], !i && a && W["bsy-mobile-calendar-week-slide__weekday--past"], o && W["bsy-mobile-calendar-week-slide__weekday--future"]),
|
|
684
682
|
children: s(`calendar.weekday.${e}`)
|
|
685
683
|
}, e);
|
|
686
684
|
})
|
|
687
|
-
}), /* @__PURE__ */
|
|
688
|
-
className:
|
|
685
|
+
}), /* @__PURE__ */ h("div", {
|
|
686
|
+
className: W["bsy-mobile-calendar-week-slide__dates"],
|
|
689
687
|
children: c.map((e) => {
|
|
690
|
-
let t =
|
|
691
|
-
return /* @__PURE__ */
|
|
692
|
-
className:
|
|
688
|
+
let t = R(e, o), n = e.isSame(r, "day") && !t, i = e.isBefore(l);
|
|
689
|
+
return /* @__PURE__ */ h("div", {
|
|
690
|
+
className: W["bsy-mobile-calendar-week-slide__date-item"],
|
|
693
691
|
onClick: () => a?.(e),
|
|
694
|
-
children: /* @__PURE__ */
|
|
695
|
-
className:
|
|
692
|
+
children: /* @__PURE__ */ h("div", {
|
|
693
|
+
className: T(W["bsy-mobile-calendar-week-slide__date-circle"], t && (f ? W["bsy-mobile-calendar-week-slide__date-circle--today"] : W["bsy-mobile-calendar-week-slide__date-circle--today-idle"]), !t && i && W["bsy-mobile-calendar-week-slide__date-circle--past"], !t && !i && W["bsy-mobile-calendar-week-slide__date-circle--future"], n && W["bsy-mobile-calendar-week-slide__date-circle--selected"]),
|
|
696
694
|
children: e.date()
|
|
697
695
|
})
|
|
698
696
|
}, e.format("YYYY-MM-DD"));
|
|
699
697
|
})
|
|
700
698
|
})]
|
|
701
699
|
});
|
|
702
|
-
},
|
|
703
|
-
let { weeks: r, translateX: i, transitionEnabled: a, bindEvents: o, handleTransitionEnd: s } =
|
|
700
|
+
}, Oe = ({ currentDate: e, setCurrentDate: t, containerWidth: n }) => {
|
|
701
|
+
let { weeks: r, translateX: i, transitionEnabled: a, bindEvents: o, handleTransitionEnd: s } = Ee({
|
|
704
702
|
selectedDate: e,
|
|
705
703
|
setSelectedDate: t,
|
|
706
704
|
containerWidth: n
|
|
707
705
|
});
|
|
708
|
-
return n ? /* @__PURE__ */
|
|
709
|
-
className:
|
|
706
|
+
return n ? /* @__PURE__ */ h("div", {
|
|
707
|
+
className: W["bsy-mobile-calendar-week-carousel"],
|
|
710
708
|
...o,
|
|
711
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ h("div", {
|
|
712
710
|
style: {
|
|
713
711
|
width: n * 3,
|
|
714
712
|
marginLeft: -n,
|
|
@@ -719,7 +717,7 @@ var H = {
|
|
|
719
717
|
willChange: "transform"
|
|
720
718
|
},
|
|
721
719
|
onTransitionEnd: s,
|
|
722
|
-
children: r.map((r) => /* @__PURE__ */
|
|
720
|
+
children: r.map((r) => /* @__PURE__ */ h(De, {
|
|
723
721
|
weekDate: r,
|
|
724
722
|
currentDate: e,
|
|
725
723
|
containerWidth: n,
|
|
@@ -727,31 +725,31 @@ var H = {
|
|
|
727
725
|
}, r.format("YYYY-MM-DD")))
|
|
728
726
|
})
|
|
729
727
|
}) : null;
|
|
730
|
-
},
|
|
731
|
-
let { t: r } = e(), i =
|
|
732
|
-
return
|
|
728
|
+
}, ke = a.memo(({ events: t, onEventClick: n }) => {
|
|
729
|
+
let { t: r } = e(), i = p(null), [a, o] = m(0), [s, c] = m(!1), l = s ? t.length : Math.min(t.length, 3), u = t.slice(0, l), f = t.length - 3, _ = t.length > 3, v = s && t.length > 8;
|
|
730
|
+
return d(() => {
|
|
733
731
|
i.current && o(t.length > 0 ? i.current.scrollHeight : 0);
|
|
734
|
-
}, [t, s]), /* @__PURE__ */
|
|
735
|
-
className:
|
|
732
|
+
}, [t, s]), /* @__PURE__ */ h("div", {
|
|
733
|
+
className: W["bsy-mobile-calendar-allday"],
|
|
736
734
|
style: { height: a },
|
|
737
|
-
children: /* @__PURE__ */
|
|
735
|
+
children: /* @__PURE__ */ g("div", {
|
|
738
736
|
ref: i,
|
|
739
|
-
className:
|
|
740
|
-
children: [/* @__PURE__ */
|
|
741
|
-
className:
|
|
737
|
+
className: W["bsy-mobile-calendar-allday__content"],
|
|
738
|
+
children: [/* @__PURE__ */ h("div", {
|
|
739
|
+
className: W["bsy-mobile-calendar-allday__list"],
|
|
742
740
|
style: v ? {
|
|
743
741
|
maxHeight: 204,
|
|
744
742
|
overflowY: "auto"
|
|
745
743
|
} : void 0,
|
|
746
|
-
children:
|
|
744
|
+
children: u.map((e) => /* @__PURE__ */ h(I, {
|
|
747
745
|
label: e.label,
|
|
748
746
|
style: { width: "100%" },
|
|
749
747
|
onClick: () => n?.(e)
|
|
750
748
|
}, e.id))
|
|
751
|
-
}), _ ? /* @__PURE__ */
|
|
752
|
-
className:
|
|
749
|
+
}), _ ? /* @__PURE__ */ g("div", {
|
|
750
|
+
className: W["bsy-mobile-calendar-allday__expand"],
|
|
753
751
|
onClick: () => c((e) => !e),
|
|
754
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ h("span", { children: s ? r("calendar.collapse") : r("calendar.moreRecords", { count: f }) }), /* @__PURE__ */ h("svg", {
|
|
755
753
|
width: "16",
|
|
756
754
|
height: "16",
|
|
757
755
|
viewBox: "0 0 16 16",
|
|
@@ -760,9 +758,9 @@ var H = {
|
|
|
760
758
|
transform: s ? "rotate(180deg)" : "rotate(0deg)",
|
|
761
759
|
transition: "transform 200ms ease"
|
|
762
760
|
},
|
|
763
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ h("path", {
|
|
764
762
|
d: "M4 6L8 10L12 6",
|
|
765
|
-
stroke: "
|
|
763
|
+
stroke: "currentColor",
|
|
766
764
|
strokeWidth: "1.5",
|
|
767
765
|
strokeLinecap: "round",
|
|
768
766
|
strokeLinejoin: "round"
|
|
@@ -771,62 +769,62 @@ var H = {
|
|
|
771
769
|
}) : null]
|
|
772
770
|
})
|
|
773
771
|
});
|
|
774
|
-
}),
|
|
775
|
-
let { timezoneLabel: a } =
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
className:
|
|
778
|
-
children: [/* @__PURE__ */
|
|
779
|
-
className:
|
|
780
|
-
children: [/* @__PURE__ */
|
|
781
|
-
className:
|
|
772
|
+
}), Ae = ({ currentDate: e, setCurrentDate: t, containerWidth: n, allDayEvents: r, onEventClick: i }) => {
|
|
773
|
+
let { timezoneLabel: a } = w();
|
|
774
|
+
return /* @__PURE__ */ g("div", {
|
|
775
|
+
className: W["bsy-mobile-calendar-day__header-wrap"],
|
|
776
|
+
children: [/* @__PURE__ */ g("div", {
|
|
777
|
+
className: W["bsy-mobile-calendar-day__header"],
|
|
778
|
+
children: [/* @__PURE__ */ h("div", {
|
|
779
|
+
className: W["bsy-mobile-calendar-day__tz"],
|
|
782
780
|
children: a
|
|
783
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ h(Oe, {
|
|
784
782
|
currentDate: e,
|
|
785
783
|
setCurrentDate: t,
|
|
786
784
|
containerWidth: n
|
|
787
785
|
})]
|
|
788
|
-
}), /* @__PURE__ */
|
|
786
|
+
}), /* @__PURE__ */ h(ke, {
|
|
789
787
|
events: r,
|
|
790
788
|
onEventClick: i
|
|
791
789
|
})]
|
|
792
790
|
});
|
|
793
|
-
},
|
|
794
|
-
let t =
|
|
791
|
+
}, G = (e) => b(e.startTime).format("YYYY-MM-DD") !== b(e.endTime).format("YYYY-MM-DD"), K = (e) => {
|
|
792
|
+
let t = b(e.startTime), n = b(e.endTime);
|
|
795
793
|
return n.diff(t, "minute") < 22 ? t.add(22, "minute") : n;
|
|
796
|
-
},
|
|
797
|
-
let n =
|
|
794
|
+
}, q = (e, t) => {
|
|
795
|
+
let n = b(e.startTime), r = K(e), i = b(t.startTime), a = K(t);
|
|
798
796
|
return n.isBefore(a) && r.isAfter(i);
|
|
799
|
-
},
|
|
797
|
+
}, je = (e) => {
|
|
800
798
|
if (e.length === 0) return [];
|
|
801
|
-
let t = [...e].sort((e, t) =>
|
|
799
|
+
let t = [...e].sort((e, t) => b(e.startTime).valueOf() - b(t.startTime).valueOf()), n = [], r = [t[0]], i = K(t[0]);
|
|
802
800
|
for (let e = 1; e < t.length; e += 1) {
|
|
803
801
|
let a = t[e];
|
|
804
|
-
if (
|
|
802
|
+
if (b(a.startTime).isBefore(i)) {
|
|
805
803
|
r.push(a);
|
|
806
|
-
let e =
|
|
804
|
+
let e = K(a);
|
|
807
805
|
e.isAfter(i) && (i = e);
|
|
808
|
-
} else n.push(r), r = [a], i =
|
|
806
|
+
} else n.push(r), r = [a], i = K(a);
|
|
809
807
|
}
|
|
810
808
|
return n.push(r), n;
|
|
811
|
-
},
|
|
812
|
-
let t = /* @__PURE__ */ new Map(), n = [], r = [...e].sort((e, t) =>
|
|
809
|
+
}, Me = (e) => {
|
|
810
|
+
let t = /* @__PURE__ */ new Map(), n = [], r = [...e].sort((e, t) => b(e.startTime).valueOf() - b(t.startTime).valueOf());
|
|
813
811
|
for (let e of r) {
|
|
814
812
|
let r = !1;
|
|
815
|
-
for (let i = 0; i < n.length; i += 1) if (n[i].every((t) => !
|
|
813
|
+
for (let i = 0; i < n.length; i += 1) if (n[i].every((t) => !q(t, e))) {
|
|
816
814
|
n[i].push(e), t.set(e.id, i), r = !0;
|
|
817
815
|
break;
|
|
818
816
|
}
|
|
819
817
|
r || (n.push([e]), t.set(e.id, n.length - 1));
|
|
820
818
|
}
|
|
821
819
|
return t;
|
|
822
|
-
},
|
|
820
|
+
}, Ne = (e, t, n, r, i) => {
|
|
823
821
|
let a = n;
|
|
824
822
|
for (let n of r) if (n.id !== e.id) {
|
|
825
823
|
let r = i.get(n.id) ?? 0;
|
|
826
|
-
r > t &&
|
|
824
|
+
r > t && q(e, n) && (a = Math.min(a, r));
|
|
827
825
|
}
|
|
828
826
|
return a - t;
|
|
829
|
-
},
|
|
827
|
+
}, Pe = (e, t) => {
|
|
830
828
|
let n = Math.max(...Array.from(t.values())) + 1, r = /* @__PURE__ */ new Map(), i = n > 10;
|
|
831
829
|
for (let a of e) {
|
|
832
830
|
let o = t.get(a.id) ?? 0;
|
|
@@ -838,7 +836,7 @@ var H = {
|
|
|
838
836
|
isPercent: !1
|
|
839
837
|
});
|
|
840
838
|
} else {
|
|
841
|
-
let i =
|
|
839
|
+
let i = Ne(a, o, n, e, t), s = 100 / n;
|
|
842
840
|
r.set(a.id, {
|
|
843
841
|
left: o * s,
|
|
844
842
|
width: s * i,
|
|
@@ -847,12 +845,12 @@ var H = {
|
|
|
847
845
|
}
|
|
848
846
|
}
|
|
849
847
|
return r;
|
|
850
|
-
},
|
|
851
|
-
let n = e.filter(
|
|
848
|
+
}, Fe = (e, t) => {
|
|
849
|
+
let n = e.filter(G), r = je(e.filter((e) => !G(e))), i = [];
|
|
852
850
|
for (let e of r) {
|
|
853
|
-
let n =
|
|
851
|
+
let n = Me(e), r = Pe(e, n), a = Math.max(...Array.from(n.values())) + 1;
|
|
854
852
|
for (let o of e) {
|
|
855
|
-
let e =
|
|
853
|
+
let e = b(o.startTime), s = b(o.endTime), c = e.hour() * 60 + e.minute(), l = s.hour() * 60 + s.minute(), u = Math.max(l - c, 22), d = c / t.interval * t.rowHeight, f = u / t.interval * t.rowHeight, p = r.get(o.id);
|
|
856
854
|
i.push({
|
|
857
855
|
event: o,
|
|
858
856
|
top: d,
|
|
@@ -869,71 +867,71 @@ var H = {
|
|
|
869
867
|
timedEvents: i,
|
|
870
868
|
allDayEvents: n
|
|
871
869
|
};
|
|
872
|
-
},
|
|
870
|
+
}, Ie = Array.from({ length: 24 }, (e, t) => `${t.toString().padStart(2, "0")}:00`), Le = {
|
|
873
871
|
interval: 60,
|
|
874
872
|
rowHeight: 60
|
|
875
|
-
},
|
|
876
|
-
let t =
|
|
873
|
+
}, Re = (e) => {
|
|
874
|
+
let t = b(e.startTime), n = b(e.endTime);
|
|
877
875
|
return `${t.format("HH:mm")}-${n.format("HH:mm")}`;
|
|
878
|
-
},
|
|
879
|
-
let { timeZone: a } =
|
|
880
|
-
|
|
881
|
-
if (!
|
|
876
|
+
}, ze = (e, t, n) => Math.min(Math.max(e, t), n), Be = ({ events: e, currentDate: r, onEventClick: i }) => {
|
|
877
|
+
let { timeZone: a } = w(), o = p(null), s = p(null), [c, l] = m(() => Date.now()), d = f(() => Fe(e, Le), [e]), _ = f(() => new Map(e.map((e) => [e.id, e])), [e]), v = d.timedEvents ?? [], y = f(() => b(r).isSame(n(a), "day"), [r, a]);
|
|
878
|
+
u(() => {
|
|
879
|
+
if (!y) {
|
|
882
880
|
s.current = null;
|
|
883
881
|
return;
|
|
884
882
|
}
|
|
885
|
-
|
|
883
|
+
l(Date.now());
|
|
886
884
|
let e = window.setInterval(() => {
|
|
887
|
-
|
|
885
|
+
l(Date.now());
|
|
888
886
|
}, 60 * 1e3);
|
|
889
887
|
return () => {
|
|
890
888
|
window.clearInterval(e);
|
|
891
889
|
};
|
|
892
|
-
}, [
|
|
893
|
-
let x =
|
|
894
|
-
if (!
|
|
895
|
-
let e =
|
|
890
|
+
}, [y]);
|
|
891
|
+
let x = f(() => {
|
|
892
|
+
if (!y) return null;
|
|
893
|
+
let e = t(c, a);
|
|
896
894
|
return 20 + (e.hour() * 60 + e.minute() + e.second() / 60) / 60 * 60;
|
|
897
895
|
}, [
|
|
898
|
-
|
|
896
|
+
y,
|
|
899
897
|
c,
|
|
900
898
|
a
|
|
901
|
-
]), S =
|
|
902
|
-
return
|
|
903
|
-
if (!
|
|
904
|
-
let e =
|
|
899
|
+
]), S = f(() => x === null ? null : x - 20, [x]);
|
|
900
|
+
return u(() => {
|
|
901
|
+
if (!y || !o.current || x === null) return;
|
|
902
|
+
let e = b(r).format("YYYY-MM-DD");
|
|
905
903
|
if (s.current === e) return;
|
|
906
|
-
let
|
|
907
|
-
|
|
904
|
+
let t = o.current, n = Math.max(t.scrollHeight - t.clientHeight, 0);
|
|
905
|
+
t.scrollTop = ze(x - t.clientHeight * .35, 0, n), s.current = e;
|
|
908
906
|
}, [
|
|
909
|
-
|
|
910
|
-
|
|
907
|
+
r,
|
|
908
|
+
y,
|
|
911
909
|
x
|
|
912
|
-
]), /* @__PURE__ */
|
|
913
|
-
className:
|
|
910
|
+
]), /* @__PURE__ */ h("div", {
|
|
911
|
+
className: W["bsy-mobile-calendar-day__body"],
|
|
914
912
|
ref: o,
|
|
915
|
-
children: /* @__PURE__ */
|
|
916
|
-
className:
|
|
917
|
-
children: [/* @__PURE__ */
|
|
918
|
-
className:
|
|
919
|
-
children:
|
|
920
|
-
className:
|
|
913
|
+
children: /* @__PURE__ */ g("div", {
|
|
914
|
+
className: W["bsy-mobile-calendar-day__time-grid"],
|
|
915
|
+
children: [/* @__PURE__ */ h("div", {
|
|
916
|
+
className: W["bsy-mobile-calendar-day__time-col"],
|
|
917
|
+
children: Ie.map((e, t) => /* @__PURE__ */ h("div", {
|
|
918
|
+
className: W["bsy-mobile-calendar-day__time-label"],
|
|
921
919
|
style: { top: 20 + t * 60 },
|
|
922
920
|
children: e
|
|
923
921
|
}, e))
|
|
924
|
-
}), /* @__PURE__ */
|
|
925
|
-
className:
|
|
922
|
+
}), /* @__PURE__ */ g("div", {
|
|
923
|
+
className: W["bsy-mobile-calendar-day__content-col"],
|
|
926
924
|
children: [
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
className:
|
|
925
|
+
/* @__PURE__ */ h("div", { style: { height: 20 } }),
|
|
926
|
+
Ie.map((e) => /* @__PURE__ */ h("div", { className: W["bsy-mobile-calendar-day__hour-cell"] }, e)),
|
|
927
|
+
/* @__PURE__ */ g("div", {
|
|
928
|
+
className: W["bsy-mobile-calendar-day__timed-layer"],
|
|
931
929
|
children: [v.map((e) => {
|
|
932
930
|
let { event: t, top: n, height: r, left: a, width: o, isPercent: s } = e, c = _.get(t.id);
|
|
933
|
-
return c ? /* @__PURE__ */
|
|
934
|
-
className:
|
|
931
|
+
return c ? /* @__PURE__ */ h(I, {
|
|
932
|
+
className: W["bsy-mobile-calendar-day__timed-item"],
|
|
935
933
|
label: t.label,
|
|
936
|
-
timeText:
|
|
934
|
+
timeText: Re(c),
|
|
937
935
|
variant: "timed",
|
|
938
936
|
height: r,
|
|
939
937
|
style: {
|
|
@@ -943,57 +941,57 @@ var H = {
|
|
|
943
941
|
},
|
|
944
942
|
onClick: () => i?.(c)
|
|
945
943
|
}, t.id) : null;
|
|
946
|
-
}), S === null ? null : /* @__PURE__ */
|
|
947
|
-
className:
|
|
944
|
+
}), S === null ? null : /* @__PURE__ */ h("div", {
|
|
945
|
+
className: W["bsy-mobile-calendar-now-line"],
|
|
948
946
|
style: { top: S },
|
|
949
|
-
children: /* @__PURE__ */
|
|
947
|
+
children: /* @__PURE__ */ h("div", { className: W["bsy-mobile-calendar-now-dot"] })
|
|
950
948
|
})]
|
|
951
949
|
})
|
|
952
950
|
]
|
|
953
951
|
})]
|
|
954
952
|
})
|
|
955
953
|
});
|
|
956
|
-
},
|
|
957
|
-
let { currentDate: e, setCurrentDate: t, events: n, onEventClick: r } =
|
|
958
|
-
let t =
|
|
959
|
-
return n.filter((e) =>
|
|
960
|
-
}, [n, e]),
|
|
961
|
-
let t =
|
|
962
|
-
return n.filter((e) => !
|
|
963
|
-
}, [n, e]), l =
|
|
954
|
+
}, Ve = () => {
|
|
955
|
+
let { currentDate: e, setCurrentDate: t, events: n, onEventClick: r } = w(), i = p(null), a = y(i), o = f(() => {
|
|
956
|
+
let t = b(e);
|
|
957
|
+
return n.filter((e) => z(e) && pe(e, t));
|
|
958
|
+
}, [n, e]), s = f(() => {
|
|
959
|
+
let t = b(e);
|
|
960
|
+
return n.filter((e) => !z(e) && b(e.startTime).isSame(t, "day"));
|
|
961
|
+
}, [n, e]), l = f(() => a?.width ? a.width - 56 : 0, [a?.width]), u = c((e) => {
|
|
964
962
|
t(e.toDate());
|
|
965
963
|
}, [t]);
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
className:
|
|
964
|
+
return /* @__PURE__ */ g("div", {
|
|
965
|
+
className: W["bsy-mobile-calendar-day"],
|
|
968
966
|
ref: i,
|
|
969
|
-
children: [/* @__PURE__ */
|
|
970
|
-
currentDate:
|
|
967
|
+
children: [/* @__PURE__ */ h(Ae, {
|
|
968
|
+
currentDate: b(e),
|
|
971
969
|
setCurrentDate: u,
|
|
972
970
|
containerWidth: l,
|
|
973
971
|
allDayEvents: o,
|
|
974
972
|
onEventClick: r
|
|
975
|
-
}), /* @__PURE__ */
|
|
976
|
-
events:
|
|
973
|
+
}), /* @__PURE__ */ h(Be, {
|
|
974
|
+
events: s,
|
|
977
975
|
currentDate: e,
|
|
978
976
|
onEventClick: r
|
|
979
977
|
})]
|
|
980
978
|
});
|
|
981
979
|
};
|
|
982
|
-
function
|
|
980
|
+
function J(e) {
|
|
983
981
|
return e + 4;
|
|
984
982
|
}
|
|
985
|
-
function
|
|
986
|
-
let r =
|
|
983
|
+
function He(e, t, n) {
|
|
984
|
+
let r = J(n), i = n > 0 ? -t / r : 0, a = Math.floor(i) - 2;
|
|
987
985
|
return Array.from({ length: 7 }, (t, n) => ({
|
|
988
986
|
date: e.add(a + n, "day"),
|
|
989
987
|
offset: a + n
|
|
990
988
|
}));
|
|
991
989
|
}
|
|
992
|
-
function
|
|
990
|
+
function Ue(e, t) {
|
|
993
991
|
return e * t + e * 4;
|
|
994
992
|
}
|
|
995
|
-
function
|
|
996
|
-
let [r, i] =
|
|
993
|
+
function We({ baseDate: e, setBaseDate: t, columnWidth: n }) {
|
|
994
|
+
let [r, i] = m(0), [a, o] = m(!1), s = p({
|
|
997
995
|
startX: 0,
|
|
998
996
|
startY: 0,
|
|
999
997
|
startTime: 0,
|
|
@@ -1001,19 +999,19 @@ function Ke({ baseDate: e, setBaseDate: t, columnWidth: n }) {
|
|
|
1001
999
|
isDragging: !1,
|
|
1002
1000
|
isVerticalScroll: !1,
|
|
1003
1001
|
directionLocked: !1
|
|
1004
|
-
}),
|
|
1005
|
-
|
|
1002
|
+
}), l = v(e), d = v(t), h = v(n), g = v(r), _ = p(e.format("YYYY-MM-DD"));
|
|
1003
|
+
u(() => {
|
|
1006
1004
|
let t = e.format("YYYY-MM-DD");
|
|
1007
|
-
|
|
1005
|
+
_.current !== t && (i(0), o(!1), _.current = t);
|
|
1008
1006
|
}, [e]);
|
|
1009
|
-
let y =
|
|
1007
|
+
let y = f(() => He(e, r, n), [
|
|
1010
1008
|
e.format("YYYY-MM-DD"),
|
|
1011
1009
|
r,
|
|
1012
1010
|
n
|
|
1013
|
-
]), b =
|
|
1014
|
-
if (
|
|
1011
|
+
]), b = c((e) => Ue(e, h.current ?? 0), [h]), x = r, S = c((e) => {
|
|
1012
|
+
if (s.current.isDragging) return;
|
|
1015
1013
|
let t = e.touches[0];
|
|
1016
|
-
|
|
1014
|
+
s.current = {
|
|
1017
1015
|
startX: t.clientX,
|
|
1018
1016
|
startY: t.clientY,
|
|
1019
1017
|
startTime: Date.now(),
|
|
@@ -1022,36 +1020,36 @@ function Ke({ baseDate: e, setBaseDate: t, columnWidth: n }) {
|
|
|
1022
1020
|
isVerticalScroll: !1,
|
|
1023
1021
|
directionLocked: !1
|
|
1024
1022
|
}, o(!1);
|
|
1025
|
-
}, [g]), C =
|
|
1026
|
-
if (!
|
|
1027
|
-
let t = e.touches[0], n = t.clientX -
|
|
1028
|
-
if (!
|
|
1029
|
-
|
|
1023
|
+
}, [g]), C = c((e) => {
|
|
1024
|
+
if (!s.current.isDragging) return;
|
|
1025
|
+
let t = e.touches[0], n = t.clientX - s.current.startX, r = t.clientY - s.current.startY;
|
|
1026
|
+
if (!s.current.directionLocked && (Math.abs(n) > 10 || Math.abs(r) > 10) && (s.current.directionLocked = !0, Math.abs(r) > Math.abs(n))) {
|
|
1027
|
+
s.current.isVerticalScroll = !0;
|
|
1030
1028
|
return;
|
|
1031
1029
|
}
|
|
1032
|
-
|
|
1033
|
-
}, []), w =
|
|
1034
|
-
if (!
|
|
1030
|
+
s.current.isVerticalScroll || i(s.current.startTranslateX + n);
|
|
1031
|
+
}, []), w = c(() => {
|
|
1032
|
+
if (!s.current.isDragging) return;
|
|
1035
1033
|
let e = g.current ?? 0, t = h.current ?? 0;
|
|
1036
|
-
if (
|
|
1037
|
-
let n =
|
|
1034
|
+
if (s.current.isDragging = !1, !t || s.current.isVerticalScroll) return;
|
|
1035
|
+
let n = J(t), r = e - s.current.startTranslateX, a = Date.now() - s.current.startTime, c = Math.abs(r) / a, l = Math.abs(r) > t * .35 || c > .3, u;
|
|
1038
1036
|
u = l ? r > 0 ? Math.ceil(e / n) * n : Math.floor(e / n) * n : Math.round(e / n) * n, o(!0), i(u);
|
|
1039
|
-
}, [h, g]), T =
|
|
1037
|
+
}, [h, g]), T = c(() => {
|
|
1040
1038
|
o(!1);
|
|
1041
|
-
let e = g.current ?? 0, t = h.current ?? 0, n =
|
|
1039
|
+
let e = g.current ?? 0, t = h.current ?? 0, n = l.current, r = d.current;
|
|
1042
1040
|
if (t > 0 && n && r) {
|
|
1043
|
-
let a =
|
|
1041
|
+
let a = J(t), o = -e / a, s = Math.round(o);
|
|
1044
1042
|
if (s !== 0) {
|
|
1045
1043
|
let e = n.add(s, "day");
|
|
1046
|
-
|
|
1044
|
+
_.current = e.format("YYYY-MM-DD"), r(e), i(0);
|
|
1047
1045
|
}
|
|
1048
1046
|
}
|
|
1049
1047
|
}, [
|
|
1050
1048
|
h,
|
|
1051
1049
|
g,
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
]), E =
|
|
1050
|
+
l,
|
|
1051
|
+
d
|
|
1052
|
+
]), E = c(() => {
|
|
1055
1053
|
i(0), o(!1);
|
|
1056
1054
|
}, []);
|
|
1057
1055
|
return {
|
|
@@ -1059,7 +1057,7 @@ function Ke({ baseDate: e, setBaseDate: t, columnWidth: n }) {
|
|
|
1059
1057
|
offsetX: r,
|
|
1060
1058
|
trackTransformX: x,
|
|
1061
1059
|
transitionEnabled: a,
|
|
1062
|
-
bindEvents:
|
|
1060
|
+
bindEvents: f(() => ({
|
|
1063
1061
|
onTouchStart: S,
|
|
1064
1062
|
onTouchMove: C,
|
|
1065
1063
|
onTouchEnd: w,
|
|
@@ -1076,86 +1074,85 @@ function Ke({ baseDate: e, setBaseDate: t, columnWidth: n }) {
|
|
|
1076
1074
|
}
|
|
1077
1075
|
//#endregion
|
|
1078
1076
|
//#region src/components/Calendar/CalendarThreeDay/ThreeDayCarousel.context.tsx
|
|
1079
|
-
var
|
|
1080
|
-
let n =
|
|
1081
|
-
return /* @__PURE__ */
|
|
1077
|
+
var Ge = o(null), Ke = ({ children: e, value: t }) => {
|
|
1078
|
+
let n = f(() => t, [t]);
|
|
1079
|
+
return /* @__PURE__ */ h(Ge.Provider, {
|
|
1082
1080
|
value: n,
|
|
1083
1081
|
children: e
|
|
1084
1082
|
});
|
|
1085
|
-
},
|
|
1086
|
-
let e =
|
|
1083
|
+
}, Y = () => {
|
|
1084
|
+
let e = l(Ge);
|
|
1087
1085
|
if (!e) throw Error("useThreeDayCarouselContext must be used within a ThreeDayCarouselProvider");
|
|
1088
1086
|
return e;
|
|
1089
|
-
},
|
|
1090
|
-
"bsy-mobile-calendar-threeday": "_bsy-mobile-calendar-
|
|
1091
|
-
"bsy-mobile-calendar-threeday__header-wrap": "_bsy-mobile-calendar-threeday__header-
|
|
1092
|
-
"bsy-mobile-calendar-threeday__header": "_bsy-mobile-calendar-
|
|
1093
|
-
"bsy-mobile-calendar-threeday__tz": "_bsy-mobile-calendar-
|
|
1094
|
-
"bsy-mobile-calendar-threeday__tz-empty": "_bsy-mobile-calendar-threeday__tz-
|
|
1095
|
-
"bsy-mobile-calendar-threeday__tz-label": "_bsy-mobile-calendar-threeday__tz-
|
|
1096
|
-
"bsy-mobile-calendar-threeday__dates": "_bsy-mobile-calendar-
|
|
1097
|
-
"bsy-mobile-calendar-threeday__dates-track": "_bsy-mobile-calendar-threeday__dates-
|
|
1098
|
-
"bsy-mobile-calendar-threeday__date-col": "_bsy-mobile-calendar-threeday__date-
|
|
1099
|
-
"bsy-mobile-calendar-threeday__weekday": "_bsy-mobile-calendar-
|
|
1100
|
-
"bsy-mobile-calendar-threeday__weekday--
|
|
1101
|
-
"bsy-mobile-calendar-threeday__weekday--
|
|
1102
|
-
"bsy-mobile-calendar-
|
|
1103
|
-
"bsy-mobile-calendar-threeday__date-num": "_bsy-mobile-calendar-threeday__date-
|
|
1104
|
-
"bsy-mobile-calendar-threeday__date-num--
|
|
1105
|
-
"bsy-mobile-calendar-threeday__date-num--
|
|
1106
|
-
"bsy-mobile-calendar-
|
|
1107
|
-
"bsy-mobile-calendar-threeday__allday": "_bsy-mobile-calendar-
|
|
1108
|
-
"bsy-mobile-calendar-threeday__allday-
|
|
1109
|
-
"bsy-mobile-calendar-threeday__allday-
|
|
1110
|
-
"bsy-mobile-calendar-
|
|
1111
|
-
"bsy-mobile-calendar-
|
|
1112
|
-
"bsy-mobile-calendar-
|
|
1113
|
-
"bsy-mobile-calendar-threeday__body": "_bsy-mobile-calendar-
|
|
1114
|
-
"bsy-mobile-calendar-threeday__body-
|
|
1115
|
-
"bsy-mobile-calendar-
|
|
1116
|
-
"bsy-mobile-calendar-
|
|
1117
|
-
"bsy-mobile-calendar-threeday__grid": "_bsy-mobile-calendar-
|
|
1118
|
-
"bsy-mobile-calendar-
|
|
1119
|
-
"bsy-mobile-calendar-
|
|
1120
|
-
"bsy-mobile-calendar-
|
|
1121
|
-
"bsy-mobile-calendar-threeday__timed-
|
|
1122
|
-
"bsy-mobile-calendar-
|
|
1123
|
-
"bsy-mobile-calendar-threeday__now-
|
|
1124
|
-
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
className:
|
|
1134
|
-
|
|
1135
|
-
className: J["bsy-mobile-calendar-threeday__tz-label"],
|
|
1087
|
+
}, X = {
|
|
1088
|
+
"bsy-mobile-calendar-threeday": "_bsy-mobile-calendar-threeday_1alic_1",
|
|
1089
|
+
"bsy-mobile-calendar-threeday__header-wrap": "_bsy-mobile-calendar-threeday__header-wrap_1alic_7",
|
|
1090
|
+
"bsy-mobile-calendar-threeday__header": "_bsy-mobile-calendar-threeday__header_1alic_7",
|
|
1091
|
+
"bsy-mobile-calendar-threeday__tz": "_bsy-mobile-calendar-threeday__tz_1alic_15",
|
|
1092
|
+
"bsy-mobile-calendar-threeday__tz-empty": "_bsy-mobile-calendar-threeday__tz-empty_1alic_21",
|
|
1093
|
+
"bsy-mobile-calendar-threeday__tz-label": "_bsy-mobile-calendar-threeday__tz-label_1alic_24",
|
|
1094
|
+
"bsy-mobile-calendar-threeday__dates": "_bsy-mobile-calendar-threeday__dates_1alic_32",
|
|
1095
|
+
"bsy-mobile-calendar-threeday__dates-track": "_bsy-mobile-calendar-threeday__dates-track_1alic_38",
|
|
1096
|
+
"bsy-mobile-calendar-threeday__date-col": "_bsy-mobile-calendar-threeday__date-col_1alic_43",
|
|
1097
|
+
"bsy-mobile-calendar-threeday__weekday": "_bsy-mobile-calendar-threeday__weekday_1alic_50",
|
|
1098
|
+
"bsy-mobile-calendar-threeday__weekday--today": "_bsy-mobile-calendar-threeday__weekday--today_1alic_55",
|
|
1099
|
+
"bsy-mobile-calendar-threeday__weekday--past": "_bsy-mobile-calendar-threeday__weekday--past_1alic_58",
|
|
1100
|
+
"bsy-mobile-calendar-threeday__date-num": "_bsy-mobile-calendar-threeday__date-num_1alic_61",
|
|
1101
|
+
"bsy-mobile-calendar-threeday__date-num--today": "_bsy-mobile-calendar-threeday__date-num--today_1alic_68",
|
|
1102
|
+
"bsy-mobile-calendar-threeday__date-num--past": "_bsy-mobile-calendar-threeday__date-num--past_1alic_71",
|
|
1103
|
+
"bsy-mobile-calendar-threeday__date-num--future": "_bsy-mobile-calendar-threeday__date-num--future_1alic_74",
|
|
1104
|
+
"bsy-mobile-calendar-threeday__allday": "_bsy-mobile-calendar-threeday__allday_1alic_77",
|
|
1105
|
+
"bsy-mobile-calendar-threeday__allday-area": "_bsy-mobile-calendar-threeday__allday-area_1alic_85",
|
|
1106
|
+
"bsy-mobile-calendar-threeday__allday-track": "_bsy-mobile-calendar-threeday__allday-track_1alic_91",
|
|
1107
|
+
"bsy-mobile-calendar-threeday__allday-card": "_bsy-mobile-calendar-threeday__allday-card_1alic_96",
|
|
1108
|
+
"bsy-mobile-calendar-threeday__expand-btn": "_bsy-mobile-calendar-threeday__expand-btn_1alic_104",
|
|
1109
|
+
"bsy-mobile-calendar-threeday__collapse": "_bsy-mobile-calendar-threeday__collapse_1alic_115",
|
|
1110
|
+
"bsy-mobile-calendar-threeday__body": "_bsy-mobile-calendar-threeday__body_1alic_127",
|
|
1111
|
+
"bsy-mobile-calendar-threeday__body-content": "_bsy-mobile-calendar-threeday__body-content_1alic_132",
|
|
1112
|
+
"bsy-mobile-calendar-threeday__body-time": "_bsy-mobile-calendar-threeday__body-time_1alic_136",
|
|
1113
|
+
"bsy-mobile-calendar-threeday__time-label": "_bsy-mobile-calendar-threeday__time-label_1alic_150",
|
|
1114
|
+
"bsy-mobile-calendar-threeday__grid": "_bsy-mobile-calendar-threeday__grid_1alic_158",
|
|
1115
|
+
"bsy-mobile-calendar-threeday__grid-track": "_bsy-mobile-calendar-threeday__grid-track_1alic_165",
|
|
1116
|
+
"bsy-mobile-calendar-threeday__day-col": "_bsy-mobile-calendar-threeday__day-col_1alic_170",
|
|
1117
|
+
"bsy-mobile-calendar-threeday__hour-cell": "_bsy-mobile-calendar-threeday__hour-cell_1alic_174",
|
|
1118
|
+
"bsy-mobile-calendar-threeday__timed-layer": "_bsy-mobile-calendar-threeday__timed-layer_1alic_179",
|
|
1119
|
+
"bsy-mobile-calendar-threeday__timed-item": "_bsy-mobile-calendar-threeday__timed-item_1alic_192",
|
|
1120
|
+
"bsy-mobile-calendar-threeday__now-line": "_bsy-mobile-calendar-threeday__now-line_1alic_197",
|
|
1121
|
+
"bsy-mobile-calendar-threeday__now-dot": "_bsy-mobile-calendar-threeday__now-dot_1alic_206"
|
|
1122
|
+
}, qe = () => {
|
|
1123
|
+
let { visibleDays: t, trackTransformX: r, transitionEnabled: i, bindEvents: a, handleTransitionEnd: o, columnWidth: s, getColumnLeft: c } = Y(), { timeZone: l, timezoneLabel: u } = w(), { t: d } = e(), p = f(() => n(l).startOf("day"), [l]), m = f(() => ({
|
|
1124
|
+
transform: `translateX(${r}px)`,
|
|
1125
|
+
transition: i ? `transform ${k} ${A}` : "none"
|
|
1126
|
+
}), [r, i]);
|
|
1127
|
+
return /* @__PURE__ */ g("div", {
|
|
1128
|
+
className: X["bsy-mobile-calendar-threeday__header"],
|
|
1129
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1130
|
+
className: X["bsy-mobile-calendar-threeday__tz"],
|
|
1131
|
+
children: [/* @__PURE__ */ h("div", { className: X["bsy-mobile-calendar-threeday__tz-empty"] }), /* @__PURE__ */ h("div", {
|
|
1132
|
+
className: X["bsy-mobile-calendar-threeday__tz-label"],
|
|
1136
1133
|
children: u
|
|
1137
1134
|
})]
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1139
|
-
className:
|
|
1135
|
+
}), /* @__PURE__ */ h("div", {
|
|
1136
|
+
className: X["bsy-mobile-calendar-threeday__dates"],
|
|
1140
1137
|
...a,
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1142
|
-
className:
|
|
1143
|
-
style:
|
|
1138
|
+
children: /* @__PURE__ */ h("div", {
|
|
1139
|
+
className: X["bsy-mobile-calendar-threeday__dates-track"],
|
|
1140
|
+
style: m,
|
|
1144
1141
|
onTransitionEnd: o,
|
|
1145
1142
|
children: t.map(({ date: e, offset: t }) => {
|
|
1146
|
-
let n = e.isSame(p, "day"), r = e.isBefore(p, "day"), i = e.isoWeekday(), a =
|
|
1147
|
-
return /* @__PURE__ */
|
|
1148
|
-
className:
|
|
1143
|
+
let n = e.isSame(p, "day"), r = e.isBefore(p, "day"), i = e.isoWeekday(), a = c(t);
|
|
1144
|
+
return /* @__PURE__ */ g("div", {
|
|
1145
|
+
className: X["bsy-mobile-calendar-threeday__date-col"],
|
|
1149
1146
|
style: {
|
|
1150
1147
|
position: "absolute",
|
|
1151
|
-
left:
|
|
1148
|
+
left: a,
|
|
1152
1149
|
width: s
|
|
1153
1150
|
},
|
|
1154
|
-
children: [/* @__PURE__ */
|
|
1155
|
-
className:
|
|
1156
|
-
children:
|
|
1157
|
-
}), /* @__PURE__ */
|
|
1158
|
-
className:
|
|
1151
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1152
|
+
className: T(X["bsy-mobile-calendar-threeday__weekday"], n && X["bsy-mobile-calendar-threeday__weekday--today"], !n && r && X["bsy-mobile-calendar-threeday__weekday--past"]),
|
|
1153
|
+
children: d(`calendar.weekdayPrefixed.${i}`)
|
|
1154
|
+
}), /* @__PURE__ */ h("div", {
|
|
1155
|
+
className: T(X["bsy-mobile-calendar-threeday__date-num"], n && X["bsy-mobile-calendar-threeday__date-num--today"], !n && r && X["bsy-mobile-calendar-threeday__date-num--past"], !n && !r && X["bsy-mobile-calendar-threeday__date-num--future"]),
|
|
1159
1156
|
children: e.date()
|
|
1160
1157
|
})]
|
|
1161
1158
|
}, e.format("YYYY-MM-DD"));
|
|
@@ -1163,92 +1160,92 @@ var K = a(null), qe = ({ children: e, value: t }) => {
|
|
|
1163
1160
|
})
|
|
1164
1161
|
})]
|
|
1165
1162
|
});
|
|
1166
|
-
},
|
|
1163
|
+
}, Je = Array.from({ length: 24 }, (e, t) => `${t.toString().padStart(2, "0")}:00`), Ye = {
|
|
1167
1164
|
interval: 60,
|
|
1168
1165
|
rowHeight: 60
|
|
1169
|
-
}, Xe = 4, Ze = 8, Qe = 4,
|
|
1170
|
-
let t =
|
|
1166
|
+
}, Xe = 4, Ze = 8, Qe = 4, Z = 8, $e = (e) => {
|
|
1167
|
+
let t = b(e.startTime), n = b(e.endTime);
|
|
1171
1168
|
return `${t.format("HH:mm")}-${n.format("HH:mm")}`;
|
|
1172
|
-
}, et = (e, t, n) => Math.min(Math.max(e, t), n), tt = ({ events: e, currentDate:
|
|
1173
|
-
let { timeZone: a } =
|
|
1169
|
+
}, et = (e, t, n) => Math.min(Math.max(e, t), n), tt = ({ events: e, currentDate: r, onEventClick: i }) => {
|
|
1170
|
+
let { timeZone: a } = w(), { visibleDays: o, trackTransformX: s, transitionEnabled: c, bindEvents: l, columnWidth: d, getColumnLeft: _ } = Y(), v = p(null), y = p(null), [x, S] = m(() => Date.now()), C = f(() => n(a).startOf("day"), [a]), T = f(() => o.map(({ date: t, offset: n }, r) => ({
|
|
1174
1171
|
date: t,
|
|
1175
1172
|
offset: n,
|
|
1176
|
-
layout:
|
|
1173
|
+
layout: Fe(e.filter((e) => b(e.startTime).isSame(t, "day") || b(e.startTime).isBefore(t, "day") && b(e.endTime).isAfter(t, "day")), Ye),
|
|
1177
1174
|
isFirstVisibleDay: r === 2
|
|
1178
|
-
})), [o, e]), E =
|
|
1179
|
-
|
|
1175
|
+
})), [o, e]), E = f(() => new Map(e.map((e) => [e.id, e])), [e]), D = f(() => o.findIndex(({ date: e }) => e.isSame(C, "day")), [o, C]), O = f(() => b(r).isSame(C, "day"), [r, C]);
|
|
1176
|
+
u(() => {
|
|
1180
1177
|
if (D === -1) {
|
|
1181
|
-
|
|
1178
|
+
y.current = null;
|
|
1182
1179
|
return;
|
|
1183
1180
|
}
|
|
1184
1181
|
S(Date.now());
|
|
1185
1182
|
let e = window.setInterval(() => S(Date.now()), 60 * 1e3);
|
|
1186
1183
|
return () => window.clearInterval(e);
|
|
1187
1184
|
}, [D]);
|
|
1188
|
-
let j =
|
|
1185
|
+
let j = f(() => {
|
|
1189
1186
|
if (D === -1) return null;
|
|
1190
|
-
let e =
|
|
1187
|
+
let e = t(x, a);
|
|
1191
1188
|
return 20 + (e.hour() * 60 + e.minute() + e.second() / 60) / 60 * 60;
|
|
1192
1189
|
}, [
|
|
1193
1190
|
D,
|
|
1194
1191
|
x,
|
|
1195
1192
|
a
|
|
1196
|
-
]), M =
|
|
1197
|
-
|
|
1198
|
-
if (!
|
|
1199
|
-
let e =
|
|
1200
|
-
if (
|
|
1201
|
-
let
|
|
1202
|
-
|
|
1193
|
+
]), M = f(() => j === null ? null : j - 20, [j]);
|
|
1194
|
+
u(() => {
|
|
1195
|
+
if (!O || !v.current || j === null) return;
|
|
1196
|
+
let e = b(r).format("YYYY-MM-DD");
|
|
1197
|
+
if (y.current === e) return;
|
|
1198
|
+
let t = v.current, n = Math.max(t.scrollHeight - t.clientHeight, 0);
|
|
1199
|
+
t.scrollTop = et(j - t.clientHeight * .35, 0, n), y.current = e;
|
|
1203
1200
|
}, [
|
|
1204
|
-
|
|
1205
|
-
|
|
1201
|
+
r,
|
|
1202
|
+
O,
|
|
1206
1203
|
j
|
|
1207
1204
|
]);
|
|
1208
|
-
let N =
|
|
1205
|
+
let N = f(() => ({
|
|
1209
1206
|
transform: `translateX(${s}px)`,
|
|
1210
|
-
transition: c ? `transform ${
|
|
1207
|
+
transition: c ? `transform ${k} ${A}` : "none"
|
|
1211
1208
|
}), [s, c]);
|
|
1212
|
-
return /* @__PURE__ */
|
|
1213
|
-
className:
|
|
1209
|
+
return /* @__PURE__ */ h("div", {
|
|
1210
|
+
className: X["bsy-mobile-calendar-threeday__body"],
|
|
1214
1211
|
ref: v,
|
|
1215
|
-
children: /* @__PURE__ */
|
|
1216
|
-
className:
|
|
1217
|
-
children: [/* @__PURE__ */
|
|
1218
|
-
className:
|
|
1219
|
-
children:
|
|
1220
|
-
className:
|
|
1212
|
+
children: /* @__PURE__ */ g("div", {
|
|
1213
|
+
className: X["bsy-mobile-calendar-threeday__body-content"],
|
|
1214
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1215
|
+
className: X["bsy-mobile-calendar-threeday__body-time"],
|
|
1216
|
+
children: Je.map((e, t) => /* @__PURE__ */ h("div", {
|
|
1217
|
+
className: X["bsy-mobile-calendar-threeday__time-label"],
|
|
1221
1218
|
style: { top: 20 + t * 60 },
|
|
1222
1219
|
children: e
|
|
1223
1220
|
}, e))
|
|
1224
|
-
}), /* @__PURE__ */
|
|
1225
|
-
className:
|
|
1226
|
-
...
|
|
1227
|
-
children: /* @__PURE__ */
|
|
1228
|
-
className:
|
|
1221
|
+
}), /* @__PURE__ */ h("div", {
|
|
1222
|
+
className: X["bsy-mobile-calendar-threeday__grid"],
|
|
1223
|
+
...l,
|
|
1224
|
+
children: /* @__PURE__ */ h("div", {
|
|
1225
|
+
className: X["bsy-mobile-calendar-threeday__grid-track"],
|
|
1229
1226
|
style: N,
|
|
1230
1227
|
children: T.map((e) => {
|
|
1231
|
-
let { date: t, offset: n, layout: r, isFirstVisibleDay: a } = e, o = r.timedEvents ?? [], s = t.isSame(
|
|
1232
|
-
return /* @__PURE__ */
|
|
1233
|
-
className:
|
|
1228
|
+
let { date: t, offset: n, layout: r, isFirstVisibleDay: a } = e, o = r.timedEvents ?? [], s = t.isSame(C, "day"), c = _(n);
|
|
1229
|
+
return /* @__PURE__ */ g("div", {
|
|
1230
|
+
className: X["bsy-mobile-calendar-threeday__day-col"],
|
|
1234
1231
|
style: {
|
|
1235
1232
|
position: "absolute",
|
|
1236
1233
|
left: c,
|
|
1237
|
-
width:
|
|
1234
|
+
width: d
|
|
1238
1235
|
},
|
|
1239
1236
|
children: [
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
className:
|
|
1237
|
+
/* @__PURE__ */ h("div", { style: { height: 20 } }),
|
|
1238
|
+
Je.map((e) => /* @__PURE__ */ h("div", { className: X["bsy-mobile-calendar-threeday__hour-cell"] }, e)),
|
|
1239
|
+
/* @__PURE__ */ g("div", {
|
|
1240
|
+
className: X["bsy-mobile-calendar-threeday__timed-layer"],
|
|
1244
1241
|
children: [o.map((e) => {
|
|
1245
|
-
let { event: t, top: n, height: r, left: o, width: s, isPercent: c, column: l, totalColumns: u } = e,
|
|
1246
|
-
if (!
|
|
1247
|
-
let
|
|
1248
|
-
return /* @__PURE__ */
|
|
1249
|
-
className:
|
|
1242
|
+
let { event: t, top: n, height: r, left: o, width: s, isPercent: c, column: l, totalColumns: u } = e, f = E.get(t.id);
|
|
1243
|
+
if (!f) return null;
|
|
1244
|
+
let p = a ? Ze : Qe, m = Math.max(0, d - p), g = Math.max(u ?? 1, 1), _ = Math.max(0, s - p), v = Math.max(Z, m - (g - 1) * Z), y = et(_, Math.min(Z, m), Math.min(m, v)), b = Math.max(0, m - y), x = (g > 1 ? (l ?? 0) / (g - 1) : 0) * b, S = a ? x + Xe : x;
|
|
1245
|
+
return /* @__PURE__ */ h(I, {
|
|
1246
|
+
className: X["bsy-mobile-calendar-threeday__timed-item"],
|
|
1250
1247
|
label: t.label,
|
|
1251
|
-
timeText: $e(
|
|
1248
|
+
timeText: $e(f),
|
|
1252
1249
|
variant: "timed",
|
|
1253
1250
|
height: r,
|
|
1254
1251
|
style: {
|
|
@@ -1256,12 +1253,12 @@ var K = a(null), qe = ({ children: e, value: t }) => {
|
|
|
1256
1253
|
left: c ? a ? `calc(${o}% + ${Xe}px)` : `${o}%` : S,
|
|
1257
1254
|
width: c ? a ? `calc(${s}% - ${Ze}px)` : `calc(${s}% - ${Qe}px)` : y
|
|
1258
1255
|
},
|
|
1259
|
-
onClick: () => i?.(
|
|
1256
|
+
onClick: () => i?.(f)
|
|
1260
1257
|
}, t.id);
|
|
1261
|
-
}), s && M !== null ? /* @__PURE__ */
|
|
1262
|
-
className:
|
|
1258
|
+
}), s && M !== null ? /* @__PURE__ */ h("div", {
|
|
1259
|
+
className: X["bsy-mobile-calendar-threeday__now-line"],
|
|
1263
1260
|
style: { top: M },
|
|
1264
|
-
children: /* @__PURE__ */
|
|
1261
|
+
children: /* @__PURE__ */ h("div", { className: X["bsy-mobile-calendar-threeday__now-dot"] })
|
|
1265
1262
|
}) : null]
|
|
1266
1263
|
})
|
|
1267
1264
|
]
|
|
@@ -1275,7 +1272,7 @@ var K = a(null), qe = ({ children: e, value: t }) => {
|
|
|
1275
1272
|
//#endregion
|
|
1276
1273
|
//#region src/components/Calendar/utils/threeDaysAlgorithm.ts
|
|
1277
1274
|
function nt(e, t) {
|
|
1278
|
-
let n = t.startOf("day"), r =
|
|
1275
|
+
let n = t.startOf("day"), r = b(e.startTime), i = b(e.endTime), a = r.startOf("day").diff(n, "day"), o = i.hour() === 0 && i.minute() === 0 && i.second() === 0 ? i.startOf("day").diff(n, "day") : i.startOf("day").add(1, "day").diff(n, "day");
|
|
1279
1276
|
return {
|
|
1280
1277
|
event: e,
|
|
1281
1278
|
startCol: a,
|
|
@@ -1309,8 +1306,8 @@ function it(e, t) {
|
|
|
1309
1306
|
//#endregion
|
|
1310
1307
|
//#region src/components/Calendar/CalendarThreeDay/ThreeDayAllDayEvents/ThreeDayAllDayEvents.tsx
|
|
1311
1308
|
var at = 22;
|
|
1312
|
-
function
|
|
1313
|
-
let i =
|
|
1309
|
+
function ot(e, t, n, r) {
|
|
1310
|
+
let i = J(r), a = e * i, o = t * i, s = a + n, c = o + n, l = r * 3 + 8, u = Math.max(s, 0), d = Math.min(c, l) - u;
|
|
1314
1311
|
return {
|
|
1315
1312
|
left: u,
|
|
1316
1313
|
width: d,
|
|
@@ -1319,8 +1316,8 @@ function Z(e, t, n, r) {
|
|
|
1319
1316
|
isEnd: c <= l
|
|
1320
1317
|
};
|
|
1321
1318
|
}
|
|
1322
|
-
function
|
|
1323
|
-
let r =
|
|
1319
|
+
function st(e, t, n) {
|
|
1320
|
+
let r = J(n), i = [
|
|
1324
1321
|
0,
|
|
1325
1322
|
0,
|
|
1326
1323
|
0
|
|
@@ -1331,73 +1328,73 @@ function ot(e, t, n) {
|
|
|
1331
1328
|
}
|
|
1332
1329
|
return i;
|
|
1333
1330
|
}
|
|
1334
|
-
var
|
|
1335
|
-
let { offsetX: r, transitionEnabled: i, bindEvents: a, columnWidth: o } =
|
|
1336
|
-
let e = l.filter((e) =>
|
|
1331
|
+
var ct = ({ events: e, baseDate: t, onEventClick: n }) => {
|
|
1332
|
+
let { offsetX: r, transitionEnabled: i, bindEvents: a, columnWidth: o } = Y(), [s, c] = m(!1), l = f(() => it(e, t), [e, t]), u = f(() => {
|
|
1333
|
+
let e = l.filter((e) => ot(e.startCol, e.endCol, r, o).visible);
|
|
1337
1334
|
return e.length === 0 ? -1 : Math.max(...e.map((e) => e.row));
|
|
1338
1335
|
}, [
|
|
1339
1336
|
l,
|
|
1340
1337
|
r,
|
|
1341
1338
|
o
|
|
1342
|
-
]) + 1,
|
|
1339
|
+
]) + 1, d = u > 3, p = s && u > 8, _ = s ? Math.min(u, 8) : Math.min(u, 3), v = f(() => s || !d ? [
|
|
1343
1340
|
0,
|
|
1344
1341
|
0,
|
|
1345
1342
|
0
|
|
1346
|
-
] :
|
|
1343
|
+
] : st(l, r, o), [
|
|
1347
1344
|
l,
|
|
1348
1345
|
r,
|
|
1349
1346
|
o,
|
|
1350
1347
|
s,
|
|
1351
|
-
|
|
1352
|
-
]), y = !s &&
|
|
1348
|
+
d
|
|
1349
|
+
]), y = !s && d && v.some((e) => e > 0), b = f(() => u === 0 ? 0 : _ * j + (y ? at : 0) + 8, [
|
|
1353
1350
|
u,
|
|
1354
1351
|
_,
|
|
1355
1352
|
y
|
|
1356
|
-
]), x =
|
|
1353
|
+
]), x = f(() => u === 0 ? 0 : p ? u * j : _ * j + (y ? at : 0), [
|
|
1357
1354
|
u,
|
|
1358
1355
|
_,
|
|
1359
1356
|
y,
|
|
1360
|
-
|
|
1361
|
-
]), S =
|
|
1362
|
-
return /* @__PURE__ */
|
|
1363
|
-
className:
|
|
1357
|
+
p
|
|
1358
|
+
]), S = J(o);
|
|
1359
|
+
return /* @__PURE__ */ g("div", {
|
|
1360
|
+
className: X["bsy-mobile-calendar-threeday__allday"],
|
|
1364
1361
|
style: { height: b },
|
|
1365
|
-
children: [s &&
|
|
1366
|
-
className:
|
|
1362
|
+
children: [s && d ? /* @__PURE__ */ h("div", {
|
|
1363
|
+
className: X["bsy-mobile-calendar-threeday__collapse"],
|
|
1367
1364
|
onClick: () => c(!1),
|
|
1368
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1369
1366
|
width: "16",
|
|
1370
1367
|
height: "16",
|
|
1371
1368
|
viewBox: "0 0 16 16",
|
|
1372
1369
|
fill: "none",
|
|
1373
1370
|
style: { transform: "rotate(180deg)" },
|
|
1374
|
-
children: /* @__PURE__ */
|
|
1371
|
+
children: /* @__PURE__ */ h("path", {
|
|
1375
1372
|
d: "M4 6L8 10L12 6",
|
|
1376
|
-
stroke: "
|
|
1373
|
+
stroke: "currentColor",
|
|
1377
1374
|
strokeWidth: "1.5",
|
|
1378
1375
|
strokeLinecap: "round",
|
|
1379
1376
|
strokeLinejoin: "round"
|
|
1380
1377
|
})
|
|
1381
1378
|
})
|
|
1382
|
-
}) : null, /* @__PURE__ */
|
|
1383
|
-
className:
|
|
1384
|
-
style:
|
|
1379
|
+
}) : null, /* @__PURE__ */ h("div", {
|
|
1380
|
+
className: X["bsy-mobile-calendar-threeday__allday-area"],
|
|
1381
|
+
style: p ? {
|
|
1385
1382
|
overflowY: "auto",
|
|
1386
|
-
maxHeight: 8 *
|
|
1383
|
+
maxHeight: 8 * j
|
|
1387
1384
|
} : void 0,
|
|
1388
1385
|
...a,
|
|
1389
|
-
children: /* @__PURE__ */
|
|
1390
|
-
className:
|
|
1386
|
+
children: /* @__PURE__ */ g("div", {
|
|
1387
|
+
className: X["bsy-mobile-calendar-threeday__allday-track"],
|
|
1391
1388
|
style: {
|
|
1392
1389
|
height: x,
|
|
1393
|
-
transition: i ? `height ${
|
|
1390
|
+
transition: i ? `height ${k} ${A}` : "none"
|
|
1394
1391
|
},
|
|
1395
1392
|
children: [l.map((e) => {
|
|
1396
1393
|
let { event: t, startCol: i, endCol: a, row: c } = e;
|
|
1397
1394
|
if (!s && c >= 3) return null;
|
|
1398
|
-
let l =
|
|
1399
|
-
return l.visible ? /* @__PURE__ */
|
|
1400
|
-
className:
|
|
1395
|
+
let l = ot(i, a, r, o);
|
|
1396
|
+
return l.visible ? /* @__PURE__ */ h(I, {
|
|
1397
|
+
className: X["bsy-mobile-calendar-threeday__allday-card"],
|
|
1401
1398
|
label: t.label,
|
|
1402
1399
|
variant: "allDay",
|
|
1403
1400
|
height: 22,
|
|
@@ -1407,22 +1404,22 @@ var st = ({ events: e, baseDate: t, onEventClick: n }) => {
|
|
|
1407
1404
|
style: {
|
|
1408
1405
|
left: l.left,
|
|
1409
1406
|
width: l.width - 4,
|
|
1410
|
-
top: c *
|
|
1407
|
+
top: c * j + 4
|
|
1411
1408
|
},
|
|
1412
1409
|
onClick: () => n?.(t)
|
|
1413
1410
|
}, t.id) : null;
|
|
1414
1411
|
}), y ? v.map((e, t) => {
|
|
1415
1412
|
if (e === 0) return null;
|
|
1416
1413
|
let n = t * S;
|
|
1417
|
-
return /* @__PURE__ */
|
|
1418
|
-
className:
|
|
1414
|
+
return /* @__PURE__ */ h("div", {
|
|
1415
|
+
className: X["bsy-mobile-calendar-threeday__expand-btn"],
|
|
1419
1416
|
style: {
|
|
1420
1417
|
left: n,
|
|
1421
1418
|
width: o - 4,
|
|
1422
|
-
top: 3 *
|
|
1419
|
+
top: 3 * j + 4
|
|
1423
1420
|
},
|
|
1424
1421
|
onClick: () => c(!0),
|
|
1425
|
-
children: /* @__PURE__ */
|
|
1422
|
+
children: /* @__PURE__ */ g("span", { children: [
|
|
1426
1423
|
"还有",
|
|
1427
1424
|
e,
|
|
1428
1425
|
"条记录"
|
|
@@ -1432,61 +1429,61 @@ var st = ({ events: e, baseDate: t, onEventClick: n }) => {
|
|
|
1432
1429
|
})
|
|
1433
1430
|
})]
|
|
1434
1431
|
});
|
|
1435
|
-
},
|
|
1436
|
-
let { currentDate: e, setCurrentDate: t, events: n, onEventClick: r } =
|
|
1437
|
-
baseDate:
|
|
1438
|
-
setBaseDate:
|
|
1432
|
+
}, lt = () => {
|
|
1433
|
+
let { currentDate: e, setCurrentDate: t, events: n, onEventClick: r } = w(), i = p(null), a = y(i), o = f(() => a?.width ? (a.width - 56 - 8 - 8) / 3 : 0, [a?.width]), s = f(() => b(e), [e]), { visibleDays: l, offsetX: u, trackTransformX: d, transitionEnabled: m, bindEvents: _, handleTransitionEnd: v, getColumnLeft: x, resetPosition: S } = We({
|
|
1434
|
+
baseDate: s,
|
|
1435
|
+
setBaseDate: c((e) => {
|
|
1439
1436
|
t(e.toDate());
|
|
1440
1437
|
}, [t]),
|
|
1441
1438
|
columnWidth: o
|
|
1442
|
-
}),
|
|
1439
|
+
}), C = f(() => n.filter((e) => z(e)), [n]), T = f(() => n.filter((e) => !z(e)), [n]), E = f(() => ({
|
|
1443
1440
|
visibleDays: l,
|
|
1444
1441
|
offsetX: u,
|
|
1445
|
-
trackTransformX:
|
|
1446
|
-
transitionEnabled:
|
|
1442
|
+
trackTransformX: d,
|
|
1443
|
+
transitionEnabled: m,
|
|
1447
1444
|
bindEvents: _,
|
|
1448
|
-
handleTransitionEnd:
|
|
1445
|
+
handleTransitionEnd: v,
|
|
1449
1446
|
columnWidth: o,
|
|
1450
1447
|
getColumnLeft: x,
|
|
1451
1448
|
resetPosition: S
|
|
1452
1449
|
}), [
|
|
1453
1450
|
l,
|
|
1454
1451
|
u,
|
|
1455
|
-
|
|
1456
|
-
|
|
1452
|
+
d,
|
|
1453
|
+
m,
|
|
1457
1454
|
_,
|
|
1458
|
-
|
|
1455
|
+
v,
|
|
1459
1456
|
o,
|
|
1460
1457
|
x,
|
|
1461
1458
|
S
|
|
1462
1459
|
]);
|
|
1463
|
-
return /* @__PURE__ */
|
|
1464
|
-
className:
|
|
1460
|
+
return /* @__PURE__ */ h("div", {
|
|
1461
|
+
className: X["bsy-mobile-calendar-threeday"],
|
|
1465
1462
|
ref: i,
|
|
1466
|
-
children: o > 0 ? /* @__PURE__ */
|
|
1463
|
+
children: o > 0 ? /* @__PURE__ */ g(Ke, {
|
|
1467
1464
|
value: E,
|
|
1468
|
-
children: [/* @__PURE__ */
|
|
1469
|
-
className:
|
|
1470
|
-
children: [/* @__PURE__ */
|
|
1471
|
-
events:
|
|
1472
|
-
baseDate:
|
|
1465
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1466
|
+
className: X["bsy-mobile-calendar-threeday__header-wrap"],
|
|
1467
|
+
children: [/* @__PURE__ */ h(qe, {}), /* @__PURE__ */ h(ct, {
|
|
1468
|
+
events: C,
|
|
1469
|
+
baseDate: s,
|
|
1473
1470
|
onEventClick: r
|
|
1474
1471
|
})]
|
|
1475
|
-
}), /* @__PURE__ */
|
|
1472
|
+
}), /* @__PURE__ */ h(tt, {
|
|
1476
1473
|
events: T,
|
|
1477
1474
|
currentDate: e,
|
|
1478
1475
|
onEventClick: r
|
|
1479
1476
|
})]
|
|
1480
1477
|
}) : null
|
|
1481
1478
|
});
|
|
1482
|
-
},
|
|
1483
|
-
let { timeZone: r } =
|
|
1484
|
-
return Array.isArray(e) ? e.map((e,
|
|
1479
|
+
}, ut = (e, n = {}) => {
|
|
1480
|
+
let { timeZone: r } = n;
|
|
1481
|
+
return Array.isArray(e) ? e.map((e, n) => ({
|
|
1485
1482
|
...e,
|
|
1486
|
-
id: e.id ?? String(
|
|
1483
|
+
id: e.id ?? String(n),
|
|
1487
1484
|
label: e.label ?? "",
|
|
1488
|
-
startTime:
|
|
1489
|
-
endTime:
|
|
1485
|
+
startTime: t(e.startTime, r),
|
|
1486
|
+
endTime: t(e.endTime, r)
|
|
1490
1487
|
})) : [];
|
|
1491
1488
|
}, Q = {
|
|
1492
1489
|
"#005EEF": {
|
|
@@ -1525,7 +1522,7 @@ var st = ({ events: e, baseDate: t, onEventClick: n }) => {
|
|
|
1525
1522
|
normal: "#F2F3F5",
|
|
1526
1523
|
hover: "#E6E6E7"
|
|
1527
1524
|
}
|
|
1528
|
-
}, $ = /* @__PURE__ */ new Map(),
|
|
1525
|
+
}, $ = /* @__PURE__ */ new Map(), dt = (e) => {
|
|
1529
1526
|
if (!e) return {
|
|
1530
1527
|
normal: "#e8f0fe",
|
|
1531
1528
|
hover: "#d7e3fd"
|
|
@@ -1538,43 +1535,61 @@ var st = ({ events: e, baseDate: t, onEventClick: n }) => {
|
|
|
1538
1535
|
hover: `rgb(${Math.round(n + (255 - n) * o)}, ${Math.round(r + (255 - r) * o)}, ${Math.round(i + (255 - i) * o)})`
|
|
1539
1536
|
};
|
|
1540
1537
|
return $.set(e, s), s;
|
|
1541
|
-
},
|
|
1542
|
-
let
|
|
1543
|
-
return
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
"
|
|
1547
|
-
|
|
1548
|
-
},
|
|
1549
|
-
|
|
1538
|
+
}, ft = (e, t, n) => {
|
|
1539
|
+
let r = {};
|
|
1540
|
+
return e && (r["--bsy-mobile-calendar-color"] = e), t && (r["--bsy-mobile-calendar-bg"] = t), n && (r["--bsy-mobile-calendar-hover"] = n), r;
|
|
1541
|
+
}, pt = {
|
|
1542
|
+
center: {
|
|
1543
|
+
backgroundPosition: "50%",
|
|
1544
|
+
backgroundSize: "contain"
|
|
1545
|
+
},
|
|
1546
|
+
stretch: {
|
|
1547
|
+
backgroundPosition: "50%",
|
|
1548
|
+
backgroundSize: "cover"
|
|
1549
|
+
},
|
|
1550
|
+
masterDrawingCenter: {
|
|
1551
|
+
backgroundPosition: "50%",
|
|
1552
|
+
backgroundSize: "100% 100%"
|
|
1553
|
+
}
|
|
1554
|
+
}, mt = (e) => {
|
|
1555
|
+
let t = {};
|
|
1556
|
+
if (i(t, "--bsy-mobile-calendar-background-color", e.colorBgContainer), e.panelBgImage) {
|
|
1557
|
+
let n = pt[e.panelBgImagePosition ?? "center"];
|
|
1558
|
+
t["--bsy-mobile-calendar-background-image"] = `url(${e.panelBgImage})`, t["--bsy-mobile-calendar-background-position"] = n.backgroundPosition, t["--bsy-mobile-calendar-background-size"] = n.backgroundSize, t["--bsy-mobile-calendar-background-repeat"] = "no-repeat";
|
|
1559
|
+
}
|
|
1560
|
+
return t;
|
|
1561
|
+
}, ht = (e, t) => {
|
|
1562
|
+
let n = t ?? e?.colorPrimary ?? "#0265ff", r = dt(n), a = ft(n, r.normal, r.hover);
|
|
1563
|
+
return e ? (Object.assign(a, mt(e)), i(a, "--bsy-mobile-calendar-title-color", e.colorText), i(a, "--bsy-mobile-calendar-over-title-color", e.colorTextTertiary), i(a, "--bsy-mobile-calendar-specifically-color", e.colorTextQuaternary ?? e.colorTextTertiary), i(a, "--bsy-mobile-calendar-header-background", e.colorFillSecondary), i(a, "--bsy-mobile-calendar-highlight-color", e.colorPrimary), e.colorPrimary && (a["--bsy-mobile-calendar-segmented-active-color"] = "#fff"), i(a, "--bsy-mobile-calendar-highlight-text-color", e.colorPrimaryText), i(a, "--bsy-mobile-calendar-border-color", e.colorSplit), i(a, "--bsy-mobile-calendar-more-record-color", e.colorLink), Object.assign(a, ft(e.eventBorderColor, e.eventBg, e.eventBgHover)), a) : a;
|
|
1564
|
+
}, gt = (e) => {
|
|
1565
|
+
let { events: t, scheduleColor: r, theme: i, timeZone: a, className: o, onEventClick: s, onDayClick: c } = e, [l, u] = _(e, {
|
|
1550
1566
|
defaultValue: "month",
|
|
1551
1567
|
defaultValuePropName: "defaultMode",
|
|
1552
1568
|
valuePropName: "mode",
|
|
1553
1569
|
trigger: "onModeChange"
|
|
1554
|
-
}), [
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
className:
|
|
1557
|
-
style:
|
|
1558
|
-
children: /* @__PURE__ */
|
|
1559
|
-
currentDate:
|
|
1560
|
-
setCurrentDate:
|
|
1561
|
-
viewMode:
|
|
1562
|
-
setViewMode:
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
className: b["bsy-mobile-calendar__body"],
|
|
1570
|
+
}), [d, p] = _(e, { defaultValue: n(a).toDate() }), m = f(() => ut(t, { timeZone: a }), [t, a]), v = f(() => ht(i, r), [i, r]);
|
|
1571
|
+
return /* @__PURE__ */ h("div", {
|
|
1572
|
+
className: T(x["bsy-mobile-calendar"], o),
|
|
1573
|
+
style: v,
|
|
1574
|
+
children: /* @__PURE__ */ g(C, {
|
|
1575
|
+
currentDate: d,
|
|
1576
|
+
setCurrentDate: p,
|
|
1577
|
+
viewMode: l,
|
|
1578
|
+
setViewMode: u,
|
|
1579
|
+
timeZone: a,
|
|
1580
|
+
events: m,
|
|
1581
|
+
onEventClick: s,
|
|
1582
|
+
onDayClick: c,
|
|
1583
|
+
children: [/* @__PURE__ */ h(O, {}), /* @__PURE__ */ g("div", {
|
|
1584
|
+
className: x["bsy-mobile-calendar__body"],
|
|
1570
1585
|
children: [
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1586
|
+
l === "month" ? /* @__PURE__ */ h(Te, {}) : null,
|
|
1587
|
+
l === "day" ? /* @__PURE__ */ h(Ve, {}) : null,
|
|
1588
|
+
l === "threeDay" ? /* @__PURE__ */ h(lt, {}) : null
|
|
1574
1589
|
]
|
|
1575
1590
|
})]
|
|
1576
1591
|
})
|
|
1577
1592
|
});
|
|
1578
1593
|
};
|
|
1579
1594
|
//#endregion
|
|
1580
|
-
export {
|
|
1595
|
+
export { gt as t };
|