vue-cal 5.0.1-rc.15 → 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 +978 -973
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +1 -1
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,14 +33,14 @@ 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,
|
|
38
|
-
if (
|
|
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
|
+
if (W.value[n.view]) return n.view;
|
|
39
39
|
const s = n.datePicker ? "month" : "week", l = n.view || s;
|
|
40
|
-
return
|
|
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(
|
|
42
|
-
), Object.keys(
|
|
43
|
-
}),
|
|
40
|
+
return W.value[l] ? l : (console.warn(
|
|
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
|
+
), Object.keys(W.value)[0]);
|
|
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.
|
|
@@ -48,31 +48,31 @@ const ve = {
|
|
|
48
48
|
// All possible event listeners to attach to calendar events.
|
|
49
49
|
}, l = (_) => _.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
50
50
|
for (const [_, t] of Object.entries(r)) {
|
|
51
|
-
const [C,
|
|
52
|
-
C && (s[
|
|
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
|
-
}),
|
|
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((C,
|
|
68
|
-
const { cols:
|
|
69
|
-
return 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."), _ = { ...
|
|
71
|
-
}), R =
|
|
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
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
|
-
}),
|
|
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:
|
|
119
|
+
eventListeners: i,
|
|
120
120
|
defaultView: R,
|
|
121
|
-
availableViews:
|
|
121
|
+
availableViews: W,
|
|
122
122
|
disableDays: c,
|
|
123
123
|
ready: p,
|
|
124
|
-
sm:
|
|
125
|
-
xs:
|
|
124
|
+
sm: H,
|
|
125
|
+
xs: v,
|
|
126
126
|
clickToNavigate: j,
|
|
127
|
-
hideWeekdays:
|
|
128
|
-
hideWeekends:
|
|
127
|
+
hideWeekdays: f,
|
|
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
|
-
return Object.keys(
|
|
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
|
-
},
|
|
144
|
+
}, Ve = (D, n) => {
|
|
145
145
|
const r = n.timeTo - n.timeFrom;
|
|
146
146
|
return (D - n.timeFrom) * 100 / r;
|
|
147
|
-
},
|
|
147
|
+
}, Pe = (D, n) => {
|
|
148
148
|
const r = n.timeTo - n.timeFrom;
|
|
149
149
|
return ~~(D * r / 100 + n.timeFrom);
|
|
150
150
|
}, Ze = (D, n) => {
|
|
151
151
|
const r = n.clientHeight;
|
|
152
152
|
return D * 100 / r;
|
|
153
|
-
}, Be =
|
|
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: r, eventsManager: h, emit: p, uid:
|
|
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
|
-
}, j = (e,
|
|
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
|
-
|
|
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
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 C,
|
|
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 } = j(e, g,
|
|
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 r, h, p,
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
return
|
|
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
|
+
return W(this, a || 0);
|
|
258
258
|
}, Date.prototype.subtractDays = function(a) {
|
|
259
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
|
-
},
|
|
282
|
-
|
|
283
|
-
},
|
|
281
|
+
}, f = (a) => {
|
|
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, "/"))), C = (a) => a.getHours() * 60 + a.getMinutes(),
|
|
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,73 +395,73 @@ 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
454
|
addDatePrototypes: j,
|
|
455
|
-
removeDatePrototypes:
|
|
456
|
-
updateTexts:
|
|
457
|
-
addDays:
|
|
455
|
+
removeDatePrototypes: i,
|
|
456
|
+
updateTexts: f,
|
|
457
|
+
addDays: W,
|
|
458
458
|
subtractDays: R,
|
|
459
|
-
addHours:
|
|
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,
|
|
@@ -469,20 +469,20 @@ const st = (D, n) => {
|
|
|
469
469
|
getPreviousFirstDayOfWeek: _,
|
|
470
470
|
stringToDate: t,
|
|
471
471
|
dateToMinutes: C,
|
|
472
|
-
countDays:
|
|
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
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,53 +491,53 @@ 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 = r.events.sort((e,
|
|
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
|
-
return
|
|
499
|
-
|
|
500
|
-
{ start: (
|
|
501
|
-
{ excludeIds: [e._.id], schedule: (g = r.schedules) != null && g.length ? ~~((
|
|
498
|
+
return W(
|
|
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
|
-
}, j = (
|
|
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 r.snapToInterval && (n.snapToInterval(
|
|
534
|
-
},
|
|
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] =
|
|
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
541
|
e = (P = r.events.find((_) => _[s] === l)) == null ? void 0 : P._.id;
|
|
542
542
|
}
|
|
543
543
|
if (!r.editableEvents.delete)
|
|
@@ -545,47 +545,48 @@ const st = (D, n) => {
|
|
|
545
545
|
if (!e) return console.warn("Vue Cal: Cannot delete event without its ID.");
|
|
546
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
|
-
r.events.splice(g, 1), D.emit("update:events", r.events), D.emit("event-delete",
|
|
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
583
|
var C;
|
|
584
584
|
return ((C = e[t._.id]) == null ? void 0 : C.position) ?? 0;
|
|
585
|
-
}))
|
|
585
|
+
}));
|
|
586
|
+
let l = 0;
|
|
586
587
|
for (; s.has(l); ) l++;
|
|
587
|
-
e[P].position = l,
|
|
588
|
-
|
|
588
|
+
e[P].position = l, m.push(M);
|
|
589
|
+
const _ = Math.max(1, ...A.map((t) => {
|
|
589
590
|
var C;
|
|
590
591
|
return ((C = e[t._.id]) == null ? void 0 : C.maxConcurrent) ?? 1;
|
|
591
592
|
}));
|
|
@@ -594,288 +595,288 @@ const st = (D, n) => {
|
|
|
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
|
-
},
|
|
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
|
-
}, R = (
|
|
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:
|
|
612
|
+
getEvent: H,
|
|
613
|
+
getEventsByDate: v,
|
|
613
614
|
getViewEvents: j,
|
|
614
|
-
getCellOverlappingEvents:
|
|
615
|
-
getEventsInRange:
|
|
616
|
-
createEvent:
|
|
617
|
-
deleteEvent:
|
|
615
|
+
getCellOverlappingEvents: T,
|
|
616
|
+
getEventsInRange: W,
|
|
617
|
+
createEvent: i,
|
|
618
|
+
deleteEvent: f,
|
|
618
619
|
isEventInRange: R
|
|
619
620
|
};
|
|
620
|
-
}, Ct = ({ config: D, dateUtils: n, emit: r, texts: h, eventsManager: p },
|
|
621
|
-
const { availableViews:
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
let
|
|
625
|
-
const R =
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
628
|
-
return
|
|
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));
|
|
623
|
+
f.value.setHours(0, 0, 0, 0);
|
|
624
|
+
const T = ie(new Date(f));
|
|
625
|
+
let W = null;
|
|
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") {
|
|
628
|
+
const d = n.addDays(c.value, 7);
|
|
629
|
+
return d.setMilliseconds(-1), d;
|
|
629
630
|
}
|
|
630
|
-
return
|
|
631
|
-
}),
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
return c.value.getTime() <=
|
|
635
|
-
const
|
|
636
|
-
return
|
|
631
|
+
return v.value === "month" ? t.value : o.value;
|
|
632
|
+
}), m = $(() => {
|
|
633
|
+
const d = i.value.getTime();
|
|
634
|
+
if (v.value === "week")
|
|
635
|
+
return c.value.getTime() <= d && d <= e.value.getTime();
|
|
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
|
-
|
|
642
|
+
function M() {
|
|
643
|
+
W = setTimeout(g, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), g();
|
|
643
644
|
}
|
|
644
|
-
const P =
|
|
645
|
-
if (!D.availableViews[
|
|
646
|
-
let
|
|
647
|
-
return D.hasHiddenDays && ["week", "month"].includes(
|
|
648
|
-
}), A =
|
|
649
|
-
var
|
|
650
|
-
return ((
|
|
651
|
-
}), s =
|
|
652
|
-
if (
|
|
653
|
-
let
|
|
654
|
-
return D.startWeekOnSunday && !D.hideWeekdays[7] && (
|
|
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 = $(() => {
|
|
650
|
+
var d;
|
|
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
|
|
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
|
|
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
|
-
start: new Date(l.value.getFullYear(),
|
|
683
|
-
end: new Date(l.value.getFullYear(),
|
|
682
|
+
d.push({
|
|
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
|
-
start: new Date(l.value.getFullYear() +
|
|
689
|
-
end: new Date(l.value.getFullYear() +
|
|
688
|
+
d.push({
|
|
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
|
-
return
|
|
694
|
-
}), t =
|
|
695
|
-
const
|
|
696
|
-
return
|
|
697
|
-
}), J =
|
|
698
|
-
const
|
|
699
|
-
return
|
|
694
|
+
return d;
|
|
695
|
+
}), t = $(() => _.value[_.value.length - 1].end), C = ie("right"), L = $(() => {
|
|
696
|
+
const d = Object.keys(D.availableViews);
|
|
697
|
+
return d[d.indexOf(v.value) + 1];
|
|
698
|
+
}), J = $(() => {
|
|
699
|
+
const d = Object.keys(D.availableViews);
|
|
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:
|
|
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
|
-
return n.formatDate(l.value,
|
|
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(R.value,
|
|
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
763
|
D.ready && r("view-change", {
|
|
763
|
-
id:
|
|
764
|
-
title:
|
|
764
|
+
id: v.value,
|
|
765
|
+
title: ce.value,
|
|
765
766
|
start: R.value,
|
|
766
|
-
end:
|
|
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
|
-
|
|
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
|
-
function w(
|
|
795
|
-
let
|
|
796
|
-
switch (
|
|
795
|
+
function w(d = !0) {
|
|
796
|
+
let F = new Date(f.value);
|
|
797
|
+
switch (v.value) {
|
|
797
798
|
case "day":
|
|
798
799
|
case "days":
|
|
799
|
-
|
|
800
|
+
d ? F = n.addDays(t.value, 1) : F = n.subtractDays(l.value, s.value);
|
|
800
801
|
break;
|
|
801
802
|
case "week": {
|
|
802
|
-
|
|
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
|
-
const
|
|
825
|
-
|
|
825
|
+
const d = /* @__PURE__ */ new Date();
|
|
826
|
+
d.setHours(0, 0, 0, 0), B(d);
|
|
826
827
|
}
|
|
827
|
-
function
|
|
828
|
-
if (!n.isValid(
|
|
829
|
-
let [
|
|
830
|
-
|
|
828
|
+
function B(d, F = !0, X = !1) {
|
|
829
|
+
if (!n.isValid(d)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
|
|
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
|
-
if (!n.isValid(
|
|
834
|
-
const { isValid:
|
|
835
|
-
(!j.value || !
|
|
833
|
+
function Q(d, F = !0) {
|
|
834
|
+
if (!n.isValid(d)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
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
|
-
!
|
|
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
|
-
|
|
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
|
-
const
|
|
853
|
-
|
|
852
|
+
function E() {
|
|
853
|
+
const d = /* @__PURE__ */ new Date();
|
|
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
|
-
|
|
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
|
-
viewDate:
|
|
869
|
+
title: ce,
|
|
870
|
+
viewDate: f,
|
|
870
871
|
start: R,
|
|
871
|
-
end:
|
|
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
|
+
containsToday: m,
|
|
879
880
|
selectedDate: j,
|
|
880
881
|
cellDates: _,
|
|
881
882
|
cols: P,
|
|
@@ -883,40 +884,40 @@ const st = (D, n) => {
|
|
|
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
|
+
events: z,
|
|
887
888
|
transitionDirection: C,
|
|
888
|
-
switch:
|
|
889
|
-
broader:
|
|
890
|
-
narrower:
|
|
891
|
-
previous:
|
|
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,13 +952,13 @@ const st = (D, n) => {
|
|
|
951
952
|
weekDays: lt,
|
|
952
953
|
year: it,
|
|
953
954
|
years: ot
|
|
954
|
-
}, Symbol.toStringTag, { value: "Module" })), ze =
|
|
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
960
|
}), Ot = ({ props: D, emit: n, attrs: r, vuecalEl: h, uid: p }) => {
|
|
960
|
-
const
|
|
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,
|
|
@@ -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 },
|
|
@@ -1089,50 +1090,50 @@ const st = (D, n) => {
|
|
|
1089
1090
|
setup(D) {
|
|
1090
1091
|
const n = Ne("vuecal"), { view: r, config: h } = n, p = () => {
|
|
1091
1092
|
h.clickToNavigate && r.broader();
|
|
1092
|
-
},
|
|
1093
|
-
return (
|
|
1094
|
-
|
|
1093
|
+
}, b = $(() => h.clickToNavigate ? { click: p } : {});
|
|
1094
|
+
return (H, v) => (S(), O("div", Ft, [
|
|
1095
|
+
N(H.$slots, "header", {
|
|
1095
1096
|
view: V(r),
|
|
1096
1097
|
availableViews: V(h).availableViews,
|
|
1097
1098
|
vuecal: V(n)
|
|
1098
1099
|
}),
|
|
1099
|
-
|
|
1100
|
-
V(h).viewsBar ? (
|
|
1101
|
-
(
|
|
1102
|
-
class:
|
|
1103
|
-
onClick: (
|
|
1104
|
-
innerHTML: V(n).texts[
|
|
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
1107
|
}, null, 10, Ht))), 256))
|
|
1107
|
-
])) :
|
|
1108
|
-
V(h).titleBar ? (
|
|
1109
|
-
|
|
1110
|
-
class:
|
|
1111
|
-
onClick:
|
|
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
|
-
|
|
1115
|
+
N(H.$slots, "previous-button")
|
|
1115
1116
|
], 2),
|
|
1116
|
-
|
|
1117
|
-
|
|
1117
|
+
ge("div", Nt, [
|
|
1118
|
+
Oe(Ge, {
|
|
1118
1119
|
name: `vuecal-slide-fade--${V(r).transitionDirection}`
|
|
1119
1120
|
}, {
|
|
1120
|
-
default:
|
|
1121
|
-
(
|
|
1121
|
+
default: q(() => [
|
|
1122
|
+
(S(), O("div", {
|
|
1122
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
|
-
|
|
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
|
+
}, Ie(b.value), {
|
|
1136
1137
|
innerHTML: V(r).title
|
|
1137
1138
|
}), null, 16, ["innerHTML"]))
|
|
1138
1139
|
]))
|
|
@@ -1140,28 +1141,28 @@ const st = (D, n) => {
|
|
|
1140
1141
|
_: 3
|
|
1141
1142
|
}, 8, ["name"])
|
|
1142
1143
|
]),
|
|
1143
|
-
V(h).todayButton ? (
|
|
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
1147
|
navigate: () => !V(r).containsToday && V(r).goToToday(),
|
|
1147
1148
|
active: V(r).containsToday
|
|
1148
|
-
}) : (
|
|
1149
|
+
}) : (S(), O("button", {
|
|
1149
1150
|
key: 1,
|
|
1150
|
-
class:
|
|
1151
|
-
onClick:
|
|
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()),
|
|
1152
1153
|
disabled: !!V(r).containsToday,
|
|
1153
1154
|
type: "button",
|
|
1154
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
|
-
|
|
1163
|
+
N(H.$slots, "next-button")
|
|
1163
1164
|
], 2)
|
|
1164
|
-
])) :
|
|
1165
|
+
])) : U("", !0)
|
|
1165
1166
|
], 64))
|
|
1166
1167
|
]));
|
|
1167
1168
|
}
|
|
@@ -1180,92 +1181,92 @@ const st = (D, n) => {
|
|
|
1180
1181
|
}, Ut = ["innerHTML"], qt = {
|
|
1181
1182
|
__name: "headings-bar",
|
|
1182
1183
|
setup(D) {
|
|
1183
|
-
const n = Ne("vuecal"), { view: r, config: h, dateUtils: p } = n,
|
|
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(
|
|
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)
|
|
1191
1192
|
}))), j = {
|
|
1192
|
-
click: (
|
|
1193
|
-
(r.isDays || r.isWeek) && r.updateSelectedDate(
|
|
1193
|
+
click: (i) => {
|
|
1194
|
+
(r.isDays || r.isWeek) && r.updateSelectedDate(i);
|
|
1194
1195
|
}
|
|
1195
1196
|
};
|
|
1196
|
-
return (
|
|
1197
|
-
V(r).isDay ?
|
|
1198
|
-
(
|
|
1199
|
-
class:
|
|
1200
|
-
key:
|
|
1201
|
-
onClick: (R) => j.click(
|
|
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 }]),
|
|
1201
|
+
key: W,
|
|
1202
|
+
onClick: (R) => j.click(T.date)
|
|
1202
1203
|
}, [
|
|
1203
|
-
|
|
1204
|
-
label: b
|
|
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
|
-
V(r).isMonth ?
|
|
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
|
-
V(h).schedules ? (
|
|
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
|
+
N(i.$slots, "schedule-heading", {
|
|
1221
1222
|
schedule: R,
|
|
1222
1223
|
view: V(r)
|
|
1223
1224
|
})
|
|
1224
|
-
], 2)) : (
|
|
1225
|
+
], 2)) : (S(), O("div", {
|
|
1225
1226
|
key: 1,
|
|
1226
|
-
class:
|
|
1227
|
+
class: De(["vuecal__schedule vuecal__schedule--heading", R.class]),
|
|
1227
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: r, texts: h } = n, p =
|
|
1238
|
-
const
|
|
1239
|
-
for (let
|
|
1240
|
-
const j =
|
|
1241
|
-
let
|
|
1242
|
-
j && (
|
|
1243
|
-
minutesSum:
|
|
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,
|
|
1244
1245
|
// The sum of hours + minutes in minutes.
|
|
1245
|
-
hours:
|
|
1246
|
-
minutes:
|
|
1247
|
-
formatted12: `${
|
|
1248
|
-
formatted24: `${
|
|
1249
|
-
height:
|
|
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
|
|
1250
1251
|
});
|
|
1251
1252
|
}
|
|
1252
|
-
return
|
|
1253
|
+
return b;
|
|
1253
1254
|
});
|
|
1254
|
-
return (
|
|
1255
|
-
(
|
|
1255
|
+
return (b, H) => (S(), O("div", Zt, [
|
|
1256
|
+
(S(!0), O(ne, null, ke(p.value, (v, j) => (S(), O("div", {
|
|
1256
1257
|
class: "vuecal__time-cell",
|
|
1257
1258
|
key: j,
|
|
1258
|
-
style:
|
|
1259
|
+
style: _e({ height: v.height || null })
|
|
1259
1260
|
}, [
|
|
1260
|
-
|
|
1261
|
+
N(b.$slots, "time-cell", {
|
|
1261
1262
|
index: j,
|
|
1262
|
-
minutes:
|
|
1263
|
-
hours:
|
|
1264
|
-
minutesSum:
|
|
1265
|
-
format12:
|
|
1266
|
-
format24:
|
|
1263
|
+
minutes: v.minutes,
|
|
1264
|
+
hours: v.hours,
|
|
1265
|
+
minutesSum: v.minutesSum,
|
|
1266
|
+
format12: v.formatted12,
|
|
1267
|
+
format24: v.formatted24
|
|
1267
1268
|
}, () => [
|
|
1268
|
-
|
|
1269
|
+
ge("label", null, re(V(r).twelveHour ? v.formatted12 : v.formatted24), 1)
|
|
1269
1270
|
])
|
|
1270
1271
|
], 4))), 128))
|
|
1271
1272
|
]));
|
|
@@ -1280,7 +1281,7 @@ const st = (D, n) => {
|
|
|
1280
1281
|
},
|
|
1281
1282
|
emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
|
|
1282
1283
|
setup(D, { emit: n }) {
|
|
1283
|
-
const { config: r, view: h, dnd: p, touch:
|
|
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({
|
|
1284
1285
|
dragging: !1,
|
|
1285
1286
|
resizing: !1,
|
|
1286
1287
|
fromResizer: !1,
|
|
@@ -1314,159 +1315,158 @@ const st = (D, n) => {
|
|
|
1314
1315
|
cellEl: null,
|
|
1315
1316
|
// Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
|
|
1316
1317
|
schedule: null
|
|
1317
|
-
}),
|
|
1318
|
-
|
|
1319
|
-
const R =
|
|
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 = $(() => {
|
|
1320
1321
|
var s, l, _;
|
|
1321
1322
|
return {
|
|
1322
|
-
[`vuecal__event--${
|
|
1323
|
-
[
|
|
1324
|
-
"vuecal__event--recurring": !!
|
|
1325
|
-
"vuecal__event--background": !!
|
|
1326
|
-
"vuecal__event--multiday": !!((s =
|
|
1327
|
-
"vuecal__event--cut-top": ((l =
|
|
1328
|
-
"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(),
|
|
1329
1330
|
// Only apply the dragging class on the event copy that is being dragged.
|
|
1330
|
-
"vuecal__event--dragging": !
|
|
1331
|
+
"vuecal__event--dragging": !i._.draggingGhost && i._.dragging,
|
|
1331
1332
|
// Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
|
|
1332
1333
|
// dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
|
|
1333
1334
|
// invisible, so if dragging is false, disable the dragging-ghost class as well.
|
|
1334
1335
|
// On event drop, if the new position of the event is approved, only remove the dragging-ghost class
|
|
1335
1336
|
// after event deletion (event._.dragging is already false) so the event ghost does not flash in before
|
|
1336
1337
|
// deletion.
|
|
1337
|
-
"vuecal__event--dragging-ghost":
|
|
1338
|
-
"vuecal__event--resizing":
|
|
1338
|
+
"vuecal__event--dragging-ghost": i._.draggingGhost,
|
|
1339
|
+
"vuecal__event--resizing": f.resizing
|
|
1339
1340
|
};
|
|
1340
|
-
}),
|
|
1341
|
+
}), o = $(() => {
|
|
1341
1342
|
const s = (h.isDay || h.isDays || h.isWeek) && r.time;
|
|
1342
|
-
if (!s && !
|
|
1343
|
+
if (!s && !i.backgroundColor && !i.color) return !1;
|
|
1343
1344
|
const l = {
|
|
1344
|
-
backgroundColor:
|
|
1345
|
-
color:
|
|
1345
|
+
backgroundColor: i.backgroundColor || null,
|
|
1346
|
+
color: i.color || null
|
|
1346
1347
|
};
|
|
1347
1348
|
if (s) {
|
|
1348
|
-
const _ = Math.max(r.timeFrom,
|
|
1349
|
-
l.top = `${C}%`, l.height = `${
|
|
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}%`;
|
|
1350
1351
|
}
|
|
1351
1352
|
return l;
|
|
1352
|
-
}), c =
|
|
1353
|
+
}), c = $(() => {
|
|
1353
1354
|
const s = { ...r.eventListeners.event };
|
|
1354
|
-
|
|
1355
|
-
["resize-end"].includes(t) || (s[t] = (
|
|
1356
|
-
|
|
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);
|
|
1357
1358
|
});
|
|
1358
|
-
});
|
|
1359
1359
|
const l = { ...s };
|
|
1360
1360
|
s.touchstart = (t) => {
|
|
1361
1361
|
var C;
|
|
1362
|
-
t.stopPropagation(), e(t), (C = l.touchstart) == null || C.call(l, { e: t, event:
|
|
1362
|
+
t.stopPropagation(), e(t), (C = l.touchstart) == null || C.call(l, { e: t, event: i });
|
|
1363
1363
|
}, s.mousedown = (t) => {
|
|
1364
1364
|
var C;
|
|
1365
|
-
t.stopPropagation(), e(t), (C = l.mousedown) == null || C.call(l, { e: t, event:
|
|
1365
|
+
t.stopPropagation(), e(t), (C = l.mousedown) == null || C.call(l, { e: t, event: i });
|
|
1366
1366
|
};
|
|
1367
1367
|
let _ = null;
|
|
1368
1368
|
return s.click = (t) => {
|
|
1369
1369
|
var C;
|
|
1370
|
-
(C = l.click) == null || C.call(l, { e: t, event:
|
|
1371
|
-
var
|
|
1372
|
-
_ = null, (
|
|
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 });
|
|
1373
1373
|
}, 400);
|
|
1374
1374
|
}, s.dblclick = (t) => {
|
|
1375
|
-
l.dblclick ? l.dblclick({ e: t, event:
|
|
1375
|
+
l.dblclick ? l.dblclick({ e: t, event: i }) : i.delete(1);
|
|
1376
1376
|
}, s;
|
|
1377
1377
|
}), e = (s) => {
|
|
1378
|
-
var t, C,
|
|
1378
|
+
var t, C, L;
|
|
1379
1379
|
const l = ((t = s.touches) == null ? void 0 : t[0]) || s;
|
|
1380
|
-
|
|
1380
|
+
f.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
|
|
1381
1381
|
const _ = j.value.getBoundingClientRect();
|
|
1382
|
-
|
|
1383
|
-
var J,
|
|
1384
|
-
|
|
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 });
|
|
1385
1385
|
}, 1e3);
|
|
1386
|
-
},
|
|
1387
|
-
var _, t, C,
|
|
1386
|
+
}, m = async (s) => {
|
|
1387
|
+
var _, t, C, L;
|
|
1388
1388
|
const l = ((_ = s.touches) == null ? void 0 : _[0]) || s;
|
|
1389
|
-
if (
|
|
1390
|
-
const { top: J, left:
|
|
1391
|
-
|
|
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;
|
|
1392
1392
|
}
|
|
1393
|
-
if (
|
|
1394
|
-
const { newStart: J, newEnd:
|
|
1395
|
-
let
|
|
1396
|
-
const { resize:
|
|
1397
|
-
|
|
1393
|
+
if (f.fromResizer) {
|
|
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({
|
|
1398
1398
|
e: s,
|
|
1399
|
-
event: { ...
|
|
1400
|
-
overlaps:
|
|
1401
|
-
})),
|
|
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._ } });
|
|
1402
1402
|
}
|
|
1403
1403
|
}, g = async (s) => {
|
|
1404
1404
|
var l, _;
|
|
1405
|
-
if (
|
|
1406
|
-
const { newStart: t, newEnd: C } =
|
|
1407
|
-
let
|
|
1405
|
+
if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
|
|
1406
|
+
const { newStart: t, newEnd: C } = M(i);
|
|
1407
|
+
let L = !0;
|
|
1408
1408
|
const J = c.value["resize-end"];
|
|
1409
|
-
J && (
|
|
1409
|
+
J && (L = await J({
|
|
1410
1410
|
e: s,
|
|
1411
|
-
event:
|
|
1412
|
-
original:
|
|
1411
|
+
event: i,
|
|
1412
|
+
original: f.resizingOriginalEvent,
|
|
1413
1413
|
// Original event details before resizing.
|
|
1414
|
-
overlaps:
|
|
1415
|
-
})),
|
|
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;
|
|
1416
1416
|
}
|
|
1417
|
-
document.removeEventListener(s.type === "touchend" ? "touchmove" : "mousemove",
|
|
1418
|
-
},
|
|
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) => {
|
|
1419
1419
|
const l = new Date(s.start.getFullYear(), s.start.getMonth(), s.start.getDate());
|
|
1420
1420
|
new Date(l).setDate(l.getDate() + 1);
|
|
1421
|
-
let t =
|
|
1421
|
+
let t = Pe(f.movePercentageY, r);
|
|
1422
1422
|
if (t = Math.max(0, Math.min(t, 24 * 60)), r.snapToInterval) {
|
|
1423
1423
|
const J = t + r.snapToInterval / 2;
|
|
1424
1424
|
t = J - J % r.snapToInterval;
|
|
1425
1425
|
}
|
|
1426
|
-
let C = s.start,
|
|
1427
|
-
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 };
|
|
1428
1428
|
};
|
|
1429
|
-
qe(() =>
|
|
1429
|
+
qe(() => i._.register(j.value));
|
|
1430
1430
|
const P = [], A = (s, l, _) => {
|
|
1431
1431
|
document.addEventListener(s, l, _), P.push({ event: s, handler: l, options: _ });
|
|
1432
1432
|
};
|
|
1433
1433
|
return Xe(() => {
|
|
1434
|
-
|
|
1434
|
+
i._.unregister();
|
|
1435
|
+
for (const { event: s, handler: l, options: _ } of P)
|
|
1435
1436
|
document.removeEventListener(s, l, _);
|
|
1436
|
-
|
|
1437
|
-
}), (s, l) => (E(), O("div", he({ class: "vuecal__event" }, Ie(c.value, !0), {
|
|
1437
|
+
}), (s, l) => (S(), O("div", ye({ class: "vuecal__event" }, Ie(c.value, !0), {
|
|
1438
1438
|
ref_key: "eventEl",
|
|
1439
1439
|
ref: j,
|
|
1440
1440
|
class: R.value,
|
|
1441
|
-
style:
|
|
1442
|
-
draggable:
|
|
1443
|
-
onDragstart: l[2] || (l[2] = (_) =>
|
|
1444
|
-
onDragend: l[3] || (l[3] = (_) =>
|
|
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))
|
|
1445
1445
|
}), [
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
V(r).time ? (
|
|
1450
|
-
- ` +
|
|
1451
|
-
|
|
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", {
|
|
1452
1452
|
class: "vuecal__event-content",
|
|
1453
|
-
innerHTML:
|
|
1453
|
+
innerHTML: i.content
|
|
1454
1454
|
}, null, 8, aa)
|
|
1455
1455
|
])
|
|
1456
1456
|
]),
|
|
1457
|
-
|
|
1457
|
+
W.value ? (S(), O("div", {
|
|
1458
1458
|
key: 0,
|
|
1459
1459
|
class: "vuecal__event-resizer",
|
|
1460
1460
|
onDragstart: l[0] || (l[0] = xe(() => {
|
|
1461
1461
|
}, ["prevent", "stop"]))
|
|
1462
|
-
}, null, 32)) :
|
|
1463
|
-
|
|
1464
|
-
default:
|
|
1465
|
-
|
|
1462
|
+
}, null, 32)) : U("", !0),
|
|
1463
|
+
Oe(Ge, { name: "vuecal-delete-btn" }, {
|
|
1464
|
+
default: q(() => [
|
|
1465
|
+
i._.deleting ? (S(), O("div", {
|
|
1466
1466
|
key: 0,
|
|
1467
1467
|
class: "vuecal__event-delete",
|
|
1468
|
-
onClick: l[1] || (l[1] = xe((_) =>
|
|
1469
|
-
}, "Delete")) :
|
|
1468
|
+
onClick: l[1] || (l[1] = xe((_) => i.delete(3), ["stop"]))
|
|
1469
|
+
}, "Delete")) : U("", !0)
|
|
1470
1470
|
]),
|
|
1471
1471
|
_: 1
|
|
1472
1472
|
})
|
|
@@ -1503,9 +1503,9 @@ const st = (D, n) => {
|
|
|
1503
1503
|
index: { type: Number, required: !0 }
|
|
1504
1504
|
},
|
|
1505
1505
|
setup(D) {
|
|
1506
|
-
const n = D, r = Ne("vuecal"), { view: h, config: p, dateUtils:
|
|
1507
|
-
|
|
1508
|
-
},
|
|
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({
|
|
1509
1509
|
dragging: !1,
|
|
1510
1510
|
holding: !1,
|
|
1511
1511
|
// When the cell is clicked and hold for a certain amount of time.
|
|
@@ -1526,129 +1526,133 @@ const st = (D, n) => {
|
|
|
1526
1526
|
movePercentageX: 0,
|
|
1527
1527
|
movePercentageY: 0,
|
|
1528
1528
|
schedule: null
|
|
1529
|
-
}), e =
|
|
1530
|
-
let
|
|
1531
|
-
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)), {
|
|
1532
1532
|
style: {
|
|
1533
|
-
top: `${
|
|
1534
|
-
height: `${Math.abs(
|
|
1533
|
+
top: `${u}%`,
|
|
1534
|
+
height: `${Math.abs(k - u)}%`
|
|
1535
1535
|
},
|
|
1536
|
-
startMinutes:
|
|
1536
|
+
startMinutes: E,
|
|
1537
1537
|
endMinutes: Y,
|
|
1538
|
-
start:
|
|
1539
|
-
end:
|
|
1538
|
+
start: b.formatMinutes(E),
|
|
1539
|
+
end: b.formatMinutes(Y),
|
|
1540
1540
|
...c.schedule ? { schedule: c.schedule } : {}
|
|
1541
1541
|
};
|
|
1542
|
-
}),
|
|
1543
|
-
const
|
|
1544
|
-
return
|
|
1545
|
-
}), P =
|
|
1546
|
-
var
|
|
1547
|
-
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();
|
|
1548
1548
|
return {
|
|
1549
1549
|
[`vuecal__cell--${Re[n.start.getDay()]}`]: h.isDay || h.isDays || h.isWeek || h.isMonth,
|
|
1550
|
-
[`vuecal__cell--${
|
|
1550
|
+
[`vuecal__cell--${$t[z]}`]: h.isYear,
|
|
1551
1551
|
[`vuecal__cell--${Y}`]: h.isYears,
|
|
1552
|
-
"vuecal__cell--today":
|
|
1553
|
-
"vuecal__cell--current-month": h.isYear && Y ===
|
|
1554
|
-
"vuecal__cell--current-year": h.isYears && Y ===
|
|
1555
|
-
"vuecal__cell--out-of-range": h.isMonth && (Y !==
|
|
1556
|
-
"vuecal__cell--before-min":
|
|
1557
|
-
"vuecal__cell--after-max":
|
|
1558
|
-
"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,
|
|
1559
1559
|
"vuecal__cell--selected": h.selectedDate && h.selectedDate.getTime() >= n.start.getTime() && h.selectedDate.getTime() <= n.end.getTime(),
|
|
1560
|
-
"vuecal__cell--has-schedules": (
|
|
1560
|
+
"vuecal__cell--has-schedules": (ae = p.schedules) == null ? void 0 : ae.length,
|
|
1561
1561
|
"vuecal__cell--dragging": c.dragging,
|
|
1562
1562
|
"vuecal__cell--has-events": l.value.length
|
|
1563
1563
|
};
|
|
1564
|
-
}), A =
|
|
1564
|
+
}), A = $(() => b.formatDate(n.start)), s = $(() => {
|
|
1565
1565
|
switch (h.id) {
|
|
1566
1566
|
case "day":
|
|
1567
1567
|
return "";
|
|
1568
1568
|
case "days":
|
|
1569
|
-
return p.availableViews.days.rows > 1 &&
|
|
1569
|
+
return p.availableViews.days.rows > 1 && b.formatDate(n.start, "D"), "";
|
|
1570
1570
|
case "week":
|
|
1571
1571
|
return "";
|
|
1572
1572
|
case "month":
|
|
1573
|
-
return
|
|
1573
|
+
return b.formatDate(n.start, "D");
|
|
1574
1574
|
case "year":
|
|
1575
|
-
return
|
|
1575
|
+
return b.formatDate(n.start, p.xs ? "MMM" : "MMMM");
|
|
1576
1576
|
case "years":
|
|
1577
|
-
return
|
|
1577
|
+
return b.formatDate(n.start, "YYYY");
|
|
1578
1578
|
}
|
|
1579
|
-
}), l =
|
|
1580
|
-
var
|
|
1581
|
-
return (
|
|
1582
|
-
}), C =
|
|
1583
|
-
const
|
|
1584
|
-
for (const
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
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
|
+
}
|
|
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}`;
|
|
1590
1594
|
}
|
|
1591
|
-
return
|
|
1592
|
-
}),
|
|
1593
|
-
var
|
|
1595
|
+
return u;
|
|
1596
|
+
}), J = $(() => h.isMonth && p.eventCount && !p.eventsOnMonthView && _.value.length), Z = $(() => {
|
|
1597
|
+
var E;
|
|
1594
1598
|
if (!p.specialHours || h.isMonth || h.isYear || h.isYears) return;
|
|
1595
|
-
const
|
|
1596
|
-
let
|
|
1597
|
-
if (
|
|
1598
|
-
return Array.isArray(
|
|
1599
|
-
let { from:
|
|
1600
|
-
if (isNaN(
|
|
1601
|
-
|
|
1602
|
-
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;
|
|
1603
1607
|
return {
|
|
1604
|
-
style: { top: `${
|
|
1605
|
-
label:
|
|
1606
|
-
class:
|
|
1608
|
+
style: { top: `${F}%`, height: `${X}%` },
|
|
1609
|
+
label: d,
|
|
1610
|
+
class: ae
|
|
1607
1611
|
};
|
|
1608
1612
|
}).filter((Y) => !!Y);
|
|
1609
|
-
}),
|
|
1610
|
-
const { disableDays:
|
|
1611
|
-
return
|
|
1612
|
-
}),
|
|
1613
|
-
show:
|
|
1614
|
-
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))
|
|
1615
1619
|
return !0;
|
|
1616
1620
|
}),
|
|
1617
|
-
nowInMinutes:
|
|
1618
|
-
todaysTimePosition:
|
|
1619
|
-
style:
|
|
1620
|
-
currentTime:
|
|
1621
|
-
}),
|
|
1622
|
-
if (
|
|
1623
|
-
const
|
|
1624
|
-
for (const [Y,
|
|
1625
|
-
|
|
1626
|
-
var
|
|
1627
|
-
(
|
|
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);
|
|
1628
1632
|
};
|
|
1629
|
-
const
|
|
1630
|
-
let
|
|
1631
|
-
return
|
|
1632
|
-
var
|
|
1633
|
-
|
|
1634
|
-
const
|
|
1635
|
-
(
|
|
1636
|
-
var
|
|
1637
|
-
|
|
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 });
|
|
1638
1642
|
}, 400);
|
|
1639
|
-
}, (p.time && h.isDay || h.isDays || h.isWeek) && (
|
|
1640
|
-
var
|
|
1641
|
-
|
|
1642
|
-
},
|
|
1643
|
-
var
|
|
1644
|
-
|
|
1645
|
-
}),
|
|
1646
|
-
var
|
|
1647
|
-
(
|
|
1648
|
-
}), p.editableEvents.drag && (
|
|
1649
|
-
Y.preventDefault(),
|
|
1650
|
-
},
|
|
1651
|
-
}),
|
|
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 = $(() => ({
|
|
1652
1656
|
start: n.start,
|
|
1653
1657
|
end: n.end,
|
|
1654
1658
|
events: l,
|
|
@@ -1657,275 +1661,276 @@ const st = (D, n) => {
|
|
|
1657
1661
|
goBroader: () => h.broader(),
|
|
1658
1662
|
broader: h.broaderView,
|
|
1659
1663
|
narrower: h.narrowerView
|
|
1660
|
-
})),
|
|
1661
|
-
var
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1664
|
-
},
|
|
1665
|
-
const
|
|
1666
|
-
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), {
|
|
1667
1671
|
x: c.movePercentageX || c.startPercentageX,
|
|
1668
1672
|
y: c.movePercentageY || c.startPercentageY,
|
|
1669
|
-
date:
|
|
1673
|
+
date: k
|
|
1670
1674
|
};
|
|
1671
|
-
}),
|
|
1675
|
+
}), a = () => {
|
|
1672
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);
|
|
1673
|
-
},
|
|
1674
|
-
var
|
|
1675
|
-
c.schedule = ~~
|
|
1676
|
-
const
|
|
1677
|
-
c.startX = (((
|
|
1678
|
-
var
|
|
1679
|
-
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 });
|
|
1680
1684
|
}, 1e3);
|
|
1681
|
-
},
|
|
1682
|
-
var
|
|
1683
|
-
c.dragging || (j.isDraggingCell = !0, (Y = (
|
|
1684
|
-
const
|
|
1685
|
-
c.moveX = (((
|
|
1686
|
-
},
|
|
1687
|
-
var
|
|
1688
|
-
document.removeEventListener(
|
|
1689
|
-
},
|
|
1690
|
-
if (
|
|
1691
|
-
let { start:
|
|
1692
|
-
|
|
1693
|
-
let
|
|
1694
|
-
const { create:
|
|
1695
|
-
if (typeof
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1698
|
-
} else h.createEvent(
|
|
1699
|
-
},
|
|
1700
|
-
var
|
|
1701
|
-
for (const
|
|
1702
|
-
(
|
|
1703
|
-
},
|
|
1704
|
-
|
|
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);
|
|
1705
1709
|
};
|
|
1706
|
-
return
|
|
1710
|
+
return me(
|
|
1707
1711
|
// Watch event IDs and start/end dates (only) to detect event resizing/dnd.
|
|
1708
|
-
() => _.value.map((
|
|
1712
|
+
() => _.value.map((u) => `${u._.id}${u.start.getTime()}${u.end.getTime()}`).join(),
|
|
1709
1713
|
async () => {
|
|
1710
|
-
await Ue(),
|
|
1714
|
+
await Ue(), te();
|
|
1711
1715
|
},
|
|
1712
1716
|
{ immediate: !0, flush: "post" }
|
|
1713
1717
|
// Use flush: 'post' to prevent infinite updates.
|
|
1714
1718
|
), Xe(async () => {
|
|
1715
|
-
for (const
|
|
1716
|
-
|
|
1717
|
-
}), (
|
|
1719
|
+
for (const u of T.value) H.deleteEvent(u, 3);
|
|
1720
|
+
he(), await Ue();
|
|
1721
|
+
}), (u, k) => (S(), O("div", ye({
|
|
1718
1722
|
class: ["vuecal__cell", P.value],
|
|
1719
1723
|
ref_key: "cellEl",
|
|
1720
|
-
ref:
|
|
1721
|
-
}, Ie(
|
|
1722
|
-
|
|
1724
|
+
ref: f
|
|
1725
|
+
}, Ie(oe.value, !0)), [
|
|
1726
|
+
u.$slots.cell ? N(u.$slots, "cell", {
|
|
1723
1727
|
key: 0,
|
|
1724
|
-
cell:
|
|
1725
|
-
}) :
|
|
1726
|
-
|
|
1727
|
-
class:
|
|
1728
|
-
style:
|
|
1729
|
-
innerHTML:
|
|
1730
|
-
}, null, 14, na))), 256)) :
|
|
1731
|
-
!
|
|
1732
|
-
class:
|
|
1733
|
-
key:
|
|
1734
|
-
style:
|
|
1735
|
-
"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
|
|
1736
1740
|
}, [
|
|
1737
|
-
|
|
1741
|
+
u.$slots["cell-events"] ? N(u.$slots, "cell-events", {
|
|
1738
1742
|
key: 0,
|
|
1739
|
-
cell:
|
|
1740
|
-
}) :
|
|
1741
|
-
s.value ||
|
|
1742
|
-
|
|
1743
|
-
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)
|
|
1744
1748
|
])
|
|
1745
|
-
])) :
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
])) :
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
])) : l.value.length ||
|
|
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, {
|
|
1752
1756
|
key: 4,
|
|
1753
1757
|
class: "vuecal__cell-events",
|
|
1754
1758
|
name: "vuecal-event-delete",
|
|
1755
|
-
onBeforeLeave:
|
|
1756
|
-
onAfterLeave:
|
|
1759
|
+
onBeforeLeave: k[0] || (k[0] = (Y) => W.value = !0),
|
|
1760
|
+
onAfterLeave: o,
|
|
1757
1761
|
tag: "div"
|
|
1758
1762
|
}, {
|
|
1759
|
-
default:
|
|
1760
|
-
(
|
|
1763
|
+
default: q(() => [
|
|
1764
|
+
(S(!0), O(ne, null, ke(t.value[E.id], (Y) => (S(), Se(nt, {
|
|
1761
1765
|
key: Y._.id,
|
|
1762
1766
|
event: Y,
|
|
1763
1767
|
onEventDeleted: R,
|
|
1764
|
-
style:
|
|
1765
|
-
},
|
|
1766
|
-
|
|
1768
|
+
style: _e(C.value[Y._.id])
|
|
1769
|
+
}, je({ _: 2 }, [
|
|
1770
|
+
u.$slots.event ? {
|
|
1767
1771
|
name: "event",
|
|
1768
|
-
fn:
|
|
1769
|
-
|
|
1772
|
+
fn: q((z) => [
|
|
1773
|
+
N(u.$slots, "event", ye({ ref_for: !0 }, z))
|
|
1770
1774
|
]),
|
|
1771
1775
|
key: "0"
|
|
1772
1776
|
} : void 0
|
|
1773
1777
|
]), 1032, ["event", "style"]))), 128))
|
|
1774
1778
|
]),
|
|
1775
1779
|
_: 2
|
|
1776
|
-
}, 1024)) :
|
|
1777
|
-
|
|
1780
|
+
}, 1024)) : U("", !0),
|
|
1781
|
+
M.value && c.schedule === E.id ? (S(), O("div", {
|
|
1778
1782
|
key: 5,
|
|
1779
1783
|
class: "vuecal__event-placeholder",
|
|
1780
|
-
style:
|
|
1781
|
-
},
|
|
1782
|
-
], 14, sa))), 128)) :
|
|
1783
|
-
!
|
|
1784
|
-
|
|
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", {
|
|
1785
1789
|
key: 0,
|
|
1786
|
-
cell:
|
|
1787
|
-
}) :
|
|
1788
|
-
s.value ||
|
|
1789
|
-
|
|
1790
|
-
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)
|
|
1791
1795
|
])
|
|
1792
|
-
])) :
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
])) :
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
])) : (l.value.length ||
|
|
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, {
|
|
1799
1803
|
key: 4,
|
|
1800
1804
|
class: "vuecal__cell-events",
|
|
1801
1805
|
name: "vuecal-event-delete",
|
|
1802
|
-
onBeforeLeave:
|
|
1803
|
-
onAfterLeave:
|
|
1806
|
+
onBeforeLeave: k[1] || (k[1] = (E) => W.value = !0),
|
|
1807
|
+
onAfterLeave: o,
|
|
1804
1808
|
tag: "div"
|
|
1805
1809
|
}, {
|
|
1806
|
-
default:
|
|
1807
|
-
(
|
|
1808
|
-
key:
|
|
1809
|
-
event:
|
|
1810
|
+
default: q(() => [
|
|
1811
|
+
(S(!0), O(ne, null, ke(l.value, (E) => (S(), Se(nt, {
|
|
1812
|
+
key: E._.id,
|
|
1813
|
+
event: E,
|
|
1810
1814
|
onEventDeleted: R,
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1815
|
+
class: De(L.value[E._.id]),
|
|
1816
|
+
style: _e(C.value[E._.id])
|
|
1817
|
+
}, je({ _: 2 }, [
|
|
1818
|
+
u.$slots.event ? {
|
|
1814
1819
|
name: "event",
|
|
1815
|
-
fn:
|
|
1816
|
-
|
|
1820
|
+
fn: q((Y) => [
|
|
1821
|
+
N(u.$slots, "event", ye({ ref_for: !0 }, Y))
|
|
1817
1822
|
]),
|
|
1818
1823
|
key: "0"
|
|
1819
1824
|
} : void 0
|
|
1820
|
-
]), 1032, ["event", "style"]))), 128))
|
|
1825
|
+
]), 1032, ["event", "class", "style"]))), 128))
|
|
1821
1826
|
]),
|
|
1822
1827
|
_: 3
|
|
1823
|
-
})) :
|
|
1824
|
-
|
|
1828
|
+
})) : U("", !0),
|
|
1829
|
+
M.value ? (S(), O("div", {
|
|
1825
1830
|
key: 5,
|
|
1826
1831
|
class: "vuecal__event-placeholder",
|
|
1827
|
-
style:
|
|
1828
|
-
},
|
|
1829
|
-
], 64)) :
|
|
1830
|
-
|
|
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", {
|
|
1831
1836
|
key: 4,
|
|
1832
1837
|
events: _.value
|
|
1833
|
-
}) :
|
|
1834
|
-
|
|
1838
|
+
}) : J.value ? (S(), O("div", da, re(_.value.length), 1)) : U("", !0),
|
|
1839
|
+
pe.show ? (S(), O("div", {
|
|
1835
1840
|
key: 6,
|
|
1836
1841
|
class: "vuecal__now-line",
|
|
1837
|
-
style: pe
|
|
1838
|
-
title:
|
|
1842
|
+
style: _e(pe.style),
|
|
1843
|
+
title: pe.currentTime
|
|
1839
1844
|
}, [
|
|
1840
|
-
|
|
1841
|
-
], 12, va)) :
|
|
1845
|
+
ge("span", null, re(pe.currentTime), 1)
|
|
1846
|
+
], 12, va)) : U("", !0)
|
|
1842
1847
|
], 16));
|
|
1843
1848
|
}
|
|
1844
1849
|
}, fa = {
|
|
1845
1850
|
__name: "body",
|
|
1846
1851
|
setup(D) {
|
|
1847
|
-
const n = Ne("vuecal"), { view: r, config: h, dateUtils: p } = n,
|
|
1852
|
+
const n = Ne("vuecal"), { view: r, config: h, dateUtils: p } = n, b = ie(null), H = ie(null), v = $(() => ({
|
|
1848
1853
|
"--vuecal-grid-columns": r.cols,
|
|
1849
1854
|
"--vuecal-grid-rows": r.rows
|
|
1850
|
-
})), j =
|
|
1851
|
-
const
|
|
1855
|
+
})), j = $(() => {
|
|
1856
|
+
const T = p.formatTime(Pe(H.value, h));
|
|
1852
1857
|
return {
|
|
1853
|
-
style: { top: `${
|
|
1854
|
-
time:
|
|
1858
|
+
style: { top: `${H.value}%` },
|
|
1859
|
+
time: T
|
|
1855
1860
|
};
|
|
1856
|
-
}),
|
|
1857
|
-
var
|
|
1861
|
+
}), i = (T) => {
|
|
1862
|
+
var o;
|
|
1858
1863
|
if (r.isMonth || r.isYear || r.isYears) return;
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1861
|
-
},
|
|
1862
|
-
|
|
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);
|
|
1866
|
+
}, f = () => {
|
|
1867
|
+
H.value = null;
|
|
1863
1868
|
};
|
|
1864
1869
|
return qe(() => {
|
|
1865
|
-
|
|
1870
|
+
b.value.addEventListener("mousemove", i), b.value.addEventListener("touchmove", i), b.value.addEventListener("mouseleave", f), b.value.addEventListener("touchend", f);
|
|
1866
1871
|
}), Xe(() => {
|
|
1867
|
-
|
|
1868
|
-
}), (
|
|
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", {
|
|
1869
1874
|
class: "vuecal__body",
|
|
1870
1875
|
ref_key: "bodyEl",
|
|
1871
|
-
ref:
|
|
1872
|
-
style:
|
|
1876
|
+
ref: b,
|
|
1877
|
+
style: _e(v.value)
|
|
1873
1878
|
}, [
|
|
1874
|
-
|
|
1875
|
-
default:
|
|
1876
|
-
V(h).timeAtCursor &&
|
|
1879
|
+
Oe(Ge, { name: "vuecal-shrink" }, {
|
|
1880
|
+
default: q(() => [
|
|
1881
|
+
V(h).timeAtCursor && H.value !== null ? (S(), O("div", {
|
|
1877
1882
|
key: 0,
|
|
1878
1883
|
class: "vuecal__time-at-cursor",
|
|
1879
|
-
style:
|
|
1884
|
+
style: _e(j.value.style)
|
|
1880
1885
|
}, [
|
|
1881
|
-
|
|
1882
|
-
], 4)) :
|
|
1886
|
+
ge("label", null, re(j.value.time), 1)
|
|
1887
|
+
], 4)) : U("", !0)
|
|
1883
1888
|
]),
|
|
1884
1889
|
_: 1
|
|
1885
1890
|
}),
|
|
1886
|
-
(
|
|
1887
|
-
key:
|
|
1891
|
+
(S(!0), O(ne, null, ke(V(r).cellDates, (R, o) => (S(), Se(ma, {
|
|
1892
|
+
key: o,
|
|
1888
1893
|
start: R.start,
|
|
1889
1894
|
end: R.end,
|
|
1890
|
-
index:
|
|
1891
|
-
},
|
|
1892
|
-
|
|
1895
|
+
index: o
|
|
1896
|
+
}, je({ _: 2 }, [
|
|
1897
|
+
T.$slots.cell ? {
|
|
1893
1898
|
name: "cell",
|
|
1894
|
-
fn:
|
|
1895
|
-
|
|
1899
|
+
fn: q((c) => [
|
|
1900
|
+
N(T.$slots, "cell", ye({ ref_for: !0 }, c))
|
|
1896
1901
|
]),
|
|
1897
1902
|
key: "0"
|
|
1898
1903
|
} : void 0,
|
|
1899
|
-
|
|
1904
|
+
T.$slots["cell-date"] ? {
|
|
1900
1905
|
name: "cell-date",
|
|
1901
|
-
fn:
|
|
1902
|
-
|
|
1906
|
+
fn: q((c) => [
|
|
1907
|
+
N(T.$slots, "cell-date", ye({ ref_for: !0 }, c))
|
|
1903
1908
|
]),
|
|
1904
1909
|
key: "1"
|
|
1905
1910
|
} : void 0,
|
|
1906
|
-
|
|
1911
|
+
T.$slots["cell-content"] ? {
|
|
1907
1912
|
name: "cell-content",
|
|
1908
|
-
fn:
|
|
1909
|
-
|
|
1913
|
+
fn: q((c) => [
|
|
1914
|
+
N(T.$slots, "cell-content", ye({ ref_for: !0 }, c))
|
|
1910
1915
|
]),
|
|
1911
1916
|
key: "2"
|
|
1912
1917
|
} : void 0,
|
|
1913
|
-
|
|
1918
|
+
T.$slots["cell-events"] ? {
|
|
1914
1919
|
name: "cell-events",
|
|
1915
|
-
fn:
|
|
1916
|
-
|
|
1920
|
+
fn: q((c) => [
|
|
1921
|
+
N(T.$slots, "cell-events", ye({ ref_for: !0 }, c))
|
|
1917
1922
|
]),
|
|
1918
1923
|
key: "3"
|
|
1919
|
-
} :
|
|
1924
|
+
} : T.$slots.event ? {
|
|
1920
1925
|
name: "event",
|
|
1921
|
-
fn:
|
|
1922
|
-
|
|
1926
|
+
fn: q((c) => [
|
|
1927
|
+
N(T.$slots, "event", ye({ ref_for: !0 }, c))
|
|
1923
1928
|
]),
|
|
1924
1929
|
key: "4"
|
|
1925
|
-
} :
|
|
1930
|
+
} : T.$slots["event-count"] ? {
|
|
1926
1931
|
name: "event-count",
|
|
1927
|
-
fn:
|
|
1928
|
-
|
|
1932
|
+
fn: q((c) => [
|
|
1933
|
+
N(T.$slots, "event-count", ye({ ref_for: !0 }, c))
|
|
1929
1934
|
]),
|
|
1930
1935
|
key: "5"
|
|
1931
1936
|
} : void 0
|
|
@@ -1950,173 +1955,173 @@ const st = (D, n) => {
|
|
|
1950
1955
|
"event-dropped"
|
|
1951
1956
|
],
|
|
1952
1957
|
setup(D, { expose: n, emit: r }) {
|
|
1953
|
-
const h = D, p = 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 = $(() => {
|
|
1954
1959
|
var e;
|
|
1955
1960
|
return {
|
|
1956
|
-
"vuecal--ready":
|
|
1957
|
-
[`vuecal--${
|
|
1958
|
-
[`vuecal--${
|
|
1959
|
-
"vuecal--date-picker":
|
|
1960
|
-
"vuecal--dark":
|
|
1961
|
-
"vuecal--light": !
|
|
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,
|
|
1962
1967
|
[`vuecal--${j.id}-view`]: !0,
|
|
1963
|
-
"vuecal--view-has-time":
|
|
1964
|
-
"vuecal--timeless": !
|
|
1965
|
-
"vuecal--dragging-cell":
|
|
1966
|
-
"vuecal--dragging-event":
|
|
1967
|
-
"vuecal--resizing-event":
|
|
1968
|
-
"vuecal--has-schedules": (e =
|
|
1968
|
+
"vuecal--view-has-time": T.value,
|
|
1969
|
+
"vuecal--timeless": !v.time,
|
|
1970
|
+
"vuecal--dragging-cell": f.isDraggingCell,
|
|
1971
|
+
"vuecal--dragging-event": f.isDraggingEvent,
|
|
1972
|
+
"vuecal--resizing-event": f.isResizingEvent,
|
|
1973
|
+
"vuecal--has-schedules": (e = v.schedules) == null ? void 0 : e.length
|
|
1969
1974
|
};
|
|
1970
|
-
}),
|
|
1971
|
-
"--vuecal-time-cell-height":
|
|
1972
|
-
})), c =
|
|
1973
|
-
var e,
|
|
1975
|
+
}), o = $(() => ({
|
|
1976
|
+
"--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
|
|
1977
|
+
})), c = $(() => {
|
|
1978
|
+
var e, m;
|
|
1974
1979
|
return {
|
|
1975
|
-
"vuecal__scrollable--row":
|
|
1980
|
+
"vuecal__scrollable--row": T.value || v.weekNumbers && j.isMonth,
|
|
1976
1981
|
// Keep the states inside the Vue transition wrapper for smooth CSS transitions.
|
|
1977
1982
|
[`vuecal__scrollable--${j.id}-view`]: !0,
|
|
1978
|
-
"vuecal__scrollable--has-schedules": (e =
|
|
1979
|
-
"vuecal__scrollable--no-schedules": !((
|
|
1983
|
+
"vuecal__scrollable--has-schedules": (e = v.schedules) == null ? void 0 : e.length,
|
|
1984
|
+
"vuecal__scrollable--no-schedules": !((m = v.schedules) != null && m.length)
|
|
1980
1985
|
};
|
|
1981
1986
|
});
|
|
1982
1987
|
return qe(async () => {
|
|
1983
|
-
await Ue(),
|
|
1984
|
-
}), Tt("vuecal",
|
|
1985
|
-
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]),
|
|
1986
1991
|
ref: "vuecal-el",
|
|
1987
1992
|
"data-locale": e.locale,
|
|
1988
|
-
style:
|
|
1993
|
+
style: _e(o.value)
|
|
1989
1994
|
}, [
|
|
1990
|
-
e.$slots.diy ?
|
|
1995
|
+
e.$slots.diy ? N(e.$slots, "diy", {
|
|
1991
1996
|
key: 0,
|
|
1992
|
-
vuecal: V(
|
|
1993
|
-
}) : (
|
|
1994
|
-
|
|
1997
|
+
vuecal: V(H)
|
|
1998
|
+
}) : (S(), O(ne, { key: 1 }, [
|
|
1999
|
+
Oe(At, null, je({ _: 2 }, [
|
|
1995
2000
|
e.$slots.header ? {
|
|
1996
2001
|
name: "header",
|
|
1997
|
-
fn:
|
|
1998
|
-
|
|
2002
|
+
fn: q((g) => [
|
|
2003
|
+
N(e.$slots, "header", se(le(g)))
|
|
1999
2004
|
]),
|
|
2000
2005
|
key: "0"
|
|
2001
2006
|
} : void 0,
|
|
2002
2007
|
!e.$slots.header && e.$slots["previous-button"] ? {
|
|
2003
2008
|
name: "previous-button",
|
|
2004
|
-
fn:
|
|
2005
|
-
|
|
2009
|
+
fn: q((g) => [
|
|
2010
|
+
N(e.$slots, "previous-button", se(le(g)))
|
|
2006
2011
|
]),
|
|
2007
2012
|
key: "1"
|
|
2008
2013
|
} : void 0,
|
|
2009
2014
|
!e.$slots.header && e.$slots["next-button"] ? {
|
|
2010
2015
|
name: "next-button",
|
|
2011
|
-
fn:
|
|
2012
|
-
|
|
2016
|
+
fn: q((g) => [
|
|
2017
|
+
N(e.$slots, "next-button", se(le(g)))
|
|
2013
2018
|
]),
|
|
2014
2019
|
key: "2"
|
|
2015
2020
|
} : void 0,
|
|
2016
2021
|
!e.$slots.header && e.$slots["today-button"] ? {
|
|
2017
2022
|
name: "today-button",
|
|
2018
|
-
fn:
|
|
2019
|
-
|
|
2023
|
+
fn: q((g) => [
|
|
2024
|
+
N(e.$slots, "today-button", se(le(g)))
|
|
2020
2025
|
]),
|
|
2021
2026
|
key: "3"
|
|
2022
2027
|
} : void 0,
|
|
2023
2028
|
!e.$slots.header && e.$slots.title ? {
|
|
2024
2029
|
name: "title",
|
|
2025
|
-
fn:
|
|
2026
|
-
|
|
2030
|
+
fn: q((g) => [
|
|
2031
|
+
N(e.$slots, "title", se(le(g)))
|
|
2027
2032
|
]),
|
|
2028
2033
|
key: "4"
|
|
2029
2034
|
} : void 0,
|
|
2030
2035
|
!e.$slots.header && e.$slots["schedule-heading"] ? {
|
|
2031
2036
|
name: "schedule-heading",
|
|
2032
|
-
fn:
|
|
2033
|
-
|
|
2037
|
+
fn: q((g) => [
|
|
2038
|
+
N(e.$slots, "schedule-heading", se(le(g)))
|
|
2034
2039
|
]),
|
|
2035
2040
|
key: "5"
|
|
2036
2041
|
} : void 0
|
|
2037
2042
|
]), 1024),
|
|
2038
|
-
|
|
2039
|
-
|
|
2043
|
+
ge("div", ha, [
|
|
2044
|
+
Oe(Ge, {
|
|
2040
2045
|
name: `vuecal-slide-fade--${V(j).transitionDirection}`
|
|
2041
2046
|
}, {
|
|
2042
|
-
default:
|
|
2043
|
-
(
|
|
2044
|
-
class:
|
|
2047
|
+
default: q(() => [
|
|
2048
|
+
(S(), O("div", {
|
|
2049
|
+
class: De(["vuecal__scrollable", c.value]),
|
|
2045
2050
|
key: V(j).id + V(j).start.getTime()
|
|
2046
2051
|
}, [
|
|
2047
|
-
|
|
2052
|
+
T.value ? (S(), Se(Kt, { key: 0 }, je({ _: 2 }, [
|
|
2048
2053
|
e.$slots["time-cell"] ? {
|
|
2049
2054
|
name: "time-cell",
|
|
2050
|
-
fn:
|
|
2051
|
-
|
|
2055
|
+
fn: q((g) => [
|
|
2056
|
+
N(e.$slots, "time-cell", se(le(g)))
|
|
2052
2057
|
]),
|
|
2053
2058
|
key: "0"
|
|
2054
2059
|
} : void 0
|
|
2055
|
-
]), 1024)) :
|
|
2056
|
-
V(
|
|
2057
|
-
(
|
|
2058
|
-
|
|
2059
|
-
|
|
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)
|
|
2060
2065
|
])
|
|
2061
2066
|
]))), 256))
|
|
2062
|
-
])) :
|
|
2063
|
-
|
|
2064
|
-
|
|
2067
|
+
])) : U("", !0),
|
|
2068
|
+
ge("div", pa, [
|
|
2069
|
+
Oe(qt, null, je({ _: 2 }, [
|
|
2065
2070
|
e.$slots["weekday-heading"] ? {
|
|
2066
2071
|
name: "weekday-heading",
|
|
2067
|
-
fn:
|
|
2068
|
-
|
|
2072
|
+
fn: q((g) => [
|
|
2073
|
+
N(e.$slots, "weekday-heading", se(le(g)))
|
|
2069
2074
|
]),
|
|
2070
2075
|
key: "0"
|
|
2071
2076
|
} : void 0,
|
|
2072
2077
|
e.$slots["schedule-heading"] ? {
|
|
2073
2078
|
name: "schedule-heading",
|
|
2074
|
-
fn:
|
|
2075
|
-
|
|
2079
|
+
fn: q((g) => [
|
|
2080
|
+
N(e.$slots, "schedule-heading", se(le(g)))
|
|
2076
2081
|
]),
|
|
2077
2082
|
key: "1"
|
|
2078
2083
|
} : void 0
|
|
2079
2084
|
]), 1024),
|
|
2080
|
-
|
|
2085
|
+
Oe(fa, null, je({ _: 2 }, [
|
|
2081
2086
|
e.$slots.cell ? {
|
|
2082
2087
|
name: "cell",
|
|
2083
|
-
fn:
|
|
2084
|
-
|
|
2088
|
+
fn: q((g) => [
|
|
2089
|
+
N(e.$slots, "cell", se(le(g)))
|
|
2085
2090
|
]),
|
|
2086
2091
|
key: "0"
|
|
2087
2092
|
} : void 0,
|
|
2088
2093
|
!e.$slots.cell && e.$slots["cell-date"] ? {
|
|
2089
2094
|
name: "cell-date",
|
|
2090
|
-
fn:
|
|
2091
|
-
|
|
2095
|
+
fn: q((g) => [
|
|
2096
|
+
N(e.$slots, "cell-date", se(le(g)))
|
|
2092
2097
|
]),
|
|
2093
2098
|
key: "1"
|
|
2094
2099
|
} : void 0,
|
|
2095
2100
|
!e.$slots.cell && e.$slots["cell-content"] ? {
|
|
2096
2101
|
name: "cell-content",
|
|
2097
|
-
fn:
|
|
2098
|
-
|
|
2102
|
+
fn: q((g) => [
|
|
2103
|
+
N(e.$slots, "cell-content", se(le(g)))
|
|
2099
2104
|
]),
|
|
2100
2105
|
key: "2"
|
|
2101
2106
|
} : void 0,
|
|
2102
2107
|
!e.$slots.cell && e.$slots["cell-events"] ? {
|
|
2103
2108
|
name: "cell-events",
|
|
2104
|
-
fn:
|
|
2105
|
-
|
|
2109
|
+
fn: q((g) => [
|
|
2110
|
+
N(e.$slots, "cell-events", se(le(g)))
|
|
2106
2111
|
]),
|
|
2107
2112
|
key: "3"
|
|
2108
2113
|
} : void 0,
|
|
2109
2114
|
!e.$slots.cell && e.$slots.event ? {
|
|
2110
2115
|
name: "event",
|
|
2111
|
-
fn:
|
|
2112
|
-
|
|
2116
|
+
fn: q((g) => [
|
|
2117
|
+
N(e.$slots, "event", se(le(g)))
|
|
2113
2118
|
]),
|
|
2114
2119
|
key: "4"
|
|
2115
2120
|
} : void 0,
|
|
2116
2121
|
!e.$slots.cell && e.$slots["event-count"] ? {
|
|
2117
2122
|
name: "event-count",
|
|
2118
|
-
fn:
|
|
2119
|
-
|
|
2123
|
+
fn: q((g) => [
|
|
2124
|
+
N(e.$slots, "event-count", se(le(g)))
|
|
2120
2125
|
]),
|
|
2121
2126
|
key: "5"
|
|
2122
2127
|
} : void 0
|
|
@@ -2131,12 +2136,12 @@ const st = (D, n) => {
|
|
|
2131
2136
|
], 14, ga));
|
|
2132
2137
|
}
|
|
2133
2138
|
}, ka = (D) => {
|
|
2134
|
-
ze.texts = { ...
|
|
2139
|
+
ze.texts = { ...fe.texts, ...D }, ze.dateUtils.updateTexts(ze.texts);
|
|
2135
2140
|
}, {
|
|
2136
2141
|
addDatePrototypes: ba,
|
|
2137
2142
|
removeDatePrototypes: Ta,
|
|
2138
|
-
updateTexts:
|
|
2139
|
-
addDays:
|
|
2143
|
+
updateTexts: $a,
|
|
2144
|
+
addDays: Ma,
|
|
2140
2145
|
subtractDays: Ya,
|
|
2141
2146
|
addHours: Ea,
|
|
2142
2147
|
subtractHours: Sa,
|
|
@@ -2162,7 +2167,7 @@ const st = (D, n) => {
|
|
|
2162
2167
|
export {
|
|
2163
2168
|
_a as VueCal,
|
|
2164
2169
|
ba as addDatePrototypes,
|
|
2165
|
-
|
|
2170
|
+
Ma as addDays,
|
|
2166
2171
|
Ea as addHours,
|
|
2167
2172
|
Ca as addMinutes,
|
|
2168
2173
|
Wa as countDays,
|
|
@@ -2185,6 +2190,6 @@ export {
|
|
|
2185
2190
|
Ya as subtractDays,
|
|
2186
2191
|
Sa as subtractHours,
|
|
2187
2192
|
Va as subtractMinutes,
|
|
2188
|
-
|
|
2193
|
+
$a as updateTexts,
|
|
2189
2194
|
ka as useLocale
|
|
2190
2195
|
};
|