vue-cal 5.0.1-rc.4 → 5.0.1-rc.5
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/vue-cal.es.js +76 -75
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +7 -3
package/dist/vue-cal.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as T, reactive as $e, watch as me, toRefs as lt, ref as ie, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as Y, renderSlot as F, createCommentVNode as U, unref as C, Fragment as te, renderList as pe, normalizeClass as ke, createElementVNode as ge, createVNode as Oe, Transition as Ge, withCtx as Z, createBlock as Se, resolveDynamicComponent as Ke, mergeProps as ye, toHandlers as Ie, normalizeProps as se, guardReactiveProps as ne, toDisplayString as le, onMounted as Ze, withModifiers as Qe, nextTick as Ue, normalizeStyle as Te, createTextVNode as xe, TransitionGroup as et, createSlots as je, useTemplateRef as rt, useId as it, useAttrs as ot, provide as ut } from "vue";
|
|
2
2
|
/**
|
|
3
|
-
* vue-cal v5.0.1-rc.
|
|
3
|
+
* vue-cal v5.0.1-rc.5
|
|
4
4
|
* (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -69,7 +69,7 @@ const fe = {
|
|
|
69
69
|
const { cols: K, rows: oe } = fe.availableViews[P];
|
|
70
70
|
return O[P] = { cols: I.cols || K, rows: I.rows || oe }, O;
|
|
71
71
|
}, {})), n && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(k).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), k = { ...fe.availableViews })) : k = { ...fe.availableViews }, k);
|
|
72
|
-
}),
|
|
72
|
+
}), G = T(() => s.datePicker ? "month" : N.value.week ? "week" : Object.keys(N.value)[0]), u = T(() => {
|
|
73
73
|
if (typeof s.selectedDate == "string") return D.stringToDate(s.selectedDate);
|
|
74
74
|
if (s.selectedDate instanceof Date) return s.selectedDate;
|
|
75
75
|
s.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", s.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
|
|
@@ -119,7 +119,7 @@ const fe = {
|
|
|
119
119
|
events: B,
|
|
120
120
|
// All the events listeners for cells and events that the end user may have attached to vue-cal.
|
|
121
121
|
eventListeners: o,
|
|
122
|
-
defaultView:
|
|
122
|
+
defaultView: G,
|
|
123
123
|
availableViews: N,
|
|
124
124
|
disableDays: d,
|
|
125
125
|
ready: w,
|
|
@@ -249,7 +249,7 @@ const st = (c) => {
|
|
|
249
249
|
}, Date.prototype.subtractDays = function(a) {
|
|
250
250
|
return N(this, a || 0);
|
|
251
251
|
}, Date.prototype.addHours = function(a) {
|
|
252
|
-
return
|
|
252
|
+
return G(this, a || 0);
|
|
253
253
|
}, Date.prototype.subtractHours = function(a) {
|
|
254
254
|
return u(this, a || 0);
|
|
255
255
|
}, Date.prototype.addMinutes = function(a) {
|
|
@@ -275,7 +275,7 @@ const st = (c) => {
|
|
|
275
275
|
}, N = (a, p) => {
|
|
276
276
|
const y = new Date(a.valueOf());
|
|
277
277
|
return y.setDate(y.getDate() - p), y;
|
|
278
|
-
},
|
|
278
|
+
}, G = (a, p) => {
|
|
279
279
|
const y = new Date(a.valueOf());
|
|
280
280
|
return y.setHours(y.getHours() + p), y;
|
|
281
281
|
}, u = (a, p) => {
|
|
@@ -288,18 +288,18 @@ const st = (c) => {
|
|
|
288
288
|
const y = new Date(a.valueOf());
|
|
289
289
|
return y.setMinutes(y.getMinutes() - p), y;
|
|
290
290
|
}, v = (a, p) => {
|
|
291
|
-
const y = (
|
|
292
|
-
const J =
|
|
293
|
-
return J !== 0 && (
|
|
291
|
+
const y = (q) => {
|
|
292
|
+
const J = q % p;
|
|
293
|
+
return J !== 0 && (q += J >= p / 2 ? p - J : -J), q;
|
|
294
294
|
};
|
|
295
295
|
if (typeof a == "number") return y(a);
|
|
296
296
|
if (a instanceof Date) {
|
|
297
|
-
let
|
|
298
|
-
|
|
297
|
+
let q = y(a.getMinutes());
|
|
298
|
+
q >= 60 && (a.setHours(a.getHours() + 1), q = 0), a.setMinutes(q, 0, 0);
|
|
299
299
|
}
|
|
300
300
|
}, h = (a, p = !1) => {
|
|
301
|
-
const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())),
|
|
302
|
-
y.setUTCDate(y.getUTCDate() + 4 -
|
|
301
|
+
const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), q = y.getUTCDay() || 7;
|
|
302
|
+
y.setUTCDate(y.getUTCDate() + 4 - q);
|
|
303
303
|
const J = new Date(Date.UTC(y.getUTCFullYear(), 0, 1));
|
|
304
304
|
return Math.ceil(((y - J) / 864e5 + 1) / 7) + (p ? 1 : 0);
|
|
305
305
|
}, E = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === f(), L = (a, p) => {
|
|
@@ -312,8 +312,8 @@ const st = (c) => {
|
|
|
312
312
|
const p = a.getFullYear();
|
|
313
313
|
return !(p % 400) || p % 100 && !(p % 4);
|
|
314
314
|
}, n = (a = null, p) => {
|
|
315
|
-
const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(),
|
|
316
|
-
return y.setDate(y.getDate() - (y.getDay() +
|
|
315
|
+
const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), q = p ? 7 : 6;
|
|
316
|
+
return y.setDate(y.getDate() - (y.getDay() + q) % 7), y;
|
|
317
317
|
}, k = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), t = (a) => a.getHours() * 60 + a.getMinutes(), O = (a, p) => {
|
|
318
318
|
typeof a == "string" && (a = a.replace(/-/g, "/")), typeof p == "string" && (p = p.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), p = new Date(p).setHours(0, 0, 1, 0);
|
|
319
319
|
const y = (new Date(p).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
|
|
@@ -321,7 +321,7 @@ const st = (c) => {
|
|
|
321
321
|
}, P = (a, p, y) => Math.abs(a.getTime() - p.getTime()) <= y * 60 * 1e3, I = (a) => a && a instanceof Date && !isNaN(a), K = (a, p = "YYYY-MM-DD", y = null) => {
|
|
322
322
|
if (y || (y = z.value), p || (p = "YYYY-MM-DD"), p === "YYYY-MM-DD") return oe(a);
|
|
323
323
|
w = {}, _ = {};
|
|
324
|
-
const
|
|
324
|
+
const q = {
|
|
325
325
|
YYYY: () => Q(a, y).YYYY,
|
|
326
326
|
YY: () => Q(a, y).YY(),
|
|
327
327
|
M: () => Q(a, y).M,
|
|
@@ -347,15 +347,15 @@ const st = (c) => {
|
|
|
347
347
|
s: () => ue(a, y).s
|
|
348
348
|
};
|
|
349
349
|
return p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (J, ce) => {
|
|
350
|
-
const r =
|
|
350
|
+
const r = q[ce.replace(/\{|\}/g, "")];
|
|
351
351
|
return r !== void 0 ? r() : ce;
|
|
352
352
|
});
|
|
353
353
|
}, oe = (a) => {
|
|
354
354
|
const p = a.getMonth() + 1, y = a.getDate();
|
|
355
355
|
return `${a.getFullYear()}-${p < 10 ? "0" : ""}${p}-${y < 10 ? "0" : ""}${y}`;
|
|
356
|
-
}, ae = (a, p = "HH:mm", y = null,
|
|
356
|
+
}, ae = (a, p = "HH:mm", y = null, q = !1) => {
|
|
357
357
|
let J = !1;
|
|
358
|
-
if (
|
|
358
|
+
if (q) {
|
|
359
359
|
const [$, S, M] = [a.getHours(), a.getMinutes(), a.getSeconds()];
|
|
360
360
|
$ + S + M === 141 && (J = !0);
|
|
361
361
|
}
|
|
@@ -386,7 +386,7 @@ const st = (c) => {
|
|
|
386
386
|
}
|
|
387
387
|
}, Q = (a, p) => {
|
|
388
388
|
if (w.D) return w;
|
|
389
|
-
const y = a.getFullYear(),
|
|
389
|
+
const y = a.getFullYear(), q = a.getMonth() + 1, J = a.getDate(), r = (a.getDay() - 1 + 7) % 7;
|
|
390
390
|
return w = {
|
|
391
391
|
// Year.
|
|
392
392
|
YYYY: y,
|
|
@@ -394,15 +394,15 @@ const st = (c) => {
|
|
|
394
394
|
YY: () => y.toString().substring(2),
|
|
395
395
|
// 24.
|
|
396
396
|
// Month.
|
|
397
|
-
M:
|
|
397
|
+
M: q,
|
|
398
398
|
// 1 to 12.
|
|
399
|
-
MM: () =>
|
|
399
|
+
MM: () => q.toString().padStart(2, 0),
|
|
400
400
|
// 01 to 12.
|
|
401
|
-
MMM: () => p.months[
|
|
401
|
+
MMM: () => p.months[q - 1].substring(0, 3),
|
|
402
402
|
// Jan to Dec.
|
|
403
|
-
MMMM: () => p.months[
|
|
403
|
+
MMMM: () => p.months[q - 1],
|
|
404
404
|
// January to December.
|
|
405
|
-
MMMMG: () => (p.monthsGenitive || p.months)[
|
|
405
|
+
MMMMG: () => (p.monthsGenitive || p.months)[q - 1],
|
|
406
406
|
// January to December in genitive form (Greek...)
|
|
407
407
|
// Day.
|
|
408
408
|
D: J,
|
|
@@ -424,8 +424,8 @@ const st = (c) => {
|
|
|
424
424
|
}, w;
|
|
425
425
|
}, ue = (a, p) => {
|
|
426
426
|
if (_.am) return _;
|
|
427
|
-
let y,
|
|
428
|
-
a instanceof Date ? (y = a.getHours(),
|
|
427
|
+
let y, q, J;
|
|
428
|
+
a instanceof Date ? (y = a.getHours(), q = a.getMinutes(), J = a.getSeconds()) : (y = Math.floor(a / 60), q = Math.floor(a % 60));
|
|
429
429
|
const ce = y % 12 ? y % 12 : 12, r = (p || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
|
|
430
430
|
return _ = {
|
|
431
431
|
H: y,
|
|
@@ -434,8 +434,8 @@ const st = (c) => {
|
|
|
434
434
|
hh: ce.toString().padStart(2, 0),
|
|
435
435
|
am: r,
|
|
436
436
|
AM: r.toUpperCase(),
|
|
437
|
-
m:
|
|
438
|
-
mm:
|
|
437
|
+
m: q,
|
|
438
|
+
mm: q.toString().padStart(2, 0),
|
|
439
439
|
s: J
|
|
440
440
|
}, _;
|
|
441
441
|
};
|
|
@@ -445,7 +445,7 @@ const st = (c) => {
|
|
|
445
445
|
updateTexts: o,
|
|
446
446
|
addDays: b,
|
|
447
447
|
subtractDays: N,
|
|
448
|
-
addHours:
|
|
448
|
+
addHours: G,
|
|
449
449
|
subtractHours: u,
|
|
450
450
|
addMinutes: d,
|
|
451
451
|
subtractMinutes: e,
|
|
@@ -580,9 +580,9 @@ const st = (c) => {
|
|
|
580
580
|
var B;
|
|
581
581
|
const E = new Set(v), L = [];
|
|
582
582
|
for (const l of u)
|
|
583
|
-
!E.has((B = l._) == null ? void 0 : B.id) && (h === null || h === l.schedule) &&
|
|
583
|
+
!E.has((B = l._) == null ? void 0 : B.id) && (h === null || h === l.schedule) && G(l, d, e) && L.push(l);
|
|
584
584
|
return L;
|
|
585
|
-
},
|
|
585
|
+
}, G = (u, d, e) => {
|
|
586
586
|
const v = u.allDay || !i.time, h = v ? new Date(u.start).setHours(0, 0, 0, 0) : u.start.getTime(), E = v ? new Date(u.end).setHours(23, 59, 59, 999) : u.end.getTime(), L = v ? new Date(d).setHours(0, 0, 0, 0) : d.getTime(), B = v ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
|
|
587
587
|
return E > L && h < B;
|
|
588
588
|
};
|
|
@@ -595,7 +595,7 @@ const st = (c) => {
|
|
|
595
595
|
getEventsInRange: N,
|
|
596
596
|
createEvent: o,
|
|
597
597
|
deleteEvent: f,
|
|
598
|
-
isEventInRange:
|
|
598
|
+
isEventInRange: G
|
|
599
599
|
};
|
|
600
600
|
}, gt = ({ config: c, dateUtils: s, emit: i, texts: D, eventsManager: w }, _) => {
|
|
601
601
|
const { availableViews: z } = c, m = ie(c.view && z[c.view] ? c.view : c.defaultView), V = ie(c.selectedDate || null);
|
|
@@ -604,7 +604,7 @@ const st = (c) => {
|
|
|
604
604
|
f.value.setHours(0, 0, 0, 0);
|
|
605
605
|
const b = ie(new Date(f));
|
|
606
606
|
let N = null;
|
|
607
|
-
const
|
|
607
|
+
const G = T(() => m.value === "month" ? b.value : n.value), u = T(() => m.value === "month" ? new Date(b.value.getFullYear(), b.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), d = T(() => m.value === "week" ? s.getPreviousFirstDayOfWeek(n.value, c.startWeekOnSunday) : m.value === "month" ? n.value : G.value), e = T(() => {
|
|
608
608
|
if (m.value === "week") {
|
|
609
609
|
const g = s.addDays(d.value, 7);
|
|
610
610
|
return g.setMilliseconds(-1), g;
|
|
@@ -642,13 +642,13 @@ const st = (c) => {
|
|
|
642
642
|
}), k = T(() => {
|
|
643
643
|
const g = [], H = ["days", "week", "month"].includes(m.value);
|
|
644
644
|
let R = 0;
|
|
645
|
-
for (let
|
|
645
|
+
for (let X = 0; X < l.value + R; X++)
|
|
646
646
|
switch (m.value) {
|
|
647
647
|
case "day":
|
|
648
648
|
case "days":
|
|
649
649
|
case "week":
|
|
650
650
|
case "month": {
|
|
651
|
-
const ve = s.addDays(n.value,
|
|
651
|
+
const ve = s.addDays(n.value, X), We = ve.getDay() || 7;
|
|
652
652
|
if (H && c.hasHiddenDays && c.hideWeekdays[We]) {
|
|
653
653
|
R++;
|
|
654
654
|
continue;
|
|
@@ -659,14 +659,14 @@ const st = (c) => {
|
|
|
659
659
|
}
|
|
660
660
|
case "year":
|
|
661
661
|
g.push({
|
|
662
|
-
start: new Date(n.value.getFullYear(),
|
|
663
|
-
end: new Date(n.value.getFullYear(),
|
|
662
|
+
start: new Date(n.value.getFullYear(), X, 1, 0, 0, 0, 0),
|
|
663
|
+
end: new Date(n.value.getFullYear(), X + 1, 0, 23, 59, 59, 999)
|
|
664
664
|
});
|
|
665
665
|
break;
|
|
666
666
|
case "years":
|
|
667
667
|
g.push({
|
|
668
|
-
start: new Date(n.value.getFullYear() +
|
|
669
|
-
end: new Date(n.value.getFullYear() +
|
|
668
|
+
start: new Date(n.value.getFullYear() + X, 0, 1, 0, 0, 0, 0),
|
|
669
|
+
end: new Date(n.value.getFullYear() + X + 1, 0, 0, 23, 59, 59, 999)
|
|
670
670
|
});
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
@@ -680,15 +680,15 @@ const st = (c) => {
|
|
|
680
680
|
});
|
|
681
681
|
function K(g, H, R = !1) {
|
|
682
682
|
if (!H || !H[g]) return g + 1;
|
|
683
|
-
const
|
|
684
|
-
return R && typeof
|
|
683
|
+
const X = H[g];
|
|
684
|
+
return R && typeof X == "string" ? X.substring(0, 3) : X;
|
|
685
685
|
}
|
|
686
686
|
function oe(g, H, R) {
|
|
687
|
-
const { monthsArray:
|
|
688
|
-
return nt ? ve ? `${K(Me,
|
|
687
|
+
const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me = g.getMonth(), Ee = g.getFullYear(), Ye = H.getMonth(), He = H.getFullYear(), Be = Me !== Ye, nt = Ee !== He, _e = We && (Ce || Be), Le = g.getDate(), ze = H.getDate();
|
|
688
|
+
return nt ? ve ? `${K(Me, X, _e)} ${Le}, ${Ee} - ${K(Ye, X, _e)} ${ze}, ${He}` : `${Le} ${K(Me, X, _e)} ${Ee} - ${ze} ${K(Ye, X, _e)} ${He}` : Be ? ve ? `${K(Me, X, _e)} ${Le} - ${K(Ye, X, _e)} ${ze}, ${Ee}` : `${Le} ${K(Me, X, _e)} - ${ze} ${K(Ye, X, _e)} ${Ee}` : ve ? `${K(Me, X, _e)} ${Le}-${ze}, ${Ee}` : `${Le}-${ze} ${K(Me, X, _e)} ${Ee}`;
|
|
689
689
|
}
|
|
690
690
|
const ae = T(() => {
|
|
691
|
-
const { dateFormat: g, months: H, monthsGenitive: R, week:
|
|
691
|
+
const { dateFormat: g, months: H, monthsGenitive: R, week: X, truncations: ve } = D, We = c.locale, Ce = ve !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = R && We === "el" ? R : H;
|
|
692
692
|
switch (m.value) {
|
|
693
693
|
case "day":
|
|
694
694
|
return s.formatDate(n.value, g);
|
|
@@ -706,13 +706,13 @@ const st = (c) => {
|
|
|
706
706
|
n.value,
|
|
707
707
|
c.startWeekOnSunday && !c.hideWeekdays[7]
|
|
708
708
|
);
|
|
709
|
-
He += ` <small>${
|
|
709
|
+
He += ` <small>${X} ${Be}</small>`;
|
|
710
710
|
}
|
|
711
711
|
return He;
|
|
712
712
|
}
|
|
713
713
|
case "month": {
|
|
714
714
|
const Ye = `${c.xs && Ce ? "MMM" : "MMMM"} YYYY`;
|
|
715
|
-
return s.formatDate(
|
|
715
|
+
return s.formatDate(G.value, Ye);
|
|
716
716
|
}
|
|
717
717
|
case "year":
|
|
718
718
|
return n.value.getFullYear();
|
|
@@ -742,7 +742,7 @@ const st = (c) => {
|
|
|
742
742
|
i("view-change", {
|
|
743
743
|
id: m.value,
|
|
744
744
|
title: ae.value,
|
|
745
|
-
start:
|
|
745
|
+
start: G.value,
|
|
746
746
|
end: u.value,
|
|
747
747
|
extendedStart: d.value,
|
|
748
748
|
extendedEnd: e.value,
|
|
@@ -800,19 +800,19 @@ const st = (c) => {
|
|
|
800
800
|
}
|
|
801
801
|
J(H);
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function q() {
|
|
804
804
|
const g = /* @__PURE__ */ new Date();
|
|
805
805
|
g.setHours(0, 0, 0, 0), J(g);
|
|
806
806
|
}
|
|
807
807
|
function J(g, H = !0, R = !1) {
|
|
808
808
|
if (!s.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
|
|
809
|
-
let [
|
|
810
|
-
m.value === "month" && ([
|
|
809
|
+
let [X, ve] = [n.value, t.value];
|
|
810
|
+
m.value === "month" && ([X, ve] = [G.value, u.value]), (!s.isInRange(g, X, ve) || R) && (g.setHours(0, 0, 0, 0), O.value = g.getTime() < X.getTime() ? "left" : "right", f.value = g, H && i("update:viewDate", g), re());
|
|
811
811
|
}
|
|
812
812
|
function ce(g, H = !0) {
|
|
813
813
|
if (s.isValid(g)) {
|
|
814
|
-
const { isValid: R, isSameDate:
|
|
815
|
-
(!V.value || !R(V.value) || !
|
|
814
|
+
const { isValid: R, isSameDate: X } = s;
|
|
815
|
+
(!V.value || !R(V.value) || !X(g, V.value)) && (g.setHours(0, 0, 0, 0), V.value = g, H && i("update:selectedDate", g));
|
|
816
816
|
} else
|
|
817
817
|
return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
818
818
|
}
|
|
@@ -826,7 +826,8 @@ const st = (c) => {
|
|
|
826
826
|
console.log("toggling weekdays", c.hideWeekdays);
|
|
827
827
|
}
|
|
828
828
|
function M(g) {
|
|
829
|
-
|
|
829
|
+
var X;
|
|
830
|
+
const H = (X = _.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = g ? g * c.timeCellHeight / c.timeStep : 0;
|
|
830
831
|
H == null || H.scrollTo({ top: R, behavior: "smooth" });
|
|
831
832
|
}
|
|
832
833
|
function W() {
|
|
@@ -848,7 +849,7 @@ const st = (c) => {
|
|
|
848
849
|
narrowerView: I,
|
|
849
850
|
title: ae,
|
|
850
851
|
viewDate: f,
|
|
851
|
-
start:
|
|
852
|
+
start: G,
|
|
852
853
|
end: u,
|
|
853
854
|
extendedStart: d,
|
|
854
855
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
@@ -872,7 +873,7 @@ const st = (c) => {
|
|
|
872
873
|
previous: a,
|
|
873
874
|
next: p,
|
|
874
875
|
navigate: y,
|
|
875
|
-
goToToday:
|
|
876
|
+
goToToday: q,
|
|
876
877
|
updateViewDate: J,
|
|
877
878
|
updateSelectedDate: ce,
|
|
878
879
|
scrollToCurrentTime: W,
|
|
@@ -1147,7 +1148,7 @@ const st = (c) => {
|
|
|
1147
1148
|
(Y(!0), j(te, null, pe(m.value, (b, N) => (Y(), j("div", {
|
|
1148
1149
|
class: ke(["vuecal__weekday", { "vuecal__weekday--today": b.isToday }]),
|
|
1149
1150
|
key: N,
|
|
1150
|
-
onClick: (
|
|
1151
|
+
onClick: (G) => V.click(b.date)
|
|
1151
1152
|
}, [
|
|
1152
1153
|
F(o.$slots, "weekday-heading", {
|
|
1153
1154
|
label: b[_.value],
|
|
@@ -1161,19 +1162,19 @@ const st = (c) => {
|
|
|
1161
1162
|
])),
|
|
1162
1163
|
C(D).schedules ? (Y(), j("div", Vt, [
|
|
1163
1164
|
(Y(!0), j(te, null, pe(m.value, (b, N) => (Y(), j(te, { key: N }, [
|
|
1164
|
-
(Y(!0), j(te, null, pe(C(D).schedules, (
|
|
1165
|
+
(Y(!0), j(te, null, pe(C(D).schedules, (G, u) => (Y(), j(te, { key: u }, [
|
|
1165
1166
|
o.$slots["schedule-heading"] ? (Y(), j("div", {
|
|
1166
1167
|
key: 0,
|
|
1167
|
-
class: ke(["vuecal__schedule vuecal__schedule--heading",
|
|
1168
|
+
class: ke(["vuecal__schedule vuecal__schedule--heading", G.class])
|
|
1168
1169
|
}, [
|
|
1169
1170
|
F(o.$slots, "schedule-heading", {
|
|
1170
|
-
schedule:
|
|
1171
|
+
schedule: G,
|
|
1171
1172
|
view: C(i)
|
|
1172
1173
|
})
|
|
1173
1174
|
], 2)) : (Y(), j("div", {
|
|
1174
1175
|
key: 1,
|
|
1175
|
-
class: ke(["vuecal__schedule vuecal__schedule--heading",
|
|
1176
|
-
innerHTML:
|
|
1176
|
+
class: ke(["vuecal__schedule vuecal__schedule--heading", G.class]),
|
|
1177
|
+
innerHTML: G.label
|
|
1177
1178
|
}, null, 10, Ot))
|
|
1178
1179
|
], 64))), 128))
|
|
1179
1180
|
], 64))), 128))
|
|
@@ -1262,7 +1263,7 @@ const st = (c) => {
|
|
|
1262
1263
|
schedule: null
|
|
1263
1264
|
}), b = T(() => i.editableEvents.drag && o.draggable !== !1 && !o.background), N = T(() => i.time && i.editableEvents.resize && o.resizable !== !1 && !o.background);
|
|
1264
1265
|
T(() => i.editableEvents.delete && o.deletable !== !1 && !o.background);
|
|
1265
|
-
const
|
|
1266
|
+
const G = T(() => {
|
|
1266
1267
|
var l, n, k;
|
|
1267
1268
|
return {
|
|
1268
1269
|
[`vuecal__event--${o._.id}`]: !0,
|
|
@@ -1383,7 +1384,7 @@ const st = (c) => {
|
|
|
1383
1384
|
}), (l, n) => (Y(), j("div", ye({ class: "vuecal__event" }, Ie(d.value, !0), {
|
|
1384
1385
|
ref_key: "eventEl",
|
|
1385
1386
|
ref: V,
|
|
1386
|
-
class:
|
|
1387
|
+
class: G.value,
|
|
1387
1388
|
style: u.value,
|
|
1388
1389
|
draggable: b.value ? "true" : void 0,
|
|
1389
1390
|
onDragstart: n[2] || (n[2] = (k) => b.value && C(w).eventDragStart(k, o)),
|
|
@@ -1449,7 +1450,7 @@ const st = (c) => {
|
|
|
1449
1450
|
index: { type: Number, required: !0 }
|
|
1450
1451
|
},
|
|
1451
1452
|
setup(c) {
|
|
1452
|
-
const s = c, i = Ne("vuecal"), { view: D, config: w, dateUtils: _, eventsManager: z, dnd: m, touch: V } = i, o = T(() => _.isToday(s.start)), f = ie(null), b = ie([]), N = ie(!1),
|
|
1453
|
+
const s = c, i = Ne("vuecal"), { view: D, config: w, dateUtils: _, eventsManager: z, dnd: m, touch: V } = i, o = T(() => _.isToday(s.start)), f = ie(null), b = ie([]), N = ie(!1), G = (r) => {
|
|
1453
1454
|
b.value.push(r.detail), N.value = !0;
|
|
1454
1455
|
}, u = () => setTimeout(() => N.value = !1, 300), d = $e({
|
|
1455
1456
|
dragging: !1,
|
|
@@ -1628,8 +1629,8 @@ const st = (c) => {
|
|
|
1628
1629
|
d.moveX = (((W = r.touches) == null ? void 0 : W[0]) || r).clientX - $.left, d.moveY = (((A = r.touches) == null ? void 0 : A[0]) || r).clientY - $.top, d.movePercentageX = d.moveX * 100 / $.width, d.movePercentageY = d.moveY * 100 / $.height, w.eventCreateMinDrag && Math.abs(d.startY - d.moveY) > w.eventCreateMinDrag && (d.thresholdPassed = !0), (de = (ee = De.value).drag) == null || de.call(ee, { e: r, cell: x.value, cursor: Q.value });
|
|
1629
1630
|
}, y = async (r) => {
|
|
1630
1631
|
var $, S;
|
|
1631
|
-
document.removeEventListener(r.type === "touchend" ? "touchmove" : "mousemove", p, { passive: !1 }), d.dragging && ((S = ($ = De.value).dragEnd) == null || S.call($, { e: r, cell: x.value, cursor: Q.value }), V.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await
|
|
1632
|
-
},
|
|
1632
|
+
document.removeEventListener(r.type === "touchend" ? "touchmove" : "mousemove", p, { passive: !1 }), d.dragging && ((S = ($ = De.value).dragEnd) == null || S.call($, { e: r, cell: x.value, cursor: Q.value }), V.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await q(r), e.value = !1)), d.holdTimer = clearTimeout(d.holdTimer), d.holding = !1, d.dragging = !1, d.startX = 0, d.startY = 0, d.moveX = 0, d.moveY = 0, d.startPercentageX = 0, d.startPercentageY = 0, d.movePercentageX = 0, d.movePercentageY = 0, d.thresholdPassed = !1, d.schedule = null;
|
|
1633
|
+
}, q = async (r) => {
|
|
1633
1634
|
if (!E.value) return;
|
|
1634
1635
|
let { start: $, end: S, startMinutes: M, endMinutes: W } = h.value;
|
|
1635
1636
|
$ = new Date(s.start), $.setMinutes(M), S = new Date(s.start), S.setMinutes(W);
|
|
@@ -1720,7 +1721,7 @@ const st = (c) => {
|
|
|
1720
1721
|
(Y(!0), j(te, null, pe(t.value[S.id], (M) => (Y(), Se(at, {
|
|
1721
1722
|
key: M._.id,
|
|
1722
1723
|
event: M,
|
|
1723
|
-
onEventDeleted:
|
|
1724
|
+
onEventDeleted: G,
|
|
1724
1725
|
style: Te(O.value[M._.id])
|
|
1725
1726
|
}, je({ _: 2 }, [
|
|
1726
1727
|
r.$slots.event ? {
|
|
@@ -1776,7 +1777,7 @@ const st = (c) => {
|
|
|
1776
1777
|
(Y(!0), j(te, null, pe(n.value, (S) => (Y(), Se(at, {
|
|
1777
1778
|
key: S._.id,
|
|
1778
1779
|
event: S,
|
|
1779
|
-
onEventDeleted:
|
|
1780
|
+
onEventDeleted: G,
|
|
1780
1781
|
style: Te(O.value[S._.id])
|
|
1781
1782
|
}, je({ _: 2 }, [
|
|
1782
1783
|
r.$slots.event ? {
|
|
@@ -1827,8 +1828,8 @@ const st = (c) => {
|
|
|
1827
1828
|
}), o = (b) => {
|
|
1828
1829
|
var u;
|
|
1829
1830
|
if (i.isMonth || i.isYear || i.isYears) return;
|
|
1830
|
-
const N = (((u = b.touches) == null ? void 0 : u[0]) || b).clientY, { top:
|
|
1831
|
-
z.value = Je(N -
|
|
1831
|
+
const N = (((u = b.touches) == null ? void 0 : u[0]) || b).clientY, { top: G } = _.value.getBoundingClientRect();
|
|
1832
|
+
z.value = Je(N - G, _.value);
|
|
1832
1833
|
}, f = () => {
|
|
1833
1834
|
z.value = null;
|
|
1834
1835
|
};
|
|
@@ -1854,10 +1855,10 @@ const st = (c) => {
|
|
|
1854
1855
|
]),
|
|
1855
1856
|
_: 1
|
|
1856
1857
|
}),
|
|
1857
|
-
(Y(!0), j(te, null, pe(C(i).cellDates, (
|
|
1858
|
+
(Y(!0), j(te, null, pe(C(i).cellDates, (G, u) => (Y(), Se(Kt, {
|
|
1858
1859
|
key: u,
|
|
1859
|
-
start:
|
|
1860
|
-
end:
|
|
1860
|
+
start: G.start,
|
|
1861
|
+
end: G.end,
|
|
1861
1862
|
index: u
|
|
1862
1863
|
}, je({ _: 2 }, [
|
|
1863
1864
|
b.$slots.cell ? {
|
|
@@ -1922,7 +1923,7 @@ const st = (c) => {
|
|
|
1922
1923
|
"event-change"
|
|
1923
1924
|
],
|
|
1924
1925
|
setup(c, { expose: s, emit: i }) {
|
|
1925
|
-
const D = c, w = i, _ = rt("vuecal-el"), z = ht({ props: D, emit: w, attrs: ot(), vuecalEl: _, uid: it() }), { config: m, view: V, dateUtils: o, touch: f } = z, b = T(() => m.time && (V.isDay || V.isDays || V.isWeek)), N = T(() => Array(V.rows).fill().map((e, v) => o.getWeek(o.addDays(V.firstCellDate, 7 * v)))),
|
|
1926
|
+
const D = c, w = i, _ = rt("vuecal-el"), z = ht({ props: D, emit: w, attrs: ot(), vuecalEl: _, uid: it() }), { config: m, view: V, dateUtils: o, touch: f } = z, b = T(() => m.time && (V.isDay || V.isDays || V.isWeek)), N = T(() => Array(V.rows).fill().map((e, v) => o.getWeek(o.addDays(V.firstCellDate, 7 * v)))), G = T(() => {
|
|
1926
1927
|
var e;
|
|
1927
1928
|
return {
|
|
1928
1929
|
"vuecal--ready": m.ready,
|
|
@@ -1954,7 +1955,7 @@ const st = (c) => {
|
|
|
1954
1955
|
return Ze(async () => {
|
|
1955
1956
|
await Ue(), w("ready", { config: m, view: V });
|
|
1956
1957
|
}), me(() => m.locale, (e) => m.loadTexts(e)), ut("vuecal", z), s({ view: z.view }), (e, v) => (Y(), j("div", {
|
|
1957
|
-
class: ke(["vuecal",
|
|
1958
|
+
class: ke(["vuecal", G.value]),
|
|
1958
1959
|
ref: "vuecal-el",
|
|
1959
1960
|
"data-locale": e.locale,
|
|
1960
1961
|
style: Te(u.value)
|
package/dist/vue-cal.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W.vuecal={},W.Vue))})(this,function(W,e){"use strict";/**
|
|
2
|
-
* vue-cal v5.0.1-rc.
|
|
2
|
+
* vue-cal v5.0.1-rc.5
|
|
3
3
|
* (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/const ee={texts:{weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm",truncations:!0},availableViews:{day:{cols:1,rows:1},days:{cols:10,rows:1},week:{cols:7,rows:1},month:{cols:7,rows:6},year:{cols:4,rows:3},years:{cols:5,rows:5}}},Se=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],ke=["sun","mon","tue","wed","thu","fri","sat"],Ce=ke.reduce((u,s,i)=>(u[s]=i||7,u),{}),Be=(u,s,i)=>{const{dateUtils:v}=u,k=!1,b=e.computed(()=>{if(z.value[s.view])return s.view;{const r=s.datePicker?"month":"week",l=s.view||r;return z.value[l]?l:(console.warn(`Vue Cal: the provided or default view \`${l}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(z.value)[0]}\`.`),Object.keys(z.value)[0])}}),O=e.computed(()=>s.sm&&!s.xs),g=e.computed(()=>s.xs||s.datePicker),C=e.computed(()=>s.clickToNavigate||s.datePicker&&s.clickToNavigate!==!1),c=e.computed(()=>{const r={cell:{},event:{}},l=_=>_.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Object.entries(i).forEach(([_,a])=>{const[B,V,F]=_.match(/^on(Cell|Event)(.+)$/)||[];B&&(r[V.toLowerCase()][l(F).replace(/^-+|-+$/g,"")]=a)}),r}),h=e.computed(()=>{var l;const r={};return s.hideWeekends&&(r[6]=!0)&&(r[7]=!0),(l=s.hideWeekdays)!=null&&l.length&&s.hideWeekdays.forEach(_=>r[Ce[_]]=!0),r}),T=e.computed(()=>s.hideWeekends||h.value[6]&&h.value[7]),z=e.computed(()=>{const r=s.datePicker;let l=0,_={};const a=s.views;return r&&!a?{month:{...ee.availableViews.month},year:{...ee.availableViews.year},years:{...ee.availableViews.years}}:(a?(Array.isArray(a)?_=a.reduce((B,V)=>(typeof V=="string"&&ee.availableViews[V]?B[V]=ee.availableViews[V]:l++,B),{}):typeof a=="object"&&(_=Object.entries(a).reduce((B,[V,F])=>{const{cols:G,rows:Q}=ee.availableViews[V];return B[V]={cols:F.cols||G,rows:F.rows||Q},B},{})),l&&console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."),Object.keys(_).length||(console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."),_={...ee.availableViews})):_={...ee.availableViews},_)}),R=e.computed(()=>s.datePicker?"month":z.value.week?"week":Object.keys(z.value)[0]),d=e.computed(()=>{if(typeof s.selectedDate=="string")return v.stringToDate(s.selectedDate);if(s.selectedDate instanceof Date)return s.selectedDate;s.selectedDate?console.warn("Vue Cal: The provided selected date is invalid:",s.selectedDate):console.log("Vue Cal: Info - The provided selected date is undefined.")}),m=e.computed(()=>{if(!s.disableDays)return[];const r=[];return Array.isArray(s.disableDays)?s.disableDays.forEach(l=>{let _=l;if(typeof l=="string"?_=v.stringToDate(l):l instanceof Date&&(l=v.formatDate(l,"YYYY-MM-DD")),_ instanceof Date&&!isNaN(_.getTime())){r.push(l);return}else console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:",l)}):console.warn("Vue Cal: The provided `disableDays` prop is invalid:",s.disableDays),r}),t=e.computed(()=>{let r=null;return s.minDate&&typeof s.minDate=="string"?r=v.stringToDate(s.minDate):s.minDate&&s.minDate instanceof Date&&(r=s.minDate),(r==null?void 0:r.getTime())||null}),f=e.computed(()=>{let r=null;return s.maxDate&&typeof s.maxDate=="string"?r=v.stringToDate(s.maxDate):s.maxDate&&s.maxDate instanceof Date&&(r=s.maxDate),(r==null?void 0:r.getTime())||null}),p=e.computed(()=>{var _;const{view:r}=u;return s.schedules.length&&(r.isDay||r.isDays||r.isWeek)&&((_=s.schedules)==null?void 0:_.map((a,B)=>({...a,id:a.id??B+1})))||void 0}),E=e.computed(()=>{const r={drag:!0,resize:!0,delete:!0,create:!0};return s.editableEvents===!0?r:s.editableEvents===!1?Object.keys(r).map(l=>r[l]=!1):{...r,...s.editableEvents}}),P=async r=>{var _;let l=Object.assign({"../i18n/ar.json":()=>import("./i18n/ar.json").then(a=>a.default),"../i18n/bg.json":()=>import("./i18n/bg.json").then(a=>a.default),"../i18n/bn.json":()=>import("./i18n/bn.json").then(a=>a.default),"../i18n/bs.json":()=>import("./i18n/bs.json").then(a=>a.default),"../i18n/ca.json":()=>import("./i18n/ca.json").then(a=>a.default),"../i18n/cs.json":()=>import("./i18n/cs.json").then(a=>a.default),"../i18n/da.json":()=>import("./i18n/da.json").then(a=>a.default),"../i18n/de.json":()=>import("./i18n/de.json").then(a=>a.default),"../i18n/el.json":()=>import("./i18n/el.json").then(a=>a.default),"../i18n/en-gb.json":()=>import("./i18n/en-gb.json").then(a=>a.default),"../i18n/en-us.json":()=>import("./i18n/en-us.json").then(a=>a.default),"../i18n/es.json":()=>import("./i18n/es.json").then(a=>a.default),"../i18n/et.json":()=>import("./i18n/et.json").then(a=>a.default),"../i18n/fa.json":()=>import("./i18n/fa.json").then(a=>a.default),"../i18n/fi.json":()=>import("./i18n/fi.json").then(a=>a.default),"../i18n/fr.json":()=>import("./i18n/fr.json").then(a=>a.default),"../i18n/he.json":()=>import("./i18n/he.json").then(a=>a.default),"../i18n/hr.json":()=>import("./i18n/hr.json").then(a=>a.default),"../i18n/hu.json":()=>import("./i18n/hu.json").then(a=>a.default),"../i18n/id.json":()=>import("./i18n/id.json").then(a=>a.default),"../i18n/is.json":()=>import("./i18n/is.json").then(a=>a.default),"../i18n/it.json":()=>import("./i18n/it.json").then(a=>a.default),"../i18n/ja.json":()=>import("./i18n/ja.json").then(a=>a.default),"../i18n/ka.json":()=>import("./i18n/ka.json").then(a=>a.default),"../i18n/ko.json":()=>import("./i18n/ko.json").then(a=>a.default),"../i18n/lt.json":()=>import("./i18n/lt.json").then(a=>a.default),"../i18n/mn.json":()=>import("./i18n/mn.json").then(a=>a.default),"../i18n/nl.json":()=>import("./i18n/nl.json").then(a=>a.default),"../i18n/no.json":()=>import("./i18n/no.json").then(a=>a.default),"../i18n/pl.json":()=>import("./i18n/pl.json").then(a=>a.default),"../i18n/pt-br.json":()=>import("./i18n/pt-br.json").then(a=>a.default),"../i18n/pt-pt.json":()=>import("./i18n/pt-pt.json").then(a=>a.default),"../i18n/ro.json":()=>import("./i18n/ro.json").then(a=>a.default),"../i18n/ru.json":()=>import("./i18n/ru.json").then(a=>a.default),"../i18n/sk.json":()=>import("./i18n/sk.json").then(a=>a.default),"../i18n/sl.json":()=>import("./i18n/sl.json").then(a=>a.default),"../i18n/sq.json":()=>import("./i18n/sq.json").then(a=>a.default),"../i18n/sr.json":()=>import("./i18n/sr.json").then(a=>a.default),"../i18n/sv.json":()=>import("./i18n/sv.json").then(a=>a.default),"../i18n/tr.json":()=>import("./i18n/tr.json").then(a=>a.default),"../i18n/uk.json":()=>import("./i18n/uk.json").then(a=>a.default),"../i18n/vi.json":()=>import("./i18n/vi.json").then(a=>a.default),"../i18n/zh-cn.json":()=>import("./i18n/zh-cn.json").then(a=>a.default),"../i18n/zh-hk.json":()=>import("./i18n/zh-hk.json").then(a=>a.default)});{if(!l[`../i18n/${r}.json`]){console.warn(`Vue Cal: the locale \`${r}\` does not exist. Falling back to \`en-us\`.`),r="en-us";return}l=await((_=l[`../i18n/${r}.json`])==null?void 0:_.call(l))}u.texts=Object.assign(u.texts,Object.assign({...ee.texts},l)),v.updateTexts(u.texts)};let j=e.reactive(s.events||[]);return e.watch(()=>s.events,r=>j.splice(0,j.length,...r)),(s.locale||!u.texts.today)&&P(s.locale||"en-us"),{...e.toRefs(s),events:j,eventListeners:c,defaultView:R,availableViews:z,disableDays:m,ready:k,sm:O,xs:g,clickToNavigate:C,hideWeekdays:h,hideWeekends:T,minTimestamp:t,maxTimestamp:f,schedules:p,selectedDate:d,editableEvents:E,view:b,get hasHiddenDays(){return Object.keys(h.value).length},get size(){return g.value?"xs":O.value?"sm":"lg"},loadTexts:P}},me=(u,s)=>{const i=s.timeTo-s.timeFrom;return(u-s.timeFrom)*100/i},fe=(u,s)=>{const i=s.timeTo-s.timeFrom;return~~(u*i/100+s.timeFrom)},be=(u,s)=>{const i=s.clientHeight;return u*100/i},we=e.reactive({id:null,date:null});let Me=!1,Te=!0;const le=e.reactive({el:null,cell:null,timeout:null}),oe=e.reactive({eventId:null,fromVueCal:null,toVueCal:null});function Ve(u){const{config:s,view:i,eventsManager:v,emit:k,uid:b,dateUtils:O}=u,g=t=>{var l;const{timeStep:f,timeCellHeight:p,timeFrom:E}=s,P=(((l=t.touches)==null?void 0:l[0])||t).clientY,{top:j}=t.currentTarget.getBoundingClientRect(),r=P-j-~~t.dataTransfer.getData("cursor-grab-at");return fe(be(r,t.currentTarget),s)},C=(t,f,p)=>{const E=f.duration||c(f.start,f.end)||s.timeStep;let P=Math.max(g(t),0);if(s.snapToInterval){const _=P+s.snapToInterval/2;P=_-_%s.snapToInterval}const j=new Date(new Date(p).setMinutes(P)),r=Math.min(P+E,24*60),l=new Date(new Date(p).setMinutes(r));return{start:j,end:l}},c=(t,f)=>Math.round((f-t)/6e4);return{eventDragStart:(t,f)=>{if(t.target.nodeType===3||u.touch.isResizingEvent)return t.preventDefault();t.dataTransfer.dropEffect="move";const p={...f,_:{id:f._.id,duration:c(f.start,f.end)}};t.dataTransfer.setData("event",JSON.stringify(p)),t.dataTransfer.setData("cursor-grab-at",t.offsetY),oe.eventId=f._.id,oe.fromVueCal=b;const E=t.target.closest(".vuecal__event");E.classList.add("vuecal__event--dragging-ghost"),setTimeout(()=>{E.classList.add("vuecal__event--dragging-original"),E.classList.remove("vuecal__event--dragging-ghost")},0),Me=!1,Object.assign(we,{id:i.id,date:i.firstCellDate}),Te=!0,u.touch.isDraggingEvent=!0},eventDragEnd:(t,f)=>{oe.eventId=null,t.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");const{fromVueCal:p,toVueCal:E}=oe;E&&p!==E&&v.deleteEvent(f._.id,3),oe.fromVueCal=null,oe.toVueCal=null,Me&&Te&&we.id&&i.switchView(we.id,we.date,!0),u.touch.isDraggingEvent=!1},cellDragEnter:(t,f)=>{const{start:p}=f,E=t.currentTarget;if(!t.currentTarget.contains(t.relatedTarget)){if(E===le.el||!E.className.includes("vuecal__cell-content"))return!1;le.el&&(le.cell.highlighted=!1),Object.assign(le,{el:E,cell:f,timeout:clearTimeout(le.timeout)}),f.highlighted=!0,["years","year","month"].includes(i.id)&&(le.timeout=setTimeout(()=>u.switchToNarrowerView(p),2e3))}},cellDragOver:(t,f)=>{const{start:p,schedule:E}=f;t.preventDefault(),f.highlighted=!0,(E||E===0)&&(f.highlightedSchedule=E)},cellDragLeave:(t,f)=>{t.preventDefault(),!t.currentTarget.contains(t.relatedTarget)&&(f.highlightedSchedule=!1,le.cell===f&&(clearTimeout(le.timeout),Object.assign(le,{el:null,cell:null,timeout:null}),f.highlighted=!1))},cellDragDrop:async(t,f)=>{var B,V,F;t.preventDefault(),clearTimeout(le.timeout),Object.assign(le,{el:null,cell:null,timeout:null});const p=JSON.parse(t.dataTransfer.getData("event")||"{}");p.start&&(p.start=new Date(p.start)),p.end&&(p.end=new Date(p.end));let E;const{start:P,end:j}=C(t,p,f.start),{schedule:r}=((B=t.target.closest("[data-schedule]"))==null?void 0:B.dataset)||{};let l=()=>{};oe.fromVueCal===b?(E=v.getEvent(p._.id),E&&(E._.dragging=!1,l=()=>{E.start=P,E.end=j,r!==void 0&&(E.schedule=~~r)})):(E={...p,start:P,end:j,...r!==void 0&&{schedule:~~r},_:{id:((V=p._)==null?void 0:V.id)||p.id,duration:c(P,j)},getOverlappingEvents:()=>v.getEventsInRange(v.getEventsByDate(O.formatDate(P),!0),{start:P,end:j},{schedule:~~r})},l=()=>{E=v.createEvent(E)});let _=!0;const{drop:a}=(F=s.eventListeners)==null?void 0:F.event;a&&(_=await a({e:t,event:{...E,start:P,end:j,schedule:~~r},overlaps:E.getOverlappingEvents({start:P,end:j,schedule:~~r}),cell:f,external:oe.fromVueCal!==b})),_!==!1&&l(),f.highlighted=!1,f.highlightedSchedule=null,Te=!1,oe.toVueCal=b,k("event-dropped",{event:E,originalEvent:p,external:oe.fromVueCal!==b}),k("event-change",{event:E,originalEvent:p})}}}const $e=u=>{let s,i,v,k={},b={};const O=e.ref(u),g=()=>{Date.prototype.addDays=function(n){return T(this,n||0)},Date.prototype.subtractDays=function(n){return z(this,n||0)},Date.prototype.addHours=function(n){return R(this,n||0)},Date.prototype.subtractHours=function(n){return d(this,n||0)},Date.prototype.addMinutes=function(n){return m(this,n||0)},Date.prototype.subtractMinutes=function(n){return t(this,n||0)},Date.prototype.getWeek=function(){return p(this)},Date.prototype.isToday=function(){return E(this)},Date.prototype.isLeapYear=function(){return r(this)},Date.prototype.format=function(n="YYYY-MM-DD"){return G(this,n)},Date.prototype.formatTime=function(n="HH:mm"){return J(this,n)}},C=()=>{delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime},c=n=>O.value=n,h=()=>(i!==new Date().getDate()&&(s=new Date,i=s.getDate(),v=`${s.getFullYear()}-${s.getMonth()}-${s.getDate()}`),v),T=(n,w)=>{const D=new Date(n.valueOf());return D.setDate(D.getDate()+w),D},z=(n,w)=>{const D=new Date(n.valueOf());return D.setDate(D.getDate()-w),D},R=(n,w)=>{const D=new Date(n.valueOf());return D.setHours(D.getHours()+w),D},d=(n,w)=>{const D=new Date(n.valueOf());return D.setHours(D.getHours()-w),D},m=(n,w)=>{const D=new Date(n.valueOf());return D.setMinutes(D.getMinutes()+w),D},t=(n,w)=>{const D=new Date(n.valueOf());return D.setMinutes(D.getMinutes()-w),D},f=(n,w)=>{const D=I=>{const X=I%w;return X!==0&&(I+=X>=w/2?w-X:-X),I};if(typeof n=="number")return D(n);if(n instanceof Date){let I=D(n.getMinutes());I>=60&&(n.setHours(n.getHours()+1),I=0),n.setMinutes(I,0,0)}},p=(n,w=!1)=>{const D=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())),I=D.getUTCDay()||7;D.setUTCDate(D.getUTCDate()+4-I);const X=new Date(Date.UTC(D.getUTCFullYear(),0,1));return Math.ceil(((D-X)/864e5+1)/7)+(w?1:0)},E=n=>`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`===h(),P=(n,w)=>{if(!n||!w)return console.warn(`Vue Cal: missing date${n?"2":"1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);if(F(n)){if(!F(w))return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${w}\`.`)}else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${n}\`.`);return n.getFullYear()===w.getFullYear()&&n.getMonth()===w.getMonth()&&n.getDate()===w.getDate()},j=(n,w,D)=>F(n)?n.getTime()>=w&&n.getTime()<=D:console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${n}\`.`),r=n=>{const w=n.getFullYear();return!(w%400)||w%100&&!(w%4)},l=(n=null,w)=>{const D=n&&new Date(n.valueOf())||new Date,I=w?7:6;return D.setDate(D.getDate()-(D.getDay()+I)%7),D},_=n=>n instanceof Date?n:(n.length===10&&(n+=" 00:00"),new Date(n.replace(/-/g,"/"))),a=n=>n.getHours()*60+n.getMinutes(),B=(n,w)=>{typeof n=="string"&&(n=n.replace(/-/g,"/")),typeof w=="string"&&(w=w.replace(/-/g,"/")),n=new Date(n).setHours(0,0,0,0),w=new Date(w).setHours(0,0,1,0);const D=(new Date(w).getTimezoneOffset()-new Date(n).getTimezoneOffset())*60*1e3;return Math.ceil((w-n-D)/(24*3600*1e3))},V=(n,w,D)=>Math.abs(n.getTime()-w.getTime())<=D*60*1e3,F=n=>n&&n instanceof Date&&!isNaN(n),G=(n,w="YYYY-MM-DD",D=null)=>{if(D||(D=O.value),w||(w="YYYY-MM-DD"),w==="YYYY-MM-DD")return Q(n);k={},b={};const I={YYYY:()=>U(n,D).YYYY,YY:()=>U(n,D).YY(),M:()=>U(n,D).M,MM:()=>U(n,D).MM(),MMM:()=>U(n,D).MMM(),MMMM:()=>U(n,D).MMMM(),MMMMG:()=>U(n,D).MMMMG(),D:()=>U(n,D).D,DD:()=>U(n,D).DD(),S:()=>U(n,D).S(),d:()=>U(n,D).d,dd:()=>U(n,D).dd(),ddd:()=>U(n,D).ddd(),dddd:()=>U(n,D).dddd(),HH:()=>x(n,D).HH,H:()=>x(n,D).H,hh:()=>x(n,D).hh,h:()=>x(n,D).h,am:()=>x(n,D).am,AM:()=>x(n,D).AM,mm:()=>x(n,D).mm,m:()=>x(n,D).m,s:()=>x(n,D).s};return w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(X,te)=>{const o=I[te.replace(/\{|\}/g,"")];return o!==void 0?o():te})},Q=n=>{const w=n.getMonth()+1,D=n.getDate();return`${n.getFullYear()}-${w<10?"0":""}${w}-${D<10?"0":""}${D}`},J=(n,w="HH:mm",D=null,I=!1)=>{let X=!1;if(I){const[M,S,$]=[n.getHours(),n.getMinutes(),n.getSeconds()];M+S+$===141&&(X=!0)}if(n instanceof Date&&w==="HH:mm")return X?"24:00":K(n);b={},D||(D=O.value);const te=x(n,D),o=w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(M,S)=>{const $=te[S.replace(/\{|\}/g,"")];return $!==void 0?$:S});return X?o.replace("23:59","24:00"):o},K=n=>{const w=n.getHours(),D=n.getMinutes();return`${(w<10?"0":"")+w}:${(D<10?"0":"")+D}`},re=n=>{const w=Math.floor(n/60).toString().padStart(2,0),D=(n%60).toString().padStart(2,0);return`${w}:${D}`},q=n=>{if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},U=(n,w)=>{if(k.D)return k;const D=n.getFullYear(),I=n.getMonth()+1,X=n.getDate(),o=(n.getDay()-1+7)%7;return k={YYYY:D,YY:()=>D.toString().substring(2),M:I,MM:()=>I.toString().padStart(2,0),MMM:()=>w.months[I-1].substring(0,3),MMMM:()=>w.months[I-1],MMMMG:()=>(w.monthsGenitive||w.months)[I-1],D:X,DD:()=>X.toString().padStart(2,0),S:()=>q(X),d:o+1,dd:()=>w.weekDaysShort.length?w.weekDaysShort[o]:w.weekDays[o][0],ddd:()=>w.weekDaysShort.length?w.weekDaysShort[o]:w.weekDays[o].substr(0,3),dddd:()=>w.weekDays[o]},k},x=(n,w)=>{if(b.am)return b;let D,I,X;n instanceof Date?(D=n.getHours(),I=n.getMinutes(),X=n.getSeconds()):(D=Math.floor(n/60),I=Math.floor(n%60));const te=D%12?D%12:12,o=(w||{am:"am",pm:"pm"})[D===24||D<12?"am":"pm"];return b={H:D,h:te,HH:D.toString().padStart(2,0),hh:te.toString().padStart(2,0),am:o,AM:o.toUpperCase(),m:I,mm:I.toString().padStart(2,0),s:X},b};return{addDatePrototypes:g,removeDatePrototypes:C,updateTexts:c,addDays:T,subtractDays:z,addHours:R,subtractHours:d,addMinutes:m,subtractMinutes:t,snapToInterval:f,getWeek:p,isToday:E,isSameDate:P,isInRange:j,isLeapYear:r,getPreviousFirstDayOfWeek:l,stringToDate:_,dateToMinutes:a,countDays:B,datesInSameTimeStep:V,isValid:F,formatDate:G,formatDateLite:Q,formatTime:J,formatTimeLite:K,formatMinutes:re}},Ye=u=>{const{dateUtils:s,config:i}=u;let v=0;const k=e.computed(()=>{const d={byDate:{},recurring:[],multiday:[],byId:{}};return i.events.sort((t,f)=>t.start-f.start<0?-1:1).forEach(t=>{b(t),t._||(t._={}),t._.id=t._.id||++v,t.delete||(t.delete=f=>h(t._.id,f)),t._.deleting=!1,t._.deleted=!1,t.isOverlapping=(f=null)=>t.getOverlappingEvents(f).length,t.getOverlappingEvents=(f=null)=>{var p;return z(g(s.formatDate((f==null?void 0:f.start)||t.start),!0),{start:(f==null?void 0:f.start)||t.start,end:(f==null?void 0:f.end)||t.end},{excludeIds:[t._.id],schedule:(p=i.schedules)!=null&&p.length?~~((f==null?void 0:f.schedule)||t.schedule):null})},t._.register=f=>{t._.$el=f,t._.fireCreated&&(u.emit("event-created",t),delete t._.fireCreated)},t._.unregister=()=>{t._.$el=null,t._.register=null,t.isOverlapping=null,t.getOverlappingEvents=null,t.delete=null},d.byId[t._.id]=t,t.recurring?d.recurring.push(t._.id):t._.multiday?(d.multiday.push(t._.id),d.byDate[t._.startFormatted]||(d.byDate[t._.startFormatted]=[]),d.byDate[t._.startFormatted].push(t._.id)):(d.byDate[t._.startFormatted]||(d.byDate[t._.startFormatted]=[]),d.byDate[t._.startFormatted].push(t._.id))}),d}),b=d=>{if(typeof d.start=="string"&&(d.start=s.stringToDate(d.start)),typeof d.end=="string"&&(d.end=s.stringToDate(d.end)),d.start.setSeconds(0,0),d.end.setSeconds(0,0),isNaN(d.start)||isNaN(d.end)){isNaN(d.start)?console.error(`Vue Cal: invalid start date for event "${d.title}".`,d.start):console.error(`Vue Cal: invalid end date for event "${d.title}".`,d.end);return}else d.end.getTime()<d.start.getTime()&&console.error(`Vue Cal: invalid event dates for event "${d.title}". The event ends before it starts.`,d.start,d.end);d._||(d._={}),d._.multiday=!s.isSameDate(d.start,new Date(d.end.getTime()-1)),d._.startFormatted=s.formatDate(d.start),d._.startMinutes=~~s.dateToMinutes(d.start),d._.endMinutes=~~s.dateToMinutes(d.end);const m=d.start.getHours(),t=d.start.getMinutes().toString().padStart(2,0),f=d.end.getHours(),p=d.end.getMinutes().toString().padStart(2,0);d._.startTimeFormatted24=`${m.toString().padStart(2,0)}:${t}`,d._.startTimeFormatted12=`${m%12||12}${t?`:${t}`:""} ${m<12?"AM":"PM"}`,d._.endTimeFormatted24=`${f.toString().padStart(2,0)}:${p}`,d._.endTimeFormatted12=`${f%12||12}${p?`:${p}`:""} ${f<12?"AM":"PM"}`,d._.duration=Math.abs(~~((d.end-d.start)/6e4))},O=d=>k.value.byId[d],g=(d,m=!1,t=!1)=>{let f=k.value.byDate[d]||[];return f=m||t?f.map(O):f,t||(f=f.filter(p=>!p.background),m||(f=f.map(p=>p._.id))),f},C=d=>{const m={};return d.forEach(({startFormatted:t})=>{m[t]=[];const f=g(t,!1,!0);f.length&&m[t].push(...f)}),m},c=d=>{if(!d.start||!d.end){console.error("Vue Cal: Cannot create an event without valid start and end dates.");return}return i.snapToInterval&&(s.snapToInterval(d.start,i.snapToInterval),s.snapToInterval(d.end,i.snapToInterval)),d={...d},d._||(d._={}),d._.id=++v,d._.fireCreated=!0,i.events.push(d),d},h=(d,m=0)=>{var p;if(!i.editableEvents.delete)return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");if(!d)return console.warn("Vue Cal: Cannot delete event without its ID.");const t=i.events.findIndex(E=>E._.id===d);if(t===-1)return console.warn(`Vue Cal: Cannot delete unknown event \`${d}\`.`);const f=i.events[t];if(f.deletable===!1)return console.warn(`Vue Cal: Can't delete event \`${d}\` since it was explicitely set to \`delete: false\`.`);switch(m){case 0:f._.deleting?i.events.splice(t,1):f._.deleting=!0;break;case 1:f._.deleting=!0;break;case 2:f._.deleted=!0,i.events[t]._.deleted=!0,(p=f._.$el)==null||p.dispatchEvent(new CustomEvent("event-deleted",{detail:f._.id}));break;case 3:i.events.splice(t,1),u.emit("update:events",i.events),u.emit("event-delete",f);break}return!0},T=d=>{const m=g(d,!0);if(!m.length)return{cellOverlaps:{},longestStreak:0};let t={},f=[],p=0;m.sort((E,P)=>E.start-P.start||E.end-E.start-(P.end-P.start));for(const E of m){const P=E._.id;t[P]||(t[P]={overlaps:new Set,maxConcurrent:1,position:0}),f=f.filter(a=>a.end>E.start);let j=f.filter(a=>{var V;return(!((V=i.schedules)!=null&&V.length)||E.schedule===a.schedule)&&a.start<E.end}),r=new Set(j.map(a=>{var B;return((B=t[a._.id])==null?void 0:B.position)??0})),l=0;for(;r.has(l);)l++;t[P].position=l,f.push(E);let _=Math.max(1,...j.map(a=>{var B;return((B=t[a._.id])==null?void 0:B.maxConcurrent)??1}));t[P].maxConcurrent=Math.max(j.length+1,_);for(const a of j)t[a._.id].overlaps.add(P),t[P].overlaps.add(a._.id),t[a._.id].maxConcurrent=t[P].maxConcurrent;p=Math.max(p,t[P].maxConcurrent)}for(const E in t)t[E].overlaps=[...t[E].overlaps];return{cellOverlaps:t,longestStreak:p}},z=(d=[],{start:m,end:t},{excludeIds:f=[],schedule:p=null})=>{var j;const E=new Set(f),P=[];for(const r of d)!E.has((j=r._)==null?void 0:j.id)&&(p===null||p===r.schedule)&&R(r,m,t)&&P.push(r);return P},R=(d,m,t)=>{const f=d.allDay||!i.time,p=f?new Date(d.start).setHours(0,0,0,0):d.start.getTime(),E=f?new Date(d.end).setHours(23,59,59,999):d.end.getTime(),P=f?new Date(m).setHours(0,0,0,0):m.getTime(),j=f?new Date(t).setHours(23,59,59,999):t.getTime();return E>P&&p<j};return{events:k,getEvent:O,getEventsByDate:g,getViewEvents:C,getCellOverlappingEvents:T,getEventsInRange:z,createEvent:c,deleteEvent:h,isEventInRange:R}},Pe=({config:u,dateUtils:s,emit:i,texts:v,eventsManager:k},b)=>{const{availableViews:O}=u,g=e.ref(u.view&&O[u.view]?u.view:u.defaultView),C=e.ref(u.selectedDate||null);let c=e.ref(new Date);const h=e.ref(new Date(u.viewDate||c.value));h.value.setHours(0,0,0,0);const T=e.ref(new Date(h));let z=null;const R=e.computed(()=>g.value==="month"?T.value:l.value),d=e.computed(()=>g.value==="month"?new Date(T.value.getFullYear(),T.value.getMonth()+1,0,23,59,59,999):a.value),m=e.computed(()=>g.value==="week"?s.getPreviousFirstDayOfWeek(l.value,u.startWeekOnSunday):g.value==="month"?l.value:R.value),t=e.computed(()=>{if(g.value==="week"){const y=s.addDays(m.value,7);return y.setMilliseconds(-1),y}else if(g.value==="month")return a.value;return d.value}),f=e.computed(()=>{const y=c.value.getTime();if(g.value==="week")return m.value.getTime()<=y&&y<=t.value.getTime();const Y=l.value.getTime(),H=a.value.getTime();return Y<=y&&y<=H});function p(){c.value=new Date,z=setTimeout(p,60*1e3)}function E(){z=setTimeout(p,(60-new Date().getSeconds())*1e3),p()}const P=e.computed(()=>{if(!u.availableViews[g.value])return 1;let y=u.availableViews[g.value].cols;return u.hasHiddenDays&&["week","month"].includes(g.value)&&(y-=u.hasHiddenDays),y}),j=e.computed(()=>{var y;return((y=u.availableViews[g.value])==null?void 0:y.rows)||1}),r=e.computed(()=>P.value*j.value),l=e.computed(()=>{if(g.value==="month"){let y=T.value.getDay()||7;return u.startWeekOnSunday&&!u.hideWeekdays[7]&&(y+=1),u.viewDayOffset&&(y-=u.viewDayOffset),s.subtractDays(T.value,y-1)}else if(g.value==="week"){const y="1234567".split("").filter(H=>!Object.keys(u.hideWeekdays).includes(H));let Y=Math.min(...y);return u.startWeekOnSunday&&!u.hideWeekdays[7]&&(Y=1),u.viewDayOffset&&(Y+=u.viewDayOffset),s.addDays(T.value,Y-1)}else return T.value}),_=e.computed(()=>{const y=[],Y=["days","week","month"].includes(g.value);let H=0;for(let A=0;A<r.value+H;A++)switch(g.value){case"day":case"days":case"week":case"month":{const ne=s.addDays(l.value,A),ve=ne.getDay()||7;if(Y&&u.hasHiddenDays&&u.hideWeekdays[ve]){H++;continue}const ge=new Date(ne);ge.setHours(23,59,59,999),y.push({start:ne,startFormatted:s.formatDate(ne),end:ge});break}case"year":y.push({start:new Date(l.value.getFullYear(),A,1,0,0,0,0),end:new Date(l.value.getFullYear(),A+1,0,23,59,59,999)});break;case"years":y.push({start:new Date(l.value.getFullYear()+A,0,1,0,0,0,0),end:new Date(l.value.getFullYear()+A+1,0,0,23,59,59,999)});break}return y}),a=e.computed(()=>_.value[_.value.length-1].end),B=e.ref("right"),V=e.computed(()=>{const y=Object.keys(u.availableViews);return y[y.indexOf(g.value)+1]}),F=e.computed(()=>{const y=Object.keys(u.availableViews);return y[y.indexOf(g.value)-1]});function G(y,Y,H=!1){if(!Y||!Y[y])return y+1;const A=Y[y];return H&&typeof A=="string"?A.substring(0,3):A}function Q(y,Y,H){const{monthsArray:A,monthBeforeDay:ne,canTruncate:ve,xs:ge}=H,ce=y.getMonth(),de=y.getFullYear(),ue=Y.getMonth(),ye=Y.getFullYear(),_e=ce!==ue,Zt=de!==ye,ie=ve&&(ge||_e),pe=y.getDate(),De=Y.getDate();return Zt?ne?`${G(ce,A,ie)} ${pe}, ${de} - ${G(ue,A,ie)} ${De}, ${ye}`:`${pe} ${G(ce,A,ie)} ${de} - ${De} ${G(ue,A,ie)} ${ye}`:_e?ne?`${G(ce,A,ie)} ${pe} - ${G(ue,A,ie)} ${De}, ${de}`:`${pe} ${G(ce,A,ie)} - ${De} ${G(ue,A,ie)} ${de}`:ne?`${G(ce,A,ie)} ${pe}-${De}, ${de}`:`${pe}-${De} ${G(ce,A,ie)} ${de}`}const J=e.computed(()=>{const{dateFormat:y,months:Y,monthsGenitive:H,week:A,truncations:ne}=v,ve=u.locale,ge=ne!==!1,ce=y.indexOf("M")<y.indexOf("D"),de=H&&ve==="el"?H:Y;switch(g.value){case"day":return s.formatDate(l.value,y);case"days":case"week":{const ue={monthsArray:de,monthBeforeDay:ce,canTruncate:ge,xs:u.xs};let ye=Q(l.value,a.value,ue);if(g.value==="week"){const _e=s.getWeek(l.value,u.startWeekOnSunday&&!u.hideWeekdays[7]);ye+=` <small>${A} ${_e}</small>`}return ye}case"month":{const ue=`${u.xs&&ge?"MMM":"MMMM"} YYYY`;return s.formatDate(R.value,ue)}case"year":return l.value.getFullYear();case"years":return`${l.value.getFullYear()} - ${d.value.getFullYear()}`}});function K(){switch(T.value=new Date(h.value||c.value),T.value.setHours(0,0,0,0),g.value){case"day":break;case"days":break;case"week":T.value=s.getPreviousFirstDayOfWeek(T.value,u.startWeekOnSunday&&!u.hideWeekdays[7]);break;case"month":T.value=new Date(T.value.getFullYear(),T.value.getMonth(),1,0,0,0,0);break;case"year":T.value=new Date(T.value.getFullYear(),0,1,0,0,0,0);break;case"years":T.value=new Date(T.value.getFullYear()-T.value.getFullYear()%r.value,0,1,0,0,0,0);break}i("view-change",{id:g.value,title:J.value,start:R.value,end:d.value,extendedStart:m.value,extendedEnd:t.value,cellDates:_.value,containsToday:f.value,events:Z.value}),c.value=new Date}function re(y){const Y=g.value,H=u.availableViews[Y];y[Y]&&JSON.stringify(y[Y])===JSON.stringify(H)||K()}function q(y,Y=!0){const H=Object.keys(u.availableViews);g.value!==y&&(H.includes(y)?(B.value=H.indexOf(y)<H.indexOf(g.value)?"left":"right",g.value=y,i("update:view",y),K()):console.warn(`Vue Cal: the \`${y}\` view is not available.`))}function U(){V.value?q(V.value):console.warn("Vue Cal: no broader view is available.")}function x(){F.value?q(F.value):console.warn("Vue Cal: no narrower view is available.")}function n(){D(!1)}function w(){D(!0)}function D(y=!0){let Y=new Date(h.value);switch(g.value){case"day":case"days":y?Y=s.addDays(a.value,1):Y=s.subtractDays(l.value,r.value);break;case"week":{y?(Y=s.addDays(t.value,1),Y.setHours(0,0,0,0)):Y=s.subtractDays(m.value,r.value);break}case"month":{const H=y?1:-1;Y=new Date(Y.getFullYear(),Y.getMonth()+H,1,0,0,0,0);break}case"year":{const H=y?1:-1;Y=new Date(Y.getFullYear()+H,1,1,0,0,0,0);break}case"years":{const H=y?r.value:-r.value;Y=new Date(Y.getFullYear()+H,1,1,0,0,0,0);break}}X(Y)}function I(){const y=new Date;y.setHours(0,0,0,0),X(y)}function X(y,Y=!0,H=!1){if(!s.isValid(y))return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");let[A,ne]=[l.value,a.value];g.value==="month"&&([A,ne]=[R.value,d.value]),(!s.isInRange(y,A,ne)||H)&&(y.setHours(0,0,0,0),B.value=y.getTime()<A.getTime()?"left":"right",h.value=y,Y&&i("update:viewDate",y),K())}function te(y,Y=!0){if(s.isValid(y)){const{isValid:H,isSameDate:A}=s;(!C.value||!H(C.value)||!A(y,C.value))&&(y.setHours(0,0,0,0),C.value=y,Y&&i("update:selectedDate",y))}else return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.")}function o(y){!y&&!T.value.getDay()?X(s.addDays(T.value,1),!0,!0):(B.value="left",K())}function M(y){y&&u.startWeekOnSunday&&!T.value.getDay()?X(s.addDays(T.value,1),!0,!0):!y&&u.startWeekOnSunday&&T.value.getDay()===1&&X(s.subtractDays(T.value,1),!0,!0)}function S(){console.log("toggling weekdays",u.hideWeekdays)}function $(y){const Y=b.value.querySelector(".vuecal__scrollable"),H=y?y*u.timeCellHeight/u.timeStep:0;Y==null||Y.scrollTo({top:H,behavior:"smooth"})}function N(){const y=new Date;$(y.getHours()*60+y.getMinutes())}function L(){$(0)}const Z=e.computed(()=>k.getViewEvents(_.value)),ae=k.createEvent,se=k.deleteEvent;return e.watch(()=>u.view,y=>q(y,!1)),e.watch(()=>u.availableViews,re),e.watch(()=>u.datePicker,()=>q("month",!1)),e.watch(()=>u.viewDate,y=>X(y,!1)),e.watch(()=>u.selectedDate,y=>te(y,!1)),e.watch(()=>u.startWeekOnSunday,y=>o(y)),e.watch(()=>u.hideWeekends,y=>M(y)),e.watch(()=>u.hideWeekdays,S),e.watch(()=>r.value,()=>{r.value>90&&console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.")}),e.watch(()=>u.watchRealTime,y=>{y&&u.time?E():z=clearTimeout(z)}),K(),u.time&&u.watchRealTime&&E(),e.onBeforeUnmount(()=>z=clearTimeout(z)),{now:c,id:g,broaderView:V,narrowerView:F,title:J,viewDate:h,start:R,end:d,extendedStart:m,extendedEnd:t,firstCellDate:l,lastCellDate:a,containsToday:f,selectedDate:C,cellDates:_,cols:P,rows:j,events:Z,transitionDirection:B,switch:q,broader:U,narrower:x,previous:n,next:w,navigate:D,goToToday:I,updateViewDate:X,updateSelectedDate:te,scrollToCurrentTime:N,scrollToTime:$,scrollTop:L,createEvent:ae,deleteEvent:se,get isDay(){return g.value==="day"},get isDays(){return g.value==="days"},get isWeek(){return g.value==="week"},get isMonth(){return g.value==="month"},get isYear(){return g.value==="year"},get isYears(){return g.value==="years"}}},he=e.reactive({texts:{...ee.texts},dateUtils:$e(ee.texts)}),Oe=({props:u,emit:s,attrs:i,vuecalEl:v,uid:k})=>{const b=e.reactive({uid:k,emit:s,texts:{...he.texts},dateUtils:{...he.dateUtils},now:new Date,config:{},eventsManager:{},view:{},dnd:{},touch:{isDraggingCell:!1,isDraggingEvent:!1,isResizingEvent:!1}});return b.dateUtils=$e(Object.assign(ee.texts,b.texts)),b.config=Be(b,u,i),b.eventsManager=Ye(b),b.view=Pe(b,v),b.dnd=Ve(b),b},ze=24*60,Ne={allDayEvents:{type:[Boolean,String],default:!1},clickToNavigate:{type:Boolean,default:void 0},dark:{type:Boolean,default:!1},datePicker:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},editableEvents:{type:[Boolean,Object],default:!1},eventCreateMinDrag:{type:Number,default:15},events:{type:Array,default:()=>[]},eventCount:{type:Boolean,default:!1},eventsOnMonthView:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:String,default:""},maxDate:{type:[String,Date],default:""},minDate:{type:[String,Date],default:""},selectedDate:{type:[String,Date],default:""},sm:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},schedules:{type:Array,default:()=>[]},snapToInterval:{type:Number,default:0},startWeekOnSunday:{type:Boolean,default:!1},theme:{type:[String,Boolean],default:"default"},time:{type:Boolean,default:!0},timeAtCursor:{type:Boolean,default:!1},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:ze},titleBar:{type:Boolean,default:!0},todayButton:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},view:{type:String,default:""},viewDate:{type:[String,Date],default:""},viewDayOffset:{type:Number,default:0},views:{type:[Array,Object]},viewsBar:{type:Boolean,default:!0},watchRealTime:{type:Boolean,default:!1},weekNumbers:{type:Boolean,default:!1},xs:{type:Boolean,default:!1}},je={class:"vuecal__header"},Le={key:0,class:"vuecal__views-bar"},Fe=["onClick","innerHTML"],He={key:1,class:"vuecal__title-bar"},We={class:"vuecal__transition-wrap"},Re=["disabled","innerHTML"],Ie={__name:"header",setup(u){const s=e.inject("vuecal"),{view:i,config:v}=s,k=()=>{v.clickToNavigate&&i.broader()},b=e.computed(()=>v.clickToNavigate?{click:k}:{});return(O,g)=>(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(O.$slots,"header",{view:e.unref(i),availableViews:e.unref(v).availableViews,vuecal:e.unref(s)}),O.$slots.header?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(v).viewsBar?(e.openBlock(),e.createElementBlock("div",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).availableViews,(C,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["vuecal__view-button",{"vuecal__view-button--active":e.unref(i).id===c}]),onClick:h=>e.unref(i).switch(c),innerHTML:e.unref(s).texts[c],type:"button"},null,10,Fe))),256))])):e.createCommentVNode("",!0),e.unref(v).titleBar?(e.openBlock(),e.createElementBlock("nav",He,[e.createElementVNode("button",{class:e.normalizeClass(["vuecal__nav vuecal__nav--prev",{"vuecal__nav--default":!O.$slots["previous-button"]}]),onClick:g[0]||(g[0]=(...C)=>e.unref(i).previous&&e.unref(i).previous(...C)),type:"button"},[e.renderSlot(O.$slots,"previous-button")],2),e.createElementVNode("div",We,[e.createVNode(e.Transition,{name:`vuecal-slide-fade--${e.unref(i).transitionDirection}`},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{key:e.unref(i).id+e.unref(i).start.getTime()},[O.$slots.title?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).clickToNavigate&&e.unref(i).broaderView?"button":"div"),e.mergeProps({key:0,class:"vuecal__title"},e.toHandlers(b.value)),{default:e.withCtx(()=>[e.renderSlot(O.$slots,"title",e.normalizeProps(e.guardReactiveProps(e.unref(i))))]),_:3},16)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).clickToNavigate&&e.unref(i).broaderView?"button":"div"),e.mergeProps({key:1,class:"vuecal__title"},e.toHandlers(b.value),{innerHTML:e.unref(i).title}),null,16,["innerHTML"]))]))]),_:3},8,["name"])]),e.unref(v).todayButton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[O.$slots["today-button"]?e.renderSlot(O.$slots,"today-button",{key:0,navigate:()=>!e.unref(i).containsToday&&e.unref(i).goToToday(),active:e.unref(i).containsToday}):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vuecal__nav vuecal__nav--today vuecal__nav--default",{"vuecal__nav--active":e.unref(i).containsToday}]),onClick:g[1]||(g[1]=C=>!e.unref(i).containsToday&&e.unref(i).goToToday()),disabled:!!e.unref(i).containsToday,type:"button",innerHTML:e.unref(s).texts.today},null,10,Re))],64)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["vuecal__nav vuecal__nav--next",{"vuecal__nav--default":!O.$slots["next-button"]}]),onClick:g[2]||(g[2]=(...C)=>e.unref(i).next&&e.unref(i).next(...C)),type:"button"},[e.renderSlot(O.$slots,"next-button")],2)])):e.createCommentVNode("",!0)],64))]))}},Ae={key:0,class:"vuecal__headings"},Xe={key:0,class:"vuecal__weekdays-headings"},Ge=["onClick"],Ue={class:"vuecal__weekday-day"},qe={key:0,class:"vuecal__weekday-date"},Ze={key:1,class:"vuecal__schedules-headings w-flex grow"},Je=["innerHTML"],Ke={__name:"headings-bar",setup(u){const s=e.inject("vuecal"),{view:i,config:v,dateUtils:k}=s,b=e.computed(()=>v.xs?"day-xs":v.sm||i.isDays||i.isMonth?"day-sm":"day"),O=e.computed(()=>(i.isDay||i.isDays||i.isWeek||i.isMonth)&&!(i.isDay&&!v.schedules)),g=e.computed(()=>i.cellDates.slice(0,i.cols).map(({start:c})=>({id:ke[c.getDay()],date:c,dateNumber:c.getDate(),day:k.formatDate(c,"dddd"),"day-sm":k.formatDate(c,"ddd"),"day-xs":k.formatDate(c,"dd"),isToday:k.isToday(c)}))),C={click:c=>{(i.isDays||i.isWeek)&&i.updateSelectedDate(c)}};return(c,h)=>O.value?(e.openBlock(),e.createElementBlock("div",Ae,[e.unref(i).isDay?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__weekday",{"vuecal__weekday--today":T.isToday}]),key:z,onClick:R=>C.click(T.date)},[e.renderSlot(c.$slots,"weekday-heading",{label:T[b.value],id:T.id,date:T.date},()=>[e.createElementVNode("span",Ue,e.toDisplayString(T[b.value]),1),e.unref(i).isMonth?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("strong",qe,e.toDisplayString(T.dateNumber),1))])],10,Ge))),128))])),e.unref(v).schedules?(e.openBlock(),e.createElementBlock("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:z},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).schedules,(R,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[c.$slots["schedule-heading"]?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vuecal__schedule vuecal__schedule--heading",R.class])},[e.renderSlot(c.$slots,"schedule-heading",{schedule:R,view:e.unref(i)})],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["vuecal__schedule vuecal__schedule--heading",R.class]),innerHTML:R.label},null,10,Je))],64))),128))],64))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}},Qe={class:"vuecal__time-column"},xe={__name:"time-column",setup(u){const s=e.inject("vuecal"),{config:i,texts:v}=s,k=e.computed(()=>{const b=[];for(let g=i.timeFrom;g<i.timeTo;g+=i.timeStep){const C=~~(g/60),c=g%60,h=v[g<720?"am":"pm"];b.push({minutesSum:g,hours:C,minutes:c,formatted12:`${C%12?C%12:12}${c?":"+c.toString().padStart(2,0):""}${h}`,formatted24:`${C.toString().padStart(2,0)}:${c.toString().padStart(2,0)}`})}return b});return(b,O)=>(e.openBlock(),e.createElementBlock("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(g,C)=>(e.openBlock(),e.createElementBlock("div",{class:"vuecal__time-cell",key:C},[e.renderSlot(b.$slots,"time-cell",{index:C,minutes:g.minutes,hours:g.hours,minutesSum:g.minutesSum,format12:g.formatted12,format24:g.formatted24},()=>[e.createElementVNode("label",null,e.toDisplayString(e.unref(i).twelveHour?g.formatted12:g.formatted24),1)])]))),128))]))}},et=["draggable"],tt={class:"vuecal__event-details"},at={class:"vuecal__event-title"},nt={key:0,class:"vuecal__event-time"},st=["innerHTML"],Ee={__name:"event",props:{event:{type:Object,required:!0}},emits:["event-drag-start","event-drag-end","event-resize-start","event-resize-end"],setup(u,{emit:s}){const{config:i,view:v,dnd:k,touch:b,dateUtils:O}=e.inject("vuecal"),g=u,C=e.ref(null),c=e.reactive(g.event),h=e.reactive({dragging:!1,resizing:!1,fromResizer:!1,holding:!1,holdTimer:null,startX:0,startY:0,startPercentageX:0,startPercentageY:0,moveX:0,moveY:0,movePercentageX:0,movePercentageY:0,resizeStartDate:null,resizingOriginalEvent:null,resizingLastAcceptedEvent:null,cellEl:null,schedule:null}),T=e.computed(()=>i.editableEvents.drag&&c.draggable!==!1&&!c.background),z=e.computed(()=>i.time&&i.editableEvents.resize&&c.resizable!==!1&&!c.background);e.computed(()=>i.editableEvents.delete&&c.deletable!==!1&&!c.background);const R=e.computed(()=>{var r,l,_;return{[`vuecal__event--${c._.id}`]:!0,[c.class]:!!c.class,"vuecal__event--recurring":!!c.recurring,"vuecal__event--background":!!c.background,"vuecal__event--multiday":!!((r=c._)!=null&&r.multiday),"vuecal__event--cut-top":((l=c._)==null?void 0:l.startMinutes)<i.timeFrom,"vuecal__event--cut-bottom":((_=c._)==null?void 0:_.endMinutes)>i.timeTo||c.end.getDate()!==c.start.getDate(),"vuecal__event--dragging":!c._.draggingGhost&&c._.dragging,"vuecal__event--dragging-ghost":c._.draggingGhost,"vuecal__event--resizing":h.resizing}}),d=e.computed(()=>{const r=(v.isDay||v.isDays||v.isWeek)&&i.time;if(!r&&!c.backgroundColor&&!c.color)return!1;const l={backgroundColor:c.backgroundColor||null,color:c.color||null};if(r){const _=Math.max(i.timeFrom,c._.startMinutes),a=Math.min(i.timeTo,c._.endMinutes),B=me(_,i),V=me(a,i)-B;l.top=`${B}%`,l.height=`${V}%`}return l}),m=e.computed(()=>{const r={...i.eventListeners.event};Object.entries(r).forEach(([a,B])=>{["resize-end"].includes(a)||(r[a]=V=>{V.type!=="drop"&&B(V.type?{e:V,event:c}:V)})});const l={...r};r.touchstart=a=>{var B;a.stopPropagation(),t(a),(B=l.touchstart)==null||B.call(l,{e:a,event:c})},r.mousedown=a=>{var B;a.stopPropagation(),t(a),(B=l.mousedown)==null||B.call(l,{e:a,event:c})};let _=null;return r.click=a=>{var B;(B=l.click)==null||B.call(l,{e:a,event:c}),_?_=clearTimeout(_):_=setTimeout(()=>{var V;_=null,(V=l["delayed-click"])==null||V.call(l,{e:a,event:c})},400)},r.dblclick=a=>{l.dblclick?l.dblclick({e:a,event:c}):c.delete(1)},r}),t=r=>{var a,B,V;const l=((a=r.touches)==null?void 0:a[0])||r;h.fromResizer=l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");const _=C.value.getBoundingClientRect();h.startX=(((B=r.touches)==null?void 0:B[0])||r).clientX-_.left,h.startY=(((V=r.touches)==null?void 0:V[0])||r).clientY-_.top,h.startPercentageX=h.startX*100/_.width,h.startPercentageY=h.startY*100/_.height,h.cellEl=C.value.closest(".vuecal__cell"),h.resizeStartDate=c.start,j(r.type==="touchstart"?"touchmove":"mousemove",f),j(r.type==="touchstart"?"touchend":"mouseup",p,{once:!0}),h.holdTimer=setTimeout(()=>{var F,G;h.holding=!0,(G=(F=m.value).hold)==null||G.call(F,{e:r,event:c})},1e3)},f=async r=>{var _,a,B,V;const l=((_=r.touches)==null?void 0:_[0])||r;if(h.fromResizer&&!h.resizing&&(h.resizing=!0,h.resizingOriginalEvent={...c,_:{...c._}},b.isResizingEvent=!0,(B=(a=m.value).resizeStart)==null||B.call(a,{e:r,event:c})),h.holdTimer=clearTimeout(h.holdTimer),h.holding=!1,h.cellEl){const{top:F,left:G,width:Q,height:J}=h.cellEl.getBoundingClientRect();h.moveX=l.clientX-G,h.moveY=l.clientY-F,h.movePercentageX=h.moveX*100/Q,h.movePercentageY=h.moveY*100/J}if(h.fromResizer){const{newStart:F,newEnd:G}=E(c);let Q=!0;const{resize:J}=(V=i.eventListeners)==null?void 0:V.event;J&&(Q=await J({e:r,event:{...c,start:F,end:G},overlaps:c.getOverlappingEvents({start:F,end:G})})),Q!==!1?(c.start=F,c.end=G,h.resizingLastAcceptedEvent&&(h.resizingLastAcceptedEvent=null)):J&&(h.resizingLastAcceptedEvent={...c,_:{...c._}})}},p=async r=>{var l,_;if(h.holdTimer=clearTimeout(h.holdTimer),h.holding=!1,h.resizing){const{newStart:a,newEnd:B}=E(c);let V=!0;const F=m.value["resize-end"];F&&(V=await F({e:r,event:c,original:h.resizingOriginalEvent,overlaps:c.getOverlappingEvents({start:a,end:B})})),c.start=V===!1?(h.resizingLastAcceptedEvent||h.resizingOriginalEvent).start:((l=h.resizingLastAcceptedEvent)==null?void 0:l.start)||a,c.end=V===!1?(h.resizingLastAcceptedEvent||h.resizingOriginalEvent).end:((_=h.resizingLastAcceptedEvent)==null?void 0:_.end)||B,c._.duration<1&&(c.start=h.resizingOriginalEvent.start,c.end=h.resizingOriginalEvent.end),b.isResizingEvent=!1}document.removeEventListener(r.type==="touchend"?"touchmove":"mousemove",f),h.resizing=!1,h.fromResizer=!1,h.dragging=!1,h.startX=0,h.startY=0,h.moveX=0,h.moveY=0,h.startPercentageX=0,h.startPercentageY=0,h.movePercentageX=0,h.movePercentageY=0,h.cellEl=null,h.resizeStartDate=null,h.resizingOriginalEvent=null,h.resizingLastAcceptedEvent=null,h.schedule=null},E=r=>{const l=new Date(r.start.getFullYear(),r.start.getMonth(),r.start.getDate());new Date(l).setDate(l.getDate()+1);let a=fe(h.movePercentageY,i);if(a=Math.max(0,Math.min(a,24*60)),i.snapToInterval){const F=a+i.snapToInterval/2;a=F-F%i.snapToInterval}let B=r.start,V=new Date(l.getTime()+a*6e4);return V<h.resizeStartDate&&(B=V,V=h.resizeStartDate),{newStart:B,newEnd:V}};e.onMounted(()=>c._.register(C.value));const P=[],j=(r,l,_)=>{document.addEventListener(r,l,_),P.push({event:r,handler:l,options:_})};return e.onBeforeUnmount(()=>{c._.unregister(),P.forEach(({event:r,handler:l,options:_})=>{document.removeEventListener(r,l,_)})}),(r,l)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:"vuecal__event"},e.toHandlers(m.value,!0),{ref_key:"eventEl",ref:C,class:R.value,style:d.value,draggable:T.value?"true":void 0,onDragstart:l[2]||(l[2]=_=>T.value&&e.unref(k).eventDragStart(_,c)),onDragend:l[3]||(l[3]=_=>T.value&&e.unref(k).eventDragEnd(_,c))}),[e.createElementVNode("div",tt,[e.renderSlot(r.$slots,"event",{event:c},()=>[e.createElementVNode("div",at,e.toDisplayString(c.title),1),e.unref(i).time?(e.openBlock(),e.createElementBlock("div",nt,e.toDisplayString(c._[`startTimeFormatted${e.unref(i).twelveHour?12:24}`])+`
|
|
6
|
-
- `+e.toDisplayString(c._[`endTimeFormatted${e.unref(i).twelveHour?12:24}`]),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vuecal__event-content",innerHTML:c.content},null,8,st)])]),z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__event-resizer",onDragstart:l[0]||(l[0]=e.withModifiers(()=>{},["prevent","stop"]))},null,32)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"vuecal-delete-btn"},{default:e.withCtx(()=>[c._.deleting?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:l[1]||(l[1]=e.withModifiers(_=>c.delete(3),["stop"]))},"Delete")):e.createCommentVNode("",!0)]),_:1})],16,et))}},lt=["innerHTML"],rt=["data-schedule"],ot={key:1,class:"vuecal__cell-date"},it={key:2,class:"vuecal__cell-content"},ct={key:3,class:"vuecal__cell-events"},dt={key:1,class:"vuecal__cell-date"},ut={key:2,class:"vuecal__cell-content"},mt={key:3,class:"vuecal__cell-events"},ft={key:5,class:"vuecal__cell-events-count"},gt=["title"],ht={__name:"cell",props:{start:{type:Date,required:!0},end:{type:Date,required:!0},index:{type:Number,required:!0}},setup(u){const s=u,i=e.inject("vuecal"),{view:v,config:k,dateUtils:b,eventsManager:O,dnd:g,touch:C}=i,c=e.computed(()=>b.isToday(s.start)),h=e.ref(null),T=e.ref([]),z=e.ref(!1),R=o=>{T.value.push(o.detail),z.value=!0},d=()=>setTimeout(()=>z.value=!1,300),m=e.reactive({dragging:!1,holding:!1,holdTimer:null,thresholdPassed:!1,startX:0,startY:0,moveX:0,moveY:0,startPercentageX:0,startPercentageY:0,movePercentageX:0,movePercentageY:0,schedule:null}),t=e.ref(!1),f=e.ref({cellOverlaps:{},longestStreak:0}),p=e.computed(()=>{let o=Math.min(m.startPercentageY,m.movePercentageY),M=Math.max(m.startPercentageY,m.movePercentageY),S=fe(o,k),$=fe(M,k);return k.snapToInterval&&(S=b.snapToInterval(S,k.snapToInterval),$=b.snapToInterval($,k.snapToInterval),o=me(S,k),M=me($,k)),{style:{top:o+"%",height:Math.abs(M-o)+"%"},startMinutes:S,endMinutes:$,start:b.formatMinutes(S),end:b.formatMinutes($),...m.schedule?{schedule:m.schedule}:{}}}),E=e.computed(()=>{const o=k.editableEvents.create&&(m.dragging||t.value),M=k.eventCreateMinDrag&&m.thresholdPassed||!k.eventCreateMinDrag;return o&&M}),P=e.computed(()=>{var Z;const o=new Date,M=v.start.getFullYear(),S=v.start.getMonth(),$=s.start.getFullYear(),N=s.start.getMonth();return{[`vuecal__cell--${ke[s.start.getDay()]}`]:v.isDay||v.isDays||v.isWeek||v.isMonth,[`vuecal__cell--${Se[N]}`]:v.isYear,[`vuecal__cell--${$}`]:v.isYears,"vuecal__cell--today":c.value,"vuecal__cell--current-month":v.isYear&&$===o.getFullYear()&&N===o.getMonth(),"vuecal__cell--current-year":v.isYears&&$===o.getFullYear(),"vuecal__cell--out-of-range":v.isMonth&&($!==M||N!==S),"vuecal__cell--before-min":J.value&&G.value,"vuecal__cell--after-max":J.value&&Q.value,"vuecal__cell--disabled":J.value,"vuecal__cell--selected":v.selectedDate&&v.selectedDate.getTime()>=s.start.getTime()&&v.selectedDate.getTime()<=s.end.getTime(),"vuecal__cell--has-schedules":(Z=k.schedules)==null?void 0:Z.length,"vuecal__cell--dragging":m.dragging,"vuecal__cell--has-events":l.value.length}}),j=e.computed(()=>b.formatDate(s.start)),r=e.computed(()=>{switch(v.id){case"day":return"";case"days":return k.availableViews.days.rows>1&&b.formatDate(s.start,"D"),"";case"week":return"";case"month":return b.formatDate(s.start,"D");case"year":return b.formatDate(s.start,k.xs?"MMM":"MMMM");case"years":return b.formatDate(s.start,"YYYY")}}),l=e.computed(()=>k.datePicker?[]:O.getEventsByDate(j.value,!0,!0).filter(o=>!T.value.includes(o._.id))),_=e.computed(()=>l.value.filter(o=>!o.background)),a=e.computed(()=>{var o;return(o=k.schedules)==null?void 0:o.reduce((M,S)=>(M[S.id]=l.value.filter($=>$.schedule===S.id),M),{})}),B=e.computed(()=>{const o={};for(const M of l.value){const S=M._.id,{maxConcurrent:$=1,position:N=0}=f.value.cellOverlaps[S]||{};o[S]={width:`${100/$}%`,left:`${100/$*N}%`}}return o}),V=e.computed(()=>v.isMonth&&k.eventCount&&!k.eventsOnMonthView&&_.value.length),F=e.computed(()=>{var S;if(!k.specialHours||v.isMonth||v.isYear||v.isYears)return;const o=ke[s.start.getDay()];let M=(S=k.specialHours)==null?void 0:S[o];if(M)return Array.isArray(M)||(M=[M]),M.map($=>{let{from:N,to:L,class:Z,label:ae}=$;if(isNaN(N)||isNaN(L)||k.timeFrom>=L||k.timeTo<=N)return;N=Math.max(k.timeFrom,N),L=Math.min(k.timeTo,L);const se=me(N,k),y=me(L,k)-se;return{style:{top:`${se}%`,height:`${y}%`},label:ae,class:Z}}).filter($=>!!$)}),G=e.computed(()=>k.minTimestamp!==null&&k.minTimestamp>s.end.getTime()),Q=e.computed(()=>k.maxTimestamp&&k.maxTimestamp<s.start.getTime()),J=e.computed(()=>{const{disableDays:o}=k,M=v.isYear||v.isYears;return o.length&&o.includes(b.formatDate(s.start))&&!M?!0:G.value||Q.value}),K=e.reactive({show:e.computed(()=>{if(!(!v.isDay&&!v.isDays&&!v.isWeek)&&!(!c.value||!k.time)&&!(k.timeFrom>b.dateToMinutes(v.now))&&!(b.dateToMinutes(v.now)>k.timeTo))return!0}),nowInMinutes:e.computed(()=>b.dateToMinutes(v.now)),todaysTimePosition:e.computed(()=>me(K.nowInMinutes,k)),style:e.computed(()=>`top: ${K.todaysTimePosition}%`),currentTime:e.computed(()=>b.formatTime(v.now))}),re=e.computed(()=>{if(J.value)return{};const o={...k.eventListeners.cell};Object.entries(o).forEach(([$,N])=>{o[$]=L=>{var Z,ae,se;(se=(ae=L.target||((Z=L.e)==null?void 0:Z.target)).closest)!=null&&se.call(ae,".vuecal__event")||N(L.type?{e:L,cell:q.value,cursor:U.value}:L)}});const M={...o};let S=null;return o.click=$=>{var N;x(),(N=M.click)==null||N.call(M,{e:$,cell:q.value,cursor:U.value}),S?S=clearTimeout(S):S=setTimeout(()=>{var L;S=null,(L=M["delayed-click"])==null||L.call(M,{e:$,cell:q.value,cursor:U.value})},400)},(k.time&&v.isDay||v.isDays||v.isWeek)&&(o.touchstart=$=>{var N;n($.e||$),(N=M.touchstart)==null||N.call(M,{e:$,cell:q.value,cursor:U.value})},o.mousedown=$=>{var N;n($.e||$),(N=M.mousedown)==null||N.call(M,{e:$,cell:q.value,cursor:U.value})}),M.dblclick&&(o.dblclick=$=>{var Y,H;const N=(((Y=$.touches)==null?void 0:Y[0])||$).clientY,{top:L}=h.value.getBoundingClientRect(),Z=be(N-L,h.value),ae=fe(Z,k),se=new Date(s.start);se.setMinutes(ae);const y={y:Z,date:se};(H=M.dblclick)==null||H.call(M,{e:$,cell:q.value,cursor:y})}),k.editableEvents.drag&&(o.dragenter=$=>g.cellDragEnter($,q.value),o.dragover=$=>{$.preventDefault(),g.cellDragOver($,q.value)},o.dragleave=$=>g.cellDragLeave($,q.value),o.drop=$=>g.cellDragDrop($,q.value)),o}),q=e.computed(()=>({start:s.start,end:s.end,events:l,...m.schedule?{schedule:m.schedule}:{}})),U=e.computed(()=>{const o=fe(m.movePercentageY||m.startPercentageY,k),M=new Date(s.start);return M.setMinutes(o),{x:m.movePercentageX||m.startPercentageX,y:m.movePercentageY||m.startPercentageY,date:M}}),x=()=>{v.updateSelectedDate(s.start),k.clickToNavigate&&((v.isMonth||v.isDays||v.isWeek)&&k.availableViews.day?v.switch("day"):v.isYear&&k.availableViews.month?v.switch("month"):v.isYears&&k.availableViews.year&&v.switch("year")),v.updateViewDate(s.start)},n=o=>{var S,$;m.schedule=~~o.target.dataset.schedule;const M=h.value.getBoundingClientRect();m.startX=(((S=o.touches)==null?void 0:S[0])||o).clientX-M.left,m.startY=((($=o.touches)==null?void 0:$[0])||o).clientY-M.top,m.startPercentageX=m.startX*100/M.width,m.startPercentageY=m.startY*100/M.height,m.thresholdPassed=!1,document.addEventListener(o.type==="touchstart"?"touchmove":"mousemove",w),document.addEventListener(o.type==="touchstart"?"touchend":"mouseup",D,{once:!0}),m.holdTimer=setTimeout(()=>{var N,L;m.holding=!0,(L=(N=re.value).hold)==null||L.call(N,{e:o,cell:q.value,cursor:U.value})},1e3)},w=o=>{var S,$,N,L,Z,ae;m.dragging||(C.isDraggingCell=!0,($=(S=re.value).dragStart)==null||$.call(S,{e:o,cell:q.value,cursor:U.value})),m.dragging=!0,m.holdTimer=clearTimeout(m.holdTimer),m.holding=!1;const M=h.value.getBoundingClientRect();m.moveX=(((N=o.touches)==null?void 0:N[0])||o).clientX-M.left,m.moveY=(((L=o.touches)==null?void 0:L[0])||o).clientY-M.top,m.movePercentageX=m.moveX*100/M.width,m.movePercentageY=m.moveY*100/M.height,k.eventCreateMinDrag&&Math.abs(m.startY-m.moveY)>k.eventCreateMinDrag&&(m.thresholdPassed=!0),(ae=(Z=re.value).drag)==null||ae.call(Z,{e:o,cell:q.value,cursor:U.value})},D=async o=>{var M,S;document.removeEventListener(o.type==="touchend"?"touchmove":"mousemove",w,{passive:!1}),m.dragging&&((S=(M=re.value).dragEnd)==null||S.call(M,{e:o,cell:q.value,cursor:U.value}),C.isDraggingCell=!1,k.editableEvents.create&&(t.value=!0,await I(o),t.value=!1)),m.holdTimer=clearTimeout(m.holdTimer),m.holding=!1,m.dragging=!1,m.startX=0,m.startY=0,m.moveX=0,m.moveY=0,m.startPercentageX=0,m.startPercentageY=0,m.movePercentageX=0,m.movePercentageY=0,m.thresholdPassed=!1,m.schedule=null},I=async o=>{if(!E.value)return;let{start:M,end:S,startMinutes:$,endMinutes:N}=p.value;M=new Date(s.start),M.setMinutes($),S=new Date(s.start),S.setMinutes(N);let L={...p.value,start:M,end:S};const{create:Z}=k.eventListeners.event;if(typeof Z=="function"){const ae=L;L=await new Promise(se=>Z({e:o,event:L,cell:q.value,resolve:se,cursor:U.value})),L&&typeof L=="object"&&v.createEvent(L),L&&typeof L=="boolean"&&v.createEvent(ae)}else v.createEvent(L)},X=()=>{Object.keys(re.value).forEach(o=>{var M;(M=h.value)==null||M.removeEventListener(o,re.value[o])})},te=()=>{f.value=O.getCellOverlappingEvents(j.value)};return e.watch(()=>_.value.map(o=>`${o._.id}${o.start.getTime()}${o.end.getTime()}`).join(),async()=>{await e.nextTick(),te()},{immediate:!0,flush:"post"}),e.onBeforeUnmount(async()=>{T.value.forEach(o=>O.deleteEvent(o,3)),X(),await e.nextTick()}),(o,M)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["vuecal__cell",P.value],ref_key:"cellEl",ref:h},e.toHandlers(re.value,!0)),[o.$slots.cell?e.renderSlot(o.$slots,"cell",{key:0,start:u.start,end:u.end,index:u.index,events:l.value}):e.createCommentVNode("",!0),F.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(F.value,(S,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__special-hours",S.class]),style:e.normalizeStyle(S.style),innerHTML:S.label||""},null,14,lt))),256)):e.createCommentVNode("",!0),!o.$slots.cell&&e.unref(k).schedules?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(e.unref(k).schedules,S=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__schedule vuecal__schedule--cell",S.class]),key:S.id,style:e.normalizeStyle(S.style||null),"data-schedule":S.id},[o.$slots["cell-events"]?e.renderSlot(o.$slots,"cell-events",{key:0,start:u.start,end:u.end,events:l.value}):e.createCommentVNode("",!0),r.value||o.$slots["cell-date"]?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(o.$slots,"cell-date",{start:u.start,end:u.end,events:l.value},()=>[e.createTextVNode(e.toDisplayString(r.value),1)])])):e.createCommentVNode("",!0),o.$slots["cell-content"]?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"cell-content",{start:u.start,end:u.end,events:l.value})])):e.createCommentVNode("",!0),o.$slots["cell-events"]&&l.value.length?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(o.$slots,"cell-events",{start:u.start,end:u.end,events:l.value})])):l.value.length||z.value?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:4,class:"vuecal__cell-events",name:"vuecal-event-delete",onBeforeLeave:M[0]||(M[0]=$=>z.value=!0),onAfterLeave:d,tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value[S.id],$=>(e.openBlock(),e.createBlock(Ee,{key:$._.id,event:$,onEventDeleted:R,style:e.normalizeStyle(B.value[$._.id])},e.createSlots({_:2},[o.$slots.event?{name:"event",fn:e.withCtx(N=>[e.renderSlot(o.$slots,"event",e.mergeProps({ref_for:!0},N))]),key:"0"}:void 0]),1032,["event","style"]))),128))]),_:2},1024)):e.createCommentVNode("",!0),E.value&&m.schedule===S.id?(e.openBlock(),e.createElementBlock("div",{key:5,class:"vuecal__event-placeholder",style:e.normalizeStyle(p.value.style)},e.toDisplayString(p.value.start)+" - "+e.toDisplayString(p.value.end),5)):e.createCommentVNode("",!0)],14,rt))),128)):e.createCommentVNode("",!0),!o.$slots.cell&&!e.unref(k).schedules?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o.$slots["cell-events"]?e.renderSlot(o.$slots,"cell-events",{key:0}):e.createCommentVNode("",!0),r.value||o.$slots["cell-date"]?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(o.$slots,"cell-date",{start:u.start,end:u.end,events:l.value},()=>[e.createTextVNode(e.toDisplayString(r.value),1)])])):e.createCommentVNode("",!0),o.$slots["cell-content"]?(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(o.$slots,"cell-content",{start:u.start,end:u.end,events:l.value})])):e.createCommentVNode("",!0),o.$slots["cell-events"]&&l.value.length?(e.openBlock(),e.createElementBlock("div",mt,[e.renderSlot(o.$slots,"cell-events",{start:u.start,end:u.end,events:l.value})])):(l.value.length||z.value)&&!(e.unref(v).isMonth&&!e.unref(k).eventsOnMonthView)?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:4,class:"vuecal__cell-events",name:"vuecal-event-delete",onBeforeLeave:M[1]||(M[1]=S=>z.value=!0),onAfterLeave:d,tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,S=>(e.openBlock(),e.createBlock(Ee,{key:S._.id,event:S,onEventDeleted:R,style:e.normalizeStyle(B.value[S._.id])},e.createSlots({_:2},[o.$slots.event?{name:"event",fn:e.withCtx($=>[e.renderSlot(o.$slots,"event",e.mergeProps({ref_for:!0},$))]),key:"0"}:void 0]),1032,["event","style"]))),128))]),_:3})):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",{key:5,class:"vuecal__event-placeholder",style:e.normalizeStyle(p.value.style)},e.toDisplayString(p.value.start)+" - "+e.toDisplayString(p.value.end),5)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),o.$slots["event-count"]?e.renderSlot(o.$slots,"event-count",{key:4,events:_.value}):V.value?(e.openBlock(),e.createElementBlock("div",ft,e.toDisplayString(_.value.length),1)):e.createCommentVNode("",!0),K.show?(e.openBlock(),e.createElementBlock("div",{key:6,class:"vuecal__now-line",style:e.normalizeStyle(K.style),title:K.currentTime},[e.createElementVNode("span",null,e.toDisplayString(K.currentTime),1)],12,gt)):e.createCommentVNode("",!0)],16))}},yt={__name:"body",setup(u){const s=e.inject("vuecal");let{view:i,config:v,dateUtils:k}=s;const b=e.ref(null),O=e.ref(null),g=e.computed(()=>({"--vuecal-grid-columns":i.cols,"--vuecal-grid-rows":i.rows})),C=e.computed(()=>{const T=k.formatTime(fe(O.value,v));return{style:{top:O.value+"%"},time:T}}),c=T=>{var d;if(i.isMonth||i.isYear||i.isYears)return;const z=(((d=T.touches)==null?void 0:d[0])||T).clientY,{top:R}=b.value.getBoundingClientRect();O.value=be(z-R,b.value)},h=()=>{O.value=null};return e.onMounted(()=>{b.value.addEventListener("mousemove",c),b.value.addEventListener("touchmove",c),b.value.addEventListener("mouseleave",h),b.value.addEventListener("touchend",h)}),e.onBeforeUnmount(()=>{b.value&&(b.value.removeEventListener("mousemove",c),b.value.removeEventListener("touchmove",c),b.value.removeEventListener("mouseleave",h),b.value.removeEventListener("touchend",h))}),(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:"vuecal__body",ref_key:"bodyEl",ref:b,style:e.normalizeStyle(g.value)},[e.createVNode(e.Transition,{name:"vuecal-shrink"},{default:e.withCtx(()=>[e.unref(v).timeAtCursor&&O.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__time-at-cursor",style:e.normalizeStyle(C.value.style)},[e.createElementVNode("label",null,e.toDisplayString(C.value.time),1)],4)):e.createCommentVNode("",!0)]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).cellDates,(R,d)=>(e.openBlock(),e.createBlock(ht,{key:d,start:R.start,end:R.end,index:d},e.createSlots({_:2},[T.$slots.cell?{name:"cell",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell",e.mergeProps({ref_for:!0},m))]),key:"0"}:void 0,T.$slots["cell-date"]?{name:"cell-date",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-date",e.mergeProps({ref_for:!0},m))]),key:"1"}:void 0,T.$slots["cell-content"]?{name:"cell-content",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-content",e.mergeProps({ref_for:!0},m))]),key:"2"}:void 0,T.$slots["cell-events"]?{name:"cell-events",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-events",e.mergeProps({ref_for:!0},m))]),key:"3"}:T.$slots.event?{name:"event",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"event",e.mergeProps({ref_for:!0},m))]),key:"4"}:T.$slots["event-count"]?{name:"event-count",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"event-count",e.mergeProps({ref_for:!0},m))]),key:"5"}:void 0]),1032,["start","end","index"]))),128))],4))}},pt=["data-locale"],Dt={class:"vuecal__scrollable-wrap"},vt={key:1,class:"vuecal__week-numbers"},kt={class:"vuecal__week-number"},wt={class:"vuecal__body-wrap"},_t={__name:"index",props:Ne,emits:["ready","view-change","update:view","update:selectedDate","update:viewDate","update:events","event-delete","event-created","event-dropped","event-change"],setup(u,{expose:s,emit:i}){const v=u,k=i,b=e.useTemplateRef("vuecal-el"),O=Oe({props:v,emit:k,attrs:e.useAttrs(),vuecalEl:b,uid:e.useId()}),{config:g,view:C,dateUtils:c,touch:h}=O,T=e.computed(()=>g.time&&(C.isDay||C.isDays||C.isWeek)),z=e.computed(()=>Array(C.rows).fill().map((t,f)=>c.getWeek(c.addDays(C.firstCellDate,7*f)))),R=e.computed(()=>{var t;return{"vuecal--ready":g.ready,[`vuecal--${g.theme}-theme`]:g.theme,[`vuecal--${g.size}`]:!0,"vuecal--date-picker":g.datePicker,"vuecal--dark":g.dark,"vuecal--light":!g.dark,[`vuecal--${C.id}-view`]:!0,"vuecal--view-has-time":T.value,"vuecal--timeless":!g.time,"vuecal--dragging-cell":h.isDraggingCell,"vuecal--dragging-event":h.isDraggingEvent,"vuecal--resizing-event":h.isResizingEvent,"vuecal--has-schedules":(t=g.schedules)==null?void 0:t.length}}),d=e.computed(()=>({"--vuecal-time-cell-height":g.timeCellHeight&&`${g.timeCellHeight}px`})),m=e.computed(()=>{var t,f;return{"vuecal__scrollable--row":T.value||g.weekNumbers&&C.isMonth,[`vuecal__scrollable--${C.id}-view`]:!0,"vuecal__scrollable--has-schedules":(t=g.schedules)==null?void 0:t.length,"vuecal__scrollable--no-schedules":!((f=g.schedules)!=null&&f.length)}});return e.onMounted(async()=>{await e.nextTick(),k("ready",{config:g,view:C})}),e.watch(()=>g.locale,t=>g.loadTexts(t)),e.provide("vuecal",O),s({view:O.view}),(t,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal",R.value]),ref:"vuecal-el","data-locale":t.locale,style:e.normalizeStyle(d.value)},[t.$slots.diy?e.renderSlot(t.$slots,"diy",{key:0,vuecal:e.unref(O),view:e.unref(C),availableViews:e.unref(g).availableViews}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(Ie,null,e.createSlots({_:2},[t.$slots.header?{name:"header",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"header",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,!t.$slots.header&&t.$slots["previous-button"]?{name:"previous-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"previous-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0,!t.$slots.header&&t.$slots["next-button"]?{name:"next-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"next-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"2"}:void 0,!t.$slots.header&&t.$slots["today-button"]?{name:"today-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"today-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"3"}:void 0,!t.$slots.header&&t.$slots.title?{name:"title",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"title",e.normalizeProps(e.guardReactiveProps(p)))]),key:"4"}:void 0,!t.$slots.header&&t.$slots["schedule-heading"]?{name:"schedule-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"schedule-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"5"}:void 0]),1024),e.createElementVNode("div",Dt,[e.createVNode(e.Transition,{name:`vuecal-slide-fade--${e.unref(C).transitionDirection}`},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__scrollable",m.value]),key:e.unref(C).id+e.unref(C).start.getTime()},[T.value?(e.openBlock(),e.createBlock(xe,{key:0},e.createSlots({_:2},[t.$slots["time-cell"]?{name:"time-cell",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"time-cell",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0]),1024)):e.createCommentVNode("",!0),e.unref(g).weekNumbers&&e.unref(C).isMonth?(e.openBlock(),e.createElementBlock("div",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,p=>(e.openBlock(),e.createElementBlock("div",kt,[e.renderSlot(t.$slots,"week-number",{},()=>[e.createElementVNode("small",null,e.toDisplayString(p),1)])]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("div",wt,[e.createVNode(Ke,null,e.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"weekday-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,t.$slots["schedule-heading"]?{name:"schedule-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"schedule-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0]),1024),e.createVNode(yt,null,e.createSlots({_:2},[t.$slots.cell?{name:"cell",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,!t.$slots.cell&&t.$slots["cell-date"]?{name:"cell-date",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-date",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0,!t.$slots.cell&&t.$slots["cell-content"]?{name:"cell-content",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-content",e.normalizeProps(e.guardReactiveProps(p)))]),key:"2"}:void 0,!t.$slots.cell&&t.$slots["cell-events"]?{name:"cell-events",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-events",e.normalizeProps(e.guardReactiveProps(p)))]),key:"3"}:void 0,!t.$slots.cell&&t.$slots.event?{name:"event",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"event",e.normalizeProps(e.guardReactiveProps(p)))]),key:"4"}:void 0,!t.$slots.cell&&t.$slots["event-count"]?{name:"event-count",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"event-count",e.normalizeProps(e.guardReactiveProps(p)))]),key:"5"}:void 0]),1024)])],2))]),_:3},8,["name"])])],64))],14,pt))}},bt=u=>{he.texts={...ee.texts,...u},he.dateUtils.updateTexts(he.texts)},{addDatePrototypes:Tt,removeDatePrototypes:Mt,updateTexts:$t,addDays:Et,subtractDays:St,addHours:Ct,subtractHours:Bt,addMinutes:Vt,subtractMinutes:Yt,getWeek:Pt,isToday:Ot,isSameDate:zt,isInRange:Nt,isLeapYear:jt,getPreviousFirstDayOfWeek:Lt,stringToDate:Ft,dateToMinutes:Ht,countDays:Wt,datesInSameTimeStep:Rt,isValid:It,formatDate:At,formatDateLite:Xt,formatTime:Gt,formatTimeLite:Ut,formatMinutes:qt}=he.dateUtils;W.VueCal=_t,W.addDatePrototypes=Tt,W.addDays=Et,W.addHours=Ct,W.addMinutes=Vt,W.countDays=Wt,W.dateToMinutes=Ht,W.datesInSameTimeStep=Rt,W.formatDate=At,W.formatDateLite=Xt,W.formatMinutes=qt,W.formatTime=Gt,W.formatTimeLite=Ut,W.getPreviousFirstDayOfWeek=Lt,W.getWeek=Pt,W.isInRange=Nt,W.isLeapYear=jt,W.isSameDate=zt,W.isToday=Ot,W.isValidDate=It,W.removeDatePrototypes=Mt,W.stringToDate=Ft,W.subtractDays=St,W.subtractHours=Bt,W.subtractMinutes=Yt,W.updateTexts=$t,W.useLocale=bt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/const ee={texts:{weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm",truncations:!0},availableViews:{day:{cols:1,rows:1},days:{cols:10,rows:1},week:{cols:7,rows:1},month:{cols:7,rows:6},year:{cols:4,rows:3},years:{cols:5,rows:5}}},Se=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],ke=["sun","mon","tue","wed","thu","fri","sat"],Ce=ke.reduce((u,s,i)=>(u[s]=i||7,u),{}),Be=(u,s,i)=>{const{dateUtils:v}=u,k=!1,b=e.computed(()=>{if(z.value[s.view])return s.view;{const r=s.datePicker?"month":"week",l=s.view||r;return z.value[l]?l:(console.warn(`Vue Cal: the provided or default view \`${l}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(z.value)[0]}\`.`),Object.keys(z.value)[0])}}),O=e.computed(()=>s.sm&&!s.xs),g=e.computed(()=>s.xs||s.datePicker),C=e.computed(()=>s.clickToNavigate||s.datePicker&&s.clickToNavigate!==!1),c=e.computed(()=>{const r={cell:{},event:{}},l=_=>_.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Object.entries(i).forEach(([_,a])=>{const[B,V,F]=_.match(/^on(Cell|Event)(.+)$/)||[];B&&(r[V.toLowerCase()][l(F).replace(/^-+|-+$/g,"")]=a)}),r}),h=e.computed(()=>{var l;const r={};return s.hideWeekends&&(r[6]=!0)&&(r[7]=!0),(l=s.hideWeekdays)!=null&&l.length&&s.hideWeekdays.forEach(_=>r[Ce[_]]=!0),r}),T=e.computed(()=>s.hideWeekends||h.value[6]&&h.value[7]),z=e.computed(()=>{const r=s.datePicker;let l=0,_={};const a=s.views;return r&&!a?{month:{...ee.availableViews.month},year:{...ee.availableViews.year},years:{...ee.availableViews.years}}:(a?(Array.isArray(a)?_=a.reduce((B,V)=>(typeof V=="string"&&ee.availableViews[V]?B[V]=ee.availableViews[V]:l++,B),{}):typeof a=="object"&&(_=Object.entries(a).reduce((B,[V,F])=>{const{cols:G,rows:Q}=ee.availableViews[V];return B[V]={cols:F.cols||G,rows:F.rows||Q},B},{})),l&&console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."),Object.keys(_).length||(console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."),_={...ee.availableViews})):_={...ee.availableViews},_)}),I=e.computed(()=>s.datePicker?"month":z.value.week?"week":Object.keys(z.value)[0]),d=e.computed(()=>{if(typeof s.selectedDate=="string")return v.stringToDate(s.selectedDate);if(s.selectedDate instanceof Date)return s.selectedDate;s.selectedDate?console.warn("Vue Cal: The provided selected date is invalid:",s.selectedDate):console.log("Vue Cal: Info - The provided selected date is undefined.")}),m=e.computed(()=>{if(!s.disableDays)return[];const r=[];return Array.isArray(s.disableDays)?s.disableDays.forEach(l=>{let _=l;if(typeof l=="string"?_=v.stringToDate(l):l instanceof Date&&(l=v.formatDate(l,"YYYY-MM-DD")),_ instanceof Date&&!isNaN(_.getTime())){r.push(l);return}else console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:",l)}):console.warn("Vue Cal: The provided `disableDays` prop is invalid:",s.disableDays),r}),t=e.computed(()=>{let r=null;return s.minDate&&typeof s.minDate=="string"?r=v.stringToDate(s.minDate):s.minDate&&s.minDate instanceof Date&&(r=s.minDate),(r==null?void 0:r.getTime())||null}),f=e.computed(()=>{let r=null;return s.maxDate&&typeof s.maxDate=="string"?r=v.stringToDate(s.maxDate):s.maxDate&&s.maxDate instanceof Date&&(r=s.maxDate),(r==null?void 0:r.getTime())||null}),p=e.computed(()=>{var _;const{view:r}=u;return s.schedules.length&&(r.isDay||r.isDays||r.isWeek)&&((_=s.schedules)==null?void 0:_.map((a,B)=>({...a,id:a.id??B+1})))||void 0}),E=e.computed(()=>{const r={drag:!0,resize:!0,delete:!0,create:!0};return s.editableEvents===!0?r:s.editableEvents===!1?Object.keys(r).map(l=>r[l]=!1):{...r,...s.editableEvents}}),P=async r=>{var _;let l=Object.assign({"../i18n/ar.json":()=>import("./i18n/ar.json").then(a=>a.default),"../i18n/bg.json":()=>import("./i18n/bg.json").then(a=>a.default),"../i18n/bn.json":()=>import("./i18n/bn.json").then(a=>a.default),"../i18n/bs.json":()=>import("./i18n/bs.json").then(a=>a.default),"../i18n/ca.json":()=>import("./i18n/ca.json").then(a=>a.default),"../i18n/cs.json":()=>import("./i18n/cs.json").then(a=>a.default),"../i18n/da.json":()=>import("./i18n/da.json").then(a=>a.default),"../i18n/de.json":()=>import("./i18n/de.json").then(a=>a.default),"../i18n/el.json":()=>import("./i18n/el.json").then(a=>a.default),"../i18n/en-gb.json":()=>import("./i18n/en-gb.json").then(a=>a.default),"../i18n/en-us.json":()=>import("./i18n/en-us.json").then(a=>a.default),"../i18n/es.json":()=>import("./i18n/es.json").then(a=>a.default),"../i18n/et.json":()=>import("./i18n/et.json").then(a=>a.default),"../i18n/fa.json":()=>import("./i18n/fa.json").then(a=>a.default),"../i18n/fi.json":()=>import("./i18n/fi.json").then(a=>a.default),"../i18n/fr.json":()=>import("./i18n/fr.json").then(a=>a.default),"../i18n/he.json":()=>import("./i18n/he.json").then(a=>a.default),"../i18n/hr.json":()=>import("./i18n/hr.json").then(a=>a.default),"../i18n/hu.json":()=>import("./i18n/hu.json").then(a=>a.default),"../i18n/id.json":()=>import("./i18n/id.json").then(a=>a.default),"../i18n/is.json":()=>import("./i18n/is.json").then(a=>a.default),"../i18n/it.json":()=>import("./i18n/it.json").then(a=>a.default),"../i18n/ja.json":()=>import("./i18n/ja.json").then(a=>a.default),"../i18n/ka.json":()=>import("./i18n/ka.json").then(a=>a.default),"../i18n/ko.json":()=>import("./i18n/ko.json").then(a=>a.default),"../i18n/lt.json":()=>import("./i18n/lt.json").then(a=>a.default),"../i18n/mn.json":()=>import("./i18n/mn.json").then(a=>a.default),"../i18n/nl.json":()=>import("./i18n/nl.json").then(a=>a.default),"../i18n/no.json":()=>import("./i18n/no.json").then(a=>a.default),"../i18n/pl.json":()=>import("./i18n/pl.json").then(a=>a.default),"../i18n/pt-br.json":()=>import("./i18n/pt-br.json").then(a=>a.default),"../i18n/pt-pt.json":()=>import("./i18n/pt-pt.json").then(a=>a.default),"../i18n/ro.json":()=>import("./i18n/ro.json").then(a=>a.default),"../i18n/ru.json":()=>import("./i18n/ru.json").then(a=>a.default),"../i18n/sk.json":()=>import("./i18n/sk.json").then(a=>a.default),"../i18n/sl.json":()=>import("./i18n/sl.json").then(a=>a.default),"../i18n/sq.json":()=>import("./i18n/sq.json").then(a=>a.default),"../i18n/sr.json":()=>import("./i18n/sr.json").then(a=>a.default),"../i18n/sv.json":()=>import("./i18n/sv.json").then(a=>a.default),"../i18n/tr.json":()=>import("./i18n/tr.json").then(a=>a.default),"../i18n/uk.json":()=>import("./i18n/uk.json").then(a=>a.default),"../i18n/vi.json":()=>import("./i18n/vi.json").then(a=>a.default),"../i18n/zh-cn.json":()=>import("./i18n/zh-cn.json").then(a=>a.default),"../i18n/zh-hk.json":()=>import("./i18n/zh-hk.json").then(a=>a.default)});{if(!l[`../i18n/${r}.json`]){console.warn(`Vue Cal: the locale \`${r}\` does not exist. Falling back to \`en-us\`.`),r="en-us";return}l=await((_=l[`../i18n/${r}.json`])==null?void 0:_.call(l))}u.texts=Object.assign(u.texts,Object.assign({...ee.texts},l)),v.updateTexts(u.texts)};let j=e.reactive(s.events||[]);return e.watch(()=>s.events,r=>j.splice(0,j.length,...r)),(s.locale||!u.texts.today)&&P(s.locale||"en-us"),{...e.toRefs(s),events:j,eventListeners:c,defaultView:I,availableViews:z,disableDays:m,ready:k,sm:O,xs:g,clickToNavigate:C,hideWeekdays:h,hideWeekends:T,minTimestamp:t,maxTimestamp:f,schedules:p,selectedDate:d,editableEvents:E,view:b,get hasHiddenDays(){return Object.keys(h.value).length},get size(){return g.value?"xs":O.value?"sm":"lg"},loadTexts:P}},me=(u,s)=>{const i=s.timeTo-s.timeFrom;return(u-s.timeFrom)*100/i},fe=(u,s)=>{const i=s.timeTo-s.timeFrom;return~~(u*i/100+s.timeFrom)},be=(u,s)=>{const i=s.clientHeight;return u*100/i},we=e.reactive({id:null,date:null});let Me=!1,Te=!0;const le=e.reactive({el:null,cell:null,timeout:null}),oe=e.reactive({eventId:null,fromVueCal:null,toVueCal:null});function Ve(u){const{config:s,view:i,eventsManager:v,emit:k,uid:b,dateUtils:O}=u,g=t=>{var l;const{timeStep:f,timeCellHeight:p,timeFrom:E}=s,P=(((l=t.touches)==null?void 0:l[0])||t).clientY,{top:j}=t.currentTarget.getBoundingClientRect(),r=P-j-~~t.dataTransfer.getData("cursor-grab-at");return fe(be(r,t.currentTarget),s)},C=(t,f,p)=>{const E=f.duration||c(f.start,f.end)||s.timeStep;let P=Math.max(g(t),0);if(s.snapToInterval){const _=P+s.snapToInterval/2;P=_-_%s.snapToInterval}const j=new Date(new Date(p).setMinutes(P)),r=Math.min(P+E,24*60),l=new Date(new Date(p).setMinutes(r));return{start:j,end:l}},c=(t,f)=>Math.round((f-t)/6e4);return{eventDragStart:(t,f)=>{if(t.target.nodeType===3||u.touch.isResizingEvent)return t.preventDefault();t.dataTransfer.dropEffect="move";const p={...f,_:{id:f._.id,duration:c(f.start,f.end)}};t.dataTransfer.setData("event",JSON.stringify(p)),t.dataTransfer.setData("cursor-grab-at",t.offsetY),oe.eventId=f._.id,oe.fromVueCal=b;const E=t.target.closest(".vuecal__event");E.classList.add("vuecal__event--dragging-ghost"),setTimeout(()=>{E.classList.add("vuecal__event--dragging-original"),E.classList.remove("vuecal__event--dragging-ghost")},0),Me=!1,Object.assign(we,{id:i.id,date:i.firstCellDate}),Te=!0,u.touch.isDraggingEvent=!0},eventDragEnd:(t,f)=>{oe.eventId=null,t.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");const{fromVueCal:p,toVueCal:E}=oe;E&&p!==E&&v.deleteEvent(f._.id,3),oe.fromVueCal=null,oe.toVueCal=null,Me&&Te&&we.id&&i.switchView(we.id,we.date,!0),u.touch.isDraggingEvent=!1},cellDragEnter:(t,f)=>{const{start:p}=f,E=t.currentTarget;if(!t.currentTarget.contains(t.relatedTarget)){if(E===le.el||!E.className.includes("vuecal__cell-content"))return!1;le.el&&(le.cell.highlighted=!1),Object.assign(le,{el:E,cell:f,timeout:clearTimeout(le.timeout)}),f.highlighted=!0,["years","year","month"].includes(i.id)&&(le.timeout=setTimeout(()=>u.switchToNarrowerView(p),2e3))}},cellDragOver:(t,f)=>{const{start:p,schedule:E}=f;t.preventDefault(),f.highlighted=!0,(E||E===0)&&(f.highlightedSchedule=E)},cellDragLeave:(t,f)=>{t.preventDefault(),!t.currentTarget.contains(t.relatedTarget)&&(f.highlightedSchedule=!1,le.cell===f&&(clearTimeout(le.timeout),Object.assign(le,{el:null,cell:null,timeout:null}),f.highlighted=!1))},cellDragDrop:async(t,f)=>{var B,V,F;t.preventDefault(),clearTimeout(le.timeout),Object.assign(le,{el:null,cell:null,timeout:null});const p=JSON.parse(t.dataTransfer.getData("event")||"{}");p.start&&(p.start=new Date(p.start)),p.end&&(p.end=new Date(p.end));let E;const{start:P,end:j}=C(t,p,f.start),{schedule:r}=((B=t.target.closest("[data-schedule]"))==null?void 0:B.dataset)||{};let l=()=>{};oe.fromVueCal===b?(E=v.getEvent(p._.id),E&&(E._.dragging=!1,l=()=>{E.start=P,E.end=j,r!==void 0&&(E.schedule=~~r)})):(E={...p,start:P,end:j,...r!==void 0&&{schedule:~~r},_:{id:((V=p._)==null?void 0:V.id)||p.id,duration:c(P,j)},getOverlappingEvents:()=>v.getEventsInRange(v.getEventsByDate(O.formatDate(P),!0),{start:P,end:j},{schedule:~~r})},l=()=>{E=v.createEvent(E)});let _=!0;const{drop:a}=(F=s.eventListeners)==null?void 0:F.event;a&&(_=await a({e:t,event:{...E,start:P,end:j,schedule:~~r},overlaps:E.getOverlappingEvents({start:P,end:j,schedule:~~r}),cell:f,external:oe.fromVueCal!==b})),_!==!1&&l(),f.highlighted=!1,f.highlightedSchedule=null,Te=!1,oe.toVueCal=b,k("event-dropped",{event:E,originalEvent:p,external:oe.fromVueCal!==b}),k("event-change",{event:E,originalEvent:p})}}}const $e=u=>{let s,i,v,k={},b={};const O=e.ref(u),g=()=>{Date.prototype.addDays=function(n){return T(this,n||0)},Date.prototype.subtractDays=function(n){return z(this,n||0)},Date.prototype.addHours=function(n){return I(this,n||0)},Date.prototype.subtractHours=function(n){return d(this,n||0)},Date.prototype.addMinutes=function(n){return m(this,n||0)},Date.prototype.subtractMinutes=function(n){return t(this,n||0)},Date.prototype.getWeek=function(){return p(this)},Date.prototype.isToday=function(){return E(this)},Date.prototype.isLeapYear=function(){return r(this)},Date.prototype.format=function(n="YYYY-MM-DD"){return G(this,n)},Date.prototype.formatTime=function(n="HH:mm"){return J(this,n)}},C=()=>{delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime},c=n=>O.value=n,h=()=>(i!==new Date().getDate()&&(s=new Date,i=s.getDate(),v=`${s.getFullYear()}-${s.getMonth()}-${s.getDate()}`),v),T=(n,w)=>{const D=new Date(n.valueOf());return D.setDate(D.getDate()+w),D},z=(n,w)=>{const D=new Date(n.valueOf());return D.setDate(D.getDate()-w),D},I=(n,w)=>{const D=new Date(n.valueOf());return D.setHours(D.getHours()+w),D},d=(n,w)=>{const D=new Date(n.valueOf());return D.setHours(D.getHours()-w),D},m=(n,w)=>{const D=new Date(n.valueOf());return D.setMinutes(D.getMinutes()+w),D},t=(n,w)=>{const D=new Date(n.valueOf());return D.setMinutes(D.getMinutes()-w),D},f=(n,w)=>{const D=A=>{const X=A%w;return X!==0&&(A+=X>=w/2?w-X:-X),A};if(typeof n=="number")return D(n);if(n instanceof Date){let A=D(n.getMinutes());A>=60&&(n.setHours(n.getHours()+1),A=0),n.setMinutes(A,0,0)}},p=(n,w=!1)=>{const D=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())),A=D.getUTCDay()||7;D.setUTCDate(D.getUTCDate()+4-A);const X=new Date(Date.UTC(D.getUTCFullYear(),0,1));return Math.ceil(((D-X)/864e5+1)/7)+(w?1:0)},E=n=>`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`===h(),P=(n,w)=>{if(!n||!w)return console.warn(`Vue Cal: missing date${n?"2":"1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);if(F(n)){if(!F(w))return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${w}\`.`)}else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${n}\`.`);return n.getFullYear()===w.getFullYear()&&n.getMonth()===w.getMonth()&&n.getDate()===w.getDate()},j=(n,w,D)=>F(n)?n.getTime()>=w&&n.getTime()<=D:console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${n}\`.`),r=n=>{const w=n.getFullYear();return!(w%400)||w%100&&!(w%4)},l=(n=null,w)=>{const D=n&&new Date(n.valueOf())||new Date,A=w?7:6;return D.setDate(D.getDate()-(D.getDay()+A)%7),D},_=n=>n instanceof Date?n:(n.length===10&&(n+=" 00:00"),new Date(n.replace(/-/g,"/"))),a=n=>n.getHours()*60+n.getMinutes(),B=(n,w)=>{typeof n=="string"&&(n=n.replace(/-/g,"/")),typeof w=="string"&&(w=w.replace(/-/g,"/")),n=new Date(n).setHours(0,0,0,0),w=new Date(w).setHours(0,0,1,0);const D=(new Date(w).getTimezoneOffset()-new Date(n).getTimezoneOffset())*60*1e3;return Math.ceil((w-n-D)/(24*3600*1e3))},V=(n,w,D)=>Math.abs(n.getTime()-w.getTime())<=D*60*1e3,F=n=>n&&n instanceof Date&&!isNaN(n),G=(n,w="YYYY-MM-DD",D=null)=>{if(D||(D=O.value),w||(w="YYYY-MM-DD"),w==="YYYY-MM-DD")return Q(n);k={},b={};const A={YYYY:()=>U(n,D).YYYY,YY:()=>U(n,D).YY(),M:()=>U(n,D).M,MM:()=>U(n,D).MM(),MMM:()=>U(n,D).MMM(),MMMM:()=>U(n,D).MMMM(),MMMMG:()=>U(n,D).MMMMG(),D:()=>U(n,D).D,DD:()=>U(n,D).DD(),S:()=>U(n,D).S(),d:()=>U(n,D).d,dd:()=>U(n,D).dd(),ddd:()=>U(n,D).ddd(),dddd:()=>U(n,D).dddd(),HH:()=>x(n,D).HH,H:()=>x(n,D).H,hh:()=>x(n,D).hh,h:()=>x(n,D).h,am:()=>x(n,D).am,AM:()=>x(n,D).AM,mm:()=>x(n,D).mm,m:()=>x(n,D).m,s:()=>x(n,D).s};return w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(X,te)=>{const o=A[te.replace(/\{|\}/g,"")];return o!==void 0?o():te})},Q=n=>{const w=n.getMonth()+1,D=n.getDate();return`${n.getFullYear()}-${w<10?"0":""}${w}-${D<10?"0":""}${D}`},J=(n,w="HH:mm",D=null,A=!1)=>{let X=!1;if(A){const[M,S,$]=[n.getHours(),n.getMinutes(),n.getSeconds()];M+S+$===141&&(X=!0)}if(n instanceof Date&&w==="HH:mm")return X?"24:00":K(n);b={},D||(D=O.value);const te=x(n,D),o=w.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(M,S)=>{const $=te[S.replace(/\{|\}/g,"")];return $!==void 0?$:S});return X?o.replace("23:59","24:00"):o},K=n=>{const w=n.getHours(),D=n.getMinutes();return`${(w<10?"0":"")+w}:${(D<10?"0":"")+D}`},re=n=>{const w=Math.floor(n/60).toString().padStart(2,0),D=(n%60).toString().padStart(2,0);return`${w}:${D}`},q=n=>{if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},U=(n,w)=>{if(k.D)return k;const D=n.getFullYear(),A=n.getMonth()+1,X=n.getDate(),o=(n.getDay()-1+7)%7;return k={YYYY:D,YY:()=>D.toString().substring(2),M:A,MM:()=>A.toString().padStart(2,0),MMM:()=>w.months[A-1].substring(0,3),MMMM:()=>w.months[A-1],MMMMG:()=>(w.monthsGenitive||w.months)[A-1],D:X,DD:()=>X.toString().padStart(2,0),S:()=>q(X),d:o+1,dd:()=>w.weekDaysShort.length?w.weekDaysShort[o]:w.weekDays[o][0],ddd:()=>w.weekDaysShort.length?w.weekDaysShort[o]:w.weekDays[o].substr(0,3),dddd:()=>w.weekDays[o]},k},x=(n,w)=>{if(b.am)return b;let D,A,X;n instanceof Date?(D=n.getHours(),A=n.getMinutes(),X=n.getSeconds()):(D=Math.floor(n/60),A=Math.floor(n%60));const te=D%12?D%12:12,o=(w||{am:"am",pm:"pm"})[D===24||D<12?"am":"pm"];return b={H:D,h:te,HH:D.toString().padStart(2,0),hh:te.toString().padStart(2,0),am:o,AM:o.toUpperCase(),m:A,mm:A.toString().padStart(2,0),s:X},b};return{addDatePrototypes:g,removeDatePrototypes:C,updateTexts:c,addDays:T,subtractDays:z,addHours:I,subtractHours:d,addMinutes:m,subtractMinutes:t,snapToInterval:f,getWeek:p,isToday:E,isSameDate:P,isInRange:j,isLeapYear:r,getPreviousFirstDayOfWeek:l,stringToDate:_,dateToMinutes:a,countDays:B,datesInSameTimeStep:V,isValid:F,formatDate:G,formatDateLite:Q,formatTime:J,formatTimeLite:K,formatMinutes:re}},Ye=u=>{const{dateUtils:s,config:i}=u;let v=0;const k=e.computed(()=>{const d={byDate:{},recurring:[],multiday:[],byId:{}};return i.events.sort((t,f)=>t.start-f.start<0?-1:1).forEach(t=>{b(t),t._||(t._={}),t._.id=t._.id||++v,t.delete||(t.delete=f=>h(t._.id,f)),t._.deleting=!1,t._.deleted=!1,t.isOverlapping=(f=null)=>t.getOverlappingEvents(f).length,t.getOverlappingEvents=(f=null)=>{var p;return z(g(s.formatDate((f==null?void 0:f.start)||t.start),!0),{start:(f==null?void 0:f.start)||t.start,end:(f==null?void 0:f.end)||t.end},{excludeIds:[t._.id],schedule:(p=i.schedules)!=null&&p.length?~~((f==null?void 0:f.schedule)||t.schedule):null})},t._.register=f=>{t._.$el=f,t._.fireCreated&&(u.emit("event-created",t),delete t._.fireCreated)},t._.unregister=()=>{t._.$el=null,t._.register=null,t.isOverlapping=null,t.getOverlappingEvents=null,t.delete=null},d.byId[t._.id]=t,t.recurring?d.recurring.push(t._.id):t._.multiday?(d.multiday.push(t._.id),d.byDate[t._.startFormatted]||(d.byDate[t._.startFormatted]=[]),d.byDate[t._.startFormatted].push(t._.id)):(d.byDate[t._.startFormatted]||(d.byDate[t._.startFormatted]=[]),d.byDate[t._.startFormatted].push(t._.id))}),d}),b=d=>{if(typeof d.start=="string"&&(d.start=s.stringToDate(d.start)),typeof d.end=="string"&&(d.end=s.stringToDate(d.end)),d.start.setSeconds(0,0),d.end.setSeconds(0,0),isNaN(d.start)||isNaN(d.end)){isNaN(d.start)?console.error(`Vue Cal: invalid start date for event "${d.title}".`,d.start):console.error(`Vue Cal: invalid end date for event "${d.title}".`,d.end);return}else d.end.getTime()<d.start.getTime()&&console.error(`Vue Cal: invalid event dates for event "${d.title}". The event ends before it starts.`,d.start,d.end);d._||(d._={}),d._.multiday=!s.isSameDate(d.start,new Date(d.end.getTime()-1)),d._.startFormatted=s.formatDate(d.start),d._.startMinutes=~~s.dateToMinutes(d.start),d._.endMinutes=~~s.dateToMinutes(d.end);const m=d.start.getHours(),t=d.start.getMinutes().toString().padStart(2,0),f=d.end.getHours(),p=d.end.getMinutes().toString().padStart(2,0);d._.startTimeFormatted24=`${m.toString().padStart(2,0)}:${t}`,d._.startTimeFormatted12=`${m%12||12}${t?`:${t}`:""} ${m<12?"AM":"PM"}`,d._.endTimeFormatted24=`${f.toString().padStart(2,0)}:${p}`,d._.endTimeFormatted12=`${f%12||12}${p?`:${p}`:""} ${f<12?"AM":"PM"}`,d._.duration=Math.abs(~~((d.end-d.start)/6e4))},O=d=>k.value.byId[d],g=(d,m=!1,t=!1)=>{let f=k.value.byDate[d]||[];return f=m||t?f.map(O):f,t||(f=f.filter(p=>!p.background),m||(f=f.map(p=>p._.id))),f},C=d=>{const m={};return d.forEach(({startFormatted:t})=>{m[t]=[];const f=g(t,!1,!0);f.length&&m[t].push(...f)}),m},c=d=>{if(!d.start||!d.end){console.error("Vue Cal: Cannot create an event without valid start and end dates.");return}return i.snapToInterval&&(s.snapToInterval(d.start,i.snapToInterval),s.snapToInterval(d.end,i.snapToInterval)),d={...d},d._||(d._={}),d._.id=++v,d._.fireCreated=!0,i.events.push(d),d},h=(d,m=0)=>{var p;if(!i.editableEvents.delete)return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");if(!d)return console.warn("Vue Cal: Cannot delete event without its ID.");const t=i.events.findIndex(E=>E._.id===d);if(t===-1)return console.warn(`Vue Cal: Cannot delete unknown event \`${d}\`.`);const f=i.events[t];if(f.deletable===!1)return console.warn(`Vue Cal: Can't delete event \`${d}\` since it was explicitely set to \`delete: false\`.`);switch(m){case 0:f._.deleting?i.events.splice(t,1):f._.deleting=!0;break;case 1:f._.deleting=!0;break;case 2:f._.deleted=!0,i.events[t]._.deleted=!0,(p=f._.$el)==null||p.dispatchEvent(new CustomEvent("event-deleted",{detail:f._.id}));break;case 3:i.events.splice(t,1),u.emit("update:events",i.events),u.emit("event-delete",f);break}return!0},T=d=>{const m=g(d,!0);if(!m.length)return{cellOverlaps:{},longestStreak:0};let t={},f=[],p=0;m.sort((E,P)=>E.start-P.start||E.end-E.start-(P.end-P.start));for(const E of m){const P=E._.id;t[P]||(t[P]={overlaps:new Set,maxConcurrent:1,position:0}),f=f.filter(a=>a.end>E.start);let j=f.filter(a=>{var V;return(!((V=i.schedules)!=null&&V.length)||E.schedule===a.schedule)&&a.start<E.end}),r=new Set(j.map(a=>{var B;return((B=t[a._.id])==null?void 0:B.position)??0})),l=0;for(;r.has(l);)l++;t[P].position=l,f.push(E);let _=Math.max(1,...j.map(a=>{var B;return((B=t[a._.id])==null?void 0:B.maxConcurrent)??1}));t[P].maxConcurrent=Math.max(j.length+1,_);for(const a of j)t[a._.id].overlaps.add(P),t[P].overlaps.add(a._.id),t[a._.id].maxConcurrent=t[P].maxConcurrent;p=Math.max(p,t[P].maxConcurrent)}for(const E in t)t[E].overlaps=[...t[E].overlaps];return{cellOverlaps:t,longestStreak:p}},z=(d=[],{start:m,end:t},{excludeIds:f=[],schedule:p=null})=>{var j;const E=new Set(f),P=[];for(const r of d)!E.has((j=r._)==null?void 0:j.id)&&(p===null||p===r.schedule)&&I(r,m,t)&&P.push(r);return P},I=(d,m,t)=>{const f=d.allDay||!i.time,p=f?new Date(d.start).setHours(0,0,0,0):d.start.getTime(),E=f?new Date(d.end).setHours(23,59,59,999):d.end.getTime(),P=f?new Date(m).setHours(0,0,0,0):m.getTime(),j=f?new Date(t).setHours(23,59,59,999):t.getTime();return E>P&&p<j};return{events:k,getEvent:O,getEventsByDate:g,getViewEvents:C,getCellOverlappingEvents:T,getEventsInRange:z,createEvent:c,deleteEvent:h,isEventInRange:I}},Pe=({config:u,dateUtils:s,emit:i,texts:v,eventsManager:k},b)=>{const{availableViews:O}=u,g=e.ref(u.view&&O[u.view]?u.view:u.defaultView),C=e.ref(u.selectedDate||null);let c=e.ref(new Date);const h=e.ref(new Date(u.viewDate||c.value));h.value.setHours(0,0,0,0);const T=e.ref(new Date(h));let z=null;const I=e.computed(()=>g.value==="month"?T.value:l.value),d=e.computed(()=>g.value==="month"?new Date(T.value.getFullYear(),T.value.getMonth()+1,0,23,59,59,999):a.value),m=e.computed(()=>g.value==="week"?s.getPreviousFirstDayOfWeek(l.value,u.startWeekOnSunday):g.value==="month"?l.value:I.value),t=e.computed(()=>{if(g.value==="week"){const y=s.addDays(m.value,7);return y.setMilliseconds(-1),y}else if(g.value==="month")return a.value;return d.value}),f=e.computed(()=>{const y=c.value.getTime();if(g.value==="week")return m.value.getTime()<=y&&y<=t.value.getTime();const Y=l.value.getTime(),H=a.value.getTime();return Y<=y&&y<=H});function p(){c.value=new Date,z=setTimeout(p,60*1e3)}function E(){z=setTimeout(p,(60-new Date().getSeconds())*1e3),p()}const P=e.computed(()=>{if(!u.availableViews[g.value])return 1;let y=u.availableViews[g.value].cols;return u.hasHiddenDays&&["week","month"].includes(g.value)&&(y-=u.hasHiddenDays),y}),j=e.computed(()=>{var y;return((y=u.availableViews[g.value])==null?void 0:y.rows)||1}),r=e.computed(()=>P.value*j.value),l=e.computed(()=>{if(g.value==="month"){let y=T.value.getDay()||7;return u.startWeekOnSunday&&!u.hideWeekdays[7]&&(y+=1),u.viewDayOffset&&(y-=u.viewDayOffset),s.subtractDays(T.value,y-1)}else if(g.value==="week"){const y="1234567".split("").filter(H=>!Object.keys(u.hideWeekdays).includes(H));let Y=Math.min(...y);return u.startWeekOnSunday&&!u.hideWeekdays[7]&&(Y=1),u.viewDayOffset&&(Y+=u.viewDayOffset),s.addDays(T.value,Y-1)}else return T.value}),_=e.computed(()=>{const y=[],Y=["days","week","month"].includes(g.value);let H=0;for(let R=0;R<r.value+H;R++)switch(g.value){case"day":case"days":case"week":case"month":{const ne=s.addDays(l.value,R),ve=ne.getDay()||7;if(Y&&u.hasHiddenDays&&u.hideWeekdays[ve]){H++;continue}const ge=new Date(ne);ge.setHours(23,59,59,999),y.push({start:ne,startFormatted:s.formatDate(ne),end:ge});break}case"year":y.push({start:new Date(l.value.getFullYear(),R,1,0,0,0,0),end:new Date(l.value.getFullYear(),R+1,0,23,59,59,999)});break;case"years":y.push({start:new Date(l.value.getFullYear()+R,0,1,0,0,0,0),end:new Date(l.value.getFullYear()+R+1,0,0,23,59,59,999)});break}return y}),a=e.computed(()=>_.value[_.value.length-1].end),B=e.ref("right"),V=e.computed(()=>{const y=Object.keys(u.availableViews);return y[y.indexOf(g.value)+1]}),F=e.computed(()=>{const y=Object.keys(u.availableViews);return y[y.indexOf(g.value)-1]});function G(y,Y,H=!1){if(!Y||!Y[y])return y+1;const R=Y[y];return H&&typeof R=="string"?R.substring(0,3):R}function Q(y,Y,H){const{monthsArray:R,monthBeforeDay:ne,canTruncate:ve,xs:ge}=H,ce=y.getMonth(),de=y.getFullYear(),ue=Y.getMonth(),ye=Y.getFullYear(),_e=ce!==ue,Zt=de!==ye,ie=ve&&(ge||_e),pe=y.getDate(),De=Y.getDate();return Zt?ne?`${G(ce,R,ie)} ${pe}, ${de} - ${G(ue,R,ie)} ${De}, ${ye}`:`${pe} ${G(ce,R,ie)} ${de} - ${De} ${G(ue,R,ie)} ${ye}`:_e?ne?`${G(ce,R,ie)} ${pe} - ${G(ue,R,ie)} ${De}, ${de}`:`${pe} ${G(ce,R,ie)} - ${De} ${G(ue,R,ie)} ${de}`:ne?`${G(ce,R,ie)} ${pe}-${De}, ${de}`:`${pe}-${De} ${G(ce,R,ie)} ${de}`}const J=e.computed(()=>{const{dateFormat:y,months:Y,monthsGenitive:H,week:R,truncations:ne}=v,ve=u.locale,ge=ne!==!1,ce=y.indexOf("M")<y.indexOf("D"),de=H&&ve==="el"?H:Y;switch(g.value){case"day":return s.formatDate(l.value,y);case"days":case"week":{const ue={monthsArray:de,monthBeforeDay:ce,canTruncate:ge,xs:u.xs};let ye=Q(l.value,a.value,ue);if(g.value==="week"){const _e=s.getWeek(l.value,u.startWeekOnSunday&&!u.hideWeekdays[7]);ye+=` <small>${R} ${_e}</small>`}return ye}case"month":{const ue=`${u.xs&&ge?"MMM":"MMMM"} YYYY`;return s.formatDate(I.value,ue)}case"year":return l.value.getFullYear();case"years":return`${l.value.getFullYear()} - ${d.value.getFullYear()}`}});function K(){switch(T.value=new Date(h.value||c.value),T.value.setHours(0,0,0,0),g.value){case"day":break;case"days":break;case"week":T.value=s.getPreviousFirstDayOfWeek(T.value,u.startWeekOnSunday&&!u.hideWeekdays[7]);break;case"month":T.value=new Date(T.value.getFullYear(),T.value.getMonth(),1,0,0,0,0);break;case"year":T.value=new Date(T.value.getFullYear(),0,1,0,0,0,0);break;case"years":T.value=new Date(T.value.getFullYear()-T.value.getFullYear()%r.value,0,1,0,0,0,0);break}i("view-change",{id:g.value,title:J.value,start:I.value,end:d.value,extendedStart:m.value,extendedEnd:t.value,cellDates:_.value,containsToday:f.value,events:Z.value}),c.value=new Date}function re(y){const Y=g.value,H=u.availableViews[Y];y[Y]&&JSON.stringify(y[Y])===JSON.stringify(H)||K()}function q(y,Y=!0){const H=Object.keys(u.availableViews);g.value!==y&&(H.includes(y)?(B.value=H.indexOf(y)<H.indexOf(g.value)?"left":"right",g.value=y,i("update:view",y),K()):console.warn(`Vue Cal: the \`${y}\` view is not available.`))}function U(){V.value?q(V.value):console.warn("Vue Cal: no broader view is available.")}function x(){F.value?q(F.value):console.warn("Vue Cal: no narrower view is available.")}function n(){D(!1)}function w(){D(!0)}function D(y=!0){let Y=new Date(h.value);switch(g.value){case"day":case"days":y?Y=s.addDays(a.value,1):Y=s.subtractDays(l.value,r.value);break;case"week":{y?(Y=s.addDays(t.value,1),Y.setHours(0,0,0,0)):Y=s.subtractDays(m.value,r.value);break}case"month":{const H=y?1:-1;Y=new Date(Y.getFullYear(),Y.getMonth()+H,1,0,0,0,0);break}case"year":{const H=y?1:-1;Y=new Date(Y.getFullYear()+H,1,1,0,0,0,0);break}case"years":{const H=y?r.value:-r.value;Y=new Date(Y.getFullYear()+H,1,1,0,0,0,0);break}}X(Y)}function A(){const y=new Date;y.setHours(0,0,0,0),X(y)}function X(y,Y=!0,H=!1){if(!s.isValid(y))return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");let[R,ne]=[l.value,a.value];g.value==="month"&&([R,ne]=[I.value,d.value]),(!s.isInRange(y,R,ne)||H)&&(y.setHours(0,0,0,0),B.value=y.getTime()<R.getTime()?"left":"right",h.value=y,Y&&i("update:viewDate",y),K())}function te(y,Y=!0){if(s.isValid(y)){const{isValid:H,isSameDate:R}=s;(!C.value||!H(C.value)||!R(y,C.value))&&(y.setHours(0,0,0,0),C.value=y,Y&&i("update:selectedDate",y))}else return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.")}function o(y){!y&&!T.value.getDay()?X(s.addDays(T.value,1),!0,!0):(B.value="left",K())}function M(y){y&&u.startWeekOnSunday&&!T.value.getDay()?X(s.addDays(T.value,1),!0,!0):!y&&u.startWeekOnSunday&&T.value.getDay()===1&&X(s.subtractDays(T.value,1),!0,!0)}function S(){console.log("toggling weekdays",u.hideWeekdays)}function $(y){var R;const Y=(R=b.value)==null?void 0:R.querySelector(".vuecal__scrollable"),H=y?y*u.timeCellHeight/u.timeStep:0;Y==null||Y.scrollTo({top:H,behavior:"smooth"})}function N(){const y=new Date;$(y.getHours()*60+y.getMinutes())}function L(){$(0)}const Z=e.computed(()=>k.getViewEvents(_.value)),ae=k.createEvent,se=k.deleteEvent;return e.watch(()=>u.view,y=>q(y,!1)),e.watch(()=>u.availableViews,re),e.watch(()=>u.datePicker,()=>q("month",!1)),e.watch(()=>u.viewDate,y=>X(y,!1)),e.watch(()=>u.selectedDate,y=>te(y,!1)),e.watch(()=>u.startWeekOnSunday,y=>o(y)),e.watch(()=>u.hideWeekends,y=>M(y)),e.watch(()=>u.hideWeekdays,S),e.watch(()=>r.value,()=>{r.value>90&&console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.")}),e.watch(()=>u.watchRealTime,y=>{y&&u.time?E():z=clearTimeout(z)}),K(),u.time&&u.watchRealTime&&E(),e.onBeforeUnmount(()=>z=clearTimeout(z)),{now:c,id:g,broaderView:V,narrowerView:F,title:J,viewDate:h,start:I,end:d,extendedStart:m,extendedEnd:t,firstCellDate:l,lastCellDate:a,containsToday:f,selectedDate:C,cellDates:_,cols:P,rows:j,events:Z,transitionDirection:B,switch:q,broader:U,narrower:x,previous:n,next:w,navigate:D,goToToday:A,updateViewDate:X,updateSelectedDate:te,scrollToCurrentTime:N,scrollToTime:$,scrollTop:L,createEvent:ae,deleteEvent:se,get isDay(){return g.value==="day"},get isDays(){return g.value==="days"},get isWeek(){return g.value==="week"},get isMonth(){return g.value==="month"},get isYear(){return g.value==="year"},get isYears(){return g.value==="years"}}},he=e.reactive({texts:{...ee.texts},dateUtils:$e(ee.texts)}),Oe=({props:u,emit:s,attrs:i,vuecalEl:v,uid:k})=>{const b=e.reactive({uid:k,emit:s,texts:{...he.texts},dateUtils:{...he.dateUtils},now:new Date,config:{},eventsManager:{},view:{},dnd:{},touch:{isDraggingCell:!1,isDraggingEvent:!1,isResizingEvent:!1}});return b.dateUtils=$e(Object.assign(ee.texts,b.texts)),b.config=Be(b,u,i),b.eventsManager=Ye(b),b.view=Pe(b,v),b.dnd=Ve(b),b},ze=24*60,Ne={allDayEvents:{type:[Boolean,String],default:!1},clickToNavigate:{type:Boolean,default:void 0},dark:{type:Boolean,default:!1},datePicker:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},editableEvents:{type:[Boolean,Object],default:!1},eventCreateMinDrag:{type:Number,default:15},events:{type:Array,default:()=>[]},eventCount:{type:Boolean,default:!1},eventsOnMonthView:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:String,default:""},maxDate:{type:[String,Date],default:""},minDate:{type:[String,Date],default:""},selectedDate:{type:[String,Date],default:""},sm:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},schedules:{type:Array,default:()=>[]},snapToInterval:{type:Number,default:0},startWeekOnSunday:{type:Boolean,default:!1},theme:{type:[String,Boolean],default:"default"},time:{type:Boolean,default:!0},timeAtCursor:{type:Boolean,default:!1},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:ze},titleBar:{type:Boolean,default:!0},todayButton:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},view:{type:String,default:""},viewDate:{type:[String,Date],default:""},viewDayOffset:{type:Number,default:0},views:{type:[Array,Object]},viewsBar:{type:Boolean,default:!0},watchRealTime:{type:Boolean,default:!1},weekNumbers:{type:Boolean,default:!1},xs:{type:Boolean,default:!1}},je={class:"vuecal__header"},Le={key:0,class:"vuecal__views-bar"},Fe=["onClick","innerHTML"],He={key:1,class:"vuecal__title-bar"},We={class:"vuecal__transition-wrap"},Re=["disabled","innerHTML"],Ie={__name:"header",setup(u){const s=e.inject("vuecal"),{view:i,config:v}=s,k=()=>{v.clickToNavigate&&i.broader()},b=e.computed(()=>v.clickToNavigate?{click:k}:{});return(O,g)=>(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(O.$slots,"header",{view:e.unref(i),availableViews:e.unref(v).availableViews,vuecal:e.unref(s)}),O.$slots.header?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(v).viewsBar?(e.openBlock(),e.createElementBlock("div",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).availableViews,(C,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["vuecal__view-button",{"vuecal__view-button--active":e.unref(i).id===c}]),onClick:h=>e.unref(i).switch(c),innerHTML:e.unref(s).texts[c],type:"button"},null,10,Fe))),256))])):e.createCommentVNode("",!0),e.unref(v).titleBar?(e.openBlock(),e.createElementBlock("nav",He,[e.createElementVNode("button",{class:e.normalizeClass(["vuecal__nav vuecal__nav--prev",{"vuecal__nav--default":!O.$slots["previous-button"]}]),onClick:g[0]||(g[0]=(...C)=>e.unref(i).previous&&e.unref(i).previous(...C)),type:"button"},[e.renderSlot(O.$slots,"previous-button")],2),e.createElementVNode("div",We,[e.createVNode(e.Transition,{name:`vuecal-slide-fade--${e.unref(i).transitionDirection}`},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{key:e.unref(i).id+e.unref(i).start.getTime()},[O.$slots.title?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).clickToNavigate&&e.unref(i).broaderView?"button":"div"),e.mergeProps({key:0,class:"vuecal__title"},e.toHandlers(b.value)),{default:e.withCtx(()=>[e.renderSlot(O.$slots,"title",e.normalizeProps(e.guardReactiveProps(e.unref(i))))]),_:3},16)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v).clickToNavigate&&e.unref(i).broaderView?"button":"div"),e.mergeProps({key:1,class:"vuecal__title"},e.toHandlers(b.value),{innerHTML:e.unref(i).title}),null,16,["innerHTML"]))]))]),_:3},8,["name"])]),e.unref(v).todayButton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[O.$slots["today-button"]?e.renderSlot(O.$slots,"today-button",{key:0,navigate:()=>!e.unref(i).containsToday&&e.unref(i).goToToday(),active:e.unref(i).containsToday}):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vuecal__nav vuecal__nav--today vuecal__nav--default",{"vuecal__nav--active":e.unref(i).containsToday}]),onClick:g[1]||(g[1]=C=>!e.unref(i).containsToday&&e.unref(i).goToToday()),disabled:!!e.unref(i).containsToday,type:"button",innerHTML:e.unref(s).texts.today},null,10,Re))],64)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["vuecal__nav vuecal__nav--next",{"vuecal__nav--default":!O.$slots["next-button"]}]),onClick:g[2]||(g[2]=(...C)=>e.unref(i).next&&e.unref(i).next(...C)),type:"button"},[e.renderSlot(O.$slots,"next-button")],2)])):e.createCommentVNode("",!0)],64))]))}},Ae={key:0,class:"vuecal__headings"},Xe={key:0,class:"vuecal__weekdays-headings"},Ge=["onClick"],Ue={class:"vuecal__weekday-day"},qe={key:0,class:"vuecal__weekday-date"},Ze={key:1,class:"vuecal__schedules-headings w-flex grow"},Je=["innerHTML"],Ke={__name:"headings-bar",setup(u){const s=e.inject("vuecal"),{view:i,config:v,dateUtils:k}=s,b=e.computed(()=>v.xs?"day-xs":v.sm||i.isDays||i.isMonth?"day-sm":"day"),O=e.computed(()=>(i.isDay||i.isDays||i.isWeek||i.isMonth)&&!(i.isDay&&!v.schedules)),g=e.computed(()=>i.cellDates.slice(0,i.cols).map(({start:c})=>({id:ke[c.getDay()],date:c,dateNumber:c.getDate(),day:k.formatDate(c,"dddd"),"day-sm":k.formatDate(c,"ddd"),"day-xs":k.formatDate(c,"dd"),isToday:k.isToday(c)}))),C={click:c=>{(i.isDays||i.isWeek)&&i.updateSelectedDate(c)}};return(c,h)=>O.value?(e.openBlock(),e.createElementBlock("div",Ae,[e.unref(i).isDay?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__weekday",{"vuecal__weekday--today":T.isToday}]),key:z,onClick:I=>C.click(T.date)},[e.renderSlot(c.$slots,"weekday-heading",{label:T[b.value],id:T.id,date:T.date},()=>[e.createElementVNode("span",Ue,e.toDisplayString(T[b.value]),1),e.unref(i).isMonth?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("strong",qe,e.toDisplayString(T.dateNumber),1))])],10,Ge))),128))])),e.unref(v).schedules?(e.openBlock(),e.createElementBlock("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:z},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).schedules,(I,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[c.$slots["schedule-heading"]?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vuecal__schedule vuecal__schedule--heading",I.class])},[e.renderSlot(c.$slots,"schedule-heading",{schedule:I,view:e.unref(i)})],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["vuecal__schedule vuecal__schedule--heading",I.class]),innerHTML:I.label},null,10,Je))],64))),128))],64))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}},Qe={class:"vuecal__time-column"},xe={__name:"time-column",setup(u){const s=e.inject("vuecal"),{config:i,texts:v}=s,k=e.computed(()=>{const b=[];for(let g=i.timeFrom;g<i.timeTo;g+=i.timeStep){const C=~~(g/60),c=g%60,h=v[g<720?"am":"pm"];b.push({minutesSum:g,hours:C,minutes:c,formatted12:`${C%12?C%12:12}${c?":"+c.toString().padStart(2,0):""}${h}`,formatted24:`${C.toString().padStart(2,0)}:${c.toString().padStart(2,0)}`})}return b});return(b,O)=>(e.openBlock(),e.createElementBlock("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(g,C)=>(e.openBlock(),e.createElementBlock("div",{class:"vuecal__time-cell",key:C},[e.renderSlot(b.$slots,"time-cell",{index:C,minutes:g.minutes,hours:g.hours,minutesSum:g.minutesSum,format12:g.formatted12,format24:g.formatted24},()=>[e.createElementVNode("label",null,e.toDisplayString(e.unref(i).twelveHour?g.formatted12:g.formatted24),1)])]))),128))]))}},et=["draggable"],tt={class:"vuecal__event-details"},at={class:"vuecal__event-title"},nt={key:0,class:"vuecal__event-time"},st=["innerHTML"],Ee={__name:"event",props:{event:{type:Object,required:!0}},emits:["event-drag-start","event-drag-end","event-resize-start","event-resize-end"],setup(u,{emit:s}){const{config:i,view:v,dnd:k,touch:b,dateUtils:O}=e.inject("vuecal"),g=u,C=e.ref(null),c=e.reactive(g.event),h=e.reactive({dragging:!1,resizing:!1,fromResizer:!1,holding:!1,holdTimer:null,startX:0,startY:0,startPercentageX:0,startPercentageY:0,moveX:0,moveY:0,movePercentageX:0,movePercentageY:0,resizeStartDate:null,resizingOriginalEvent:null,resizingLastAcceptedEvent:null,cellEl:null,schedule:null}),T=e.computed(()=>i.editableEvents.drag&&c.draggable!==!1&&!c.background),z=e.computed(()=>i.time&&i.editableEvents.resize&&c.resizable!==!1&&!c.background);e.computed(()=>i.editableEvents.delete&&c.deletable!==!1&&!c.background);const I=e.computed(()=>{var r,l,_;return{[`vuecal__event--${c._.id}`]:!0,[c.class]:!!c.class,"vuecal__event--recurring":!!c.recurring,"vuecal__event--background":!!c.background,"vuecal__event--multiday":!!((r=c._)!=null&&r.multiday),"vuecal__event--cut-top":((l=c._)==null?void 0:l.startMinutes)<i.timeFrom,"vuecal__event--cut-bottom":((_=c._)==null?void 0:_.endMinutes)>i.timeTo||c.end.getDate()!==c.start.getDate(),"vuecal__event--dragging":!c._.draggingGhost&&c._.dragging,"vuecal__event--dragging-ghost":c._.draggingGhost,"vuecal__event--resizing":h.resizing}}),d=e.computed(()=>{const r=(v.isDay||v.isDays||v.isWeek)&&i.time;if(!r&&!c.backgroundColor&&!c.color)return!1;const l={backgroundColor:c.backgroundColor||null,color:c.color||null};if(r){const _=Math.max(i.timeFrom,c._.startMinutes),a=Math.min(i.timeTo,c._.endMinutes),B=me(_,i),V=me(a,i)-B;l.top=`${B}%`,l.height=`${V}%`}return l}),m=e.computed(()=>{const r={...i.eventListeners.event};Object.entries(r).forEach(([a,B])=>{["resize-end"].includes(a)||(r[a]=V=>{V.type!=="drop"&&B(V.type?{e:V,event:c}:V)})});const l={...r};r.touchstart=a=>{var B;a.stopPropagation(),t(a),(B=l.touchstart)==null||B.call(l,{e:a,event:c})},r.mousedown=a=>{var B;a.stopPropagation(),t(a),(B=l.mousedown)==null||B.call(l,{e:a,event:c})};let _=null;return r.click=a=>{var B;(B=l.click)==null||B.call(l,{e:a,event:c}),_?_=clearTimeout(_):_=setTimeout(()=>{var V;_=null,(V=l["delayed-click"])==null||V.call(l,{e:a,event:c})},400)},r.dblclick=a=>{l.dblclick?l.dblclick({e:a,event:c}):c.delete(1)},r}),t=r=>{var a,B,V;const l=((a=r.touches)==null?void 0:a[0])||r;h.fromResizer=l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");const _=C.value.getBoundingClientRect();h.startX=(((B=r.touches)==null?void 0:B[0])||r).clientX-_.left,h.startY=(((V=r.touches)==null?void 0:V[0])||r).clientY-_.top,h.startPercentageX=h.startX*100/_.width,h.startPercentageY=h.startY*100/_.height,h.cellEl=C.value.closest(".vuecal__cell"),h.resizeStartDate=c.start,j(r.type==="touchstart"?"touchmove":"mousemove",f),j(r.type==="touchstart"?"touchend":"mouseup",p,{once:!0}),h.holdTimer=setTimeout(()=>{var F,G;h.holding=!0,(G=(F=m.value).hold)==null||G.call(F,{e:r,event:c})},1e3)},f=async r=>{var _,a,B,V;const l=((_=r.touches)==null?void 0:_[0])||r;if(h.fromResizer&&!h.resizing&&(h.resizing=!0,h.resizingOriginalEvent={...c,_:{...c._}},b.isResizingEvent=!0,(B=(a=m.value).resizeStart)==null||B.call(a,{e:r,event:c})),h.holdTimer=clearTimeout(h.holdTimer),h.holding=!1,h.cellEl){const{top:F,left:G,width:Q,height:J}=h.cellEl.getBoundingClientRect();h.moveX=l.clientX-G,h.moveY=l.clientY-F,h.movePercentageX=h.moveX*100/Q,h.movePercentageY=h.moveY*100/J}if(h.fromResizer){const{newStart:F,newEnd:G}=E(c);let Q=!0;const{resize:J}=(V=i.eventListeners)==null?void 0:V.event;J&&(Q=await J({e:r,event:{...c,start:F,end:G},overlaps:c.getOverlappingEvents({start:F,end:G})})),Q!==!1?(c.start=F,c.end=G,h.resizingLastAcceptedEvent&&(h.resizingLastAcceptedEvent=null)):J&&(h.resizingLastAcceptedEvent={...c,_:{...c._}})}},p=async r=>{var l,_;if(h.holdTimer=clearTimeout(h.holdTimer),h.holding=!1,h.resizing){const{newStart:a,newEnd:B}=E(c);let V=!0;const F=m.value["resize-end"];F&&(V=await F({e:r,event:c,original:h.resizingOriginalEvent,overlaps:c.getOverlappingEvents({start:a,end:B})})),c.start=V===!1?(h.resizingLastAcceptedEvent||h.resizingOriginalEvent).start:((l=h.resizingLastAcceptedEvent)==null?void 0:l.start)||a,c.end=V===!1?(h.resizingLastAcceptedEvent||h.resizingOriginalEvent).end:((_=h.resizingLastAcceptedEvent)==null?void 0:_.end)||B,c._.duration<1&&(c.start=h.resizingOriginalEvent.start,c.end=h.resizingOriginalEvent.end),b.isResizingEvent=!1}document.removeEventListener(r.type==="touchend"?"touchmove":"mousemove",f),h.resizing=!1,h.fromResizer=!1,h.dragging=!1,h.startX=0,h.startY=0,h.moveX=0,h.moveY=0,h.startPercentageX=0,h.startPercentageY=0,h.movePercentageX=0,h.movePercentageY=0,h.cellEl=null,h.resizeStartDate=null,h.resizingOriginalEvent=null,h.resizingLastAcceptedEvent=null,h.schedule=null},E=r=>{const l=new Date(r.start.getFullYear(),r.start.getMonth(),r.start.getDate());new Date(l).setDate(l.getDate()+1);let a=fe(h.movePercentageY,i);if(a=Math.max(0,Math.min(a,24*60)),i.snapToInterval){const F=a+i.snapToInterval/2;a=F-F%i.snapToInterval}let B=r.start,V=new Date(l.getTime()+a*6e4);return V<h.resizeStartDate&&(B=V,V=h.resizeStartDate),{newStart:B,newEnd:V}};e.onMounted(()=>c._.register(C.value));const P=[],j=(r,l,_)=>{document.addEventListener(r,l,_),P.push({event:r,handler:l,options:_})};return e.onBeforeUnmount(()=>{c._.unregister(),P.forEach(({event:r,handler:l,options:_})=>{document.removeEventListener(r,l,_)})}),(r,l)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:"vuecal__event"},e.toHandlers(m.value,!0),{ref_key:"eventEl",ref:C,class:I.value,style:d.value,draggable:T.value?"true":void 0,onDragstart:l[2]||(l[2]=_=>T.value&&e.unref(k).eventDragStart(_,c)),onDragend:l[3]||(l[3]=_=>T.value&&e.unref(k).eventDragEnd(_,c))}),[e.createElementVNode("div",tt,[e.renderSlot(r.$slots,"event",{event:c},()=>[e.createElementVNode("div",at,e.toDisplayString(c.title),1),e.unref(i).time?(e.openBlock(),e.createElementBlock("div",nt,e.toDisplayString(c._[`startTimeFormatted${e.unref(i).twelveHour?12:24}`])+`
|
|
6
|
+
- `+e.toDisplayString(c._[`endTimeFormatted${e.unref(i).twelveHour?12:24}`]),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vuecal__event-content",innerHTML:c.content},null,8,st)])]),z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__event-resizer",onDragstart:l[0]||(l[0]=e.withModifiers(()=>{},["prevent","stop"]))},null,32)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"vuecal-delete-btn"},{default:e.withCtx(()=>[c._.deleting?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:l[1]||(l[1]=e.withModifiers(_=>c.delete(3),["stop"]))},"Delete")):e.createCommentVNode("",!0)]),_:1})],16,et))}},lt=["innerHTML"],rt=["data-schedule"],ot={key:1,class:"vuecal__cell-date"},it={key:2,class:"vuecal__cell-content"},ct={key:3,class:"vuecal__cell-events"},dt={key:1,class:"vuecal__cell-date"},ut={key:2,class:"vuecal__cell-content"},mt={key:3,class:"vuecal__cell-events"},ft={key:5,class:"vuecal__cell-events-count"},gt=["title"],ht={__name:"cell",props:{start:{type:Date,required:!0},end:{type:Date,required:!0},index:{type:Number,required:!0}},setup(u){const s=u,i=e.inject("vuecal"),{view:v,config:k,dateUtils:b,eventsManager:O,dnd:g,touch:C}=i,c=e.computed(()=>b.isToday(s.start)),h=e.ref(null),T=e.ref([]),z=e.ref(!1),I=o=>{T.value.push(o.detail),z.value=!0},d=()=>setTimeout(()=>z.value=!1,300),m=e.reactive({dragging:!1,holding:!1,holdTimer:null,thresholdPassed:!1,startX:0,startY:0,moveX:0,moveY:0,startPercentageX:0,startPercentageY:0,movePercentageX:0,movePercentageY:0,schedule:null}),t=e.ref(!1),f=e.ref({cellOverlaps:{},longestStreak:0}),p=e.computed(()=>{let o=Math.min(m.startPercentageY,m.movePercentageY),M=Math.max(m.startPercentageY,m.movePercentageY),S=fe(o,k),$=fe(M,k);return k.snapToInterval&&(S=b.snapToInterval(S,k.snapToInterval),$=b.snapToInterval($,k.snapToInterval),o=me(S,k),M=me($,k)),{style:{top:o+"%",height:Math.abs(M-o)+"%"},startMinutes:S,endMinutes:$,start:b.formatMinutes(S),end:b.formatMinutes($),...m.schedule?{schedule:m.schedule}:{}}}),E=e.computed(()=>{const o=k.editableEvents.create&&(m.dragging||t.value),M=k.eventCreateMinDrag&&m.thresholdPassed||!k.eventCreateMinDrag;return o&&M}),P=e.computed(()=>{var Z;const o=new Date,M=v.start.getFullYear(),S=v.start.getMonth(),$=s.start.getFullYear(),N=s.start.getMonth();return{[`vuecal__cell--${ke[s.start.getDay()]}`]:v.isDay||v.isDays||v.isWeek||v.isMonth,[`vuecal__cell--${Se[N]}`]:v.isYear,[`vuecal__cell--${$}`]:v.isYears,"vuecal__cell--today":c.value,"vuecal__cell--current-month":v.isYear&&$===o.getFullYear()&&N===o.getMonth(),"vuecal__cell--current-year":v.isYears&&$===o.getFullYear(),"vuecal__cell--out-of-range":v.isMonth&&($!==M||N!==S),"vuecal__cell--before-min":J.value&&G.value,"vuecal__cell--after-max":J.value&&Q.value,"vuecal__cell--disabled":J.value,"vuecal__cell--selected":v.selectedDate&&v.selectedDate.getTime()>=s.start.getTime()&&v.selectedDate.getTime()<=s.end.getTime(),"vuecal__cell--has-schedules":(Z=k.schedules)==null?void 0:Z.length,"vuecal__cell--dragging":m.dragging,"vuecal__cell--has-events":l.value.length}}),j=e.computed(()=>b.formatDate(s.start)),r=e.computed(()=>{switch(v.id){case"day":return"";case"days":return k.availableViews.days.rows>1&&b.formatDate(s.start,"D"),"";case"week":return"";case"month":return b.formatDate(s.start,"D");case"year":return b.formatDate(s.start,k.xs?"MMM":"MMMM");case"years":return b.formatDate(s.start,"YYYY")}}),l=e.computed(()=>k.datePicker?[]:O.getEventsByDate(j.value,!0,!0).filter(o=>!T.value.includes(o._.id))),_=e.computed(()=>l.value.filter(o=>!o.background)),a=e.computed(()=>{var o;return(o=k.schedules)==null?void 0:o.reduce((M,S)=>(M[S.id]=l.value.filter($=>$.schedule===S.id),M),{})}),B=e.computed(()=>{const o={};for(const M of l.value){const S=M._.id,{maxConcurrent:$=1,position:N=0}=f.value.cellOverlaps[S]||{};o[S]={width:`${100/$}%`,left:`${100/$*N}%`}}return o}),V=e.computed(()=>v.isMonth&&k.eventCount&&!k.eventsOnMonthView&&_.value.length),F=e.computed(()=>{var S;if(!k.specialHours||v.isMonth||v.isYear||v.isYears)return;const o=ke[s.start.getDay()];let M=(S=k.specialHours)==null?void 0:S[o];if(M)return Array.isArray(M)||(M=[M]),M.map($=>{let{from:N,to:L,class:Z,label:ae}=$;if(isNaN(N)||isNaN(L)||k.timeFrom>=L||k.timeTo<=N)return;N=Math.max(k.timeFrom,N),L=Math.min(k.timeTo,L);const se=me(N,k),y=me(L,k)-se;return{style:{top:`${se}%`,height:`${y}%`},label:ae,class:Z}}).filter($=>!!$)}),G=e.computed(()=>k.minTimestamp!==null&&k.minTimestamp>s.end.getTime()),Q=e.computed(()=>k.maxTimestamp&&k.maxTimestamp<s.start.getTime()),J=e.computed(()=>{const{disableDays:o}=k,M=v.isYear||v.isYears;return o.length&&o.includes(b.formatDate(s.start))&&!M?!0:G.value||Q.value}),K=e.reactive({show:e.computed(()=>{if(!(!v.isDay&&!v.isDays&&!v.isWeek)&&!(!c.value||!k.time)&&!(k.timeFrom>b.dateToMinutes(v.now))&&!(b.dateToMinutes(v.now)>k.timeTo))return!0}),nowInMinutes:e.computed(()=>b.dateToMinutes(v.now)),todaysTimePosition:e.computed(()=>me(K.nowInMinutes,k)),style:e.computed(()=>`top: ${K.todaysTimePosition}%`),currentTime:e.computed(()=>b.formatTime(v.now))}),re=e.computed(()=>{if(J.value)return{};const o={...k.eventListeners.cell};Object.entries(o).forEach(([$,N])=>{o[$]=L=>{var Z,ae,se;(se=(ae=L.target||((Z=L.e)==null?void 0:Z.target)).closest)!=null&&se.call(ae,".vuecal__event")||N(L.type?{e:L,cell:q.value,cursor:U.value}:L)}});const M={...o};let S=null;return o.click=$=>{var N;x(),(N=M.click)==null||N.call(M,{e:$,cell:q.value,cursor:U.value}),S?S=clearTimeout(S):S=setTimeout(()=>{var L;S=null,(L=M["delayed-click"])==null||L.call(M,{e:$,cell:q.value,cursor:U.value})},400)},(k.time&&v.isDay||v.isDays||v.isWeek)&&(o.touchstart=$=>{var N;n($.e||$),(N=M.touchstart)==null||N.call(M,{e:$,cell:q.value,cursor:U.value})},o.mousedown=$=>{var N;n($.e||$),(N=M.mousedown)==null||N.call(M,{e:$,cell:q.value,cursor:U.value})}),M.dblclick&&(o.dblclick=$=>{var Y,H;const N=(((Y=$.touches)==null?void 0:Y[0])||$).clientY,{top:L}=h.value.getBoundingClientRect(),Z=be(N-L,h.value),ae=fe(Z,k),se=new Date(s.start);se.setMinutes(ae);const y={y:Z,date:se};(H=M.dblclick)==null||H.call(M,{e:$,cell:q.value,cursor:y})}),k.editableEvents.drag&&(o.dragenter=$=>g.cellDragEnter($,q.value),o.dragover=$=>{$.preventDefault(),g.cellDragOver($,q.value)},o.dragleave=$=>g.cellDragLeave($,q.value),o.drop=$=>g.cellDragDrop($,q.value)),o}),q=e.computed(()=>({start:s.start,end:s.end,events:l,...m.schedule?{schedule:m.schedule}:{}})),U=e.computed(()=>{const o=fe(m.movePercentageY||m.startPercentageY,k),M=new Date(s.start);return M.setMinutes(o),{x:m.movePercentageX||m.startPercentageX,y:m.movePercentageY||m.startPercentageY,date:M}}),x=()=>{v.updateSelectedDate(s.start),k.clickToNavigate&&((v.isMonth||v.isDays||v.isWeek)&&k.availableViews.day?v.switch("day"):v.isYear&&k.availableViews.month?v.switch("month"):v.isYears&&k.availableViews.year&&v.switch("year")),v.updateViewDate(s.start)},n=o=>{var S,$;m.schedule=~~o.target.dataset.schedule;const M=h.value.getBoundingClientRect();m.startX=(((S=o.touches)==null?void 0:S[0])||o).clientX-M.left,m.startY=((($=o.touches)==null?void 0:$[0])||o).clientY-M.top,m.startPercentageX=m.startX*100/M.width,m.startPercentageY=m.startY*100/M.height,m.thresholdPassed=!1,document.addEventListener(o.type==="touchstart"?"touchmove":"mousemove",w),document.addEventListener(o.type==="touchstart"?"touchend":"mouseup",D,{once:!0}),m.holdTimer=setTimeout(()=>{var N,L;m.holding=!0,(L=(N=re.value).hold)==null||L.call(N,{e:o,cell:q.value,cursor:U.value})},1e3)},w=o=>{var S,$,N,L,Z,ae;m.dragging||(C.isDraggingCell=!0,($=(S=re.value).dragStart)==null||$.call(S,{e:o,cell:q.value,cursor:U.value})),m.dragging=!0,m.holdTimer=clearTimeout(m.holdTimer),m.holding=!1;const M=h.value.getBoundingClientRect();m.moveX=(((N=o.touches)==null?void 0:N[0])||o).clientX-M.left,m.moveY=(((L=o.touches)==null?void 0:L[0])||o).clientY-M.top,m.movePercentageX=m.moveX*100/M.width,m.movePercentageY=m.moveY*100/M.height,k.eventCreateMinDrag&&Math.abs(m.startY-m.moveY)>k.eventCreateMinDrag&&(m.thresholdPassed=!0),(ae=(Z=re.value).drag)==null||ae.call(Z,{e:o,cell:q.value,cursor:U.value})},D=async o=>{var M,S;document.removeEventListener(o.type==="touchend"?"touchmove":"mousemove",w,{passive:!1}),m.dragging&&((S=(M=re.value).dragEnd)==null||S.call(M,{e:o,cell:q.value,cursor:U.value}),C.isDraggingCell=!1,k.editableEvents.create&&(t.value=!0,await A(o),t.value=!1)),m.holdTimer=clearTimeout(m.holdTimer),m.holding=!1,m.dragging=!1,m.startX=0,m.startY=0,m.moveX=0,m.moveY=0,m.startPercentageX=0,m.startPercentageY=0,m.movePercentageX=0,m.movePercentageY=0,m.thresholdPassed=!1,m.schedule=null},A=async o=>{if(!E.value)return;let{start:M,end:S,startMinutes:$,endMinutes:N}=p.value;M=new Date(s.start),M.setMinutes($),S=new Date(s.start),S.setMinutes(N);let L={...p.value,start:M,end:S};const{create:Z}=k.eventListeners.event;if(typeof Z=="function"){const ae=L;L=await new Promise(se=>Z({e:o,event:L,cell:q.value,resolve:se,cursor:U.value})),L&&typeof L=="object"&&v.createEvent(L),L&&typeof L=="boolean"&&v.createEvent(ae)}else v.createEvent(L)},X=()=>{Object.keys(re.value).forEach(o=>{var M;(M=h.value)==null||M.removeEventListener(o,re.value[o])})},te=()=>{f.value=O.getCellOverlappingEvents(j.value)};return e.watch(()=>_.value.map(o=>`${o._.id}${o.start.getTime()}${o.end.getTime()}`).join(),async()=>{await e.nextTick(),te()},{immediate:!0,flush:"post"}),e.onBeforeUnmount(async()=>{T.value.forEach(o=>O.deleteEvent(o,3)),X(),await e.nextTick()}),(o,M)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["vuecal__cell",P.value],ref_key:"cellEl",ref:h},e.toHandlers(re.value,!0)),[o.$slots.cell?e.renderSlot(o.$slots,"cell",{key:0,start:u.start,end:u.end,index:u.index,events:l.value}):e.createCommentVNode("",!0),F.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(F.value,(S,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__special-hours",S.class]),style:e.normalizeStyle(S.style),innerHTML:S.label||""},null,14,lt))),256)):e.createCommentVNode("",!0),!o.$slots.cell&&e.unref(k).schedules?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(e.unref(k).schedules,S=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__schedule vuecal__schedule--cell",S.class]),key:S.id,style:e.normalizeStyle(S.style||null),"data-schedule":S.id},[o.$slots["cell-events"]?e.renderSlot(o.$slots,"cell-events",{key:0,start:u.start,end:u.end,events:l.value}):e.createCommentVNode("",!0),r.value||o.$slots["cell-date"]?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(o.$slots,"cell-date",{start:u.start,end:u.end,events:l.value},()=>[e.createTextVNode(e.toDisplayString(r.value),1)])])):e.createCommentVNode("",!0),o.$slots["cell-content"]?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(o.$slots,"cell-content",{start:u.start,end:u.end,events:l.value})])):e.createCommentVNode("",!0),o.$slots["cell-events"]&&l.value.length?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(o.$slots,"cell-events",{start:u.start,end:u.end,events:l.value})])):l.value.length||z.value?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:4,class:"vuecal__cell-events",name:"vuecal-event-delete",onBeforeLeave:M[0]||(M[0]=$=>z.value=!0),onAfterLeave:d,tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value[S.id],$=>(e.openBlock(),e.createBlock(Ee,{key:$._.id,event:$,onEventDeleted:I,style:e.normalizeStyle(B.value[$._.id])},e.createSlots({_:2},[o.$slots.event?{name:"event",fn:e.withCtx(N=>[e.renderSlot(o.$slots,"event",e.mergeProps({ref_for:!0},N))]),key:"0"}:void 0]),1032,["event","style"]))),128))]),_:2},1024)):e.createCommentVNode("",!0),E.value&&m.schedule===S.id?(e.openBlock(),e.createElementBlock("div",{key:5,class:"vuecal__event-placeholder",style:e.normalizeStyle(p.value.style)},e.toDisplayString(p.value.start)+" - "+e.toDisplayString(p.value.end),5)):e.createCommentVNode("",!0)],14,rt))),128)):e.createCommentVNode("",!0),!o.$slots.cell&&!e.unref(k).schedules?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o.$slots["cell-events"]?e.renderSlot(o.$slots,"cell-events",{key:0}):e.createCommentVNode("",!0),r.value||o.$slots["cell-date"]?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(o.$slots,"cell-date",{start:u.start,end:u.end,events:l.value},()=>[e.createTextVNode(e.toDisplayString(r.value),1)])])):e.createCommentVNode("",!0),o.$slots["cell-content"]?(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(o.$slots,"cell-content",{start:u.start,end:u.end,events:l.value})])):e.createCommentVNode("",!0),o.$slots["cell-events"]&&l.value.length?(e.openBlock(),e.createElementBlock("div",mt,[e.renderSlot(o.$slots,"cell-events",{start:u.start,end:u.end,events:l.value})])):(l.value.length||z.value)&&!(e.unref(v).isMonth&&!e.unref(k).eventsOnMonthView)?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:4,class:"vuecal__cell-events",name:"vuecal-event-delete",onBeforeLeave:M[1]||(M[1]=S=>z.value=!0),onAfterLeave:d,tag:"div"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,S=>(e.openBlock(),e.createBlock(Ee,{key:S._.id,event:S,onEventDeleted:I,style:e.normalizeStyle(B.value[S._.id])},e.createSlots({_:2},[o.$slots.event?{name:"event",fn:e.withCtx($=>[e.renderSlot(o.$slots,"event",e.mergeProps({ref_for:!0},$))]),key:"0"}:void 0]),1032,["event","style"]))),128))]),_:3})):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",{key:5,class:"vuecal__event-placeholder",style:e.normalizeStyle(p.value.style)},e.toDisplayString(p.value.start)+" - "+e.toDisplayString(p.value.end),5)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),o.$slots["event-count"]?e.renderSlot(o.$slots,"event-count",{key:4,events:_.value}):V.value?(e.openBlock(),e.createElementBlock("div",ft,e.toDisplayString(_.value.length),1)):e.createCommentVNode("",!0),K.show?(e.openBlock(),e.createElementBlock("div",{key:6,class:"vuecal__now-line",style:e.normalizeStyle(K.style),title:K.currentTime},[e.createElementVNode("span",null,e.toDisplayString(K.currentTime),1)],12,gt)):e.createCommentVNode("",!0)],16))}},yt={__name:"body",setup(u){const s=e.inject("vuecal");let{view:i,config:v,dateUtils:k}=s;const b=e.ref(null),O=e.ref(null),g=e.computed(()=>({"--vuecal-grid-columns":i.cols,"--vuecal-grid-rows":i.rows})),C=e.computed(()=>{const T=k.formatTime(fe(O.value,v));return{style:{top:O.value+"%"},time:T}}),c=T=>{var d;if(i.isMonth||i.isYear||i.isYears)return;const z=(((d=T.touches)==null?void 0:d[0])||T).clientY,{top:I}=b.value.getBoundingClientRect();O.value=be(z-I,b.value)},h=()=>{O.value=null};return e.onMounted(()=>{b.value.addEventListener("mousemove",c),b.value.addEventListener("touchmove",c),b.value.addEventListener("mouseleave",h),b.value.addEventListener("touchend",h)}),e.onBeforeUnmount(()=>{b.value&&(b.value.removeEventListener("mousemove",c),b.value.removeEventListener("touchmove",c),b.value.removeEventListener("mouseleave",h),b.value.removeEventListener("touchend",h))}),(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:"vuecal__body",ref_key:"bodyEl",ref:b,style:e.normalizeStyle(g.value)},[e.createVNode(e.Transition,{name:"vuecal-shrink"},{default:e.withCtx(()=>[e.unref(v).timeAtCursor&&O.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vuecal__time-at-cursor",style:e.normalizeStyle(C.value.style)},[e.createElementVNode("label",null,e.toDisplayString(C.value.time),1)],4)):e.createCommentVNode("",!0)]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).cellDates,(I,d)=>(e.openBlock(),e.createBlock(ht,{key:d,start:I.start,end:I.end,index:d},e.createSlots({_:2},[T.$slots.cell?{name:"cell",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell",e.mergeProps({ref_for:!0},m))]),key:"0"}:void 0,T.$slots["cell-date"]?{name:"cell-date",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-date",e.mergeProps({ref_for:!0},m))]),key:"1"}:void 0,T.$slots["cell-content"]?{name:"cell-content",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-content",e.mergeProps({ref_for:!0},m))]),key:"2"}:void 0,T.$slots["cell-events"]?{name:"cell-events",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"cell-events",e.mergeProps({ref_for:!0},m))]),key:"3"}:T.$slots.event?{name:"event",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"event",e.mergeProps({ref_for:!0},m))]),key:"4"}:T.$slots["event-count"]?{name:"event-count",fn:e.withCtx(m=>[e.renderSlot(T.$slots,"event-count",e.mergeProps({ref_for:!0},m))]),key:"5"}:void 0]),1032,["start","end","index"]))),128))],4))}},pt=["data-locale"],Dt={class:"vuecal__scrollable-wrap"},vt={key:1,class:"vuecal__week-numbers"},kt={class:"vuecal__week-number"},wt={class:"vuecal__body-wrap"},_t={__name:"index",props:Ne,emits:["ready","view-change","update:view","update:selectedDate","update:viewDate","update:events","event-delete","event-created","event-dropped","event-change"],setup(u,{expose:s,emit:i}){const v=u,k=i,b=e.useTemplateRef("vuecal-el"),O=Oe({props:v,emit:k,attrs:e.useAttrs(),vuecalEl:b,uid:e.useId()}),{config:g,view:C,dateUtils:c,touch:h}=O,T=e.computed(()=>g.time&&(C.isDay||C.isDays||C.isWeek)),z=e.computed(()=>Array(C.rows).fill().map((t,f)=>c.getWeek(c.addDays(C.firstCellDate,7*f)))),I=e.computed(()=>{var t;return{"vuecal--ready":g.ready,[`vuecal--${g.theme}-theme`]:g.theme,[`vuecal--${g.size}`]:!0,"vuecal--date-picker":g.datePicker,"vuecal--dark":g.dark,"vuecal--light":!g.dark,[`vuecal--${C.id}-view`]:!0,"vuecal--view-has-time":T.value,"vuecal--timeless":!g.time,"vuecal--dragging-cell":h.isDraggingCell,"vuecal--dragging-event":h.isDraggingEvent,"vuecal--resizing-event":h.isResizingEvent,"vuecal--has-schedules":(t=g.schedules)==null?void 0:t.length}}),d=e.computed(()=>({"--vuecal-time-cell-height":g.timeCellHeight&&`${g.timeCellHeight}px`})),m=e.computed(()=>{var t,f;return{"vuecal__scrollable--row":T.value||g.weekNumbers&&C.isMonth,[`vuecal__scrollable--${C.id}-view`]:!0,"vuecal__scrollable--has-schedules":(t=g.schedules)==null?void 0:t.length,"vuecal__scrollable--no-schedules":!((f=g.schedules)!=null&&f.length)}});return e.onMounted(async()=>{await e.nextTick(),k("ready",{config:g,view:C})}),e.watch(()=>g.locale,t=>g.loadTexts(t)),e.provide("vuecal",O),s({view:O.view}),(t,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal",I.value]),ref:"vuecal-el","data-locale":t.locale,style:e.normalizeStyle(d.value)},[t.$slots.diy?e.renderSlot(t.$slots,"diy",{key:0,vuecal:e.unref(O),view:e.unref(C),availableViews:e.unref(g).availableViews}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(Ie,null,e.createSlots({_:2},[t.$slots.header?{name:"header",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"header",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,!t.$slots.header&&t.$slots["previous-button"]?{name:"previous-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"previous-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0,!t.$slots.header&&t.$slots["next-button"]?{name:"next-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"next-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"2"}:void 0,!t.$slots.header&&t.$slots["today-button"]?{name:"today-button",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"today-button",e.normalizeProps(e.guardReactiveProps(p)))]),key:"3"}:void 0,!t.$slots.header&&t.$slots.title?{name:"title",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"title",e.normalizeProps(e.guardReactiveProps(p)))]),key:"4"}:void 0,!t.$slots.header&&t.$slots["schedule-heading"]?{name:"schedule-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"schedule-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"5"}:void 0]),1024),e.createElementVNode("div",Dt,[e.createVNode(e.Transition,{name:`vuecal-slide-fade--${e.unref(C).transitionDirection}`},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuecal__scrollable",m.value]),key:e.unref(C).id+e.unref(C).start.getTime()},[T.value?(e.openBlock(),e.createBlock(xe,{key:0},e.createSlots({_:2},[t.$slots["time-cell"]?{name:"time-cell",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"time-cell",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0]),1024)):e.createCommentVNode("",!0),e.unref(g).weekNumbers&&e.unref(C).isMonth?(e.openBlock(),e.createElementBlock("div",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,p=>(e.openBlock(),e.createElementBlock("div",kt,[e.renderSlot(t.$slots,"week-number",{},()=>[e.createElementVNode("small",null,e.toDisplayString(p),1)])]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("div",wt,[e.createVNode(Ke,null,e.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"weekday-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,t.$slots["schedule-heading"]?{name:"schedule-heading",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"schedule-heading",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0]),1024),e.createVNode(yt,null,e.createSlots({_:2},[t.$slots.cell?{name:"cell",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell",e.normalizeProps(e.guardReactiveProps(p)))]),key:"0"}:void 0,!t.$slots.cell&&t.$slots["cell-date"]?{name:"cell-date",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-date",e.normalizeProps(e.guardReactiveProps(p)))]),key:"1"}:void 0,!t.$slots.cell&&t.$slots["cell-content"]?{name:"cell-content",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-content",e.normalizeProps(e.guardReactiveProps(p)))]),key:"2"}:void 0,!t.$slots.cell&&t.$slots["cell-events"]?{name:"cell-events",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"cell-events",e.normalizeProps(e.guardReactiveProps(p)))]),key:"3"}:void 0,!t.$slots.cell&&t.$slots.event?{name:"event",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"event",e.normalizeProps(e.guardReactiveProps(p)))]),key:"4"}:void 0,!t.$slots.cell&&t.$slots["event-count"]?{name:"event-count",fn:e.withCtx(p=>[e.renderSlot(t.$slots,"event-count",e.normalizeProps(e.guardReactiveProps(p)))]),key:"5"}:void 0]),1024)])],2))]),_:3},8,["name"])])],64))],14,pt))}},bt=u=>{he.texts={...ee.texts,...u},he.dateUtils.updateTexts(he.texts)},{addDatePrototypes:Tt,removeDatePrototypes:Mt,updateTexts:$t,addDays:Et,subtractDays:St,addHours:Ct,subtractHours:Bt,addMinutes:Vt,subtractMinutes:Yt,getWeek:Pt,isToday:Ot,isSameDate:zt,isInRange:Nt,isLeapYear:jt,getPreviousFirstDayOfWeek:Lt,stringToDate:Ft,dateToMinutes:Ht,countDays:Wt,datesInSameTimeStep:Rt,isValid:It,formatDate:At,formatDateLite:Xt,formatTime:Gt,formatTimeLite:Ut,formatMinutes:qt}=he.dateUtils;W.VueCal=_t,W.addDatePrototypes=Tt,W.addDays=Et,W.addHours=Ct,W.addMinutes=Vt,W.countDays=Wt,W.dateToMinutes=Ht,W.datesInSameTimeStep=Rt,W.formatDate=At,W.formatDateLite=Xt,W.formatMinutes=qt,W.formatTime=Gt,W.formatTimeLite=Ut,W.getPreviousFirstDayOfWeek=Lt,W.getWeek=Pt,W.isInRange=Nt,W.isLeapYear=jt,W.isSameDate=zt,W.isToday=Ot,W.isValidDate=It,W.removeDatePrototypes=Mt,W.stringToDate=Ft,W.subtractDays=St,W.subtractHours=Bt,W.subtractMinutes=Yt,W.updateTexts=$t,W.useLocale=bt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-cal",
|
|
3
|
-
"version": "5.0.1-rc.
|
|
3
|
+
"version": "5.0.1-rc.5",
|
|
4
4
|
"description": "A Vue JS full calendar, no dependency, no BS. :metal:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/vue-cal",
|
|
@@ -21,8 +21,12 @@
|
|
|
21
21
|
"import": "./dist/vue-cal.es.js",
|
|
22
22
|
"require": "./dist/vue-cal.cjs.js"
|
|
23
23
|
},
|
|
24
|
-
"./style":
|
|
25
|
-
|
|
24
|
+
"./style": {
|
|
25
|
+
"default": "./dist/vue-cal.css"
|
|
26
|
+
},
|
|
27
|
+
"./style.css": {
|
|
28
|
+
"default": "./dist/vue-cal.css"
|
|
29
|
+
},
|
|
26
30
|
"./i18n/*": "./dist/i18n/*",
|
|
27
31
|
"./package.json": "./package.json"
|
|
28
32
|
},
|