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