@reservi/preact 1.3.2 → 1.4.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +137 -4
- package/dist/index.js +984 -565
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,18 +1,58 @@
|
|
|
1
|
-
import { render as
|
|
2
|
-
import { getLocaleText as
|
|
3
|
-
import { dayGridPlugin as
|
|
4
|
-
import {
|
|
1
|
+
import { render as at, h as bt } from "preact";
|
|
2
|
+
import { getLocaleText as R, dl as s, timeStringToMinutes as K, computeDrop as J, pxToSnappedMinutes as wt, computeResize as kt, THEME_TOKEN_VARS as Dt, themeToStyle as pt, CalendarApi as Mt, eventsToICS as St } from "@reservi/core";
|
|
3
|
+
import { dayGridPlugin as ge, definePlugin as ye, defineTheme as fe, eventsToICS as be, listPlugin as we, multiMonthPlugin as ke, parseICS as De, resourcePlugin as pe, themeToStyle as Me, timeGridPlugin as Se, timelinePlugin as Ce } from "@reservi/core";
|
|
4
|
+
import { jsx as d, jsxs as g, Fragment as Ct } from "preact/jsx-runtime";
|
|
5
5
|
import "@preact/signals";
|
|
6
|
-
import { useRef as
|
|
7
|
-
function
|
|
8
|
-
return
|
|
6
|
+
import { useRef as $, useLayoutEffect as ot, useState as N, useEffect as H } from "preact/hooks";
|
|
7
|
+
function ce(r) {
|
|
8
|
+
return { __rsvHost: !0, node: r };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function Et(r) {
|
|
11
|
+
return typeof r == "object" && r !== null && r.__rsvHost === !0;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
function L(r, t, e, n) {
|
|
14
|
+
if (!r) return e;
|
|
15
|
+
const o = r(t);
|
|
16
|
+
return o === void 0 ? e : Et(o) ? n ? /* @__PURE__ */ d(xt, { bridge: n, node: o.node }) : e : o;
|
|
17
|
+
}
|
|
18
|
+
let Tt = 0;
|
|
19
|
+
function xt({ bridge: r, node: t }) {
|
|
20
|
+
const e = $("");
|
|
21
|
+
e.current || (e.current = `rsv-host-${++Tt}`);
|
|
22
|
+
const n = $(null), o = $(t);
|
|
23
|
+
o.current = t;
|
|
24
|
+
const a = $(!1);
|
|
25
|
+
return ot(() => {
|
|
26
|
+
const h = n.current;
|
|
27
|
+
if (!h) return;
|
|
28
|
+
const u = e.current;
|
|
29
|
+
return a.current = !0, r.mount(u, h, o.current), () => {
|
|
30
|
+
a.current = !1, r.unmount(u);
|
|
31
|
+
};
|
|
32
|
+
}, []), ot(() => {
|
|
33
|
+
a.current && r.update(e.current, t);
|
|
34
|
+
}), /* @__PURE__ */ d("div", { "data-rsv": "host", ref: n });
|
|
35
|
+
}
|
|
36
|
+
function F(...r) {
|
|
37
|
+
return r.filter(Boolean).join(" ");
|
|
38
|
+
}
|
|
39
|
+
const dt = /* @__PURE__ */ new WeakSet();
|
|
40
|
+
function A(r, t, e) {
|
|
41
|
+
if (!r || !t) return;
|
|
42
|
+
const n = r;
|
|
43
|
+
dt.has(n) || (dt.add(n), t(Object.assign(e(), { el: n })));
|
|
44
|
+
}
|
|
45
|
+
function $t(r, t) {
|
|
46
|
+
if (!r.length) return null;
|
|
47
|
+
const e = [...r].sort((o, a) => o.breakpoint - a.breakpoint);
|
|
48
|
+
let n = e[0].view;
|
|
49
|
+
for (const o of e)
|
|
50
|
+
t >= o.breakpoint && (n = o.view);
|
|
51
|
+
return n;
|
|
52
|
+
}
|
|
53
|
+
const G = { prev: "‹", next: "›" }, Pt = /* @__PURE__ */ new Set(["", "title", "today", "prev", "next"]), Ot = /month|year/i, B = (r) => String(r).padStart(2, "0");
|
|
54
|
+
function Lt() {
|
|
55
|
+
return /* @__PURE__ */ g(
|
|
16
56
|
"svg",
|
|
17
57
|
{
|
|
18
58
|
"data-rsv": "title-icon",
|
|
@@ -26,158 +66,158 @@ function ft() {
|
|
|
26
66
|
"stroke-linejoin": "round",
|
|
27
67
|
"aria-hidden": "true",
|
|
28
68
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ d("rect", { x: "1", y: "2.5", width: "12", height: "10.5", rx: "1.5" }),
|
|
70
|
+
/* @__PURE__ */ d("line", { x1: "1", y1: "5.5", x2: "13", y2: "5.5" }),
|
|
71
|
+
/* @__PURE__ */ d("line", { x1: "4.5", y1: "1", x2: "4.5", y2: "3.5" }),
|
|
72
|
+
/* @__PURE__ */ d("line", { x1: "9.5", y1: "1", x2: "9.5", y2: "3.5" })
|
|
33
73
|
]
|
|
34
74
|
}
|
|
35
75
|
);
|
|
36
76
|
}
|
|
37
|
-
function
|
|
38
|
-
var
|
|
39
|
-
if ((
|
|
40
|
-
const t =
|
|
41
|
-
return t ? [t.start, t.center, t.end].filter((
|
|
77
|
+
function Ft(r) {
|
|
78
|
+
var e;
|
|
79
|
+
if ((e = r.views) != null && e.length) return r.views;
|
|
80
|
+
const t = r.headerToolbar;
|
|
81
|
+
return t ? [t.start, t.center, t.end].filter((n) => !!n).flatMap((n) => n.split(/\s+/)).flatMap((n) => n.split(",")).filter((n) => !Pt.has(n)) : [];
|
|
42
82
|
}
|
|
43
|
-
function
|
|
44
|
-
var
|
|
45
|
-
const o =
|
|
83
|
+
function Rt({ api: r, title: t, activeView: e, options: n }) {
|
|
84
|
+
var V, Z, Y, tt, et;
|
|
85
|
+
const o = R(n.locale), a = (Z = (V = n.slots) == null ? void 0 : V.toolbarStart) == null ? void 0 : Z.call(V), h = (tt = (Y = n.slots) == null ? void 0 : Y.toolbarEnd) == null ? void 0 : tt.call(Y), u = Ft(n), v = Ot.test(e), c = n.firstDay ?? o.firstDay, l = $(null), [f, b] = N(!1), k = s.toDate(r.getDate()), w = s.toDate(n.now ? s.from(n.now) : s.now()), [p, m] = N(k.getFullYear()), [S, i] = N(k.getMonth()), D = new Intl.DateTimeFormat(n.locale, { month: "short" }), C = new Intl.DateTimeFormat(n.locale, { month: "long" }), M = new Intl.DateTimeFormat(n.locale, { weekday: "short" }), E = Array.from(
|
|
46
86
|
{ length: 12 },
|
|
47
|
-
(
|
|
48
|
-
),
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
87
|
+
(y, T) => D.format(new Date(2020, T, 1))
|
|
88
|
+
), x = () => {
|
|
89
|
+
const y = s.toDate(r.getDate());
|
|
90
|
+
m(y.getFullYear()), i(y.getMonth()), b(!0);
|
|
91
|
+
}, I = (y) => {
|
|
92
|
+
const T = p * 12 + S + y;
|
|
93
|
+
m(Math.floor(T / 12)), i((T % 12 + 12) % 12);
|
|
94
|
+
}, P = (y) => {
|
|
95
|
+
r.gotoDate(y), b(!1);
|
|
56
96
|
};
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
(
|
|
60
|
-
},
|
|
61
|
-
|
|
97
|
+
H(() => {
|
|
98
|
+
const y = (O) => {
|
|
99
|
+
(O.ctrlKey || O.metaKey) && (O.key === "m" || O.key === "M") ? (O.preventDefault(), x()) : O.key === "Escape" && b(!1);
|
|
100
|
+
}, T = (O) => {
|
|
101
|
+
l.current && !l.current.contains(O.target) && b(!1);
|
|
62
102
|
};
|
|
63
|
-
return document.addEventListener("keydown",
|
|
64
|
-
document.removeEventListener("keydown",
|
|
103
|
+
return document.addEventListener("keydown", y), document.addEventListener("mousedown", T), () => {
|
|
104
|
+
document.removeEventListener("keydown", y), document.removeEventListener("mousedown", T);
|
|
65
105
|
};
|
|
66
106
|
}, []);
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
return { cells:
|
|
107
|
+
const Q = (() => {
|
|
108
|
+
if (v) return { cells: [], dows: [] };
|
|
109
|
+
const y = s.from(`${p}-${B(S + 1)}-01`), T = (s.dayOfWeek(y) - c + 7) % 7, O = s.subtract(y, { days: T }), rt = Array.from({ length: 42 }, (nt, ft) => s.toDate(s.add(O, { days: ft }))), yt = rt.slice(0, 7).map((nt) => M.format(nt));
|
|
110
|
+
return { cells: rt, dows: yt };
|
|
71
111
|
})();
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "toolbar-wrap", class: F((et = n.classNames) == null ? void 0 : et.toolbar), ref: l, children: [
|
|
113
|
+
/* @__PURE__ */ g("div", { "data-rsv": "toolbar", children: [
|
|
114
|
+
/* @__PURE__ */ d("div", { "data-rsv": "toolbar-section", "data-rsv-area": "start", children: a }),
|
|
115
|
+
/* @__PURE__ */ g("div", { "data-rsv": "toolbar-section", "data-rsv-area": "nav", children: [
|
|
116
|
+
/* @__PURE__ */ d(
|
|
77
117
|
"button",
|
|
78
118
|
{
|
|
79
119
|
type: "button",
|
|
80
120
|
"data-rsv": "button",
|
|
81
|
-
title: o.
|
|
82
|
-
"aria-label": o.
|
|
83
|
-
onClick: () =>
|
|
121
|
+
title: o.todayHint,
|
|
122
|
+
"aria-label": o.todayHint,
|
|
123
|
+
onClick: () => r.today(),
|
|
84
124
|
children: o.today
|
|
85
125
|
}
|
|
86
126
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ d(
|
|
88
128
|
"button",
|
|
89
129
|
{
|
|
90
130
|
type: "button",
|
|
91
131
|
"data-rsv": "button",
|
|
92
132
|
"data-rsv-nav": "prev",
|
|
93
|
-
title: o.
|
|
94
|
-
"aria-label": o.
|
|
95
|
-
onClick: () =>
|
|
96
|
-
children:
|
|
133
|
+
title: o.prevHint,
|
|
134
|
+
"aria-label": o.prevHint,
|
|
135
|
+
onClick: () => r.prev(),
|
|
136
|
+
children: G.prev
|
|
97
137
|
}
|
|
98
138
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ g("div", { "data-rsv": "datepicker-anchor", children: [
|
|
140
|
+
/* @__PURE__ */ g(
|
|
101
141
|
"button",
|
|
102
142
|
{
|
|
103
143
|
type: "button",
|
|
104
144
|
"data-rsv": "title",
|
|
105
145
|
"aria-haspopup": "dialog",
|
|
106
|
-
"aria-expanded":
|
|
146
|
+
"aria-expanded": f,
|
|
107
147
|
title: `${t} · Ctrl+M`,
|
|
108
|
-
onClick: () =>
|
|
148
|
+
onClick: () => f ? b(!1) : x(),
|
|
109
149
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ d(Lt, {}),
|
|
111
151
|
t
|
|
112
152
|
]
|
|
113
153
|
}
|
|
114
154
|
),
|
|
115
|
-
|
|
155
|
+
f && /* @__PURE__ */ g(
|
|
116
156
|
"div",
|
|
117
157
|
{
|
|
118
158
|
"data-rsv": "datepicker",
|
|
119
|
-
"data-rsv-mode":
|
|
159
|
+
"data-rsv-mode": v ? "month" : "day",
|
|
120
160
|
role: "dialog",
|
|
121
161
|
"aria-label": t,
|
|
122
162
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ g("div", { "data-rsv": "dp-head", children: [
|
|
164
|
+
/* @__PURE__ */ d(
|
|
125
165
|
"button",
|
|
126
166
|
{
|
|
127
167
|
type: "button",
|
|
128
168
|
"data-rsv": "dp-nav",
|
|
129
169
|
"aria-label": o.prev,
|
|
130
|
-
onClick: () =>
|
|
131
|
-
children:
|
|
170
|
+
onClick: () => v ? m((y) => y - 1) : I(-1),
|
|
171
|
+
children: G.prev
|
|
132
172
|
}
|
|
133
173
|
),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ d("span", { "data-rsv": "dp-label", children: v ? p : `${C.format(new Date(p, S, 1))} ${p}` }),
|
|
175
|
+
/* @__PURE__ */ d(
|
|
136
176
|
"button",
|
|
137
177
|
{
|
|
138
178
|
type: "button",
|
|
139
179
|
"data-rsv": "dp-nav",
|
|
140
180
|
"aria-label": o.next,
|
|
141
|
-
onClick: () =>
|
|
142
|
-
children:
|
|
181
|
+
onClick: () => v ? m((y) => y + 1) : I(1),
|
|
182
|
+
children: G.next
|
|
143
183
|
}
|
|
144
184
|
)
|
|
145
185
|
] }),
|
|
146
|
-
|
|
186
|
+
v ? /* @__PURE__ */ d("div", { "data-rsv": "dp-grid", children: E.map((y, T) => /* @__PURE__ */ d(
|
|
147
187
|
"button",
|
|
148
188
|
{
|
|
149
189
|
type: "button",
|
|
150
190
|
"data-rsv": "dp-month",
|
|
151
191
|
"data-active": String(
|
|
152
|
-
|
|
192
|
+
p === k.getFullYear() && T === k.getMonth()
|
|
153
193
|
),
|
|
154
194
|
"data-today": String(
|
|
155
|
-
|
|
195
|
+
p === w.getFullYear() && T === w.getMonth()
|
|
156
196
|
),
|
|
157
|
-
onClick: () =>
|
|
158
|
-
children:
|
|
197
|
+
onClick: () => P(`${p}-${B(T + 1)}-01`),
|
|
198
|
+
children: y
|
|
159
199
|
},
|
|
160
|
-
|
|
161
|
-
)) }) : /* @__PURE__ */
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
return /* @__PURE__ */
|
|
200
|
+
y
|
|
201
|
+
)) }) : /* @__PURE__ */ g("div", { "data-rsv": "dp-days", children: [
|
|
202
|
+
Q.dows.map((y, T) => /* @__PURE__ */ d("div", { "data-rsv": "dp-dow", children: y }, `dow-${T}`)),
|
|
203
|
+
Q.cells.map((y) => {
|
|
204
|
+
const T = `${y.getFullYear()}-${B(y.getMonth() + 1)}-${B(y.getDate())}`;
|
|
205
|
+
return /* @__PURE__ */ d(
|
|
166
206
|
"button",
|
|
167
207
|
{
|
|
168
208
|
type: "button",
|
|
169
209
|
"data-rsv": "dp-day",
|
|
170
|
-
"data-other": String(
|
|
210
|
+
"data-other": String(y.getMonth() !== S),
|
|
171
211
|
"data-active": String(
|
|
172
|
-
|
|
212
|
+
y.getFullYear() === k.getFullYear() && y.getMonth() === k.getMonth() && y.getDate() === k.getDate()
|
|
173
213
|
),
|
|
174
214
|
"data-today": String(
|
|
175
|
-
|
|
215
|
+
y.getFullYear() === w.getFullYear() && y.getMonth() === w.getMonth() && y.getDate() === w.getDate()
|
|
176
216
|
),
|
|
177
|
-
onClick: () =>
|
|
178
|
-
children:
|
|
217
|
+
onClick: () => P(T),
|
|
218
|
+
children: y.getDate()
|
|
179
219
|
},
|
|
180
|
-
|
|
220
|
+
T
|
|
181
221
|
);
|
|
182
222
|
})
|
|
183
223
|
] })
|
|
@@ -185,233 +225,319 @@ function bt({ api: a, title: t, activeView: r, options: e }) {
|
|
|
185
225
|
}
|
|
186
226
|
)
|
|
187
227
|
] }),
|
|
188
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ d(
|
|
189
229
|
"button",
|
|
190
230
|
{
|
|
191
231
|
type: "button",
|
|
192
232
|
"data-rsv": "button",
|
|
193
233
|
"data-rsv-nav": "next",
|
|
194
|
-
title: o.
|
|
195
|
-
"aria-label": o.
|
|
196
|
-
onClick: () =>
|
|
197
|
-
children:
|
|
234
|
+
title: o.nextHint,
|
|
235
|
+
"aria-label": o.nextHint,
|
|
236
|
+
onClick: () => r.next(),
|
|
237
|
+
children: G.next
|
|
198
238
|
}
|
|
199
239
|
)
|
|
200
240
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
|
|
241
|
+
/* @__PURE__ */ g("div", { "data-rsv": "toolbar-section", "data-rsv-area": "end", children: [
|
|
242
|
+
h,
|
|
243
|
+
n.onAddClick && /* @__PURE__ */ g(
|
|
204
244
|
"button",
|
|
205
245
|
{
|
|
206
246
|
type: "button",
|
|
207
247
|
"data-rsv": "button",
|
|
208
248
|
"data-rsv-variant": "primary",
|
|
209
|
-
onClick:
|
|
249
|
+
onClick: n.onAddClick,
|
|
210
250
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
251
|
+
/* @__PURE__ */ d("span", { "data-rsv": "add-icon", "aria-hidden": "true", children: "+" }),
|
|
252
|
+
n.addButtonText
|
|
213
253
|
]
|
|
214
254
|
}
|
|
215
255
|
)
|
|
216
256
|
] })
|
|
217
257
|
] }),
|
|
218
|
-
|
|
258
|
+
u.length > 0 && /* @__PURE__ */ d("div", { "data-rsv": "toolbar-views", role: "tablist", children: u.map((y) => /* @__PURE__ */ d(
|
|
219
259
|
"button",
|
|
220
260
|
{
|
|
221
261
|
type: "button",
|
|
222
262
|
"data-rsv": "view-tab",
|
|
223
263
|
role: "tab",
|
|
224
|
-
"aria-selected":
|
|
225
|
-
"data-active": String(
|
|
226
|
-
|
|
227
|
-
|
|
264
|
+
"aria-selected": y === e,
|
|
265
|
+
"data-active": String(y === e),
|
|
266
|
+
title: o.viewHint(o.views[y] ?? y),
|
|
267
|
+
onClick: () => r.changeView(y),
|
|
268
|
+
children: o.views[y] ?? y
|
|
228
269
|
},
|
|
229
|
-
|
|
270
|
+
y
|
|
230
271
|
)) })
|
|
231
272
|
] });
|
|
232
273
|
}
|
|
233
|
-
function
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
274
|
+
function U(r) {
|
|
275
|
+
return r < 10 ? `0${r}` : String(r);
|
|
276
|
+
}
|
|
277
|
+
function It(r) {
|
|
278
|
+
const t = (Math.round(r) % 1440 + 1440) % 1440;
|
|
279
|
+
return `${U(Math.floor(t / 60))}:${U(t % 60)}`;
|
|
280
|
+
}
|
|
281
|
+
function At(r) {
|
|
282
|
+
const t = Math.max(0, Math.round(r));
|
|
283
|
+
return `${U(Math.floor(t / 60))}:${U(t % 60)}:00`;
|
|
284
|
+
}
|
|
285
|
+
function X(r, t) {
|
|
286
|
+
if (!t) return null;
|
|
287
|
+
const e = new Intl.DateTimeFormat(r, t);
|
|
288
|
+
return (n) => e.format(n);
|
|
289
|
+
}
|
|
290
|
+
function W(r, t, e) {
|
|
291
|
+
if (t === !1) return null;
|
|
292
|
+
const n = new Intl.DateTimeFormat(r, t ?? e);
|
|
293
|
+
return (o) => n.format(o);
|
|
294
|
+
}
|
|
295
|
+
function st(r, t) {
|
|
296
|
+
r.trigger("navLinkDay", { date: t });
|
|
297
|
+
const e = r.hasView("timeGridDay") ? "timeGridDay" : r.hasView("dayGridDay") ? "dayGridDay" : null;
|
|
298
|
+
e && (r.gotoDate(s.toISOString(t)), r.changeView(e));
|
|
299
|
+
}
|
|
300
|
+
const _ = 1440, Ht = {
|
|
301
|
+
moveLeft: ["ArrowLeft"],
|
|
302
|
+
moveRight: ["ArrowRight"],
|
|
303
|
+
moveUp: ["ArrowUp"],
|
|
304
|
+
moveDown: ["ArrowDown"],
|
|
305
|
+
activate: ["Enter", " "]
|
|
306
|
+
};
|
|
307
|
+
function Nt(r, t) {
|
|
308
|
+
const e = Object.entries(Ht);
|
|
309
|
+
for (const [n, o] of e)
|
|
310
|
+
if (((t == null ? void 0 : t[n]) ?? o).includes(r)) return n;
|
|
311
|
+
return null;
|
|
237
312
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
313
|
+
function lt(r, t) {
|
|
314
|
+
const { api: e, event: n, kind: o } = t, a = K(t.snap ?? "00:30"), h = Nt(r.key, t.shortcuts);
|
|
315
|
+
if (!h) return;
|
|
316
|
+
if (h === "activate") {
|
|
317
|
+
r.preventDefault(), e.trigger("eventClick", { event: n });
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
241
320
|
let u = 0;
|
|
242
|
-
switch (
|
|
243
|
-
case "
|
|
244
|
-
u = -
|
|
321
|
+
switch (h) {
|
|
322
|
+
case "moveLeft":
|
|
323
|
+
u = -_;
|
|
245
324
|
break;
|
|
246
|
-
case "
|
|
247
|
-
u =
|
|
325
|
+
case "moveRight":
|
|
326
|
+
u = _;
|
|
248
327
|
break;
|
|
249
|
-
case "
|
|
250
|
-
u = o === "timeGrid" ? -
|
|
328
|
+
case "moveUp":
|
|
329
|
+
u = o === "timeGrid" ? -a : -_ * 7;
|
|
251
330
|
break;
|
|
252
|
-
case "
|
|
253
|
-
u = o === "timeGrid" ?
|
|
331
|
+
case "moveDown":
|
|
332
|
+
u = o === "timeGrid" ? a : _ * 7;
|
|
254
333
|
break;
|
|
255
|
-
case "Enter":
|
|
256
|
-
case " ":
|
|
257
|
-
a.preventDefault(), r.trigger("eventClick", { event: e });
|
|
258
|
-
return;
|
|
259
|
-
default:
|
|
260
|
-
return;
|
|
261
334
|
}
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
const
|
|
266
|
-
|
|
335
|
+
r.preventDefault();
|
|
336
|
+
const v = J(n.start, n.end, u, s);
|
|
337
|
+
if (e.moveEvent(n.id, v.start, v.end)) {
|
|
338
|
+
const c = e.getEventById(n.id);
|
|
339
|
+
c && e.trigger("eventDrop", { event: c });
|
|
267
340
|
}
|
|
268
341
|
}
|
|
269
|
-
const
|
|
270
|
-
function
|
|
271
|
-
var
|
|
272
|
-
const
|
|
273
|
-
return ((
|
|
274
|
-
}
|
|
275
|
-
function
|
|
276
|
-
|
|
277
|
-
const { api:
|
|
278
|
-
let
|
|
279
|
-
const
|
|
280
|
-
!
|
|
281
|
-
}, c = (
|
|
282
|
-
var
|
|
283
|
-
if (document.removeEventListener("pointermove",
|
|
284
|
-
(
|
|
285
|
-
const
|
|
286
|
-
if (!
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
|
|
342
|
+
const Vt = 1440, Yt = 4;
|
|
343
|
+
function ct(r, t) {
|
|
344
|
+
var n;
|
|
345
|
+
const e = document.elementFromPoint(r, t);
|
|
346
|
+
return ((n = e == null ? void 0 : e.closest('[data-rsv="day"]')) == null ? void 0 : n.dataset.date) ?? null;
|
|
347
|
+
}
|
|
348
|
+
function Gt(r, t) {
|
|
349
|
+
r.stopPropagation();
|
|
350
|
+
const { api: e, event: n, sourceDate: o } = t, a = r.clientX, h = r.clientY;
|
|
351
|
+
let u = !1;
|
|
352
|
+
const v = (l) => {
|
|
353
|
+
!u && Math.hypot(l.clientX - a, l.clientY - h) > Yt && (u = !0, document.body.style.cursor = "grabbing");
|
|
354
|
+
}, c = (l) => {
|
|
355
|
+
var w;
|
|
356
|
+
if (document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", c), document.body.style.cursor = "", !u) return;
|
|
357
|
+
(w = t.onMoved) == null || w.call(t);
|
|
358
|
+
const f = ct(l.clientX, l.clientY);
|
|
359
|
+
if (!f) return;
|
|
360
|
+
const b = s.diff(s.from(o), s.from(f), "day");
|
|
361
|
+
if (b === 0) return;
|
|
362
|
+
const k = J(n.start, n.end, b * Vt, s);
|
|
363
|
+
if (e.moveEvent(n.id, k.start, k.end)) {
|
|
364
|
+
const p = e.getEventById(n.id);
|
|
365
|
+
p && e.trigger("eventDrop", { event: p });
|
|
293
366
|
}
|
|
294
367
|
};
|
|
295
|
-
document.addEventListener("pointermove",
|
|
368
|
+
document.addEventListener("pointermove", v), document.addEventListener("pointerup", c);
|
|
296
369
|
}
|
|
297
|
-
function
|
|
298
|
-
if (
|
|
370
|
+
function Bt(r, t) {
|
|
371
|
+
if (r.target.closest('[data-rsv="event"], [data-rsv="more-anchor"], [data-nav-link="true"]'))
|
|
299
372
|
return;
|
|
300
|
-
const { api:
|
|
301
|
-
let o = t.startDate,
|
|
302
|
-
const
|
|
303
|
-
const c =
|
|
304
|
-
c && c !== t.startDate && (
|
|
305
|
-
},
|
|
306
|
-
var
|
|
307
|
-
if (document.removeEventListener("pointermove",
|
|
308
|
-
(
|
|
309
|
-
const
|
|
310
|
-
|
|
373
|
+
const { api: n } = t;
|
|
374
|
+
let o = t.startDate, a = !1;
|
|
375
|
+
const h = (v) => {
|
|
376
|
+
const c = ct(v.clientX, v.clientY);
|
|
377
|
+
c && c !== t.startDate && (a = !0), c && (o = c);
|
|
378
|
+
}, u = () => {
|
|
379
|
+
var b;
|
|
380
|
+
if (document.removeEventListener("pointermove", h), document.removeEventListener("pointerup", u), !a) return;
|
|
381
|
+
(b = t.onRangeSelect) == null || b.call(t);
|
|
382
|
+
const v = s.from(t.startDate), c = s.from(o), [l, f] = s.isBefore(v, c) ? [v, c] : [c, v];
|
|
383
|
+
n.select(s.toISOString(l), s.toISOString(s.add(f, { days: 1 })));
|
|
311
384
|
};
|
|
312
|
-
document.addEventListener("pointermove",
|
|
385
|
+
document.addEventListener("pointermove", h), document.addEventListener("pointerup", u);
|
|
313
386
|
}
|
|
314
|
-
function
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
return /* @__PURE__ */
|
|
387
|
+
function ut({ api: r, model: t, options: e }) {
|
|
388
|
+
var v;
|
|
389
|
+
const n = e.locale ?? "en", o = { type: r.getView().type }, a = W(n, e.dayHeaderFormat, { weekday: "short" }), h = ((v = t.weeks[0]) == null ? void 0 : v.days) ?? [], u = e.weekNumbers === !0;
|
|
390
|
+
return /* @__PURE__ */ g(
|
|
318
391
|
"div",
|
|
319
392
|
{
|
|
320
393
|
"data-rsv": "daygrid",
|
|
321
394
|
"data-weeknumbers": String(u),
|
|
322
395
|
style: `--rsv-cols:${t.columnCount}`,
|
|
323
396
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
u && /* @__PURE__ */
|
|
326
|
-
|
|
327
|
-
var
|
|
328
|
-
const
|
|
329
|
-
|
|
397
|
+
/* @__PURE__ */ g("div", { "data-rsv": "daygrid-header", role: "row", children: [
|
|
398
|
+
u && /* @__PURE__ */ d("div", { "data-rsv": "daygrid-weeknum-header", role: "columnheader" }),
|
|
399
|
+
h.map((c) => {
|
|
400
|
+
var k, w;
|
|
401
|
+
const l = s.toDate(c.date), f = a ? a(l) : "", b = {
|
|
402
|
+
date: l,
|
|
403
|
+
text: f,
|
|
404
|
+
dayOfWeek: c.dayOfWeek,
|
|
405
|
+
dayNumber: s.dayOfMonth(c.date),
|
|
406
|
+
isToday: c.isToday,
|
|
407
|
+
view: o
|
|
408
|
+
};
|
|
409
|
+
return /* @__PURE__ */ d(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
"data-rsv": "daygrid-dow",
|
|
413
|
+
role: "columnheader",
|
|
414
|
+
"data-dow": String(c.dayOfWeek),
|
|
415
|
+
class: F((k = e.classNames) == null ? void 0 : k.dayHeader),
|
|
416
|
+
ref: (p) => {
|
|
417
|
+
var m;
|
|
418
|
+
return A(p, (m = e.hooks) == null ? void 0 : m.dayHeaderDidMount, () => b);
|
|
419
|
+
},
|
|
420
|
+
children: L((w = e.slots) == null ? void 0 : w.dayHeaderContent, b, f, e.hostBridge)
|
|
421
|
+
},
|
|
422
|
+
c.dayOfWeek
|
|
423
|
+
);
|
|
330
424
|
})
|
|
331
425
|
] }),
|
|
332
|
-
t.weeks.map((
|
|
333
|
-
u && /* @__PURE__ */
|
|
334
|
-
|
|
335
|
-
|
|
426
|
+
t.weeks.map((c, l) => /* @__PURE__ */ g("div", { "data-rsv": "daygrid-week", role: "row", children: [
|
|
427
|
+
u && /* @__PURE__ */ d("div", { "data-rsv": "daygrid-weeknum", role: "rowheader", children: c.weekNumber }),
|
|
428
|
+
c.days.map((f) => /* @__PURE__ */ d(
|
|
429
|
+
_t,
|
|
430
|
+
{
|
|
431
|
+
api: r,
|
|
432
|
+
cell: f,
|
|
433
|
+
options: e,
|
|
434
|
+
view: o
|
|
435
|
+
},
|
|
436
|
+
s.toISOString(f.date)
|
|
437
|
+
))
|
|
438
|
+
] }, l))
|
|
336
439
|
]
|
|
337
440
|
}
|
|
338
441
|
);
|
|
339
442
|
}
|
|
340
|
-
function
|
|
341
|
-
api:
|
|
443
|
+
function _t({
|
|
444
|
+
api: r,
|
|
342
445
|
cell: t,
|
|
343
|
-
options:
|
|
446
|
+
options: e,
|
|
447
|
+
view: n
|
|
344
448
|
}) {
|
|
345
|
-
var p;
|
|
346
|
-
const
|
|
449
|
+
var p, m, S;
|
|
450
|
+
const o = s.toDate(t.date), a = s.dayOfMonth(t.date), h = e.navLinks ? /* @__PURE__ */ d(
|
|
347
451
|
"a",
|
|
348
452
|
{
|
|
349
453
|
"data-rsv": "day-number",
|
|
350
454
|
"data-nav-link": "true",
|
|
351
455
|
role: "link",
|
|
352
456
|
tabIndex: 0,
|
|
353
|
-
|
|
354
|
-
|
|
457
|
+
title: R(e.locale).navLinkHint(
|
|
458
|
+
new Intl.DateTimeFormat(e.locale, { dateStyle: "long" }).format(o)
|
|
459
|
+
),
|
|
460
|
+
onClick: (i) => {
|
|
461
|
+
i.stopPropagation(), st(r, t.date);
|
|
355
462
|
},
|
|
356
|
-
children:
|
|
463
|
+
children: a
|
|
357
464
|
}
|
|
358
|
-
) : /* @__PURE__ */
|
|
359
|
-
(p =
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
465
|
+
) : /* @__PURE__ */ d("span", { "data-rsv": "day-number", children: a }), u = { date: o, dayNumber: a, isToday: t.isToday, isOther: t.isOther, view: n }, v = L(
|
|
466
|
+
(p = e.slots) == null ? void 0 : p.dayCellContent,
|
|
467
|
+
u,
|
|
468
|
+
h,
|
|
469
|
+
e.hostBridge
|
|
470
|
+
), [c, l] = N(!1), f = s.toISOString(t.date), b = $(!1), k = () => {
|
|
471
|
+
if (b.current) {
|
|
472
|
+
b.current = !1;
|
|
365
473
|
return;
|
|
366
474
|
}
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
|
|
475
|
+
r.trigger("dateClick", { date: t.date }), e.selectable && r.select(f, s.toISOString(s.add(t.date, { days: 1 })));
|
|
476
|
+
}, w = (i) => {
|
|
477
|
+
i.stopPropagation(), l(!0), r.trigger("moreLinkClick", {
|
|
370
478
|
date: t.date,
|
|
371
479
|
allEvents: [...t.events, ...t.hiddenEvents],
|
|
372
480
|
hiddenEvents: t.hiddenEvents
|
|
373
481
|
});
|
|
374
482
|
};
|
|
375
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ g(
|
|
376
484
|
"div",
|
|
377
485
|
{
|
|
378
486
|
"data-rsv": "day",
|
|
379
487
|
role: "gridcell",
|
|
380
|
-
"data-date":
|
|
488
|
+
"data-date": f,
|
|
381
489
|
"data-today": String(t.isToday),
|
|
382
490
|
"data-other": String(t.isOther),
|
|
383
491
|
"data-weekend": String(t.isWeekend),
|
|
384
492
|
"data-business": String(t.isBusiness),
|
|
385
493
|
"data-selected": String(t.isSelected),
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
494
|
+
class: F((m = e.classNames) == null ? void 0 : m.day),
|
|
495
|
+
ref: (i) => {
|
|
496
|
+
var D;
|
|
497
|
+
return A(i, (D = e.hooks) == null ? void 0 : D.dayCellDidMount, () => u);
|
|
498
|
+
},
|
|
499
|
+
onClick: k,
|
|
500
|
+
onPointerDown: e.selectable ? (i) => Bt(i, {
|
|
501
|
+
api: r,
|
|
502
|
+
startDate: f,
|
|
390
503
|
onRangeSelect: () => {
|
|
391
|
-
|
|
504
|
+
b.current = !0;
|
|
392
505
|
}
|
|
393
506
|
}) : void 0,
|
|
394
507
|
children: [
|
|
395
|
-
|
|
396
|
-
t.events.filter((
|
|
397
|
-
|
|
508
|
+
v,
|
|
509
|
+
t.events.filter((i) => i.display !== "none").map((i) => /* @__PURE__ */ d(
|
|
510
|
+
vt,
|
|
398
511
|
{
|
|
399
|
-
api:
|
|
400
|
-
event:
|
|
401
|
-
options:
|
|
402
|
-
|
|
512
|
+
api: r,
|
|
513
|
+
event: i,
|
|
514
|
+
options: e,
|
|
515
|
+
view: n,
|
|
516
|
+
sourceDate: f
|
|
403
517
|
},
|
|
404
|
-
|
|
518
|
+
i.id
|
|
405
519
|
)),
|
|
406
|
-
t.moreCount > 0 && /* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
|
|
409
|
-
xt,
|
|
520
|
+
t.moreCount > 0 && /* @__PURE__ */ g("div", { "data-rsv": "more-anchor", children: [
|
|
521
|
+
/* @__PURE__ */ d("button", { type: "button", "data-rsv": "more-link", onClick: w, children: L(
|
|
522
|
+
(S = e.slots) == null ? void 0 : S.moreLinkContent,
|
|
410
523
|
{
|
|
411
|
-
|
|
524
|
+
date: o,
|
|
525
|
+
moreCount: t.moreCount,
|
|
526
|
+
allEvents: [...t.events, ...t.hiddenEvents],
|
|
527
|
+
hiddenEvents: t.hiddenEvents,
|
|
528
|
+
view: n
|
|
529
|
+
},
|
|
530
|
+
R(e.locale).more(t.moreCount),
|
|
531
|
+
e.hostBridge
|
|
532
|
+
) }),
|
|
533
|
+
c && /* @__PURE__ */ d(
|
|
534
|
+
jt,
|
|
535
|
+
{
|
|
536
|
+
api: r,
|
|
412
537
|
cell: t,
|
|
413
|
-
options:
|
|
414
|
-
|
|
538
|
+
options: e,
|
|
539
|
+
view: n,
|
|
540
|
+
onClose: () => l(!1)
|
|
415
541
|
}
|
|
416
542
|
)
|
|
417
543
|
] })
|
|
@@ -419,287 +545,463 @@ function St({
|
|
|
419
545
|
}
|
|
420
546
|
);
|
|
421
547
|
}
|
|
422
|
-
function
|
|
423
|
-
api:
|
|
548
|
+
function jt({
|
|
549
|
+
api: r,
|
|
424
550
|
cell: t,
|
|
425
|
-
options:
|
|
426
|
-
|
|
551
|
+
options: e,
|
|
552
|
+
view: n,
|
|
553
|
+
onClose: o
|
|
427
554
|
}) {
|
|
428
|
-
const
|
|
555
|
+
const a = $(null), h = new Intl.DateTimeFormat(e.locale ?? "en", {
|
|
429
556
|
weekday: "long",
|
|
430
557
|
day: "numeric",
|
|
431
558
|
month: "long"
|
|
432
|
-
}), u = [...t.events, ...t.hiddenEvents].filter((
|
|
433
|
-
return
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
},
|
|
437
|
-
|
|
559
|
+
}), u = [...t.events, ...t.hiddenEvents].filter((v) => v.display !== "none");
|
|
560
|
+
return H(() => {
|
|
561
|
+
const v = (l) => {
|
|
562
|
+
a.current && !a.current.contains(l.target) && o();
|
|
563
|
+
}, c = (l) => {
|
|
564
|
+
l.key === "Escape" && o();
|
|
438
565
|
};
|
|
439
|
-
return document.addEventListener("mousedown",
|
|
440
|
-
document.removeEventListener("mousedown",
|
|
566
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", c), () => {
|
|
567
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", c);
|
|
441
568
|
};
|
|
442
|
-
}, [
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
569
|
+
}, [o]), /* @__PURE__ */ g("div", { "data-rsv": "more-popover", role: "dialog", ref: a, onClick: (v) => v.stopPropagation(), children: [
|
|
570
|
+
/* @__PURE__ */ g("div", { "data-rsv": "more-popover-header", children: [
|
|
571
|
+
/* @__PURE__ */ d("span", { "data-rsv": "more-popover-title", children: h.format(s.toDate(t.date)) }),
|
|
572
|
+
/* @__PURE__ */ d("button", { type: "button", "data-rsv": "more-popover-close", "aria-label": "✕", onClick: o, children: "✕" })
|
|
446
573
|
] }),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
|
|
574
|
+
/* @__PURE__ */ d("div", { "data-rsv": "more-popover-body", children: u.map((v) => /* @__PURE__ */ d(
|
|
575
|
+
vt,
|
|
449
576
|
{
|
|
450
|
-
api:
|
|
451
|
-
event:
|
|
452
|
-
options:
|
|
453
|
-
|
|
577
|
+
api: r,
|
|
578
|
+
event: v,
|
|
579
|
+
options: e,
|
|
580
|
+
view: n,
|
|
581
|
+
sourceDate: s.toISOString(t.date)
|
|
454
582
|
},
|
|
455
|
-
|
|
583
|
+
v.id
|
|
456
584
|
)) })
|
|
457
585
|
] });
|
|
458
586
|
}
|
|
459
|
-
function
|
|
460
|
-
api:
|
|
587
|
+
function vt({
|
|
588
|
+
api: r,
|
|
461
589
|
event: t,
|
|
462
|
-
options:
|
|
463
|
-
|
|
590
|
+
options: e,
|
|
591
|
+
view: n,
|
|
592
|
+
sourceDate: o
|
|
464
593
|
}) {
|
|
465
|
-
var
|
|
466
|
-
const
|
|
467
|
-
(
|
|
468
|
-
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
|
|
594
|
+
var b, k;
|
|
595
|
+
const a = e.editable === !0 && t.editable !== !1, h = r.selectedEventIds.value.has(t.id), u = $(!1), v = X(e.locale ?? "en", e.eventTimeFormat), c = t.allDay ? "" : v ? v(s.toDate(t.start)) : s.format(t.start, "HH:mm"), l = { event: t, isAllDay: t.allDay, timeText: c, view: n }, f = L(
|
|
596
|
+
(b = e.slots) == null ? void 0 : b.eventContent,
|
|
597
|
+
l,
|
|
598
|
+
/* @__PURE__ */ g("span", { "data-rsv": "event-title", children: [
|
|
599
|
+
c ? `${c} ` : "",
|
|
471
600
|
t.title
|
|
472
|
-
] })
|
|
601
|
+
] }),
|
|
602
|
+
e.hostBridge
|
|
473
603
|
);
|
|
474
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ d(
|
|
475
605
|
"div",
|
|
476
606
|
{
|
|
477
607
|
"data-rsv": "event",
|
|
478
608
|
role: "button",
|
|
479
609
|
tabIndex: 0,
|
|
480
|
-
class:
|
|
610
|
+
class: F((k = e.classNames) == null ? void 0 : k.event, ...t.classNames),
|
|
481
611
|
"data-all-day": String(t.allDay),
|
|
482
612
|
"data-display": t.display,
|
|
483
613
|
"data-event-id": t.id,
|
|
484
|
-
"data-editable": String(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
614
|
+
"data-editable": String(a),
|
|
615
|
+
"data-rsv-selected": String(h),
|
|
616
|
+
ref: (w) => {
|
|
617
|
+
var p;
|
|
618
|
+
return A(w, (p = e.hooks) == null ? void 0 : p.eventDidMount, () => l);
|
|
619
|
+
},
|
|
620
|
+
style: `--rsv-event-bg:${t.backgroundColor};--rsv-event-fg:${t.textColor};--rsv-event-border:${t.borderColor}`,
|
|
621
|
+
onClick: (w) => {
|
|
622
|
+
if (w.stopPropagation(), u.current) {
|
|
623
|
+
u.current = !1;
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
if (w.ctrlKey || w.metaKey) {
|
|
627
|
+
r.toggleEventSelection(t.id);
|
|
489
628
|
return;
|
|
490
629
|
}
|
|
491
|
-
|
|
630
|
+
r.trigger("eventClick", { event: t, el: w.currentTarget }), t.url && window.open(t.url, "_self");
|
|
492
631
|
},
|
|
493
|
-
onPointerDown:
|
|
494
|
-
api:
|
|
632
|
+
onPointerDown: a ? (w) => Gt(w, {
|
|
633
|
+
api: r,
|
|
495
634
|
event: t,
|
|
496
|
-
sourceDate:
|
|
635
|
+
sourceDate: o,
|
|
497
636
|
onMoved: () => {
|
|
498
|
-
|
|
637
|
+
u.current = !0;
|
|
499
638
|
}
|
|
500
639
|
}) : void 0,
|
|
501
|
-
onKeyDown:
|
|
502
|
-
|
|
640
|
+
onKeyDown: a ? (w) => lt(w, {
|
|
641
|
+
api: r,
|
|
642
|
+
event: t,
|
|
643
|
+
kind: "dayGrid",
|
|
644
|
+
shortcuts: e.keyboardShortcuts
|
|
645
|
+
}) : void 0,
|
|
646
|
+
children: f
|
|
503
647
|
}
|
|
504
648
|
);
|
|
505
649
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
650
|
+
const j = 40, it = 16, Kt = {
|
|
651
|
+
update() {
|
|
652
|
+
},
|
|
653
|
+
getScrolled: () => 0,
|
|
654
|
+
stop() {
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
function mt(r) {
|
|
658
|
+
if (!r) return Kt;
|
|
659
|
+
let t = 0, e = 0, n = 0;
|
|
660
|
+
const o = () => {
|
|
661
|
+
const a = r.getBoundingClientRect();
|
|
662
|
+
let h = 0;
|
|
663
|
+
if (t < a.top + j ? h = -it * (1 - Math.max(0, t - a.top) / j) : t > a.bottom - j && (h = it * (1 - Math.max(0, a.bottom - t) / j)), h !== 0) {
|
|
664
|
+
const u = r.scrollTop;
|
|
665
|
+
r.scrollTop += h, e += r.scrollTop - u;
|
|
666
|
+
}
|
|
667
|
+
n = requestAnimationFrame(o);
|
|
668
|
+
};
|
|
669
|
+
return n = requestAnimationFrame(o), {
|
|
670
|
+
update(a) {
|
|
671
|
+
t = a;
|
|
672
|
+
},
|
|
673
|
+
getScrolled: () => e,
|
|
674
|
+
stop() {
|
|
675
|
+
cancelAnimationFrame(n);
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function ht(r) {
|
|
680
|
+
return r.closest('[data-rsv="tg-body"]');
|
|
681
|
+
}
|
|
682
|
+
function q(r, t) {
|
|
683
|
+
r.preventDefault(), r.stopPropagation();
|
|
684
|
+
const { api: e, event: n, model: o, columnEl: a, snap: h = "00:15", edge: u } = t, v = a.getBoundingClientRect(), c = o.maxMinutes - o.minMinutes, l = v.height === 0 ? 0 : v.height / c, f = r.clientY, b = mt(ht(a));
|
|
685
|
+
b.update(r.clientY);
|
|
686
|
+
const k = (p) => {
|
|
687
|
+
b.update(p.clientY);
|
|
688
|
+
}, w = (p) => {
|
|
689
|
+
document.removeEventListener("pointermove", k), document.removeEventListener("pointerup", w), b.stop();
|
|
690
|
+
const m = wt(p.clientY - f + b.getScrolled(), l, h);
|
|
691
|
+
if (m === 0) return;
|
|
692
|
+
const S = u ? kt(n.start, n.end, u, m, s) : J(n.start, n.end, m, s);
|
|
693
|
+
if (e.moveEvent(n.id, S.start, S.end)) {
|
|
694
|
+
const i = e.getEventById(n.id);
|
|
695
|
+
i && e.trigger(u ? "eventResize" : "eventDrop", { event: i });
|
|
516
696
|
}
|
|
517
697
|
};
|
|
518
|
-
document.addEventListener("pointerup",
|
|
519
|
-
}
|
|
520
|
-
function
|
|
521
|
-
if (
|
|
522
|
-
const { api:
|
|
523
|
-
const S = o.minMinutes + (
|
|
524
|
-
return Math.round(
|
|
525
|
-
},
|
|
526
|
-
let
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
698
|
+
document.addEventListener("pointermove", k), document.addEventListener("pointerup", w);
|
|
699
|
+
}
|
|
700
|
+
function Ut(r, t) {
|
|
701
|
+
if (r.target.closest('[data-rsv="event"]')) return;
|
|
702
|
+
const { api: e, date: n, model: o, columnEl: a, snap: h = "00:15" } = t, u = o.maxMinutes - o.minMinutes, v = K(h) || 15, c = (m) => {
|
|
703
|
+
const S = a.getBoundingClientRect(), i = S.height === 0 ? 0 : S.height / u, D = o.minMinutes + (i === 0 ? 0 : (m - S.top) / i), C = Math.max(o.minMinutes, Math.min(o.maxMinutes, D));
|
|
704
|
+
return Math.round(C / v) * v;
|
|
705
|
+
}, l = c(r.clientY);
|
|
706
|
+
let f = l, b = !1;
|
|
707
|
+
const k = mt(ht(a));
|
|
708
|
+
k.update(r.clientY);
|
|
709
|
+
const w = (m) => {
|
|
710
|
+
var i;
|
|
711
|
+
k.update(m.clientY);
|
|
712
|
+
const S = c(m.clientY);
|
|
713
|
+
S !== l && (b = !0), f = S, b && ((i = t.onPreview) == null || i.call(t, {
|
|
714
|
+
startMin: Math.min(l, f),
|
|
715
|
+
endMin: Math.max(l, f)
|
|
716
|
+
}));
|
|
717
|
+
}, p = () => {
|
|
718
|
+
var D;
|
|
719
|
+
if (document.removeEventListener("pointermove", w), document.removeEventListener("pointerup", p), k.stop(), (D = t.onPreview) == null || D.call(t, null), !b) return;
|
|
720
|
+
const m = Math.min(l, f), S = Math.max(l, f), i = s.startOf(n, "day");
|
|
721
|
+
e.select(
|
|
722
|
+
s.toISOString(s.add(i, { minutes: m })),
|
|
723
|
+
s.toISOString(s.add(i, { minutes: S }))
|
|
536
724
|
);
|
|
537
725
|
};
|
|
538
|
-
document.addEventListener("pointermove", w), document.addEventListener("pointerup",
|
|
539
|
-
}
|
|
540
|
-
function
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
726
|
+
document.addEventListener("pointermove", w), document.addEventListener("pointerup", p);
|
|
727
|
+
}
|
|
728
|
+
function Wt({ api: r, model: t, options: e }) {
|
|
729
|
+
const n = e.locale ?? "en", o = { type: r.getView().type }, a = W(n, e.dayHeaderFormat, {
|
|
730
|
+
weekday: "short",
|
|
731
|
+
day: "numeric"
|
|
732
|
+
}), h = X(n, e.slotLabelFormat), u = e.allDaySlot !== !1, v = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`, c = t.maxMinutes - t.minMinutes, l = K(e.snapDuration ?? e.slotDuration ?? "00:15") || 15, f = $(null), b = $(t);
|
|
733
|
+
b.current = t;
|
|
734
|
+
const [k, w] = N(null);
|
|
735
|
+
H(() => {
|
|
736
|
+
const i = f.current;
|
|
737
|
+
if (!i) return;
|
|
738
|
+
const D = {
|
|
739
|
+
scrollToTime(C) {
|
|
740
|
+
const M = b.current, E = M.maxMinutes - M.minMinutes, x = i.scrollHeight;
|
|
741
|
+
if (E <= 0 || x <= 0) return;
|
|
742
|
+
const P = (Math.max(M.minMinutes, Math.min(M.maxMinutes, K(C))) - M.minMinutes) / E * x;
|
|
743
|
+
i.scrollTop = Math.max(0, Math.min(P, x - i.clientHeight));
|
|
744
|
+
},
|
|
745
|
+
getScrollTime() {
|
|
746
|
+
const C = b.current, M = C.maxMinutes - C.minMinutes, E = i.scrollHeight;
|
|
747
|
+
return M <= 0 || E <= 0 ? null : At(C.minMinutes + i.scrollTop / E * M);
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
return r.setViewAdapter(D), () => r.setViewAdapter(null);
|
|
751
|
+
}, [r]);
|
|
752
|
+
const p = e.scrollTime;
|
|
753
|
+
H(() => {
|
|
754
|
+
if (!p) return;
|
|
755
|
+
let i = 0;
|
|
756
|
+
const D = requestAnimationFrame(() => {
|
|
757
|
+
i = requestAnimationFrame(() => r.scrollToTime(p));
|
|
758
|
+
});
|
|
759
|
+
return () => {
|
|
760
|
+
cancelAnimationFrame(D), cancelAnimationFrame(i);
|
|
761
|
+
};
|
|
762
|
+
}, [r]);
|
|
763
|
+
const m = (i, D) => {
|
|
764
|
+
const C = i.getBoundingClientRect();
|
|
765
|
+
if (C.height === 0 || c <= 0) return t.minMinutes;
|
|
766
|
+
const M = (D - C.top) / C.height * c, E = Math.floor(Math.max(0, Math.min(c, M)) / l) * l;
|
|
767
|
+
return t.minMinutes + E;
|
|
768
|
+
}, S = t.days[0];
|
|
769
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.days.length}`, children: [
|
|
770
|
+
/* @__PURE__ */ g("div", { "data-rsv": "tg-header", role: "row", children: [
|
|
771
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis-corner" }),
|
|
772
|
+
t.days.map((i) => {
|
|
773
|
+
var E, x;
|
|
774
|
+
const D = s.toDate(i.date), C = a ? a(D) : "", M = {
|
|
775
|
+
date: D,
|
|
776
|
+
text: C,
|
|
777
|
+
dayOfWeek: s.dayOfWeek(i.date),
|
|
778
|
+
dayNumber: s.dayOfMonth(i.date),
|
|
779
|
+
isToday: i.isToday,
|
|
780
|
+
view: o
|
|
781
|
+
};
|
|
782
|
+
return /* @__PURE__ */ d(
|
|
783
|
+
"div",
|
|
784
|
+
{
|
|
785
|
+
"data-rsv": "tg-col-header",
|
|
786
|
+
role: "columnheader",
|
|
787
|
+
"data-today": String(i.isToday),
|
|
788
|
+
"data-date": s.toISOString(i.date),
|
|
789
|
+
"data-nav-link": e.navLinks ? "true" : void 0,
|
|
790
|
+
class: F((E = e.classNames) == null ? void 0 : E.dayHeader),
|
|
791
|
+
ref: (I) => {
|
|
792
|
+
var P;
|
|
793
|
+
return A(I, (P = e.hooks) == null ? void 0 : P.dayHeaderDidMount, () => M);
|
|
794
|
+
},
|
|
795
|
+
onClick: e.navLinks ? () => st(r, i.date) : void 0,
|
|
796
|
+
children: L((x = e.slots) == null ? void 0 : x.dayHeaderContent, M, C, e.hostBridge)
|
|
797
|
+
},
|
|
798
|
+
s.toISOString(i.date)
|
|
799
|
+
);
|
|
800
|
+
})
|
|
557
801
|
] }),
|
|
558
|
-
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
t.days.map((
|
|
802
|
+
u && /* @__PURE__ */ g("div", { "data-rsv": "tg-allday", role: "row", children: [
|
|
803
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis-label", children: R(e.locale).allDay }),
|
|
804
|
+
t.days.map((i) => /* @__PURE__ */ d(
|
|
561
805
|
"div",
|
|
562
806
|
{
|
|
563
|
-
"data-rsv": "
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
807
|
+
"data-rsv": "tg-allday-cell",
|
|
808
|
+
onClick: () => r.trigger("dateClick", { date: i.date, allDay: !0 }),
|
|
809
|
+
children: i.allDayEvents.filter((D) => D.display !== "none").map((D) => {
|
|
810
|
+
var C, M;
|
|
811
|
+
return /* @__PURE__ */ d(
|
|
812
|
+
"div",
|
|
813
|
+
{
|
|
814
|
+
"data-rsv": "event",
|
|
815
|
+
"data-all-day": "true",
|
|
816
|
+
"data-event-id": D.id,
|
|
817
|
+
class: F((C = e.classNames) == null ? void 0 : C.event, ...D.classNames),
|
|
818
|
+
"data-display": D.display,
|
|
819
|
+
style: `--rsv-event-bg:${D.backgroundColor};--rsv-event-fg:${D.textColor};--rsv-event-border:${D.borderColor}`,
|
|
820
|
+
onClick: (E) => {
|
|
821
|
+
E.stopPropagation(), r.trigger("eventClick", { event: D, el: E.currentTarget }), D.url && window.open(D.url, "_self");
|
|
822
|
+
},
|
|
823
|
+
children: L(
|
|
824
|
+
(M = e.slots) == null ? void 0 : M.eventContent,
|
|
825
|
+
{ event: D, isAllDay: !0, timeText: "", view: o },
|
|
826
|
+
D.title,
|
|
827
|
+
e.hostBridge
|
|
828
|
+
)
|
|
829
|
+
},
|
|
830
|
+
D.id
|
|
831
|
+
);
|
|
832
|
+
})
|
|
572
833
|
},
|
|
573
|
-
s.
|
|
574
|
-
))
|
|
834
|
+
s.toISOString(i.date)
|
|
835
|
+
))
|
|
575
836
|
] }),
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
837
|
+
/* @__PURE__ */ g("div", { "data-rsv": "tg-body", ref: f, children: [
|
|
838
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis", style: `height:${v}`, children: t.slots.map((i) => {
|
|
839
|
+
var E, x;
|
|
840
|
+
const D = t.minMinutes + i.offsetMin;
|
|
841
|
+
let C = "";
|
|
842
|
+
i.isMajor && (C = h && S ? h(s.toDate(s.add(s.startOf(S.date, "day"), { minutes: D }))) : i.label || It(D));
|
|
843
|
+
const M = { text: C, minutes: D, isMajor: i.isMajor, view: o };
|
|
844
|
+
return /* @__PURE__ */ d("div", { "data-rsv": "tg-slot", "data-major": String(i.isMajor), children: /* @__PURE__ */ d(
|
|
845
|
+
"span",
|
|
846
|
+
{
|
|
847
|
+
"data-rsv": "tg-slot-label",
|
|
848
|
+
class: F((E = e.classNames) == null ? void 0 : E.slotLabel),
|
|
849
|
+
ref: (I) => {
|
|
850
|
+
var P;
|
|
851
|
+
return A(I, (P = e.hooks) == null ? void 0 : P.slotLabelDidMount, () => M);
|
|
852
|
+
},
|
|
853
|
+
children: L((x = e.slots) == null ? void 0 : x.slotLabelContent, M, C, e.hostBridge)
|
|
854
|
+
}
|
|
855
|
+
) }, i.offsetMin);
|
|
584
856
|
}) }),
|
|
585
|
-
t.days.map((
|
|
586
|
-
var
|
|
587
|
-
return /* @__PURE__ */
|
|
857
|
+
t.days.map((i, D) => {
|
|
858
|
+
var C;
|
|
859
|
+
return /* @__PURE__ */ g(
|
|
588
860
|
"div",
|
|
589
861
|
{
|
|
590
862
|
"data-rsv": "tg-col",
|
|
591
|
-
"data-today": String(
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
863
|
+
"data-today": String(i.isToday),
|
|
864
|
+
"data-date": s.toISOString(i.date),
|
|
865
|
+
style: `height:${v}`,
|
|
866
|
+
onClick: (M) => {
|
|
867
|
+
const E = m(M.currentTarget, M.clientY);
|
|
868
|
+
r.trigger("dateClick", {
|
|
869
|
+
date: s.add(s.startOf(i.date, "day"), { minutes: E }),
|
|
870
|
+
allDay: !1
|
|
871
|
+
});
|
|
872
|
+
},
|
|
873
|
+
onPointerDown: e.selectable ? (M) => Ut(M, {
|
|
874
|
+
api: r,
|
|
875
|
+
date: i.date,
|
|
597
876
|
model: t,
|
|
598
|
-
columnEl:
|
|
599
|
-
snap:
|
|
877
|
+
columnEl: M.currentTarget,
|
|
878
|
+
snap: e.snapDuration ?? e.slotDuration,
|
|
879
|
+
onPreview: e.selectMirror ? (E) => w(
|
|
880
|
+
E ? { dayIndex: D, startMin: E.startMin, endMin: E.endMin } : null
|
|
881
|
+
) : void 0
|
|
600
882
|
}) : void 0,
|
|
601
883
|
children: [
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
884
|
+
e.businessHours && !i.businessPct && /* @__PURE__ */ d("div", { "data-rsv": "tg-nonbusiness", style: "top:0;height:100%" }),
|
|
885
|
+
i.businessPct && /* @__PURE__ */ g(Ct, { children: [
|
|
886
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-nonbusiness", style: `top:0;height:${i.businessPct.topPct}%` }),
|
|
887
|
+
/* @__PURE__ */ d(
|
|
606
888
|
"div",
|
|
607
889
|
{
|
|
608
890
|
"data-rsv": "tg-nonbusiness",
|
|
609
|
-
style: `top:${
|
|
891
|
+
style: `top:${i.businessPct.bottomPct}%;height:${100 - i.businessPct.bottomPct}%`
|
|
610
892
|
}
|
|
611
893
|
)
|
|
612
894
|
] }),
|
|
613
|
-
|
|
614
|
-
|
|
895
|
+
(k == null ? void 0 : k.dayIndex) === D && c > 0 && /* @__PURE__ */ d(
|
|
896
|
+
"div",
|
|
897
|
+
{
|
|
898
|
+
"data-rsv": "select-mirror",
|
|
899
|
+
style: `top:${(k.startMin - t.minMinutes) / c * 100}%;height:${(k.endMin - k.startMin) / c * 100}%`
|
|
900
|
+
}
|
|
901
|
+
),
|
|
902
|
+
i.timedSegs.filter((M) => M.event.display !== "none").map((M) => /* @__PURE__ */ d(
|
|
903
|
+
Xt,
|
|
615
904
|
{
|
|
616
|
-
api:
|
|
617
|
-
seg:
|
|
905
|
+
api: r,
|
|
906
|
+
seg: M,
|
|
618
907
|
model: t,
|
|
619
|
-
options:
|
|
908
|
+
options: e,
|
|
909
|
+
view: o
|
|
620
910
|
},
|
|
621
|
-
|
|
911
|
+
M.event.id
|
|
622
912
|
)),
|
|
623
|
-
((
|
|
913
|
+
((C = t.nowIndicator) == null ? void 0 : C.dayIndex) === D && /* @__PURE__ */ d("div", { "data-rsv": "now-indicator", style: `top:${t.nowIndicator.topPct}%` })
|
|
624
914
|
]
|
|
625
915
|
},
|
|
626
|
-
|
|
916
|
+
s.toISOString(i.date)
|
|
627
917
|
);
|
|
628
918
|
})
|
|
629
919
|
] })
|
|
630
920
|
] });
|
|
631
921
|
}
|
|
632
|
-
function
|
|
633
|
-
api:
|
|
922
|
+
function Xt({
|
|
923
|
+
api: r,
|
|
634
924
|
seg: t,
|
|
635
|
-
model:
|
|
636
|
-
options:
|
|
925
|
+
model: e,
|
|
926
|
+
options: n,
|
|
927
|
+
view: o
|
|
637
928
|
}) {
|
|
638
|
-
var
|
|
639
|
-
const { event:
|
|
640
|
-
(
|
|
641
|
-
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
|
|
929
|
+
var w, p;
|
|
930
|
+
const { event: a } = t, h = n.editable === !0 && a.editable !== !1, u = r.selectedEventIds.value.has(a.id), v = 100 / t.colCount, c = X(n.locale ?? "en", n.eventTimeFormat), l = c ? c(s.toDate(a.start)) : s.format(a.start, "HH:mm"), f = { event: a, isAllDay: !1, timeText: l, view: o }, b = L(
|
|
931
|
+
(w = n.slots) == null ? void 0 : w.eventContent,
|
|
932
|
+
f,
|
|
933
|
+
/* @__PURE__ */ g("span", { "data-rsv": "event-title", children: [
|
|
934
|
+
l,
|
|
644
935
|
" ",
|
|
645
|
-
|
|
646
|
-
] })
|
|
647
|
-
|
|
648
|
-
|
|
936
|
+
a.title
|
|
937
|
+
] }),
|
|
938
|
+
n.hostBridge
|
|
939
|
+
), k = (m) => m.closest('[data-rsv="tg-col"]') ?? m;
|
|
940
|
+
return /* @__PURE__ */ g(
|
|
649
941
|
"div",
|
|
650
942
|
{
|
|
651
943
|
"data-rsv": "event",
|
|
652
944
|
"data-all-day": "false",
|
|
653
|
-
"data-display":
|
|
654
|
-
"data-event-id":
|
|
655
|
-
|
|
945
|
+
"data-display": a.display,
|
|
946
|
+
"data-event-id": a.id,
|
|
947
|
+
"data-rsv-selected": String(u),
|
|
948
|
+
class: F((p = n.classNames) == null ? void 0 : p.event, ...a.classNames),
|
|
656
949
|
role: "button",
|
|
657
950
|
tabIndex: 0,
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
951
|
+
ref: (m) => {
|
|
952
|
+
var S;
|
|
953
|
+
return A(m, (S = n.hooks) == null ? void 0 : S.eventDidMount, () => f);
|
|
661
954
|
},
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
955
|
+
style: `position:absolute;top:${t.topPct}%;height:${t.heightPct}%;left:${t.col * v}%;width:${v}%;--rsv-event-bg:${a.backgroundColor};--rsv-event-fg:${a.textColor};--rsv-event-border:${a.borderColor}`,
|
|
956
|
+
onClick: (m) => {
|
|
957
|
+
if (m.stopPropagation(), m.ctrlKey || m.metaKey) {
|
|
958
|
+
r.toggleEventSelection(a.id);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
r.trigger("eventClick", { event: a, el: m.currentTarget }), a.url && window.open(a.url, "_self");
|
|
962
|
+
},
|
|
963
|
+
onKeyDown: h ? (m) => lt(m, {
|
|
964
|
+
api: r,
|
|
965
|
+
event: a,
|
|
665
966
|
kind: "timeGrid",
|
|
666
|
-
snap:
|
|
967
|
+
snap: n.snapDuration ?? n.slotDuration,
|
|
968
|
+
shortcuts: n.keyboardShortcuts
|
|
667
969
|
}) : void 0,
|
|
668
|
-
onPointerDown:
|
|
669
|
-
api:
|
|
670
|
-
event:
|
|
671
|
-
model:
|
|
672
|
-
columnEl:
|
|
673
|
-
snap:
|
|
970
|
+
onPointerDown: h ? (m) => q(m, {
|
|
971
|
+
api: r,
|
|
972
|
+
event: a,
|
|
973
|
+
model: e,
|
|
974
|
+
columnEl: k(m.currentTarget),
|
|
975
|
+
snap: n.snapDuration
|
|
674
976
|
}) : void 0,
|
|
675
977
|
children: [
|
|
676
|
-
|
|
978
|
+
h && /* @__PURE__ */ d(
|
|
677
979
|
"span",
|
|
678
980
|
{
|
|
679
981
|
"data-rsv": "resize-handle",
|
|
680
982
|
"data-edge": "start",
|
|
681
|
-
onPointerDown: (
|
|
682
|
-
api:
|
|
683
|
-
event:
|
|
684
|
-
model:
|
|
685
|
-
columnEl:
|
|
686
|
-
snap:
|
|
983
|
+
onPointerDown: (m) => q(m, {
|
|
984
|
+
api: r,
|
|
985
|
+
event: a,
|
|
986
|
+
model: e,
|
|
987
|
+
columnEl: k(m.currentTarget),
|
|
988
|
+
snap: n.snapDuration,
|
|
687
989
|
edge: "start"
|
|
688
990
|
})
|
|
689
991
|
}
|
|
690
992
|
),
|
|
691
|
-
|
|
692
|
-
|
|
993
|
+
b,
|
|
994
|
+
h && /* @__PURE__ */ d(
|
|
693
995
|
"span",
|
|
694
996
|
{
|
|
695
997
|
"data-rsv": "resize-handle",
|
|
696
998
|
"data-edge": "end",
|
|
697
|
-
onPointerDown: (
|
|
698
|
-
api:
|
|
699
|
-
event:
|
|
700
|
-
model:
|
|
701
|
-
columnEl:
|
|
702
|
-
snap:
|
|
999
|
+
onPointerDown: (m) => q(m, {
|
|
1000
|
+
api: r,
|
|
1001
|
+
event: a,
|
|
1002
|
+
model: e,
|
|
1003
|
+
columnEl: k(m.currentTarget),
|
|
1004
|
+
snap: n.snapDuration,
|
|
703
1005
|
edge: "end"
|
|
704
1006
|
})
|
|
705
1007
|
}
|
|
@@ -708,176 +1010,187 @@ function $t({
|
|
|
708
1010
|
}
|
|
709
1011
|
);
|
|
710
1012
|
}
|
|
711
|
-
function
|
|
712
|
-
const
|
|
1013
|
+
function qt({ api: r, model: t, options: e }) {
|
|
1014
|
+
const n = e.locale ?? "en", o = { type: r.getView().type }, a = R(e.locale), h = W(n, e.listDayFormat, {
|
|
713
1015
|
weekday: "long",
|
|
714
1016
|
day: "numeric",
|
|
715
1017
|
month: "long"
|
|
716
|
-
});
|
|
717
|
-
return t.isEmpty ? /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
1018
|
+
}), u = e.listDaySideFormat ? W(n, e.listDaySideFormat, { month: "short", day: "2-digit" }) : null, v = X(n, e.eventTimeFormat);
|
|
1019
|
+
return t.isEmpty ? /* @__PURE__ */ d("div", { "data-rsv": "list", children: /* @__PURE__ */ d("div", { "data-rsv": "list-empty", children: a.noEvents }) }) : /* @__PURE__ */ d("div", { "data-rsv": "list", role: "list", children: t.days.map((c) => /* @__PURE__ */ g("div", { "data-rsv": "list-day", "data-today": String(c.isToday), children: [
|
|
1020
|
+
/* @__PURE__ */ g("div", { "data-rsv": "list-day-header", role: "heading", "aria-level": 3, children: [
|
|
1021
|
+
/* @__PURE__ */ d("span", { "data-rsv": "list-day-text", children: h ? h(s.toDate(c.date)) : "" }),
|
|
1022
|
+
u && /* @__PURE__ */ d("span", { "data-rsv": "list-day-side-text", children: u(s.toDate(c.date)) })
|
|
1023
|
+
] }),
|
|
1024
|
+
c.events.filter((l) => l.display !== "none").map((l) => {
|
|
1025
|
+
var k, w;
|
|
1026
|
+
const f = l.allDay ? a.allDay : v ? v(s.toDate(l.start)) : s.format(l.start, "HH:mm"), b = { event: l, isAllDay: l.allDay, timeText: f, view: o };
|
|
1027
|
+
return /* @__PURE__ */ g(
|
|
723
1028
|
"div",
|
|
724
1029
|
{
|
|
725
1030
|
"data-rsv": "list-item",
|
|
726
1031
|
role: "listitem",
|
|
727
1032
|
tabIndex: 0,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1033
|
+
"data-event-id": l.id,
|
|
1034
|
+
class: F((k = e.classNames) == null ? void 0 : k.event, ...l.classNames),
|
|
1035
|
+
"data-display": l.display,
|
|
1036
|
+
ref: (p) => {
|
|
1037
|
+
var m;
|
|
1038
|
+
return A(p, (m = e.hooks) == null ? void 0 : m.eventDidMount, () => b);
|
|
1039
|
+
},
|
|
1040
|
+
style: `--rsv-event-bg:${l.backgroundColor};--rsv-event-fg:${l.textColor};--rsv-event-border:${l.borderColor}`,
|
|
1041
|
+
onClick: (p) => {
|
|
1042
|
+
r.trigger("eventClick", { event: l, el: p.currentTarget }), l.url && window.open(l.url, "_self");
|
|
732
1043
|
},
|
|
733
1044
|
children: [
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ d("span", { "data-rsv": "list-item-time", children: f }),
|
|
1046
|
+
/* @__PURE__ */ d(
|
|
736
1047
|
"span",
|
|
737
1048
|
{
|
|
738
1049
|
"data-rsv": "list-item-dot",
|
|
739
|
-
style: `--rsv-event-bg:${
|
|
1050
|
+
style: `--rsv-event-bg:${l.backgroundColor}`
|
|
740
1051
|
}
|
|
741
1052
|
),
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
(
|
|
744
|
-
|
|
745
|
-
|
|
1053
|
+
/* @__PURE__ */ d("div", { "data-rsv": "list-item-title", children: L(
|
|
1054
|
+
(w = e.slots) == null ? void 0 : w.eventContent,
|
|
1055
|
+
b,
|
|
1056
|
+
l.title,
|
|
1057
|
+
e.hostBridge
|
|
746
1058
|
) })
|
|
747
1059
|
]
|
|
748
1060
|
},
|
|
749
|
-
|
|
1061
|
+
l.id
|
|
750
1062
|
);
|
|
751
1063
|
})
|
|
752
|
-
] },
|
|
753
|
-
}
|
|
754
|
-
function
|
|
755
|
-
const
|
|
756
|
-
return /* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
] },
|
|
760
|
-
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
return /* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
1064
|
+
] }, s.toISOString(c.date))) });
|
|
1065
|
+
}
|
|
1066
|
+
function zt({ api: r, model: t, options: e }) {
|
|
1067
|
+
const n = e.locale ?? "en", o = new Intl.DateTimeFormat(n, { month: "long" });
|
|
1068
|
+
return /* @__PURE__ */ d("div", { "data-rsv": "multimonth", children: t.months.map((a) => /* @__PURE__ */ g("section", { "data-rsv": "mm-month", children: [
|
|
1069
|
+
/* @__PURE__ */ d("header", { "data-rsv": "mm-title", children: o.format(s.toDate(a.date)) }),
|
|
1070
|
+
/* @__PURE__ */ d(ut, { api: r, model: a.dayGrid, options: e })
|
|
1071
|
+
] }, s.toISOString(a.date))) });
|
|
1072
|
+
}
|
|
1073
|
+
const z = 1.6;
|
|
1074
|
+
function Jt({ api: r, model: t, options: e }) {
|
|
1075
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "timeline", children: [
|
|
1076
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tl-axis", role: "row", children: t.slots.map((n) => /* @__PURE__ */ d("div", { "data-rsv": "tl-slot", style: `left:${n.leftPct}%`, children: n.label }, n.leftPct)) }),
|
|
1077
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tl-body", style: `height:${t.laneCount * z + 0.5}rem`, children: t.segs.map((n) => /* @__PURE__ */ d(gt, { api: r, seg: n, options: e }, n.event.id)) })
|
|
766
1078
|
] });
|
|
767
1079
|
}
|
|
768
|
-
function
|
|
769
|
-
api:
|
|
1080
|
+
function gt({
|
|
1081
|
+
api: r,
|
|
770
1082
|
seg: t,
|
|
771
|
-
options:
|
|
1083
|
+
options: e
|
|
772
1084
|
}) {
|
|
773
1085
|
var o;
|
|
774
|
-
const { event:
|
|
775
|
-
return /* @__PURE__ */
|
|
1086
|
+
const { event: n } = t;
|
|
1087
|
+
return /* @__PURE__ */ d(
|
|
776
1088
|
"div",
|
|
777
1089
|
{
|
|
778
1090
|
"data-rsv": "event",
|
|
779
|
-
"data-event-id":
|
|
1091
|
+
"data-event-id": n.id,
|
|
780
1092
|
role: "button",
|
|
781
1093
|
tabIndex: 0,
|
|
782
|
-
style: `position:absolute;left:${t.leftPct}%;width:${t.widthPct}%;top:${t.lane *
|
|
783
|
-
onClick: () =>
|
|
784
|
-
children:
|
|
785
|
-
(o =
|
|
786
|
-
{ event:
|
|
787
|
-
|
|
1094
|
+
style: `position:absolute;left:${t.leftPct}%;width:${t.widthPct}%;top:${t.lane * z}rem;height:${z - 0.2}rem;--rsv-event-bg:${n.backgroundColor};--rsv-event-fg:${n.textColor};--rsv-event-border:${n.borderColor}`,
|
|
1095
|
+
onClick: (a) => r.trigger("eventClick", { event: n, el: a.currentTarget }),
|
|
1096
|
+
children: L(
|
|
1097
|
+
(o = e.slots) == null ? void 0 : o.eventContent,
|
|
1098
|
+
{ event: n, isAllDay: n.allDay, timeText: "", view: { type: r.getView().type } },
|
|
1099
|
+
n.title,
|
|
1100
|
+
e.hostBridge
|
|
788
1101
|
)
|
|
789
1102
|
}
|
|
790
1103
|
);
|
|
791
1104
|
}
|
|
792
|
-
const
|
|
793
|
-
function
|
|
794
|
-
return /* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
1105
|
+
const Qt = 1.6;
|
|
1106
|
+
function Zt({ api: r, model: t, options: e }) {
|
|
1107
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "resource-timeline", children: [
|
|
1108
|
+
/* @__PURE__ */ g("div", { "data-rsv": "rt-header", role: "row", children: [
|
|
1109
|
+
/* @__PURE__ */ d("div", { "data-rsv": "resource-area-header", children: e.locale === "es" ? "Recursos" : "Resources" }),
|
|
1110
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tl-axis", children: t.slots.map((n) => /* @__PURE__ */ d("div", { "data-rsv": "tl-slot", style: `left:${n.leftPct}%`, children: n.label }, n.leftPct)) })
|
|
798
1111
|
] }),
|
|
799
|
-
t.lanes.map((
|
|
800
|
-
const o =
|
|
801
|
-
return /* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
1112
|
+
t.lanes.map((n) => {
|
|
1113
|
+
const o = n.laneCount * Qt + 0.4;
|
|
1114
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "resource-row", role: "row", children: [
|
|
1115
|
+
/* @__PURE__ */ g(
|
|
803
1116
|
"div",
|
|
804
1117
|
{
|
|
805
1118
|
"data-rsv": "resource-label",
|
|
806
|
-
style: `padding-inline-start:${0.5 +
|
|
1119
|
+
style: `padding-inline-start:${0.5 + n.row.depth * 1}rem`,
|
|
807
1120
|
children: [
|
|
808
|
-
|
|
1121
|
+
n.row.hasChildren && /* @__PURE__ */ d(
|
|
809
1122
|
"button",
|
|
810
1123
|
{
|
|
811
1124
|
type: "button",
|
|
812
1125
|
"data-rsv": "resource-toggle",
|
|
813
|
-
"aria-expanded":
|
|
814
|
-
onClick: () =>
|
|
815
|
-
children:
|
|
1126
|
+
"aria-expanded": n.row.expanded,
|
|
1127
|
+
onClick: () => r.toggleResource(n.row.resource.id),
|
|
1128
|
+
children: n.row.expanded ? "▾" : "▸"
|
|
816
1129
|
}
|
|
817
1130
|
),
|
|
818
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ d("span", { "data-rsv": "resource-title", children: n.row.resource.title })
|
|
819
1132
|
]
|
|
820
1133
|
}
|
|
821
1134
|
),
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
] },
|
|
1135
|
+
/* @__PURE__ */ d("div", { "data-rsv": "resource-lane", style: `height:${o}rem`, children: n.segs.map((a) => /* @__PURE__ */ d(gt, { api: r, seg: a, options: e }, a.event.id)) })
|
|
1136
|
+
] }, n.row.resource.id);
|
|
824
1137
|
})
|
|
825
1138
|
] });
|
|
826
1139
|
}
|
|
827
|
-
function
|
|
828
|
-
const
|
|
829
|
-
return /* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
t.columns.map((o) => /* @__PURE__ */
|
|
1140
|
+
function te({ api: r, model: t, options: e }) {
|
|
1141
|
+
const n = `calc(var(--spacing-rsv-slot, 2.5rem) * ${t.slots.length})`;
|
|
1142
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "timegrid", style: `--rsv-tg-days:${t.columns.length}`, children: [
|
|
1143
|
+
/* @__PURE__ */ g("div", { "data-rsv": "tg-header", role: "row", children: [
|
|
1144
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis-corner" }),
|
|
1145
|
+
t.columns.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-col-header", role: "columnheader", children: o.row.resource.title }, o.row.resource.id))
|
|
833
1146
|
] }),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
t.columns.map((o) => /* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ g("div", { "data-rsv": "tg-allday", role: "row", children: [
|
|
1148
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis-label", children: R(e.locale).allDay }),
|
|
1149
|
+
t.columns.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-allday-cell", children: o.allDayEvents.map((a) => /* @__PURE__ */ d(
|
|
837
1150
|
"div",
|
|
838
1151
|
{
|
|
839
1152
|
"data-rsv": "event",
|
|
840
1153
|
"data-all-day": "true",
|
|
841
|
-
style: `--rsv-event-bg:${
|
|
842
|
-
onClick: () =>
|
|
843
|
-
children:
|
|
1154
|
+
style: `--rsv-event-bg:${a.backgroundColor}`,
|
|
1155
|
+
onClick: (h) => r.trigger("eventClick", { event: a, el: h.currentTarget }),
|
|
1156
|
+
children: a.title
|
|
844
1157
|
},
|
|
845
|
-
|
|
1158
|
+
a.id
|
|
846
1159
|
)) }, o.row.resource.id))
|
|
847
1160
|
] }),
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
t.columns.map((o) => /* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ g("div", { "data-rsv": "tg-body", children: [
|
|
1162
|
+
/* @__PURE__ */ d("div", { "data-rsv": "tg-axis", style: `height:${n}`, children: t.slots.map((o) => /* @__PURE__ */ d("div", { "data-rsv": "tg-slot", "data-major": String(o.isMajor), children: /* @__PURE__ */ d("span", { "data-rsv": "tg-slot-label", children: o.label }) }, o.offsetMin)) }),
|
|
1163
|
+
t.columns.map((o) => /* @__PURE__ */ g(
|
|
851
1164
|
"div",
|
|
852
1165
|
{
|
|
853
1166
|
"data-rsv": "tg-col",
|
|
854
1167
|
"data-rsv-resource-id": o.row.resource.id,
|
|
855
|
-
style: `height:${
|
|
1168
|
+
style: `height:${n}`,
|
|
856
1169
|
children: [
|
|
857
|
-
o.timedSegs.map((
|
|
858
|
-
const
|
|
859
|
-
return /* @__PURE__ */
|
|
1170
|
+
o.timedSegs.map((a) => {
|
|
1171
|
+
const h = 100 / a.colCount;
|
|
1172
|
+
return /* @__PURE__ */ g(
|
|
860
1173
|
"div",
|
|
861
1174
|
{
|
|
862
1175
|
"data-rsv": "event",
|
|
863
1176
|
"data-all-day": "false",
|
|
864
|
-
"data-event-id":
|
|
1177
|
+
"data-event-id": a.event.id,
|
|
865
1178
|
role: "button",
|
|
866
1179
|
tabIndex: 0,
|
|
867
|
-
style: `position:absolute;top:${
|
|
868
|
-
onClick: (
|
|
869
|
-
|
|
1180
|
+
style: `position:absolute;top:${a.topPct}%;height:${a.heightPct}%;left:${a.col * h}%;width:${h}%;--rsv-event-bg:${a.event.backgroundColor};--rsv-event-fg:${a.event.textColor}`,
|
|
1181
|
+
onClick: (u) => {
|
|
1182
|
+
u.stopPropagation(), r.trigger("eventClick", { event: a.event });
|
|
870
1183
|
},
|
|
871
1184
|
children: [
|
|
872
|
-
|
|
1185
|
+
s.format(a.event.start, "HH:mm"),
|
|
873
1186
|
" ",
|
|
874
|
-
|
|
1187
|
+
a.event.title
|
|
875
1188
|
]
|
|
876
1189
|
},
|
|
877
|
-
|
|
1190
|
+
a.event.id
|
|
878
1191
|
);
|
|
879
1192
|
}),
|
|
880
|
-
t.nowTopPct != null && /* @__PURE__ */
|
|
1193
|
+
t.nowTopPct != null && /* @__PURE__ */ d("div", { "data-rsv": "now-indicator", style: `top:${t.nowTopPct}%` })
|
|
881
1194
|
]
|
|
882
1195
|
},
|
|
883
1196
|
o.row.resource.id
|
|
@@ -885,99 +1198,205 @@ function Rt({ api: a, model: t, options: r }) {
|
|
|
885
1198
|
] })
|
|
886
1199
|
] });
|
|
887
1200
|
}
|
|
888
|
-
function
|
|
889
|
-
return /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
1201
|
+
function ee({ api: r, model: t }) {
|
|
1202
|
+
return /* @__PURE__ */ g("div", { "data-rsv": "resource-daygrid", style: `--rsv-rdg-cols:${t.columns.length}`, children: [
|
|
1203
|
+
/* @__PURE__ */ d("div", { "data-rsv": "rdg-header", role: "row", children: t.columns.map((e) => /* @__PURE__ */ d("div", { "data-rsv": "rdg-col-header", role: "columnheader", children: e.row.resource.title }, e.row.resource.id)) }),
|
|
1204
|
+
/* @__PURE__ */ d("div", { "data-rsv": "rdg-body", role: "row", children: t.columns.map((e) => /* @__PURE__ */ d(
|
|
892
1205
|
"div",
|
|
893
1206
|
{
|
|
894
1207
|
"data-rsv": "rdg-col",
|
|
895
|
-
"data-rsv-resource-id":
|
|
896
|
-
children:
|
|
1208
|
+
"data-rsv-resource-id": e.row.resource.id,
|
|
1209
|
+
children: e.events.map((n) => /* @__PURE__ */ g(
|
|
897
1210
|
"div",
|
|
898
1211
|
{
|
|
899
1212
|
"data-rsv": "event",
|
|
900
|
-
"data-all-day": String(
|
|
901
|
-
"data-event-id":
|
|
1213
|
+
"data-all-day": String(n.allDay),
|
|
1214
|
+
"data-event-id": n.id,
|
|
902
1215
|
role: "button",
|
|
903
1216
|
tabIndex: 0,
|
|
904
|
-
style: `--rsv-event-bg:${
|
|
905
|
-
onClick: () =>
|
|
1217
|
+
style: `--rsv-event-bg:${n.backgroundColor};--rsv-event-fg:${n.textColor};--rsv-event-border:${n.borderColor}`,
|
|
1218
|
+
onClick: (o) => r.trigger("eventClick", { event: n, el: o.currentTarget }),
|
|
906
1219
|
children: [
|
|
907
|
-
|
|
908
|
-
|
|
1220
|
+
n.allDay ? "" : s.format(n.start, "HH:mm") + " ",
|
|
1221
|
+
n.title
|
|
909
1222
|
]
|
|
910
1223
|
},
|
|
911
|
-
|
|
1224
|
+
n.id
|
|
912
1225
|
))
|
|
913
1226
|
},
|
|
914
|
-
|
|
1227
|
+
e.row.resource.id
|
|
915
1228
|
)) })
|
|
916
1229
|
] });
|
|
917
1230
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1231
|
+
function re({ api: r, model: t, options: e }) {
|
|
1232
|
+
return /* @__PURE__ */ d("div", { "data-rsv": "resource-daygrid-month", style: `--rsv-rdgm-cols:${t.columnCount}`, children: t.weeks.map((n, o) => /* @__PURE__ */ d("div", { "data-rsv": "rdgm-week", role: "row", children: n.days.map((a) => /* @__PURE__ */ d(
|
|
1233
|
+
ne,
|
|
1234
|
+
{
|
|
1235
|
+
api: r,
|
|
1236
|
+
cell: a,
|
|
1237
|
+
options: e
|
|
1238
|
+
},
|
|
1239
|
+
s.toISOString(a.date)
|
|
1240
|
+
)) }, `week-${o}`)) });
|
|
1241
|
+
}
|
|
1242
|
+
function ne({
|
|
1243
|
+
api: r,
|
|
1244
|
+
cell: t,
|
|
1245
|
+
options: e
|
|
1246
|
+
}) {
|
|
1247
|
+
const n = s.dayOfMonth(t.date);
|
|
1248
|
+
return /* @__PURE__ */ g(
|
|
1249
|
+
"div",
|
|
1250
|
+
{
|
|
1251
|
+
"data-rsv": "day",
|
|
1252
|
+
role: "gridcell",
|
|
1253
|
+
"data-date": s.toISOString(t.date),
|
|
1254
|
+
"data-today": String(t.isToday),
|
|
1255
|
+
"data-other": String(t.isOther),
|
|
1256
|
+
children: [
|
|
1257
|
+
/* @__PURE__ */ d("span", { "data-rsv": "day-number", children: n }),
|
|
1258
|
+
/* @__PURE__ */ d("div", { "data-rsv": "rdgm-columns", children: t.columns.map((o) => /* @__PURE__ */ g("div", { "data-rsv": "rdgm-col", "data-rsv-resource-id": o.row.resource.id, children: [
|
|
1259
|
+
/* @__PURE__ */ d("span", { "data-rsv": "rdgm-col-label", children: o.row.resource.title }),
|
|
1260
|
+
o.events.map((a) => {
|
|
1261
|
+
const h = r.selectedEventIds.value.has(a.id);
|
|
1262
|
+
return /* @__PURE__ */ g(
|
|
1263
|
+
"div",
|
|
1264
|
+
{
|
|
1265
|
+
"data-rsv": "event",
|
|
1266
|
+
"data-all-day": String(a.allDay),
|
|
1267
|
+
"data-event-id": a.id,
|
|
1268
|
+
"data-rsv-selected": String(h),
|
|
1269
|
+
role: "button",
|
|
1270
|
+
tabIndex: 0,
|
|
1271
|
+
style: `--rsv-event-bg:${a.backgroundColor};--rsv-event-fg:${a.textColor};--rsv-event-border:${a.borderColor}`,
|
|
1272
|
+
onClick: (u) => {
|
|
1273
|
+
if (u.stopPropagation(), u.ctrlKey || u.metaKey) {
|
|
1274
|
+
r.toggleEventSelection(a.id);
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
r.trigger("eventClick", { event: a, el: u.currentTarget }), a.url && window.open(a.url, "_self");
|
|
1278
|
+
},
|
|
1279
|
+
children: [
|
|
1280
|
+
a.allDay ? "" : `${s.format(a.start, "HH:mm")} `,
|
|
1281
|
+
a.title
|
|
1282
|
+
]
|
|
1283
|
+
},
|
|
1284
|
+
a.id
|
|
1285
|
+
);
|
|
1286
|
+
}),
|
|
1287
|
+
o.moreCount > 0 && /* @__PURE__ */ d(
|
|
1288
|
+
"span",
|
|
1289
|
+
{
|
|
1290
|
+
"data-rsv": "rdgm-more",
|
|
1291
|
+
onClick: (a) => {
|
|
1292
|
+
a.stopPropagation(), r.trigger("moreLinkClick", {
|
|
1293
|
+
date: t.date,
|
|
1294
|
+
allEvents: [...o.events, ...o.hiddenEvents],
|
|
1295
|
+
hiddenEvents: o.hiddenEvents
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
children: R(e.locale).more(o.moreCount)
|
|
1299
|
+
}
|
|
1300
|
+
)
|
|
1301
|
+
] }, o.row.resource.id)) })
|
|
1302
|
+
]
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
function ae({ api: r, options: t }) {
|
|
1307
|
+
var c;
|
|
1308
|
+
const e = r.viewModel.value, n = t.direction ?? R(t.locale).direction, o = r.getEffectiveOption("hourHeight", e.type), a = r.getEffectiveOption("height", e.type), h = [
|
|
1309
|
+
t.themeTokens ? pt(t.themeTokens) : "",
|
|
1310
|
+
o ? `${Dt.slotHeight}:${o}px` : "",
|
|
1311
|
+
a != null && a !== "auto" ? `height:${typeof a == "number" ? `${a}px` : a}` : ""
|
|
1312
|
+
].filter(Boolean).join(";") || void 0, u = $(null);
|
|
1313
|
+
H(() => (r.setRootEl(u.current), () => r.setRootEl(null)), [r]);
|
|
1314
|
+
const v = $(t.responsiveViews);
|
|
1315
|
+
return v.current = t.responsiveViews, H(() => {
|
|
1316
|
+
const l = u.current;
|
|
1317
|
+
if (!l || typeof ResizeObserver > "u") return;
|
|
1318
|
+
let f = 0;
|
|
1319
|
+
const b = new ResizeObserver((k) => {
|
|
1320
|
+
const w = k[0], p = (w == null ? void 0 : w.contentRect.width) ?? l.clientWidth;
|
|
1321
|
+
cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1322
|
+
const m = v.current;
|
|
1323
|
+
if (!(m != null && m.length)) return;
|
|
1324
|
+
const S = $t(m, p);
|
|
1325
|
+
S && S !== r.getView().type && r.hasView(S) && r.changeView(S);
|
|
1326
|
+
});
|
|
1327
|
+
});
|
|
1328
|
+
return b.observe(l), () => {
|
|
1329
|
+
cancelAnimationFrame(f), b.disconnect();
|
|
1330
|
+
};
|
|
1331
|
+
}, [r]), /* @__PURE__ */ g(
|
|
922
1332
|
"div",
|
|
923
1333
|
{
|
|
1334
|
+
ref: u,
|
|
924
1335
|
"data-rsv": "root",
|
|
925
|
-
dir:
|
|
1336
|
+
dir: n,
|
|
926
1337
|
"data-rsv-theme": t.theme,
|
|
927
|
-
|
|
928
|
-
|
|
1338
|
+
"data-rsv-autoheight": a === "auto" ? "true" : void 0,
|
|
1339
|
+
style: h,
|
|
1340
|
+
class: F((c = t.classNames) == null ? void 0 : c.root),
|
|
929
1341
|
children: [
|
|
930
|
-
t.headerToolbar !== !1 && /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
1342
|
+
t.headerToolbar !== !1 && /* @__PURE__ */ d(Rt, { api: r, title: e.title, activeView: e.type, options: t }),
|
|
1343
|
+
/* @__PURE__ */ d("div", { "data-rsv": "view", "data-view": e.type, children: e.dayGrid ? /* @__PURE__ */ d(ut, { api: r, model: e.dayGrid, options: t }) : e.timeGrid ? /* @__PURE__ */ d(Wt, { api: r, model: e.timeGrid, options: t }) : e.list ? /* @__PURE__ */ d(qt, { api: r, model: e.list, options: t }) : e.multiMonth ? /* @__PURE__ */ d(zt, { api: r, model: e.multiMonth, options: t }) : e.resourceTimeGrid ? /* @__PURE__ */ d(te, { api: r, model: e.resourceTimeGrid, options: t }) : e.resourceDayGrid ? /* @__PURE__ */ d(ee, { api: r, model: e.resourceDayGrid, options: t }) : e.resourceDayGridMonth ? /* @__PURE__ */ d(re, { api: r, model: e.resourceDayGridMonth, options: t }) : e.resourceTimeline ? /* @__PURE__ */ d(Zt, { api: r, model: e.resourceTimeline, options: t }) : e.timeline ? /* @__PURE__ */ d(Jt, { api: r, model: e.timeline, options: t }) : /* @__PURE__ */ g("div", { "data-rsv": "unsupported", children: [
|
|
932
1344
|
'La vista "',
|
|
933
|
-
|
|
1345
|
+
e.type,
|
|
934
1346
|
'" se implementa en una fase posterior.'
|
|
935
1347
|
] }) })
|
|
936
1348
|
]
|
|
937
1349
|
}
|
|
938
1350
|
);
|
|
939
1351
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
return
|
|
943
|
-
api:
|
|
1352
|
+
function ue(r, t) {
|
|
1353
|
+
const e = new Mt(t);
|
|
1354
|
+
return at(bt(ae, { api: e, options: t }), r), {
|
|
1355
|
+
api: e,
|
|
944
1356
|
destroy() {
|
|
945
|
-
|
|
1357
|
+
at(null, r), e.destroy();
|
|
946
1358
|
}
|
|
947
1359
|
};
|
|
948
1360
|
}
|
|
949
|
-
function
|
|
1361
|
+
function ve(r, t = "calendar.ics") {
|
|
950
1362
|
if (typeof document > "u") return;
|
|
951
|
-
const
|
|
952
|
-
|
|
1363
|
+
const e = St(r), n = new Blob([e], { type: "text/calendar;charset=utf-8" }), o = URL.createObjectURL(n), a = document.createElement("a");
|
|
1364
|
+
a.href = o, a.download = t, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(o);
|
|
953
1365
|
}
|
|
954
1366
|
export {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1367
|
+
ae as Calendar,
|
|
1368
|
+
ut as DayGridView,
|
|
1369
|
+
qt as ListView,
|
|
1370
|
+
zt as MultiMonthView,
|
|
1371
|
+
ee as ResourceDayGridView,
|
|
1372
|
+
te as ResourceTimeGridView,
|
|
1373
|
+
Zt as ResourceTimelineView,
|
|
1374
|
+
Wt as TimeGridView,
|
|
1375
|
+
Jt as TimelineView,
|
|
1376
|
+
Rt as Toolbar,
|
|
1377
|
+
A as callDidMount,
|
|
1378
|
+
F as cx,
|
|
1379
|
+
W as dateFormatter,
|
|
1380
|
+
ge as dayGridPlugin,
|
|
1381
|
+
ye as definePlugin,
|
|
1382
|
+
fe as defineTheme,
|
|
1383
|
+
ve as downloadICS,
|
|
1384
|
+
be as eventsToICS,
|
|
1385
|
+
lt as handleEventKeydown,
|
|
1386
|
+
ce as hostSlot,
|
|
1387
|
+
Et as isHostSlot,
|
|
1388
|
+
we as listPlugin,
|
|
1389
|
+
It as minutesToLabel,
|
|
1390
|
+
At as minutesToTimeString,
|
|
1391
|
+
ue as mount,
|
|
1392
|
+
ke as multiMonthPlugin,
|
|
1393
|
+
De as parseICS,
|
|
1394
|
+
L as renderSlot,
|
|
1395
|
+
pe as resourcePlugin,
|
|
1396
|
+
q as startEventDrag,
|
|
1397
|
+
Me as themeToStyle,
|
|
1398
|
+
X as timeFormatter,
|
|
1399
|
+
Se as timeGridPlugin,
|
|
1400
|
+
Ce as timelinePlugin
|
|
982
1401
|
};
|
|
983
1402
|
//# sourceMappingURL=index.js.map
|