vue-cal 5.0.1-rc.7 → 5.0.1-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-cal.css +1 -1
- package/dist/vue-cal.es.js +1023 -1045
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +1 -1
package/dist/vue-cal.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as T, reactive as $e, watch as me, toRefs as rt, ref as
|
|
2
|
-
import
|
|
1
|
+
import { computed as T, reactive as $e, watch as me, toRefs as rt, ref as ie, onBeforeUnmount as Xe, inject as Ne, createElementBlock as j, openBlock as E, renderSlot as F, createCommentVNode as Z, unref as O, Fragment as te, renderList as we, normalizeClass as _e, createElementVNode as ge, createVNode as Oe, Transition as Ge, withCtx as J, createBlock as Se, resolveDynamicComponent as Ke, mergeProps as De, toHandlers as Ie, normalizeProps as ne, guardReactiveProps as se, toDisplayString as le, onMounted as Ze, withModifiers as Qe, nextTick as Ue, normalizeStyle as Te, createTextVNode as xe, TransitionGroup as et, createSlots as je, useTemplateRef as ot, useId as it, useAttrs as ut, provide as ct } from "vue";
|
|
2
|
+
import nt from "./i18n/en-us.json";
|
|
3
3
|
/**
|
|
4
|
-
* vue-cal v5.0.1-rc.
|
|
4
|
+
* vue-cal v5.0.1-rc.9
|
|
5
5
|
* (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
@@ -34,301 +34,305 @@ const fe = {
|
|
|
34
34
|
years: { cols: 5, rows: 5 }
|
|
35
35
|
// Arbitrary range of quarters of century (25y).
|
|
36
36
|
}
|
|
37
|
-
}, dt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], vt = Re.reduce((
|
|
38
|
-
const { dateUtils:
|
|
39
|
-
if (W.value[
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}), H = T(() => s.sm && !s.xs), m = T(() => s.xs || s.datePicker), C = T(() => s.clickToNavigate || s.datePicker && s.clickToNavigate !== !1), i = T(() => {
|
|
47
|
-
const l = {
|
|
37
|
+
}, dt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], vt = Re.reduce((D, n, r) => (D[n] = r || 7, D), {}), mt = (D, n, r) => {
|
|
38
|
+
const { dateUtils: g } = D, p = !1, b = T(() => {
|
|
39
|
+
if (W.value[n.view]) return n.view;
|
|
40
|
+
const s = n.datePicker ? "month" : "week", l = n.view || s;
|
|
41
|
+
return W.value[l] ? l : (console.warn(
|
|
42
|
+
`Vue Cal: the provided or default view \`${l}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(W.value)[0]}\`.`
|
|
43
|
+
), Object.keys(W.value)[0]);
|
|
44
|
+
}), L = T(() => n.sm && !n.xs), v = T(() => n.xs || n.datePicker), C = T(() => n.clickToNavigate || n.datePicker && n.clickToNavigate !== !1), o = T(() => {
|
|
45
|
+
const s = {
|
|
48
46
|
cell: {},
|
|
49
47
|
// All possible event listeners to attach to cells.
|
|
50
48
|
event: {}
|
|
51
49
|
// All possible event listeners to attach to calendar events.
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
const [
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
}, l = (k) => k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
51
|
+
for (const [k, t] of Object.entries(r)) {
|
|
52
|
+
const [V, H, U] = k.match(/^on(Cell|Event)(.+)$/) || [];
|
|
53
|
+
V && (s[H.toLowerCase()][l(U).replace(/^-+|-+$/g, "")] = t);
|
|
54
|
+
}
|
|
55
|
+
return s;
|
|
56
|
+
}), m = T(() => {
|
|
57
|
+
var l;
|
|
58
|
+
const s = {};
|
|
59
|
+
return n.hideWeekends && (s[6] = !0) && (s[7] = !0), (l = n.hideWeekdays) != null && l.length && n.hideWeekdays.forEach((k) => s[vt[k]] = !0), s;
|
|
60
|
+
}), $ = T(() => n.hideWeekends || m.value[6] && m.value[7]), W = T(() => {
|
|
61
|
+
const s = n.datePicker;
|
|
62
|
+
let l = 0, k = {};
|
|
63
|
+
const t = n.views;
|
|
64
|
+
return s && !t ? {
|
|
66
65
|
month: { ...fe.availableViews.month },
|
|
67
66
|
year: { ...fe.availableViews.year },
|
|
68
67
|
years: { ...fe.availableViews.years }
|
|
69
|
-
} : (t ? (Array.isArray(t) ?
|
|
70
|
-
const { cols:
|
|
71
|
-
return
|
|
72
|
-
}, {})),
|
|
73
|
-
}), G = T(() =>
|
|
74
|
-
if (typeof
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
l.push(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
} : (t ? (Array.isArray(t) ? k = t.reduce((V, H) => (typeof H == "string" && fe.availableViews[H] ? V[H] = fe.availableViews[H] : l++, V), {}) : typeof t == "object" && (k = Object.entries(t).reduce((V, [H, U]) => {
|
|
69
|
+
const { cols: K, rows: ue } = fe.availableViews[H];
|
|
70
|
+
return V[H] = { cols: U.cols || K, rows: U.rows || ue }, V;
|
|
71
|
+
}, {})), l && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(k).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), k = { ...fe.availableViews })) : k = { ...fe.availableViews }, k);
|
|
72
|
+
}), G = T(() => n.datePicker ? "month" : W.value.week ? "week" : Object.keys(W.value)[0]), i = T(() => {
|
|
73
|
+
if (typeof n.selectedDate == "string") return g.stringToDate(n.selectedDate);
|
|
74
|
+
if (n.selectedDate instanceof Date) return n.selectedDate;
|
|
75
|
+
n.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", n.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
|
|
76
|
+
}), u = T(() => {
|
|
77
|
+
if (!n.disableDays) return [];
|
|
78
|
+
const s = [];
|
|
79
|
+
if (Array.isArray(n.disableDays))
|
|
80
|
+
for (let l of n.disableDays) {
|
|
81
|
+
let k = l;
|
|
82
|
+
typeof l == "string" ? k = g.stringToDate(l) : l instanceof Date && (l = g.formatDate(l, "YYYY-MM-DD")), k instanceof Date && !isNaN(k.getTime()) ? s.push(l) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", l);
|
|
83
|
+
}
|
|
84
|
+
else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", n.disableDays);
|
|
85
|
+
return s;
|
|
87
86
|
}), e = T(() => {
|
|
88
|
-
let
|
|
89
|
-
return
|
|
90
|
-
}),
|
|
91
|
-
let
|
|
92
|
-
return
|
|
87
|
+
let s = null;
|
|
88
|
+
return n.minDate && typeof n.minDate == "string" ? s = g.stringToDate(n.minDate) : n.minDate && n.minDate instanceof Date && (s = n.minDate), (s == null ? void 0 : s.getTime()) || null;
|
|
89
|
+
}), d = T(() => {
|
|
90
|
+
let s = null;
|
|
91
|
+
return n.maxDate && typeof n.maxDate == "string" ? s = g.stringToDate(n.maxDate) : n.maxDate && n.maxDate instanceof Date && (s = n.maxDate), (s == null ? void 0 : s.getTime()) || null;
|
|
93
92
|
}), h = T(() => {
|
|
94
|
-
var
|
|
95
|
-
const { view:
|
|
96
|
-
return
|
|
97
|
-
}),
|
|
98
|
-
const
|
|
93
|
+
var k;
|
|
94
|
+
const { view: s } = D;
|
|
95
|
+
return n.schedules.length && (s.isDay || s.isDays || s.isWeek) && ((k = n.schedules) == null ? void 0 : k.map((t, V) => ({ ...t, id: t.id ?? V + 1 }))) || void 0;
|
|
96
|
+
}), Y = T(() => {
|
|
97
|
+
const s = {
|
|
99
98
|
drag: !0,
|
|
100
99
|
resize: !0,
|
|
101
100
|
delete: !0,
|
|
102
101
|
create: !0
|
|
103
102
|
};
|
|
104
|
-
return
|
|
105
|
-
}),
|
|
106
|
-
var
|
|
107
|
-
let
|
|
103
|
+
return n.editableEvents === !0 ? s : n.editableEvents === !1 ? Object.keys(s).map((l) => s[l] = !1) : { ...s, ...n.editableEvents };
|
|
104
|
+
}), P = async (s) => {
|
|
105
|
+
var k;
|
|
106
|
+
let l = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.json").then((t) => t.default), "../i18n/bg.json": () => import("./i18n/bg.json").then((t) => t.default), "../i18n/bn.json": () => import("./i18n/bn.json").then((t) => t.default), "../i18n/bs.json": () => import("./i18n/bs.json").then((t) => t.default), "../i18n/ca.json": () => import("./i18n/ca.json").then((t) => t.default), "../i18n/cs.json": () => import("./i18n/cs.json").then((t) => t.default), "../i18n/da.json": () => import("./i18n/da.json").then((t) => t.default), "../i18n/de.json": () => import("./i18n/de.json").then((t) => t.default), "../i18n/el.json": () => import("./i18n/el.json").then((t) => t.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.json").then((t) => t.default), "../i18n/en-us.json": () => import("./i18n/en-us.json").then((t) => t.default), "../i18n/es.json": () => import("./i18n/es.json").then((t) => t.default), "../i18n/et.json": () => import("./i18n/et.json").then((t) => t.default), "../i18n/fa.json": () => import("./i18n/fa.json").then((t) => t.default), "../i18n/fi.json": () => import("./i18n/fi.json").then((t) => t.default), "../i18n/fr.json": () => import("./i18n/fr.json").then((t) => t.default), "../i18n/he.json": () => import("./i18n/he.json").then((t) => t.default), "../i18n/hr.json": () => import("./i18n/hr.json").then((t) => t.default), "../i18n/hu.json": () => import("./i18n/hu.json").then((t) => t.default), "../i18n/id.json": () => import("./i18n/id.json").then((t) => t.default), "../i18n/is.json": () => import("./i18n/is.json").then((t) => t.default), "../i18n/it.json": () => import("./i18n/it.json").then((t) => t.default), "../i18n/ja.json": () => import("./i18n/ja.json").then((t) => t.default), "../i18n/ka.json": () => import("./i18n/ka.json").then((t) => t.default), "../i18n/ko.json": () => import("./i18n/ko.json").then((t) => t.default), "../i18n/lt.json": () => import("./i18n/lt.json").then((t) => t.default), "../i18n/mn.json": () => import("./i18n/mn.json").then((t) => t.default), "../i18n/nl.json": () => import("./i18n/nl.json").then((t) => t.default), "../i18n/no.json": () => import("./i18n/no.json").then((t) => t.default), "../i18n/pl.json": () => import("./i18n/pl.json").then((t) => t.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.json").then((t) => t.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.json").then((t) => t.default), "../i18n/ro.json": () => import("./i18n/ro.json").then((t) => t.default), "../i18n/ru.json": () => import("./i18n/ru.json").then((t) => t.default), "../i18n/sk.json": () => import("./i18n/sk.json").then((t) => t.default), "../i18n/sl.json": () => import("./i18n/sl.json").then((t) => t.default), "../i18n/sq.json": () => import("./i18n/sq.json").then((t) => t.default), "../i18n/sr.json": () => import("./i18n/sr.json").then((t) => t.default), "../i18n/sv.json": () => import("./i18n/sv.json").then((t) => t.default), "../i18n/tr.json": () => import("./i18n/tr.json").then((t) => t.default), "../i18n/uk.json": () => import("./i18n/uk.json").then((t) => t.default), "../i18n/vi.json": () => import("./i18n/vi.json").then((t) => t.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.json").then((t) => t.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.json").then((t) => t.default) });
|
|
108
107
|
{
|
|
109
|
-
if (!
|
|
110
|
-
console.warn(`Vue Cal: the locale \`${
|
|
108
|
+
if (!l[`../i18n/${s}.json`]) {
|
|
109
|
+
console.warn(`Vue Cal: the locale \`${s}\` does not exist. Falling back to \`en-us\`.`), s = "en-us";
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
|
-
|
|
112
|
+
l = await ((k = l[`../i18n/${s}.json`]) == null ? void 0 : k.call(l));
|
|
114
113
|
}
|
|
115
|
-
|
|
116
|
-
}, A = $e(
|
|
117
|
-
return me(() =>
|
|
118
|
-
...rt(
|
|
114
|
+
D.texts = Object.assign(D.texts, Object.assign({ ...fe.texts }, l)), g.updateTexts(D.texts);
|
|
115
|
+
}, A = $e(n.events || []);
|
|
116
|
+
return me(() => n.events, (s) => A.splice(0, A.length, ...s)), me(() => n.locale, (s) => P(s || "en-us")), (n.locale || !D.texts.today) && P(n.locale || "en-us"), {
|
|
117
|
+
...rt(n),
|
|
119
118
|
events: A,
|
|
120
119
|
// All the events listeners for cells and events that the end user may have attached to vue-cal.
|
|
121
|
-
eventListeners:
|
|
120
|
+
eventListeners: o,
|
|
122
121
|
defaultView: G,
|
|
123
122
|
availableViews: W,
|
|
124
|
-
disableDays:
|
|
125
|
-
ready:
|
|
126
|
-
sm:
|
|
127
|
-
xs:
|
|
123
|
+
disableDays: u,
|
|
124
|
+
ready: p,
|
|
125
|
+
sm: L,
|
|
126
|
+
xs: v,
|
|
128
127
|
clickToNavigate: C,
|
|
129
|
-
hideWeekdays:
|
|
128
|
+
hideWeekdays: m,
|
|
130
129
|
hideWeekends: $,
|
|
131
130
|
minTimestamp: e,
|
|
132
|
-
maxTimestamp:
|
|
131
|
+
maxTimestamp: d,
|
|
133
132
|
schedules: h,
|
|
134
|
-
selectedDate:
|
|
135
|
-
editableEvents:
|
|
133
|
+
selectedDate: i,
|
|
134
|
+
editableEvents: Y,
|
|
136
135
|
view: b,
|
|
137
136
|
// Getters.
|
|
138
137
|
get hasHiddenDays() {
|
|
139
|
-
return Object.keys(
|
|
138
|
+
return Object.keys(m.value).length;
|
|
140
139
|
},
|
|
141
140
|
get size() {
|
|
142
|
-
return
|
|
141
|
+
return v.value ? "xs" : L.value ? "sm" : "lg";
|
|
143
142
|
},
|
|
144
|
-
loadTexts:
|
|
143
|
+
loadTexts: P
|
|
145
144
|
};
|
|
146
|
-
}, Ve = (
|
|
147
|
-
const r =
|
|
148
|
-
return (
|
|
149
|
-
}, Pe = (
|
|
150
|
-
const r =
|
|
151
|
-
return ~~(
|
|
152
|
-
}, Je = (
|
|
153
|
-
const r =
|
|
154
|
-
return
|
|
145
|
+
}, Ve = (D, n) => {
|
|
146
|
+
const r = n.timeTo - n.timeFrom;
|
|
147
|
+
return (D - n.timeFrom) * 100 / r;
|
|
148
|
+
}, Pe = (D, n) => {
|
|
149
|
+
const r = n.timeTo - n.timeFrom;
|
|
150
|
+
return ~~(D * r / 100 + n.timeFrom);
|
|
151
|
+
}, Je = (D, n) => {
|
|
152
|
+
const r = n.clientHeight;
|
|
153
|
+
return D * 100 / r;
|
|
155
154
|
}, Ae = $e({ id: null, date: null });
|
|
156
155
|
let tt = !1, qe = !0;
|
|
157
|
-
const
|
|
156
|
+
const pe = $e({ el: null, cell: null, timeout: null }), be = $e({
|
|
158
157
|
eventId: null,
|
|
159
158
|
fromVueCal: null,
|
|
160
159
|
toVueCal: null
|
|
161
160
|
});
|
|
162
|
-
function ft(
|
|
163
|
-
const { config:
|
|
164
|
-
var
|
|
165
|
-
const { timeStep:
|
|
166
|
-
return Pe(Je(
|
|
167
|
-
}, C = (e,
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
|
|
161
|
+
function ft(D) {
|
|
162
|
+
const { config: n, view: r, eventsManager: g, emit: p, uid: b, dateUtils: L } = D, v = (e) => {
|
|
163
|
+
var l;
|
|
164
|
+
const { timeStep: d, timeCellHeight: h, timeFrom: Y } = n, P = (((l = e.touches) == null ? void 0 : l[0]) || e).clientY, { top: A } = e.currentTarget.getBoundingClientRect(), s = P - A - ~~e.dataTransfer.getData("cursor-grab-at");
|
|
165
|
+
return Pe(Je(s, e.currentTarget), n);
|
|
166
|
+
}, C = (e, d, h) => {
|
|
167
|
+
const Y = d.duration || o(d.start, d.end) || n.timeStep;
|
|
168
|
+
let P = Math.max(v(e), 0);
|
|
169
|
+
if (n.snapToInterval) {
|
|
170
|
+
const k = P + n.snapToInterval / 2;
|
|
171
|
+
P = k - k % n.snapToInterval;
|
|
173
172
|
}
|
|
174
|
-
const A = new Date(new Date(h).setMinutes(
|
|
175
|
-
return { start: A, end:
|
|
176
|
-
},
|
|
173
|
+
const A = new Date(new Date(h).setMinutes(P)), s = Math.min(P + Y, 24 * 60), l = new Date(new Date(h).setMinutes(s));
|
|
174
|
+
return { start: A, end: l };
|
|
175
|
+
}, o = (e, d) => Math.round((d - e) / 6e4);
|
|
177
176
|
return {
|
|
178
|
-
eventDragStart: (e,
|
|
179
|
-
if (e.target.nodeType === 3 ||
|
|
180
|
-
e.dataTransfer.dropEffect = "move";
|
|
181
|
-
const h = { ...
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
177
|
+
eventDragStart: (e, d) => {
|
|
178
|
+
if (e.target.nodeType === 3 || D.touch.isResizingEvent) return e.preventDefault();
|
|
179
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move";
|
|
180
|
+
const h = { ...d, _: { id: d._.id, duration: o(d.start, d.end) } };
|
|
181
|
+
try {
|
|
182
|
+
e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(h)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
|
|
183
|
+
} catch (P) {
|
|
184
|
+
return console.warn("Vue Cal: Failed to set drag data:", P), e.preventDefault();
|
|
185
|
+
}
|
|
186
|
+
be.eventId = d._.id, be.fromVueCal = b;
|
|
187
|
+
const Y = e.target.closest(".vuecal__event");
|
|
188
|
+
Y.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
|
|
189
|
+
Y.classList.add("vuecal__event--dragging-original"), Y.classList.remove("vuecal__event--dragging-ghost");
|
|
190
|
+
}, 0), tt = !1, Object.assign(Ae, { id: r.id, date: r.firstCellDate }), qe = !0, D.touch.isDraggingEvent = !0;
|
|
187
191
|
},
|
|
188
|
-
eventDragEnd: (e,
|
|
192
|
+
eventDragEnd: (e, d) => {
|
|
189
193
|
be.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
|
|
190
|
-
const { fromVueCal: h, toVueCal:
|
|
191
|
-
|
|
194
|
+
const { fromVueCal: h, toVueCal: Y } = be;
|
|
195
|
+
Y && h !== Y && g.deleteEvent(d._.id, 3), be.fromVueCal = null, be.toVueCal = null, tt && qe && Ae.id && r.switchView(Ae.id, Ae.date, !0), D.touch.isDraggingEvent = !1;
|
|
192
196
|
},
|
|
193
|
-
cellDragEnter: (e,
|
|
194
|
-
const { start: h } =
|
|
197
|
+
cellDragEnter: (e, d) => {
|
|
198
|
+
const { start: h } = d, Y = e.currentTarget;
|
|
195
199
|
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
196
|
-
if (
|
|
197
|
-
|
|
200
|
+
if (Y === pe.el || !Y.className.includes("vuecal__cell-content")) return !1;
|
|
201
|
+
pe.el && (pe.cell.highlighted = !1), Object.assign(pe, { el: Y, cell: d, timeout: clearTimeout(pe.timeout) }), d.highlighted = !0, ["years", "year", "month"].includes(r.id) && (pe.timeout = setTimeout(() => D.switchToNarrowerView(h), 2e3));
|
|
198
202
|
}
|
|
199
203
|
},
|
|
200
|
-
cellDragOver: (e,
|
|
201
|
-
const { start: h, schedule:
|
|
202
|
-
e.preventDefault(),
|
|
204
|
+
cellDragOver: (e, d) => {
|
|
205
|
+
const { start: h, schedule: Y } = d;
|
|
206
|
+
e.preventDefault(), d.highlighted = !0, (Y || Y === 0) && (d.highlightedSchedule = Y);
|
|
203
207
|
},
|
|
204
|
-
cellDragLeave: (e,
|
|
205
|
-
e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (
|
|
208
|
+
cellDragLeave: (e, d) => {
|
|
209
|
+
e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (d.highlightedSchedule = !1, pe.cell === d && (clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null }), d.highlighted = !1));
|
|
206
210
|
},
|
|
207
|
-
cellDragDrop: async (e,
|
|
208
|
-
var
|
|
209
|
-
e.preventDefault(), clearTimeout(
|
|
211
|
+
cellDragDrop: async (e, d) => {
|
|
212
|
+
var V, H, U;
|
|
213
|
+
e.preventDefault(), clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null });
|
|
210
214
|
const h = JSON.parse(e.dataTransfer.getData("event") || "{}");
|
|
211
215
|
h.start && (h.start = new Date(h.start)), h.end && (h.end = new Date(h.end));
|
|
212
|
-
let
|
|
213
|
-
const { start:
|
|
214
|
-
let
|
|
216
|
+
let Y;
|
|
217
|
+
const { start: P, end: A } = C(e, h, d.start), { schedule: s } = ((V = e.target.closest("[data-schedule]")) == null ? void 0 : V.dataset) || {};
|
|
218
|
+
let l = () => {
|
|
215
219
|
};
|
|
216
|
-
be.fromVueCal === b ? (
|
|
217
|
-
|
|
218
|
-
})) : (
|
|
220
|
+
be.fromVueCal === b ? (Y = g.getEvent(h._.id), Y && (Y._.dragging = !1, l = () => {
|
|
221
|
+
Y.start = P, Y.end = A, s !== void 0 && (Y.schedule = ~~s);
|
|
222
|
+
})) : (Y = {
|
|
219
223
|
...h,
|
|
220
|
-
start:
|
|
224
|
+
start: P,
|
|
221
225
|
end: A,
|
|
222
|
-
...
|
|
223
|
-
_: { id: ((
|
|
224
|
-
getOverlappingEvents: () =>
|
|
225
|
-
|
|
226
|
-
{ start:
|
|
227
|
-
{ schedule: ~~
|
|
226
|
+
...s !== void 0 && { schedule: ~~s },
|
|
227
|
+
_: { id: ((H = h._) == null ? void 0 : H.id) || h.id, duration: o(P, A) },
|
|
228
|
+
getOverlappingEvents: () => g.getEventsInRange(
|
|
229
|
+
g.getEventsByDate(L.formatDate(P), !0),
|
|
230
|
+
{ start: P, end: A },
|
|
231
|
+
{ schedule: ~~s }
|
|
228
232
|
)
|
|
229
|
-
},
|
|
230
|
-
|
|
233
|
+
}, l = () => {
|
|
234
|
+
Y = g.createEvent(Y);
|
|
231
235
|
});
|
|
232
|
-
let
|
|
233
|
-
const { drop: t } = (
|
|
234
|
-
t && (
|
|
236
|
+
let k = !0;
|
|
237
|
+
const { drop: t } = (U = n.eventListeners) == null ? void 0 : U.event;
|
|
238
|
+
t && (k = await t({
|
|
235
239
|
e,
|
|
236
|
-
event: { ...
|
|
237
|
-
overlaps:
|
|
238
|
-
cell:
|
|
240
|
+
event: { ...Y, start: P, end: A, schedule: ~~s },
|
|
241
|
+
overlaps: Y.getOverlappingEvents({ start: P, end: A, schedule: ~~s }),
|
|
242
|
+
cell: d,
|
|
239
243
|
external: be.fromVueCal !== b
|
|
240
|
-
})),
|
|
244
|
+
})), k !== !1 && l(), d.highlighted = !1, d.highlightedSchedule = null, qe = !1, be.toVueCal = b, p("event-dropped", {
|
|
241
245
|
e,
|
|
242
|
-
cell:
|
|
243
|
-
event:
|
|
246
|
+
cell: d,
|
|
247
|
+
event: Y,
|
|
244
248
|
originalEvent: h,
|
|
245
249
|
external: be.fromVueCal !== b
|
|
246
250
|
});
|
|
247
251
|
}
|
|
248
252
|
};
|
|
249
253
|
}
|
|
250
|
-
const
|
|
251
|
-
let r,
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
+
const st = (D, n) => {
|
|
255
|
+
let r, g, p, b = {}, L = {};
|
|
256
|
+
const v = ie(D), C = () => {
|
|
257
|
+
v.value.today || (v.value = n), Date.prototype.addDays = function(a) {
|
|
254
258
|
return W(this, a || 0);
|
|
255
259
|
}, Date.prototype.subtractDays = function(a) {
|
|
256
260
|
return G(this, a || 0);
|
|
257
261
|
}, Date.prototype.addHours = function(a) {
|
|
258
|
-
return
|
|
262
|
+
return i(this, a || 0);
|
|
259
263
|
}, Date.prototype.subtractHours = function(a) {
|
|
260
|
-
return
|
|
264
|
+
return u(this, a || 0);
|
|
261
265
|
}, Date.prototype.addMinutes = function(a) {
|
|
262
266
|
return e(this, a || 0);
|
|
263
267
|
}, Date.prototype.subtractMinutes = function(a) {
|
|
264
|
-
return
|
|
268
|
+
return d(this, a || 0);
|
|
265
269
|
}, Date.prototype.getWeek = function() {
|
|
266
|
-
return
|
|
270
|
+
return Y(this);
|
|
267
271
|
}, Date.prototype.isToday = function() {
|
|
268
|
-
return
|
|
272
|
+
return P(this);
|
|
269
273
|
}, Date.prototype.isLeapYear = function() {
|
|
270
|
-
return
|
|
274
|
+
return l(this);
|
|
271
275
|
}, Date.prototype.format = function(a = "YYYY-MM-DD") {
|
|
272
276
|
return ue(this, a);
|
|
273
277
|
}, Date.prototype.formatTime = function(a = "HH:mm") {
|
|
274
278
|
return re(this, a);
|
|
275
279
|
};
|
|
276
|
-
},
|
|
280
|
+
}, o = () => {
|
|
277
281
|
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;
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
}, $ = () => (
|
|
282
|
+
}, m = (a) => {
|
|
283
|
+
v.value = a, Date.prototype.subtractDays && C();
|
|
284
|
+
}, $ = () => (g !== (/* @__PURE__ */ new Date()).getDate() && (r = /* @__PURE__ */ new Date(), g = r.getDate(), p = `${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`), p), W = (a, _) => {
|
|
281
285
|
const y = new Date(a.valueOf());
|
|
282
|
-
return y.setDate(y.getDate() +
|
|
283
|
-
}, G = (a,
|
|
286
|
+
return y.setDate(y.getDate() + _), y;
|
|
287
|
+
}, G = (a, _) => {
|
|
284
288
|
const y = new Date(a.valueOf());
|
|
285
|
-
return y.setDate(y.getDate() -
|
|
286
|
-
},
|
|
289
|
+
return y.setDate(y.getDate() - _), y;
|
|
290
|
+
}, i = (a, _) => {
|
|
287
291
|
const y = new Date(a.valueOf());
|
|
288
|
-
return y.setHours(y.getHours() +
|
|
289
|
-
},
|
|
292
|
+
return y.setHours(y.getHours() + _), y;
|
|
293
|
+
}, u = (a, _) => {
|
|
290
294
|
const y = new Date(a.valueOf());
|
|
291
|
-
return y.setHours(y.getHours() -
|
|
292
|
-
}, e = (a,
|
|
295
|
+
return y.setHours(y.getHours() - _), y;
|
|
296
|
+
}, e = (a, _) => {
|
|
293
297
|
const y = new Date(a.valueOf());
|
|
294
|
-
return y.setMinutes(y.getMinutes() +
|
|
295
|
-
},
|
|
298
|
+
return y.setMinutes(y.getMinutes() + _), y;
|
|
299
|
+
}, d = (a, _) => {
|
|
296
300
|
const y = new Date(a.valueOf());
|
|
297
|
-
return y.setMinutes(y.getMinutes() -
|
|
298
|
-
}, h = (a,
|
|
301
|
+
return y.setMinutes(y.getMinutes() - _), y;
|
|
302
|
+
}, h = (a, _) => {
|
|
299
303
|
const y = (B) => {
|
|
300
|
-
const Q = B %
|
|
301
|
-
return Q !== 0 && (B += Q >=
|
|
304
|
+
const Q = B % _;
|
|
305
|
+
return Q !== 0 && (B += Q >= _ / 2 ? _ - Q : -Q), B;
|
|
302
306
|
};
|
|
303
307
|
if (typeof a == "number") return y(a);
|
|
304
308
|
if (a instanceof Date) {
|
|
305
309
|
let B = y(a.getMinutes());
|
|
306
310
|
B >= 60 && (a.setHours(a.getHours() + 1), B = 0), a.setMinutes(B, 0, 0);
|
|
307
311
|
}
|
|
308
|
-
},
|
|
312
|
+
}, Y = (a, _ = !1) => {
|
|
309
313
|
const y = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())), B = y.getUTCDay() || 7;
|
|
310
314
|
y.setUTCDate(y.getUTCDate() + 4 - B);
|
|
311
315
|
const Q = new Date(Date.UTC(y.getUTCFullYear(), 0, 1));
|
|
312
|
-
return Math.ceil(((y - Q) / 864e5 + 1) / 7) + (
|
|
313
|
-
},
|
|
314
|
-
if (!a || !
|
|
315
|
-
if (
|
|
316
|
-
if (!
|
|
316
|
+
return Math.ceil(((y - Q) / 864e5 + 1) / 7) + (_ ? 1 : 0);
|
|
317
|
+
}, P = (a) => `${a.getFullYear()}-${a.getMonth()}-${a.getDate()}` === $(), A = (a, _) => {
|
|
318
|
+
if (!a || !_) return console.warn(`Vue Cal: missing date${a ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
|
|
319
|
+
if (K(a)) {
|
|
320
|
+
if (!K(_)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${_}\`.`);
|
|
317
321
|
} else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${a}\`.`);
|
|
318
|
-
return a.getFullYear() ===
|
|
319
|
-
},
|
|
320
|
-
const
|
|
321
|
-
return !(
|
|
322
|
-
},
|
|
323
|
-
const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), B =
|
|
322
|
+
return a.getFullYear() === _.getFullYear() && a.getMonth() === _.getMonth() && a.getDate() === _.getDate();
|
|
323
|
+
}, s = (a, _, y) => K(a) ? a.getTime() >= _ && a.getTime() <= y : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${a}\`.`), l = (a) => {
|
|
324
|
+
const _ = a.getFullYear();
|
|
325
|
+
return !(_ % 400) || _ % 100 && !(_ % 4);
|
|
326
|
+
}, k = (a = null, _) => {
|
|
327
|
+
const y = a && new Date(a.valueOf()) || /* @__PURE__ */ new Date(), B = _ ? 7 : 6;
|
|
324
328
|
return y.setDate(y.getDate() - (y.getDay() + B) % 7), y;
|
|
325
|
-
}, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))),
|
|
326
|
-
typeof a == "string" && (a = a.replace(/-/g, "/")), typeof
|
|
327
|
-
const y = (new Date(
|
|
328
|
-
return Math.ceil((
|
|
329
|
-
},
|
|
330
|
-
if (y || (y =
|
|
331
|
-
b = {},
|
|
329
|
+
}, t = (a) => a instanceof Date ? a : (a.length === 10 && (a += " 00:00"), new Date(a.replace(/-/g, "/"))), V = (a) => a.getHours() * 60 + a.getMinutes(), H = (a, _) => {
|
|
330
|
+
typeof a == "string" && (a = a.replace(/-/g, "/")), typeof _ == "string" && (_ = _.replace(/-/g, "/")), a = new Date(a).setHours(0, 0, 0, 0), _ = new Date(_).setHours(0, 0, 1, 0);
|
|
331
|
+
const y = (new Date(_).getTimezoneOffset() - new Date(a).getTimezoneOffset()) * 60 * 1e3;
|
|
332
|
+
return Math.ceil((_ - a - y) / (24 * 3600 * 1e3));
|
|
333
|
+
}, U = (a, _, y) => Math.abs(a.getTime() - _.getTime()) <= y * 60 * 1e3, K = (a) => a && a instanceof Date && !isNaN(a), ue = (a, _ = "YYYY-MM-DD", y = null) => {
|
|
334
|
+
if (y || (y = v.value), _ || (_ = "YYYY-MM-DD"), _ === "YYYY-MM-DD") return ae(a);
|
|
335
|
+
b = {}, L = {};
|
|
332
336
|
const B = {
|
|
333
337
|
YYYY: () => ee(a, y).YYYY,
|
|
334
338
|
YY: () => ee(a, y).YY(),
|
|
@@ -344,42 +348,42 @@ const nt = (u, s) => {
|
|
|
344
348
|
dd: () => ee(a, y).dd(),
|
|
345
349
|
ddd: () => ee(a, y).ddd(),
|
|
346
350
|
dddd: () => ee(a, y).dddd(),
|
|
347
|
-
HH: () =>
|
|
348
|
-
H: () =>
|
|
349
|
-
hh: () =>
|
|
350
|
-
h: () =>
|
|
351
|
-
am: () =>
|
|
352
|
-
AM: () =>
|
|
353
|
-
mm: () =>
|
|
354
|
-
m: () =>
|
|
355
|
-
s: () =>
|
|
351
|
+
HH: () => oe(a, y).HH,
|
|
352
|
+
H: () => oe(a, y).H,
|
|
353
|
+
hh: () => oe(a, y).hh,
|
|
354
|
+
h: () => oe(a, y).h,
|
|
355
|
+
am: () => oe(a, y).am,
|
|
356
|
+
AM: () => oe(a, y).AM,
|
|
357
|
+
mm: () => oe(a, y).mm,
|
|
358
|
+
m: () => oe(a, y).m,
|
|
359
|
+
s: () => oe(a, y).s
|
|
356
360
|
};
|
|
357
|
-
return
|
|
358
|
-
const
|
|
359
|
-
return
|
|
361
|
+
return _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (Q, c) => {
|
|
362
|
+
const w = B[c.replace(/\{|\}/g, "")];
|
|
363
|
+
return w !== void 0 ? w() : c;
|
|
360
364
|
});
|
|
361
365
|
}, ae = (a) => {
|
|
362
|
-
const
|
|
363
|
-
return `${a.getFullYear()}-${
|
|
364
|
-
}, re = (a,
|
|
366
|
+
const _ = a.getMonth() + 1, y = a.getDate();
|
|
367
|
+
return `${a.getFullYear()}-${_ < 10 ? "0" : ""}${_}-${y < 10 ? "0" : ""}${y}`;
|
|
368
|
+
}, re = (a, _ = "HH:mm", y = null, B = !1) => {
|
|
365
369
|
let Q = !1;
|
|
366
370
|
if (B) {
|
|
367
|
-
const [
|
|
368
|
-
|
|
371
|
+
const [S, M, N] = [a.getHours(), a.getMinutes(), a.getSeconds()];
|
|
372
|
+
S + M + N === 141 && (Q = !0);
|
|
369
373
|
}
|
|
370
|
-
if (a instanceof Date &&
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
const N =
|
|
374
|
+
if (a instanceof Date && _ === "HH:mm") return Q ? "24:00" : he(a);
|
|
375
|
+
L = {}, y || (y = v.value);
|
|
376
|
+
const c = oe(a, y), w = _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (S, M) => {
|
|
377
|
+
const N = c[M.replace(/\{|\}/g, "")];
|
|
374
378
|
return N !== void 0 ? N : M;
|
|
375
379
|
});
|
|
376
|
-
return Q ?
|
|
380
|
+
return Q ? w.replace("23:59", "24:00") : w;
|
|
377
381
|
}, he = (a) => {
|
|
378
|
-
const
|
|
379
|
-
return `${(
|
|
380
|
-
},
|
|
381
|
-
const
|
|
382
|
-
return `${
|
|
382
|
+
const _ = a.getHours(), y = a.getMinutes();
|
|
383
|
+
return `${(_ < 10 ? "0" : "") + _}:${(y < 10 ? "0" : "") + y}`;
|
|
384
|
+
}, q = (a) => {
|
|
385
|
+
const _ = Math.floor(a / 60).toString().padStart(2, 0), y = (a % 60).toString().padStart(2, 0);
|
|
386
|
+
return `${_}:${y}`;
|
|
383
387
|
}, ce = (a) => {
|
|
384
388
|
if (a > 3 && a < 21) return "th";
|
|
385
389
|
switch (a % 10) {
|
|
@@ -392,9 +396,9 @@ const nt = (u, s) => {
|
|
|
392
396
|
default:
|
|
393
397
|
return "th";
|
|
394
398
|
}
|
|
395
|
-
}, ee = (a,
|
|
399
|
+
}, ee = (a, _) => {
|
|
396
400
|
if (b.D) return b;
|
|
397
|
-
const y = a.getFullYear(), B = a.getMonth() + 1, Q = a.getDate(),
|
|
401
|
+
const y = a.getFullYear(), B = a.getMonth() + 1, Q = a.getDate(), w = (a.getDay() - 1 + 7) % 7;
|
|
398
402
|
return b = {
|
|
399
403
|
// Year.
|
|
400
404
|
YYYY: y,
|
|
@@ -406,11 +410,11 @@ const nt = (u, s) => {
|
|
|
406
410
|
// 1 to 12.
|
|
407
411
|
MM: () => B.toString().padStart(2, 0),
|
|
408
412
|
// 01 to 12.
|
|
409
|
-
MMM: () =>
|
|
413
|
+
MMM: () => _.months[B - 1].substring(0, 3),
|
|
410
414
|
// Jan to Dec.
|
|
411
|
-
MMMM: () =>
|
|
415
|
+
MMMM: () => _.months[B - 1],
|
|
412
416
|
// January to December.
|
|
413
|
-
MMMMG: () => (
|
|
417
|
+
MMMMG: () => (_.monthsGenitive || _.months)[B - 1],
|
|
414
418
|
// January to December in genitive form (Greek...)
|
|
415
419
|
// Day.
|
|
416
420
|
D: Q,
|
|
@@ -420,66 +424,66 @@ const nt = (u, s) => {
|
|
|
420
424
|
S: () => ce(Q),
|
|
421
425
|
// st, nd, rd, th.
|
|
422
426
|
// Day of the week.
|
|
423
|
-
d:
|
|
427
|
+
d: w + 1,
|
|
424
428
|
// 1 to 7 with 7 = Sunday.
|
|
425
429
|
// Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
|
|
426
|
-
dd: () =>
|
|
430
|
+
dd: () => _.weekDaysShort.length ? _.weekDaysShort[w] : _.weekDays[w][0],
|
|
427
431
|
// M to S.
|
|
428
|
-
ddd: () =>
|
|
432
|
+
ddd: () => _.weekDaysShort.length ? _.weekDaysShort[w] : _.weekDays[w].substr(0, 3),
|
|
429
433
|
// Mon to Sun.
|
|
430
|
-
dddd: () =>
|
|
434
|
+
dddd: () => _.weekDays[w]
|
|
431
435
|
// Monday to Sunday.
|
|
432
436
|
}, b;
|
|
433
|
-
},
|
|
434
|
-
if (
|
|
437
|
+
}, oe = (a, _) => {
|
|
438
|
+
if (L.am) return L;
|
|
435
439
|
let y, B, Q;
|
|
436
440
|
a instanceof Date ? (y = a.getHours(), B = a.getMinutes(), Q = a.getSeconds()) : (y = Math.floor(a / 60), B = Math.floor(a % 60));
|
|
437
|
-
const
|
|
438
|
-
return
|
|
441
|
+
const c = y % 12 ? y % 12 : 12, w = (_ || { am: "am", pm: "pm" })[y === 24 || y < 12 ? "am" : "pm"];
|
|
442
|
+
return L = {
|
|
439
443
|
H: y,
|
|
440
|
-
h:
|
|
444
|
+
h: c,
|
|
441
445
|
HH: y.toString().padStart(2, 0),
|
|
442
|
-
hh:
|
|
443
|
-
am:
|
|
444
|
-
AM:
|
|
446
|
+
hh: c.toString().padStart(2, 0),
|
|
447
|
+
am: w,
|
|
448
|
+
AM: w.toUpperCase(),
|
|
445
449
|
m: B,
|
|
446
450
|
mm: B.toString().padStart(2, 0),
|
|
447
451
|
s: Q
|
|
448
|
-
},
|
|
452
|
+
}, L;
|
|
449
453
|
};
|
|
450
454
|
return {
|
|
451
455
|
addDatePrototypes: C,
|
|
452
|
-
removeDatePrototypes:
|
|
453
|
-
updateTexts:
|
|
456
|
+
removeDatePrototypes: o,
|
|
457
|
+
updateTexts: m,
|
|
454
458
|
addDays: W,
|
|
455
459
|
subtractDays: G,
|
|
456
|
-
addHours:
|
|
457
|
-
subtractHours:
|
|
460
|
+
addHours: i,
|
|
461
|
+
subtractHours: u,
|
|
458
462
|
addMinutes: e,
|
|
459
|
-
subtractMinutes:
|
|
463
|
+
subtractMinutes: d,
|
|
460
464
|
snapToInterval: h,
|
|
461
|
-
getWeek:
|
|
462
|
-
isToday:
|
|
465
|
+
getWeek: Y,
|
|
466
|
+
isToday: P,
|
|
463
467
|
isSameDate: A,
|
|
464
|
-
isInRange:
|
|
465
|
-
isLeapYear:
|
|
466
|
-
getPreviousFirstDayOfWeek:
|
|
468
|
+
isInRange: s,
|
|
469
|
+
isLeapYear: l,
|
|
470
|
+
getPreviousFirstDayOfWeek: k,
|
|
467
471
|
stringToDate: t,
|
|
468
|
-
dateToMinutes:
|
|
469
|
-
countDays:
|
|
470
|
-
datesInSameTimeStep:
|
|
471
|
-
isValid:
|
|
472
|
+
dateToMinutes: V,
|
|
473
|
+
countDays: H,
|
|
474
|
+
datesInSameTimeStep: U,
|
|
475
|
+
isValid: K,
|
|
472
476
|
formatDate: ue,
|
|
473
477
|
formatDateLite: ae,
|
|
474
478
|
formatTime: re,
|
|
475
479
|
formatTimeLite: he,
|
|
476
|
-
formatMinutes:
|
|
480
|
+
formatMinutes: q
|
|
477
481
|
};
|
|
478
|
-
}, gt = (
|
|
479
|
-
const { dateUtils:
|
|
480
|
-
let
|
|
481
|
-
const
|
|
482
|
-
const
|
|
482
|
+
}, gt = (D) => {
|
|
483
|
+
const { dateUtils: n, config: r } = D;
|
|
484
|
+
let g = 0;
|
|
485
|
+
const p = T(() => {
|
|
486
|
+
const i = {
|
|
483
487
|
byDate: {},
|
|
484
488
|
// A map of single-day events indexed by date.
|
|
485
489
|
recurring: [],
|
|
@@ -488,254 +492,256 @@ const nt = (u, s) => {
|
|
|
488
492
|
// An array of events IDs that are multiday.
|
|
489
493
|
byId: {}
|
|
490
494
|
// A map of all the events indexed by ID for fast lookup.
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
b(e), e._ || (e._ = {}), e._.id = e._.id || ++
|
|
495
|
+
}, u = r.events.sort((e, d) => e.start - d.start < 0 ? -1 : 1);
|
|
496
|
+
for (const e of u)
|
|
497
|
+
b(e), e._ || (e._ = {}), e._.id = e._.id || ++g, e.delete || (e.delete = (d) => m(e._.id, d)), e._.deleting = !1, e._.deleted = !1, e.isOverlapping = (d = null) => e.getOverlappingEvents(d).length, e.getOverlappingEvents = (d = null) => {
|
|
494
498
|
var h;
|
|
495
499
|
return W(
|
|
496
|
-
|
|
497
|
-
{ start: (
|
|
498
|
-
{ excludeIds: [e._.id], schedule: (h = r.schedules) != null && h.length ? ~~((
|
|
500
|
+
v(n.formatDate((d == null ? void 0 : d.start) || e.start), !0),
|
|
501
|
+
{ start: (d == null ? void 0 : d.start) || e.start, end: (d == null ? void 0 : d.end) || e.end },
|
|
502
|
+
{ excludeIds: [e._.id], schedule: (h = r.schedules) != null && h.length ? ~~((d == null ? void 0 : d.schedule) || e.schedule) : null }
|
|
499
503
|
);
|
|
500
|
-
}, e._.register = (
|
|
501
|
-
e._.$el =
|
|
504
|
+
}, e._.register = (d) => {
|
|
505
|
+
e._.$el = d, e._.fireCreated && (D.emit("event-created", e), delete e._.fireCreated);
|
|
502
506
|
}, e._.unregister = () => {
|
|
503
507
|
e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
}), b = (
|
|
507
|
-
if (typeof
|
|
508
|
-
isNaN(
|
|
508
|
+
}, i.byId[e._.id] = e, e.recurring ? i.recurring.push(e._.id) : e._.multiday ? (i.multiday.push(e._.id), i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id)) : (i.byDate[e._.startFormatted] || (i.byDate[e._.startFormatted] = []), i.byDate[e._.startFormatted].push(e._.id));
|
|
509
|
+
return i;
|
|
510
|
+
}), b = (i) => {
|
|
511
|
+
if (typeof i.start == "string" && (i.start = n.stringToDate(i.start)), typeof i.end == "string" && (i.end = n.stringToDate(i.end)), i.start.setSeconds(0, 0), i.end.setSeconds(0, 0), isNaN(i.start) || isNaN(i.end)) {
|
|
512
|
+
isNaN(i.start) ? console.error(`Vue Cal: invalid start date for event "${i.title}".`, i.start) : console.error(`Vue Cal: invalid end date for event "${i.title}".`, i.end);
|
|
509
513
|
return;
|
|
510
|
-
} else
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
let
|
|
516
|
-
return
|
|
517
|
-
}, C = (
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
|
|
514
|
+
} else i.end.getTime() < i.start.getTime() && console.error(`Vue Cal: invalid event dates for event "${i.title}". The event ends before it starts.`, i.start, i.end);
|
|
515
|
+
i._ || (i._ = {}), i._.multiday = !n.isSameDate(i.start, new Date(i.end.getTime() - 1)), i._.startFormatted = n.formatDate(i.start), i._.startMinutes = ~~n.dateToMinutes(i.start), i._.endMinutes = ~~n.dateToMinutes(i.end);
|
|
516
|
+
const u = i.start.getHours(), e = i.start.getMinutes().toString().padStart(2, 0), d = i.end.getHours(), h = i.end.getMinutes().toString().padStart(2, 0);
|
|
517
|
+
i._.startTimeFormatted24 = `${u.toString().padStart(2, 0)}:${e}`, i._.startTimeFormatted12 = `${u % 12 || 12}${e ? `:${e}` : ""} ${u < 12 ? "AM" : "PM"}`, i._.endTimeFormatted24 = `${d.toString().padStart(2, 0)}:${h}`, i._.endTimeFormatted12 = `${d % 12 || 12}${h ? `:${h}` : ""} ${d < 12 ? "AM" : "PM"}`, i._.duration = Math.abs(~~((i.end - i.start) / 6e4));
|
|
518
|
+
}, L = (i) => p.value.byId[i], v = (i, u = !1, e = !1) => {
|
|
519
|
+
let d = p.value.byDate[i] || [];
|
|
520
|
+
return d = u || e ? d.map(L) : d, e || (d = d.filter((h) => !h.background), u || (d = d.map((h) => h._.id))), d;
|
|
521
|
+
}, C = (i) => {
|
|
522
|
+
const u = {};
|
|
523
|
+
for (const { startFormatted: e } of i) {
|
|
524
|
+
u[e] = [];
|
|
525
|
+
const d = v(e, !1, !0);
|
|
526
|
+
d.length && u[e].push(...d);
|
|
527
|
+
}
|
|
528
|
+
return u;
|
|
529
|
+
}, o = (i) => {
|
|
530
|
+
if (!i.start || !i.end) {
|
|
526
531
|
console.error("Vue Cal: Cannot create an event without valid start and end dates.");
|
|
527
532
|
return;
|
|
528
533
|
}
|
|
529
|
-
return r.snapToInterval && (
|
|
530
|
-
},
|
|
534
|
+
return r.snapToInterval && (n.snapToInterval(i.start, r.snapToInterval), n.snapToInterval(i.end, r.snapToInterval)), i = { ...i }, i._ || (i._ = {}), i._.id = ++g, i._.fireCreated = !0, r.events.push(i), i;
|
|
535
|
+
}, m = (i, u = 0) => {
|
|
531
536
|
var h;
|
|
532
537
|
if (!r.editableEvents.delete)
|
|
533
538
|
return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
|
|
534
|
-
if (!
|
|
535
|
-
const e = r.events.findIndex((
|
|
536
|
-
if (e === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
switch (
|
|
539
|
+
if (!i) return console.warn("Vue Cal: Cannot delete event without its ID.");
|
|
540
|
+
const e = r.events.findIndex((Y) => Y._.id === i);
|
|
541
|
+
if (e === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${i}\`.`);
|
|
542
|
+
const d = r.events[e];
|
|
543
|
+
if (d.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${i}\` since it was explicitely set to \`delete: false\`.`);
|
|
544
|
+
switch (u) {
|
|
540
545
|
case 0:
|
|
541
|
-
|
|
546
|
+
d._.deleting ? r.events.splice(e, 1) : d._.deleting = !0;
|
|
542
547
|
break;
|
|
543
548
|
// Display the delete button.
|
|
544
549
|
case 1:
|
|
545
|
-
|
|
550
|
+
d._.deleting = !0;
|
|
546
551
|
break;
|
|
547
552
|
// Visual deletion + external DOM event firing.
|
|
548
553
|
// When explicitly using this stage, the event will be visually deleted but still present in the
|
|
549
554
|
// source of truth until the cell is unmounted (by navigating away).
|
|
550
555
|
case 2:
|
|
551
|
-
|
|
556
|
+
d._.deleted = !0, r.events[e]._.deleted = !0, (h = d._.$el) == null || h.dispatchEvent(new CustomEvent("event-deleted", { detail: d._.id }));
|
|
552
557
|
break;
|
|
553
558
|
// Effective deletion from the source of truth (by default, when unmounting the cell).
|
|
554
559
|
case 3:
|
|
555
|
-
r.events.splice(e, 1),
|
|
560
|
+
r.events.splice(e, 1), D.emit("update:events", r.events), D.emit("event-delete", d);
|
|
556
561
|
break;
|
|
557
562
|
}
|
|
558
563
|
return !0;
|
|
559
|
-
}, $ = (
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
564
|
+
}, $ = (i) => {
|
|
565
|
+
const u = v(i, !0);
|
|
566
|
+
if (!u.length) return { cellOverlaps: {}, longestStreak: 0 };
|
|
567
|
+
const e = {};
|
|
568
|
+
let d = [], h = 0;
|
|
569
|
+
u.sort((Y, P) => Y.start - P.start || Y.end - Y.start - (P.end - P.start));
|
|
570
|
+
for (const Y of u) {
|
|
571
|
+
const P = Y._.id;
|
|
572
|
+
e[P] || (e[P] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), d = d.filter((t) => t.end > Y.start);
|
|
573
|
+
let A = d.filter((t) => {
|
|
574
|
+
var H;
|
|
575
|
+
return (!((H = r.schedules) != null && H.length) || Y.schedule === t.schedule) && t.start < Y.end;
|
|
576
|
+
}), s = new Set(A.map((t) => {
|
|
577
|
+
var V;
|
|
578
|
+
return ((V = e[t._.id]) == null ? void 0 : V.position) ?? 0;
|
|
579
|
+
})), l = 0;
|
|
580
|
+
for (; s.has(l); ) l++;
|
|
581
|
+
e[P].position = l, d.push(Y);
|
|
582
|
+
let k = Math.max(1, ...A.map((t) => {
|
|
583
|
+
var V;
|
|
584
|
+
return ((V = e[t._.id]) == null ? void 0 : V.maxConcurrent) ?? 1;
|
|
579
585
|
}));
|
|
580
|
-
e[
|
|
586
|
+
e[P].maxConcurrent = Math.max(A.length + 1, k);
|
|
581
587
|
for (const t of A)
|
|
582
|
-
e[t._.id].overlaps.add(
|
|
583
|
-
h = Math.max(h, e[
|
|
588
|
+
e[t._.id].overlaps.add(P), e[P].overlaps.add(t._.id), e[t._.id].maxConcurrent = e[P].maxConcurrent;
|
|
589
|
+
h = Math.max(h, e[P].maxConcurrent);
|
|
584
590
|
}
|
|
585
|
-
for (const
|
|
591
|
+
for (const Y in e) e[Y].overlaps = [...e[Y].overlaps];
|
|
586
592
|
return { cellOverlaps: e, longestStreak: h };
|
|
587
|
-
}, W = (
|
|
593
|
+
}, W = (i = [], { start: u, end: e }, { excludeIds: d = [], schedule: h = null }) => {
|
|
588
594
|
var A;
|
|
589
|
-
const
|
|
590
|
-
for (const
|
|
591
|
-
!
|
|
592
|
-
return
|
|
593
|
-
}, G = (
|
|
594
|
-
const
|
|
595
|
-
return
|
|
595
|
+
const Y = new Set(d), P = [];
|
|
596
|
+
for (const s of i)
|
|
597
|
+
!Y.has((A = s._) == null ? void 0 : A.id) && (h === null || h === s.schedule) && G(s, u, e) && P.push(s);
|
|
598
|
+
return P;
|
|
599
|
+
}, G = (i, u, e) => {
|
|
600
|
+
const d = i.allDay || !r.time, h = d ? new Date(i.start).setHours(0, 0, 0, 0) : i.start.getTime(), Y = d ? new Date(i.end).setHours(23, 59, 59, 999) : i.end.getTime(), P = d ? new Date(u).setHours(0, 0, 0, 0) : u.getTime(), A = d ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
|
|
601
|
+
return Y > P && h < A;
|
|
596
602
|
};
|
|
597
603
|
return {
|
|
598
|
-
events:
|
|
599
|
-
getEvent:
|
|
600
|
-
getEventsByDate:
|
|
604
|
+
events: p,
|
|
605
|
+
getEvent: L,
|
|
606
|
+
getEventsByDate: v,
|
|
601
607
|
getViewEvents: C,
|
|
602
608
|
getCellOverlappingEvents: $,
|
|
603
609
|
getEventsInRange: W,
|
|
604
|
-
createEvent:
|
|
605
|
-
deleteEvent:
|
|
610
|
+
createEvent: o,
|
|
611
|
+
deleteEvent: m,
|
|
606
612
|
isEventInRange: G
|
|
607
613
|
};
|
|
608
|
-
}, ht = ({ config:
|
|
609
|
-
const { availableViews:
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
f.value.setHours(0, 0, 0, 0);
|
|
613
|
-
const $ = oe(new Date(f));
|
|
614
|
+
}, ht = ({ config: D, dateUtils: n, emit: r, texts: g, eventsManager: p }, b) => {
|
|
615
|
+
const { availableViews: L } = D, v = ie(D.view && L[D.view] ? D.view : D.defaultView), C = ie(D.selectedDate || null), o = ie(/* @__PURE__ */ new Date()), m = ie(new Date(D.viewDate || o.value));
|
|
616
|
+
m.value.setHours(0, 0, 0, 0);
|
|
617
|
+
const $ = ie(new Date(m));
|
|
614
618
|
let W = null;
|
|
615
|
-
const G = T(() =>
|
|
616
|
-
if (
|
|
617
|
-
const
|
|
618
|
-
return
|
|
619
|
-
}
|
|
620
|
-
return
|
|
621
|
-
}),
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
625
|
-
const z =
|
|
626
|
-
return z <=
|
|
619
|
+
const G = T(() => v.value === "month" ? $.value : l.value), i = T(() => v.value === "month" ? new Date($.value.getFullYear(), $.value.getMonth() + 1, 0, 23, 59, 59, 999) : t.value), u = T(() => v.value === "week" ? n.getPreviousFirstDayOfWeek(l.value, D.startWeekOnSunday) : v.value === "month" ? l.value : G.value), e = T(() => {
|
|
620
|
+
if (v.value === "week") {
|
|
621
|
+
const f = n.addDays(u.value, 7);
|
|
622
|
+
return f.setMilliseconds(-1), f;
|
|
623
|
+
}
|
|
624
|
+
return v.value === "month" ? t.value : i.value;
|
|
625
|
+
}), d = T(() => {
|
|
626
|
+
const f = o.value.getTime();
|
|
627
|
+
if (v.value === "week")
|
|
628
|
+
return u.value.getTime() <= f && f <= e.value.getTime();
|
|
629
|
+
const z = l.value.getTime(), R = t.value.getTime();
|
|
630
|
+
return z <= f && f <= R;
|
|
627
631
|
});
|
|
628
632
|
function h() {
|
|
629
|
-
|
|
633
|
+
o.value = /* @__PURE__ */ new Date(), W = setTimeout(h, 60 * 1e3);
|
|
630
634
|
}
|
|
631
|
-
function
|
|
635
|
+
function Y() {
|
|
632
636
|
W = setTimeout(h, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), h();
|
|
633
637
|
}
|
|
634
|
-
const
|
|
635
|
-
if (!
|
|
636
|
-
let
|
|
637
|
-
return
|
|
638
|
+
const P = T(() => {
|
|
639
|
+
if (!D.availableViews[v.value]) return 1;
|
|
640
|
+
let f = D.availableViews[v.value].cols;
|
|
641
|
+
return D.hasHiddenDays && ["week", "month"].includes(v.value) && (f -= D.hasHiddenDays), f;
|
|
638
642
|
}), A = T(() => {
|
|
639
|
-
var
|
|
640
|
-
return ((
|
|
641
|
-
}),
|
|
642
|
-
if (
|
|
643
|
-
let
|
|
644
|
-
return
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
643
|
+
var f;
|
|
644
|
+
return ((f = D.availableViews[v.value]) == null ? void 0 : f.rows) || 1;
|
|
645
|
+
}), s = T(() => P.value * A.value), l = T(() => {
|
|
646
|
+
if (v.value === "month") {
|
|
647
|
+
let f = $.value.getDay() || 7;
|
|
648
|
+
return D.startWeekOnSunday && !D.hideWeekdays[7] && (f += 1), D.viewDayOffset && (f -= D.viewDayOffset), n.subtractDays($.value, f - 1);
|
|
649
|
+
}
|
|
650
|
+
if (v.value === "week") {
|
|
651
|
+
const f = "1234567".split("").filter((R) => !Object.keys(D.hideWeekdays).includes(R));
|
|
652
|
+
let z = Math.min(...f);
|
|
653
|
+
return D.startWeekOnSunday && !D.hideWeekdays[7] && (z = 1), D.viewDayOffset && (z += D.viewDayOffset), n.addDays($.value, z - 1);
|
|
654
|
+
}
|
|
655
|
+
return $.value;
|
|
656
|
+
}), k = T(() => {
|
|
657
|
+
const f = [], z = ["days", "week", "month"].includes(v.value);
|
|
652
658
|
let R = 0;
|
|
653
|
-
for (let X = 0; X <
|
|
654
|
-
switch (
|
|
659
|
+
for (let X = 0; X < s.value + R; X++)
|
|
660
|
+
switch (v.value) {
|
|
655
661
|
case "day":
|
|
656
662
|
case "days":
|
|
657
663
|
case "week":
|
|
658
664
|
case "month": {
|
|
659
|
-
const ve =
|
|
660
|
-
if (z &&
|
|
665
|
+
const ve = n.addDays(l.value, X), We = ve.getDay() || 7;
|
|
666
|
+
if (z && D.hasHiddenDays && D.hideWeekdays[We]) {
|
|
661
667
|
R++;
|
|
662
668
|
continue;
|
|
663
669
|
}
|
|
664
670
|
const Ce = new Date(ve);
|
|
665
|
-
Ce.setHours(23, 59, 59, 999),
|
|
671
|
+
Ce.setHours(23, 59, 59, 999), f.push({ start: ve, startFormatted: n.formatDate(ve), end: Ce });
|
|
666
672
|
break;
|
|
667
673
|
}
|
|
668
674
|
case "year":
|
|
669
|
-
|
|
670
|
-
start: new Date(
|
|
671
|
-
end: new Date(
|
|
675
|
+
f.push({
|
|
676
|
+
start: new Date(l.value.getFullYear(), X, 1, 0, 0, 0, 0),
|
|
677
|
+
end: new Date(l.value.getFullYear(), X + 1, 0, 23, 59, 59, 999)
|
|
672
678
|
});
|
|
673
679
|
break;
|
|
674
680
|
case "years":
|
|
675
|
-
|
|
676
|
-
start: new Date(
|
|
677
|
-
end: new Date(
|
|
681
|
+
f.push({
|
|
682
|
+
start: new Date(l.value.getFullYear() + X, 0, 1, 0, 0, 0, 0),
|
|
683
|
+
end: new Date(l.value.getFullYear() + X + 1, 0, 0, 23, 59, 59, 999)
|
|
678
684
|
});
|
|
679
685
|
break;
|
|
680
686
|
}
|
|
681
|
-
return
|
|
682
|
-
}), t = T(() =>
|
|
683
|
-
const
|
|
684
|
-
return
|
|
685
|
-
}),
|
|
686
|
-
const
|
|
687
|
-
return
|
|
687
|
+
return f;
|
|
688
|
+
}), t = T(() => k.value[k.value.length - 1].end), V = ie("right"), H = T(() => {
|
|
689
|
+
const f = Object.keys(D.availableViews);
|
|
690
|
+
return f[f.indexOf(v.value) + 1];
|
|
691
|
+
}), U = T(() => {
|
|
692
|
+
const f = Object.keys(D.availableViews);
|
|
693
|
+
return f[f.indexOf(v.value) - 1];
|
|
688
694
|
});
|
|
689
|
-
function
|
|
690
|
-
if (!z || !z[
|
|
691
|
-
const X = z[
|
|
695
|
+
function K(f, z, R = !1) {
|
|
696
|
+
if (!z || !z[f]) return f + 1;
|
|
697
|
+
const X = z[f];
|
|
692
698
|
return R && typeof X == "string" ? X.substring(0, 3) : X;
|
|
693
699
|
}
|
|
694
|
-
function ue(
|
|
695
|
-
const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me =
|
|
696
|
-
return lt ? ve ? `${
|
|
700
|
+
function ue(f, z, R) {
|
|
701
|
+
const { monthsArray: X, monthBeforeDay: ve, canTruncate: We, xs: Ce } = R, Me = f.getMonth(), Ye = f.getFullYear(), Ee = z.getMonth(), He = z.getFullYear(), Be = Me !== Ee, lt = Ye !== He, ke = We && (Ce || Be), Le = f.getDate(), ze = z.getDate();
|
|
702
|
+
return lt ? ve ? `${K(Me, X, ke)} ${Le}, ${Ye} - ${K(Ee, X, ke)} ${ze}, ${He}` : `${Le} ${K(Me, X, ke)} ${Ye} - ${ze} ${K(Ee, X, ke)} ${He}` : Be ? ve ? `${K(Me, X, ke)} ${Le} - ${K(Ee, X, ke)} ${ze}, ${Ye}` : `${Le} ${K(Me, X, ke)} - ${ze} ${K(Ee, X, ke)} ${Ye}` : ve ? `${K(Me, X, ke)} ${Le}-${ze}, ${Ye}` : `${Le}-${ze} ${K(Me, X, ke)} ${Ye}`;
|
|
697
703
|
}
|
|
698
704
|
const ae = T(() => {
|
|
699
|
-
const { dateFormat:
|
|
700
|
-
switch (
|
|
705
|
+
const { dateFormat: f, months: z, monthsGenitive: R, week: X, truncations: ve } = g, We = D.locale, Ce = ve !== !1, Me = f.indexOf("M") < f.indexOf("D"), Ye = R && We === "el" ? R : z;
|
|
706
|
+
switch (v.value) {
|
|
701
707
|
case "day":
|
|
702
|
-
return
|
|
708
|
+
return n.formatDate(l.value, f);
|
|
703
709
|
case "days":
|
|
704
710
|
case "week": {
|
|
705
|
-
const
|
|
706
|
-
monthsArray:
|
|
711
|
+
const Ee = {
|
|
712
|
+
monthsArray: Ye,
|
|
707
713
|
monthBeforeDay: Me,
|
|
708
714
|
canTruncate: Ce,
|
|
709
|
-
xs:
|
|
715
|
+
xs: D.xs
|
|
710
716
|
};
|
|
711
|
-
let He = ue(
|
|
712
|
-
if (
|
|
713
|
-
const Be =
|
|
714
|
-
|
|
715
|
-
|
|
717
|
+
let He = ue(l.value, t.value, Ee);
|
|
718
|
+
if (v.value === "week") {
|
|
719
|
+
const Be = n.getWeek(
|
|
720
|
+
l.value,
|
|
721
|
+
D.startWeekOnSunday && !D.hideWeekdays[7]
|
|
716
722
|
);
|
|
717
723
|
He += ` <small>${X} ${Be}</small>`;
|
|
718
724
|
}
|
|
719
725
|
return He;
|
|
720
726
|
}
|
|
721
727
|
case "month": {
|
|
722
|
-
const
|
|
723
|
-
return
|
|
728
|
+
const Ee = `${D.xs && Ce ? "MMM" : "MMMM"} YYYY`;
|
|
729
|
+
return n.formatDate(G.value, Ee);
|
|
724
730
|
}
|
|
725
731
|
case "year":
|
|
726
|
-
return
|
|
732
|
+
return l.value.getFullYear();
|
|
727
733
|
case "years":
|
|
728
|
-
return `${
|
|
734
|
+
return `${l.value.getFullYear()} - ${i.value.getFullYear()}`;
|
|
729
735
|
}
|
|
730
736
|
});
|
|
731
737
|
function re() {
|
|
732
|
-
switch ($.value = new Date(
|
|
738
|
+
switch ($.value = new Date(m.value || o.value), $.value.setHours(0, 0, 0, 0), v.value) {
|
|
733
739
|
case "day":
|
|
734
740
|
break;
|
|
735
741
|
case "days":
|
|
736
742
|
break;
|
|
737
743
|
case "week":
|
|
738
|
-
$.value =
|
|
744
|
+
$.value = n.getPreviousFirstDayOfWeek($.value, D.startWeekOnSunday && !D.hideWeekdays[7]);
|
|
739
745
|
break;
|
|
740
746
|
case "month":
|
|
741
747
|
$.value = new Date($.value.getFullYear(), $.value.getMonth(), 1, 0, 0, 0, 0);
|
|
@@ -744,64 +750,64 @@ const nt = (u, s) => {
|
|
|
744
750
|
$.value = new Date($.value.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
745
751
|
break;
|
|
746
752
|
case "years":
|
|
747
|
-
$.value = new Date($.value.getFullYear() - $.value.getFullYear() %
|
|
753
|
+
$.value = new Date($.value.getFullYear() - $.value.getFullYear() % s.value, 0, 1, 0, 0, 0, 0);
|
|
748
754
|
break;
|
|
749
755
|
}
|
|
750
|
-
|
|
751
|
-
id:
|
|
756
|
+
D.ready && r("view-change", {
|
|
757
|
+
id: v.value,
|
|
752
758
|
title: ae.value,
|
|
753
759
|
start: G.value,
|
|
754
|
-
end:
|
|
755
|
-
extendedStart:
|
|
760
|
+
end: i.value,
|
|
761
|
+
extendedStart: u.value,
|
|
756
762
|
extendedEnd: e.value,
|
|
757
|
-
cellDates:
|
|
758
|
-
containsToday:
|
|
763
|
+
cellDates: k.value,
|
|
764
|
+
containsToday: d.value,
|
|
759
765
|
events: x.value
|
|
760
|
-
}),
|
|
766
|
+
}), o.value = /* @__PURE__ */ new Date();
|
|
761
767
|
}
|
|
762
|
-
function he(
|
|
763
|
-
const z =
|
|
764
|
-
|
|
768
|
+
function he(f) {
|
|
769
|
+
const z = v.value, R = D.availableViews[z];
|
|
770
|
+
f[z] && JSON.stringify(f[z]) === JSON.stringify(R) || re();
|
|
765
771
|
}
|
|
766
|
-
function
|
|
767
|
-
const R = Object.keys(
|
|
768
|
-
|
|
772
|
+
function q(f, z = !0) {
|
|
773
|
+
const R = Object.keys(D.availableViews);
|
|
774
|
+
v.value !== f && (R.includes(f) ? (V.value = R.indexOf(f) < R.indexOf(v.value) ? "left" : "right", v.value = f, r("update:view", f), re()) : console.warn(`Vue Cal: the \`${f}\` view is not available.`));
|
|
769
775
|
}
|
|
770
776
|
function ce() {
|
|
771
|
-
|
|
777
|
+
H.value ? q(H.value) : console.warn("Vue Cal: no broader view is available.");
|
|
772
778
|
}
|
|
773
779
|
function ee() {
|
|
774
|
-
|
|
780
|
+
U.value ? q(U.value) : console.warn("Vue Cal: no narrower view is available.");
|
|
775
781
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
782
|
+
function oe() {
|
|
783
|
+
_(!1);
|
|
778
784
|
}
|
|
779
785
|
function a() {
|
|
780
|
-
|
|
786
|
+
_(!0);
|
|
781
787
|
}
|
|
782
|
-
function
|
|
783
|
-
let z = new Date(
|
|
784
|
-
switch (
|
|
788
|
+
function _(f = !0) {
|
|
789
|
+
let z = new Date(m.value);
|
|
790
|
+
switch (v.value) {
|
|
785
791
|
case "day":
|
|
786
792
|
case "days":
|
|
787
|
-
|
|
793
|
+
f ? z = n.addDays(t.value, 1) : z = n.subtractDays(l.value, s.value);
|
|
788
794
|
break;
|
|
789
795
|
case "week": {
|
|
790
|
-
|
|
796
|
+
f ? (z = n.addDays(e.value, 1), z.setHours(0, 0, 0, 0)) : z = n.subtractDays(u.value, s.value);
|
|
791
797
|
break;
|
|
792
798
|
}
|
|
793
799
|
case "month": {
|
|
794
|
-
const R =
|
|
800
|
+
const R = f ? 1 : -1;
|
|
795
801
|
z = new Date(z.getFullYear(), z.getMonth() + R, 1, 0, 0, 0, 0);
|
|
796
802
|
break;
|
|
797
803
|
}
|
|
798
804
|
case "year": {
|
|
799
|
-
const R =
|
|
805
|
+
const R = f ? 1 : -1;
|
|
800
806
|
z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
|
|
801
807
|
break;
|
|
802
808
|
}
|
|
803
809
|
case "years": {
|
|
804
|
-
const R =
|
|
810
|
+
const R = f ? s.value : -s.value;
|
|
805
811
|
z = new Date(z.getFullYear() + R, 1, 1, 0, 0, 0, 0);
|
|
806
812
|
break;
|
|
807
813
|
}
|
|
@@ -809,78 +815,76 @@ const nt = (u, s) => {
|
|
|
809
815
|
B(z);
|
|
810
816
|
}
|
|
811
817
|
function y() {
|
|
812
|
-
const
|
|
813
|
-
|
|
818
|
+
const f = /* @__PURE__ */ new Date();
|
|
819
|
+
f.setHours(0, 0, 0, 0), B(f);
|
|
814
820
|
}
|
|
815
|
-
function B(
|
|
816
|
-
if (!
|
|
817
|
-
let [X, ve] = [
|
|
818
|
-
|
|
821
|
+
function B(f, z = !0, R = !1) {
|
|
822
|
+
if (!n.isValid(f)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
|
|
823
|
+
let [X, ve] = [l.value, t.value];
|
|
824
|
+
v.value === "month" && ([X, ve] = [G.value, i.value]), (!n.isInRange(f, X, ve) || R) && (f.setHours(0, 0, 0, 0), V.value = f.getTime() < X.getTime() ? "left" : "right", m.value = f, z && r("update:viewDate", f), re());
|
|
819
825
|
}
|
|
820
|
-
function Q(
|
|
821
|
-
if (
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
} else
|
|
825
|
-
return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
826
|
+
function Q(f, z = !0) {
|
|
827
|
+
if (!n.isValid(f)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
828
|
+
const { isValid: R, isSameDate: X } = n;
|
|
829
|
+
(!C.value || !R(C.value) || !X(f, C.value)) && (f.setHours(0, 0, 0, 0), C.value = f, z && r("update:selectedDate", f));
|
|
826
830
|
}
|
|
827
|
-
function
|
|
828
|
-
!
|
|
831
|
+
function c(f) {
|
|
832
|
+
!f && !$.value.getDay() ? B(n.addDays($.value, 1), !0, !0) : (V.value = "left", re());
|
|
829
833
|
}
|
|
830
|
-
function
|
|
831
|
-
|
|
834
|
+
function w(f) {
|
|
835
|
+
f && D.startWeekOnSunday && !$.value.getDay() ? B(n.addDays($.value, 1), !0, !0) : !f && D.startWeekOnSunday && $.value.getDay() === 1 && B(n.subtractDays($.value, 1), !0, !0);
|
|
832
836
|
}
|
|
833
|
-
function
|
|
834
|
-
console.log("toggling weekdays",
|
|
837
|
+
function S() {
|
|
838
|
+
console.log("toggling weekdays", D.hideWeekdays);
|
|
835
839
|
}
|
|
836
|
-
function M(
|
|
840
|
+
function M(f) {
|
|
837
841
|
var X;
|
|
838
|
-
const z = (X = b.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R =
|
|
842
|
+
const z = (X = b.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = f ? f * D.timeCellHeight / D.timeStep : 0;
|
|
839
843
|
z == null || z.scrollTo({ top: R, behavior: "smooth" });
|
|
840
844
|
}
|
|
841
845
|
function N() {
|
|
842
|
-
const
|
|
843
|
-
M(
|
|
846
|
+
const f = /* @__PURE__ */ new Date();
|
|
847
|
+
M(f.getHours() * 60 + f.getMinutes());
|
|
844
848
|
}
|
|
845
849
|
function I() {
|
|
846
850
|
M(0);
|
|
847
851
|
}
|
|
848
|
-
const x = T(() =>
|
|
849
|
-
return me(() =>
|
|
850
|
-
|
|
851
|
-
}), me(() =>
|
|
852
|
-
|
|
853
|
-
}), re(),
|
|
854
|
-
now:
|
|
855
|
-
id:
|
|
856
|
-
broaderView:
|
|
857
|
-
narrowerView:
|
|
852
|
+
const x = T(() => p.getViewEvents(k.value)), de = p.createEvent, ye = p.deleteEvent;
|
|
853
|
+
return me(() => D.view, (f) => q(f, !1)), me(() => D.availableViews, he), me(() => D.datePicker, () => q("month", !1)), me(() => D.viewDate, (f) => B(f, !1)), me(() => D.selectedDate, (f) => Q(f, !1)), me(() => D.startWeekOnSunday, (f) => c(f)), me(() => D.hideWeekends, (f) => w(f)), me(() => D.hideWeekdays, S), me(() => s.value, () => {
|
|
854
|
+
s.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
|
|
855
|
+
}), me(() => D.watchRealTime, (f) => {
|
|
856
|
+
f && D.time ? Y() : W = clearTimeout(W);
|
|
857
|
+
}), re(), D.time && D.watchRealTime && Y(), Xe(() => W = clearTimeout(W)), {
|
|
858
|
+
now: o,
|
|
859
|
+
id: v,
|
|
860
|
+
broaderView: H,
|
|
861
|
+
narrowerView: U,
|
|
858
862
|
title: ae,
|
|
859
|
-
viewDate:
|
|
863
|
+
viewDate: m,
|
|
860
864
|
start: G,
|
|
861
|
-
end:
|
|
862
|
-
extendedStart:
|
|
865
|
+
end: i,
|
|
866
|
+
extendedStart: u,
|
|
863
867
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
864
868
|
extendedEnd: e,
|
|
865
869
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
866
|
-
firstCellDate:
|
|
870
|
+
firstCellDate: l,
|
|
867
871
|
lastCellDate: t,
|
|
868
|
-
containsToday:
|
|
872
|
+
containsToday: d,
|
|
869
873
|
selectedDate: C,
|
|
870
|
-
cellDates:
|
|
871
|
-
cols:
|
|
874
|
+
cellDates: k,
|
|
875
|
+
cols: P,
|
|
872
876
|
rows: A,
|
|
873
877
|
// All the events are stored and indexed in the events object of the eventsManager.
|
|
874
878
|
// The following events array is only a subset of visible ones, plus any potential recurring
|
|
875
879
|
// and multi-day events.
|
|
876
880
|
events: x,
|
|
877
|
-
transitionDirection:
|
|
878
|
-
switch:
|
|
881
|
+
transitionDirection: V,
|
|
882
|
+
switch: q,
|
|
879
883
|
broader: ce,
|
|
880
884
|
narrower: ee,
|
|
881
|
-
previous:
|
|
885
|
+
previous: oe,
|
|
882
886
|
next: a,
|
|
883
|
-
navigate:
|
|
887
|
+
navigate: _,
|
|
884
888
|
goToToday: y,
|
|
885
889
|
updateViewDate: B,
|
|
886
890
|
updateSelectedDate: Q,
|
|
@@ -891,34 +895,34 @@ const nt = (u, s) => {
|
|
|
891
895
|
deleteEvent: ye,
|
|
892
896
|
// Getters.
|
|
893
897
|
get isDay() {
|
|
894
|
-
return
|
|
898
|
+
return v.value === "day";
|
|
895
899
|
},
|
|
896
900
|
get isDays() {
|
|
897
|
-
return
|
|
901
|
+
return v.value === "days";
|
|
898
902
|
},
|
|
899
903
|
get isWeek() {
|
|
900
|
-
return
|
|
904
|
+
return v.value === "week";
|
|
901
905
|
},
|
|
902
906
|
get isMonth() {
|
|
903
|
-
return
|
|
907
|
+
return v.value === "month";
|
|
904
908
|
},
|
|
905
909
|
get isYear() {
|
|
906
|
-
return
|
|
910
|
+
return v.value === "year";
|
|
907
911
|
},
|
|
908
912
|
get isYears() {
|
|
909
|
-
return
|
|
913
|
+
return v.value === "years";
|
|
910
914
|
}
|
|
911
915
|
};
|
|
912
916
|
}, Fe = $e({
|
|
913
917
|
texts: { ...fe.texts },
|
|
914
918
|
// Make texts reactive before a locale is loaded.
|
|
915
|
-
dateUtils:
|
|
919
|
+
dateUtils: st(fe.texts, nt)
|
|
916
920
|
// Some Date utils functions need localized texts.
|
|
917
|
-
}), yt = ({ props:
|
|
921
|
+
}), yt = ({ props: D, emit: n, attrs: r, vuecalEl: g, uid: p }) => {
|
|
918
922
|
const b = $e({
|
|
919
|
-
uid:
|
|
923
|
+
uid: p,
|
|
920
924
|
// The Vuecal instance unique ID, used for dnd source-target identification.
|
|
921
|
-
emit:
|
|
925
|
+
emit: n,
|
|
922
926
|
texts: { ...Fe.texts },
|
|
923
927
|
// Make texts reactive before a locale is loaded.
|
|
924
928
|
// The date utils composable.
|
|
@@ -939,8 +943,8 @@ const nt = (u, s) => {
|
|
|
939
943
|
isResizingEvent: !1
|
|
940
944
|
}
|
|
941
945
|
});
|
|
942
|
-
return b.dateUtils =
|
|
943
|
-
}, Dt = 24 * 60,
|
|
946
|
+
return b.dateUtils = st(Object.assign(fe.texts, b.texts), nt), b.config = mt(b, D, r), b.eventsManager = gt(b), b.view = ht(b, g), b.dnd = ft(b), b;
|
|
947
|
+
}, Dt = 24 * 60, pt = {
|
|
944
948
|
allDayEvents: { type: [Boolean, String], default: !1 },
|
|
945
949
|
// Coming soon.
|
|
946
950
|
// avoidEventOverlap: { type: Boolean, default: undefined }, // Coming soon.
|
|
@@ -1036,97 +1040,97 @@ const nt = (u, s) => {
|
|
|
1036
1040
|
// minScheduleWidth: { type: Number, default: 0 },
|
|
1037
1041
|
// overlapsPerTimeStep: { type: Boolean, default: false },
|
|
1038
1042
|
// resizeX: { type: Boolean, default: false },
|
|
1039
|
-
},
|
|
1043
|
+
}, wt = { class: "vuecal__header" }, _t = {
|
|
1040
1044
|
key: 0,
|
|
1041
1045
|
class: "vuecal__views-bar"
|
|
1042
|
-
},
|
|
1046
|
+
}, kt = ["onClick", "innerHTML"], bt = {
|
|
1043
1047
|
key: 1,
|
|
1044
1048
|
class: "vuecal__title-bar"
|
|
1045
1049
|
}, Tt = { class: "vuecal__transition-wrap" }, $t = ["disabled", "innerHTML"], Mt = {
|
|
1046
1050
|
__name: "header",
|
|
1047
|
-
setup(
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1050
|
-
}, b = T(() =>
|
|
1051
|
-
return (
|
|
1052
|
-
F(
|
|
1053
|
-
view:
|
|
1054
|
-
availableViews:
|
|
1055
|
-
vuecal:
|
|
1051
|
+
setup(D) {
|
|
1052
|
+
const n = Ne("vuecal"), { view: r, config: g } = n, p = () => {
|
|
1053
|
+
g.clickToNavigate && r.broader();
|
|
1054
|
+
}, b = T(() => g.clickToNavigate ? { click: p } : {});
|
|
1055
|
+
return (L, v) => (E(), j("div", wt, [
|
|
1056
|
+
F(L.$slots, "header", {
|
|
1057
|
+
view: O(r),
|
|
1058
|
+
availableViews: O(g).availableViews,
|
|
1059
|
+
vuecal: O(n)
|
|
1056
1060
|
}),
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
(
|
|
1060
|
-
class:
|
|
1061
|
-
onClick: (
|
|
1062
|
-
innerHTML:
|
|
1061
|
+
L.$slots.header ? Z("", !0) : (E(), j(te, { key: 0 }, [
|
|
1062
|
+
O(g).viewsBar ? (E(), j("div", _t, [
|
|
1063
|
+
(E(!0), j(te, null, we(O(g).availableViews, (C, o) => (E(), j("button", {
|
|
1064
|
+
class: _e(["vuecal__view-button", { "vuecal__view-button--active": O(r).id === o }]),
|
|
1065
|
+
onClick: (m) => O(r).switch(o),
|
|
1066
|
+
innerHTML: O(n).texts[o],
|
|
1063
1067
|
type: "button"
|
|
1064
|
-
}, null, 10,
|
|
1065
|
-
])) :
|
|
1066
|
-
|
|
1068
|
+
}, null, 10, kt))), 256))
|
|
1069
|
+
])) : Z("", !0),
|
|
1070
|
+
O(g).titleBar ? (E(), j("nav", bt, [
|
|
1067
1071
|
ge("button", {
|
|
1068
|
-
class:
|
|
1069
|
-
onClick:
|
|
1072
|
+
class: _e(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !L.$slots["previous-button"] }]),
|
|
1073
|
+
onClick: v[0] || (v[0] = (...C) => O(r).previous && O(r).previous(...C)),
|
|
1070
1074
|
type: "button"
|
|
1071
1075
|
}, [
|
|
1072
|
-
F(
|
|
1076
|
+
F(L.$slots, "previous-button")
|
|
1073
1077
|
], 2),
|
|
1074
1078
|
ge("div", Tt, [
|
|
1075
1079
|
Oe(Ge, {
|
|
1076
|
-
name: `vuecal-slide-fade--${
|
|
1080
|
+
name: `vuecal-slide-fade--${O(r).transitionDirection}`
|
|
1077
1081
|
}, {
|
|
1078
|
-
default:
|
|
1079
|
-
(
|
|
1080
|
-
key:
|
|
1082
|
+
default: J(() => [
|
|
1083
|
+
(E(), j("div", {
|
|
1084
|
+
key: O(r).id + O(r).start.getTime()
|
|
1081
1085
|
}, [
|
|
1082
|
-
|
|
1086
|
+
L.$slots.title ? (E(), Se(Ke(O(g).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
|
|
1083
1087
|
key: 0,
|
|
1084
1088
|
class: "vuecal__title"
|
|
1085
1089
|
}, Ie(b.value)), {
|
|
1086
|
-
default:
|
|
1087
|
-
F(
|
|
1090
|
+
default: J(() => [
|
|
1091
|
+
F(L.$slots, "title", ne(se(O(r))))
|
|
1088
1092
|
]),
|
|
1089
1093
|
_: 3
|
|
1090
|
-
}, 16)) : (
|
|
1094
|
+
}, 16)) : (E(), Se(Ke(O(g).clickToNavigate && O(r).broaderView ? "button" : "div"), De({
|
|
1091
1095
|
key: 1,
|
|
1092
1096
|
class: "vuecal__title"
|
|
1093
1097
|
}, Ie(b.value), {
|
|
1094
|
-
innerHTML:
|
|
1098
|
+
innerHTML: O(r).title
|
|
1095
1099
|
}), null, 16, ["innerHTML"]))
|
|
1096
1100
|
]))
|
|
1097
1101
|
]),
|
|
1098
1102
|
_: 3
|
|
1099
1103
|
}, 8, ["name"])
|
|
1100
1104
|
]),
|
|
1101
|
-
|
|
1102
|
-
|
|
1105
|
+
O(g).todayButton ? (E(), j(te, { key: 0 }, [
|
|
1106
|
+
L.$slots["today-button"] ? F(L.$slots, "today-button", {
|
|
1103
1107
|
key: 0,
|
|
1104
|
-
navigate: () => !
|
|
1105
|
-
active:
|
|
1106
|
-
}) : (
|
|
1108
|
+
navigate: () => !O(r).containsToday && O(r).goToToday(),
|
|
1109
|
+
active: O(r).containsToday
|
|
1110
|
+
}) : (E(), j("button", {
|
|
1107
1111
|
key: 1,
|
|
1108
|
-
class:
|
|
1109
|
-
onClick:
|
|
1110
|
-
disabled: !!
|
|
1112
|
+
class: _e(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": O(r).containsToday }]),
|
|
1113
|
+
onClick: v[1] || (v[1] = (C) => !O(r).containsToday && O(r).goToToday()),
|
|
1114
|
+
disabled: !!O(r).containsToday,
|
|
1111
1115
|
type: "button",
|
|
1112
|
-
innerHTML:
|
|
1116
|
+
innerHTML: O(n).texts.today
|
|
1113
1117
|
}, null, 10, $t))
|
|
1114
|
-
], 64)) :
|
|
1118
|
+
], 64)) : Z("", !0),
|
|
1115
1119
|
ge("button", {
|
|
1116
|
-
class:
|
|
1117
|
-
onClick:
|
|
1120
|
+
class: _e(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !L.$slots["next-button"] }]),
|
|
1121
|
+
onClick: v[2] || (v[2] = (...C) => O(r).next && O(r).next(...C)),
|
|
1118
1122
|
type: "button"
|
|
1119
1123
|
}, [
|
|
1120
|
-
F(
|
|
1124
|
+
F(L.$slots, "next-button")
|
|
1121
1125
|
], 2)
|
|
1122
|
-
])) :
|
|
1126
|
+
])) : Z("", !0)
|
|
1123
1127
|
], 64))
|
|
1124
1128
|
]));
|
|
1125
1129
|
}
|
|
1126
|
-
},
|
|
1130
|
+
}, Yt = {
|
|
1127
1131
|
key: 0,
|
|
1128
1132
|
class: "vuecal__headings"
|
|
1129
|
-
},
|
|
1133
|
+
}, Et = {
|
|
1130
1134
|
key: 0,
|
|
1131
1135
|
class: "vuecal__weekdays-headings"
|
|
1132
1136
|
}, St = ["onClick"], Ct = { class: "vuecal__weekday-day" }, Vt = {
|
|
@@ -1137,90 +1141,90 @@ const nt = (u, s) => {
|
|
|
1137
1141
|
class: "vuecal__schedules-headings w-flex grow"
|
|
1138
1142
|
}, jt = ["innerHTML"], Pt = {
|
|
1139
1143
|
__name: "headings-bar",
|
|
1140
|
-
setup(
|
|
1141
|
-
const
|
|
1142
|
-
id: Re[
|
|
1143
|
-
date:
|
|
1144
|
-
dateNumber:
|
|
1145
|
-
day:
|
|
1146
|
-
"day-sm":
|
|
1147
|
-
"day-xs":
|
|
1148
|
-
isToday:
|
|
1144
|
+
setup(D) {
|
|
1145
|
+
const n = Ne("vuecal"), { view: r, config: g, dateUtils: p } = n, b = T(() => g.xs ? "day-xs" : g.sm || r.isDays || r.isMonth ? "day-sm" : "day"), L = T(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !g.schedules)), v = T(() => r.cellDates.slice(0, r.cols).map(({ start: o }) => ({
|
|
1146
|
+
id: Re[o.getDay()],
|
|
1147
|
+
date: o,
|
|
1148
|
+
dateNumber: o.getDate(),
|
|
1149
|
+
day: p.formatDate(o, "dddd"),
|
|
1150
|
+
"day-sm": p.formatDate(o, "ddd"),
|
|
1151
|
+
"day-xs": p.formatDate(o, "dd"),
|
|
1152
|
+
isToday: p.isToday(o)
|
|
1149
1153
|
}))), C = {
|
|
1150
|
-
click: (
|
|
1151
|
-
(r.isDays || r.isWeek) && r.updateSelectedDate(
|
|
1154
|
+
click: (o) => {
|
|
1155
|
+
(r.isDays || r.isWeek) && r.updateSelectedDate(o);
|
|
1152
1156
|
}
|
|
1153
1157
|
};
|
|
1154
|
-
return (
|
|
1155
|
-
|
|
1156
|
-
(
|
|
1157
|
-
class:
|
|
1158
|
+
return (o, m) => L.value ? (E(), j("div", Yt, [
|
|
1159
|
+
O(r).isDay ? Z("", !0) : (E(), j("div", Et, [
|
|
1160
|
+
(E(!0), j(te, null, we(v.value, ($, W) => (E(), j("div", {
|
|
1161
|
+
class: _e(["vuecal__weekday", { "vuecal__weekday--today": $.isToday }]),
|
|
1158
1162
|
key: W,
|
|
1159
1163
|
onClick: (G) => C.click($.date)
|
|
1160
1164
|
}, [
|
|
1161
|
-
F(
|
|
1165
|
+
F(o.$slots, "weekday-heading", {
|
|
1162
1166
|
label: $[b.value],
|
|
1163
1167
|
id: $.id,
|
|
1164
1168
|
date: $.date
|
|
1165
1169
|
}, () => [
|
|
1166
1170
|
ge("span", Ct, le($[b.value]), 1),
|
|
1167
|
-
|
|
1171
|
+
O(r).isMonth ? Z("", !0) : (E(), j("strong", Vt, le($.dateNumber), 1))
|
|
1168
1172
|
])
|
|
1169
1173
|
], 10, St))), 128))
|
|
1170
1174
|
])),
|
|
1171
|
-
|
|
1172
|
-
(
|
|
1173
|
-
(
|
|
1174
|
-
|
|
1175
|
+
O(g).schedules ? (E(), j("div", Ot, [
|
|
1176
|
+
(E(!0), j(te, null, we(v.value, ($, W) => (E(), j(te, { key: W }, [
|
|
1177
|
+
(E(!0), j(te, null, we(O(g).schedules, (G, i) => (E(), j(te, { key: i }, [
|
|
1178
|
+
o.$slots["schedule-heading"] ? (E(), j("div", {
|
|
1175
1179
|
key: 0,
|
|
1176
|
-
class:
|
|
1180
|
+
class: _e(["vuecal__schedule vuecal__schedule--heading", G.class])
|
|
1177
1181
|
}, [
|
|
1178
|
-
F(
|
|
1182
|
+
F(o.$slots, "schedule-heading", {
|
|
1179
1183
|
schedule: G,
|
|
1180
|
-
view:
|
|
1184
|
+
view: O(r)
|
|
1181
1185
|
})
|
|
1182
|
-
], 2)) : (
|
|
1186
|
+
], 2)) : (E(), j("div", {
|
|
1183
1187
|
key: 1,
|
|
1184
|
-
class:
|
|
1188
|
+
class: _e(["vuecal__schedule vuecal__schedule--heading", G.class]),
|
|
1185
1189
|
innerHTML: G.label
|
|
1186
1190
|
}, null, 10, jt))
|
|
1187
1191
|
], 64))), 128))
|
|
1188
1192
|
], 64))), 128))
|
|
1189
|
-
])) :
|
|
1190
|
-
])) :
|
|
1193
|
+
])) : Z("", !0)
|
|
1194
|
+
])) : Z("", !0);
|
|
1191
1195
|
}
|
|
1192
1196
|
}, Ht = { class: "vuecal__time-column" }, Lt = {
|
|
1193
1197
|
__name: "time-column",
|
|
1194
|
-
setup(
|
|
1195
|
-
const
|
|
1198
|
+
setup(D) {
|
|
1199
|
+
const n = Ne("vuecal"), { config: r, texts: g } = n, p = T(() => {
|
|
1196
1200
|
const b = [];
|
|
1197
|
-
for (let
|
|
1198
|
-
const C = ~~(
|
|
1201
|
+
for (let v = r.timeFrom; v < r.timeTo; v += r.timeStep) {
|
|
1202
|
+
const C = ~~(v / 60), o = v % 60, m = g[v < 720 ? "am" : "pm"];
|
|
1199
1203
|
b.push({
|
|
1200
|
-
minutesSum:
|
|
1204
|
+
minutesSum: v,
|
|
1201
1205
|
// The sum of hours + minutes in minutes.
|
|
1202
1206
|
hours: C,
|
|
1203
|
-
minutes:
|
|
1204
|
-
formatted12: `${C % 12 ? C % 12 : 12}${
|
|
1205
|
-
formatted24: `${C.toString().padStart(2, 0)}:${
|
|
1207
|
+
minutes: o,
|
|
1208
|
+
formatted12: `${C % 12 ? C % 12 : 12}${o ? ":" + o.toString().padStart(2, 0) : ""}${m}`,
|
|
1209
|
+
formatted24: `${C.toString().padStart(2, 0)}:${o.toString().padStart(2, 0)}`
|
|
1206
1210
|
});
|
|
1207
1211
|
}
|
|
1208
1212
|
return b;
|
|
1209
1213
|
});
|
|
1210
|
-
return (b,
|
|
1211
|
-
(
|
|
1214
|
+
return (b, L) => (E(), j("div", Ht, [
|
|
1215
|
+
(E(!0), j(te, null, we(p.value, (v, C) => (E(), j("div", {
|
|
1212
1216
|
class: "vuecal__time-cell",
|
|
1213
1217
|
key: C
|
|
1214
1218
|
}, [
|
|
1215
1219
|
F(b.$slots, "time-cell", {
|
|
1216
1220
|
index: C,
|
|
1217
|
-
minutes:
|
|
1218
|
-
hours:
|
|
1219
|
-
minutesSum:
|
|
1220
|
-
format12:
|
|
1221
|
-
format24:
|
|
1221
|
+
minutes: v.minutes,
|
|
1222
|
+
hours: v.hours,
|
|
1223
|
+
minutesSum: v.minutesSum,
|
|
1224
|
+
format12: v.formatted12,
|
|
1225
|
+
format24: v.formatted24
|
|
1222
1226
|
}, () => [
|
|
1223
|
-
ge("label", null, le(
|
|
1227
|
+
ge("label", null, le(O(r).twelveHour ? v.formatted12 : v.formatted24), 1)
|
|
1224
1228
|
])
|
|
1225
1229
|
]))), 128))
|
|
1226
1230
|
]));
|
|
@@ -1234,8 +1238,8 @@ const nt = (u, s) => {
|
|
|
1234
1238
|
event: { type: Object, required: !0 }
|
|
1235
1239
|
},
|
|
1236
1240
|
emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
|
|
1237
|
-
setup(
|
|
1238
|
-
const { config: r, view:
|
|
1241
|
+
setup(D, { emit: n }) {
|
|
1242
|
+
const { config: r, view: g, dnd: p, touch: b, dateUtils: L } = Ne("vuecal"), v = D, C = ie(null), o = $e(v.event), m = $e({
|
|
1239
1243
|
dragging: !1,
|
|
1240
1244
|
resizing: !1,
|
|
1241
1245
|
fromResizer: !1,
|
|
@@ -1269,159 +1273,159 @@ const nt = (u, s) => {
|
|
|
1269
1273
|
cellEl: null,
|
|
1270
1274
|
// Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
|
|
1271
1275
|
schedule: null
|
|
1272
|
-
}), $ = T(() => r.editableEvents.drag &&
|
|
1273
|
-
T(() => r.editableEvents.delete &&
|
|
1276
|
+
}), $ = T(() => r.editableEvents.drag && o.draggable !== !1 && !o.background), W = T(() => r.time && r.editableEvents.resize && o.resizable !== !1 && !o.background);
|
|
1277
|
+
T(() => r.editableEvents.delete && o.deletable !== !1 && !o.background);
|
|
1274
1278
|
const G = T(() => {
|
|
1275
|
-
var
|
|
1279
|
+
var s, l, k;
|
|
1276
1280
|
return {
|
|
1277
|
-
[`vuecal__event--${
|
|
1278
|
-
[
|
|
1279
|
-
"vuecal__event--recurring": !!
|
|
1280
|
-
"vuecal__event--background": !!
|
|
1281
|
-
"vuecal__event--multiday": !!((
|
|
1282
|
-
"vuecal__event--cut-top": ((
|
|
1283
|
-
"vuecal__event--cut-bottom": ((
|
|
1281
|
+
[`vuecal__event--${o._.id}`]: !0,
|
|
1282
|
+
[o.class]: !!o.class,
|
|
1283
|
+
"vuecal__event--recurring": !!o.recurring,
|
|
1284
|
+
"vuecal__event--background": !!o.background,
|
|
1285
|
+
"vuecal__event--multiday": !!((s = o._) != null && s.multiday),
|
|
1286
|
+
"vuecal__event--cut-top": ((l = o._) == null ? void 0 : l.startMinutes) < r.timeFrom,
|
|
1287
|
+
"vuecal__event--cut-bottom": ((k = o._) == null ? void 0 : k.endMinutes) > r.timeTo || o.end.getDate() !== o.start.getDate(),
|
|
1284
1288
|
// Only apply the dragging class on the event copy that is being dragged.
|
|
1285
|
-
"vuecal__event--dragging": !
|
|
1289
|
+
"vuecal__event--dragging": !o._.draggingGhost && o._.dragging,
|
|
1286
1290
|
// Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
|
|
1287
1291
|
// dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
|
|
1288
1292
|
// invisible, so if dragging is false, disable the dragging-ghost class as well.
|
|
1289
1293
|
// On event drop, if the new position of the event is approved, only remove the dragging-ghost class
|
|
1290
1294
|
// after event deletion (event._.dragging is already false) so the event ghost does not flash in before
|
|
1291
1295
|
// deletion.
|
|
1292
|
-
"vuecal__event--dragging-ghost":
|
|
1293
|
-
"vuecal__event--resizing":
|
|
1296
|
+
"vuecal__event--dragging-ghost": o._.draggingGhost,
|
|
1297
|
+
"vuecal__event--resizing": m.resizing
|
|
1294
1298
|
};
|
|
1295
|
-
}),
|
|
1296
|
-
const
|
|
1297
|
-
if (!
|
|
1298
|
-
const
|
|
1299
|
-
backgroundColor:
|
|
1300
|
-
color:
|
|
1299
|
+
}), i = T(() => {
|
|
1300
|
+
const s = (g.isDay || g.isDays || g.isWeek) && r.time;
|
|
1301
|
+
if (!s && !o.backgroundColor && !o.color) return !1;
|
|
1302
|
+
const l = {
|
|
1303
|
+
backgroundColor: o.backgroundColor || null,
|
|
1304
|
+
color: o.color || null
|
|
1301
1305
|
};
|
|
1302
|
-
if (
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1306
|
+
if (s) {
|
|
1307
|
+
const k = Math.max(r.timeFrom, o._.startMinutes), t = Math.min(r.timeTo, o._.endMinutes), V = Ve(k, r), H = Ve(t, r) - V;
|
|
1308
|
+
l.top = `${V}%`, l.height = `${H}%`;
|
|
1305
1309
|
}
|
|
1306
|
-
return
|
|
1307
|
-
}),
|
|
1308
|
-
const
|
|
1309
|
-
Object.entries(
|
|
1310
|
-
["resize-end"].includes(t) || (
|
|
1311
|
-
|
|
1310
|
+
return l;
|
|
1311
|
+
}), u = T(() => {
|
|
1312
|
+
const s = { ...r.eventListeners.event };
|
|
1313
|
+
Object.entries(s).forEach(([t, V]) => {
|
|
1314
|
+
["resize-end"].includes(t) || (s[t] = (H) => {
|
|
1315
|
+
H.type !== "drop" && V(H.type ? { e: H, event: o } : H);
|
|
1312
1316
|
});
|
|
1313
1317
|
});
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
var
|
|
1317
|
-
t.stopPropagation(), e(t), (
|
|
1318
|
-
},
|
|
1319
|
-
var
|
|
1320
|
-
t.stopPropagation(), e(t), (
|
|
1318
|
+
const l = { ...s };
|
|
1319
|
+
s.touchstart = (t) => {
|
|
1320
|
+
var V;
|
|
1321
|
+
t.stopPropagation(), e(t), (V = l.touchstart) == null || V.call(l, { e: t, event: o });
|
|
1322
|
+
}, s.mousedown = (t) => {
|
|
1323
|
+
var V;
|
|
1324
|
+
t.stopPropagation(), e(t), (V = l.mousedown) == null || V.call(l, { e: t, event: o });
|
|
1321
1325
|
};
|
|
1322
|
-
let
|
|
1323
|
-
return
|
|
1324
|
-
var
|
|
1325
|
-
(
|
|
1326
|
-
var
|
|
1327
|
-
|
|
1326
|
+
let k = null;
|
|
1327
|
+
return s.click = (t) => {
|
|
1328
|
+
var V;
|
|
1329
|
+
(V = l.click) == null || V.call(l, { e: t, event: o }), k ? k = clearTimeout(k) : k = setTimeout(() => {
|
|
1330
|
+
var H;
|
|
1331
|
+
k = null, (H = l["delayed-click"]) == null || H.call(l, { e: t, event: o });
|
|
1328
1332
|
}, 400);
|
|
1329
|
-
},
|
|
1330
|
-
|
|
1331
|
-
},
|
|
1332
|
-
}), e = (
|
|
1333
|
-
var t,
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1338
|
-
var
|
|
1339
|
-
|
|
1333
|
+
}, s.dblclick = (t) => {
|
|
1334
|
+
l.dblclick ? l.dblclick({ e: t, event: o }) : o.delete(1);
|
|
1335
|
+
}, s;
|
|
1336
|
+
}), e = (s) => {
|
|
1337
|
+
var t, V, H;
|
|
1338
|
+
const l = ((t = s.touches) == null ? void 0 : t[0]) || s;
|
|
1339
|
+
m.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
|
|
1340
|
+
const k = C.value.getBoundingClientRect();
|
|
1341
|
+
m.startX = (((V = s.touches) == null ? void 0 : V[0]) || s).clientX - k.left, m.startY = (((H = s.touches) == null ? void 0 : H[0]) || s).clientY - k.top, m.startPercentageX = m.startX * 100 / k.width, m.startPercentageY = m.startY * 100 / k.height, m.cellEl = C.value.closest(".vuecal__cell"), m.resizeStartDate = o.start, A(s.type === "touchstart" ? "touchmove" : "mousemove", d), A(s.type === "touchstart" ? "touchend" : "mouseup", h, { once: !0 }), m.holdTimer = setTimeout(() => {
|
|
1342
|
+
var U, K;
|
|
1343
|
+
m.holding = !0, (K = (U = u.value).hold) == null || K.call(U, { e: s, event: o });
|
|
1340
1344
|
}, 1e3);
|
|
1341
|
-
},
|
|
1342
|
-
var
|
|
1343
|
-
const
|
|
1344
|
-
if (
|
|
1345
|
-
const { top:
|
|
1346
|
-
|
|
1345
|
+
}, d = async (s) => {
|
|
1346
|
+
var k, t, V, H;
|
|
1347
|
+
const l = ((k = s.touches) == null ? void 0 : k[0]) || s;
|
|
1348
|
+
if (m.fromResizer && !m.resizing && (m.resizing = !0, m.resizingOriginalEvent = { ...o, _: { ...o._ } }, b.isResizingEvent = !0, (V = (t = u.value).resizeStart) == null || V.call(t, { e: s, event: o })), m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.cellEl) {
|
|
1349
|
+
const { top: U, left: K, width: ue, height: ae } = m.cellEl.getBoundingClientRect();
|
|
1350
|
+
m.moveX = l.clientX - K, m.moveY = l.clientY - U, m.movePercentageX = m.moveX * 100 / ue, m.movePercentageY = m.moveY * 100 / ae;
|
|
1347
1351
|
}
|
|
1348
|
-
if (
|
|
1349
|
-
const { newStart:
|
|
1352
|
+
if (m.fromResizer) {
|
|
1353
|
+
const { newStart: U, newEnd: K } = Y(o);
|
|
1350
1354
|
let ue = !0;
|
|
1351
|
-
const { resize: ae } = (
|
|
1355
|
+
const { resize: ae } = (H = r.eventListeners) == null ? void 0 : H.event;
|
|
1352
1356
|
ae && (ue = await ae({
|
|
1353
|
-
e:
|
|
1354
|
-
event: { ...
|
|
1355
|
-
overlaps:
|
|
1356
|
-
})), ue !== !1 ? (
|
|
1357
|
+
e: s,
|
|
1358
|
+
event: { ...o, start: U, end: K },
|
|
1359
|
+
overlaps: o.getOverlappingEvents({ start: U, end: K })
|
|
1360
|
+
})), ue !== !1 ? (o.start = U, o.end = K, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null)) : ae && (m.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
|
|
1357
1361
|
}
|
|
1358
|
-
}, h = async (
|
|
1359
|
-
var
|
|
1360
|
-
if (
|
|
1361
|
-
const { newStart: t, newEnd:
|
|
1362
|
-
let
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
e:
|
|
1366
|
-
event:
|
|
1367
|
-
original:
|
|
1362
|
+
}, h = async (s) => {
|
|
1363
|
+
var l, k;
|
|
1364
|
+
if (m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.resizing) {
|
|
1365
|
+
const { newStart: t, newEnd: V } = Y(o);
|
|
1366
|
+
let H = !0;
|
|
1367
|
+
const U = u.value["resize-end"];
|
|
1368
|
+
U && (H = await U({
|
|
1369
|
+
e: s,
|
|
1370
|
+
event: o,
|
|
1371
|
+
original: m.resizingOriginalEvent,
|
|
1368
1372
|
// Original event details before resizing.
|
|
1369
|
-
overlaps:
|
|
1370
|
-
})),
|
|
1373
|
+
overlaps: o.getOverlappingEvents({ start: t, end: V })
|
|
1374
|
+
})), o.start = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((l = m.resizingLastAcceptedEvent) == null ? void 0 : l.start) || t, o.end = H === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((k = m.resizingLastAcceptedEvent) == null ? void 0 : k.end) || V, o._.duration < 1 && (o.start = m.resizingOriginalEvent.start, o.end = m.resizingOriginalEvent.end), b.isResizingEvent = !1;
|
|
1371
1375
|
}
|
|
1372
|
-
document.removeEventListener(
|
|
1373
|
-
},
|
|
1374
|
-
const
|
|
1375
|
-
new Date(
|
|
1376
|
-
let t = Pe(
|
|
1376
|
+
document.removeEventListener(s.type === "touchend" ? "touchmove" : "mousemove", d), m.resizing = !1, m.fromResizer = !1, m.dragging = !1, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.cellEl = null, m.resizeStartDate = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.schedule = null;
|
|
1377
|
+
}, Y = (s) => {
|
|
1378
|
+
const l = new Date(s.start.getFullYear(), s.start.getMonth(), s.start.getDate());
|
|
1379
|
+
new Date(l).setDate(l.getDate() + 1);
|
|
1380
|
+
let t = Pe(m.movePercentageY, r);
|
|
1377
1381
|
if (t = Math.max(0, Math.min(t, 24 * 60)), r.snapToInterval) {
|
|
1378
|
-
const
|
|
1379
|
-
t =
|
|
1382
|
+
const U = t + r.snapToInterval / 2;
|
|
1383
|
+
t = U - U % r.snapToInterval;
|
|
1380
1384
|
}
|
|
1381
|
-
let
|
|
1382
|
-
return
|
|
1385
|
+
let V = s.start, H = new Date(l.getTime() + t * 6e4);
|
|
1386
|
+
return H < m.resizeStartDate && (V = H, H = m.resizeStartDate), { newStart: V, newEnd: H };
|
|
1383
1387
|
};
|
|
1384
|
-
Ze(() =>
|
|
1385
|
-
const
|
|
1386
|
-
document.addEventListener(
|
|
1388
|
+
Ze(() => o._.register(C.value));
|
|
1389
|
+
const P = [], A = (s, l, k) => {
|
|
1390
|
+
document.addEventListener(s, l, k), P.push({ event: s, handler: l, options: k });
|
|
1387
1391
|
};
|
|
1388
1392
|
return Xe(() => {
|
|
1389
|
-
|
|
1390
|
-
document.removeEventListener(
|
|
1393
|
+
o._.unregister(), P.forEach(({ event: s, handler: l, options: k }) => {
|
|
1394
|
+
document.removeEventListener(s, l, k);
|
|
1391
1395
|
});
|
|
1392
|
-
}), (
|
|
1396
|
+
}), (s, l) => (E(), j("div", De({ class: "vuecal__event" }, Ie(u.value, !0), {
|
|
1393
1397
|
ref_key: "eventEl",
|
|
1394
1398
|
ref: C,
|
|
1395
1399
|
class: G.value,
|
|
1396
|
-
style:
|
|
1400
|
+
style: i.value,
|
|
1397
1401
|
draggable: $.value ? "true" : void 0,
|
|
1398
|
-
onDragstart:
|
|
1399
|
-
onDragend:
|
|
1402
|
+
onDragstart: l[2] || (l[2] = (k) => $.value && O(p).eventDragStart(k, o)),
|
|
1403
|
+
onDragend: l[3] || (l[3] = (k) => $.value && O(p).eventDragEnd(k, o))
|
|
1400
1404
|
}), [
|
|
1401
1405
|
ge("div", Ft, [
|
|
1402
|
-
F(
|
|
1403
|
-
ge("div", Nt, le(
|
|
1404
|
-
|
|
1405
|
-
- ` + le(
|
|
1406
|
+
F(s.$slots, "event", { event: o }, () => [
|
|
1407
|
+
ge("div", Nt, le(o.title), 1),
|
|
1408
|
+
O(r).time ? (E(), j("div", Wt, le(o._[`startTimeFormatted${O(r).twelveHour ? 12 : 24}`]) + `
|
|
1409
|
+
- ` + le(o._[`endTimeFormatted${O(r).twelveHour ? 12 : 24}`]), 1)) : Z("", !0),
|
|
1406
1410
|
ge("div", {
|
|
1407
1411
|
class: "vuecal__event-content",
|
|
1408
|
-
innerHTML:
|
|
1412
|
+
innerHTML: o.content
|
|
1409
1413
|
}, null, 8, Bt)
|
|
1410
1414
|
])
|
|
1411
1415
|
]),
|
|
1412
|
-
W.value ? (
|
|
1416
|
+
W.value ? (E(), j("div", {
|
|
1413
1417
|
key: 0,
|
|
1414
1418
|
class: "vuecal__event-resizer",
|
|
1415
|
-
onDragstart:
|
|
1419
|
+
onDragstart: l[0] || (l[0] = Qe(() => {
|
|
1416
1420
|
}, ["prevent", "stop"]))
|
|
1417
|
-
}, null, 32)) :
|
|
1421
|
+
}, null, 32)) : Z("", !0),
|
|
1418
1422
|
Oe(Ge, { name: "vuecal-delete-btn" }, {
|
|
1419
|
-
default:
|
|
1420
|
-
|
|
1423
|
+
default: J(() => [
|
|
1424
|
+
o._.deleting ? (E(), j("div", {
|
|
1421
1425
|
key: 0,
|
|
1422
1426
|
class: "vuecal__event-delete",
|
|
1423
|
-
onClick:
|
|
1424
|
-
}, "Delete")) :
|
|
1427
|
+
onClick: l[1] || (l[1] = Qe((k) => o.delete(3), ["stop"]))
|
|
1428
|
+
}, "Delete")) : Z("", !0)
|
|
1425
1429
|
]),
|
|
1426
1430
|
_: 1
|
|
1427
1431
|
})
|
|
@@ -1457,10 +1461,10 @@ const nt = (u, s) => {
|
|
|
1457
1461
|
end: { type: Date, required: !0 },
|
|
1458
1462
|
index: { type: Number, required: !0 }
|
|
1459
1463
|
},
|
|
1460
|
-
setup(
|
|
1461
|
-
const
|
|
1462
|
-
$.value.push(
|
|
1463
|
-
},
|
|
1464
|
+
setup(D) {
|
|
1465
|
+
const n = D, r = Ne("vuecal"), { view: g, config: p, dateUtils: b, eventsManager: L, dnd: v, touch: C } = r, o = T(() => b.isToday(n.start)), m = ie(null), $ = ie([]), W = ie(!1), G = (c) => {
|
|
1466
|
+
$.value.push(c.detail), W.value = !0;
|
|
1467
|
+
}, i = () => setTimeout(() => W.value = !1, 300), u = $e({
|
|
1464
1468
|
dragging: !1,
|
|
1465
1469
|
holding: !1,
|
|
1466
1470
|
// When the cell is clicked and hold for a certain amount of time.
|
|
@@ -1481,431 +1485,407 @@ const nt = (u, s) => {
|
|
|
1481
1485
|
movePercentageX: 0,
|
|
1482
1486
|
movePercentageY: 0,
|
|
1483
1487
|
schedule: null
|
|
1484
|
-
}), e =
|
|
1485
|
-
let
|
|
1486
|
-
return
|
|
1488
|
+
}), e = ie(!1), d = ie({ cellOverlaps: {}, longestStreak: 0 }), h = T(() => {
|
|
1489
|
+
let c = Math.min(u.startPercentageY, u.movePercentageY), w = Math.max(u.startPercentageY, u.movePercentageY), S = Pe(c, p), M = Pe(w, p);
|
|
1490
|
+
return p.snapToInterval && (S = b.snapToInterval(S, p.snapToInterval), M = b.snapToInterval(M, p.snapToInterval), c = Ve(S, p), w = Ve(M, p)), {
|
|
1487
1491
|
style: {
|
|
1488
|
-
top:
|
|
1489
|
-
height: Math.abs(
|
|
1492
|
+
top: c + "%",
|
|
1493
|
+
height: Math.abs(w - c) + "%"
|
|
1490
1494
|
},
|
|
1491
|
-
startMinutes:
|
|
1495
|
+
startMinutes: S,
|
|
1492
1496
|
endMinutes: M,
|
|
1493
|
-
start: b.formatMinutes(
|
|
1497
|
+
start: b.formatMinutes(S),
|
|
1494
1498
|
end: b.formatMinutes(M),
|
|
1495
|
-
...
|
|
1499
|
+
...u.schedule ? { schedule: u.schedule } : {}
|
|
1496
1500
|
};
|
|
1497
|
-
}),
|
|
1498
|
-
const
|
|
1499
|
-
return
|
|
1500
|
-
}),
|
|
1501
|
+
}), Y = T(() => {
|
|
1502
|
+
const c = p.editableEvents.create && (u.dragging || e.value), w = p.eventCreateMinDrag && u.thresholdPassed || !p.eventCreateMinDrag;
|
|
1503
|
+
return c && w;
|
|
1504
|
+
}), P = T(() => {
|
|
1501
1505
|
var x;
|
|
1502
|
-
const
|
|
1506
|
+
const c = /* @__PURE__ */ new Date(), w = g.start.getFullYear(), S = g.start.getMonth(), M = n.start.getFullYear(), N = n.start.getMonth();
|
|
1503
1507
|
return {
|
|
1504
|
-
[`vuecal__cell--${Re[
|
|
1505
|
-
[`vuecal__cell--${dt[N]}`]:
|
|
1506
|
-
[`vuecal__cell--${M}`]:
|
|
1507
|
-
"vuecal__cell--today":
|
|
1508
|
-
"vuecal__cell--current-month":
|
|
1509
|
-
"vuecal__cell--current-year":
|
|
1510
|
-
"vuecal__cell--out-of-range":
|
|
1511
|
-
"vuecal__cell--before-min": ae.value &&
|
|
1508
|
+
[`vuecal__cell--${Re[n.start.getDay()]}`]: g.isDay || g.isDays || g.isWeek || g.isMonth,
|
|
1509
|
+
[`vuecal__cell--${dt[N]}`]: g.isYear,
|
|
1510
|
+
[`vuecal__cell--${M}`]: g.isYears,
|
|
1511
|
+
"vuecal__cell--today": o.value,
|
|
1512
|
+
"vuecal__cell--current-month": g.isYear && M === c.getFullYear() && N === c.getMonth(),
|
|
1513
|
+
"vuecal__cell--current-year": g.isYears && M === c.getFullYear(),
|
|
1514
|
+
"vuecal__cell--out-of-range": g.isMonth && (M !== w || N !== S),
|
|
1515
|
+
"vuecal__cell--before-min": ae.value && K.value,
|
|
1512
1516
|
"vuecal__cell--after-max": ae.value && ue.value,
|
|
1513
1517
|
"vuecal__cell--disabled": ae.value,
|
|
1514
|
-
"vuecal__cell--selected":
|
|
1515
|
-
"vuecal__cell--has-schedules": (x =
|
|
1516
|
-
"vuecal__cell--dragging":
|
|
1517
|
-
"vuecal__cell--has-events":
|
|
1518
|
+
"vuecal__cell--selected": g.selectedDate && g.selectedDate.getTime() >= n.start.getTime() && g.selectedDate.getTime() <= n.end.getTime(),
|
|
1519
|
+
"vuecal__cell--has-schedules": (x = p.schedules) == null ? void 0 : x.length,
|
|
1520
|
+
"vuecal__cell--dragging": u.dragging,
|
|
1521
|
+
"vuecal__cell--has-events": l.value.length
|
|
1518
1522
|
};
|
|
1519
|
-
}), A = T(() => b.formatDate(
|
|
1520
|
-
switch (
|
|
1523
|
+
}), A = T(() => b.formatDate(n.start)), s = T(() => {
|
|
1524
|
+
switch (g.id) {
|
|
1521
1525
|
case "day":
|
|
1522
1526
|
return "";
|
|
1523
1527
|
case "days":
|
|
1524
|
-
return
|
|
1528
|
+
return p.availableViews.days.rows > 1 && b.formatDate(n.start, "D"), "";
|
|
1525
1529
|
case "week":
|
|
1526
1530
|
return "";
|
|
1527
1531
|
case "month":
|
|
1528
|
-
return b.formatDate(
|
|
1532
|
+
return b.formatDate(n.start, "D");
|
|
1529
1533
|
case "year":
|
|
1530
|
-
return b.formatDate(
|
|
1534
|
+
return b.formatDate(n.start, p.xs ? "MMM" : "MMMM");
|
|
1531
1535
|
case "years":
|
|
1532
|
-
return b.formatDate(
|
|
1536
|
+
return b.formatDate(n.start, "YYYY");
|
|
1533
1537
|
}
|
|
1534
|
-
}),
|
|
1535
|
-
var
|
|
1536
|
-
return (
|
|
1537
|
-
}),
|
|
1538
|
-
const
|
|
1539
|
-
for (const
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1538
|
+
}), l = T(() => p.datePicker ? [] : L.getEventsByDate(A.value, !0, !0).filter((c) => !$.value.includes(c._.id))), k = T(() => l.value.filter((c) => !c.background)), t = T(() => {
|
|
1539
|
+
var c;
|
|
1540
|
+
return (c = p.schedules) == null ? void 0 : c.reduce((w, S) => (w[S.id] = l.value.filter((M) => M.schedule === S.id), w), {});
|
|
1541
|
+
}), V = T(() => {
|
|
1542
|
+
const c = {};
|
|
1543
|
+
for (const w of l.value) {
|
|
1544
|
+
const S = w._.id, { maxConcurrent: M = 1, position: N = 0 } = d.value.cellOverlaps[S] || {};
|
|
1545
|
+
c[S] = {
|
|
1542
1546
|
width: `${100 / M}%`,
|
|
1543
1547
|
left: `${100 / M * N}%`
|
|
1544
1548
|
};
|
|
1545
1549
|
}
|
|
1546
|
-
return
|
|
1547
|
-
}),
|
|
1548
|
-
var
|
|
1549
|
-
if (!
|
|
1550
|
-
const
|
|
1551
|
-
let
|
|
1552
|
-
if (
|
|
1553
|
-
return Array.isArray(
|
|
1550
|
+
return c;
|
|
1551
|
+
}), H = T(() => g.isMonth && p.eventCount && !p.eventsOnMonthView && k.value.length), U = T(() => {
|
|
1552
|
+
var S;
|
|
1553
|
+
if (!p.specialHours || g.isMonth || g.isYear || g.isYears) return;
|
|
1554
|
+
const c = Re[n.start.getDay()];
|
|
1555
|
+
let w = (S = p.specialHours) == null ? void 0 : S[c];
|
|
1556
|
+
if (w)
|
|
1557
|
+
return Array.isArray(w) || (w = [w]), w.map((M) => {
|
|
1554
1558
|
let { from: N, to: I, class: x, label: de } = M;
|
|
1555
|
-
if (isNaN(N) || isNaN(I) ||
|
|
1556
|
-
N = Math.max(
|
|
1557
|
-
const ye = Ve(N,
|
|
1559
|
+
if (isNaN(N) || isNaN(I) || p.timeFrom >= I || p.timeTo <= N) return;
|
|
1560
|
+
N = Math.max(p.timeFrom, N), I = Math.min(p.timeTo, I);
|
|
1561
|
+
const ye = Ve(N, p), f = Ve(I, p) - ye;
|
|
1558
1562
|
return {
|
|
1559
|
-
style: { top: `${ye}%`, height: `${
|
|
1563
|
+
style: { top: `${ye}%`, height: `${f}%` },
|
|
1560
1564
|
label: de,
|
|
1561
1565
|
class: x
|
|
1562
1566
|
};
|
|
1563
1567
|
}).filter((M) => !!M);
|
|
1564
|
-
}),
|
|
1565
|
-
const { disableDays:
|
|
1566
|
-
return
|
|
1568
|
+
}), K = T(() => p.minTimestamp !== null && p.minTimestamp > n.end.getTime()), ue = T(() => p.maxTimestamp && p.maxTimestamp < n.start.getTime()), ae = T(() => {
|
|
1569
|
+
const { disableDays: c } = p, w = g.isYear || g.isYears;
|
|
1570
|
+
return c.length && c.includes(b.formatDate(n.start)) && !w ? !0 : K.value || ue.value;
|
|
1567
1571
|
}), re = $e({
|
|
1568
1572
|
show: T(() => {
|
|
1569
|
-
if (!(!
|
|
1573
|
+
if (!(!g.isDay && !g.isDays && !g.isWeek) && !(!o.value || !p.time) && !(p.timeFrom > b.dateToMinutes(g.now)) && !(b.dateToMinutes(g.now) > p.timeTo))
|
|
1570
1574
|
return !0;
|
|
1571
1575
|
}),
|
|
1572
|
-
nowInMinutes: T(() => b.dateToMinutes(
|
|
1573
|
-
todaysTimePosition: T(() => Ve(re.nowInMinutes,
|
|
1576
|
+
nowInMinutes: T(() => b.dateToMinutes(g.now)),
|
|
1577
|
+
todaysTimePosition: T(() => Ve(re.nowInMinutes, p)),
|
|
1574
1578
|
style: T(() => `top: ${re.todaysTimePosition}%`),
|
|
1575
|
-
currentTime: T(() => b.formatTime(
|
|
1579
|
+
currentTime: T(() => b.formatTime(g.now))
|
|
1576
1580
|
}), he = T(() => {
|
|
1577
1581
|
if (ae.value) return {};
|
|
1578
|
-
const
|
|
1579
|
-
Object.entries(
|
|
1580
|
-
|
|
1582
|
+
const c = { ...p.eventListeners.cell };
|
|
1583
|
+
Object.entries(c).forEach(([M, N]) => {
|
|
1584
|
+
c[M] = (I) => {
|
|
1581
1585
|
var x, de, ye;
|
|
1582
|
-
(ye = (de = I.target || ((x = I.e) == null ? void 0 : x.target)).closest) != null && ye.call(de, ".vuecal__event") || N(I.type ? { e: I, cell:
|
|
1586
|
+
(ye = (de = I.target || ((x = I.e) == null ? void 0 : x.target)).closest) != null && ye.call(de, ".vuecal__event") || N(I.type ? { e: I, cell: q.value, cursor: ce.value } : I);
|
|
1583
1587
|
};
|
|
1584
1588
|
});
|
|
1585
|
-
const
|
|
1586
|
-
let
|
|
1587
|
-
return
|
|
1589
|
+
const w = { ...c };
|
|
1590
|
+
let S = null;
|
|
1591
|
+
return c.click = (M) => {
|
|
1588
1592
|
var N;
|
|
1589
|
-
ee(), (N =
|
|
1593
|
+
ee(), (N = w.click) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value }), S ? S = clearTimeout(S) : S = setTimeout(() => {
|
|
1590
1594
|
var I;
|
|
1591
|
-
|
|
1595
|
+
S = null, (I = w["delayed-click"]) == null || I.call(w, { e: M, cell: q.value, cursor: ce.value });
|
|
1592
1596
|
}, 400);
|
|
1593
|
-
}, (
|
|
1597
|
+
}, (p.time && g.isDay || g.isDays || g.isWeek) && (c.touchstart = (M) => {
|
|
1594
1598
|
var N;
|
|
1595
|
-
|
|
1596
|
-
},
|
|
1599
|
+
oe(M.e || M), (N = w.touchstart) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value });
|
|
1600
|
+
}, c.mousedown = (M) => {
|
|
1597
1601
|
var N;
|
|
1598
|
-
|
|
1599
|
-
}),
|
|
1602
|
+
oe(M.e || M), (N = w.mousedown) == null || N.call(w, { e: M, cell: q.value, cursor: ce.value });
|
|
1603
|
+
}), w.dblclick && (c.dblclick = (M) => {
|
|
1600
1604
|
var z, R;
|
|
1601
|
-
const N = (((z = M.touches) == null ? void 0 : z[0]) || M).clientY, { top: I } =
|
|
1605
|
+
const N = (((z = M.touches) == null ? void 0 : z[0]) || M).clientY, { top: I } = m.value.getBoundingClientRect(), x = Je(N - I, m.value), de = Pe(x, p), ye = new Date(n.start);
|
|
1602
1606
|
ye.setMinutes(de);
|
|
1603
|
-
const
|
|
1607
|
+
const f = {
|
|
1604
1608
|
y: x,
|
|
1605
1609
|
date: ye
|
|
1606
1610
|
};
|
|
1607
|
-
(R =
|
|
1608
|
-
}),
|
|
1609
|
-
M.preventDefault(),
|
|
1610
|
-
},
|
|
1611
|
-
}),
|
|
1612
|
-
start:
|
|
1613
|
-
end:
|
|
1614
|
-
events:
|
|
1615
|
-
...
|
|
1611
|
+
(R = w.dblclick) == null || R.call(w, { e: M, cell: q.value, cursor: f });
|
|
1612
|
+
}), p.editableEvents.drag && (c.dragenter = (M) => v.cellDragEnter(M, q.value), c.dragover = (M) => {
|
|
1613
|
+
M.preventDefault(), v.cellDragOver(M, q.value);
|
|
1614
|
+
}, c.dragleave = (M) => v.cellDragLeave(M, q.value), c.drop = (M) => v.cellDragDrop(M, q.value)), c;
|
|
1615
|
+
}), q = T(() => ({
|
|
1616
|
+
start: n.start,
|
|
1617
|
+
end: n.end,
|
|
1618
|
+
events: l,
|
|
1619
|
+
...u.schedule ? { schedule: u.schedule } : {},
|
|
1620
|
+
goNarrower: () => g.narrower(),
|
|
1621
|
+
goBroader: () => g.broader(),
|
|
1622
|
+
broader: g.broaderView,
|
|
1623
|
+
narrower: g.narrowerView
|
|
1616
1624
|
})), ce = T(() => {
|
|
1617
|
-
const
|
|
1618
|
-
return
|
|
1619
|
-
x:
|
|
1620
|
-
y:
|
|
1621
|
-
date:
|
|
1625
|
+
const c = Pe(u.movePercentageY || u.startPercentageY, p), w = new Date(n.start);
|
|
1626
|
+
return w.setMinutes(c), {
|
|
1627
|
+
x: u.movePercentageX || u.startPercentageX,
|
|
1628
|
+
y: u.movePercentageY || u.startPercentageY,
|
|
1629
|
+
date: w
|
|
1622
1630
|
};
|
|
1623
1631
|
}), ee = () => {
|
|
1624
|
-
|
|
1625
|
-
},
|
|
1626
|
-
var
|
|
1627
|
-
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1632
|
+
g.updateSelectedDate(n.start), p.clickToNavigate && ((g.isMonth || g.isDays || g.isWeek) && p.availableViews.day ? g.switch("day") : g.isYear && p.availableViews.month ? g.switch("month") : g.isYears && p.availableViews.year && g.switch("year")), g.updateViewDate(n.start);
|
|
1633
|
+
}, oe = (c) => {
|
|
1634
|
+
var S, M;
|
|
1635
|
+
u.schedule = ~~c.target.dataset.schedule;
|
|
1636
|
+
const w = m.value.getBoundingClientRect();
|
|
1637
|
+
u.startX = (((S = c.touches) == null ? void 0 : S[0]) || c).clientX - w.left, u.startY = (((M = c.touches) == null ? void 0 : M[0]) || c).clientY - w.top, u.startPercentageX = u.startX * 100 / w.width, u.startPercentageY = u.startY * 100 / w.height, u.thresholdPassed = !1, document.addEventListener(c.type === "touchstart" ? "touchmove" : "mousemove", a), document.addEventListener(c.type === "touchstart" ? "touchend" : "mouseup", _, { once: !0 }), u.holdTimer = setTimeout(() => {
|
|
1630
1638
|
var N, I;
|
|
1631
|
-
|
|
1639
|
+
u.holding = !0, (I = (N = he.value).hold) == null || I.call(N, { e: c, cell: q.value, cursor: ce.value });
|
|
1632
1640
|
}, 1e3);
|
|
1633
|
-
}, a = (
|
|
1634
|
-
var
|
|
1635
|
-
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1638
|
-
},
|
|
1639
|
-
var
|
|
1640
|
-
document.removeEventListener(
|
|
1641
|
-
}, y = async (
|
|
1642
|
-
if (!
|
|
1643
|
-
let { start:
|
|
1644
|
-
|
|
1645
|
-
let I = { ...h.value, start:
|
|
1646
|
-
const { create: x } =
|
|
1641
|
+
}, a = (c) => {
|
|
1642
|
+
var S, M, N, I, x, de;
|
|
1643
|
+
u.dragging || (C.isDraggingCell = !0, (M = (S = he.value).dragStart) == null || M.call(S, { e: c, cell: q.value, cursor: ce.value })), u.dragging = !0, u.holdTimer = clearTimeout(u.holdTimer), u.holding = !1;
|
|
1644
|
+
const w = m.value.getBoundingClientRect();
|
|
1645
|
+
u.moveX = (((N = c.touches) == null ? void 0 : N[0]) || c).clientX - w.left, u.moveY = (((I = c.touches) == null ? void 0 : I[0]) || c).clientY - w.top, u.movePercentageX = u.moveX * 100 / w.width, u.movePercentageY = u.moveY * 100 / w.height, p.eventCreateMinDrag && Math.abs(u.startY - u.moveY) > p.eventCreateMinDrag && (u.thresholdPassed = !0), (de = (x = he.value).drag) == null || de.call(x, { e: c, cell: q.value, cursor: ce.value });
|
|
1646
|
+
}, _ = async (c) => {
|
|
1647
|
+
var w, S;
|
|
1648
|
+
document.removeEventListener(c.type === "touchend" ? "touchmove" : "mousemove", a, { passive: !1 }), u.dragging && ((S = (w = he.value).dragEnd) == null || S.call(w, { e: c, cell: q.value, cursor: ce.value }), C.isDraggingCell = !1, p.editableEvents.create && (e.value = !0, await y(c), e.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;
|
|
1649
|
+
}, y = async (c) => {
|
|
1650
|
+
if (!Y.value) return;
|
|
1651
|
+
let { start: w, end: S, startMinutes: M, endMinutes: N } = h.value;
|
|
1652
|
+
w = new Date(n.start), w.setMinutes(M), S = new Date(n.start), S.setMinutes(N);
|
|
1653
|
+
let I = { ...h.value, start: w, end: S };
|
|
1654
|
+
const { create: x } = p.eventListeners.event;
|
|
1647
1655
|
if (typeof x == "function") {
|
|
1648
1656
|
const de = I;
|
|
1649
|
-
I = await new Promise((ye) => x({ e:
|
|
1650
|
-
} else
|
|
1657
|
+
I = await new Promise((ye) => x({ e: c, event: I, cell: q.value, resolve: ye, cursor: ce.value })), I && typeof I == "object" && g.createEvent(I), I && typeof I == "boolean" && g.createEvent(de);
|
|
1658
|
+
} else g.createEvent(I);
|
|
1651
1659
|
}, B = () => {
|
|
1652
|
-
Object.keys(he.value).forEach((
|
|
1653
|
-
var
|
|
1654
|
-
(
|
|
1660
|
+
Object.keys(he.value).forEach((c) => {
|
|
1661
|
+
var w;
|
|
1662
|
+
(w = m.value) == null || w.removeEventListener(c, he.value[c]);
|
|
1655
1663
|
});
|
|
1656
1664
|
}, Q = () => {
|
|
1657
|
-
|
|
1665
|
+
d.value = L.getCellOverlappingEvents(A.value);
|
|
1658
1666
|
};
|
|
1659
1667
|
return me(
|
|
1660
1668
|
// Watch event IDs and start/end dates (only) to detect event resizing/dnd.
|
|
1661
|
-
() =>
|
|
1669
|
+
() => k.value.map((c) => `${c._.id}${c.start.getTime()}${c.end.getTime()}`).join(),
|
|
1662
1670
|
async () => {
|
|
1663
1671
|
await Ue(), Q();
|
|
1664
1672
|
},
|
|
1665
1673
|
{ immediate: !0, flush: "post" }
|
|
1666
1674
|
// Use flush: 'post' to prevent infinite updates.
|
|
1667
1675
|
), Xe(async () => {
|
|
1668
|
-
$.value.forEach((
|
|
1669
|
-
}), (
|
|
1670
|
-
class: ["vuecal__cell",
|
|
1676
|
+
$.value.forEach((c) => L.deleteEvent(c, 3)), B(), await Ue();
|
|
1677
|
+
}), (c, w) => (E(), j("div", De({
|
|
1678
|
+
class: ["vuecal__cell", P.value],
|
|
1671
1679
|
ref_key: "cellEl",
|
|
1672
|
-
ref:
|
|
1680
|
+
ref: m
|
|
1673
1681
|
}, Ie(he.value, !0)), [
|
|
1674
|
-
|
|
1682
|
+
c.$slots.cell ? F(c.$slots, "cell", {
|
|
1675
1683
|
key: 0,
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
key: V.id,
|
|
1689
|
-
style: Te(V.style || null),
|
|
1690
|
-
"data-schedule": V.id
|
|
1684
|
+
cell: q.value
|
|
1685
|
+
}) : Z("", !0),
|
|
1686
|
+
U.value ? (E(!0), j(te, { key: 1 }, we(U.value, (S, M) => (E(), j("div", {
|
|
1687
|
+
class: _e(["vuecal__special-hours", S.class]),
|
|
1688
|
+
style: Te(S.style),
|
|
1689
|
+
innerHTML: S.label || ""
|
|
1690
|
+
}, null, 14, At))), 256)) : Z("", !0),
|
|
1691
|
+
!c.$slots.cell && O(p).schedules ? (E(!0), j(te, { key: 2 }, we(O(p).schedules, (S) => (E(), j("div", {
|
|
1692
|
+
class: _e(["vuecal__schedule vuecal__schedule--cell", S.class]),
|
|
1693
|
+
key: S.id,
|
|
1694
|
+
style: Te(S.style || null),
|
|
1695
|
+
"data-schedule": S.id
|
|
1691
1696
|
}, [
|
|
1692
|
-
|
|
1697
|
+
c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
|
|
1693
1698
|
key: 0,
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
F(d.$slots, "cell-date", {
|
|
1700
|
-
start: u.start,
|
|
1701
|
-
end: u.end,
|
|
1702
|
-
events: n.value
|
|
1703
|
-
}, () => [
|
|
1704
|
-
xe(le(l.value), 1)
|
|
1699
|
+
cell: q.value
|
|
1700
|
+
}) : Z("", !0),
|
|
1701
|
+
s.value || c.$slots["cell-date"] ? (E(), j("div", Rt, [
|
|
1702
|
+
F(c.$slots, "cell-date", { cell: q.value }, () => [
|
|
1703
|
+
xe(le(s.value), 1)
|
|
1705
1704
|
])
|
|
1706
|
-
])) :
|
|
1707
|
-
|
|
1708
|
-
F(
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
])) : U("", !0),
|
|
1714
|
-
d.$slots["cell-events"] && n.value.length ? (Y(), j("div", Gt, [
|
|
1715
|
-
F(d.$slots, "cell-events", {
|
|
1716
|
-
start: u.start,
|
|
1717
|
-
end: u.end,
|
|
1718
|
-
events: n.value
|
|
1719
|
-
})
|
|
1720
|
-
])) : n.value.length || W.value ? (Y(), Se(et, {
|
|
1705
|
+
])) : Z("", !0),
|
|
1706
|
+
c.$slots["cell-content"] ? (E(), j("div", Xt, [
|
|
1707
|
+
F(c.$slots, "cell-content", { cell: q.value })
|
|
1708
|
+
])) : Z("", !0),
|
|
1709
|
+
c.$slots["cell-events"] && l.value.length ? (E(), j("div", Gt, [
|
|
1710
|
+
F(c.$slots, "cell-events", { cell: q.value })
|
|
1711
|
+
])) : l.value.length || W.value ? (E(), Se(et, {
|
|
1721
1712
|
key: 4,
|
|
1722
1713
|
class: "vuecal__cell-events",
|
|
1723
1714
|
name: "vuecal-event-delete",
|
|
1724
|
-
onBeforeLeave:
|
|
1725
|
-
onAfterLeave:
|
|
1715
|
+
onBeforeLeave: w[0] || (w[0] = (M) => W.value = !0),
|
|
1716
|
+
onAfterLeave: i,
|
|
1726
1717
|
tag: "div"
|
|
1727
1718
|
}, {
|
|
1728
|
-
default:
|
|
1729
|
-
(
|
|
1719
|
+
default: J(() => [
|
|
1720
|
+
(E(!0), j(te, null, we(t.value[S.id], (M) => (E(), Se(at, {
|
|
1730
1721
|
key: M._.id,
|
|
1731
1722
|
event: M,
|
|
1732
1723
|
onEventDeleted: G,
|
|
1733
|
-
style: Te(
|
|
1724
|
+
style: Te(V.value[M._.id])
|
|
1734
1725
|
}, je({ _: 2 }, [
|
|
1735
|
-
|
|
1726
|
+
c.$slots.event ? {
|
|
1736
1727
|
name: "event",
|
|
1737
|
-
fn:
|
|
1738
|
-
F(
|
|
1728
|
+
fn: J((N) => [
|
|
1729
|
+
F(c.$slots, "event", De({ ref_for: !0 }, N))
|
|
1739
1730
|
]),
|
|
1740
1731
|
key: "0"
|
|
1741
1732
|
} : void 0
|
|
1742
1733
|
]), 1032, ["event", "style"]))), 128))
|
|
1743
1734
|
]),
|
|
1744
1735
|
_: 2
|
|
1745
|
-
}, 1024)) :
|
|
1746
|
-
|
|
1736
|
+
}, 1024)) : Z("", !0),
|
|
1737
|
+
Y.value && u.schedule === S.id ? (E(), j("div", {
|
|
1747
1738
|
key: 5,
|
|
1748
1739
|
class: "vuecal__event-placeholder",
|
|
1749
1740
|
style: Te(h.value.style)
|
|
1750
|
-
}, le(h.value.start) + " - " + le(h.value.end), 5)) :
|
|
1751
|
-
], 14, It))), 128)) :
|
|
1752
|
-
!
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
xe(le(l.value), 1)
|
|
1741
|
+
}, le(h.value.start) + " - " + le(h.value.end), 5)) : Z("", !0)
|
|
1742
|
+
], 14, It))), 128)) : Z("", !0),
|
|
1743
|
+
!c.$slots.cell && !O(p).schedules ? (E(), j(te, { key: 3 }, [
|
|
1744
|
+
c.$slots["cell-events"] ? F(c.$slots, "cell-events", {
|
|
1745
|
+
key: 0,
|
|
1746
|
+
cell: q.value
|
|
1747
|
+
}) : Z("", !0),
|
|
1748
|
+
s.value || c.$slots["cell-date"] ? (E(), j("div", qt, [
|
|
1749
|
+
F(c.$slots, "cell-date", { cell: q.value }, () => [
|
|
1750
|
+
xe(le(s.value), 1)
|
|
1761
1751
|
])
|
|
1762
|
-
])) :
|
|
1763
|
-
|
|
1764
|
-
F(
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
])) : U("", !0),
|
|
1770
|
-
d.$slots["cell-events"] && n.value.length ? (Y(), j("div", Zt, [
|
|
1771
|
-
F(d.$slots, "cell-events", {
|
|
1772
|
-
start: u.start,
|
|
1773
|
-
end: u.end,
|
|
1774
|
-
events: n.value
|
|
1775
|
-
})
|
|
1776
|
-
])) : (n.value.length || W.value) && !(S(D).isMonth && !S(w).eventsOnMonthView) ? (Y(), Se(et, {
|
|
1752
|
+
])) : Z("", !0),
|
|
1753
|
+
c.$slots["cell-content"] ? (E(), j("div", Ut, [
|
|
1754
|
+
F(c.$slots, "cell-content", { cell: q.value })
|
|
1755
|
+
])) : Z("", !0),
|
|
1756
|
+
c.$slots["cell-events"] && l.value.length ? (E(), j("div", Zt, [
|
|
1757
|
+
F(c.$slots, "cell-events", { cell: q.value })
|
|
1758
|
+
])) : (l.value.length || W.value) && !(O(g).isMonth && !O(p).eventsOnMonthView) ? (E(), Se(et, {
|
|
1777
1759
|
key: 4,
|
|
1778
1760
|
class: "vuecal__cell-events",
|
|
1779
1761
|
name: "vuecal-event-delete",
|
|
1780
|
-
onBeforeLeave:
|
|
1781
|
-
onAfterLeave:
|
|
1762
|
+
onBeforeLeave: w[1] || (w[1] = (S) => W.value = !0),
|
|
1763
|
+
onAfterLeave: i,
|
|
1782
1764
|
tag: "div"
|
|
1783
1765
|
}, {
|
|
1784
|
-
default:
|
|
1785
|
-
(
|
|
1786
|
-
key:
|
|
1787
|
-
event:
|
|
1766
|
+
default: J(() => [
|
|
1767
|
+
(E(!0), j(te, null, we(l.value, (S) => (E(), Se(at, {
|
|
1768
|
+
key: S._.id,
|
|
1769
|
+
event: S,
|
|
1788
1770
|
onEventDeleted: G,
|
|
1789
|
-
style: Te(
|
|
1771
|
+
style: Te(V.value[S._.id])
|
|
1790
1772
|
}, je({ _: 2 }, [
|
|
1791
|
-
|
|
1773
|
+
c.$slots.event ? {
|
|
1792
1774
|
name: "event",
|
|
1793
|
-
fn:
|
|
1794
|
-
F(
|
|
1775
|
+
fn: J((M) => [
|
|
1776
|
+
F(c.$slots, "event", De({ ref_for: !0 }, M))
|
|
1795
1777
|
]),
|
|
1796
1778
|
key: "0"
|
|
1797
1779
|
} : void 0
|
|
1798
1780
|
]), 1032, ["event", "style"]))), 128))
|
|
1799
1781
|
]),
|
|
1800
1782
|
_: 3
|
|
1801
|
-
})) :
|
|
1802
|
-
|
|
1783
|
+
})) : Z("", !0),
|
|
1784
|
+
Y.value ? (E(), j("div", {
|
|
1803
1785
|
key: 5,
|
|
1804
1786
|
class: "vuecal__event-placeholder",
|
|
1805
1787
|
style: Te(h.value.style)
|
|
1806
|
-
}, le(h.value.start) + " - " + le(h.value.end), 5)) :
|
|
1807
|
-
], 64)) :
|
|
1808
|
-
|
|
1788
|
+
}, le(h.value.start) + " - " + le(h.value.end), 5)) : Z("", !0)
|
|
1789
|
+
], 64)) : Z("", !0),
|
|
1790
|
+
c.$slots["event-count"] ? F(c.$slots, "event-count", {
|
|
1809
1791
|
key: 4,
|
|
1810
|
-
events:
|
|
1811
|
-
}) :
|
|
1812
|
-
re.show ? (
|
|
1792
|
+
events: k.value
|
|
1793
|
+
}) : H.value ? (E(), j("div", Jt, le(k.value.length), 1)) : Z("", !0),
|
|
1794
|
+
re.show ? (E(), j("div", {
|
|
1813
1795
|
key: 6,
|
|
1814
1796
|
class: "vuecal__now-line",
|
|
1815
1797
|
style: Te(re.style),
|
|
1816
1798
|
title: re.currentTime
|
|
1817
1799
|
}, [
|
|
1818
1800
|
ge("span", null, le(re.currentTime), 1)
|
|
1819
|
-
], 12, Kt)) :
|
|
1801
|
+
], 12, Kt)) : Z("", !0)
|
|
1820
1802
|
], 16));
|
|
1821
1803
|
}
|
|
1822
1804
|
}, xt = {
|
|
1823
1805
|
__name: "body",
|
|
1824
|
-
setup(
|
|
1825
|
-
const
|
|
1826
|
-
let { view: r, config: D, dateUtils: w } = s;
|
|
1827
|
-
const b = oe(null), H = oe(null), m = T(() => ({
|
|
1806
|
+
setup(D) {
|
|
1807
|
+
const n = Ne("vuecal"), { view: r, config: g, dateUtils: p } = n, b = ie(null), L = ie(null), v = T(() => ({
|
|
1828
1808
|
"--vuecal-grid-columns": r.cols,
|
|
1829
1809
|
"--vuecal-grid-rows": r.rows
|
|
1830
1810
|
})), C = T(() => {
|
|
1831
|
-
const $ =
|
|
1811
|
+
const $ = p.formatTime(Pe(L.value, g));
|
|
1832
1812
|
return {
|
|
1833
|
-
style: { top:
|
|
1813
|
+
style: { top: `${L.value}%` },
|
|
1834
1814
|
time: $
|
|
1835
1815
|
};
|
|
1836
|
-
}),
|
|
1837
|
-
var
|
|
1816
|
+
}), o = ($) => {
|
|
1817
|
+
var i;
|
|
1838
1818
|
if (r.isMonth || r.isYear || r.isYears) return;
|
|
1839
|
-
const W = (((
|
|
1840
|
-
|
|
1841
|
-
},
|
|
1842
|
-
|
|
1819
|
+
const W = (((i = $.touches) == null ? void 0 : i[0]) || $).clientY, { top: G } = b.value.getBoundingClientRect();
|
|
1820
|
+
L.value = Je(W - G, b.value);
|
|
1821
|
+
}, m = () => {
|
|
1822
|
+
L.value = null;
|
|
1843
1823
|
};
|
|
1844
1824
|
return Ze(() => {
|
|
1845
|
-
b.value.addEventListener("mousemove",
|
|
1825
|
+
b.value.addEventListener("mousemove", o), b.value.addEventListener("touchmove", o), b.value.addEventListener("mouseleave", m), b.value.addEventListener("touchend", m);
|
|
1846
1826
|
}), Xe(() => {
|
|
1847
|
-
b.value && (b.value.removeEventListener("mousemove",
|
|
1848
|
-
}), ($, W) => (
|
|
1827
|
+
b.value && (b.value.removeEventListener("mousemove", o), b.value.removeEventListener("touchmove", o), b.value.removeEventListener("mouseleave", m), b.value.removeEventListener("touchend", m));
|
|
1828
|
+
}), ($, W) => (E(), j("div", {
|
|
1849
1829
|
class: "vuecal__body",
|
|
1850
1830
|
ref_key: "bodyEl",
|
|
1851
1831
|
ref: b,
|
|
1852
|
-
style: Te(
|
|
1832
|
+
style: Te(v.value)
|
|
1853
1833
|
}, [
|
|
1854
1834
|
Oe(Ge, { name: "vuecal-shrink" }, {
|
|
1855
|
-
default:
|
|
1856
|
-
|
|
1835
|
+
default: J(() => [
|
|
1836
|
+
O(g).timeAtCursor && L.value !== null ? (E(), j("div", {
|
|
1857
1837
|
key: 0,
|
|
1858
1838
|
class: "vuecal__time-at-cursor",
|
|
1859
1839
|
style: Te(C.value.style)
|
|
1860
1840
|
}, [
|
|
1861
1841
|
ge("label", null, le(C.value.time), 1)
|
|
1862
|
-
], 4)) :
|
|
1842
|
+
], 4)) : Z("", !0)
|
|
1863
1843
|
]),
|
|
1864
1844
|
_: 1
|
|
1865
1845
|
}),
|
|
1866
|
-
(
|
|
1867
|
-
key:
|
|
1846
|
+
(E(!0), j(te, null, we(O(r).cellDates, (G, i) => (E(), Se(Qt, {
|
|
1847
|
+
key: i,
|
|
1868
1848
|
start: G.start,
|
|
1869
1849
|
end: G.end,
|
|
1870
|
-
index:
|
|
1850
|
+
index: i
|
|
1871
1851
|
}, je({ _: 2 }, [
|
|
1872
1852
|
$.$slots.cell ? {
|
|
1873
1853
|
name: "cell",
|
|
1874
|
-
fn:
|
|
1875
|
-
F($.$slots, "cell", De({ ref_for: !0 },
|
|
1854
|
+
fn: J((u) => [
|
|
1855
|
+
F($.$slots, "cell", De({ ref_for: !0 }, u))
|
|
1876
1856
|
]),
|
|
1877
1857
|
key: "0"
|
|
1878
1858
|
} : void 0,
|
|
1879
1859
|
$.$slots["cell-date"] ? {
|
|
1880
1860
|
name: "cell-date",
|
|
1881
|
-
fn:
|
|
1882
|
-
F($.$slots, "cell-date", De({ ref_for: !0 },
|
|
1861
|
+
fn: J((u) => [
|
|
1862
|
+
F($.$slots, "cell-date", De({ ref_for: !0 }, u))
|
|
1883
1863
|
]),
|
|
1884
1864
|
key: "1"
|
|
1885
1865
|
} : void 0,
|
|
1886
1866
|
$.$slots["cell-content"] ? {
|
|
1887
1867
|
name: "cell-content",
|
|
1888
|
-
fn:
|
|
1889
|
-
F($.$slots, "cell-content", De({ ref_for: !0 },
|
|
1868
|
+
fn: J((u) => [
|
|
1869
|
+
F($.$slots, "cell-content", De({ ref_for: !0 }, u))
|
|
1890
1870
|
]),
|
|
1891
1871
|
key: "2"
|
|
1892
1872
|
} : void 0,
|
|
1893
1873
|
$.$slots["cell-events"] ? {
|
|
1894
1874
|
name: "cell-events",
|
|
1895
|
-
fn:
|
|
1896
|
-
F($.$slots, "cell-events", De({ ref_for: !0 },
|
|
1875
|
+
fn: J((u) => [
|
|
1876
|
+
F($.$slots, "cell-events", De({ ref_for: !0 }, u))
|
|
1897
1877
|
]),
|
|
1898
1878
|
key: "3"
|
|
1899
1879
|
} : $.$slots.event ? {
|
|
1900
1880
|
name: "event",
|
|
1901
|
-
fn:
|
|
1902
|
-
F($.$slots, "event", De({ ref_for: !0 },
|
|
1881
|
+
fn: J((u) => [
|
|
1882
|
+
F($.$slots, "event", De({ ref_for: !0 }, u))
|
|
1903
1883
|
]),
|
|
1904
1884
|
key: "4"
|
|
1905
1885
|
} : $.$slots["event-count"] ? {
|
|
1906
1886
|
name: "event-count",
|
|
1907
|
-
fn:
|
|
1908
|
-
F($.$slots, "event-count", De({ ref_for: !0 },
|
|
1887
|
+
fn: J((u) => [
|
|
1888
|
+
F($.$slots, "event-count", De({ ref_for: !0 }, u))
|
|
1909
1889
|
]),
|
|
1910
1890
|
key: "5"
|
|
1911
1891
|
} : void 0
|
|
@@ -1915,9 +1895,9 @@ const nt = (u, s) => {
|
|
|
1915
1895
|
}, ea = ["data-locale"], ta = { class: "vuecal__scrollable-wrap" }, aa = {
|
|
1916
1896
|
key: 1,
|
|
1917
1897
|
class: "vuecal__week-numbers"
|
|
1918
|
-
},
|
|
1898
|
+
}, na = { class: "vuecal__week-number" }, sa = { class: "vuecal__body-wrap" }, oa = {
|
|
1919
1899
|
__name: "index",
|
|
1920
|
-
props:
|
|
1900
|
+
props: pt,
|
|
1921
1901
|
emits: [
|
|
1922
1902
|
"ready",
|
|
1923
1903
|
"view-change",
|
|
@@ -1929,132 +1909,130 @@ const nt = (u, s) => {
|
|
|
1929
1909
|
"event-created",
|
|
1930
1910
|
"event-dropped"
|
|
1931
1911
|
],
|
|
1932
|
-
setup(
|
|
1933
|
-
const
|
|
1912
|
+
setup(D, { expose: n, emit: r }) {
|
|
1913
|
+
const g = D, p = r, b = ot("vuecal-el"), L = yt({ props: g, emit: p, attrs: ut(), vuecalEl: b, uid: it() }), { config: v, view: C, dateUtils: o, touch: m } = L, $ = T(() => v.time && (C.isDay || C.isDays || C.isWeek)), W = T(() => Array(C.rows).fill().map((e, d) => o.getWeek(o.addDays(C.firstCellDate, 7 * d)))), G = T(() => {
|
|
1934
1914
|
var e;
|
|
1935
1915
|
return {
|
|
1936
|
-
"vuecal--ready":
|
|
1937
|
-
[`vuecal--${
|
|
1938
|
-
[`vuecal--${
|
|
1939
|
-
"vuecal--date-picker":
|
|
1940
|
-
"vuecal--dark":
|
|
1941
|
-
"vuecal--light": !
|
|
1916
|
+
"vuecal--ready": v.ready,
|
|
1917
|
+
[`vuecal--${v.theme}-theme`]: v.theme,
|
|
1918
|
+
[`vuecal--${v.size}`]: !0,
|
|
1919
|
+
"vuecal--date-picker": v.datePicker,
|
|
1920
|
+
"vuecal--dark": v.dark,
|
|
1921
|
+
"vuecal--light": !v.dark,
|
|
1942
1922
|
[`vuecal--${C.id}-view`]: !0,
|
|
1943
1923
|
"vuecal--view-has-time": $.value,
|
|
1944
|
-
"vuecal--timeless": !
|
|
1945
|
-
"vuecal--dragging-cell":
|
|
1946
|
-
"vuecal--dragging-event":
|
|
1947
|
-
"vuecal--resizing-event":
|
|
1948
|
-
"vuecal--has-schedules": (e =
|
|
1924
|
+
"vuecal--timeless": !v.time,
|
|
1925
|
+
"vuecal--dragging-cell": m.isDraggingCell,
|
|
1926
|
+
"vuecal--dragging-event": m.isDraggingEvent,
|
|
1927
|
+
"vuecal--resizing-event": m.isResizingEvent,
|
|
1928
|
+
"vuecal--has-schedules": (e = v.schedules) == null ? void 0 : e.length
|
|
1949
1929
|
};
|
|
1950
|
-
}),
|
|
1951
|
-
"--vuecal-time-cell-height":
|
|
1952
|
-
})),
|
|
1953
|
-
var e,
|
|
1930
|
+
}), i = T(() => ({
|
|
1931
|
+
"--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
|
|
1932
|
+
})), u = T(() => {
|
|
1933
|
+
var e, d;
|
|
1954
1934
|
return {
|
|
1955
|
-
"vuecal__scrollable--row": $.value ||
|
|
1935
|
+
"vuecal__scrollable--row": $.value || v.weekNumbers && C.isMonth,
|
|
1956
1936
|
// Keep the states inside the Vue transition wrapper for smooth CSS transitions.
|
|
1957
1937
|
[`vuecal__scrollable--${C.id}-view`]: !0,
|
|
1958
|
-
"vuecal__scrollable--has-schedules": (e =
|
|
1959
|
-
"vuecal__scrollable--no-schedules": !((
|
|
1938
|
+
"vuecal__scrollable--has-schedules": (e = v.schedules) == null ? void 0 : e.length,
|
|
1939
|
+
"vuecal__scrollable--no-schedules": !((d = v.schedules) != null && d.length)
|
|
1960
1940
|
};
|
|
1961
1941
|
});
|
|
1962
1942
|
return Ze(async () => {
|
|
1963
|
-
await Ue(),
|
|
1964
|
-
}), ct("vuecal",
|
|
1965
|
-
class:
|
|
1943
|
+
await Ue(), v.ready = !0, p("ready", { config: v, view: C });
|
|
1944
|
+
}), ct("vuecal", L), n({ view: L.view }), (e, d) => (E(), j("div", {
|
|
1945
|
+
class: _e(["vuecal", G.value]),
|
|
1966
1946
|
ref: "vuecal-el",
|
|
1967
1947
|
"data-locale": e.locale,
|
|
1968
|
-
style: Te(
|
|
1948
|
+
style: Te(i.value)
|
|
1969
1949
|
}, [
|
|
1970
1950
|
e.$slots.diy ? F(e.$slots, "diy", {
|
|
1971
1951
|
key: 0,
|
|
1972
|
-
vuecal:
|
|
1973
|
-
|
|
1974
|
-
availableViews: S(m).availableViews
|
|
1975
|
-
}) : (Y(), j(te, { key: 1 }, [
|
|
1952
|
+
vuecal: O(L)
|
|
1953
|
+
}) : (E(), j(te, { key: 1 }, [
|
|
1976
1954
|
Oe(Mt, null, je({ _: 2 }, [
|
|
1977
1955
|
e.$slots.header ? {
|
|
1978
1956
|
name: "header",
|
|
1979
|
-
fn:
|
|
1980
|
-
F(e.$slots, "header", se(
|
|
1957
|
+
fn: J((h) => [
|
|
1958
|
+
F(e.$slots, "header", ne(se(h)))
|
|
1981
1959
|
]),
|
|
1982
1960
|
key: "0"
|
|
1983
1961
|
} : void 0,
|
|
1984
1962
|
!e.$slots.header && e.$slots["previous-button"] ? {
|
|
1985
1963
|
name: "previous-button",
|
|
1986
|
-
fn:
|
|
1987
|
-
F(e.$slots, "previous-button", se(
|
|
1964
|
+
fn: J((h) => [
|
|
1965
|
+
F(e.$slots, "previous-button", ne(se(h)))
|
|
1988
1966
|
]),
|
|
1989
1967
|
key: "1"
|
|
1990
1968
|
} : void 0,
|
|
1991
1969
|
!e.$slots.header && e.$slots["next-button"] ? {
|
|
1992
1970
|
name: "next-button",
|
|
1993
|
-
fn:
|
|
1994
|
-
F(e.$slots, "next-button", se(
|
|
1971
|
+
fn: J((h) => [
|
|
1972
|
+
F(e.$slots, "next-button", ne(se(h)))
|
|
1995
1973
|
]),
|
|
1996
1974
|
key: "2"
|
|
1997
1975
|
} : void 0,
|
|
1998
1976
|
!e.$slots.header && e.$slots["today-button"] ? {
|
|
1999
1977
|
name: "today-button",
|
|
2000
|
-
fn:
|
|
2001
|
-
F(e.$slots, "today-button", se(
|
|
1978
|
+
fn: J((h) => [
|
|
1979
|
+
F(e.$slots, "today-button", ne(se(h)))
|
|
2002
1980
|
]),
|
|
2003
1981
|
key: "3"
|
|
2004
1982
|
} : void 0,
|
|
2005
1983
|
!e.$slots.header && e.$slots.title ? {
|
|
2006
1984
|
name: "title",
|
|
2007
|
-
fn:
|
|
2008
|
-
F(e.$slots, "title", se(
|
|
1985
|
+
fn: J((h) => [
|
|
1986
|
+
F(e.$slots, "title", ne(se(h)))
|
|
2009
1987
|
]),
|
|
2010
1988
|
key: "4"
|
|
2011
1989
|
} : void 0,
|
|
2012
1990
|
!e.$slots.header && e.$slots["schedule-heading"] ? {
|
|
2013
1991
|
name: "schedule-heading",
|
|
2014
|
-
fn:
|
|
2015
|
-
F(e.$slots, "schedule-heading", se(
|
|
1992
|
+
fn: J((h) => [
|
|
1993
|
+
F(e.$slots, "schedule-heading", ne(se(h)))
|
|
2016
1994
|
]),
|
|
2017
1995
|
key: "5"
|
|
2018
1996
|
} : void 0
|
|
2019
1997
|
]), 1024),
|
|
2020
1998
|
ge("div", ta, [
|
|
2021
1999
|
Oe(Ge, {
|
|
2022
|
-
name: `vuecal-slide-fade--${
|
|
2000
|
+
name: `vuecal-slide-fade--${O(C).transitionDirection}`
|
|
2023
2001
|
}, {
|
|
2024
|
-
default:
|
|
2025
|
-
(
|
|
2026
|
-
class:
|
|
2027
|
-
key:
|
|
2002
|
+
default: J(() => [
|
|
2003
|
+
(E(), j("div", {
|
|
2004
|
+
class: _e(["vuecal__scrollable", u.value]),
|
|
2005
|
+
key: O(C).id + O(C).start.getTime()
|
|
2028
2006
|
}, [
|
|
2029
|
-
$.value ? (
|
|
2007
|
+
$.value ? (E(), Se(Lt, { key: 0 }, je({ _: 2 }, [
|
|
2030
2008
|
e.$slots["time-cell"] ? {
|
|
2031
2009
|
name: "time-cell",
|
|
2032
|
-
fn:
|
|
2033
|
-
F(e.$slots, "time-cell", se(
|
|
2010
|
+
fn: J((h) => [
|
|
2011
|
+
F(e.$slots, "time-cell", ne(se(h)))
|
|
2034
2012
|
]),
|
|
2035
2013
|
key: "0"
|
|
2036
2014
|
} : void 0
|
|
2037
|
-
]), 1024)) :
|
|
2038
|
-
|
|
2039
|
-
(
|
|
2015
|
+
]), 1024)) : Z("", !0),
|
|
2016
|
+
O(v).weekNumbers && O(C).isMonth ? (E(), j("div", aa, [
|
|
2017
|
+
(E(!0), j(te, null, we(W.value, (h) => (E(), j("div", na, [
|
|
2040
2018
|
F(e.$slots, "week-number", {}, () => [
|
|
2041
2019
|
ge("small", null, le(h), 1)
|
|
2042
2020
|
])
|
|
2043
2021
|
]))), 256))
|
|
2044
|
-
])) :
|
|
2045
|
-
ge("div",
|
|
2022
|
+
])) : Z("", !0),
|
|
2023
|
+
ge("div", sa, [
|
|
2046
2024
|
Oe(Pt, null, je({ _: 2 }, [
|
|
2047
2025
|
e.$slots["weekday-heading"] ? {
|
|
2048
2026
|
name: "weekday-heading",
|
|
2049
|
-
fn:
|
|
2050
|
-
F(e.$slots, "weekday-heading", se(
|
|
2027
|
+
fn: J((h) => [
|
|
2028
|
+
F(e.$slots, "weekday-heading", ne(se(h)))
|
|
2051
2029
|
]),
|
|
2052
2030
|
key: "0"
|
|
2053
2031
|
} : void 0,
|
|
2054
2032
|
e.$slots["schedule-heading"] ? {
|
|
2055
2033
|
name: "schedule-heading",
|
|
2056
|
-
fn:
|
|
2057
|
-
F(e.$slots, "schedule-heading", se(
|
|
2034
|
+
fn: J((h) => [
|
|
2035
|
+
F(e.$slots, "schedule-heading", ne(se(h)))
|
|
2058
2036
|
]),
|
|
2059
2037
|
key: "1"
|
|
2060
2038
|
} : void 0
|
|
@@ -2062,43 +2040,43 @@ const nt = (u, s) => {
|
|
|
2062
2040
|
Oe(xt, null, je({ _: 2 }, [
|
|
2063
2041
|
e.$slots.cell ? {
|
|
2064
2042
|
name: "cell",
|
|
2065
|
-
fn:
|
|
2066
|
-
F(e.$slots, "cell", se(
|
|
2043
|
+
fn: J((h) => [
|
|
2044
|
+
F(e.$slots, "cell", ne(se(h)))
|
|
2067
2045
|
]),
|
|
2068
2046
|
key: "0"
|
|
2069
2047
|
} : void 0,
|
|
2070
2048
|
!e.$slots.cell && e.$slots["cell-date"] ? {
|
|
2071
2049
|
name: "cell-date",
|
|
2072
|
-
fn:
|
|
2073
|
-
F(e.$slots, "cell-date", se(
|
|
2050
|
+
fn: J((h) => [
|
|
2051
|
+
F(e.$slots, "cell-date", ne(se(h)))
|
|
2074
2052
|
]),
|
|
2075
2053
|
key: "1"
|
|
2076
2054
|
} : void 0,
|
|
2077
2055
|
!e.$slots.cell && e.$slots["cell-content"] ? {
|
|
2078
2056
|
name: "cell-content",
|
|
2079
|
-
fn:
|
|
2080
|
-
F(e.$slots, "cell-content", se(
|
|
2057
|
+
fn: J((h) => [
|
|
2058
|
+
F(e.$slots, "cell-content", ne(se(h)))
|
|
2081
2059
|
]),
|
|
2082
2060
|
key: "2"
|
|
2083
2061
|
} : void 0,
|
|
2084
2062
|
!e.$slots.cell && e.$slots["cell-events"] ? {
|
|
2085
2063
|
name: "cell-events",
|
|
2086
|
-
fn:
|
|
2087
|
-
F(e.$slots, "cell-events", se(
|
|
2064
|
+
fn: J((h) => [
|
|
2065
|
+
F(e.$slots, "cell-events", ne(se(h)))
|
|
2088
2066
|
]),
|
|
2089
2067
|
key: "3"
|
|
2090
2068
|
} : void 0,
|
|
2091
2069
|
!e.$slots.cell && e.$slots.event ? {
|
|
2092
2070
|
name: "event",
|
|
2093
|
-
fn:
|
|
2094
|
-
F(e.$slots, "event", se(
|
|
2071
|
+
fn: J((h) => [
|
|
2072
|
+
F(e.$slots, "event", ne(se(h)))
|
|
2095
2073
|
]),
|
|
2096
2074
|
key: "4"
|
|
2097
2075
|
} : void 0,
|
|
2098
2076
|
!e.$slots.cell && e.$slots["event-count"] ? {
|
|
2099
2077
|
name: "event-count",
|
|
2100
|
-
fn:
|
|
2101
|
-
F(e.$slots, "event-count", se(
|
|
2078
|
+
fn: J((h) => [
|
|
2079
|
+
F(e.$slots, "event-count", ne(se(h)))
|
|
2102
2080
|
]),
|
|
2103
2081
|
key: "5"
|
|
2104
2082
|
} : void 0
|
|
@@ -2112,8 +2090,8 @@ const nt = (u, s) => {
|
|
|
2112
2090
|
], 64))
|
|
2113
2091
|
], 14, ea));
|
|
2114
2092
|
}
|
|
2115
|
-
},
|
|
2116
|
-
Fe.texts = { ...fe.texts, ...
|
|
2093
|
+
}, ia = (D) => {
|
|
2094
|
+
Fe.texts = { ...fe.texts, ...D }, Fe.dateUtils.updateTexts(Fe.texts);
|
|
2117
2095
|
}, {
|
|
2118
2096
|
addDatePrototypes: ua,
|
|
2119
2097
|
removeDatePrototypes: ca,
|
|
@@ -2125,16 +2103,16 @@ const nt = (u, s) => {
|
|
|
2125
2103
|
addMinutes: ha,
|
|
2126
2104
|
subtractMinutes: ya,
|
|
2127
2105
|
getWeek: Da,
|
|
2128
|
-
isToday:
|
|
2129
|
-
isSameDate:
|
|
2130
|
-
isInRange:
|
|
2131
|
-
isLeapYear:
|
|
2106
|
+
isToday: pa,
|
|
2107
|
+
isSameDate: wa,
|
|
2108
|
+
isInRange: _a,
|
|
2109
|
+
isLeapYear: ka,
|
|
2132
2110
|
getPreviousFirstDayOfWeek: ba,
|
|
2133
2111
|
stringToDate: Ta,
|
|
2134
2112
|
dateToMinutes: $a,
|
|
2135
2113
|
countDays: Ma,
|
|
2136
|
-
datesInSameTimeStep:
|
|
2137
|
-
isValid:
|
|
2114
|
+
datesInSameTimeStep: Ya,
|
|
2115
|
+
isValid: Ea,
|
|
2138
2116
|
formatDate: Sa,
|
|
2139
2117
|
formatDateLite: Ca,
|
|
2140
2118
|
formatTime: Va,
|
|
@@ -2142,14 +2120,14 @@ const nt = (u, s) => {
|
|
|
2142
2120
|
formatMinutes: ja
|
|
2143
2121
|
} = Fe.dateUtils;
|
|
2144
2122
|
export {
|
|
2145
|
-
|
|
2123
|
+
oa as VueCal,
|
|
2146
2124
|
ua as addDatePrototypes,
|
|
2147
2125
|
va as addDays,
|
|
2148
2126
|
fa as addHours,
|
|
2149
2127
|
ha as addMinutes,
|
|
2150
2128
|
Ma as countDays,
|
|
2151
2129
|
$a as dateToMinutes,
|
|
2152
|
-
|
|
2130
|
+
Ya as datesInSameTimeStep,
|
|
2153
2131
|
Sa as formatDate,
|
|
2154
2132
|
Ca as formatDateLite,
|
|
2155
2133
|
ja as formatMinutes,
|
|
@@ -2157,16 +2135,16 @@ export {
|
|
|
2157
2135
|
Oa as formatTimeLite,
|
|
2158
2136
|
ba as getPreviousFirstDayOfWeek,
|
|
2159
2137
|
Da as getWeek,
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2138
|
+
_a as isInRange,
|
|
2139
|
+
ka as isLeapYear,
|
|
2140
|
+
wa as isSameDate,
|
|
2141
|
+
pa as isToday,
|
|
2142
|
+
Ea as isValidDate,
|
|
2165
2143
|
ca as removeDatePrototypes,
|
|
2166
2144
|
Ta as stringToDate,
|
|
2167
2145
|
ma as subtractDays,
|
|
2168
2146
|
ga as subtractHours,
|
|
2169
2147
|
ya as subtractMinutes,
|
|
2170
2148
|
da as updateTexts,
|
|
2171
|
-
|
|
2149
|
+
ia as useLocale
|
|
2172
2150
|
};
|