vue-cal 5.0.1-rc.3 → 5.0.1-rc.31
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/README.md +4 -1
- package/dist/i18n/ar.js +42 -0
- package/dist/i18n/bg.js +38 -0
- package/dist/i18n/bn.js +38 -0
- package/dist/i18n/bs.js +38 -0
- package/dist/i18n/ca.js +40 -0
- package/dist/i18n/cs.js +38 -0
- package/dist/i18n/da.js +38 -0
- package/dist/i18n/de.js +38 -0
- package/dist/i18n/el.js +44 -0
- package/dist/i18n/en-gb.js +38 -0
- package/dist/i18n/es.js +38 -0
- package/dist/i18n/et.js +38 -0
- package/dist/i18n/fa.js +42 -0
- package/dist/i18n/fi.js +38 -0
- package/dist/i18n/fr.js +38 -0
- package/dist/i18n/he.js +42 -0
- package/dist/i18n/hr.js +38 -0
- package/dist/i18n/hu.js +38 -0
- package/dist/i18n/id.js +38 -0
- package/dist/i18n/is.js +38 -0
- package/dist/i18n/it.js +38 -0
- package/dist/i18n/ja.js +40 -0
- package/dist/i18n/ka.js +38 -0
- package/dist/i18n/kaa.js +36 -0
- package/dist/i18n/kk.js +40 -0
- package/dist/i18n/ko.js +40 -0
- package/dist/i18n/ky.js +36 -0
- package/dist/i18n/lt.js +38 -0
- package/dist/i18n/mn.js +38 -0
- package/dist/i18n/nl.js +38 -0
- package/dist/i18n/no.js +38 -0
- package/dist/i18n/pl.js +38 -0
- package/dist/i18n/pt-br.js +38 -0
- package/dist/i18n/pt-pt.js +38 -0
- package/dist/i18n/ro.js +38 -0
- package/dist/i18n/ru.js +40 -0
- package/dist/i18n/sk.js +38 -0
- package/dist/i18n/sl.js +38 -0
- package/dist/i18n/sq.js +40 -0
- package/dist/i18n/sr.js +38 -0
- package/dist/i18n/sv.js +38 -0
- package/dist/i18n/tr.js +38 -0
- package/dist/i18n/uk.js +40 -0
- package/dist/i18n/uz-cryl.js +36 -0
- package/dist/i18n/uz.js +36 -0
- package/dist/i18n/vi.js +40 -0
- package/dist/i18n/zh-cn.js +40 -0
- package/dist/i18n/zh-hk.js +40 -0
- package/dist/vue-cal.css +1 -1
- package/dist/vue-cal.es.js +1890 -1465
- package/dist/vue-cal.umd.js +3 -4
- package/package.json +30 -27
- package/dist/i18n/ar.json +0 -18
- package/dist/i18n/bg.json +0 -16
- package/dist/i18n/bn.json +0 -16
- package/dist/i18n/bs.json +0 -16
- package/dist/i18n/ca.json +0 -17
- package/dist/i18n/cs.json +0 -16
- package/dist/i18n/da.json +0 -16
- package/dist/i18n/de.json +0 -16
- package/dist/i18n/el.json +0 -19
- package/dist/i18n/en-gb.json +0 -16
- package/dist/i18n/en-us.json +0 -16
- package/dist/i18n/es.json +0 -16
- package/dist/i18n/et.json +0 -16
- package/dist/i18n/fa.json +0 -18
- package/dist/i18n/fi.json +0 -16
- package/dist/i18n/fr.json +0 -16
- package/dist/i18n/he.json +0 -18
- package/dist/i18n/hr.json +0 -16
- package/dist/i18n/hu.json +0 -16
- package/dist/i18n/id.json +0 -16
- package/dist/i18n/is.json +0 -16
- package/dist/i18n/it.json +0 -16
- package/dist/i18n/ja.json +0 -17
- package/dist/i18n/ka.json +0 -16
- package/dist/i18n/ko.json +0 -17
- package/dist/i18n/lt.json +0 -16
- package/dist/i18n/mn.json +0 -16
- package/dist/i18n/nl.json +0 -16
- package/dist/i18n/no.json +0 -16
- package/dist/i18n/pl.json +0 -16
- package/dist/i18n/pt-br.json +0 -16
- package/dist/i18n/pt-pt.json +0 -16
- package/dist/i18n/ro.json +0 -16
- package/dist/i18n/ru.json +0 -17
- package/dist/i18n/sk.json +0 -16
- package/dist/i18n/sl.json +0 -16
- package/dist/i18n/sq.json +0 -17
- package/dist/i18n/sr.json +0 -16
- package/dist/i18n/sv.json +0 -16
- package/dist/i18n/tr.json +0 -16
- package/dist/i18n/uk.json +0 -17
- package/dist/i18n/vi.json +0 -17
- package/dist/i18n/zh-cn.json +0 -17
- package/dist/i18n/zh-hk.json +0 -17
package/dist/vue-cal.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as b, reactive as be, watch as De, toRefs as bt, ref as ue, onBeforeUnmount as Re, nextTick as Xe, inject as He, createElementBlock as P, openBlock as V, renderSlot as j, createCommentVNode as x, unref as $, Fragment as de, renderList as we, normalizeClass as pe, createElementVNode as he, createVNode as Oe, Transition as Ue, withCtx as B, createBlock as Se, resolveDynamicComponent as xe, mergeProps as ie, toHandlers as Ie, normalizeProps as se, onMounted as Ze, toDisplayString as ce, createTextVNode as qe, withModifiers as et, normalizeStyle as $e, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Et, provide as at, guardReactiveProps as re } from "vue";
|
|
2
2
|
/**
|
|
3
|
-
* vue-cal v5.0.1-rc.
|
|
3
|
+
* vue-cal v5.0.1-rc.31
|
|
4
4
|
* (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
7
|
+
const fe = {
|
|
8
8
|
texts: {
|
|
9
9
|
weekDays: Array(7).fill(""),
|
|
10
10
|
weekDaysShort: [],
|
|
@@ -33,348 +33,378 @@ const ve = {
|
|
|
33
33
|
years: { cols: 5, rows: 5 }
|
|
34
34
|
// Arbitrary range of quarters of century (25y).
|
|
35
35
|
}
|
|
36
|
-
},
|
|
37
|
-
const { dateUtils:
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), L = M(() => s.sm && !s.xs), g = M(() => s.xs || s.datePicker), V = M(() => s.clickToNavigate || s.datePicker && s.clickToNavigate !== !1), o = M(() => {
|
|
46
|
-
const l = {
|
|
36
|
+
}, Yt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Ge = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], St = Ge.reduce((y, t, d) => (y[t] = d || 7, y), {}), Ct = (y, t, d) => {
|
|
37
|
+
const { dateUtils: r } = y, h = !1, C = b(() => {
|
|
38
|
+
if (E.value[t.view]) return t.view;
|
|
39
|
+
const c = t.datePicker ? "month" : "week", u = t.view || c;
|
|
40
|
+
return E.value[u] ? u : (console.warn(
|
|
41
|
+
`Vue Cal: the provided or default view \`${u}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(E.value)[0]}\`.`
|
|
42
|
+
), Object.keys(E.value)[0]);
|
|
43
|
+
}), W = b(() => t.sm && !t.xs), v = b(() => t.xs || t.datePicker), A = b(() => t.clickToNavigate || t.datePicker && t.clickToNavigate !== !1), Z = b(() => {
|
|
44
|
+
const c = {
|
|
47
45
|
cell: {},
|
|
48
46
|
// All possible event listeners to attach to cells.
|
|
49
47
|
event: {}
|
|
50
48
|
// All possible event listeners to attach to calendar events.
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
const [O,
|
|
54
|
-
O && (
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return
|
|
96
|
-
}),
|
|
97
|
-
|
|
49
|
+
}, u = (p) => p.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
50
|
+
for (const [p, a] of Object.entries(d)) {
|
|
51
|
+
const [O, X, U] = p.match(/^on(Cell|Event)(.+)$/) || [];
|
|
52
|
+
O && (c[X.toLowerCase()][u(U).replace(/^-+|-+$/g, "")] = a);
|
|
53
|
+
}
|
|
54
|
+
return c;
|
|
55
|
+
}), L = b(() => {
|
|
56
|
+
var u;
|
|
57
|
+
const c = {};
|
|
58
|
+
return t.hideWeekends && (c[6] = !0) && (c[7] = !0), (u = t.hideWeekdays) != null && u.length && t.hideWeekdays.forEach((p) => c[St[p]] = !0), c;
|
|
59
|
+
}), l = b(() => t.hideWeekends || L.value[6] && L.value[7]), E = b(() => {
|
|
60
|
+
const c = t.datePicker;
|
|
61
|
+
let u = 0, p = {};
|
|
62
|
+
const a = t.views;
|
|
63
|
+
return c && !a ? {
|
|
64
|
+
month: { ...fe.availableViews.month },
|
|
65
|
+
year: { ...fe.availableViews.year },
|
|
66
|
+
years: { ...fe.availableViews.years }
|
|
67
|
+
} : t.horizontal && !a ? {
|
|
68
|
+
days: { cols: fe.availableViews.days.rows, rows: fe.availableViews.days.cols },
|
|
69
|
+
week: { cols: fe.availableViews.week.rows, rows: fe.availableViews.week.cols }
|
|
70
|
+
} : (a ? (Array.isArray(a) ? p = a.reduce((O, X) => (typeof X == "string" && fe.availableViews[X] ? O[X] = fe.availableViews[X] : u++, O), {}) : typeof a == "object" && (p = Object.entries(a).reduce((O, [X, U]) => {
|
|
71
|
+
const { cols: Q, rows: te } = fe.availableViews[X];
|
|
72
|
+
return O[X] = { cols: U.cols || Q, rows: U.rows || te }, O;
|
|
73
|
+
}, {})), u && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(p).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), p = { ...fe.availableViews })) : p = { ...fe.availableViews }, p);
|
|
74
|
+
}), F = b(() => t.datePicker ? "month" : E.value.week ? "week" : Object.keys(E.value)[0]), m = b(() => {
|
|
75
|
+
if (typeof t.selectedDate == "string") return r.stringToDate(t.selectedDate);
|
|
76
|
+
if (t.selectedDate instanceof Date) return t.selectedDate;
|
|
77
|
+
t.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", t.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
|
|
78
|
+
}), i = b(() => {
|
|
79
|
+
if (!t.disableDays) return [];
|
|
80
|
+
const c = [];
|
|
81
|
+
if (Array.isArray(t.disableDays))
|
|
82
|
+
for (let u of t.disableDays) {
|
|
83
|
+
let p = u;
|
|
84
|
+
typeof u == "string" ? p = r.stringToDate(u) : u instanceof Date && (u = r.formatDate(u, "YYYY-MM-DD")), p instanceof Date && !isNaN(p.getTime()) ? c.push(u) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", u);
|
|
85
|
+
}
|
|
86
|
+
else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", t.disableDays);
|
|
87
|
+
return c;
|
|
88
|
+
}), S = b(() => {
|
|
89
|
+
let c = null;
|
|
90
|
+
return t.minDate && typeof t.minDate == "string" ? c = r.stringToDate(t.minDate) : t.minDate && t.minDate instanceof Date && (c = t.minDate), (c == null ? void 0 : c.getTime()) || null;
|
|
91
|
+
}), n = b(() => {
|
|
92
|
+
let c = null;
|
|
93
|
+
return t.maxDate && typeof t.maxDate == "string" ? c = r.stringToDate(t.maxDate) : t.maxDate && t.maxDate instanceof Date && (c = t.maxDate), (c == null ? void 0 : c.getTime()) || null;
|
|
94
|
+
}), I = b(() => {
|
|
95
|
+
var p;
|
|
96
|
+
const { view: c } = y;
|
|
97
|
+
return t.schedules.length && (c.isDay || c.isDays || c.isWeek) && ((p = t.schedules) == null ? void 0 : p.map((a, O) => ({ ...a, id: a.id ?? O + 1 }))) || void 0;
|
|
98
|
+
}), e = b(() => {
|
|
99
|
+
const c = {
|
|
98
100
|
drag: !0,
|
|
99
101
|
resize: !0,
|
|
100
102
|
delete: !0,
|
|
101
103
|
create: !0
|
|
102
104
|
};
|
|
103
|
-
return
|
|
104
|
-
}),
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
return t.editableEvents === !0 ? c : t.editableEvents === !1 ? Object.keys(c).map((u) => c[u] = !1) : { ...c, ...t.editableEvents };
|
|
106
|
+
}), z = b(() => {
|
|
107
|
+
const { view: c } = y, { eventCount: u } = t;
|
|
108
|
+
return (Array.isArray(u) ? u.includes(c.id) : u) && (c.isMonth && !t.eventsOnMonthView || c.isYear);
|
|
109
|
+
}), H = b(() => t.allDayEvents && t.time !== !1 && !C.isMonth), Y = b(() => t.timeAtCursor && t.time !== !1), _ = async (c) => {
|
|
110
|
+
var p;
|
|
111
|
+
let u = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((a) => a.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((a) => a.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((a) => a.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((a) => a.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((a) => a.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((a) => a.default), "../i18n/da.json": () => import("./i18n/da.js").then((a) => a.default), "../i18n/de.json": () => import("./i18n/de.js").then((a) => a.default), "../i18n/el.json": () => import("./i18n/el.js").then((a) => a.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((a) => a.default), "../i18n/en-us.json": () => Promise.resolve().then(() => jt).then((a) => a.default), "../i18n/es.json": () => import("./i18n/es.js").then((a) => a.default), "../i18n/et.json": () => import("./i18n/et.js").then((a) => a.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((a) => a.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((a) => a.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((a) => a.default), "../i18n/he.json": () => import("./i18n/he.js").then((a) => a.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((a) => a.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((a) => a.default), "../i18n/id.json": () => import("./i18n/id.js").then((a) => a.default), "../i18n/is.json": () => import("./i18n/is.js").then((a) => a.default), "../i18n/it.json": () => import("./i18n/it.js").then((a) => a.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((a) => a.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((a) => a.default), "../i18n/kaa.json": () => import("./i18n/kaa.js").then((a) => a.default), "../i18n/kk.json": () => import("./i18n/kk.js").then((a) => a.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((a) => a.default), "../i18n/ky.json": () => import("./i18n/ky.js").then((a) => a.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((a) => a.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((a) => a.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((a) => a.default), "../i18n/no.json": () => import("./i18n/no.js").then((a) => a.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((a) => a.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((a) => a.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((a) => a.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((a) => a.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((a) => a.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((a) => a.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((a) => a.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((a) => a.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((a) => a.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((a) => a.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((a) => a.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((a) => a.default), "../i18n/uz-cryl.json": () => import("./i18n/uz-cryl.js").then((a) => a.default), "../i18n/uz.json": () => import("./i18n/uz.js").then((a) => a.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((a) => a.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((a) => a.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((a) => a.default) });
|
|
107
112
|
{
|
|
108
|
-
if (!
|
|
109
|
-
console.warn(`Vue Cal: the locale \`${
|
|
113
|
+
if (!u[`../i18n/${c}.json`]) {
|
|
114
|
+
console.warn(`Vue Cal: the locale \`${c}\` does not exist. Falling back to \`en-us\`.`), c = "en-us";
|
|
110
115
|
return;
|
|
111
116
|
}
|
|
112
|
-
|
|
117
|
+
u = await ((p = u[`../i18n/${c}.json`]) == null ? void 0 : p.call(u));
|
|
113
118
|
}
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
events: B,
|
|
119
|
+
y.texts = Object.assign(y.texts, Object.assign({ ...fe.texts }, u)), r.updateTexts(y.texts);
|
|
120
|
+
}, f = be(t.events || []);
|
|
121
|
+
return De(() => t.events, (c) => f.splice(0, f.length, ...c)), De(() => t.locale, (c) => _(c || "en-us")), (t.locale || !y.texts.today) && _(t.locale || "en-us"), {
|
|
122
|
+
...bt(t),
|
|
123
|
+
events: f,
|
|
120
124
|
// All the events listeners for cells and events that the end user may have attached to vue-cal.
|
|
121
|
-
eventListeners:
|
|
122
|
-
defaultView:
|
|
123
|
-
availableViews:
|
|
124
|
-
disableDays:
|
|
125
|
-
ready:
|
|
126
|
-
sm:
|
|
127
|
-
xs:
|
|
128
|
-
clickToNavigate:
|
|
129
|
-
hideWeekdays:
|
|
130
|
-
hideWeekends:
|
|
131
|
-
minTimestamp:
|
|
132
|
-
maxTimestamp:
|
|
133
|
-
schedules:
|
|
134
|
-
selectedDate:
|
|
135
|
-
editableEvents:
|
|
136
|
-
|
|
125
|
+
eventListeners: Z,
|
|
126
|
+
defaultView: F,
|
|
127
|
+
availableViews: E,
|
|
128
|
+
disableDays: i,
|
|
129
|
+
ready: h,
|
|
130
|
+
sm: W,
|
|
131
|
+
xs: v,
|
|
132
|
+
clickToNavigate: A,
|
|
133
|
+
hideWeekdays: L,
|
|
134
|
+
hideWeekends: l,
|
|
135
|
+
minTimestamp: S,
|
|
136
|
+
maxTimestamp: n,
|
|
137
|
+
schedules: I,
|
|
138
|
+
selectedDate: m,
|
|
139
|
+
editableEvents: e,
|
|
140
|
+
showCellEventCount: z,
|
|
141
|
+
allDayEvents: H,
|
|
142
|
+
timeAtCursor: Y,
|
|
143
|
+
view: C,
|
|
137
144
|
// Getters.
|
|
138
145
|
get hasHiddenDays() {
|
|
139
|
-
return Object.keys(
|
|
146
|
+
return Object.keys(L.value).length;
|
|
140
147
|
},
|
|
141
148
|
get size() {
|
|
142
|
-
return
|
|
149
|
+
return v.value ? "xs" : W.value ? "sm" : "lg";
|
|
143
150
|
},
|
|
144
|
-
loadTexts:
|
|
151
|
+
loadTexts: _
|
|
145
152
|
};
|
|
146
|
-
},
|
|
147
|
-
const
|
|
148
|
-
return (
|
|
149
|
-
},
|
|
150
|
-
const
|
|
151
|
-
return ~~(
|
|
152
|
-
},
|
|
153
|
-
const
|
|
154
|
-
return
|
|
155
|
-
},
|
|
156
|
-
let
|
|
157
|
-
const
|
|
153
|
+
}, Ve = (y, t) => {
|
|
154
|
+
const d = t.timeTo - t.timeFrom;
|
|
155
|
+
return (y - t.timeFrom) * 100 / d;
|
|
156
|
+
}, je = (y, t) => {
|
|
157
|
+
const d = t.timeTo - t.timeFrom;
|
|
158
|
+
return ~~(y * d / 100 + t.timeFrom);
|
|
159
|
+
}, Ke = (y, t) => {
|
|
160
|
+
const d = t.clientHeight;
|
|
161
|
+
return y * 100 / d;
|
|
162
|
+
}, We = be({ id: null, date: null });
|
|
163
|
+
let nt = !1, Je = !0;
|
|
164
|
+
const _e = be({ el: null, cell: null, timeout: null }), ke = be({
|
|
158
165
|
eventId: null,
|
|
159
166
|
fromVueCal: null,
|
|
160
167
|
toVueCal: null
|
|
161
168
|
});
|
|
162
|
-
function
|
|
163
|
-
const { config:
|
|
164
|
-
var
|
|
165
|
-
const { timeStep:
|
|
166
|
-
return
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
|
|
169
|
+
function zt(y) {
|
|
170
|
+
const { config: t, view: d, eventsManager: r, emit: h, uid: C, dateUtils: W } = y, v = (S) => {
|
|
171
|
+
var _;
|
|
172
|
+
const { timeStep: n, timeCellHeight: I, timeFrom: e } = t, z = (((_ = S.touches) == null ? void 0 : _[0]) || S).clientY, { top: H } = S.currentTarget.getBoundingClientRect(), Y = z - H - ~~S.dataTransfer.getData("cursor-grab-at");
|
|
173
|
+
return je(Ke(Y, S.currentTarget), t);
|
|
174
|
+
}, A = (S, n, I) => {
|
|
175
|
+
const e = n.duration || Z(n.start, n.end) || t.timeStep;
|
|
176
|
+
let z = Math.max(v(S), 0);
|
|
177
|
+
if (t.snapToInterval) {
|
|
178
|
+
const f = z + t.snapToInterval / 2;
|
|
179
|
+
z = f - f % t.snapToInterval;
|
|
173
180
|
}
|
|
174
|
-
const
|
|
175
|
-
return { start:
|
|
176
|
-
},
|
|
181
|
+
const H = new Date(new Date(I).setMinutes(z)), Y = Math.min(z + e, 1440), _ = new Date(new Date(I).setMinutes(Y));
|
|
182
|
+
return { start: H, end: _ };
|
|
183
|
+
}, Z = (S, n) => Math.round((n - S) / 6e4);
|
|
177
184
|
return {
|
|
178
|
-
eventDragStart: (
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
185
|
+
eventDragStart: (S, n) => {
|
|
186
|
+
if (S.target.nodeType === 3 || y.touch.isResizingEvent) return S.preventDefault();
|
|
187
|
+
S.dataTransfer.effectAllowed = "move", S.dataTransfer.dropEffect = "move";
|
|
188
|
+
const I = { ...n, _: { id: n._.id, duration: Z(n.start, n.end) } };
|
|
189
|
+
try {
|
|
190
|
+
S.dataTransfer.setData("text/plain", ""), S.dataTransfer.setData("event", JSON.stringify(I)), S.dataTransfer.setData("cursor-grab-at", S.offsetY);
|
|
191
|
+
} catch (z) {
|
|
192
|
+
return console.warn("Vue Cal: Failed to set drag data:", z), S.preventDefault();
|
|
193
|
+
}
|
|
194
|
+
ke.eventId = n._.id, ke.fromVueCal = C, h("event-drag-start", {
|
|
195
|
+
e: S,
|
|
196
|
+
event: n
|
|
197
|
+
});
|
|
198
|
+
const e = S.target.closest(".vuecal__event");
|
|
199
|
+
e.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
|
|
200
|
+
e.classList.add("vuecal__event--dragging-original"), e.classList.remove("vuecal__event--dragging-ghost");
|
|
201
|
+
}, 0), nt = !1, Object.assign(We, { id: d.id, date: d.firstCellDate }), Je = !0, y.touch.isDraggingEvent = !0;
|
|
187
202
|
},
|
|
188
|
-
eventDragEnd: (
|
|
189
|
-
|
|
190
|
-
const { fromVueCal:
|
|
191
|
-
|
|
203
|
+
eventDragEnd: (S, n) => {
|
|
204
|
+
ke.eventId = null, S.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
|
|
205
|
+
const { fromVueCal: I, toVueCal: e } = ke;
|
|
206
|
+
e && I !== e && r.deleteEvent(n._.id, 3), nt && Je && We.id && d.switchView(We.id, We.date, !0), h("event-drag-end", {
|
|
207
|
+
e: S,
|
|
208
|
+
event: n,
|
|
209
|
+
external: ke.fromVueCal !== C
|
|
210
|
+
}), ke.fromVueCal = null, ke.toVueCal = null, y.touch.isDraggingEvent = !1;
|
|
192
211
|
},
|
|
193
|
-
cellDragEnter: (
|
|
194
|
-
const { start:
|
|
195
|
-
if (!
|
|
196
|
-
if (
|
|
197
|
-
|
|
212
|
+
cellDragEnter: (S, n) => {
|
|
213
|
+
const { start: I } = n, e = S.currentTarget;
|
|
214
|
+
if (!S.currentTarget.contains(S.relatedTarget)) {
|
|
215
|
+
if (e === _e.el || !e.className.includes("vuecal__cell-content")) return !1;
|
|
216
|
+
_e.el && (_e.cell.highlighted = !1), Object.assign(_e, { el: e, cell: n, timeout: clearTimeout(_e.timeout) }), n.highlighted = !0, ["years", "year", "month"].includes(d.id) && (_e.timeout = setTimeout(() => y.switchToNarrowerView(I), 2e3));
|
|
198
217
|
}
|
|
199
218
|
},
|
|
200
|
-
cellDragOver: (
|
|
201
|
-
const { start:
|
|
202
|
-
|
|
219
|
+
cellDragOver: (S, n) => {
|
|
220
|
+
const { start: I, schedule: e } = n;
|
|
221
|
+
S.preventDefault(), n.highlighted = !0, (e || e === 0) && (n.highlightedSchedule = e);
|
|
203
222
|
},
|
|
204
|
-
cellDragLeave: (
|
|
205
|
-
|
|
223
|
+
cellDragLeave: (S, n) => {
|
|
224
|
+
S.preventDefault(), !S.currentTarget.contains(S.relatedTarget) && (n.highlightedSchedule = !1, _e.cell === n && (clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null }), n.highlighted = !1));
|
|
206
225
|
},
|
|
207
|
-
cellDragDrop: async (
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
|
|
226
|
+
cellDragDrop: async (S, n, I = !1) => {
|
|
227
|
+
var p, a, O;
|
|
228
|
+
S.preventDefault(), clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null });
|
|
229
|
+
const e = JSON.parse(S.dataTransfer.getData("event") || "{}");
|
|
230
|
+
e.start && (e.start = new Date(e.start)), e.end && (e.end = new Date(e.end));
|
|
231
|
+
let z, H, Y;
|
|
232
|
+
I ? (H = new Date(n.start), Y = new Date(n.end)) : { start: H, end: Y } = A(S, e, n.start);
|
|
233
|
+
const { schedule: _ } = ((p = S.target.closest("[data-schedule]")) == null ? void 0 : p.dataset) || {};
|
|
234
|
+
let f = () => {
|
|
215
235
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
236
|
+
ke.fromVueCal === C ? (z = r.getEvent(e._.id), z && (z._.dragging = !1, f = (X) => {
|
|
237
|
+
if (z.start = H, z.end = Y, z.allDay = I, _ !== void 0 && (z.schedule = ~~_), X && typeof X == "object") {
|
|
238
|
+
const { _: U, ...Q } = X;
|
|
239
|
+
Object.assign(z, Q);
|
|
240
|
+
}
|
|
241
|
+
})) : (z = {
|
|
242
|
+
...e,
|
|
220
243
|
start: H,
|
|
221
|
-
end:
|
|
222
|
-
...
|
|
223
|
-
_: { id: ((
|
|
224
|
-
getOverlappingEvents: () =>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
{
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
244
|
+
end: Y,
|
|
245
|
+
..._ !== void 0 && { schedule: ~~_ },
|
|
246
|
+
_: { id: ((a = e._) == null ? void 0 : a.id) || e.id, duration: Z(H, Y) },
|
|
247
|
+
getOverlappingEvents: () => r.getEventsInRange(H, Y, { schedule: ~~_ })
|
|
248
|
+
}, f = (X) => {
|
|
249
|
+
if (z = r.createEvent(z), X && typeof X == "object") {
|
|
250
|
+
const { _: U, ...Q } = X;
|
|
251
|
+
Object.assign(z, Q);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
let c = !0;
|
|
255
|
+
const { drop: u } = (O = t.eventListeners) == null ? void 0 : O.event;
|
|
256
|
+
u && (c = await u({
|
|
257
|
+
e: S,
|
|
258
|
+
event: { ...z, start: H, end: Y, schedule: ~~_ },
|
|
259
|
+
overlaps: z.getOverlappingEvents({ start: H, end: Y, schedule: ~~_ }),
|
|
260
|
+
cell: n,
|
|
261
|
+
external: ke.fromVueCal !== C
|
|
262
|
+
})), c !== !1 && f(c), n.highlighted = !1, n.highlightedSchedule = null, Je = !1, ke.toVueCal = C, h("event-dropped", {
|
|
263
|
+
e: S,
|
|
264
|
+
cell: n,
|
|
265
|
+
event: z,
|
|
266
|
+
originalEvent: e,
|
|
267
|
+
external: ke.fromVueCal !== C
|
|
231
268
|
});
|
|
232
|
-
let k = !0;
|
|
233
|
-
const { drop: t } = (R = s.eventListeners) == null ? void 0 : R.event;
|
|
234
|
-
t && (k = await t({
|
|
235
|
-
e,
|
|
236
|
-
event: { ...E, start: H, end: B, schedule: ~~l },
|
|
237
|
-
overlaps: E.getOverlappingEvents({ start: H, end: B, schedule: ~~l }),
|
|
238
|
-
cell: v,
|
|
239
|
-
external: pe.fromVueCal !== _
|
|
240
|
-
})), k !== !1 && n(), v.highlighted = !1, v.highlightedSchedule = null, Ne = !1, pe.toVueCal = _, w("event-dropped", { event: E, originalEvent: y, external: pe.fromVueCal !== _ }), w("event-change", { event: E, originalEvent: y });
|
|
241
269
|
}
|
|
242
270
|
};
|
|
243
271
|
}
|
|
244
|
-
const
|
|
245
|
-
let
|
|
246
|
-
const
|
|
247
|
-
Date.prototype.addDays = function(
|
|
248
|
-
return
|
|
249
|
-
}, Date.prototype.subtractDays = function(
|
|
250
|
-
return
|
|
251
|
-
}, Date.prototype.addHours = function(
|
|
252
|
-
return
|
|
253
|
-
}, Date.prototype.subtractHours = function(
|
|
254
|
-
return
|
|
255
|
-
}, Date.prototype.addMinutes = function(
|
|
256
|
-
return
|
|
257
|
-
}, Date.prototype.subtractMinutes = function(
|
|
258
|
-
return
|
|
272
|
+
const lt = (y, t) => {
|
|
273
|
+
let d, r, h, C = {}, W = {};
|
|
274
|
+
const v = ue(y), A = () => {
|
|
275
|
+
v.value.today || (v.value = t), Date.prototype.addDays = function(s) {
|
|
276
|
+
return E(this, s || 0);
|
|
277
|
+
}, Date.prototype.subtractDays = function(s) {
|
|
278
|
+
return F(this, s || 0);
|
|
279
|
+
}, Date.prototype.addHours = function(s) {
|
|
280
|
+
return m(this, s || 0);
|
|
281
|
+
}, Date.prototype.subtractHours = function(s) {
|
|
282
|
+
return i(this, s || 0);
|
|
283
|
+
}, Date.prototype.addMinutes = function(s) {
|
|
284
|
+
return S(this, s || 0);
|
|
285
|
+
}, Date.prototype.subtractMinutes = function(s) {
|
|
286
|
+
return n(this, s || 0);
|
|
259
287
|
}, Date.prototype.getWeek = function() {
|
|
260
|
-
return
|
|
288
|
+
return e(this);
|
|
261
289
|
}, Date.prototype.isToday = function() {
|
|
262
|
-
return
|
|
290
|
+
return z(this);
|
|
263
291
|
}, Date.prototype.isLeapYear = function() {
|
|
264
|
-
return
|
|
265
|
-
}, Date.prototype.format = function(
|
|
266
|
-
return
|
|
267
|
-
}, Date.prototype.formatTime = function(
|
|
268
|
-
return
|
|
292
|
+
return _(this);
|
|
293
|
+
}, Date.prototype.format = function(s = "YYYY-MM-DD") {
|
|
294
|
+
return X(this, s);
|
|
295
|
+
}, Date.prototype.formatTime = function(s = "HH:mm") {
|
|
296
|
+
return Q(this, s);
|
|
269
297
|
};
|
|
270
|
-
},
|
|
298
|
+
}, Z = () => {
|
|
271
299
|
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;
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
300
|
+
}, L = (s) => {
|
|
301
|
+
v.value = s, Date.prototype.subtractDays && A();
|
|
302
|
+
}, l = () => (r !== (/* @__PURE__ */ new Date()).getDate() && (d = /* @__PURE__ */ new Date(), r = d.getDate(), h = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`), h), E = (s, k) => {
|
|
303
|
+
const D = new Date(s.valueOf());
|
|
304
|
+
return D.setDate(D.getDate() + k), D;
|
|
305
|
+
}, F = (s, k) => {
|
|
306
|
+
const D = new Date(s.valueOf());
|
|
307
|
+
return D.setDate(D.getDate() - k), D;
|
|
308
|
+
}, m = (s, k) => {
|
|
309
|
+
const D = new Date(s.valueOf());
|
|
310
|
+
return D.setHours(D.getHours() + k), D;
|
|
311
|
+
}, i = (s, k) => {
|
|
312
|
+
const D = new Date(s.valueOf());
|
|
313
|
+
return D.setHours(D.getHours() - k), D;
|
|
314
|
+
}, S = (s, k) => {
|
|
315
|
+
const D = new Date(s.valueOf());
|
|
316
|
+
return D.setMinutes(D.getMinutes() + k), D;
|
|
317
|
+
}, n = (s, k) => {
|
|
318
|
+
const D = new Date(s.valueOf());
|
|
319
|
+
return D.setMinutes(D.getMinutes() - k), D;
|
|
320
|
+
}, I = (s, k) => {
|
|
321
|
+
const D = (J) => {
|
|
322
|
+
const ne = J % k;
|
|
323
|
+
return ne !== 0 && (J += ne >= k / 2 ? k - ne : -ne), J;
|
|
294
324
|
};
|
|
295
|
-
if (typeof
|
|
296
|
-
if (
|
|
297
|
-
let
|
|
298
|
-
|
|
325
|
+
if (typeof s == "number") return D(s);
|
|
326
|
+
if (s instanceof Date) {
|
|
327
|
+
let J = D(s.getMinutes());
|
|
328
|
+
J >= 60 && (s.setHours(s.getHours() + 1), J = 0), s.setMinutes(J, 0, 0);
|
|
299
329
|
}
|
|
300
|
-
},
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
return Math.ceil(((
|
|
305
|
-
},
|
|
306
|
-
if (!
|
|
307
|
-
if (
|
|
308
|
-
if (!
|
|
309
|
-
} else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${
|
|
310
|
-
return
|
|
311
|
-
},
|
|
312
|
-
const
|
|
313
|
-
return !(
|
|
314
|
-
},
|
|
315
|
-
const
|
|
316
|
-
return
|
|
317
|
-
},
|
|
318
|
-
typeof
|
|
319
|
-
const
|
|
320
|
-
return Math.ceil((
|
|
321
|
-
},
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
YYYY: () =>
|
|
326
|
-
YY: () =>
|
|
327
|
-
M: () =>
|
|
328
|
-
MM: () =>
|
|
329
|
-
MMM: () =>
|
|
330
|
-
MMMM: () =>
|
|
331
|
-
MMMMG: () =>
|
|
332
|
-
D: () =>
|
|
333
|
-
DD: () =>
|
|
334
|
-
S: () =>
|
|
335
|
-
d: () =>
|
|
336
|
-
dd: () =>
|
|
337
|
-
ddd: () =>
|
|
338
|
-
dddd: () =>
|
|
339
|
-
HH: () =>
|
|
340
|
-
H: () =>
|
|
341
|
-
hh: () =>
|
|
342
|
-
h: () =>
|
|
343
|
-
am: () =>
|
|
344
|
-
AM: () =>
|
|
345
|
-
mm: () =>
|
|
346
|
-
m: () =>
|
|
347
|
-
s: () =>
|
|
330
|
+
}, e = (s, k = !1) => {
|
|
331
|
+
const D = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), J = D.getUTCDay() || 7;
|
|
332
|
+
D.setUTCDate(D.getUTCDate() + 4 - J);
|
|
333
|
+
const ne = new Date(Date.UTC(D.getUTCFullYear(), 0, 1));
|
|
334
|
+
return Math.ceil(((D - ne) / 864e5 + 1) / 7) + (k ? 1 : 0);
|
|
335
|
+
}, z = (s) => `${s.getFullYear()}-${s.getMonth()}-${s.getDate()}` === l(), H = (s, k) => {
|
|
336
|
+
if (!s || !k) return console.warn(`Vue Cal: missing date${s ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
|
|
337
|
+
if (O(s)) {
|
|
338
|
+
if (!O(k)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${k}\`.`);
|
|
339
|
+
} else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${s}\`.`);
|
|
340
|
+
return s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
|
|
341
|
+
}, Y = (s, k, D) => O(s) ? s.getTime() >= k && s.getTime() <= D : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${s}\`.`), _ = (s) => {
|
|
342
|
+
const k = s.getFullYear();
|
|
343
|
+
return !(k % 400) || k % 100 && !(k % 4);
|
|
344
|
+
}, f = (s = null, k) => {
|
|
345
|
+
const D = s && new Date(s.valueOf()) || /* @__PURE__ */ new Date(), J = k ? 7 : 6;
|
|
346
|
+
return D.setDate(D.getDate() - (D.getDay() + J) % 7), D;
|
|
347
|
+
}, c = (s) => s instanceof Date ? s : (s.length === 10 && (s += " 00:00"), new Date(s.replace(/-/g, "/"))), u = (s) => s.getHours() * 60 + s.getMinutes(), p = (s, k) => {
|
|
348
|
+
typeof s == "string" && (s = s.replace(/-/g, "/")), typeof k == "string" && (k = k.replace(/-/g, "/")), s = new Date(s).setHours(0, 0, 0, 0), k = new Date(k).setHours(0, 0, 1, 0);
|
|
349
|
+
const D = (new Date(k).getTimezoneOffset() - new Date(s).getTimezoneOffset()) * 60 * 1e3;
|
|
350
|
+
return Math.ceil((k - s - D) / (24 * 3600 * 1e3));
|
|
351
|
+
}, a = (s, k, D) => Math.abs(s.getTime() - k.getTime()) <= D * 60 * 1e3, O = (s) => s && s instanceof Date && !isNaN(s), X = (s, k = "YYYY-MM-DD", D = null) => {
|
|
352
|
+
if (D || (D = v.value), k || (k = "YYYY-MM-DD"), k === "YYYY-MM-DD") return U(s);
|
|
353
|
+
C = {}, W = {};
|
|
354
|
+
const J = {
|
|
355
|
+
YYYY: () => ae(s, D).YYYY,
|
|
356
|
+
YY: () => ae(s, D).YY(),
|
|
357
|
+
M: () => ae(s, D).M,
|
|
358
|
+
MM: () => ae(s, D).MM(),
|
|
359
|
+
MMM: () => ae(s, D).MMM(),
|
|
360
|
+
MMMM: () => ae(s, D).MMMM(),
|
|
361
|
+
MMMMG: () => ae(s, D).MMMMG(),
|
|
362
|
+
D: () => ae(s, D).D,
|
|
363
|
+
DD: () => ae(s, D).DD(),
|
|
364
|
+
S: () => ae(s, D).S(),
|
|
365
|
+
d: () => ae(s, D).d,
|
|
366
|
+
dd: () => ae(s, D).dd(),
|
|
367
|
+
ddd: () => ae(s, D).ddd(),
|
|
368
|
+
dddd: () => ae(s, D).dddd(),
|
|
369
|
+
HH: () => ve(s, D).HH,
|
|
370
|
+
H: () => ve(s, D).H,
|
|
371
|
+
hh: () => ve(s, D).hh,
|
|
372
|
+
h: () => ve(s, D).h,
|
|
373
|
+
am: () => ve(s, D).am,
|
|
374
|
+
AM: () => ve(s, D).AM,
|
|
375
|
+
mm: () => ve(s, D).mm,
|
|
376
|
+
m: () => ve(s, D).m,
|
|
377
|
+
s: () => ve(s, D).s
|
|
348
378
|
};
|
|
349
|
-
return
|
|
350
|
-
const
|
|
351
|
-
return
|
|
379
|
+
return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (ne, me) => {
|
|
380
|
+
const o = J[me.replace(/\{|\}/g, "")];
|
|
381
|
+
return o !== void 0 ? o() : me;
|
|
352
382
|
});
|
|
353
|
-
},
|
|
354
|
-
const
|
|
355
|
-
return `${
|
|
356
|
-
},
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
const [T,
|
|
360
|
-
T +
|
|
383
|
+
}, U = (s) => {
|
|
384
|
+
const k = s.getMonth() + 1, D = s.getDate();
|
|
385
|
+
return `${s.getFullYear()}-${k < 10 ? "0" : ""}${k}-${D < 10 ? "0" : ""}${D}`;
|
|
386
|
+
}, Q = (s, k = "HH:mm", D = null, J = !1) => {
|
|
387
|
+
let ne = !1;
|
|
388
|
+
if (J) {
|
|
389
|
+
const [T, M, w] = [s.getHours(), s.getMinutes(), s.getSeconds()];
|
|
390
|
+
T + M + w === 141 && (ne = !0);
|
|
361
391
|
}
|
|
362
|
-
if (
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
const
|
|
366
|
-
return
|
|
392
|
+
if (s instanceof Date && k === "HH:mm") return ne ? "24:00" : te(s);
|
|
393
|
+
W = {}, D || (D = v.value);
|
|
394
|
+
const me = ve(s, D), o = k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (T, M) => {
|
|
395
|
+
const w = me[M.replace(/\{|\}/g, "")];
|
|
396
|
+
return w !== void 0 ? w : M;
|
|
367
397
|
});
|
|
368
|
-
return
|
|
369
|
-
},
|
|
370
|
-
const
|
|
371
|
-
return `${(
|
|
372
|
-
},
|
|
373
|
-
const
|
|
374
|
-
return `${
|
|
375
|
-
},
|
|
376
|
-
if (
|
|
377
|
-
switch (
|
|
398
|
+
return ne ? o.replace("23:59", "24:00") : o;
|
|
399
|
+
}, te = (s) => {
|
|
400
|
+
const k = s.getHours(), D = s.getMinutes();
|
|
401
|
+
return `${(k < 10 ? "0" : "") + k}:${(D < 10 ? "0" : "") + D}`;
|
|
402
|
+
}, q = (s) => {
|
|
403
|
+
const k = Math.floor(s / 60).toString().padStart(2, 0), D = (s % 60).toString().padStart(2, 0);
|
|
404
|
+
return `${k}:${D}`;
|
|
405
|
+
}, le = (s) => {
|
|
406
|
+
if (s > 3 && s < 21) return "th";
|
|
407
|
+
switch (s % 10) {
|
|
378
408
|
case 1:
|
|
379
409
|
return "st";
|
|
380
410
|
case 2:
|
|
@@ -384,94 +414,98 @@ const Ke = (c) => {
|
|
|
384
414
|
default:
|
|
385
415
|
return "th";
|
|
386
416
|
}
|
|
387
|
-
},
|
|
388
|
-
if (
|
|
389
|
-
const
|
|
390
|
-
return
|
|
417
|
+
}, ae = (s, k) => {
|
|
418
|
+
if (C.D) return C;
|
|
419
|
+
const D = s.getFullYear(), J = s.getMonth() + 1, ne = s.getDate(), o = (s.getDay() - 1 + 7) % 7;
|
|
420
|
+
return C = {
|
|
391
421
|
// Year.
|
|
392
|
-
YYYY:
|
|
422
|
+
YYYY: D,
|
|
393
423
|
// 2024.
|
|
394
|
-
YY: () =>
|
|
424
|
+
YY: () => D.toString().substring(2),
|
|
395
425
|
// 24.
|
|
396
426
|
// Month.
|
|
397
|
-
M:
|
|
427
|
+
M: J,
|
|
398
428
|
// 1 to 12.
|
|
399
|
-
MM: () =>
|
|
429
|
+
MM: () => J.toString().padStart(2, 0),
|
|
400
430
|
// 01 to 12.
|
|
401
|
-
MMM: () =>
|
|
431
|
+
MMM: () => k.months[J - 1].substring(0, 3),
|
|
402
432
|
// Jan to Dec.
|
|
403
|
-
MMMM: () =>
|
|
433
|
+
MMMM: () => k.months[J - 1],
|
|
404
434
|
// January to December.
|
|
405
|
-
MMMMG: () => (
|
|
435
|
+
MMMMG: () => (k.monthsGenitive || k.months)[J - 1],
|
|
406
436
|
// January to December in genitive form (Greek...)
|
|
407
437
|
// Day.
|
|
408
|
-
D:
|
|
438
|
+
D: ne,
|
|
409
439
|
// 1 to 31.
|
|
410
|
-
DD: () =>
|
|
440
|
+
DD: () => ne.toString().padStart(2, 0),
|
|
411
441
|
// 01 to 31.
|
|
412
|
-
S: () =>
|
|
442
|
+
S: () => le(ne),
|
|
413
443
|
// st, nd, rd, th.
|
|
414
444
|
// Day of the week.
|
|
415
|
-
d:
|
|
445
|
+
d: o + 1,
|
|
416
446
|
// 1 to 7 with 7 = Sunday.
|
|
417
447
|
// Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
|
|
418
|
-
dd: () =>
|
|
448
|
+
dd: () => k.weekDaysShort.length ? k.weekDaysShort[o] : k.weekDays[o][0],
|
|
419
449
|
// M to S.
|
|
420
|
-
ddd: () =>
|
|
450
|
+
ddd: () => k.weekDaysShort.length ? k.weekDaysShort[o] : k.weekDays[o].substr(0, 3),
|
|
421
451
|
// Mon to Sun.
|
|
422
|
-
dddd: () =>
|
|
452
|
+
dddd: () => k.weekDays[o]
|
|
423
453
|
// Monday to Sunday.
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
if (
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
return
|
|
431
|
-
H:
|
|
432
|
-
h:
|
|
433
|
-
HH:
|
|
434
|
-
hh:
|
|
435
|
-
am:
|
|
436
|
-
AM:
|
|
437
|
-
m:
|
|
438
|
-
mm:
|
|
439
|
-
s:
|
|
440
|
-
},
|
|
454
|
+
}, C;
|
|
455
|
+
}, ve = (s, k) => {
|
|
456
|
+
if (W.am) return W;
|
|
457
|
+
let D, J, ne;
|
|
458
|
+
s instanceof Date ? (D = s.getHours(), J = s.getMinutes(), ne = s.getSeconds()) : (D = Math.floor(s / 60), J = Math.floor(s % 60));
|
|
459
|
+
const me = D % 12 ? D % 12 : 12, o = (k || { am: "am", pm: "pm" })[D === 24 || D < 12 ? "am" : "pm"];
|
|
460
|
+
return W = {
|
|
461
|
+
H: D,
|
|
462
|
+
h: me,
|
|
463
|
+
HH: D.toString().padStart(2, 0),
|
|
464
|
+
hh: me.toString().padStart(2, 0),
|
|
465
|
+
am: o,
|
|
466
|
+
AM: o.toUpperCase(),
|
|
467
|
+
m: J,
|
|
468
|
+
mm: J.toString().padStart(2, 0),
|
|
469
|
+
s: ne
|
|
470
|
+
}, W;
|
|
441
471
|
};
|
|
442
472
|
return {
|
|
443
|
-
addDatePrototypes:
|
|
444
|
-
removeDatePrototypes:
|
|
445
|
-
updateTexts:
|
|
446
|
-
addDays:
|
|
447
|
-
subtractDays:
|
|
448
|
-
addHours:
|
|
449
|
-
subtractHours:
|
|
450
|
-
addMinutes:
|
|
451
|
-
subtractMinutes:
|
|
452
|
-
snapToInterval:
|
|
453
|
-
getWeek:
|
|
454
|
-
isToday:
|
|
473
|
+
addDatePrototypes: A,
|
|
474
|
+
removeDatePrototypes: Z,
|
|
475
|
+
updateTexts: L,
|
|
476
|
+
addDays: E,
|
|
477
|
+
subtractDays: F,
|
|
478
|
+
addHours: m,
|
|
479
|
+
subtractHours: i,
|
|
480
|
+
addMinutes: S,
|
|
481
|
+
subtractMinutes: n,
|
|
482
|
+
snapToInterval: I,
|
|
483
|
+
getWeek: e,
|
|
484
|
+
isToday: z,
|
|
455
485
|
isSameDate: H,
|
|
456
|
-
isInRange:
|
|
457
|
-
isLeapYear:
|
|
458
|
-
getPreviousFirstDayOfWeek:
|
|
459
|
-
stringToDate:
|
|
460
|
-
dateToMinutes:
|
|
461
|
-
countDays:
|
|
462
|
-
datesInSameTimeStep:
|
|
463
|
-
isValid:
|
|
464
|
-
formatDate:
|
|
465
|
-
formatDateLite:
|
|
466
|
-
formatTime:
|
|
467
|
-
formatTimeLite:
|
|
468
|
-
formatMinutes:
|
|
486
|
+
isInRange: Y,
|
|
487
|
+
isLeapYear: _,
|
|
488
|
+
getPreviousFirstDayOfWeek: f,
|
|
489
|
+
stringToDate: c,
|
|
490
|
+
dateToMinutes: u,
|
|
491
|
+
countDays: p,
|
|
492
|
+
datesInSameTimeStep: a,
|
|
493
|
+
isValid: O,
|
|
494
|
+
formatDate: X,
|
|
495
|
+
formatDateLite: U,
|
|
496
|
+
formatTime: Q,
|
|
497
|
+
formatTimeLite: te,
|
|
498
|
+
formatMinutes: q
|
|
469
499
|
};
|
|
470
|
-
},
|
|
471
|
-
const { dateUtils:
|
|
472
|
-
let
|
|
473
|
-
const
|
|
474
|
-
|
|
500
|
+
}, Vt = (y) => {
|
|
501
|
+
const { dateUtils: t, config: d } = y;
|
|
502
|
+
let r = 0;
|
|
503
|
+
const h = b(() => {
|
|
504
|
+
var H, Y, _, f, c;
|
|
505
|
+
const e = {
|
|
506
|
+
// A map of events indexed by { YYYY: { MM: { DD: [] } } }.
|
|
507
|
+
// Each year contains a map of 12 months starting from 1, each containing a map of days starting from 1, each containing an array of event IDs.
|
|
508
|
+
byYear: {},
|
|
475
509
|
byDate: {},
|
|
476
510
|
// A map of single-day events indexed by date.
|
|
477
511
|
recurring: [],
|
|
@@ -479,430 +513,593 @@ const Ke = (c) => {
|
|
|
479
513
|
multiday: [],
|
|
480
514
|
// An array of events IDs that are multiday.
|
|
481
515
|
byId: {}
|
|
482
|
-
// A map of all the events indexed by ID for fast lookup.
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}),
|
|
516
|
-
|
|
517
|
-
|
|
516
|
+
// A map of all the events indexed by ID for fast lookup. Each event is the original full event object.
|
|
517
|
+
}, z = d.events.slice().sort((u, p) => u.start - p.start < 0 ? -1 : 1);
|
|
518
|
+
for (let u of z) {
|
|
519
|
+
const p = typeof u.start == "string" || typeof u.end == "string", a = !((H = u._) != null && H.register) || !u.isOverlapping || !u.delete;
|
|
520
|
+
let O = !1;
|
|
521
|
+
if (!p && ((Y = u._) != null && Y.cachedStart) && ((_ = u._) != null && _.cachedEnd) && (O = u.start.getTime() !== ((f = u._) == null ? void 0 : f.cachedStart) || u.end.getTime() !== ((c = u._) == null ? void 0 : c.cachedEnd)), p || a || O) {
|
|
522
|
+
if (!C(u)) continue;
|
|
523
|
+
W(u), u._.cachedStart = u.start.getTime(), u._.cachedEnd = u.end.getTime();
|
|
524
|
+
}
|
|
525
|
+
if (e.byId[u._.id] = u, u.recurring)
|
|
526
|
+
e.recurring.push(u._.id);
|
|
527
|
+
else if (!t.isSameDate(u.start, new Date(u.end.getTime() - 1)))
|
|
528
|
+
u._.multiday = d.multidayEvents, d.multidayEvents ? e.multiday.push(u._.id) : (console.info("Vue Cal: Multi-day events provided without being enabled. Truncating event end to next midnight."), u.end = new Date(new Date(u.start).setHours(23, 59, 59, 999)), W(u)), e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
|
|
529
|
+
else {
|
|
530
|
+
e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
|
|
531
|
+
const X = u._.startFormatted.substring(0, 4), U = u._.startFormatted.substring(5, 7), Q = u._.startFormatted.substring(8, 10);
|
|
532
|
+
e.byYear[X] || (e.byYear[X] = {}), e.byYear[X][U] || (e.byYear[X][U] = {}), e.byYear[X][U][Q] || (e.byYear[X][U][Q] = []), e.byYear[X][U][Q].push(u._.id);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return e;
|
|
536
|
+
}), C = (e) => !e.start || !e.end ? (console.error("Vue Cal: Event is missing start or end date", e), !1) : (typeof e.start == "string" && (e.start = t.stringToDate(e.start)), typeof e.end == "string" && (e.end = t.stringToDate(e.end)), e.start.setSeconds(0, 0), e.end.getSeconds() === 59 ? e.end.setMinutes(e.end.getMinutes() + 1, 0, 0) : e.end.setSeconds(0, 0), isNaN(e.start) || isNaN(e.end) || e.end.getTime() < e.start.getTime() ? (isNaN(e.start) ? console.error(`Vue Cal: invalid start date for event "${e.title}".`, e.start) : isNaN(e.end) ? console.error(`Vue Cal: invalid end date for event "${e.title}".`, e.end) : console.error(`Vue Cal: invalid event dates for event "${e.title}". The event ends before it starts.`, e.start, e.end), !1) : !0), W = (e) => {
|
|
537
|
+
e._ || (e._ = {}), e._.id = e._.id || ++r, e._.multiday = !t.isSameDate(e.start, new Date(e.end.getTime() - 1)), e._.startFormatted = t.formatDate(e.start), e._.endFormatted = t.formatDate(e.end), e._.startMinutes = ~~t.dateToMinutes(e.start), e._.endMinutes = ~~t.dateToMinutes(e.end);
|
|
538
|
+
const z = e.start.getHours(), H = e.start.getMinutes().toString().padStart(2, 0), Y = e.end.getHours(), _ = e.end.getMinutes().toString().padStart(2, 0);
|
|
539
|
+
e._.startTimeFormatted24 = `${z.toString().padStart(2, 0)}:${H}`, e._.startTimeFormatted12 = `${z % 12 || 12}${H ? `:${H}` : ""} ${z < 12 ? "AM" : "PM"}`, e._.endTimeFormatted24 = `${Y.toString().padStart(2, 0)}:${_}`, e._.endTimeFormatted12 = `${Y % 12 || 12}${_ ? `:${_}` : ""} ${Y < 12 ? "AM" : "PM"}`, e._.duration = Math.abs(~~((e.end - e.start) / 6e4)), e.delete || (e.delete = function(f) {
|
|
540
|
+
return L(this._.id, f);
|
|
541
|
+
}), e._.deleting === void 0 && (e._.deleting = !1), e._.deleted === void 0 && (e._.deleted = !1), e.isOverlapping || (e.isOverlapping = function(f = null) {
|
|
542
|
+
return this.getOverlappingEvents(f).length;
|
|
543
|
+
}), e.getOverlappingEvents || (e.getOverlappingEvents = function(f = null) {
|
|
544
|
+
var a;
|
|
545
|
+
const c = (f == null ? void 0 : f.start) || this.start, u = (f == null ? void 0 : f.end) || this.end, p = (a = d.schedules) != null && a.length ? ~~((f == null ? void 0 : f.schedule) || this.schedule) : null;
|
|
546
|
+
return E(c, u, { excludeIds: [this._.id], schedule: p });
|
|
547
|
+
}), e._.register || (e._.register = (f) => {
|
|
548
|
+
e._.$el = f, e._.fireCreated && (y.emit("event-created", e), delete e._.fireCreated);
|
|
549
|
+
}), e._.unregister || (e._.unregister = () => {
|
|
550
|
+
e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
|
|
551
|
+
});
|
|
552
|
+
}, v = (e) => h.value.byId[e], A = (e) => {
|
|
553
|
+
const z = [];
|
|
554
|
+
for (const { start: H, end: Y } of e) {
|
|
555
|
+
const _ = E(H, Y);
|
|
556
|
+
_.length && z.push(..._);
|
|
557
|
+
}
|
|
558
|
+
return z;
|
|
559
|
+
}, Z = (e) => {
|
|
560
|
+
if (!e.start || !e.end) {
|
|
518
561
|
console.error("Vue Cal: Cannot create an event without valid start and end dates.");
|
|
519
562
|
return;
|
|
520
563
|
}
|
|
521
|
-
return
|
|
522
|
-
},
|
|
523
|
-
var
|
|
524
|
-
if (!
|
|
564
|
+
return d.snapToInterval && (t.snapToInterval(e.start, d.snapToInterval), t.snapToInterval(e.end, d.snapToInterval)), e = { ...e }, e._ || (e._ = {}), e._.id = ++r, e._.fireCreated = !0, d.events.push(e), e;
|
|
565
|
+
}, L = async (e, z = 0) => {
|
|
566
|
+
var c, u;
|
|
567
|
+
if (!e) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
|
|
568
|
+
let H = typeof e == "string" || !isNaN(e) ? e : null;
|
|
569
|
+
const Y = typeof e == "object" ? Object.entries(e) : null;
|
|
570
|
+
if (Y) {
|
|
571
|
+
const [p, a] = Y[0];
|
|
572
|
+
H = (c = d.events.find((O) => O[p] === a)) == null ? void 0 : c._.id;
|
|
573
|
+
}
|
|
574
|
+
if (!d.editableEvents.delete)
|
|
525
575
|
return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
|
|
526
|
-
if (!
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
531
|
-
switch (
|
|
576
|
+
if (!H) return console.warn("Vue Cal: Cannot delete event without its ID.");
|
|
577
|
+
const _ = d.events.findIndex((p) => p._.id === H);
|
|
578
|
+
if (_ === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${H}\`.`);
|
|
579
|
+
const f = d.events[_];
|
|
580
|
+
if (f.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${H}\` since it was explicitely set to \`delete: false\`.`);
|
|
581
|
+
switch (z) {
|
|
532
582
|
case 0:
|
|
533
|
-
|
|
583
|
+
f._.deleting ? d.events.splice(_, 1) : f._.deleting = !0;
|
|
534
584
|
break;
|
|
535
585
|
// Display the delete button.
|
|
536
586
|
case 1:
|
|
537
|
-
|
|
587
|
+
f._.deleting = !0;
|
|
538
588
|
break;
|
|
539
589
|
// Visual deletion + external DOM event firing.
|
|
540
590
|
// When explicitly using this stage, the event will be visually deleted but still present in the
|
|
541
591
|
// source of truth until the cell is unmounted (by navigating away).
|
|
542
592
|
case 2:
|
|
543
|
-
|
|
593
|
+
f._.deleted = !0, d.events[_]._.deleted = !0, (u = f._.$el) == null || u.dispatchEvent(new CustomEvent("event-deleted", { detail: f._.id }));
|
|
544
594
|
break;
|
|
545
595
|
// Effective deletion from the source of truth (by default, when unmounting the cell).
|
|
546
596
|
case 3:
|
|
547
|
-
|
|
597
|
+
d.events.splice(_, 1), y.emit("update:events", d.events), y.emit("event-delete", f);
|
|
548
598
|
break;
|
|
549
599
|
}
|
|
550
600
|
return !0;
|
|
551
|
-
},
|
|
552
|
-
const d =
|
|
553
|
-
if (!
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
601
|
+
}, l = (e, z, H) => {
|
|
602
|
+
const Y = d.allDayEvents ? { allDay: H } : {}, _ = E(e, z, { background: !1, ...Y });
|
|
603
|
+
if (!_.length) return { cellOverlaps: {}, longestStreak: 0 };
|
|
604
|
+
const f = {};
|
|
605
|
+
let c = [], u = 0;
|
|
606
|
+
_.sort((p, a) => p.start - a.start || p.end - p.start - (a.end - a.start));
|
|
607
|
+
for (const p of _) {
|
|
608
|
+
const a = p._.id;
|
|
609
|
+
f[a] || (f[a] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), c = c.filter((te) => te.end > p.start);
|
|
610
|
+
const O = c.filter((te) => {
|
|
611
|
+
var le;
|
|
612
|
+
return (!((le = d.schedules) != null && le.length) || p.schedule === te.schedule) && te.start < p.end;
|
|
613
|
+
}), X = new Set(O.map((te) => {
|
|
614
|
+
var q;
|
|
615
|
+
return ((q = f[te._.id]) == null ? void 0 : q.position) ?? 0;
|
|
616
|
+
}));
|
|
617
|
+
let U = 0;
|
|
618
|
+
for (; X.has(U); ) U++;
|
|
619
|
+
f[a].position = U, c.push(p);
|
|
620
|
+
const Q = Math.max(1, ...O.map((te) => {
|
|
621
|
+
var q;
|
|
622
|
+
return ((q = f[te._.id]) == null ? void 0 : q.maxConcurrent) ?? 1;
|
|
571
623
|
}));
|
|
572
|
-
|
|
573
|
-
for (const
|
|
574
|
-
|
|
575
|
-
|
|
624
|
+
f[a].maxConcurrent = Math.max(O.length + 1, Q);
|
|
625
|
+
for (const te of O)
|
|
626
|
+
f[te._.id].overlaps.add(a), f[a].overlaps.add(te._.id), f[te._.id].maxConcurrent = f[a].maxConcurrent;
|
|
627
|
+
u = Math.max(u, f[a].maxConcurrent);
|
|
628
|
+
}
|
|
629
|
+
for (const p in f) f[p].overlaps = [...f[p].overlaps];
|
|
630
|
+
return { cellOverlaps: f, longestStreak: u };
|
|
631
|
+
}, E = (e, z, { excludeIds: H = [], schedule: Y = null, background: _ = !0, allDay: f = !1 } = {}) => {
|
|
632
|
+
if (!Object.keys(h.value.byId).length) return [];
|
|
633
|
+
const c = e.getFullYear(), u = z.getFullYear(), p = e.getMonth() + 1, a = z.getMonth() + 1, O = e.getDate(), X = z.getDate();
|
|
634
|
+
e.getTime(), z.getTime();
|
|
635
|
+
const U = new Date(e).setHours(0, 0, 0, 0), Q = new Date(z).setHours(23, 59, 59, 999), te = new Set(H), q = [];
|
|
636
|
+
if (Object.keys(h.value.byId).length <= 100) {
|
|
637
|
+
for (const le of Object.values(h.value.byId))
|
|
638
|
+
!le || te.has(le._.id) || Y !== null && Y !== le.schedule || _ === !1 && le.background || d.allDayEvents && (f && !le.allDay || !f && le.allDay) || le.start.getTime() < Q && le.end.getTime() > U && q.push(le);
|
|
639
|
+
return q;
|
|
640
|
+
}
|
|
641
|
+
for (let le = c; le <= u; le++) {
|
|
642
|
+
const ae = `${le}`, ve = h.value.byYear[ae];
|
|
643
|
+
if (!ve) continue;
|
|
644
|
+
const s = le === c ? p : 1, k = le === u ? a : 12;
|
|
645
|
+
for (let D = s; D <= k; D++) {
|
|
646
|
+
const J = String(D).padStart(2, "0"), ne = ve[J];
|
|
647
|
+
if (ne)
|
|
648
|
+
for (const me in ne) {
|
|
649
|
+
const o = +me;
|
|
650
|
+
if (o > X || o < O) continue;
|
|
651
|
+
const T = ne[me];
|
|
652
|
+
if (T != null && T.length)
|
|
653
|
+
for (let M = 0; M < T.length; M++) {
|
|
654
|
+
const w = h.value.byId[T[M]];
|
|
655
|
+
!w || te.has(w._.id) || Y !== null && Y !== w.schedule || _ === !1 && w.background || d.allDayEvents && (f && !w.allDay || !f && w.allDay) || w.start.getTime() < Q && w.end.getTime() > U && q.push(w);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
576
659
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
660
|
+
return q;
|
|
661
|
+
}, F = (e, z, H) => {
|
|
662
|
+
const Y = e.allDay || !d.time, _ = Y ? new Date(e.start).setHours(0, 0, 0, 0) : e.start.getTime(), f = Y ? new Date(e.end).setHours(23, 59, 59, 999) : e.end.getTime(), c = Y ? new Date(z).setHours(0, 0, 0, 0) : z.getTime(), u = Y ? new Date(H).setHours(23, 59, 59, 999) : H.getTime();
|
|
663
|
+
return f > c && _ < u;
|
|
664
|
+
}, m = be({
|
|
665
|
+
isResizing: !1,
|
|
666
|
+
fromResizer: !1,
|
|
667
|
+
resizingEvent: null,
|
|
668
|
+
resizingOriginalEvent: null,
|
|
669
|
+
resizingLastAcceptedEvent: null,
|
|
670
|
+
startX: 0,
|
|
671
|
+
startY: 0,
|
|
672
|
+
startPercentageX: 0,
|
|
673
|
+
startPercentageY: 0,
|
|
674
|
+
moveX: 0,
|
|
675
|
+
moveY: 0,
|
|
676
|
+
movePercentageX: 0,
|
|
677
|
+
movePercentageY: 0,
|
|
678
|
+
documentMouseX: 0,
|
|
679
|
+
documentMouseY: 0,
|
|
680
|
+
resizeStartDate: null,
|
|
681
|
+
cellEl: null,
|
|
682
|
+
schedule: null
|
|
683
|
+
}), i = (e, z) => {
|
|
684
|
+
var f;
|
|
685
|
+
let H = je(m.movePercentageY, d);
|
|
686
|
+
if (H = Math.max(0, Math.min(H, 1440)), d.snapToInterval) {
|
|
687
|
+
const c = H + d.snapToInterval / 2;
|
|
688
|
+
H = c - c % d.snapToInterval;
|
|
689
|
+
}
|
|
690
|
+
let Y = e.start, _ = new Date(z.getTime() + H * 6e4);
|
|
691
|
+
return m.moveX && ((f = y.touch) != null && f.currentHoveredCell) && m.cellEl && new Date(y.touch.currentHoveredCell.__vueParentComponent.props.start), _ < m.resizeStartDate && (Y = _, _ = m.resizeStartDate), { newStart: Y, newEnd: _ };
|
|
692
|
+
}, S = async (e) => {
|
|
693
|
+
var Y, _, f, c, u;
|
|
694
|
+
const { clientX: z, clientY: H } = ((Y = e.touches) == null ? void 0 : Y[0]) || e;
|
|
695
|
+
if (m.fromResizer && !((_ = y.touch) != null && _.isResizingEvent)) {
|
|
696
|
+
m.resizingOriginalEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } }, y.touch.isResizingEvent = !0;
|
|
697
|
+
const p = ((f = d.eventListeners) == null ? void 0 : f.event) || {};
|
|
698
|
+
(c = p["resize-start"]) == null || c.call(p, { e, event: m.resizingEvent });
|
|
699
|
+
}
|
|
700
|
+
if (m.cellEl) {
|
|
701
|
+
const { top: p, left: a, width: O, height: X } = m.cellEl.getBoundingClientRect();
|
|
702
|
+
m.moveX = z - a, m.moveY = H - p, m.movePercentageX = m.moveX * 100 / O, m.movePercentageY = m.moveY * 100 / X;
|
|
703
|
+
}
|
|
704
|
+
if (m.documentMouseX = z, m.documentMouseY = H, m.fromResizer && m.resizingEvent) {
|
|
705
|
+
const p = m.cellEl.__vueParentComponent.props.start, { newStart: a, newEnd: O } = i(m.resizingEvent, p);
|
|
706
|
+
let X = !0;
|
|
707
|
+
const { resize: U } = ((u = d.eventListeners) == null ? void 0 : u.event) || {};
|
|
708
|
+
U && (X = await U({
|
|
709
|
+
e,
|
|
710
|
+
event: { ...m.resizingEvent, start: a, end: O },
|
|
711
|
+
overlaps: m.resizingEvent.getOverlappingEvents({ start: a, end: O })
|
|
712
|
+
})), X !== !1 ? (m.resizingEvent.start = a, m.resizingEvent.end = O, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null), e.preventDefault()) : U && (m.resizingLastAcceptedEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } });
|
|
713
|
+
}
|
|
714
|
+
}, n = async (e) => {
|
|
715
|
+
var z, H, Y, _;
|
|
716
|
+
if ((z = y.touch) != null && z.isResizingEvent && m.resizingEvent) {
|
|
717
|
+
const f = m.cellEl.__vueParentComponent.props.start, { newStart: c, newEnd: u } = i(m.resizingEvent, f);
|
|
718
|
+
let p = !0;
|
|
719
|
+
const O = (((H = d.eventListeners) == null ? void 0 : H.event) || {})["resize-end"];
|
|
720
|
+
O && (p = await O({
|
|
721
|
+
e,
|
|
722
|
+
event: m.resizingEvent,
|
|
723
|
+
original: m.resizingOriginalEvent,
|
|
724
|
+
// Original event details before resizing.
|
|
725
|
+
overlaps: m.resizingEvent.getOverlappingEvents({ start: c, end: u })
|
|
726
|
+
})), m.resizingEvent.start = p === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((Y = m.resizingLastAcceptedEvent) == null ? void 0 : Y.start) || c, m.resizingEvent.end = p === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((_ = m.resizingLastAcceptedEvent) == null ? void 0 : _.end) || u, m.resizingEvent._.duration < 1 && (m.resizingEvent.start = m.resizingOriginalEvent.start, m.resizingEvent.end = m.resizingOriginalEvent.end), y.touch.isResizingEvent = !1, y.touch.currentHoveredCell = null;
|
|
727
|
+
}
|
|
728
|
+
document.removeEventListener(e.type === "touchend" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), y.touch.isResizingEvent = !1, m.fromResizer = !1, m.resizingEvent = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, 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.documentMouseX = 0, m.documentMouseY = 0, m.cellEl = null, m.resizeStartDate = null, m.schedule = null;
|
|
588
729
|
};
|
|
589
730
|
return {
|
|
590
|
-
events:
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
getViewEvents:
|
|
594
|
-
getCellOverlappingEvents:
|
|
595
|
-
getEventsInRange:
|
|
596
|
-
createEvent:
|
|
597
|
-
deleteEvent:
|
|
598
|
-
isEventInRange:
|
|
731
|
+
events: h,
|
|
732
|
+
resizeState: m,
|
|
733
|
+
getEvent: v,
|
|
734
|
+
getViewEvents: A,
|
|
735
|
+
getCellOverlappingEvents: l,
|
|
736
|
+
getEventsInRange: E,
|
|
737
|
+
createEvent: Z,
|
|
738
|
+
deleteEvent: L,
|
|
739
|
+
isEventInRange: F,
|
|
740
|
+
handleEventResize: (e, z, H) => {
|
|
741
|
+
var _;
|
|
742
|
+
const Y = ((_ = e.touches) == null ? void 0 : _[0]) || e;
|
|
743
|
+
if (m.fromResizer = !!Y.target.closest(".vuecal__event-resizer"), m.fromResizer) {
|
|
744
|
+
const f = H.getBoundingClientRect();
|
|
745
|
+
m.startX = Y.clientX - f.left, m.startY = Y.clientY - f.top, m.startPercentageX = m.startX * 100 / f.width, m.startPercentageY = m.startY * 100 / f.height, m.cellEl = H.closest(".vuecal__cell"), m.resizeStartDate = z.start, m.resizingEvent = z, document.addEventListener(e.type === "touchstart" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), document.addEventListener(e.type === "touchstart" ? "touchend" : "mouseup", n, { once: !0 });
|
|
746
|
+
}
|
|
747
|
+
}
|
|
599
748
|
};
|
|
600
|
-
},
|
|
601
|
-
const { availableViews:
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const b =
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
const P = n.value.getTime(), N = t.value.getTime();
|
|
618
|
-
return P <= h && h <= N;
|
|
749
|
+
}, Ot = ({ config: y, dateUtils: t, emit: d, texts: r, eventsManager: h }, C) => {
|
|
750
|
+
const { availableViews: W } = y, v = ue(y.view && W[y.view] ? y.view : y.defaultView), A = ue(y.selectedDate || null), Z = ue(/* @__PURE__ */ new Date()), L = ue(new Date(y.viewDate || Z.value));
|
|
751
|
+
L.value.setHours(0, 0, 0, 0);
|
|
752
|
+
const l = ue(new Date(L));
|
|
753
|
+
let E = null;
|
|
754
|
+
const F = b(() => v.value === "month" ? l.value : _.value), m = b(() => v.value === "month" ? new Date(l.value.getFullYear(), l.value.getMonth() + 1, 0, 23, 59, 59, 999) : c.value), i = b(() => v.value === "week" ? t.getPreviousFirstDayOfWeek(_.value, y.startWeekOnSunday) : v.value === "month" ? _.value : F.value), S = b(() => {
|
|
755
|
+
if (v.value === "week") {
|
|
756
|
+
const g = t.addDays(i.value, 7);
|
|
757
|
+
return g.setMilliseconds(-1), g;
|
|
758
|
+
}
|
|
759
|
+
return v.value === "month" ? c.value : m.value;
|
|
760
|
+
}), n = b(() => {
|
|
761
|
+
const g = Z.value.getTime();
|
|
762
|
+
if (v.value === "week")
|
|
763
|
+
return i.value.getTime() <= g && g <= S.value.getTime();
|
|
764
|
+
const R = _.value.getTime(), ee = c.value.getTime();
|
|
765
|
+
return R <= g && g <= ee;
|
|
619
766
|
});
|
|
620
|
-
function
|
|
621
|
-
|
|
767
|
+
function I() {
|
|
768
|
+
Z.value = /* @__PURE__ */ new Date(), E = setTimeout(I, 60 * 1e3);
|
|
622
769
|
}
|
|
623
|
-
function
|
|
624
|
-
|
|
770
|
+
function e() {
|
|
771
|
+
E = setTimeout(I, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), I();
|
|
625
772
|
}
|
|
626
|
-
const
|
|
627
|
-
if (!
|
|
628
|
-
let
|
|
629
|
-
return
|
|
630
|
-
}),
|
|
631
|
-
var
|
|
632
|
-
return ((
|
|
633
|
-
}),
|
|
634
|
-
if (
|
|
635
|
-
let
|
|
636
|
-
return
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
773
|
+
const z = b(() => {
|
|
774
|
+
if (!y.availableViews[v.value]) return 1;
|
|
775
|
+
let g = y.availableViews[v.value].cols;
|
|
776
|
+
return y.hasHiddenDays && ["week", "month"].includes(v.value) && (g -= y.hasHiddenDays), g;
|
|
777
|
+
}), H = b(() => {
|
|
778
|
+
var g;
|
|
779
|
+
return ((g = y.availableViews[v.value]) == null ? void 0 : g.rows) || 1;
|
|
780
|
+
}), Y = b(() => z.value * H.value), _ = b(() => {
|
|
781
|
+
if (v.value === "month") {
|
|
782
|
+
let g = l.value.getDay() || 7;
|
|
783
|
+
return y.startWeekOnSunday && !y.hideWeekdays[7] && (g += 1), y.viewDayOffset && (g -= y.viewDayOffset), t.subtractDays(l.value, g - 1);
|
|
784
|
+
}
|
|
785
|
+
if (v.value === "week") {
|
|
786
|
+
const g = "1234567".split("").filter((ee) => !Object.keys(y.hideWeekdays).includes(ee));
|
|
787
|
+
let R = Math.min(...g);
|
|
788
|
+
return y.startWeekOnSunday && !y.hideWeekdays[7] && (R = 1), y.viewDayOffset && (R += y.viewDayOffset), t.addDays(l.value, R - 1);
|
|
789
|
+
}
|
|
790
|
+
return l.value;
|
|
791
|
+
}), f = b(() => {
|
|
792
|
+
const g = [], R = ["days", "week", "month"].includes(v.value);
|
|
793
|
+
let ee = 0;
|
|
794
|
+
for (let K = 0; K < Y.value + ee; K++)
|
|
795
|
+
switch (v.value) {
|
|
647
796
|
case "day":
|
|
648
797
|
case "days":
|
|
649
798
|
case "week":
|
|
650
799
|
case "month": {
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
|
|
800
|
+
const ye = t.addDays(_.value, K), Ne = ye.getDay() || 7;
|
|
801
|
+
if (R && y.hasHiddenDays && y.hideWeekdays[Ne]) {
|
|
802
|
+
ee++;
|
|
654
803
|
continue;
|
|
655
804
|
}
|
|
656
|
-
const
|
|
657
|
-
|
|
805
|
+
const ze = new Date(ye);
|
|
806
|
+
ze.setHours(23, 59, 59, 999), g.push({ start: ye, startFormatted: t.formatDate(ye), end: ze });
|
|
658
807
|
break;
|
|
659
808
|
}
|
|
660
809
|
case "year":
|
|
661
|
-
|
|
662
|
-
start: new Date(
|
|
663
|
-
end: new Date(
|
|
810
|
+
g.push({
|
|
811
|
+
start: new Date(_.value.getFullYear(), K, 1, 0, 0, 0, 0),
|
|
812
|
+
end: new Date(_.value.getFullYear(), K + 1, 0, 23, 59, 59, 999)
|
|
664
813
|
});
|
|
665
814
|
break;
|
|
666
815
|
case "years":
|
|
667
|
-
|
|
668
|
-
start: new Date(
|
|
669
|
-
end: new Date(
|
|
816
|
+
g.push({
|
|
817
|
+
start: new Date(_.value.getFullYear() + K, 0, 1, 0, 0, 0, 0),
|
|
818
|
+
end: new Date(_.value.getFullYear() + K + 1, 0, 0, 23, 59, 59, 999)
|
|
670
819
|
});
|
|
671
820
|
break;
|
|
672
821
|
}
|
|
673
|
-
return
|
|
674
|
-
}),
|
|
675
|
-
const
|
|
676
|
-
return
|
|
677
|
-
}),
|
|
678
|
-
const
|
|
679
|
-
return
|
|
680
|
-
})
|
|
681
|
-
|
|
682
|
-
|
|
822
|
+
return g;
|
|
823
|
+
}), c = b(() => f.value[f.value.length - 1].end), u = ue("right"), p = b(() => {
|
|
824
|
+
const g = Object.keys(y.availableViews);
|
|
825
|
+
return g[g.indexOf(v.value) + 1];
|
|
826
|
+
}), a = b(() => {
|
|
827
|
+
const g = Object.keys(y.availableViews);
|
|
828
|
+
return g[g.indexOf(v.value) - 1];
|
|
829
|
+
});
|
|
830
|
+
function O(g, R, ee = !1) {
|
|
831
|
+
if (!R || !R[g]) return g + 1;
|
|
832
|
+
const K = R[g];
|
|
833
|
+
return ee && typeof K == "string" ? K.substring(0, 3) : K;
|
|
834
|
+
}
|
|
835
|
+
function X(g, R, ee) {
|
|
836
|
+
const { monthsArray: K, monthBeforeDay: ye, canTruncate: Ne, xs: ze } = ee, Me = g.getMonth(), Ee = g.getFullYear(), Ye = R.getMonth(), Pe = R.getFullYear(), Be = Me !== Ye, $t = Ee !== Pe, Te = Ne && (ze || Be), Le = g.getDate(), Ae = R.getDate();
|
|
837
|
+
return $t ? ye ? `${O(Me, K, Te)} ${Le}, ${Ee} - ${O(Ye, K, Te)} ${Ae}, ${Pe}` : `${Le} ${O(Me, K, Te)} ${Ee} - ${Ae} ${O(Ye, K, Te)} ${Pe}` : Be ? ye ? `${O(Me, K, Te)} ${Le} - ${O(Ye, K, Te)} ${Ae}, ${Ee}` : `${Le} ${O(Me, K, Te)} - ${Ae} ${O(Ye, K, Te)} ${Ee}` : ye ? `${O(Me, K, Te)} ${Le}-${Ae}, ${Ee}` : `${Le}-${Ae} ${O(Me, K, Te)} ${Ee}`;
|
|
838
|
+
}
|
|
839
|
+
const U = b(() => {
|
|
840
|
+
const { dateFormat: g, months: R, monthsGenitive: ee, week: K, truncations: ye } = r, Ne = y.locale, ze = ye !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = ee && Ne === "el" ? ee : R;
|
|
841
|
+
switch (v.value) {
|
|
683
842
|
case "day":
|
|
684
|
-
return
|
|
685
|
-
case "days":
|
|
686
|
-
let N = h.replace(/(\s|^)[^a-zA-Z]*?d{2,4}[^a-zA-Z]*?(\s|$)/, "");
|
|
687
|
-
P !== !1 && (N = N.replace("MMMM", "MMM"));
|
|
688
|
-
const K = s.formatDate(n.value, N), ae = s.formatDate(t.value, N);
|
|
689
|
-
return `${K} - ${ae}`;
|
|
690
|
-
}
|
|
843
|
+
return t.formatDate(_.value, g);
|
|
844
|
+
case "days":
|
|
691
845
|
case "week": {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
846
|
+
const Ye = {
|
|
847
|
+
monthsArray: Ee,
|
|
848
|
+
monthBeforeDay: Me,
|
|
849
|
+
canTruncate: ze,
|
|
850
|
+
xs: y.xs
|
|
851
|
+
};
|
|
852
|
+
let Pe = X(_.value, c.value, Ye);
|
|
853
|
+
if (v.value === "week") {
|
|
854
|
+
const Be = t.getWeek(
|
|
855
|
+
_.value,
|
|
856
|
+
y.startWeekOnSunday && !y.hideWeekdays[7]
|
|
857
|
+
);
|
|
858
|
+
Pe += ` <small>${K} ${Be}</small>`;
|
|
859
|
+
}
|
|
860
|
+
return Pe;
|
|
699
861
|
}
|
|
700
862
|
case "month": {
|
|
701
|
-
const
|
|
702
|
-
return
|
|
863
|
+
const Ye = `${y.xs && ze ? "MMM" : "MMMM"} YYYY`;
|
|
864
|
+
return t.formatDate(F.value, Ye);
|
|
703
865
|
}
|
|
704
866
|
case "year":
|
|
705
|
-
return
|
|
867
|
+
return _.value.getFullYear();
|
|
706
868
|
case "years":
|
|
707
|
-
return `${
|
|
869
|
+
return `${_.value.getFullYear()} - ${m.value.getFullYear()}`;
|
|
708
870
|
}
|
|
709
871
|
});
|
|
710
|
-
function
|
|
711
|
-
switch (
|
|
872
|
+
async function Q() {
|
|
873
|
+
switch (l.value = new Date(L.value || Z.value), l.value.setHours(0, 0, 0, 0), v.value) {
|
|
712
874
|
case "day":
|
|
713
875
|
break;
|
|
714
876
|
case "days":
|
|
715
877
|
break;
|
|
716
878
|
case "week":
|
|
717
|
-
|
|
879
|
+
l.value = t.getPreviousFirstDayOfWeek(l.value, y.startWeekOnSunday && !y.hideWeekdays[7]);
|
|
718
880
|
break;
|
|
719
881
|
case "month":
|
|
720
|
-
|
|
882
|
+
l.value = new Date(l.value.getFullYear(), l.value.getMonth(), 1, 0, 0, 0, 0);
|
|
721
883
|
break;
|
|
722
884
|
case "year":
|
|
723
|
-
|
|
885
|
+
l.value = new Date(l.value.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
724
886
|
break;
|
|
725
887
|
case "years":
|
|
726
|
-
|
|
888
|
+
l.value = new Date(l.value.getFullYear() - l.value.getFullYear() % Y.value, 0, 1, 0, 0, 0, 0);
|
|
727
889
|
break;
|
|
728
890
|
}
|
|
729
|
-
|
|
730
|
-
id:
|
|
731
|
-
title:
|
|
732
|
-
start:
|
|
733
|
-
end:
|
|
734
|
-
extendedStart:
|
|
735
|
-
extendedEnd:
|
|
736
|
-
cellDates:
|
|
737
|
-
containsToday:
|
|
738
|
-
events:
|
|
739
|
-
})
|
|
891
|
+
Z.value = /* @__PURE__ */ new Date(), y.ready && (await Xe(), d("view-change", {
|
|
892
|
+
id: v.value,
|
|
893
|
+
title: U.value,
|
|
894
|
+
start: F.value,
|
|
895
|
+
end: m.value,
|
|
896
|
+
extendedStart: i.value,
|
|
897
|
+
extendedEnd: S.value,
|
|
898
|
+
cellDates: f.value,
|
|
899
|
+
containsToday: n.value,
|
|
900
|
+
events: G.value
|
|
901
|
+
}));
|
|
740
902
|
}
|
|
741
|
-
function
|
|
742
|
-
const
|
|
743
|
-
|
|
903
|
+
function te(g) {
|
|
904
|
+
const R = v.value, ee = y.availableViews[R];
|
|
905
|
+
g[R] && JSON.stringify(g[R]) === JSON.stringify(ee) || Q();
|
|
744
906
|
}
|
|
745
|
-
function
|
|
746
|
-
const
|
|
747
|
-
|
|
907
|
+
function q(g, R = !0, ee = null) {
|
|
908
|
+
const K = Object.keys(y.availableViews);
|
|
909
|
+
v.value === g && !ee || (K.includes(g) ? (u.value = K.indexOf(g) < K.indexOf(v.value) ? "left" : "right", R && v.value !== g && d("update:view", g), v.value = g, ee ? J(ee) : Q()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
|
|
748
910
|
}
|
|
749
|
-
function
|
|
750
|
-
|
|
911
|
+
function le() {
|
|
912
|
+
p.value ? q(p.value) : console.warn("Vue Cal: no broader view is available.");
|
|
751
913
|
}
|
|
752
|
-
function
|
|
753
|
-
|
|
914
|
+
function ae() {
|
|
915
|
+
a.value ? q(a.value) : console.warn("Vue Cal: no narrower view is available.");
|
|
754
916
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
917
|
+
function ve() {
|
|
918
|
+
k(!1);
|
|
757
919
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
920
|
+
function s() {
|
|
921
|
+
k(!0);
|
|
760
922
|
}
|
|
761
|
-
function
|
|
762
|
-
let
|
|
763
|
-
switch (
|
|
923
|
+
function k(g = !0) {
|
|
924
|
+
let R = new Date(L.value);
|
|
925
|
+
switch (v.value) {
|
|
764
926
|
case "day":
|
|
765
927
|
case "days":
|
|
766
|
-
|
|
928
|
+
g ? R = t.addDays(c.value, 1) : R = t.subtractDays(_.value, Y.value);
|
|
767
929
|
break;
|
|
768
930
|
case "week": {
|
|
769
|
-
|
|
931
|
+
g ? (R = t.addDays(S.value, 1), R.setHours(0, 0, 0, 0)) : R = t.subtractDays(i.value, Y.value);
|
|
770
932
|
break;
|
|
771
933
|
}
|
|
772
934
|
case "month": {
|
|
773
|
-
const
|
|
774
|
-
|
|
935
|
+
const ee = g ? 1 : -1;
|
|
936
|
+
R = new Date(R.getFullYear(), R.getMonth() + ee, 1, 0, 0, 0, 0);
|
|
775
937
|
break;
|
|
776
938
|
}
|
|
777
939
|
case "year": {
|
|
778
|
-
const
|
|
779
|
-
|
|
940
|
+
const ee = g ? 1 : -1;
|
|
941
|
+
R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
|
|
780
942
|
break;
|
|
781
943
|
}
|
|
782
944
|
case "years": {
|
|
783
|
-
const
|
|
784
|
-
|
|
945
|
+
const ee = g ? Y.value : -Y.value;
|
|
946
|
+
R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
|
|
785
947
|
break;
|
|
786
948
|
}
|
|
787
949
|
}
|
|
788
|
-
|
|
950
|
+
J(R);
|
|
789
951
|
}
|
|
790
|
-
function
|
|
791
|
-
const
|
|
792
|
-
|
|
952
|
+
function D() {
|
|
953
|
+
const g = /* @__PURE__ */ new Date();
|
|
954
|
+
g.setHours(0, 0, 0, 0), J(g);
|
|
793
955
|
}
|
|
794
|
-
function
|
|
795
|
-
if (!
|
|
796
|
-
let [K,
|
|
797
|
-
|
|
956
|
+
function J(g, R = !0, ee = !1) {
|
|
957
|
+
if (!t.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
|
|
958
|
+
let [K, ye] = [_.value, c.value];
|
|
959
|
+
v.value === "month" && ([K, ye] = [F.value, m.value]), (!t.isInRange(g, K, ye) || ee) && (g.setHours(0, 0, 0, 0), u.value = g.getTime() < K.getTime() ? "left" : "right", L.value = g, R && d("update:viewDate", g), Q());
|
|
798
960
|
}
|
|
799
|
-
function
|
|
800
|
-
if (
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
} else
|
|
804
|
-
return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
961
|
+
function ne(g, R = !0) {
|
|
962
|
+
if (!t.isValid(g)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
963
|
+
const { isValid: ee, isSameDate: K } = t;
|
|
964
|
+
(!A.value || !ee(A.value) || !K(g, A.value)) && (g.setHours(0, 0, 0, 0), A.value = g, R && d("update:selectedDate", g));
|
|
805
965
|
}
|
|
806
|
-
function
|
|
807
|
-
!
|
|
966
|
+
function me(g) {
|
|
967
|
+
!g && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : (u.value = "left", Q());
|
|
808
968
|
}
|
|
809
|
-
function
|
|
810
|
-
|
|
969
|
+
function o(g) {
|
|
970
|
+
g && y.startWeekOnSunday && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : !g && y.startWeekOnSunday && l.value.getDay() === 1 && J(t.subtractDays(l.value, 1), !0, !0);
|
|
811
971
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
972
|
+
function T() {
|
|
973
|
+
Q();
|
|
814
974
|
}
|
|
815
|
-
function
|
|
816
|
-
|
|
817
|
-
|
|
975
|
+
function M(g) {
|
|
976
|
+
var K;
|
|
977
|
+
const R = (K = C.value) == null ? void 0 : K.querySelector(".vuecal__scrollable"), ee = g ? g * y.timeCellHeight / y.timeStep : 0;
|
|
978
|
+
R == null || R.scrollTo({ top: ee, behavior: "smooth" });
|
|
818
979
|
}
|
|
819
|
-
function
|
|
820
|
-
const
|
|
821
|
-
|
|
980
|
+
function w() {
|
|
981
|
+
const g = /* @__PURE__ */ new Date();
|
|
982
|
+
M(g.getHours() * 60 + g.getMinutes());
|
|
822
983
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
984
|
+
function N() {
|
|
985
|
+
M(0);
|
|
825
986
|
}
|
|
826
|
-
const
|
|
827
|
-
return
|
|
828
|
-
|
|
829
|
-
}),
|
|
830
|
-
|
|
831
|
-
}),
|
|
832
|
-
now:
|
|
833
|
-
id:
|
|
834
|
-
broaderView:
|
|
835
|
-
narrowerView:
|
|
836
|
-
title:
|
|
837
|
-
viewDate:
|
|
838
|
-
start:
|
|
839
|
-
end:
|
|
840
|
-
extendedStart:
|
|
987
|
+
const G = b(() => h.getViewEvents(f.value)), oe = h.createEvent, ge = h.deleteEvent;
|
|
988
|
+
return De(() => y.view, (g) => q(g, !1)), De(() => y.availableViews, te), De(() => y.datePicker, () => q("month")), De(() => y.viewDate, (g) => J(g, !1)), De(() => y.selectedDate, (g) => ne(g, !1)), De(() => y.startWeekOnSunday, (g) => me(g)), De(() => y.hideWeekends, (g) => o(g)), De(() => y.hideWeekdays, T), De(() => Y.value, () => {
|
|
989
|
+
Y.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
|
|
990
|
+
}), De(() => y.watchRealTime, (g) => {
|
|
991
|
+
g && y.time ? e() : E = clearTimeout(E);
|
|
992
|
+
}), Q(), y.time && y.watchRealTime && e(), Re(() => E = clearTimeout(E)), {
|
|
993
|
+
now: Z,
|
|
994
|
+
id: v,
|
|
995
|
+
broaderView: p,
|
|
996
|
+
narrowerView: a,
|
|
997
|
+
title: U,
|
|
998
|
+
viewDate: L,
|
|
999
|
+
start: F,
|
|
1000
|
+
end: m,
|
|
1001
|
+
extendedStart: i,
|
|
841
1002
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
842
|
-
extendedEnd:
|
|
1003
|
+
extendedEnd: S,
|
|
843
1004
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
844
|
-
firstCellDate:
|
|
845
|
-
lastCellDate:
|
|
846
|
-
containsToday:
|
|
847
|
-
selectedDate:
|
|
848
|
-
cellDates:
|
|
849
|
-
cols:
|
|
850
|
-
rows:
|
|
1005
|
+
firstCellDate: _,
|
|
1006
|
+
lastCellDate: c,
|
|
1007
|
+
containsToday: n,
|
|
1008
|
+
selectedDate: A,
|
|
1009
|
+
cellDates: f,
|
|
1010
|
+
cols: z,
|
|
1011
|
+
rows: H,
|
|
851
1012
|
// All the events are stored and indexed in the events object of the eventsManager.
|
|
852
1013
|
// The following events array is only a subset of visible ones, plus any potential recurring
|
|
853
1014
|
// and multi-day events.
|
|
854
|
-
events:
|
|
855
|
-
transitionDirection:
|
|
856
|
-
switch:
|
|
857
|
-
broader:
|
|
858
|
-
narrower:
|
|
859
|
-
previous:
|
|
860
|
-
next:
|
|
861
|
-
navigate:
|
|
862
|
-
goToToday:
|
|
863
|
-
updateViewDate:
|
|
864
|
-
updateSelectedDate:
|
|
865
|
-
scrollToCurrentTime:
|
|
866
|
-
scrollToTime:
|
|
867
|
-
scrollTop:
|
|
868
|
-
createEvent:
|
|
869
|
-
deleteEvent:
|
|
1015
|
+
events: G,
|
|
1016
|
+
transitionDirection: u,
|
|
1017
|
+
switch: (g, R) => q(g, !0, R),
|
|
1018
|
+
broader: le,
|
|
1019
|
+
narrower: ae,
|
|
1020
|
+
previous: ve,
|
|
1021
|
+
next: s,
|
|
1022
|
+
navigate: k,
|
|
1023
|
+
goToToday: D,
|
|
1024
|
+
updateViewDate: J,
|
|
1025
|
+
updateSelectedDate: ne,
|
|
1026
|
+
scrollToCurrentTime: w,
|
|
1027
|
+
scrollToTime: M,
|
|
1028
|
+
scrollTop: N,
|
|
1029
|
+
createEvent: oe,
|
|
1030
|
+
deleteEvent: ge,
|
|
870
1031
|
// Getters.
|
|
871
1032
|
get isDay() {
|
|
872
|
-
return
|
|
1033
|
+
return v.value === "day";
|
|
873
1034
|
},
|
|
874
1035
|
get isDays() {
|
|
875
|
-
return
|
|
1036
|
+
return v.value === "days";
|
|
876
1037
|
},
|
|
877
1038
|
get isWeek() {
|
|
878
|
-
return
|
|
1039
|
+
return v.value === "week";
|
|
879
1040
|
},
|
|
880
1041
|
get isMonth() {
|
|
881
|
-
return
|
|
1042
|
+
return v.value === "month";
|
|
882
1043
|
},
|
|
883
1044
|
get isYear() {
|
|
884
|
-
return
|
|
1045
|
+
return v.value === "year";
|
|
885
1046
|
},
|
|
886
1047
|
get isYears() {
|
|
887
|
-
return
|
|
1048
|
+
return v.value === "years";
|
|
888
1049
|
}
|
|
889
1050
|
};
|
|
890
|
-
},
|
|
891
|
-
|
|
1051
|
+
}, rt = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], ot = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], it = "Years", ut = "Year", ct = "Month", dt = "Week", vt = "Days", ft = "Day", mt = "Today", gt = "No Event", ht = "All-day", yt = "Delete", Dt = "Create an event", pt = "dddd, MMMM D, YYYY", wt = "am", _t = "pm", Qe = {
|
|
1052
|
+
weekDays: rt,
|
|
1053
|
+
months: ot,
|
|
1054
|
+
years: it,
|
|
1055
|
+
year: ut,
|
|
1056
|
+
month: ct,
|
|
1057
|
+
week: dt,
|
|
1058
|
+
days: vt,
|
|
1059
|
+
day: ft,
|
|
1060
|
+
today: mt,
|
|
1061
|
+
noEvent: gt,
|
|
1062
|
+
allDay: ht,
|
|
1063
|
+
deleteEvent: yt,
|
|
1064
|
+
createEvent: Dt,
|
|
1065
|
+
dateFormat: pt,
|
|
1066
|
+
am: wt,
|
|
1067
|
+
pm: _t
|
|
1068
|
+
}, jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1069
|
+
__proto__: null,
|
|
1070
|
+
allDay: ht,
|
|
1071
|
+
am: wt,
|
|
1072
|
+
createEvent: Dt,
|
|
1073
|
+
dateFormat: pt,
|
|
1074
|
+
day: ft,
|
|
1075
|
+
days: vt,
|
|
1076
|
+
default: Qe,
|
|
1077
|
+
deleteEvent: yt,
|
|
1078
|
+
month: ct,
|
|
1079
|
+
months: ot,
|
|
1080
|
+
noEvent: gt,
|
|
1081
|
+
pm: _t,
|
|
1082
|
+
today: mt,
|
|
1083
|
+
week: dt,
|
|
1084
|
+
weekDays: rt,
|
|
1085
|
+
year: ut,
|
|
1086
|
+
years: it
|
|
1087
|
+
}, Symbol.toStringTag, { value: "Module" })), Fe = be({
|
|
1088
|
+
texts: { ...fe.texts },
|
|
892
1089
|
// Make texts reactive before a locale is loaded.
|
|
893
|
-
dateUtils:
|
|
1090
|
+
dateUtils: lt(fe.texts, Qe)
|
|
894
1091
|
// Some Date utils functions need localized texts.
|
|
895
|
-
}),
|
|
896
|
-
const
|
|
897
|
-
uid:
|
|
1092
|
+
}), Ht = ({ props: y, emit: t, attrs: d, vuecalEl: r, uid: h }) => {
|
|
1093
|
+
const C = be({
|
|
1094
|
+
uid: h,
|
|
898
1095
|
// The Vuecal instance unique ID, used for dnd source-target identification.
|
|
899
|
-
emit:
|
|
900
|
-
texts: { ...
|
|
1096
|
+
emit: t,
|
|
1097
|
+
texts: { ...Fe.texts },
|
|
901
1098
|
// Make texts reactive before a locale is loaded.
|
|
902
1099
|
// The date utils composable.
|
|
903
1100
|
// A class/composable is needed in order to access the user locale in all the methods, and
|
|
904
1101
|
// independently of other potential Vue Cal instances on the same page.
|
|
905
|
-
dateUtils: { ...
|
|
1102
|
+
dateUtils: { ...Fe.dateUtils },
|
|
906
1103
|
now: /* @__PURE__ */ new Date(),
|
|
907
1104
|
config: {},
|
|
908
1105
|
eventsManager: {},
|
|
@@ -914,14 +1111,16 @@ const Ke = (c) => {
|
|
|
914
1111
|
touch: {
|
|
915
1112
|
isDraggingCell: !1,
|
|
916
1113
|
isDraggingEvent: !1,
|
|
917
|
-
isResizingEvent: !1
|
|
1114
|
+
isResizingEvent: !1,
|
|
1115
|
+
currentHoveredCell: null
|
|
1116
|
+
// Track the cell currently being hovered during event resizing.
|
|
918
1117
|
}
|
|
919
1118
|
});
|
|
920
|
-
return
|
|
921
|
-
},
|
|
922
|
-
allDayEvents: { type:
|
|
923
|
-
//
|
|
924
|
-
|
|
1119
|
+
return C.dateUtils = lt(Object.assign(fe.texts, C.texts), Qe), C.config = Ct(C, y, d), C.eventsManager = Vt(C), C.view = Ot(C, r), C.dnd = zt(C), C;
|
|
1120
|
+
}, Pt = 1440, Lt = {
|
|
1121
|
+
allDayEvents: { type: Boolean, default: !1 },
|
|
1122
|
+
// Display all-day events in a fixed top bar on the day, days & week views.
|
|
1123
|
+
stackEvents: { type: Boolean, default: !1 },
|
|
925
1124
|
clickToNavigate: { type: Boolean, default: void 0 },
|
|
926
1125
|
// Setting to false will force it off on date-picker.
|
|
927
1126
|
dark: { type: Boolean, default: !1 },
|
|
@@ -931,7 +1130,7 @@ const Ke = (c) => {
|
|
|
931
1130
|
disableDays: { type: Array, default: () => [] },
|
|
932
1131
|
// Array of specific dates to disable.
|
|
933
1132
|
// Can be true false or a finer grain permissions object like:
|
|
934
|
-
// { drag: bool, resize: bool, create: bool, delete: bool }
|
|
1133
|
+
// { drag: bool, resize: bool, resizeX: bool, create: bool, delete: bool }
|
|
935
1134
|
editableEvents: { type: [Boolean, Object], default: !1 },
|
|
936
1135
|
// Minimum drag distance in pixels to create an event (prevents accidental event creation when trying to navigate).
|
|
937
1136
|
eventCreateMinDrag: { type: Number, default: 15 },
|
|
@@ -939,8 +1138,9 @@ const Ke = (c) => {
|
|
|
939
1138
|
// The array of events to display in Vue Cal.
|
|
940
1139
|
// Can hold just the view events and be updated or the full array of all events available.
|
|
941
1140
|
events: { type: Array, default: () => [] },
|
|
942
|
-
|
|
943
|
-
//
|
|
1141
|
+
// Displays an events counter in each cell on month view or year view.
|
|
1142
|
+
// Can be a boolean or an array of views to display the event count on.
|
|
1143
|
+
eventCount: { type: [Boolean, Array], default: !1 },
|
|
944
1144
|
eventsOnMonthView: { type: Boolean, default: !1 },
|
|
945
1145
|
// Displays events in full on month view.
|
|
946
1146
|
hideWeekdays: { type: Array, default: () => [] },
|
|
@@ -955,6 +1155,8 @@ const Ke = (c) => {
|
|
|
955
1155
|
// Mostly for date pickers, sets a maximum date for cell interactions.
|
|
956
1156
|
minDate: { type: [String, Date], default: "" },
|
|
957
1157
|
// Mostly for date pickers, sets a minimum date for cell interactions.
|
|
1158
|
+
multidayEvents: { type: Boolean, default: !0 },
|
|
1159
|
+
// Allow events to span multiple days.
|
|
958
1160
|
// A 2-way binding that highlights the selected date in the calendar but does not navigate to it.
|
|
959
1161
|
selectedDate: { type: [String, Date], default: "" },
|
|
960
1162
|
// The selected date in the calendar !== viewDate.
|
|
@@ -982,7 +1184,7 @@ const Ke = (c) => {
|
|
|
982
1184
|
// Start time of the time column, in minutes.
|
|
983
1185
|
timeStep: { type: Number, default: 60 },
|
|
984
1186
|
// Step amount for the time in the time column, in minutes.
|
|
985
|
-
timeTo: { type: Number, default:
|
|
1187
|
+
timeTo: { type: Number, default: Pt },
|
|
986
1188
|
// End time of the time column, in minutes.
|
|
987
1189
|
titleBar: { type: Boolean, default: !0 },
|
|
988
1190
|
// Show or hide the header title bar.
|
|
@@ -1009,219 +1211,130 @@ const Ke = (c) => {
|
|
|
1009
1211
|
// Show the weeks numbers in a column on month view.
|
|
1010
1212
|
xs: { type: Boolean, default: !1 }
|
|
1011
1213
|
// Extra small size for date pickers (truncates texts + specific styles).
|
|
1214
|
+
// Temporarily disabled until fully implemented.
|
|
1215
|
+
// horizontal: { type: Boolean, default: false } // Show the calendar timeline horizontally.
|
|
1012
1216
|
// TODO:
|
|
1013
1217
|
// minEventWidth: { type: Number, default: 0 },
|
|
1014
1218
|
// minScheduleWidth: { type: Number, default: 0 },
|
|
1015
1219
|
// overlapsPerTimeStep: { type: Boolean, default: false },
|
|
1016
|
-
|
|
1017
|
-
}, mt = { class: "vuecal__header" }, ft = {
|
|
1220
|
+
}, At = { class: "vuecal__header" }, Ft = {
|
|
1018
1221
|
key: 0,
|
|
1019
1222
|
class: "vuecal__views-bar"
|
|
1020
|
-
},
|
|
1223
|
+
}, Rt = ["onClick", "innerHTML"], Nt = {
|
|
1021
1224
|
key: 1,
|
|
1022
1225
|
class: "vuecal__title-bar"
|
|
1023
|
-
},
|
|
1226
|
+
}, Bt = { class: "vuecal__transition-wrap" }, Wt = ["disabled", "innerHTML"], Xt = {
|
|
1024
1227
|
__name: "header",
|
|
1025
|
-
setup(
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
},
|
|
1029
|
-
return (
|
|
1030
|
-
|
|
1031
|
-
view:
|
|
1032
|
-
availableViews:
|
|
1033
|
-
vuecal:
|
|
1228
|
+
setup(y) {
|
|
1229
|
+
const t = He("vuecal"), { view: d, config: r } = t, h = () => {
|
|
1230
|
+
r.clickToNavigate && d.broader();
|
|
1231
|
+
}, C = b(() => r.clickToNavigate ? { click: h } : {});
|
|
1232
|
+
return (W, v) => (V(), P("div", At, [
|
|
1233
|
+
j(W.$slots, "header", {
|
|
1234
|
+
view: $(d),
|
|
1235
|
+
availableViews: $(r).availableViews,
|
|
1236
|
+
vuecal: $(t)
|
|
1034
1237
|
}),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
(
|
|
1038
|
-
class:
|
|
1039
|
-
onClick: (
|
|
1040
|
-
innerHTML:
|
|
1238
|
+
W.$slots.header ? x("", !0) : (V(), P(de, { key: 0 }, [
|
|
1239
|
+
$(r).viewsBar ? (V(), P("div", Ft, [
|
|
1240
|
+
(V(!0), P(de, null, we($(r).availableViews, (A, Z) => (V(), P("button", {
|
|
1241
|
+
class: pe(["vuecal__view-button", { "vuecal__view-button--active": $(d).id === Z }]),
|
|
1242
|
+
onClick: (L) => $(d).switch(Z),
|
|
1243
|
+
innerHTML: $(t).texts[Z],
|
|
1041
1244
|
type: "button"
|
|
1042
|
-
}, null, 10,
|
|
1043
|
-
])) :
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
class:
|
|
1047
|
-
onClick:
|
|
1245
|
+
}, null, 10, Rt))), 256))
|
|
1246
|
+
])) : x("", !0),
|
|
1247
|
+
$(r).titleBar ? (V(), P("nav", Nt, [
|
|
1248
|
+
he("button", {
|
|
1249
|
+
class: pe(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !W.$slots["previous-button"] }]),
|
|
1250
|
+
onClick: v[0] || (v[0] = (...A) => $(d).previous && $(d).previous(...A)),
|
|
1048
1251
|
type: "button"
|
|
1049
1252
|
}, [
|
|
1050
|
-
|
|
1253
|
+
j(W.$slots, "previous-button")
|
|
1051
1254
|
], 2),
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
name: `vuecal-slide-fade--${
|
|
1255
|
+
he("div", Bt, [
|
|
1256
|
+
Oe(Ue, {
|
|
1257
|
+
name: `vuecal-slide-fade--${$(d).transitionDirection}`
|
|
1055
1258
|
}, {
|
|
1056
|
-
default:
|
|
1057
|
-
(
|
|
1058
|
-
key:
|
|
1259
|
+
default: B(() => [
|
|
1260
|
+
(V(), P("div", {
|
|
1261
|
+
key: $(d).id + $(d).start.getTime()
|
|
1059
1262
|
}, [
|
|
1060
|
-
|
|
1263
|
+
W.$slots.title || W.$slots[`title.${$(d).id}`] ? (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
|
|
1061
1264
|
key: 0,
|
|
1062
1265
|
class: "vuecal__title"
|
|
1063
|
-
},
|
|
1064
|
-
default:
|
|
1065
|
-
|
|
1266
|
+
}, Ie(C.value)), {
|
|
1267
|
+
default: B(() => [
|
|
1268
|
+
W.$slots[`title.${$(d).id}`] ? j(W.$slots, `title.${$(d).id}`, se(ie({ key: 0 }, $(d)))) : j(W.$slots, "title", se(ie({ key: 1 }, $(d))))
|
|
1066
1269
|
]),
|
|
1067
1270
|
_: 3
|
|
1068
|
-
}, 16)) : (
|
|
1271
|
+
}, 16)) : (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
|
|
1069
1272
|
key: 1,
|
|
1070
1273
|
class: "vuecal__title"
|
|
1071
|
-
},
|
|
1072
|
-
innerHTML:
|
|
1274
|
+
}, Ie(C.value), {
|
|
1275
|
+
innerHTML: $(d).title
|
|
1073
1276
|
}), null, 16, ["innerHTML"]))
|
|
1074
1277
|
]))
|
|
1075
1278
|
]),
|
|
1076
1279
|
_: 3
|
|
1077
1280
|
}, 8, ["name"])
|
|
1078
1281
|
]),
|
|
1079
|
-
|
|
1080
|
-
|
|
1282
|
+
$(r).todayButton ? (V(), P(de, { key: 0 }, [
|
|
1283
|
+
W.$slots["today-button"] ? j(W.$slots, "today-button", {
|
|
1081
1284
|
key: 0,
|
|
1082
|
-
navigate: () =>
|
|
1083
|
-
active:
|
|
1084
|
-
}) : (
|
|
1285
|
+
navigate: () => !$(d).containsToday && $(d).goToToday(),
|
|
1286
|
+
active: $(d).containsToday
|
|
1287
|
+
}) : (V(), P("button", {
|
|
1085
1288
|
key: 1,
|
|
1086
|
-
class:
|
|
1087
|
-
onClick:
|
|
1088
|
-
disabled:
|
|
1289
|
+
class: pe(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": $(d).containsToday }]),
|
|
1290
|
+
onClick: v[1] || (v[1] = (A) => !$(d).containsToday && $(d).goToToday()),
|
|
1291
|
+
disabled: !!$(d).containsToday,
|
|
1089
1292
|
type: "button",
|
|
1090
|
-
innerHTML:
|
|
1091
|
-
}, null, 10,
|
|
1092
|
-
], 64)) :
|
|
1093
|
-
|
|
1094
|
-
class:
|
|
1095
|
-
onClick:
|
|
1293
|
+
innerHTML: $(t).texts.today
|
|
1294
|
+
}, null, 10, Wt))
|
|
1295
|
+
], 64)) : x("", !0),
|
|
1296
|
+
he("button", {
|
|
1297
|
+
class: pe(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !W.$slots["next-button"] }]),
|
|
1298
|
+
onClick: v[2] || (v[2] = (...A) => $(d).next && $(d).next(...A)),
|
|
1096
1299
|
type: "button"
|
|
1097
1300
|
}, [
|
|
1098
|
-
|
|
1301
|
+
j(W.$slots, "next-button")
|
|
1099
1302
|
], 2)
|
|
1100
|
-
])) :
|
|
1303
|
+
])) : x("", !0)
|
|
1101
1304
|
], 64))
|
|
1102
1305
|
]));
|
|
1103
1306
|
}
|
|
1104
|
-
},
|
|
1105
|
-
key: 0,
|
|
1106
|
-
class: "vuecal__headings"
|
|
1107
|
-
}, kt = {
|
|
1307
|
+
}, It = ["draggable"], qt = { class: "vuecal__event-details" }, Gt = { class: "vuecal__event-title" }, Ut = {
|
|
1108
1308
|
key: 0,
|
|
1109
|
-
class: "
|
|
1110
|
-
},
|
|
1309
|
+
class: "vuecal__event-time"
|
|
1310
|
+
}, Jt = {
|
|
1111
1311
|
key: 0,
|
|
1112
|
-
class: "
|
|
1113
|
-
},
|
|
1312
|
+
class: "vuecal__event-comma"
|
|
1313
|
+
}, Zt = { class: "vuecal__event-start" }, Kt = {
|
|
1114
1314
|
key: 1,
|
|
1115
|
-
class: "
|
|
1116
|
-
},
|
|
1117
|
-
__name: "headings-bar",
|
|
1118
|
-
setup(c) {
|
|
1119
|
-
const s = Se("vuecal"), { view: i, config: D, dateUtils: w } = s, _ = M(() => D.xs ? "day-xs" : D.sm || i.isDays || i.isMonth ? "day-sm" : "day"), L = M(() => (i.isDay || i.isDays || i.isWeek || i.isMonth) && !(i.isDay && !D.schedules)), g = M(() => i.cellDates.slice(0, i.cols).map(({ start: o }) => ({
|
|
1120
|
-
id: Pe[o.getDay()],
|
|
1121
|
-
date: o,
|
|
1122
|
-
dateNumber: o.getDate(),
|
|
1123
|
-
day: w.formatDate(o, "dddd"),
|
|
1124
|
-
"day-sm": w.formatDate(o, "ddd"),
|
|
1125
|
-
"day-xs": w.formatDate(o, "dd"),
|
|
1126
|
-
isToday: w.isToday(o)
|
|
1127
|
-
}))), V = {
|
|
1128
|
-
click: (o) => {
|
|
1129
|
-
(i.isDays || i.isWeek) && i.updateSelectedDate(o);
|
|
1130
|
-
}
|
|
1131
|
-
};
|
|
1132
|
-
return (o, f) => L.value ? (Y(), j("div", pt, [
|
|
1133
|
-
C(i).isDay ? Z("", !0) : (Y(), j("div", kt, [
|
|
1134
|
-
(Y(!0), j(se, null, De(g.value, (b, W) => (Y(), j("div", {
|
|
1135
|
-
class: we(["vuecal__weekday", { "vuecal__weekday--today": b.isToday }]),
|
|
1136
|
-
key: W,
|
|
1137
|
-
onClick: (X) => V.click(b.date)
|
|
1138
|
-
}, [
|
|
1139
|
-
F(o.$slots, "weekday-heading", {
|
|
1140
|
-
label: b[_.value],
|
|
1141
|
-
id: b.id,
|
|
1142
|
-
date: b.date
|
|
1143
|
-
}, () => [
|
|
1144
|
-
me("span", bt, re(b[_.value]), 1),
|
|
1145
|
-
C(i).isMonth ? Z("", !0) : (Y(), j("strong", Tt, re(b.dateNumber), 1))
|
|
1146
|
-
])
|
|
1147
|
-
], 10, _t))), 128))
|
|
1148
|
-
])),
|
|
1149
|
-
C(D).schedules ? (Y(), j("div", Mt, [
|
|
1150
|
-
(Y(!0), j(se, null, De(g.value, (b, W) => (Y(), j(se, { key: W }, [
|
|
1151
|
-
(Y(!0), j(se, null, De(C(D).schedules, (X, u) => (Y(), j(se, { key: u }, [
|
|
1152
|
-
o.$slots["schedule-heading"] ? (Y(), j("div", {
|
|
1153
|
-
key: 0,
|
|
1154
|
-
class: we(["vuecal__schedule vuecal__schedule--heading", X.class])
|
|
1155
|
-
}, [
|
|
1156
|
-
F(o.$slots, "schedule-heading", {
|
|
1157
|
-
schedule: X,
|
|
1158
|
-
view: C(i)
|
|
1159
|
-
})
|
|
1160
|
-
], 2)) : (Y(), j("div", {
|
|
1161
|
-
key: 1,
|
|
1162
|
-
class: we(["vuecal__schedule vuecal__schedule--heading", X.class]),
|
|
1163
|
-
innerHTML: X.label
|
|
1164
|
-
}, null, 10, $t))
|
|
1165
|
-
], 64))), 128))
|
|
1166
|
-
], 64))), 128))
|
|
1167
|
-
])) : Z("", !0)
|
|
1168
|
-
])) : Z("", !0);
|
|
1169
|
-
}
|
|
1170
|
-
}, Yt = { class: "vuecal__time-column" }, St = {
|
|
1171
|
-
__name: "time-column",
|
|
1172
|
-
setup(c) {
|
|
1173
|
-
const s = Se("vuecal"), { config: i, texts: D } = s, w = M(() => {
|
|
1174
|
-
const _ = [];
|
|
1175
|
-
for (let g = i.timeFrom; g < i.timeTo; g += i.timeStep) {
|
|
1176
|
-
const V = ~~(g / 60), o = g % 60, f = D[g < 720 ? "am" : "pm"];
|
|
1177
|
-
_.push({
|
|
1178
|
-
minutesSum: g,
|
|
1179
|
-
// The sum of hours + minutes in minutes.
|
|
1180
|
-
hours: V,
|
|
1181
|
-
minutes: o,
|
|
1182
|
-
formatted12: `${V % 12 ? V % 12 : 12}${o ? ":" + o.toString().padStart(2, 0) : ""}${f}`,
|
|
1183
|
-
formatted24: `${V.toString().padStart(2, 0)}:${o.toString().padStart(2, 0)}`
|
|
1184
|
-
});
|
|
1185
|
-
}
|
|
1186
|
-
return _;
|
|
1187
|
-
});
|
|
1188
|
-
return (_, L) => (Y(), j("div", Yt, [
|
|
1189
|
-
(Y(!0), j(se, null, De(w.value, (g, V) => (Y(), j("div", {
|
|
1190
|
-
class: "vuecal__time-cell",
|
|
1191
|
-
key: V
|
|
1192
|
-
}, [
|
|
1193
|
-
F(_.$slots, "time-cell", {
|
|
1194
|
-
index: V,
|
|
1195
|
-
minutes: g.minutes,
|
|
1196
|
-
hours: g.hours,
|
|
1197
|
-
minutesSum: g.minutesSum,
|
|
1198
|
-
format12: g.formatted12,
|
|
1199
|
-
format24: g.formatted24
|
|
1200
|
-
}, () => [
|
|
1201
|
-
me("label", null, re(C(i).twelveHour ? g.formatted12 : g.formatted24), 1)
|
|
1202
|
-
])
|
|
1203
|
-
]))), 128))
|
|
1204
|
-
]));
|
|
1205
|
-
}
|
|
1206
|
-
}, Ct = ["draggable"], Vt = { class: "vuecal__event-details" }, Ot = { class: "vuecal__event-title" }, jt = {
|
|
1207
|
-
key: 0,
|
|
1208
|
-
class: "vuecal__event-time"
|
|
1209
|
-
}, Pt = ["innerHTML"], Ue = {
|
|
1315
|
+
class: "vuecal__event-end"
|
|
1316
|
+
}, Qt = { key: 0 }, xt = ["innerHTML"], ea = 16, st = {
|
|
1210
1317
|
__name: "event",
|
|
1211
1318
|
props: {
|
|
1212
|
-
event: { type: Object, required: !0 }
|
|
1319
|
+
event: { type: Object, required: !0 },
|
|
1320
|
+
inAllDayBar: { type: Boolean, default: !1 },
|
|
1321
|
+
cellStart: { type: Date, required: !0 },
|
|
1322
|
+
cellEnd: { type: Date, required: !0 }
|
|
1213
1323
|
},
|
|
1214
1324
|
emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
|
|
1215
|
-
setup(
|
|
1216
|
-
const { config:
|
|
1325
|
+
setup(y, { emit: t }) {
|
|
1326
|
+
const d = y, { config: r, view: h, dnd: C, touch: W, dateUtils: v, eventsManager: A } = He("vuecal"), { handleEventResize: Z } = A, L = ue(null), l = be(d.event), E = be({
|
|
1217
1327
|
dragging: !1,
|
|
1218
|
-
resizing: !1,
|
|
1219
1328
|
fromResizer: !1,
|
|
1220
1329
|
// If the drag originates from the resizer element.
|
|
1221
1330
|
holding: !1,
|
|
1222
1331
|
// When the event is clicked and hold for a certain amount of time.
|
|
1223
1332
|
holdTimer: null,
|
|
1224
1333
|
// event click and hold detection.
|
|
1334
|
+
canTouchAndDrag: null,
|
|
1335
|
+
// Wait for 500ms before allowing an event to be dragged after touchstart.
|
|
1336
|
+
touchAndDragTimer: null,
|
|
1337
|
+
// Timer for canTouchAndDrag.
|
|
1225
1338
|
startX: 0,
|
|
1226
1339
|
// The X coords at the start of the drag.
|
|
1227
1340
|
startY: 0,
|
|
@@ -1238,6 +1351,10 @@ const Ke = (c) => {
|
|
|
1238
1351
|
// The X coords in percentage while dragging.
|
|
1239
1352
|
movePercentageY: 0,
|
|
1240
1353
|
// The Y coords in percentage while dragging.
|
|
1354
|
+
documentMouseX: 0,
|
|
1355
|
+
// Document mouse X position for horizontal resizing
|
|
1356
|
+
documentMouseY: 0,
|
|
1357
|
+
// Document mouse Y position for horizontal resizing
|
|
1241
1358
|
resizeStartDate: null,
|
|
1242
1359
|
// When resizing and going above the start date (end before start) update the start instead of the end.
|
|
1243
1360
|
resizingOriginalEvent: null,
|
|
@@ -1247,198 +1364,180 @@ const Ke = (c) => {
|
|
|
1247
1364
|
cellEl: null,
|
|
1248
1365
|
// Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
|
|
1249
1366
|
schedule: null
|
|
1250
|
-
}),
|
|
1251
|
-
|
|
1252
|
-
const
|
|
1253
|
-
var
|
|
1367
|
+
}), F = b(() => r.editableEvents.drag && l.draggable !== !1 && !l.background && E.canTouchAndDrag !== !1), m = b(() => h.isMonth || h.isYear || h.isYears || d.inAllDayBar || l._.multiday && !n.value ? !1 : r.time && r.editableEvents.resize && l.resizable !== !1 && !l.background);
|
|
1368
|
+
b(() => r.editableEvents.delete && l.deletable !== !1 && !l.background);
|
|
1369
|
+
const i = b(() => {
|
|
1370
|
+
var c, u, p, a, O;
|
|
1371
|
+
const f = !!((c = l._) != null && c.multiday);
|
|
1254
1372
|
return {
|
|
1255
|
-
[`vuecal__event--${
|
|
1256
|
-
[
|
|
1257
|
-
"vuecal__event--recurring": !!
|
|
1258
|
-
"vuecal__event--background": !!
|
|
1259
|
-
"vuecal__event--
|
|
1260
|
-
"vuecal__event--
|
|
1261
|
-
"vuecal__event--cut-
|
|
1373
|
+
[`vuecal__event--${l._.id}`]: !0,
|
|
1374
|
+
[l.class]: !!l.class,
|
|
1375
|
+
"vuecal__event--recurring": !!l.recurring,
|
|
1376
|
+
"vuecal__event--background": !!l.background,
|
|
1377
|
+
"vuecal__event--all-day": l.allDay || ((u = l._) == null ? void 0 : u.startMinutes) === 0 && ((p = l._) == null ? void 0 : p.duration) === 1440,
|
|
1378
|
+
"vuecal__event--multiday": f,
|
|
1379
|
+
"vuecal__event--cut-top": !d.inAllDayBar && (((a = l._) == null ? void 0 : a.startMinutes) < r.timeFrom || f && !S.value),
|
|
1380
|
+
"vuecal__event--cut-bottom": !d.inAllDayBar && (((O = l._) == null ? void 0 : O.endMinutes) > r.timeTo || f && !n.value),
|
|
1262
1381
|
// Only apply the dragging class on the event copy that is being dragged.
|
|
1263
|
-
"vuecal__event--dragging": !
|
|
1382
|
+
"vuecal__event--dragging": !l._.draggingGhost && l._.dragging,
|
|
1264
1383
|
// Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
|
|
1265
1384
|
// dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
|
|
1266
1385
|
// invisible, so if dragging is false, disable the dragging-ghost class as well.
|
|
1267
1386
|
// On event drop, if the new position of the event is approved, only remove the dragging-ghost class
|
|
1268
1387
|
// after event deletion (event._.dragging is already false) so the event ghost does not flash in before
|
|
1269
1388
|
// deletion.
|
|
1270
|
-
"vuecal__event--dragging-ghost":
|
|
1271
|
-
"vuecal__event--resizing":
|
|
1389
|
+
"vuecal__event--dragging-ghost": l._.draggingGhost,
|
|
1390
|
+
"vuecal__event--resizing": W.isResizingEvent
|
|
1272
1391
|
};
|
|
1273
|
-
}),
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1392
|
+
}), S = b(() => l._.multiday ? new Date(l.start).setHours(0, 0, 0, 0) === d.cellStart.getTime() : !0), n = b(() => l._.multiday ? v.isSameDate(new Date(new Date(l.end).setMilliseconds(-1)), d.cellEnd) : !0), I = b(() => {
|
|
1393
|
+
const f = new Date(l.start).setHours(0, 0, 0, 0), c = new Date(l.end).setHours(0, 0, 0, 0);
|
|
1394
|
+
return Math.ceil((c - f) / (1e3 * 60 * 60 * 24));
|
|
1395
|
+
}), e = b(() => {
|
|
1396
|
+
const f = (h.isDay || h.isDays || h.isWeek) && r.time && !d.inAllDayBar, c = r.horizontal;
|
|
1397
|
+
if (!f && !l.backgroundColor && !l.color) return !1;
|
|
1398
|
+
const u = {
|
|
1399
|
+
backgroundColor: l.backgroundColor || null,
|
|
1400
|
+
color: l.color || null
|
|
1279
1401
|
};
|
|
1280
|
-
if (
|
|
1281
|
-
|
|
1282
|
-
|
|
1402
|
+
if (f) {
|
|
1403
|
+
let p = l._.startMinutes, a = l._.endMinutes;
|
|
1404
|
+
l._.multiday && (S.value || (p = 0), n.value || (a = 1440));
|
|
1405
|
+
const O = Math.max(r.timeFrom, p), X = Math.min(r.timeTo, a) + (l._.duration && !a ? 1440 : 0), U = Ve(O, r), Q = Ve(X, r) - U;
|
|
1406
|
+
u[c ? "left" : "top"] = `${U}%`, u[c ? "width" : "height"] = `${Q}%`;
|
|
1283
1407
|
}
|
|
1284
|
-
return
|
|
1285
|
-
}),
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
["resize-end"].includes(
|
|
1289
|
-
|
|
1408
|
+
return u;
|
|
1409
|
+
}), z = b(() => {
|
|
1410
|
+
const f = { ...r.eventListeners.event };
|
|
1411
|
+
for (const [p, a] of Object.entries(f))
|
|
1412
|
+
["resize-end"].includes(p) || (f[p] = (O) => {
|
|
1413
|
+
O.type !== "drop" && a(O.type ? { e: O, event: l } : O);
|
|
1290
1414
|
});
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1415
|
+
const c = { ...f };
|
|
1416
|
+
f.touchstart = (p) => {
|
|
1417
|
+
var a;
|
|
1418
|
+
p.stopPropagation(), E.touchAndDragTimer = setTimeout(() => {
|
|
1419
|
+
E.canTouchAndDrag = !0;
|
|
1420
|
+
}, 500), _(p), (a = c.touchstart) == null || a.call(c, { e: p, event: l });
|
|
1421
|
+
}, f.mousedown = (p) => {
|
|
1422
|
+
var a;
|
|
1423
|
+
p.stopPropagation(), _(p), (a = c.mousedown) == null || a.call(c, { e: p, event: l });
|
|
1299
1424
|
};
|
|
1300
|
-
let
|
|
1301
|
-
return
|
|
1302
|
-
var
|
|
1303
|
-
(
|
|
1304
|
-
var
|
|
1305
|
-
|
|
1425
|
+
let u = null;
|
|
1426
|
+
return f.click = (p) => {
|
|
1427
|
+
var a;
|
|
1428
|
+
(a = c.click) == null || a.call(c, { e: p, event: l }), u ? u = clearTimeout(u) : u = setTimeout(() => {
|
|
1429
|
+
var O;
|
|
1430
|
+
u = null, (O = c["delayed-click"]) == null || O.call(c, { e: p, event: l });
|
|
1306
1431
|
}, 400);
|
|
1307
|
-
},
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
})
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1432
|
+
}, f.dblclick = (p) => {
|
|
1433
|
+
c.dblclick ? c.dblclick({ e: p, event: l }) : l.delete(1);
|
|
1434
|
+
}, f;
|
|
1435
|
+
});
|
|
1436
|
+
let H = null, Y = 0;
|
|
1437
|
+
const _ = (f) => {
|
|
1438
|
+
var a, O, X;
|
|
1439
|
+
const c = ((a = f.touches) == null ? void 0 : a[0]) || f;
|
|
1440
|
+
E.fromResizer = c.target.closest(".vuecal__event-resizer");
|
|
1441
|
+
const u = Date.now();
|
|
1442
|
+
(!H || u - Y > ea) && (H = L.value.getBoundingClientRect(), Y = u);
|
|
1443
|
+
const p = H;
|
|
1444
|
+
E.startX = (((O = f.touches) == null ? void 0 : O[0]) || f).clientX - p.left, E.startY = (((X = f.touches) == null ? void 0 : X[0]) || f).clientY - p.top, E.startPercentageX = E.startX * 100 / p.width, E.startPercentageY = E.startY * 100 / p.height, E.cellEl = L.value.closest(".vuecal__cell"), E.resizeStartDate = l.start, E.fromResizer && Z(f, l, L.value), E.holdTimer = setTimeout(() => {
|
|
1445
|
+
var U, Q;
|
|
1446
|
+
E.holding = !0, (Q = (U = z.value).hold) == null || Q.call(U, { e: f, event: l });
|
|
1318
1447
|
}, 1e3);
|
|
1319
|
-
}, v = async (l) => {
|
|
1320
|
-
var k, t, O, z;
|
|
1321
|
-
const n = ((k = l.touches) == null ? void 0 : k[0]) || l;
|
|
1322
|
-
if (f.fromResizer && !f.resizing && (f.resizing = !0, f.resizingOriginalEvent = { ...o, _: { ...o._ } }, _.isResizingEvent = !0, (O = (t = d.value).resizeStart) == null || O.call(t, { e: l, event: o })), f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.cellEl) {
|
|
1323
|
-
const { top: R, left: Q, width: ee, height: ie } = f.cellEl.getBoundingClientRect();
|
|
1324
|
-
f.moveX = n.clientX - Q, f.moveY = n.clientY - R, f.movePercentageX = f.moveX * 100 / ee, f.movePercentageY = f.moveY * 100 / ie;
|
|
1325
|
-
}
|
|
1326
|
-
if (f.fromResizer) {
|
|
1327
|
-
const { newStart: R, newEnd: Q } = E(o);
|
|
1328
|
-
let ee = !0;
|
|
1329
|
-
const { resize: ie } = (z = i.eventListeners) == null ? void 0 : z.event;
|
|
1330
|
-
ie && (ee = await ie({
|
|
1331
|
-
e: l,
|
|
1332
|
-
event: { ...o, start: R, end: Q },
|
|
1333
|
-
overlaps: o.getOverlappingEvents({ start: R, end: Q })
|
|
1334
|
-
})), ee !== !1 ? (o.start = R, o.end = Q, f.resizingLastAcceptedEvent && (f.resizingLastAcceptedEvent = null)) : ie && (f.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
|
|
1335
|
-
}
|
|
1336
|
-
}, y = async (l) => {
|
|
1337
|
-
var n, k;
|
|
1338
|
-
if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
|
|
1339
|
-
const { newStart: t, newEnd: O } = E(o);
|
|
1340
|
-
let z = !0;
|
|
1341
|
-
const R = d.value["resize-end"];
|
|
1342
|
-
R && (z = await R({
|
|
1343
|
-
e: l,
|
|
1344
|
-
event: o,
|
|
1345
|
-
original: f.resizingOriginalEvent,
|
|
1346
|
-
// Original event details before resizing.
|
|
1347
|
-
overlaps: o.getOverlappingEvents({ start: t, end: O })
|
|
1348
|
-
})), o.start = z === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).start : ((n = f.resizingLastAcceptedEvent) == null ? void 0 : n.start) || t, o.end = z === !1 ? (f.resizingLastAcceptedEvent || f.resizingOriginalEvent).end : ((k = f.resizingLastAcceptedEvent) == null ? void 0 : k.end) || O, o._.duration < 1 && (o.start = f.resizingOriginalEvent.start, o.end = f.resizingOriginalEvent.end), _.isResizingEvent = !1;
|
|
1349
|
-
}
|
|
1350
|
-
document.removeEventListener(l.type === "touchend" ? "touchmove" : "mousemove", v), f.resizing = !1, f.fromResizer = !1, f.dragging = !1, f.startX = 0, f.startY = 0, f.moveX = 0, f.moveY = 0, f.startPercentageX = 0, f.startPercentageY = 0, f.movePercentageX = 0, f.movePercentageY = 0, f.cellEl = null, f.resizeStartDate = null, f.resizingOriginalEvent = null, f.resizingLastAcceptedEvent = null, f.schedule = null;
|
|
1351
|
-
}, E = (l) => {
|
|
1352
|
-
const n = new Date(l.start.getFullYear(), l.start.getMonth(), l.start.getDate());
|
|
1353
|
-
new Date(n).setDate(n.getDate() + 1);
|
|
1354
|
-
let t = Ee(f.movePercentageY, i);
|
|
1355
|
-
if (t = Math.max(0, Math.min(t, 24 * 60)), i.snapToInterval) {
|
|
1356
|
-
const R = t + i.snapToInterval / 2;
|
|
1357
|
-
t = R - R % i.snapToInterval;
|
|
1358
|
-
}
|
|
1359
|
-
let O = l.start, z = new Date(n.getTime() + t * 6e4);
|
|
1360
|
-
return z < f.resizeStartDate && (O = z, z = f.resizeStartDate), { newStart: O, newEnd: z };
|
|
1361
1448
|
};
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
};
|
|
1366
|
-
return ze(() => {
|
|
1367
|
-
o._.unregister(), H.forEach(({ event: l, handler: n, options: k }) => {
|
|
1368
|
-
document.removeEventListener(l, n, k);
|
|
1369
|
-
});
|
|
1370
|
-
}), (l, n) => (Y(), j("div", ge({ class: "vuecal__event" }, je(d.value, !0), {
|
|
1449
|
+
return Ze(() => l._.register(L.value)), Re(() => {
|
|
1450
|
+
E.holdTimer && (E.holdTimer = clearTimeout(E.holdTimer)), E.touchAndDragTimer && (E.touchAndDragTimer = clearTimeout(E.touchAndDragTimer)), l._.unregister();
|
|
1451
|
+
}), (f, c) => (V(), P("div", ie({ class: "vuecal__event" }, Ie(z.value, !0), {
|
|
1371
1452
|
ref_key: "eventEl",
|
|
1372
|
-
ref:
|
|
1373
|
-
class:
|
|
1374
|
-
style:
|
|
1375
|
-
draggable:
|
|
1376
|
-
onDragstart:
|
|
1377
|
-
onDragend:
|
|
1453
|
+
ref: L,
|
|
1454
|
+
class: i.value,
|
|
1455
|
+
style: e.value,
|
|
1456
|
+
draggable: F.value ? "true" : void 0,
|
|
1457
|
+
onDragstart: c[2] || (c[2] = (u) => F.value && $(C).eventDragStart(u, l)),
|
|
1458
|
+
onDragend: c[3] || (c[3] = (u) => F.value && $(C).eventDragEnd(u, l))
|
|
1378
1459
|
}), [
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1460
|
+
he("div", qt, [
|
|
1461
|
+
f.$slots["event.all-day"] ? j(f.$slots, "event.all-day", {
|
|
1462
|
+
key: 0,
|
|
1463
|
+
event: l
|
|
1464
|
+
}) : f.$slots[`event.${$(h).id}`] ? j(f.$slots, `event.${$(h).id}`, {
|
|
1465
|
+
key: 1,
|
|
1466
|
+
event: l
|
|
1467
|
+
}) : j(f.$slots, "event", {
|
|
1468
|
+
key: 2,
|
|
1469
|
+
event: l
|
|
1470
|
+
}, () => [
|
|
1471
|
+
he("div", Gt, ce(l.title), 1),
|
|
1472
|
+
$(r).time && !y.inAllDayBar && !(l._.multiday && !S.value) ? (V(), P("div", Ut, [
|
|
1473
|
+
$(h).isMonth ? (V(), P("span", Jt, ",")) : x("", !0),
|
|
1474
|
+
he("span", Zt, ce(l._[`startTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
|
|
1475
|
+
$(h).isMonth ? x("", !0) : (V(), P("span", Kt, [
|
|
1476
|
+
qe(" - " + ce(l._[`endTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
|
|
1477
|
+
l._.multiday && S.value ? (V(), P("span", Qt, "+" + ce(I.value) + "d", 1)) : x("", !0)
|
|
1478
|
+
]))
|
|
1479
|
+
])) : x("", !0),
|
|
1480
|
+
y.inAllDayBar ? x("", !0) : (V(), P("div", {
|
|
1481
|
+
key: 1,
|
|
1385
1482
|
class: "vuecal__event-content",
|
|
1386
|
-
innerHTML:
|
|
1387
|
-
}, null, 8,
|
|
1483
|
+
innerHTML: l.content
|
|
1484
|
+
}, null, 8, xt))
|
|
1388
1485
|
])
|
|
1389
1486
|
]),
|
|
1390
|
-
|
|
1487
|
+
m.value ? (V(), P("div", {
|
|
1391
1488
|
key: 0,
|
|
1392
1489
|
class: "vuecal__event-resizer",
|
|
1393
|
-
onDragstart:
|
|
1490
|
+
onDragstart: c[0] || (c[0] = et(() => {
|
|
1394
1491
|
}, ["prevent", "stop"]))
|
|
1395
|
-
}, null, 32)) :
|
|
1396
|
-
|
|
1397
|
-
default:
|
|
1398
|
-
|
|
1492
|
+
}, null, 32)) : x("", !0),
|
|
1493
|
+
Oe(Ue, { name: "vuecal-delete-btn" }, {
|
|
1494
|
+
default: B(() => [
|
|
1495
|
+
l._.deleting ? (V(), P("div", {
|
|
1399
1496
|
key: 0,
|
|
1400
1497
|
class: "vuecal__event-delete",
|
|
1401
|
-
onClick:
|
|
1402
|
-
}, "Delete")) :
|
|
1498
|
+
onClick: c[1] || (c[1] = et((u) => l.delete(3), ["stop"]))
|
|
1499
|
+
}, "Delete")) : x("", !0)
|
|
1403
1500
|
]),
|
|
1404
1501
|
_: 1
|
|
1405
1502
|
})
|
|
1406
|
-
], 16,
|
|
1503
|
+
], 16, It));
|
|
1407
1504
|
}
|
|
1408
|
-
},
|
|
1505
|
+
}, ta = ["innerHTML"], aa = ["data-schedule"], na = {
|
|
1409
1506
|
key: 1,
|
|
1410
1507
|
class: "vuecal__cell-date"
|
|
1411
|
-
},
|
|
1508
|
+
}, sa = {
|
|
1412
1509
|
key: 2,
|
|
1413
1510
|
class: "vuecal__cell-content"
|
|
1414
|
-
},
|
|
1511
|
+
}, la = {
|
|
1415
1512
|
key: 3,
|
|
1416
1513
|
class: "vuecal__cell-events"
|
|
1417
|
-
},
|
|
1514
|
+
}, ra = {
|
|
1418
1515
|
key: 1,
|
|
1419
1516
|
class: "vuecal__cell-date"
|
|
1420
|
-
},
|
|
1517
|
+
}, oa = {
|
|
1421
1518
|
key: 2,
|
|
1422
1519
|
class: "vuecal__cell-content"
|
|
1423
|
-
},
|
|
1520
|
+
}, ia = {
|
|
1424
1521
|
key: 3,
|
|
1425
1522
|
class: "vuecal__cell-events"
|
|
1426
|
-
},
|
|
1523
|
+
}, ua = {
|
|
1427
1524
|
key: 5,
|
|
1428
1525
|
class: "vuecal__cell-events-count"
|
|
1429
|
-
},
|
|
1526
|
+
}, ca = ["title"], kt = {
|
|
1430
1527
|
__name: "cell",
|
|
1431
1528
|
props: {
|
|
1432
1529
|
// Even with time=false, the date of the cell will still be provided in order to attach
|
|
1433
1530
|
// events to a specific date.
|
|
1434
1531
|
start: { type: Date, required: !0 },
|
|
1435
1532
|
end: { type: Date, required: !0 },
|
|
1436
|
-
index: { type: Number, required: !0 }
|
|
1533
|
+
index: { type: Number, required: !0 },
|
|
1534
|
+
allDay: { type: Boolean, default: !1 }
|
|
1535
|
+
// True when the cell is an all-day cell.
|
|
1437
1536
|
},
|
|
1438
|
-
setup(
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
},
|
|
1537
|
+
setup(y) {
|
|
1538
|
+
const t = y, d = He("vuecal"), { view: r, config: h, dateUtils: C, eventsManager: W, dnd: v, touch: A } = d, Z = b(() => C.isToday(t.start)), L = ue(null), l = ue([]), E = ue(!1), F = (o) => {
|
|
1539
|
+
l.value.push(o.detail), E.value = !0;
|
|
1540
|
+
}, m = () => setTimeout(() => E.value = !1, 300), i = be({
|
|
1442
1541
|
dragging: !1,
|
|
1443
1542
|
holding: !1,
|
|
1444
1543
|
// When the cell is clicked and hold for a certain amount of time.
|
|
@@ -1446,6 +1545,10 @@ const Ke = (c) => {
|
|
|
1446
1545
|
// Cell click and hold detection.
|
|
1447
1546
|
thresholdPassed: !1,
|
|
1448
1547
|
// If the drag threshold has been passed.
|
|
1548
|
+
canTouchAndDrag: null,
|
|
1549
|
+
// Wait for 500ms before allowing an event to be dragged after touchstart.
|
|
1550
|
+
touchAndDragTimer: null,
|
|
1551
|
+
// Timer for canTouchAndDrag.
|
|
1449
1552
|
startX: 0,
|
|
1450
1553
|
// The x position at the start of the drag (mousedown or touchstart).
|
|
1451
1554
|
startY: 0,
|
|
@@ -1459,443 +1562,688 @@ const Ke = (c) => {
|
|
|
1459
1562
|
movePercentageX: 0,
|
|
1460
1563
|
movePercentageY: 0,
|
|
1461
1564
|
schedule: null
|
|
1462
|
-
}),
|
|
1463
|
-
let
|
|
1464
|
-
return
|
|
1565
|
+
}), S = ue(!1), n = ue({ cellOverlaps: {}, longestStreak: 0 }), I = b(() => {
|
|
1566
|
+
let o = Math.min(i.startPercentageY, i.movePercentageY), T = Math.max(i.startPercentageY, i.movePercentageY), M = je(o, h), w = je(T, h);
|
|
1567
|
+
return h.snapToInterval && (M = C.snapToInterval(M, h.snapToInterval), w = C.snapToInterval(w, h.snapToInterval), o = Ve(M, h), T = Ve(w, h)), {
|
|
1465
1568
|
style: {
|
|
1466
|
-
top:
|
|
1467
|
-
height: Math.abs(T -
|
|
1569
|
+
top: `${o}%`,
|
|
1570
|
+
height: `${Math.abs(T - o)}%`
|
|
1468
1571
|
},
|
|
1469
|
-
startMinutes:
|
|
1470
|
-
endMinutes:
|
|
1471
|
-
start:
|
|
1472
|
-
end:
|
|
1473
|
-
...
|
|
1572
|
+
startMinutes: M,
|
|
1573
|
+
endMinutes: w,
|
|
1574
|
+
start: C.formatMinutes(M),
|
|
1575
|
+
end: C.formatMinutes(w),
|
|
1576
|
+
...i.schedule ? { schedule: i.schedule } : {}
|
|
1474
1577
|
};
|
|
1475
|
-
}),
|
|
1476
|
-
const
|
|
1477
|
-
return
|
|
1478
|
-
}),
|
|
1479
|
-
var
|
|
1480
|
-
const
|
|
1578
|
+
}), e = b(() => {
|
|
1579
|
+
const o = h.editableEvents.create && (i.dragging || S.value), T = h.eventCreateMinDrag && i.thresholdPassed || !h.eventCreateMinDrag, M = i.canTouchAndDrag !== !1;
|
|
1580
|
+
return o && T && M;
|
|
1581
|
+
}), z = b(() => {
|
|
1582
|
+
var oe;
|
|
1583
|
+
const o = /* @__PURE__ */ new Date(), T = r.start.getFullYear(), M = r.start.getMonth(), w = t.start.getFullYear(), N = t.start.getMonth();
|
|
1481
1584
|
return {
|
|
1482
|
-
[`vuecal__cell--${
|
|
1483
|
-
[`vuecal__cell--${
|
|
1484
|
-
[`vuecal__cell--${
|
|
1485
|
-
"vuecal__cell--today":
|
|
1486
|
-
"vuecal__cell--current-month":
|
|
1487
|
-
"vuecal__cell--current-year":
|
|
1488
|
-
"vuecal__cell--out-of-range":
|
|
1489
|
-
"vuecal__cell--before-min":
|
|
1490
|
-
"vuecal__cell--after-max":
|
|
1491
|
-
"vuecal__cell--disabled":
|
|
1492
|
-
"vuecal__cell--selected":
|
|
1493
|
-
"vuecal__cell--has-schedules": (
|
|
1494
|
-
"vuecal__cell--dragging":
|
|
1495
|
-
"vuecal__cell--has-events":
|
|
1585
|
+
[`vuecal__cell--${Ge[t.start.getDay()]}`]: r.isDay || r.isDays || r.isWeek || r.isMonth,
|
|
1586
|
+
[`vuecal__cell--${Yt[N]}`]: r.isYear,
|
|
1587
|
+
[`vuecal__cell--${w}`]: r.isYears,
|
|
1588
|
+
"vuecal__cell--today": Z.value,
|
|
1589
|
+
"vuecal__cell--current-month": r.isYear && w === o.getFullYear() && N === o.getMonth(),
|
|
1590
|
+
"vuecal__cell--current-year": r.isYears && w === o.getFullYear(),
|
|
1591
|
+
"vuecal__cell--out-of-range": r.isMonth && (w !== T || N !== M),
|
|
1592
|
+
"vuecal__cell--before-min": U.value && O.value,
|
|
1593
|
+
"vuecal__cell--after-max": U.value && X.value,
|
|
1594
|
+
"vuecal__cell--disabled": U.value,
|
|
1595
|
+
"vuecal__cell--selected": r.selectedDate && r.selectedDate.getTime() >= t.start.getTime() && r.selectedDate.getTime() <= t.end.getTime(),
|
|
1596
|
+
"vuecal__cell--has-schedules": (oe = h.schedules) == null ? void 0 : oe.length,
|
|
1597
|
+
"vuecal__cell--dragging": i.dragging,
|
|
1598
|
+
"vuecal__cell--has-events": Y.value.length
|
|
1496
1599
|
};
|
|
1497
|
-
})
|
|
1498
|
-
|
|
1600
|
+
});
|
|
1601
|
+
b(() => C.formatDate(t.start));
|
|
1602
|
+
const H = b(() => {
|
|
1603
|
+
switch (r.id) {
|
|
1499
1604
|
case "day":
|
|
1500
1605
|
return "";
|
|
1501
1606
|
case "days":
|
|
1502
|
-
return
|
|
1607
|
+
return h.availableViews.days.rows > 1 && C.formatDate(t.start, "D"), "";
|
|
1503
1608
|
case "week":
|
|
1504
1609
|
return "";
|
|
1505
1610
|
case "month":
|
|
1506
|
-
return
|
|
1611
|
+
return C.formatDate(t.start, "D");
|
|
1507
1612
|
case "year":
|
|
1508
|
-
return
|
|
1613
|
+
return C.formatDate(t.start, h.xs ? "MMM" : "MMMM");
|
|
1509
1614
|
case "years":
|
|
1510
|
-
return
|
|
1615
|
+
return C.formatDate(t.start, "YYYY");
|
|
1511
1616
|
}
|
|
1512
|
-
}),
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1617
|
+
}), Y = b(() => h.datePicker ? [] : W.getEventsInRange(
|
|
1618
|
+
t.start,
|
|
1619
|
+
t.end,
|
|
1620
|
+
{ excludeIds: l.value, ...h.allDayEvents ? { allDay: t.allDay } : {} }
|
|
1621
|
+
)), _ = b(() => Y.value.filter((o) => !o.background)), f = b(() => {
|
|
1622
|
+
var o;
|
|
1623
|
+
return (o = h.schedules) == null ? void 0 : o.reduce((T, M) => (T[M.id] = Y.value.filter((w) => w.schedule === M.id), T), {});
|
|
1624
|
+
}), c = b(() => {
|
|
1625
|
+
if (r.isMonth || r.isYear || r.isYears || t.allDay) return {};
|
|
1626
|
+
const o = typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl", T = h.horizontal, M = {};
|
|
1627
|
+
for (const w of Y.value) {
|
|
1628
|
+
const N = w._.id, { maxConcurrent: G = 1, position: oe = 0 } = n.value.cellOverlaps[N] || {}, ge = o ? "right" : "left", g = T ? "height" : "width";
|
|
1629
|
+
M[N] = { [T ? "top" : ge]: `${100 / G * oe}%` }, h.stackEvents ? M[N][g] = `${100 / G + (oe === G - 1 ? 0 : 15)}%` : M[N][g] = `${100 / G}%`;
|
|
1523
1630
|
}
|
|
1524
|
-
return
|
|
1525
|
-
}),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1631
|
+
return M;
|
|
1632
|
+
}), u = b(() => {
|
|
1633
|
+
const o = {};
|
|
1634
|
+
for (const T of Y.value) {
|
|
1635
|
+
const M = T._.id, { maxConcurrent: w = 1, position: N = 0 } = n.value.cellOverlaps[M] || {};
|
|
1636
|
+
o[M] = `vuecal__event--stack-${N + 1}-${w}`;
|
|
1637
|
+
}
|
|
1638
|
+
return o;
|
|
1639
|
+
}), p = b(() => h.showCellEventCount && _.value.length), a = b(() => {
|
|
1640
|
+
var M;
|
|
1641
|
+
if (!h.specialHours || r.isMonth || r.isYear || r.isYears || t.allDay) return;
|
|
1642
|
+
const o = Ge[t.start.getDay()];
|
|
1643
|
+
let T = (M = h.specialHours) == null ? void 0 : M[o];
|
|
1530
1644
|
if (T)
|
|
1531
|
-
return Array.isArray(T) || (T = [T]), T.map((
|
|
1532
|
-
let { from:
|
|
1533
|
-
if (isNaN(
|
|
1534
|
-
|
|
1535
|
-
const
|
|
1645
|
+
return Array.isArray(T) || (T = [T]), T.map((w) => {
|
|
1646
|
+
let { from: N, to: G, class: oe, label: ge } = w;
|
|
1647
|
+
if (isNaN(N) || isNaN(G) || h.timeFrom >= G || h.timeTo <= N) return;
|
|
1648
|
+
N = Math.max(h.timeFrom, N), G = Math.min(h.timeTo, G);
|
|
1649
|
+
const g = Ve(N, h), R = Ve(G, h) - g;
|
|
1536
1650
|
return {
|
|
1537
|
-
style: { top: `${
|
|
1538
|
-
label:
|
|
1539
|
-
class:
|
|
1651
|
+
style: { top: `${g}%`, height: `${R}%` },
|
|
1652
|
+
label: ge,
|
|
1653
|
+
class: oe
|
|
1540
1654
|
};
|
|
1541
|
-
}).filter((
|
|
1542
|
-
}),
|
|
1543
|
-
const { disableDays:
|
|
1544
|
-
return
|
|
1545
|
-
}),
|
|
1546
|
-
show:
|
|
1547
|
-
if (!(!
|
|
1655
|
+
}).filter((w) => !!w);
|
|
1656
|
+
}), O = b(() => h.minTimestamp !== null && h.minTimestamp > t.end.getTime()), X = b(() => h.maxTimestamp && h.maxTimestamp < t.start.getTime()), U = b(() => {
|
|
1657
|
+
const { disableDays: o } = h, T = r.isYear || r.isYears;
|
|
1658
|
+
return o.length && o.includes(C.formatDate(t.start)) && !T ? !0 : O.value || X.value;
|
|
1659
|
+
}), Q = be({
|
|
1660
|
+
show: b(() => {
|
|
1661
|
+
if (!(!r.isDay && !r.isDays && !r.isWeek) && !(!Z.value || !h.time || t.allDay) && !(h.timeFrom > C.dateToMinutes(r.now)) && !(C.dateToMinutes(r.now) > h.timeTo))
|
|
1548
1662
|
return !0;
|
|
1549
1663
|
}),
|
|
1550
|
-
nowInMinutes:
|
|
1551
|
-
todaysTimePosition:
|
|
1552
|
-
style:
|
|
1553
|
-
currentTime:
|
|
1554
|
-
}),
|
|
1555
|
-
if (
|
|
1556
|
-
const
|
|
1557
|
-
Object.entries(
|
|
1558
|
-
|
|
1559
|
-
var
|
|
1560
|
-
(
|
|
1664
|
+
nowInMinutes: b(() => C.dateToMinutes(r.now)),
|
|
1665
|
+
todaysTimePosition: b(() => Ve(Q.nowInMinutes, h)),
|
|
1666
|
+
style: b(() => `${h.horizontal ? "left" : "top"}: ${Q.todaysTimePosition}%`),
|
|
1667
|
+
currentTime: b(() => C.formatTime(r.now))
|
|
1668
|
+
}), te = b(() => {
|
|
1669
|
+
if (U.value) return {};
|
|
1670
|
+
const o = { ...h.eventListeners.cell };
|
|
1671
|
+
for (const [w, N] of Object.entries(o))
|
|
1672
|
+
o[w] = (G) => {
|
|
1673
|
+
var oe, ge, g;
|
|
1674
|
+
(g = (ge = G.target || ((oe = G.e) == null ? void 0 : oe.target)).closest) != null && g.call(ge, ".vuecal__event") || N(G.type ? { e: G, cell: q.value, cursor: ae.value } : G);
|
|
1561
1675
|
};
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1676
|
+
const T = { ...o };
|
|
1677
|
+
let M = null;
|
|
1678
|
+
return o.click = (w) => {
|
|
1679
|
+
var G;
|
|
1680
|
+
ve();
|
|
1681
|
+
const N = le(w);
|
|
1682
|
+
(G = T.click) == null || G.call(T, { e: w, cell: q.value, cursor: N }), M ? M = clearTimeout(M) : M = setTimeout(() => {
|
|
1683
|
+
var oe;
|
|
1684
|
+
M = null, (oe = T["delayed-click"]) == null || oe.call(T, { e: w, cell: q.value, cursor: N });
|
|
1570
1685
|
}, 400);
|
|
1571
|
-
}, (
|
|
1572
|
-
var
|
|
1573
|
-
|
|
1574
|
-
},
|
|
1575
|
-
var
|
|
1576
|
-
|
|
1577
|
-
}), T.dblclick && (
|
|
1578
|
-
var
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1686
|
+
}, (h.time && r.isDay || r.isDays || r.isWeek) && (o.touchstart = (w) => {
|
|
1687
|
+
var N;
|
|
1688
|
+
s(w.e || w), (N = T.touchstart) == null || N.call(T, { e: w, cell: q.value, cursor: ae.value });
|
|
1689
|
+
}, o.mousedown = (w) => {
|
|
1690
|
+
var N;
|
|
1691
|
+
s(w.e || w), (N = T.mousedown) == null || N.call(T, { e: w, cell: q.value, cursor: ae.value });
|
|
1692
|
+
}), T.dblclick && (o.dblclick = (w) => {
|
|
1693
|
+
var N;
|
|
1694
|
+
(N = T.dblclick) == null || N.call(T, { e: w, cell: q.value, cursor: le(w) });
|
|
1695
|
+
}), h.editableEvents.drag && (o.dragenter = (w) => v.cellDragEnter(w, q.value), o.dragover = (w) => {
|
|
1696
|
+
w.preventDefault(), v.cellDragOver(w, q.value);
|
|
1697
|
+
}, o.dragleave = (w) => v.cellDragLeave(w, q.value), o.drop = (w) => v.cellDragDrop(w, q.value, t.allDay)), o;
|
|
1698
|
+
}), q = b(() => ({
|
|
1699
|
+
start: t.start,
|
|
1700
|
+
end: t.end,
|
|
1701
|
+
events: Y,
|
|
1702
|
+
...i.schedule ? { schedule: i.schedule } : {},
|
|
1703
|
+
goNarrower: () => r.narrower(),
|
|
1704
|
+
goBroader: () => r.broader(),
|
|
1705
|
+
broader: r.broaderView,
|
|
1706
|
+
narrower: r.narrowerView
|
|
1707
|
+
})), le = (o) => {
|
|
1708
|
+
var G;
|
|
1709
|
+
const T = (((G = o.touches) == null ? void 0 : G[0]) || o).clientY, { top: M } = L.value.getBoundingClientRect(), w = Ke(T - M, L.value), N = new Date(t.start);
|
|
1710
|
+
return N.setMinutes(je(w, h)), { y: w, date: N };
|
|
1711
|
+
}, ae = b(() => {
|
|
1712
|
+
const o = je(i.movePercentageY || i.startPercentageY, h), T = new Date(t.start);
|
|
1713
|
+
return T.setMinutes(o), {
|
|
1714
|
+
x: i.movePercentageX || i.startPercentageX,
|
|
1715
|
+
y: i.movePercentageY || i.startPercentageY,
|
|
1599
1716
|
date: T
|
|
1600
1717
|
};
|
|
1601
|
-
}),
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1604
|
-
var
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1718
|
+
}), ve = () => {
|
|
1719
|
+
r.updateSelectedDate(t.start), h.clickToNavigate && ((r.isMonth || r.isDays || r.isWeek) && h.availableViews.day ? r.switch("day") : r.isYear && h.availableViews.month ? r.switch("month") : r.isYears && h.availableViews.year && r.switch("year")), r.updateViewDate(t.start);
|
|
1720
|
+
}, s = (o) => {
|
|
1721
|
+
var w, N;
|
|
1722
|
+
const T = o.type === "touchstart";
|
|
1723
|
+
T ? (i.canTouchAndDrag = !1, i.touchAndDragTimer = setTimeout(() => {
|
|
1724
|
+
i.canTouchAndDrag = !0, (i.holding || i.dragging) && o.preventDefault();
|
|
1725
|
+
}, 500)) : i.canTouchAndDrag = !0, i.schedule = ~~o.target.dataset.schedule;
|
|
1726
|
+
const M = L.value.getBoundingClientRect();
|
|
1727
|
+
i.startX = (((w = o.touches) == null ? void 0 : w[0]) || o).clientX - M.left, i.startY = (((N = o.touches) == null ? void 0 : N[0]) || o).clientY - M.top, i.startPercentageX = i.startX * 100 / M.width, i.startPercentageY = i.startY * 100 / M.height, i.thresholdPassed = !1, document.addEventListener(T ? "touchmove" : "mousemove", k, { passive: !T }), document.addEventListener(T ? "touchend" : "mouseup", D, { once: !0 }), i.holdTimer = setTimeout(() => {
|
|
1728
|
+
var G, oe;
|
|
1729
|
+
i.holding = !0, (oe = (G = te.value).hold) == null || oe.call(G, { e: o, cell: q.value, cursor: ae.value });
|
|
1610
1730
|
}, 1e3);
|
|
1611
|
-
},
|
|
1612
|
-
var
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1731
|
+
}, k = (o) => {
|
|
1732
|
+
var w, N, G, oe, ge, g;
|
|
1733
|
+
const T = o.type === "touchmove";
|
|
1734
|
+
if (T && !i.canTouchAndDrag) {
|
|
1735
|
+
i.touchAndDragTimer && (clearTimeout(i.touchAndDragTimer), i.touchAndDragTimer = null), D(o);
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
T && o.preventDefault(), i.dragging || (A.isDraggingCell = !0, (N = (w = te.value)["drag-start"]) == null || N.call(w, { e: o, cell: q.value, cursor: ae.value })), i.dragging = !0, i.holdTimer = clearTimeout(i.holdTimer), i.holding = !1;
|
|
1739
|
+
const M = L.value.getBoundingClientRect();
|
|
1740
|
+
i.moveX = (((G = o.touches) == null ? void 0 : G[0]) || o).clientX - M.left, i.moveY = (((oe = o.touches) == null ? void 0 : oe[0]) || o).clientY - M.top, i.movePercentageX = i.moveX * 100 / M.width, i.movePercentageY = i.moveY * 100 / M.height, h.eventCreateMinDrag && Math.abs(i.startY - i.moveY) > h.eventCreateMinDrag && (i.thresholdPassed = !0), (g = (ge = te.value).drag) == null || g.call(ge, { e: o, cell: q.value, cursor: ae.value });
|
|
1741
|
+
}, D = async (o) => {
|
|
1742
|
+
var M, w;
|
|
1743
|
+
const T = o.type === "touchend";
|
|
1744
|
+
document.removeEventListener(T ? "touchmove" : "mousemove", k, { passive: !1 }), i.touchAndDragTimer && (clearTimeout(i.touchAndDragTimer), i.touchAndDragTimer = null), i.dragging && ((w = (M = te.value)["drag-end"]) == null || w.call(M, { e: o, cell: q.value, cursor: ae.value }), A.isDraggingCell = !1, h.editableEvents.create && i.canTouchAndDrag && (S.value = !0, await J(o), S.value = !1)), i.holdTimer = clearTimeout(i.holdTimer), i.holding = !1, i.dragging = !1, i.startX = 0, i.startY = 0, i.moveX = 0, i.moveY = 0, i.startPercentageX = 0, i.startPercentageY = 0, i.movePercentageX = 0, i.movePercentageY = 0, i.thresholdPassed = !1, i.schedule = null, i.canTouchAndDrag = null;
|
|
1745
|
+
}, J = async (o) => {
|
|
1746
|
+
var ge;
|
|
1747
|
+
if (!e.value) return;
|
|
1748
|
+
let { start: T, end: M, startMinutes: w, endMinutes: N } = I.value;
|
|
1749
|
+
T = new Date(t.start), T.setMinutes(w), M = new Date(t.start), M.setMinutes(N);
|
|
1750
|
+
let G = { ...I.value, start: T, end: M };
|
|
1751
|
+
const { create: oe } = h.eventListeners.event;
|
|
1752
|
+
if (typeof oe == "function") {
|
|
1753
|
+
const g = G;
|
|
1754
|
+
G = await new Promise((R) => oe({ e: o, event: G, cell: q.value, resolve: R, cursor: ae.value })), G && typeof G == "object" && r.createEvent(G), G && typeof G == "boolean" && r.createEvent(g);
|
|
1755
|
+
} else r.createEvent(G);
|
|
1756
|
+
(ge = navigator.vibrate) == null || ge.call(navigator, 200);
|
|
1757
|
+
}, ne = () => {
|
|
1758
|
+
var o;
|
|
1759
|
+
for (const T of Object.keys(te.value))
|
|
1760
|
+
(o = L.value) == null || o.removeEventListener(T, te.value[T]);
|
|
1761
|
+
}, me = () => {
|
|
1762
|
+
n.value = W.getCellOverlappingEvents(t.start, t.end, t.allDay);
|
|
1636
1763
|
};
|
|
1637
|
-
return
|
|
1764
|
+
return De(
|
|
1638
1765
|
// Watch event IDs and start/end dates (only) to detect event resizing/dnd.
|
|
1639
|
-
() =>
|
|
1766
|
+
() => !r.isYears && !r.isYear && _.value.map((o) => `${o._.id}${o.start.getTime()}${o.end.getTime()}`).join(),
|
|
1640
1767
|
async () => {
|
|
1641
|
-
await
|
|
1768
|
+
await Xe(), me();
|
|
1642
1769
|
},
|
|
1643
1770
|
{ immediate: !0, flush: "post" }
|
|
1644
1771
|
// Use flush: 'post' to prevent infinite updates.
|
|
1645
|
-
),
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1772
|
+
), Re(async () => {
|
|
1773
|
+
for (const o of l.value) W.deleteEvent(o, 3);
|
|
1774
|
+
ne(), await Xe();
|
|
1775
|
+
}), (o, T) => (V(), P("div", ie({
|
|
1776
|
+
class: ["vuecal__cell", z.value],
|
|
1649
1777
|
ref_key: "cellEl",
|
|
1650
|
-
ref:
|
|
1651
|
-
},
|
|
1652
|
-
|
|
1778
|
+
ref: L
|
|
1779
|
+
}, Ie(te.value, !0)), [
|
|
1780
|
+
o.$slots.cell ? j(o.$slots, "cell", {
|
|
1653
1781
|
key: 0,
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
key: S.id,
|
|
1667
|
-
style: ke(S.style || null),
|
|
1668
|
-
"data-schedule": S.id
|
|
1782
|
+
cell: q.value
|
|
1783
|
+
}) : x("", !0),
|
|
1784
|
+
a.value ? (V(!0), P(de, { key: 1 }, we(a.value, (M, w) => (V(), P("div", {
|
|
1785
|
+
class: pe(["vuecal__special-hours", M.class]),
|
|
1786
|
+
style: $e(M.style),
|
|
1787
|
+
innerHTML: M.label || ""
|
|
1788
|
+
}, null, 14, ta))), 256)) : x("", !0),
|
|
1789
|
+
!o.$slots.cell && $(h).schedules ? (V(!0), P(de, { key: 2 }, we($(h).schedules, (M) => (V(), P("div", {
|
|
1790
|
+
class: pe(["vuecal__schedule vuecal__schedule--cell", M.class]),
|
|
1791
|
+
key: M.id,
|
|
1792
|
+
style: $e(M.style || null),
|
|
1793
|
+
"data-schedule": M.id
|
|
1669
1794
|
}, [
|
|
1670
|
-
|
|
1795
|
+
o.$slots["cell-events"] ? j(o.$slots, "cell-events", {
|
|
1671
1796
|
key: 0,
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
F(r.$slots, "cell-date", {
|
|
1678
|
-
start: c.start,
|
|
1679
|
-
end: c.end,
|
|
1680
|
-
events: n.value
|
|
1681
|
-
}, () => [
|
|
1682
|
-
Ze(re(l.value), 1)
|
|
1797
|
+
cell: q.value
|
|
1798
|
+
}) : x("", !0),
|
|
1799
|
+
H.value || o.$slots["cell-date"] ? (V(), P("div", na, [
|
|
1800
|
+
j(o.$slots, "cell-date", { cell: q.value }, () => [
|
|
1801
|
+
qe(ce(H.value), 1)
|
|
1683
1802
|
])
|
|
1684
|
-
])) :
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
])) : Z("", !0),
|
|
1692
|
-
r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Nt, [
|
|
1693
|
-
F(r.$slots, "cell-events", {
|
|
1694
|
-
start: c.start,
|
|
1695
|
-
end: c.end,
|
|
1696
|
-
events: n.value
|
|
1697
|
-
})
|
|
1698
|
-
])) : n.value.length || W.value ? (Y(), be(qe, {
|
|
1803
|
+
])) : x("", !0),
|
|
1804
|
+
o.$slots["cell-content"] ? (V(), P("div", sa, [
|
|
1805
|
+
j(o.$slots, "cell-content", { cell: q.value })
|
|
1806
|
+
])) : x("", !0),
|
|
1807
|
+
o.$slots["cell-events"] && Y.value.length ? (V(), P("div", la, [
|
|
1808
|
+
j(o.$slots, "cell-events", { cell: q.value })
|
|
1809
|
+
])) : Y.value.length || E.value ? (V(), Se(tt, {
|
|
1699
1810
|
key: 4,
|
|
1700
1811
|
class: "vuecal__cell-events",
|
|
1701
1812
|
name: "vuecal-event-delete",
|
|
1702
|
-
onBeforeLeave: T[0] || (T[0] = (
|
|
1703
|
-
onAfterLeave:
|
|
1813
|
+
onBeforeLeave: T[0] || (T[0] = (w) => E.value = !0),
|
|
1814
|
+
onAfterLeave: m,
|
|
1704
1815
|
tag: "div"
|
|
1705
1816
|
}, {
|
|
1706
|
-
default:
|
|
1707
|
-
(
|
|
1708
|
-
key:
|
|
1709
|
-
event:
|
|
1710
|
-
onEventDeleted:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1817
|
+
default: B(() => [
|
|
1818
|
+
(V(!0), P(de, null, we(f.value[M.id], (w) => (V(), Se(st, {
|
|
1819
|
+
key: w._.id,
|
|
1820
|
+
event: w,
|
|
1821
|
+
onEventDeleted: F,
|
|
1822
|
+
"in-all-day-bar": t.allDay,
|
|
1823
|
+
"cell-start": t.start,
|
|
1824
|
+
"cell-end": t.end,
|
|
1825
|
+
style: $e(c.value[w._.id])
|
|
1826
|
+
}, Ce({ _: 2 }, [
|
|
1827
|
+
o.$slots["event.all-day"] && t.allDay ? {
|
|
1828
|
+
name: "event.all-day",
|
|
1829
|
+
fn: B((N) => [
|
|
1830
|
+
j(o.$slots, "event.all-day", ie({ ref_for: !0 }, N))
|
|
1717
1831
|
]),
|
|
1718
1832
|
key: "0"
|
|
1833
|
+
} : void 0,
|
|
1834
|
+
o.$slots[`event.${$(r).id}`] ? {
|
|
1835
|
+
name: `event.${$(r).id}`,
|
|
1836
|
+
fn: B((N) => [
|
|
1837
|
+
j(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, N))
|
|
1838
|
+
]),
|
|
1839
|
+
key: "1"
|
|
1840
|
+
} : void 0,
|
|
1841
|
+
o.$slots.event ? {
|
|
1842
|
+
name: "event",
|
|
1843
|
+
fn: B((N) => [
|
|
1844
|
+
j(o.$slots, "event", ie({ ref_for: !0 }, N))
|
|
1845
|
+
]),
|
|
1846
|
+
key: "2"
|
|
1719
1847
|
} : void 0
|
|
1720
|
-
]), 1032, ["event", "style"]))), 128))
|
|
1848
|
+
]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "style"]))), 128))
|
|
1721
1849
|
]),
|
|
1722
1850
|
_: 2
|
|
1723
|
-
}, 1024)) :
|
|
1724
|
-
|
|
1851
|
+
}, 1024)) : x("", !0),
|
|
1852
|
+
e.value && i.schedule === M.id && !t.allDay ? (V(), P("div", {
|
|
1725
1853
|
key: 5,
|
|
1726
1854
|
class: "vuecal__event-placeholder",
|
|
1727
|
-
style:
|
|
1728
|
-
},
|
|
1729
|
-
], 14,
|
|
1730
|
-
!
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
Ze(re(l.value), 1)
|
|
1855
|
+
style: $e(I.value.style)
|
|
1856
|
+
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) : x("", !0)
|
|
1857
|
+
], 14, aa))), 128)) : x("", !0),
|
|
1858
|
+
!o.$slots.cell && !$(h).schedules ? (V(), P(de, { key: 3 }, [
|
|
1859
|
+
o.$slots["cell-events"] ? j(o.$slots, "cell-events", {
|
|
1860
|
+
key: 0,
|
|
1861
|
+
cell: q.value
|
|
1862
|
+
}) : x("", !0),
|
|
1863
|
+
H.value || o.$slots["cell-date"] ? (V(), P("div", ra, [
|
|
1864
|
+
j(o.$slots, "cell-date", { cell: q.value }, () => [
|
|
1865
|
+
qe(ce(H.value), 1)
|
|
1739
1866
|
])
|
|
1740
|
-
])) :
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
])) : Z("", !0),
|
|
1748
|
-
r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Bt, [
|
|
1749
|
-
F(r.$slots, "cell-events", {
|
|
1750
|
-
start: c.start,
|
|
1751
|
-
end: c.end,
|
|
1752
|
-
events: n.value
|
|
1753
|
-
})
|
|
1754
|
-
])) : (n.value.length || W.value) && !(C(D).isMonth && !C(w).eventsOnMonthView) ? (Y(), be(qe, {
|
|
1867
|
+
])) : x("", !0),
|
|
1868
|
+
o.$slots["cell-content"] ? (V(), P("div", oa, [
|
|
1869
|
+
j(o.$slots, "cell-content", { cell: q.value })
|
|
1870
|
+
])) : x("", !0),
|
|
1871
|
+
o.$slots["cell-events"] && Y.value.length ? (V(), P("div", ia, [
|
|
1872
|
+
j(o.$slots, "cell-events", { cell: q.value })
|
|
1873
|
+
])) : !($(r).isMonth && !$(h).eventsOnMonthView) && !$(r).isYear && !$(r).isYears && (Y.value.length || E.value) ? (V(), Se(tt, {
|
|
1755
1874
|
key: 4,
|
|
1756
1875
|
class: "vuecal__cell-events",
|
|
1757
1876
|
name: "vuecal-event-delete",
|
|
1758
|
-
onBeforeLeave: T[1] || (T[1] = (
|
|
1759
|
-
onAfterLeave:
|
|
1877
|
+
onBeforeLeave: T[1] || (T[1] = (M) => E.value = !0),
|
|
1878
|
+
onAfterLeave: m,
|
|
1760
1879
|
tag: "div"
|
|
1761
1880
|
}, {
|
|
1762
|
-
default:
|
|
1763
|
-
(
|
|
1764
|
-
key:
|
|
1765
|
-
event:
|
|
1766
|
-
onEventDeleted:
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1881
|
+
default: B(() => [
|
|
1882
|
+
(V(!0), P(de, null, we(Y.value, (M) => (V(), Se(st, {
|
|
1883
|
+
key: M._.id,
|
|
1884
|
+
event: M,
|
|
1885
|
+
onEventDeleted: F,
|
|
1886
|
+
"in-all-day-bar": t.allDay,
|
|
1887
|
+
"cell-start": t.start,
|
|
1888
|
+
"cell-end": t.end,
|
|
1889
|
+
class: pe(u.value[M._.id]),
|
|
1890
|
+
style: $e(c.value[M._.id])
|
|
1891
|
+
}, Ce({ _: 2 }, [
|
|
1892
|
+
o.$slots["event.all-day"] && t.allDay ? {
|
|
1893
|
+
name: "event.all-day",
|
|
1894
|
+
fn: B((w) => [
|
|
1895
|
+
j(o.$slots, "event.all-day", ie({ ref_for: !0 }, w))
|
|
1773
1896
|
]),
|
|
1774
1897
|
key: "0"
|
|
1898
|
+
} : void 0,
|
|
1899
|
+
o.$slots[`event.${$(r).id}`] ? {
|
|
1900
|
+
name: `event.${$(r).id}`,
|
|
1901
|
+
fn: B((w) => [
|
|
1902
|
+
j(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, w))
|
|
1903
|
+
]),
|
|
1904
|
+
key: "1"
|
|
1905
|
+
} : void 0,
|
|
1906
|
+
o.$slots.event ? {
|
|
1907
|
+
name: "event",
|
|
1908
|
+
fn: B((w) => [
|
|
1909
|
+
j(o.$slots, "event", ie({ ref_for: !0 }, w))
|
|
1910
|
+
]),
|
|
1911
|
+
key: "2"
|
|
1775
1912
|
} : void 0
|
|
1776
|
-
]), 1032, ["event", "style"]))), 128))
|
|
1913
|
+
]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "class", "style"]))), 128))
|
|
1777
1914
|
]),
|
|
1778
1915
|
_: 3
|
|
1779
|
-
})) :
|
|
1780
|
-
|
|
1916
|
+
})) : x("", !0),
|
|
1917
|
+
e.value ? (V(), P("div", {
|
|
1781
1918
|
key: 5,
|
|
1782
1919
|
class: "vuecal__event-placeholder",
|
|
1783
|
-
style:
|
|
1784
|
-
},
|
|
1785
|
-
], 64)) :
|
|
1786
|
-
|
|
1920
|
+
style: $e(I.value.style)
|
|
1921
|
+
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) : x("", !0)
|
|
1922
|
+
], 64)) : x("", !0),
|
|
1923
|
+
o.$slots["event-count"] ? j(o.$slots, "event-count", {
|
|
1787
1924
|
key: 4,
|
|
1788
|
-
events:
|
|
1789
|
-
}) :
|
|
1790
|
-
|
|
1925
|
+
events: _.value
|
|
1926
|
+
}) : p.value ? (V(), P("div", ua, ce(_.value.length), 1)) : x("", !0),
|
|
1927
|
+
Q.show ? (V(), P("div", {
|
|
1791
1928
|
key: 6,
|
|
1792
1929
|
class: "vuecal__now-line",
|
|
1793
|
-
style:
|
|
1794
|
-
title:
|
|
1930
|
+
style: $e(Q.style),
|
|
1931
|
+
title: Q.currentTime
|
|
1795
1932
|
}, [
|
|
1796
|
-
|
|
1797
|
-
], 12,
|
|
1933
|
+
he("span", null, ce(Q.currentTime), 1)
|
|
1934
|
+
], 12, ca)) : x("", !0)
|
|
1798
1935
|
], 16));
|
|
1799
1936
|
}
|
|
1800
|
-
},
|
|
1937
|
+
}, da = {
|
|
1938
|
+
key: 0,
|
|
1939
|
+
class: "vuecal__headings"
|
|
1940
|
+
}, va = {
|
|
1941
|
+
key: 0,
|
|
1942
|
+
class: "vuecal__weekdays-headings"
|
|
1943
|
+
}, fa = ["onClick"], ma = { class: "vuecal__weekday-day" }, ga = {
|
|
1944
|
+
key: 0,
|
|
1945
|
+
class: "vuecal__weekday-date"
|
|
1946
|
+
}, ha = {
|
|
1947
|
+
key: 1,
|
|
1948
|
+
class: "vuecal__schedules-headings w-flex grow"
|
|
1949
|
+
}, ya = ["innerHTML"], Da = {
|
|
1950
|
+
key: 2,
|
|
1951
|
+
class: "vuecal__all-day w-flex grow"
|
|
1952
|
+
}, pa = {
|
|
1953
|
+
__name: "headings-bar",
|
|
1954
|
+
setup(y) {
|
|
1955
|
+
const t = He("vuecal"), d = He("$vuecalEl"), { view: r, config: h, dateUtils: C } = t, W = b(() => h.xs ? "day-xs" : h.sm || r.isDays || r.isMonth ? "day-sm" : "day"), v = b(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !h.schedules && !h.allDayEvents)), A = b(() => r.cellDates.slice(0, h.horizontal ? r.rows : r.cols).map(({ start: l }) => ({
|
|
1956
|
+
id: Ge[l.getDay()],
|
|
1957
|
+
date: l,
|
|
1958
|
+
dateNumber: l.getDate(),
|
|
1959
|
+
day: C.formatDate(l, "dddd"),
|
|
1960
|
+
"day-sm": C.formatDate(l, "ddd"),
|
|
1961
|
+
"day-xs": C.formatDate(l, "dd"),
|
|
1962
|
+
isToday: C.isToday(l)
|
|
1963
|
+
}))), Z = {
|
|
1964
|
+
click: (l) => {
|
|
1965
|
+
(r.isDays || r.isWeek) && r.updateSelectedDate(l);
|
|
1966
|
+
}
|
|
1967
|
+
}, L = {
|
|
1968
|
+
isResizing: ue(!1),
|
|
1969
|
+
startY: ue(0),
|
|
1970
|
+
initialHeight: ue(0),
|
|
1971
|
+
defaultHeight: 25,
|
|
1972
|
+
// Default height in pixels.
|
|
1973
|
+
// Or in the case of horizontal layout.
|
|
1974
|
+
startX: ue(0),
|
|
1975
|
+
initialWidth: ue(0),
|
|
1976
|
+
defaultWidth: 25,
|
|
1977
|
+
// Default width in pixels.
|
|
1978
|
+
// Cleanup event listeners.
|
|
1979
|
+
cleanup() {
|
|
1980
|
+
typeof document < "u" && (document.removeEventListener("mousemove", L.handleMouseMove), document.removeEventListener("mouseup", L.cleanup), document.removeEventListener("touchmove", L.handleTouchMove, { passive: !1 }), document.removeEventListener("touchend", L.cleanup)), L.isResizing.value = !1;
|
|
1981
|
+
},
|
|
1982
|
+
startResize(l, E) {
|
|
1983
|
+
var i;
|
|
1984
|
+
this.isResizing.value = !0;
|
|
1985
|
+
const F = h.horizontal;
|
|
1986
|
+
this[F ? "startX" : "startY"].value = F ? l : E;
|
|
1987
|
+
const m = (i = d.value) == null ? void 0 : i.querySelector(".vuecal__all-day");
|
|
1988
|
+
m && (this[F ? "initialWidth" : "initialHeight"].value = m[F ? "offsetWidth" : "offsetHeight"]), document.addEventListener("mousemove", L.handleMouseMove), document.addEventListener("mouseup", L.cleanup), document.addEventListener("touchmove", L.handleTouchMove, { passive: !1 }), document.addEventListener("touchend", L.cleanup);
|
|
1989
|
+
},
|
|
1990
|
+
// Update height/width based on mouse/touch movement.
|
|
1991
|
+
updateSize(l, E) {
|
|
1992
|
+
var S;
|
|
1993
|
+
if (!this.isResizing.value) return;
|
|
1994
|
+
const F = h.horizontal, m = F ? l - this.startX.value : E - this.startY.value, i = Math.max(20, this[F ? "initialWidth" : "initialHeight"].value + m);
|
|
1995
|
+
(S = d.value) == null || S.style.setProperty("--vuecal-all-day-bar-height", `${i}px`);
|
|
1996
|
+
},
|
|
1997
|
+
// Mouse event handlers.
|
|
1998
|
+
handleMouseDown(l) {
|
|
1999
|
+
this.startResize(l.clientX, l.clientY);
|
|
2000
|
+
},
|
|
2001
|
+
handleMouseMove(l) {
|
|
2002
|
+
L.updateSize(l.clientX, l.clientY);
|
|
2003
|
+
},
|
|
2004
|
+
// Touch event handlers.
|
|
2005
|
+
handleTouchStart(l) {
|
|
2006
|
+
var E;
|
|
2007
|
+
(E = l.touches) != null && E[0] && this.startResize(l.touches[0].clientX, l.touches[0].clientY);
|
|
2008
|
+
},
|
|
2009
|
+
handleTouchMove(l) {
|
|
2010
|
+
var E;
|
|
2011
|
+
(E = l.touches) != null && E[0] && (L.updateSize(l.touches[0].clientX, l.touches[0].clientY), l.preventDefault());
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
return Re(() => {
|
|
2015
|
+
L.cleanup();
|
|
2016
|
+
}), (l, E) => v.value ? (V(), P("div", da, [
|
|
2017
|
+
$(r).isDay ? x("", !0) : (V(), P("div", va, [
|
|
2018
|
+
(V(!0), P(de, null, we(A.value, (F, m) => (V(), P("div", {
|
|
2019
|
+
class: pe(["vuecal__weekday", { "vuecal__weekday--today": F.isToday }]),
|
|
2020
|
+
key: m,
|
|
2021
|
+
onClick: (i) => Z.click(F.date)
|
|
2022
|
+
}, [
|
|
2023
|
+
j(l.$slots, "weekday-heading", {
|
|
2024
|
+
label: F[W.value],
|
|
2025
|
+
id: F.id,
|
|
2026
|
+
date: F.date
|
|
2027
|
+
}, () => [
|
|
2028
|
+
he("span", ma, ce(F[W.value]), 1),
|
|
2029
|
+
$(r).isMonth ? x("", !0) : (V(), P("strong", ga, ce(F.dateNumber), 1))
|
|
2030
|
+
])
|
|
2031
|
+
], 10, fa))), 128))
|
|
2032
|
+
])),
|
|
2033
|
+
$(h).schedules ? (V(), P("div", ha, [
|
|
2034
|
+
(V(!0), P(de, null, we(A.value, (F, m) => (V(), P(de, { key: m }, [
|
|
2035
|
+
(V(!0), P(de, null, we($(h).schedules, (i, S) => (V(), P(de, { key: S }, [
|
|
2036
|
+
l.$slots["schedule-heading"] ? (V(), P("div", {
|
|
2037
|
+
key: 0,
|
|
2038
|
+
class: pe(["vuecal__schedule vuecal__schedule--heading", i.class])
|
|
2039
|
+
}, [
|
|
2040
|
+
j(l.$slots, "schedule-heading", {
|
|
2041
|
+
schedule: i,
|
|
2042
|
+
view: $(r)
|
|
2043
|
+
})
|
|
2044
|
+
], 2)) : (V(), P("div", {
|
|
2045
|
+
key: 1,
|
|
2046
|
+
class: pe(["vuecal__schedule vuecal__schedule--heading", i.class]),
|
|
2047
|
+
innerHTML: i.label
|
|
2048
|
+
}, null, 10, ya))
|
|
2049
|
+
], 64))), 128))
|
|
2050
|
+
], 64))), 128))
|
|
2051
|
+
])) : x("", !0),
|
|
2052
|
+
$(h).allDayEvents ? (V(), P("div", Da, [
|
|
2053
|
+
(V(!0), P(de, null, we(A.value, (F, m) => (V(), Se(kt, {
|
|
2054
|
+
class: pe(["vuecal__all-day-cell", { "vuecal__weekday--today": F.isToday }]),
|
|
2055
|
+
key: m,
|
|
2056
|
+
start: F.date,
|
|
2057
|
+
end: new Date(F.date.getTime() + 1440 * 60 * 1e3 - 1),
|
|
2058
|
+
index: m,
|
|
2059
|
+
"all-day": ""
|
|
2060
|
+
}, Ce({ _: 2 }, [
|
|
2061
|
+
l.$slots["event.all-day"] ? {
|
|
2062
|
+
name: "event.all-day",
|
|
2063
|
+
fn: B((i) => [
|
|
2064
|
+
j(l.$slots, "event.all-day", ie({ ref_for: !0 }, i))
|
|
2065
|
+
]),
|
|
2066
|
+
key: "0"
|
|
2067
|
+
} : {
|
|
2068
|
+
name: "event",
|
|
2069
|
+
fn: B((i) => [
|
|
2070
|
+
j(l.$slots, "event", ie({ ref_for: !0 }, i))
|
|
2071
|
+
]),
|
|
2072
|
+
key: "1"
|
|
2073
|
+
}
|
|
2074
|
+
]), 1032, ["class", "start", "end", "index"]))), 128)),
|
|
2075
|
+
he("div", {
|
|
2076
|
+
class: "vuecal__all-day-resizer",
|
|
2077
|
+
onMousedown: E[0] || (E[0] = (...F) => L.handleMouseDown && L.handleMouseDown(...F)),
|
|
2078
|
+
onTouchstart: E[1] || (E[1] = (...F) => L.handleTouchStart && L.handleTouchStart(...F))
|
|
2079
|
+
}, null, 32)
|
|
2080
|
+
])) : x("", !0)
|
|
2081
|
+
])) : x("", !0);
|
|
2082
|
+
}
|
|
2083
|
+
}, wa = { class: "vuecal__time-column" }, _a = {
|
|
2084
|
+
key: 0,
|
|
2085
|
+
class: "vuecal__all-day-label"
|
|
2086
|
+
}, ka = {
|
|
2087
|
+
__name: "time-column",
|
|
2088
|
+
setup(y) {
|
|
2089
|
+
const t = He("vuecal"), { config: d, texts: r } = t, h = b(() => {
|
|
2090
|
+
const C = [];
|
|
2091
|
+
for (let v = d.timeFrom; v < d.timeTo; v += d.timeStep) {
|
|
2092
|
+
const A = v + d.timeStep > d.timeTo, Z = ~~(v / 60), L = v % 60, l = r[v < 720 ? "am" : "pm"];
|
|
2093
|
+
let E = null;
|
|
2094
|
+
A && (E = `calc(var(--vuecal-time-cell-height) * ${(d.timeTo - v) / d.timeStep})`), C.push({
|
|
2095
|
+
minutesSum: v,
|
|
2096
|
+
// The sum of hours + minutes in minutes.
|
|
2097
|
+
hours: Z,
|
|
2098
|
+
minutes: L,
|
|
2099
|
+
formatted12: `${Z % 12 ? Z % 12 : 12}${L ? `:${L.toString().padStart(2, 0)}` : ""}${l}`,
|
|
2100
|
+
formatted24: `${Z.toString().padStart(2, 0)}:${L.toString().padStart(2, 0)}`,
|
|
2101
|
+
height: E
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
return C;
|
|
2105
|
+
});
|
|
2106
|
+
return (C, W) => (V(), P("div", wa, [
|
|
2107
|
+
$(d).allDayEvents ? (V(), P("div", _a, [
|
|
2108
|
+
j(C.$slots, "all-day-label", {}, () => [
|
|
2109
|
+
qe(ce($(t).texts.allDay), 1)
|
|
2110
|
+
])
|
|
2111
|
+
])) : x("", !0),
|
|
2112
|
+
(V(!0), P(de, null, we(h.value, (v, A) => (V(), P("div", {
|
|
2113
|
+
class: "vuecal__time-cell",
|
|
2114
|
+
key: A,
|
|
2115
|
+
style: $e({ height: v.height || null })
|
|
2116
|
+
}, [
|
|
2117
|
+
j(C.$slots, "time-cell", {
|
|
2118
|
+
index: A,
|
|
2119
|
+
minutes: v.minutes,
|
|
2120
|
+
hours: v.hours,
|
|
2121
|
+
minutesSum: v.minutesSum,
|
|
2122
|
+
format12: v.formatted12,
|
|
2123
|
+
format24: v.formatted24
|
|
2124
|
+
}, () => [
|
|
2125
|
+
he("label", null, ce($(d).twelveHour ? v.formatted12 : v.formatted24), 1)
|
|
2126
|
+
])
|
|
2127
|
+
], 4))), 128))
|
|
2128
|
+
]));
|
|
2129
|
+
}
|
|
2130
|
+
}, $a = {
|
|
1801
2131
|
__name: "body",
|
|
1802
|
-
setup(
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
"--vuecal-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
const b = w.formatTime(Ee(L.value, D));
|
|
2132
|
+
setup(y) {
|
|
2133
|
+
const t = He("vuecal"), { view: d, config: r, dateUtils: h, touch: C, eventsManager: W } = t, v = ue(null), A = ue(null), { resizeState: Z } = W, L = b(() => ({
|
|
2134
|
+
"--vuecal-grid-columns": d.cols,
|
|
2135
|
+
"--vuecal-grid-rows": d.rows,
|
|
2136
|
+
"--vuecal-body-max-height": r.time ? `${r.timeCellHeight * (r.timeTo - r.timeFrom) / r.timeStep}px` : null
|
|
2137
|
+
})), l = b(() => {
|
|
2138
|
+
const i = h.formatTime(je(A.value, r));
|
|
1810
2139
|
return {
|
|
1811
|
-
style: { top:
|
|
1812
|
-
time:
|
|
2140
|
+
style: { top: `${A.value}%` },
|
|
2141
|
+
time: i
|
|
1813
2142
|
};
|
|
1814
|
-
}),
|
|
1815
|
-
var
|
|
1816
|
-
if (
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1819
|
-
},
|
|
1820
|
-
|
|
2143
|
+
}), E = (i) => {
|
|
2144
|
+
var z;
|
|
2145
|
+
if (d.isMonth || d.isYear || d.isYears) return;
|
|
2146
|
+
const S = ((z = i.touches) == null ? void 0 : z[0]) || i, { clientX: n, clientY: I } = S, { top: e } = v.value.getBoundingClientRect();
|
|
2147
|
+
A.value = Ke(I - e, v.value), C.isResizingEvent && r.editableEvents.resizeX && (Z.cellEl = m(n, I));
|
|
2148
|
+
}, F = () => {
|
|
2149
|
+
A.value = null;
|
|
2150
|
+
}, m = (i, S) => {
|
|
2151
|
+
const n = document.elementFromPoint(i, S);
|
|
2152
|
+
return console.log(n == null ? void 0 : n.closest(".vuecal__cell")), (n == null ? void 0 : n.closest(".vuecal__cell")) || null;
|
|
1821
2153
|
};
|
|
1822
|
-
return
|
|
1823
|
-
|
|
1824
|
-
}),
|
|
1825
|
-
|
|
1826
|
-
}), (
|
|
2154
|
+
return Ze(() => {
|
|
2155
|
+
v.value.addEventListener("mousemove", E), v.value.addEventListener("touchmove", E), v.value.addEventListener("mouseleave", F), v.value.addEventListener("touchend", F);
|
|
2156
|
+
}), Re(() => {
|
|
2157
|
+
v.value && (v.value.removeEventListener("mousemove", E), v.value.removeEventListener("touchmove", E), v.value.removeEventListener("mouseleave", F), v.value.removeEventListener("touchend", F));
|
|
2158
|
+
}), (i, S) => (V(), P("div", {
|
|
1827
2159
|
class: "vuecal__body",
|
|
1828
2160
|
ref_key: "bodyEl",
|
|
1829
|
-
ref:
|
|
1830
|
-
style:
|
|
2161
|
+
ref: v,
|
|
2162
|
+
style: $e(L.value)
|
|
1831
2163
|
}, [
|
|
1832
|
-
|
|
1833
|
-
default:
|
|
1834
|
-
|
|
2164
|
+
Oe(Ue, { name: "vuecal-shrink" }, {
|
|
2165
|
+
default: B(() => [
|
|
2166
|
+
$(r).timeAtCursor && A.value !== null ? (V(), P("div", {
|
|
1835
2167
|
key: 0,
|
|
1836
2168
|
class: "vuecal__time-at-cursor",
|
|
1837
|
-
style:
|
|
2169
|
+
style: $e(l.value.style)
|
|
1838
2170
|
}, [
|
|
1839
|
-
|
|
1840
|
-
], 4)) :
|
|
2171
|
+
he("label", null, ce(l.value.time), 1)
|
|
2172
|
+
], 4)) : x("", !0)
|
|
1841
2173
|
]),
|
|
1842
2174
|
_: 1
|
|
1843
2175
|
}),
|
|
1844
|
-
(
|
|
1845
|
-
key:
|
|
1846
|
-
start:
|
|
1847
|
-
end:
|
|
1848
|
-
index:
|
|
1849
|
-
},
|
|
1850
|
-
|
|
2176
|
+
(V(!0), P(de, null, we($(d).cellDates, (n, I) => (V(), Se(kt, {
|
|
2177
|
+
key: I,
|
|
2178
|
+
start: n.start,
|
|
2179
|
+
end: n.end,
|
|
2180
|
+
index: I
|
|
2181
|
+
}, Ce({ _: 2 }, [
|
|
2182
|
+
i.$slots.cell ? {
|
|
1851
2183
|
name: "cell",
|
|
1852
|
-
fn:
|
|
1853
|
-
|
|
2184
|
+
fn: B((e) => [
|
|
2185
|
+
j(i.$slots, "cell", ie({ ref_for: !0 }, e))
|
|
1854
2186
|
]),
|
|
1855
2187
|
key: "0"
|
|
1856
2188
|
} : void 0,
|
|
1857
|
-
|
|
2189
|
+
i.$slots["cell-date"] ? {
|
|
1858
2190
|
name: "cell-date",
|
|
1859
|
-
fn:
|
|
1860
|
-
|
|
2191
|
+
fn: B((e) => [
|
|
2192
|
+
j(i.$slots, "cell-date", ie({ ref_for: !0 }, e))
|
|
1861
2193
|
]),
|
|
1862
2194
|
key: "1"
|
|
1863
2195
|
} : void 0,
|
|
1864
|
-
|
|
2196
|
+
i.$slots["cell-content"] ? {
|
|
1865
2197
|
name: "cell-content",
|
|
1866
|
-
fn:
|
|
1867
|
-
|
|
2198
|
+
fn: B((e) => [
|
|
2199
|
+
j(i.$slots, "cell-content", ie({ ref_for: !0 }, e))
|
|
1868
2200
|
]),
|
|
1869
2201
|
key: "2"
|
|
1870
2202
|
} : void 0,
|
|
1871
|
-
|
|
2203
|
+
i.$slots["cell-events"] ? {
|
|
1872
2204
|
name: "cell-events",
|
|
1873
|
-
fn:
|
|
1874
|
-
|
|
2205
|
+
fn: B((e) => [
|
|
2206
|
+
j(i.$slots, "cell-events", ie({ ref_for: !0 }, e))
|
|
1875
2207
|
]),
|
|
1876
2208
|
key: "3"
|
|
1877
|
-
} :
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
2209
|
+
} : void 0,
|
|
2210
|
+
i.$slots[`event.${$(d).id}`] ? {
|
|
2211
|
+
name: `event.${$(d).id}`,
|
|
2212
|
+
fn: B((e) => [
|
|
2213
|
+
j(i.$slots, `event.${$(d).id}`, ie({ ref_for: !0 }, e))
|
|
1881
2214
|
]),
|
|
1882
2215
|
key: "4"
|
|
1883
|
-
} :
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
2216
|
+
} : void 0,
|
|
2217
|
+
i.$slots["event.all-day"] ? {
|
|
2218
|
+
name: "event.all-day",
|
|
2219
|
+
fn: B((e) => [
|
|
2220
|
+
j(i.$slots, "event.all-day", ie({ ref_for: !0 }, e))
|
|
1887
2221
|
]),
|
|
1888
2222
|
key: "5"
|
|
2223
|
+
} : void 0,
|
|
2224
|
+
i.$slots.event ? {
|
|
2225
|
+
name: "event",
|
|
2226
|
+
fn: B((e) => [
|
|
2227
|
+
j(i.$slots, "event", ie({ ref_for: !0 }, e))
|
|
2228
|
+
]),
|
|
2229
|
+
key: "6"
|
|
2230
|
+
} : void 0,
|
|
2231
|
+
i.$slots["event-count"] ? {
|
|
2232
|
+
name: "event-count",
|
|
2233
|
+
fn: B((e) => [
|
|
2234
|
+
j(i.$slots, "event-count", ie({ ref_for: !0 }, e))
|
|
2235
|
+
]),
|
|
2236
|
+
key: "7"
|
|
1889
2237
|
} : void 0
|
|
1890
2238
|
]), 1032, ["start", "end", "index"]))), 128))
|
|
1891
2239
|
], 4));
|
|
1892
2240
|
}
|
|
1893
|
-
},
|
|
2241
|
+
}, ba = ["data-locale"], Ta = { class: "vuecal__scrollable-wrap" }, Ma = {
|
|
1894
2242
|
key: 1,
|
|
1895
2243
|
class: "vuecal__week-numbers"
|
|
1896
|
-
},
|
|
2244
|
+
}, Ea = { class: "vuecal__week-number" }, Ya = { class: "vuecal__body-wrap" }, Ca = {
|
|
1897
2245
|
__name: "index",
|
|
1898
|
-
props:
|
|
2246
|
+
props: Lt,
|
|
1899
2247
|
emits: [
|
|
1900
2248
|
"ready",
|
|
1901
2249
|
"view-change",
|
|
@@ -1906,180 +2254,257 @@ const Ke = (c) => {
|
|
|
1906
2254
|
"event-delete",
|
|
1907
2255
|
"event-created",
|
|
1908
2256
|
"event-dropped",
|
|
1909
|
-
"event-
|
|
2257
|
+
"event-drag-start",
|
|
2258
|
+
"event-drag-end"
|
|
1910
2259
|
],
|
|
1911
|
-
setup(
|
|
1912
|
-
const
|
|
1913
|
-
var
|
|
2260
|
+
setup(y, { expose: t, emit: d }) {
|
|
2261
|
+
const r = y, h = d, C = Tt("vuecal-el"), W = Ht({ props: r, emit: h, attrs: Et(), vuecalEl: C, uid: Mt() }), { config: v, view: A, dateUtils: Z, touch: L } = W, l = b(() => v.time && (A.isDay || A.isDays || A.isWeek)), E = b(() => Array(A.rows).fill().map((n, I) => Z.getWeek(Z.addDays(A.firstCellDate, 7 * I)))), F = b(() => {
|
|
2262
|
+
var n;
|
|
1914
2263
|
return {
|
|
1915
|
-
"vuecal--ready":
|
|
1916
|
-
[`vuecal--${
|
|
1917
|
-
[`vuecal--${
|
|
1918
|
-
"vuecal--date-picker":
|
|
1919
|
-
"vuecal--dark":
|
|
1920
|
-
"vuecal--light": !
|
|
1921
|
-
[`vuecal--${
|
|
1922
|
-
"vuecal--view-has-time":
|
|
1923
|
-
"vuecal--timeless": !
|
|
1924
|
-
"vuecal--dragging-cell":
|
|
1925
|
-
"vuecal--dragging-event":
|
|
1926
|
-
"vuecal--resizing-event":
|
|
1927
|
-
"vuecal--has-schedules": (
|
|
2264
|
+
"vuecal--ready": v.ready,
|
|
2265
|
+
[`vuecal--${v.theme}-theme`]: v.theme,
|
|
2266
|
+
[`vuecal--${v.size}`]: !0,
|
|
2267
|
+
"vuecal--date-picker": v.datePicker,
|
|
2268
|
+
"vuecal--dark": v.dark,
|
|
2269
|
+
"vuecal--light": !v.dark,
|
|
2270
|
+
[`vuecal--${A.id}-view`]: !0,
|
|
2271
|
+
"vuecal--view-has-time": l.value,
|
|
2272
|
+
"vuecal--timeless": !v.time,
|
|
2273
|
+
"vuecal--dragging-cell": L.isDraggingCell,
|
|
2274
|
+
"vuecal--dragging-event": L.isDraggingEvent,
|
|
2275
|
+
"vuecal--resizing-event": L.isResizingEvent,
|
|
2276
|
+
"vuecal--has-schedules": (n = v.schedules) == null ? void 0 : n.length,
|
|
2277
|
+
"vuecal--horizontal": v.horizontal
|
|
1928
2278
|
};
|
|
1929
|
-
}),
|
|
1930
|
-
"--vuecal-time-cell-height":
|
|
1931
|
-
})),
|
|
1932
|
-
var
|
|
2279
|
+
}), m = b(() => ({
|
|
2280
|
+
"--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
|
|
2281
|
+
})), i = b(() => {
|
|
2282
|
+
var n, I;
|
|
1933
2283
|
return {
|
|
1934
|
-
"vuecal__scrollable--row":
|
|
2284
|
+
"vuecal__scrollable--row": l.value || v.weekNumbers && A.isMonth,
|
|
1935
2285
|
// Keep the states inside the Vue transition wrapper for smooth CSS transitions.
|
|
1936
|
-
[`vuecal__scrollable--${
|
|
1937
|
-
"vuecal__scrollable--has-schedules": (
|
|
1938
|
-
"vuecal__scrollable--no-schedules": !((
|
|
2286
|
+
[`vuecal__scrollable--${A.id}-view`]: !0,
|
|
2287
|
+
"vuecal__scrollable--has-schedules": (n = v.schedules) == null ? void 0 : n.length,
|
|
2288
|
+
"vuecal__scrollable--no-schedules": !((I = v.schedules) != null && I.length),
|
|
2289
|
+
"vuecal__scrollable--no-all-day-bar": !v.allDayEvents,
|
|
2290
|
+
"vuecal__scrollable--has-all-day-bar": v.allDayEvents
|
|
1939
2291
|
};
|
|
1940
|
-
})
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
2292
|
+
}), S = (n) => {
|
|
2293
|
+
n.target.closest(".vuecal__cell") && n.preventDefault();
|
|
2294
|
+
};
|
|
2295
|
+
return Ze(async () => {
|
|
2296
|
+
typeof window < "u" && window.hasOwnProperty("ontouchstart") && C.value.addEventListener("contextmenu", S), await Xe(), v.ready = !0, h("ready", { config: v, view: A });
|
|
2297
|
+
}), Re(() => {
|
|
2298
|
+
var n;
|
|
2299
|
+
(n = C == null ? void 0 : C.value) == null || n.removeEventListener("contextmenu", S);
|
|
2300
|
+
}), at("vuecal", W), at("$vuecalEl", C), t({ view: W.view }), (n, I) => (V(), P("div", {
|
|
2301
|
+
class: pe(["vuecal", F.value]),
|
|
1945
2302
|
ref: "vuecal-el",
|
|
1946
|
-
"data-locale":
|
|
1947
|
-
style:
|
|
2303
|
+
"data-locale": n.locale,
|
|
2304
|
+
style: $e(m.value)
|
|
1948
2305
|
}, [
|
|
1949
|
-
|
|
2306
|
+
n.$slots.diy ? j(n.$slots, "diy", {
|
|
1950
2307
|
key: 0,
|
|
1951
|
-
vuecal:
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
Me(wt, null, $e({ _: 2 }, [
|
|
1956
|
-
e.$slots.header ? {
|
|
2308
|
+
vuecal: $(W)
|
|
2309
|
+
}) : (V(), P(de, { key: 1 }, [
|
|
2310
|
+
Oe(Xt, null, Ce({ _: 2 }, [
|
|
2311
|
+
n.$slots.header ? {
|
|
1957
2312
|
name: "header",
|
|
1958
|
-
fn:
|
|
1959
|
-
|
|
2313
|
+
fn: B((e) => [
|
|
2314
|
+
j(n.$slots, "header", se(re(e)))
|
|
1960
2315
|
]),
|
|
1961
2316
|
key: "0"
|
|
1962
2317
|
} : void 0,
|
|
1963
|
-
!
|
|
2318
|
+
!n.$slots.header && n.$slots["previous-button"] ? {
|
|
1964
2319
|
name: "previous-button",
|
|
1965
|
-
fn:
|
|
1966
|
-
|
|
2320
|
+
fn: B((e) => [
|
|
2321
|
+
j(n.$slots, "previous-button", se(re(e)))
|
|
1967
2322
|
]),
|
|
1968
2323
|
key: "1"
|
|
1969
2324
|
} : void 0,
|
|
1970
|
-
!
|
|
2325
|
+
!n.$slots.header && n.$slots["next-button"] ? {
|
|
1971
2326
|
name: "next-button",
|
|
1972
|
-
fn:
|
|
1973
|
-
|
|
2327
|
+
fn: B((e) => [
|
|
2328
|
+
j(n.$slots, "next-button", se(re(e)))
|
|
1974
2329
|
]),
|
|
1975
2330
|
key: "2"
|
|
1976
2331
|
} : void 0,
|
|
1977
|
-
!
|
|
2332
|
+
!n.$slots.header && n.$slots["today-button"] ? {
|
|
1978
2333
|
name: "today-button",
|
|
1979
|
-
fn:
|
|
1980
|
-
|
|
2334
|
+
fn: B((e) => [
|
|
2335
|
+
j(n.$slots, "today-button", se(re(e)))
|
|
1981
2336
|
]),
|
|
1982
2337
|
key: "3"
|
|
1983
2338
|
} : void 0,
|
|
1984
|
-
!
|
|
2339
|
+
!n.$slots.header && n.$slots.title ? {
|
|
1985
2340
|
name: "title",
|
|
1986
|
-
fn:
|
|
1987
|
-
|
|
2341
|
+
fn: B((e) => [
|
|
2342
|
+
j(n.$slots, "title", se(re(e)))
|
|
1988
2343
|
]),
|
|
1989
2344
|
key: "4"
|
|
1990
2345
|
} : void 0,
|
|
1991
|
-
!
|
|
1992
|
-
name: "
|
|
1993
|
-
fn:
|
|
1994
|
-
|
|
2346
|
+
!n.$slots.header && n.$slots["title.day"] ? {
|
|
2347
|
+
name: "title.day",
|
|
2348
|
+
fn: B((e) => [
|
|
2349
|
+
j(n.$slots, "title.day", se(re(e)))
|
|
1995
2350
|
]),
|
|
1996
2351
|
key: "5"
|
|
2352
|
+
} : void 0,
|
|
2353
|
+
!n.$slots.header && n.$slots["title.days"] ? {
|
|
2354
|
+
name: "title.days",
|
|
2355
|
+
fn: B((e) => [
|
|
2356
|
+
j(n.$slots, "title.days", se(re(e)))
|
|
2357
|
+
]),
|
|
2358
|
+
key: "6"
|
|
2359
|
+
} : void 0,
|
|
2360
|
+
!n.$slots.header && n.$slots["title.week"] ? {
|
|
2361
|
+
name: "title.week",
|
|
2362
|
+
fn: B((e) => [
|
|
2363
|
+
j(n.$slots, "title.week", se(re(e)))
|
|
2364
|
+
]),
|
|
2365
|
+
key: "7"
|
|
2366
|
+
} : void 0,
|
|
2367
|
+
!n.$slots.header && n.$slots["title.month"] ? {
|
|
2368
|
+
name: "title.month",
|
|
2369
|
+
fn: B((e) => [
|
|
2370
|
+
j(n.$slots, "title.month", se(re(e)))
|
|
2371
|
+
]),
|
|
2372
|
+
key: "8"
|
|
2373
|
+
} : void 0,
|
|
2374
|
+
!n.$slots.header && n.$slots["title.year"] ? {
|
|
2375
|
+
name: "title.year",
|
|
2376
|
+
fn: B((e) => [
|
|
2377
|
+
j(n.$slots, "title.year", se(re(e)))
|
|
2378
|
+
]),
|
|
2379
|
+
key: "9"
|
|
2380
|
+
} : void 0,
|
|
2381
|
+
!n.$slots.header && n.$slots["title.years"] ? {
|
|
2382
|
+
name: "title.years",
|
|
2383
|
+
fn: B((e) => [
|
|
2384
|
+
j(n.$slots, "title.years", se(re(e)))
|
|
2385
|
+
]),
|
|
2386
|
+
key: "10"
|
|
2387
|
+
} : void 0,
|
|
2388
|
+
!n.$slots.header && n.$slots["schedule-heading"] ? {
|
|
2389
|
+
name: "schedule-heading",
|
|
2390
|
+
fn: B((e) => [
|
|
2391
|
+
j(n.$slots, "schedule-heading", se(re(e)))
|
|
2392
|
+
]),
|
|
2393
|
+
key: "11"
|
|
1997
2394
|
} : void 0
|
|
1998
2395
|
]), 1024),
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
name: `vuecal-slide-fade--${
|
|
2396
|
+
he("div", Ta, [
|
|
2397
|
+
Oe(Ue, {
|
|
2398
|
+
name: `vuecal-slide-fade--${$(A).transitionDirection}`
|
|
2002
2399
|
}, {
|
|
2003
|
-
default:
|
|
2004
|
-
(
|
|
2005
|
-
class:
|
|
2006
|
-
key:
|
|
2400
|
+
default: B(() => [
|
|
2401
|
+
(V(), P("div", {
|
|
2402
|
+
class: pe(["vuecal__scrollable", i.value]),
|
|
2403
|
+
key: $(A).id + $(A).start.getTime()
|
|
2007
2404
|
}, [
|
|
2008
|
-
|
|
2009
|
-
|
|
2405
|
+
l.value ? (V(), Se(ka, { key: 0 }, Ce({ _: 2 }, [
|
|
2406
|
+
n.$slots["time-cell"] ? {
|
|
2010
2407
|
name: "time-cell",
|
|
2011
|
-
fn:
|
|
2012
|
-
|
|
2408
|
+
fn: B((e) => [
|
|
2409
|
+
j(n.$slots, "time-cell", se(re(e)))
|
|
2013
2410
|
]),
|
|
2014
2411
|
key: "0"
|
|
2015
2412
|
} : void 0
|
|
2016
|
-
]), 1024)) :
|
|
2017
|
-
|
|
2018
|
-
(
|
|
2019
|
-
|
|
2020
|
-
|
|
2413
|
+
]), 1024)) : x("", !0),
|
|
2414
|
+
$(v).weekNumbers && $(A).isMonth ? (V(), P("div", Ma, [
|
|
2415
|
+
(V(!0), P(de, null, we(E.value, (e) => (V(), P("div", Ea, [
|
|
2416
|
+
j(n.$slots, "week-number", {}, () => [
|
|
2417
|
+
he("small", null, ce(e), 1)
|
|
2021
2418
|
])
|
|
2022
2419
|
]))), 256))
|
|
2023
|
-
])) :
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2420
|
+
])) : x("", !0),
|
|
2421
|
+
he("div", Ya, [
|
|
2422
|
+
Oe(pa, null, Ce({ _: 2 }, [
|
|
2423
|
+
n.$slots["weekday-heading"] ? {
|
|
2027
2424
|
name: "weekday-heading",
|
|
2028
|
-
fn:
|
|
2029
|
-
|
|
2425
|
+
fn: B((e) => [
|
|
2426
|
+
j(n.$slots, "weekday-heading", se(re(e)))
|
|
2030
2427
|
]),
|
|
2031
2428
|
key: "0"
|
|
2032
2429
|
} : void 0,
|
|
2033
|
-
|
|
2430
|
+
n.$slots["schedule-heading"] ? {
|
|
2034
2431
|
name: "schedule-heading",
|
|
2035
|
-
fn:
|
|
2036
|
-
|
|
2432
|
+
fn: B((e) => [
|
|
2433
|
+
j(n.$slots, "schedule-heading", se(re(e)))
|
|
2037
2434
|
]),
|
|
2038
2435
|
key: "1"
|
|
2436
|
+
} : void 0,
|
|
2437
|
+
n.$slots["event.all-day"] ? {
|
|
2438
|
+
name: "event.all-day",
|
|
2439
|
+
fn: B((e) => [
|
|
2440
|
+
j(n.$slots, "event.all-day", se(re(e)))
|
|
2441
|
+
]),
|
|
2442
|
+
key: "2"
|
|
2443
|
+
} : void 0,
|
|
2444
|
+
n.$slots.event ? {
|
|
2445
|
+
name: "event",
|
|
2446
|
+
fn: B((e) => [
|
|
2447
|
+
j(n.$slots, "event", se(re(e)))
|
|
2448
|
+
]),
|
|
2449
|
+
key: "3"
|
|
2039
2450
|
} : void 0
|
|
2040
2451
|
]), 1024),
|
|
2041
|
-
|
|
2042
|
-
|
|
2452
|
+
Oe($a, null, Ce({ _: 2 }, [
|
|
2453
|
+
n.$slots.cell ? {
|
|
2043
2454
|
name: "cell",
|
|
2044
|
-
fn:
|
|
2045
|
-
|
|
2455
|
+
fn: B((e) => [
|
|
2456
|
+
j(n.$slots, "cell", se(re(e)))
|
|
2046
2457
|
]),
|
|
2047
2458
|
key: "0"
|
|
2048
2459
|
} : void 0,
|
|
2049
|
-
!
|
|
2460
|
+
!n.$slots.cell && n.$slots["cell-date"] ? {
|
|
2050
2461
|
name: "cell-date",
|
|
2051
|
-
fn:
|
|
2052
|
-
|
|
2462
|
+
fn: B((e) => [
|
|
2463
|
+
j(n.$slots, "cell-date", se(re(e)))
|
|
2053
2464
|
]),
|
|
2054
2465
|
key: "1"
|
|
2055
2466
|
} : void 0,
|
|
2056
|
-
!
|
|
2467
|
+
!n.$slots.cell && n.$slots["cell-content"] ? {
|
|
2057
2468
|
name: "cell-content",
|
|
2058
|
-
fn:
|
|
2059
|
-
|
|
2469
|
+
fn: B((e) => [
|
|
2470
|
+
j(n.$slots, "cell-content", se(re(e)))
|
|
2060
2471
|
]),
|
|
2061
2472
|
key: "2"
|
|
2062
2473
|
} : void 0,
|
|
2063
|
-
!
|
|
2474
|
+
!n.$slots.cell && n.$slots["cell-events"] ? {
|
|
2064
2475
|
name: "cell-events",
|
|
2065
|
-
fn:
|
|
2066
|
-
|
|
2476
|
+
fn: B((e) => [
|
|
2477
|
+
j(n.$slots, "cell-events", se(re(e)))
|
|
2067
2478
|
]),
|
|
2068
2479
|
key: "3"
|
|
2069
2480
|
} : void 0,
|
|
2070
|
-
!
|
|
2071
|
-
name: "event",
|
|
2072
|
-
fn:
|
|
2073
|
-
|
|
2481
|
+
!n.$slots.cell && !n.$slots["cell-events"] && n.$slots["event.all-day"] ? {
|
|
2482
|
+
name: "event.all-day",
|
|
2483
|
+
fn: B((e) => [
|
|
2484
|
+
j(n.$slots, "event.all-day", se(re(e)))
|
|
2074
2485
|
]),
|
|
2075
2486
|
key: "4"
|
|
2076
2487
|
} : void 0,
|
|
2077
|
-
!
|
|
2078
|
-
name:
|
|
2079
|
-
fn:
|
|
2080
|
-
|
|
2488
|
+
!n.$slots.cell && !n.$slots["cell-events"] && n.$slots[`event.${$(A).id}`] ? {
|
|
2489
|
+
name: `event.${$(A).id}`,
|
|
2490
|
+
fn: B((e) => [
|
|
2491
|
+
j(n.$slots, `event.${$(A).id}`, se(re(e)))
|
|
2081
2492
|
]),
|
|
2082
2493
|
key: "5"
|
|
2494
|
+
} : void 0,
|
|
2495
|
+
!n.$slots.cell && !n.$slots["cell-events"] && n.$slots.event ? {
|
|
2496
|
+
name: "event",
|
|
2497
|
+
fn: B((e) => [
|
|
2498
|
+
j(n.$slots, "event", se(re(e)))
|
|
2499
|
+
]),
|
|
2500
|
+
key: "6"
|
|
2501
|
+
} : void 0,
|
|
2502
|
+
!n.$slots.cell && n.$slots["event-count"] ? {
|
|
2503
|
+
name: "event-count",
|
|
2504
|
+
fn: B((e) => [
|
|
2505
|
+
j(n.$slots, "event-count", se(re(e)))
|
|
2506
|
+
]),
|
|
2507
|
+
key: "7"
|
|
2083
2508
|
} : void 0
|
|
2084
2509
|
]), 1024)
|
|
2085
2510
|
])
|
|
@@ -2089,63 +2514,63 @@ const Ke = (c) => {
|
|
|
2089
2514
|
}, 8, ["name"])
|
|
2090
2515
|
])
|
|
2091
2516
|
], 64))
|
|
2092
|
-
], 14,
|
|
2517
|
+
], 14, ba));
|
|
2093
2518
|
}
|
|
2094
|
-
},
|
|
2095
|
-
|
|
2519
|
+
}, za = (y) => {
|
|
2520
|
+
Fe.texts = { ...fe.texts, ...y }, Fe.dateUtils.updateTexts(Fe.texts);
|
|
2096
2521
|
}, {
|
|
2097
|
-
addDatePrototypes:
|
|
2098
|
-
removeDatePrototypes:
|
|
2099
|
-
updateTexts:
|
|
2100
|
-
addDays:
|
|
2101
|
-
subtractDays:
|
|
2102
|
-
addHours:
|
|
2103
|
-
subtractHours:
|
|
2104
|
-
addMinutes:
|
|
2105
|
-
subtractMinutes:
|
|
2106
|
-
getWeek:
|
|
2107
|
-
isToday:
|
|
2108
|
-
isSameDate:
|
|
2109
|
-
isInRange:
|
|
2110
|
-
isLeapYear:
|
|
2111
|
-
getPreviousFirstDayOfWeek:
|
|
2112
|
-
stringToDate:
|
|
2113
|
-
dateToMinutes:
|
|
2114
|
-
countDays:
|
|
2115
|
-
datesInSameTimeStep:
|
|
2116
|
-
isValid:
|
|
2117
|
-
formatDate:
|
|
2118
|
-
formatDateLite:
|
|
2119
|
-
formatTime:
|
|
2120
|
-
formatTimeLite:
|
|
2121
|
-
formatMinutes:
|
|
2122
|
-
} =
|
|
2522
|
+
addDatePrototypes: Va,
|
|
2523
|
+
removeDatePrototypes: Oa,
|
|
2524
|
+
updateTexts: ja,
|
|
2525
|
+
addDays: Ha,
|
|
2526
|
+
subtractDays: Pa,
|
|
2527
|
+
addHours: La,
|
|
2528
|
+
subtractHours: Aa,
|
|
2529
|
+
addMinutes: Fa,
|
|
2530
|
+
subtractMinutes: Ra,
|
|
2531
|
+
getWeek: Na,
|
|
2532
|
+
isToday: Ba,
|
|
2533
|
+
isSameDate: Wa,
|
|
2534
|
+
isInRange: Xa,
|
|
2535
|
+
isLeapYear: Ia,
|
|
2536
|
+
getPreviousFirstDayOfWeek: qa,
|
|
2537
|
+
stringToDate: Ga,
|
|
2538
|
+
dateToMinutes: Ua,
|
|
2539
|
+
countDays: Ja,
|
|
2540
|
+
datesInSameTimeStep: Za,
|
|
2541
|
+
isValid: Ka,
|
|
2542
|
+
formatDate: Qa,
|
|
2543
|
+
formatDateLite: xa,
|
|
2544
|
+
formatTime: en,
|
|
2545
|
+
formatTimeLite: tn,
|
|
2546
|
+
formatMinutes: an
|
|
2547
|
+
} = Fe.dateUtils;
|
|
2123
2548
|
export {
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2549
|
+
Ca as VueCal,
|
|
2550
|
+
Va as addDatePrototypes,
|
|
2551
|
+
Ha as addDays,
|
|
2552
|
+
La as addHours,
|
|
2553
|
+
Fa as addMinutes,
|
|
2554
|
+
Ja as countDays,
|
|
2555
|
+
Ua as dateToMinutes,
|
|
2556
|
+
Za as datesInSameTimeStep,
|
|
2557
|
+
Qa as formatDate,
|
|
2558
|
+
xa as formatDateLite,
|
|
2559
|
+
an as formatMinutes,
|
|
2560
|
+
en as formatTime,
|
|
2561
|
+
tn as formatTimeLite,
|
|
2562
|
+
qa as getPreviousFirstDayOfWeek,
|
|
2563
|
+
Na as getWeek,
|
|
2564
|
+
Xa as isInRange,
|
|
2565
|
+
Ia as isLeapYear,
|
|
2566
|
+
Wa as isSameDate,
|
|
2567
|
+
Ba as isToday,
|
|
2568
|
+
Ka as isValidDate,
|
|
2569
|
+
Oa as removeDatePrototypes,
|
|
2570
|
+
Ga as stringToDate,
|
|
2571
|
+
Pa as subtractDays,
|
|
2572
|
+
Aa as subtractHours,
|
|
2573
|
+
Ra as subtractMinutes,
|
|
2574
|
+
ja as updateTexts,
|
|
2575
|
+
za as useLocale
|
|
2151
2576
|
};
|