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