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