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