vue-cal 5.0.1-rc.30 → 5.0.1-rc.32
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/kaa.js +1 -1
- package/dist/i18n/kk.js +1 -1
- package/dist/i18n/ko.js +1 -1
- package/dist/i18n/ky.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/uz-cryl.js +1 -1
- package/dist/i18n/uz.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 +703 -684
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +9 -9
package/dist/vue-cal.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed as b, reactive as be, watch as De, toRefs as bt, ref as ue, onBeforeUnmount as Re, nextTick as Xe, inject as He, createElementBlock as P, openBlock as V, renderSlot as
|
|
1
|
+
import { computed as b, reactive as be, watch as De, toRefs as bt, ref as ue, onBeforeUnmount as Re, nextTick as Xe, inject as He, createElementBlock as P, openBlock as V, renderSlot as O, createCommentVNode as x, unref as $, Fragment as de, renderList as we, normalizeClass as pe, createElementVNode as he, createVNode as Oe, Transition as Ue, withCtx as N, createBlock as Se, resolveDynamicComponent as xe, mergeProps as ie, toHandlers as Ie, normalizeProps as ne, onMounted as Ze, toDisplayString as ce, createTextVNode as qe, withModifiers as et, normalizeStyle as $e, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Et, provide as nt, guardReactiveProps as le } from "vue";
|
|
2
2
|
/**
|
|
3
|
-
* vue-cal v5.0.1-rc.
|
|
3
|
+
* vue-cal v5.0.1-rc.32
|
|
4
4
|
* (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -40,16 +40,16 @@ const fe = {
|
|
|
40
40
|
return E.value[u] ? u : (console.warn(
|
|
41
41
|
`Vue Cal: the provided or default view \`${u}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(E.value)[0]}\`.`
|
|
42
42
|
), Object.keys(E.value)[0]);
|
|
43
|
-
}),
|
|
43
|
+
}), W = b(() => t.sm && !t.xs), v = b(() => t.xs || t.datePicker), A = b(() => t.clickToNavigate || t.datePicker && t.clickToNavigate !== !1), Z = b(() => {
|
|
44
44
|
const c = {
|
|
45
45
|
cell: {},
|
|
46
46
|
// All possible event listeners to attach to cells.
|
|
47
47
|
event: {}
|
|
48
48
|
// All possible event listeners to attach to calendar events.
|
|
49
49
|
}, u = (p) => p.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
50
|
-
for (const [p,
|
|
51
|
-
const [
|
|
52
|
-
|
|
50
|
+
for (const [p, n] of Object.entries(d)) {
|
|
51
|
+
const [j, X, U] = p.match(/^on(Cell|Event)(.+)$/) || [];
|
|
52
|
+
j && (c[X.toLowerCase()][u(U).replace(/^-+|-+$/g, "")] = n);
|
|
53
53
|
}
|
|
54
54
|
return c;
|
|
55
55
|
}), L = b(() => {
|
|
@@ -59,17 +59,17 @@ const fe = {
|
|
|
59
59
|
}), l = b(() => t.hideWeekends || L.value[6] && L.value[7]), E = b(() => {
|
|
60
60
|
const c = t.datePicker;
|
|
61
61
|
let u = 0, p = {};
|
|
62
|
-
const
|
|
63
|
-
return c && !
|
|
62
|
+
const n = t.views;
|
|
63
|
+
return c && !n ? {
|
|
64
64
|
month: { ...fe.availableViews.month },
|
|
65
65
|
year: { ...fe.availableViews.year },
|
|
66
66
|
years: { ...fe.availableViews.years }
|
|
67
|
-
} : t.horizontal && !
|
|
67
|
+
} : t.horizontal && !n ? {
|
|
68
68
|
days: { cols: fe.availableViews.days.rows, rows: fe.availableViews.days.cols },
|
|
69
69
|
week: { cols: fe.availableViews.week.rows, rows: fe.availableViews.week.cols }
|
|
70
|
-
} : (
|
|
70
|
+
} : (n ? (Array.isArray(n) ? p = n.reduce((j, X) => (typeof X == "string" && fe.availableViews[X] ? j[X] = fe.availableViews[X] : u++, j), {}) : typeof n == "object" && (p = Object.entries(n).reduce((j, [X, U]) => {
|
|
71
71
|
const { cols: K, rows: te } = fe.availableViews[X];
|
|
72
|
-
return
|
|
72
|
+
return j[X] = { cols: U.cols || K, rows: U.rows || te }, j;
|
|
73
73
|
}, {})), u && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(p).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), p = { ...fe.availableViews })) : p = { ...fe.availableViews }, p);
|
|
74
74
|
}), F = b(() => t.datePicker ? "month" : E.value.week ? "week" : Object.keys(E.value)[0]), m = b(() => {
|
|
75
75
|
if (typeof t.selectedDate == "string") return r.stringToDate(t.selectedDate);
|
|
@@ -88,13 +88,13 @@ const fe = {
|
|
|
88
88
|
}), S = b(() => {
|
|
89
89
|
let c = null;
|
|
90
90
|
return t.minDate && typeof t.minDate == "string" ? c = r.stringToDate(t.minDate) : t.minDate && t.minDate instanceof Date && (c = t.minDate), (c == null ? void 0 : c.getTime()) || null;
|
|
91
|
-
}),
|
|
91
|
+
}), a = b(() => {
|
|
92
92
|
let c = null;
|
|
93
93
|
return t.maxDate && typeof t.maxDate == "string" ? c = r.stringToDate(t.maxDate) : t.maxDate && t.maxDate instanceof Date && (c = t.maxDate), (c == null ? void 0 : c.getTime()) || null;
|
|
94
94
|
}), I = b(() => {
|
|
95
95
|
var p;
|
|
96
96
|
const { view: c } = y;
|
|
97
|
-
return t.schedules.length && (c.isDay || c.isDays || c.isWeek) && ((p = t.schedules) == null ? void 0 : p.map((
|
|
97
|
+
return t.schedules.length && (c.isDay || c.isDays || c.isWeek) && ((p = t.schedules) == null ? void 0 : p.map((n, j) => ({ ...n, id: n.id ?? j + 1 }))) || void 0;
|
|
98
98
|
}), e = b(() => {
|
|
99
99
|
const c = {
|
|
100
100
|
drag: !0,
|
|
@@ -108,7 +108,7 @@ const fe = {
|
|
|
108
108
|
return (Array.isArray(u) ? u.includes(c.id) : u) && (c.isMonth && !t.eventsOnMonthView || c.isYear);
|
|
109
109
|
}), H = b(() => t.allDayEvents && t.time !== !1 && !C.isMonth), Y = b(() => t.timeAtCursor && t.time !== !1), _ = async (c) => {
|
|
110
110
|
var p;
|
|
111
|
-
let u = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((
|
|
111
|
+
let u = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((n) => n.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((n) => n.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((n) => n.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((n) => n.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((n) => n.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((n) => n.default), "../i18n/da.json": () => import("./i18n/da.js").then((n) => n.default), "../i18n/de.json": () => import("./i18n/de.js").then((n) => n.default), "../i18n/el.json": () => import("./i18n/el.js").then((n) => n.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((n) => n.default), "../i18n/en-us.json": () => Promise.resolve().then(() => jt).then((n) => n.default), "../i18n/es.json": () => import("./i18n/es.js").then((n) => n.default), "../i18n/et.json": () => import("./i18n/et.js").then((n) => n.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((n) => n.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((n) => n.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((n) => n.default), "../i18n/he.json": () => import("./i18n/he.js").then((n) => n.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((n) => n.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((n) => n.default), "../i18n/id.json": () => import("./i18n/id.js").then((n) => n.default), "../i18n/is.json": () => import("./i18n/is.js").then((n) => n.default), "../i18n/it.json": () => import("./i18n/it.js").then((n) => n.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((n) => n.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((n) => n.default), "../i18n/kaa.json": () => import("./i18n/kaa.js").then((n) => n.default), "../i18n/kk.json": () => import("./i18n/kk.js").then((n) => n.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((n) => n.default), "../i18n/ky.json": () => import("./i18n/ky.js").then((n) => n.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((n) => n.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((n) => n.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((n) => n.default), "../i18n/no.json": () => import("./i18n/no.js").then((n) => n.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((n) => n.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((n) => n.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((n) => n.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((n) => n.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((n) => n.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((n) => n.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((n) => n.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((n) => n.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((n) => n.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((n) => n.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((n) => n.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((n) => n.default), "../i18n/uz-cryl.json": () => import("./i18n/uz-cryl.js").then((n) => n.default), "../i18n/uz.json": () => import("./i18n/uz.js").then((n) => n.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((n) => n.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((n) => n.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((n) => n.default) });
|
|
112
112
|
{
|
|
113
113
|
if (!u[`../i18n/${c}.json`]) {
|
|
114
114
|
console.warn(`Vue Cal: the locale \`${c}\` does not exist. Falling back to \`en-us\`.`), c = "en-us";
|
|
@@ -117,23 +117,23 @@ const fe = {
|
|
|
117
117
|
u = await ((p = u[`../i18n/${c}.json`]) == null ? void 0 : p.call(u));
|
|
118
118
|
}
|
|
119
119
|
y.texts = Object.assign(y.texts, Object.assign({ ...fe.texts }, u)), r.updateTexts(y.texts);
|
|
120
|
-
},
|
|
121
|
-
return De(() => t.events, (c) =>
|
|
120
|
+
}, f = be(t.events || []);
|
|
121
|
+
return De(() => t.events, (c) => f.splice(0, f.length, ...c)), De(() => t.locale, (c) => _(c || "en-us")), (t.locale || !y.texts.today) && _(t.locale || "en-us"), {
|
|
122
122
|
...bt(t),
|
|
123
|
-
events:
|
|
123
|
+
events: f,
|
|
124
124
|
// All the events listeners for cells and events that the end user may have attached to vue-cal.
|
|
125
125
|
eventListeners: Z,
|
|
126
126
|
defaultView: F,
|
|
127
127
|
availableViews: E,
|
|
128
128
|
disableDays: i,
|
|
129
129
|
ready: h,
|
|
130
|
-
sm:
|
|
131
|
-
xs:
|
|
130
|
+
sm: W,
|
|
131
|
+
xs: v,
|
|
132
132
|
clickToNavigate: A,
|
|
133
133
|
hideWeekdays: L,
|
|
134
134
|
hideWeekends: l,
|
|
135
135
|
minTimestamp: S,
|
|
136
|
-
maxTimestamp:
|
|
136
|
+
maxTimestamp: a,
|
|
137
137
|
schedules: I,
|
|
138
138
|
selectedDate: m,
|
|
139
139
|
editableEvents: e,
|
|
@@ -146,7 +146,7 @@ const fe = {
|
|
|
146
146
|
return Object.keys(L.value).length;
|
|
147
147
|
},
|
|
148
148
|
get size() {
|
|
149
|
-
return
|
|
149
|
+
return v.value ? "xs" : W.value ? "sm" : "lg";
|
|
150
150
|
},
|
|
151
151
|
loadTexts: _
|
|
152
152
|
};
|
|
@@ -159,81 +159,81 @@ const fe = {
|
|
|
159
159
|
}, Ke = (y, t) => {
|
|
160
160
|
const d = t.clientHeight;
|
|
161
161
|
return y * 100 / d;
|
|
162
|
-
},
|
|
163
|
-
let
|
|
162
|
+
}, We = be({ id: null, date: null });
|
|
163
|
+
let at = !1, Je = !0;
|
|
164
164
|
const _e = be({ el: null, cell: null, timeout: null }), ke = be({
|
|
165
165
|
eventId: null,
|
|
166
166
|
fromVueCal: null,
|
|
167
167
|
toVueCal: null
|
|
168
168
|
});
|
|
169
169
|
function zt(y) {
|
|
170
|
-
const { config: t, view: d, eventsManager: r, emit: h, uid: C, dateUtils:
|
|
170
|
+
const { config: t, view: d, eventsManager: r, emit: h, uid: C, dateUtils: W } = y, v = (S) => {
|
|
171
171
|
var _;
|
|
172
|
-
const { timeStep:
|
|
172
|
+
const { timeStep: a, timeCellHeight: I, timeFrom: e } = t, z = (((_ = S.touches) == null ? void 0 : _[0]) || S).clientY, { top: H } = S.currentTarget.getBoundingClientRect(), Y = z - H - ~~S.dataTransfer.getData("cursor-grab-at");
|
|
173
173
|
return je(Ke(Y, S.currentTarget), t);
|
|
174
|
-
}, A = (S,
|
|
175
|
-
const e =
|
|
176
|
-
let z = Math.max(
|
|
174
|
+
}, A = (S, a, I) => {
|
|
175
|
+
const e = a.duration || Z(a.start, a.end) || t.timeStep;
|
|
176
|
+
let z = Math.max(v(S), 0);
|
|
177
177
|
if (t.snapToInterval) {
|
|
178
|
-
const
|
|
179
|
-
z =
|
|
178
|
+
const f = z + t.snapToInterval / 2;
|
|
179
|
+
z = f - f % t.snapToInterval;
|
|
180
180
|
}
|
|
181
181
|
const H = new Date(new Date(I).setMinutes(z)), Y = Math.min(z + e, 1440), _ = new Date(new Date(I).setMinutes(Y));
|
|
182
182
|
return { start: H, end: _ };
|
|
183
|
-
}, Z = (S,
|
|
183
|
+
}, Z = (S, a) => Math.round((a - S) / 6e4);
|
|
184
184
|
return {
|
|
185
|
-
eventDragStart: (S,
|
|
185
|
+
eventDragStart: (S, a) => {
|
|
186
186
|
if (S.target.nodeType === 3 || y.touch.isResizingEvent) return S.preventDefault();
|
|
187
187
|
S.dataTransfer.effectAllowed = "move", S.dataTransfer.dropEffect = "move";
|
|
188
|
-
const I = { ...
|
|
188
|
+
const I = { ...a, _: { id: a._.id, duration: Z(a.start, a.end) } };
|
|
189
189
|
try {
|
|
190
190
|
S.dataTransfer.setData("text/plain", ""), S.dataTransfer.setData("event", JSON.stringify(I)), S.dataTransfer.setData("cursor-grab-at", S.offsetY);
|
|
191
191
|
} catch (z) {
|
|
192
192
|
return console.warn("Vue Cal: Failed to set drag data:", z), S.preventDefault();
|
|
193
193
|
}
|
|
194
|
-
ke.eventId =
|
|
194
|
+
ke.eventId = a._.id, ke.fromVueCal = C, h("event-drag-start", {
|
|
195
195
|
e: S,
|
|
196
|
-
event:
|
|
196
|
+
event: a
|
|
197
197
|
});
|
|
198
198
|
const e = S.target.closest(".vuecal__event");
|
|
199
199
|
e.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
|
|
200
200
|
e.classList.add("vuecal__event--dragging-original"), e.classList.remove("vuecal__event--dragging-ghost");
|
|
201
|
-
}, 0),
|
|
201
|
+
}, 0), at = !1, Object.assign(We, { id: d.id, date: d.firstCellDate }), Je = !0, y.touch.isDraggingEvent = !0;
|
|
202
202
|
},
|
|
203
|
-
eventDragEnd: (S,
|
|
203
|
+
eventDragEnd: (S, a) => {
|
|
204
204
|
ke.eventId = null, S.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
|
|
205
205
|
const { fromVueCal: I, toVueCal: e } = ke;
|
|
206
|
-
e && I !== e && r.deleteEvent(
|
|
206
|
+
e && I !== e && r.deleteEvent(a._.id, 3), at && Je && We.id && d.switchView(We.id, We.date, !0), h("event-drag-end", {
|
|
207
207
|
e: S,
|
|
208
|
-
event:
|
|
208
|
+
event: a,
|
|
209
209
|
external: ke.fromVueCal !== C
|
|
210
210
|
}), ke.fromVueCal = null, ke.toVueCal = null, y.touch.isDraggingEvent = !1;
|
|
211
211
|
},
|
|
212
|
-
cellDragEnter: (S,
|
|
213
|
-
const { start: I } =
|
|
212
|
+
cellDragEnter: (S, a) => {
|
|
213
|
+
const { start: I } = a, e = S.currentTarget;
|
|
214
214
|
if (!S.currentTarget.contains(S.relatedTarget)) {
|
|
215
215
|
if (e === _e.el || !e.className.includes("vuecal__cell-content")) return !1;
|
|
216
|
-
_e.el && (_e.cell.highlighted = !1), Object.assign(_e, { el: e, cell:
|
|
216
|
+
_e.el && (_e.cell.highlighted = !1), Object.assign(_e, { el: e, cell: a, timeout: clearTimeout(_e.timeout) }), a.highlighted = !0, ["years", "year", "month"].includes(d.id) && (_e.timeout = setTimeout(() => y.switchToNarrowerView(I), 2e3));
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
cellDragOver: (S,
|
|
220
|
-
const { start: I, schedule: e } =
|
|
221
|
-
S.preventDefault(),
|
|
219
|
+
cellDragOver: (S, a) => {
|
|
220
|
+
const { start: I, schedule: e } = a;
|
|
221
|
+
S.preventDefault(), a.highlighted = !0, (e || e === 0) && (a.highlightedSchedule = e);
|
|
222
222
|
},
|
|
223
|
-
cellDragLeave: (S,
|
|
224
|
-
S.preventDefault(), !S.currentTarget.contains(S.relatedTarget) && (
|
|
223
|
+
cellDragLeave: (S, a) => {
|
|
224
|
+
S.preventDefault(), !S.currentTarget.contains(S.relatedTarget) && (a.highlightedSchedule = !1, _e.cell === a && (clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null }), a.highlighted = !1));
|
|
225
225
|
},
|
|
226
|
-
cellDragDrop: async (S,
|
|
227
|
-
var p,
|
|
226
|
+
cellDragDrop: async (S, a, I = !1) => {
|
|
227
|
+
var p, n, j;
|
|
228
228
|
S.preventDefault(), clearTimeout(_e.timeout), Object.assign(_e, { el: null, cell: null, timeout: null });
|
|
229
229
|
const e = JSON.parse(S.dataTransfer.getData("event") || "{}");
|
|
230
230
|
e.start && (e.start = new Date(e.start)), e.end && (e.end = new Date(e.end));
|
|
231
231
|
let z, H, Y;
|
|
232
|
-
I ? (H = new Date(
|
|
232
|
+
I ? (H = new Date(a.start), Y = new Date(a.end)) : { start: H, end: Y } = A(S, e, a.start);
|
|
233
233
|
const { schedule: _ } = ((p = S.target.closest("[data-schedule]")) == null ? void 0 : p.dataset) || {};
|
|
234
|
-
let
|
|
234
|
+
let f = () => {
|
|
235
235
|
};
|
|
236
|
-
ke.fromVueCal === C ? (z = r.getEvent(e._.id), z && (z._.dragging = !1,
|
|
236
|
+
ke.fromVueCal === C ? (z = r.getEvent(e._.id), z && (z._.dragging = !1, f = (X) => {
|
|
237
237
|
if (z.start = H, z.end = Y, z.allDay = I, _ !== void 0 && (z.schedule = ~~_), X && typeof X == "object") {
|
|
238
238
|
const { _: U, ...K } = X;
|
|
239
239
|
Object.assign(z, K);
|
|
@@ -243,25 +243,25 @@ function zt(y) {
|
|
|
243
243
|
start: H,
|
|
244
244
|
end: Y,
|
|
245
245
|
..._ !== void 0 && { schedule: ~~_ },
|
|
246
|
-
_: { id: ((
|
|
246
|
+
_: { id: ((n = e._) == null ? void 0 : n.id) || e.id, duration: Z(H, Y) },
|
|
247
247
|
getOverlappingEvents: () => r.getEventsInRange(H, Y, { schedule: ~~_ })
|
|
248
|
-
},
|
|
248
|
+
}, f = (X) => {
|
|
249
249
|
if (z = r.createEvent(z), X && typeof X == "object") {
|
|
250
250
|
const { _: U, ...K } = X;
|
|
251
251
|
Object.assign(z, K);
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
let c = !0;
|
|
255
|
-
const { drop: u } = (
|
|
255
|
+
const { drop: u } = (j = t.eventListeners) == null ? void 0 : j.event;
|
|
256
256
|
u && (c = await u({
|
|
257
257
|
e: S,
|
|
258
258
|
event: { ...z, start: H, end: Y, schedule: ~~_ },
|
|
259
259
|
overlaps: z.getOverlappingEvents({ start: H, end: Y, schedule: ~~_ }),
|
|
260
|
-
cell:
|
|
260
|
+
cell: a,
|
|
261
261
|
external: ke.fromVueCal !== C
|
|
262
|
-
})), c !== !1 &&
|
|
262
|
+
})), c !== !1 && f(c), a.highlighted = !1, a.highlightedSchedule = null, Je = !1, ke.toVueCal = C, h("event-dropped", {
|
|
263
263
|
e: S,
|
|
264
|
-
cell:
|
|
264
|
+
cell: a,
|
|
265
265
|
event: z,
|
|
266
266
|
originalEvent: e,
|
|
267
267
|
external: ke.fromVueCal !== C
|
|
@@ -270,9 +270,9 @@ function zt(y) {
|
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
272
|
const lt = (y, t) => {
|
|
273
|
-
let d, r, h, C = {},
|
|
274
|
-
const
|
|
275
|
-
|
|
273
|
+
let d, r, h, C = {}, W = {};
|
|
274
|
+
const v = ue(y), A = () => {
|
|
275
|
+
v.value.today || (v.value = t), Date.prototype.addDays = function(s) {
|
|
276
276
|
return E(this, s || 0);
|
|
277
277
|
}, Date.prototype.subtractDays = function(s) {
|
|
278
278
|
return F(this, s || 0);
|
|
@@ -283,7 +283,7 @@ const lt = (y, t) => {
|
|
|
283
283
|
}, Date.prototype.addMinutes = function(s) {
|
|
284
284
|
return S(this, s || 0);
|
|
285
285
|
}, Date.prototype.subtractMinutes = function(s) {
|
|
286
|
-
return
|
|
286
|
+
return a(this, s || 0);
|
|
287
287
|
}, Date.prototype.getWeek = function() {
|
|
288
288
|
return e(this);
|
|
289
289
|
}, Date.prototype.isToday = function() {
|
|
@@ -298,7 +298,7 @@ const lt = (y, t) => {
|
|
|
298
298
|
}, Z = () => {
|
|
299
299
|
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;
|
|
300
300
|
}, L = (s) => {
|
|
301
|
-
|
|
301
|
+
v.value = s, Date.prototype.subtractDays && A();
|
|
302
302
|
}, l = () => (r !== (/* @__PURE__ */ new Date()).getDate() && (d = /* @__PURE__ */ new Date(), r = d.getDate(), h = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`), h), E = (s, k) => {
|
|
303
303
|
const D = new Date(s.valueOf());
|
|
304
304
|
return D.setDate(D.getDate() + k), D;
|
|
@@ -314,13 +314,13 @@ const lt = (y, t) => {
|
|
|
314
314
|
}, S = (s, k) => {
|
|
315
315
|
const D = new Date(s.valueOf());
|
|
316
316
|
return D.setMinutes(D.getMinutes() + k), D;
|
|
317
|
-
},
|
|
317
|
+
}, a = (s, k) => {
|
|
318
318
|
const D = new Date(s.valueOf());
|
|
319
319
|
return D.setMinutes(D.getMinutes() - k), D;
|
|
320
320
|
}, I = (s, k) => {
|
|
321
321
|
const D = (J) => {
|
|
322
|
-
const
|
|
323
|
-
return
|
|
322
|
+
const se = J % k;
|
|
323
|
+
return se !== 0 && (J += se >= k / 2 ? k - se : -se), J;
|
|
324
324
|
};
|
|
325
325
|
if (typeof s == "number") return D(s);
|
|
326
326
|
if (s instanceof Date) {
|
|
@@ -330,27 +330,27 @@ const lt = (y, t) => {
|
|
|
330
330
|
}, e = (s, k = !1) => {
|
|
331
331
|
const D = new Date(Date.UTC(s.getFullYear(), s.getMonth(), s.getDate())), J = D.getUTCDay() || 7;
|
|
332
332
|
D.setUTCDate(D.getUTCDate() + 4 - J);
|
|
333
|
-
const
|
|
334
|
-
return Math.ceil(((D -
|
|
333
|
+
const se = new Date(Date.UTC(D.getUTCFullYear(), 0, 1));
|
|
334
|
+
return Math.ceil(((D - se) / 864e5 + 1) / 7) + (k ? 1 : 0);
|
|
335
335
|
}, z = (s) => `${s.getFullYear()}-${s.getMonth()}-${s.getDate()}` === l(), H = (s, k) => {
|
|
336
336
|
if (!s || !k) return console.warn(`Vue Cal: missing date${s ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
|
|
337
|
-
if (
|
|
338
|
-
if (!
|
|
337
|
+
if (j(s)) {
|
|
338
|
+
if (!j(k)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${k}\`.`);
|
|
339
339
|
} else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${s}\`.`);
|
|
340
340
|
return s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
|
|
341
|
-
}, Y = (s, k, D) =>
|
|
341
|
+
}, Y = (s, k, D) => j(s) ? s.getTime() >= k && s.getTime() <= D : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${s}\`.`), _ = (s) => {
|
|
342
342
|
const k = s.getFullYear();
|
|
343
343
|
return !(k % 400) || k % 100 && !(k % 4);
|
|
344
|
-
},
|
|
344
|
+
}, f = (s = null, k) => {
|
|
345
345
|
const D = s && new Date(s.valueOf()) || /* @__PURE__ */ new Date(), J = k ? 7 : 6;
|
|
346
346
|
return D.setDate(D.getDate() - (D.getDay() + J) % 7), D;
|
|
347
347
|
}, c = (s) => s instanceof Date ? s : (s.length === 10 && (s += " 00:00"), new Date(s.replace(/-/g, "/"))), u = (s) => s.getHours() * 60 + s.getMinutes(), p = (s, k) => {
|
|
348
348
|
typeof s == "string" && (s = s.replace(/-/g, "/")), typeof k == "string" && (k = k.replace(/-/g, "/")), s = new Date(s).setHours(0, 0, 0, 0), k = new Date(k).setHours(0, 0, 1, 0);
|
|
349
349
|
const D = (new Date(k).getTimezoneOffset() - new Date(s).getTimezoneOffset()) * 60 * 1e3;
|
|
350
350
|
return Math.ceil((k - s - D) / (24 * 3600 * 1e3));
|
|
351
|
-
},
|
|
352
|
-
if (D || (D =
|
|
353
|
-
C = {},
|
|
351
|
+
}, n = (s, k, D) => Math.abs(s.getTime() - k.getTime()) <= D * 60 * 1e3, j = (s) => s && s instanceof Date && !isNaN(s), X = (s, k = "YYYY-MM-DD", D = null) => {
|
|
352
|
+
if (D || (D = v.value), k || (k = "YYYY-MM-DD"), k === "YYYY-MM-DD") return U(s);
|
|
353
|
+
C = {}, W = {};
|
|
354
354
|
const J = {
|
|
355
355
|
YYYY: () => ae(s, D).YYYY,
|
|
356
356
|
YY: () => ae(s, D).YY(),
|
|
@@ -376,7 +376,7 @@ const lt = (y, t) => {
|
|
|
376
376
|
m: () => ve(s, D).m,
|
|
377
377
|
s: () => ve(s, D).s
|
|
378
378
|
};
|
|
379
|
-
return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (
|
|
379
|
+
return k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (se, me) => {
|
|
380
380
|
const o = J[me.replace(/\{|\}/g, "")];
|
|
381
381
|
return o !== void 0 ? o() : me;
|
|
382
382
|
});
|
|
@@ -384,25 +384,25 @@ const lt = (y, t) => {
|
|
|
384
384
|
const k = s.getMonth() + 1, D = s.getDate();
|
|
385
385
|
return `${s.getFullYear()}-${k < 10 ? "0" : ""}${k}-${D < 10 ? "0" : ""}${D}`;
|
|
386
386
|
}, K = (s, k = "HH:mm", D = null, J = !1) => {
|
|
387
|
-
let
|
|
387
|
+
let se = !1;
|
|
388
388
|
if (J) {
|
|
389
389
|
const [T, M, w] = [s.getHours(), s.getMinutes(), s.getSeconds()];
|
|
390
|
-
T + M + w === 141 && (
|
|
390
|
+
T + M + w === 141 && (se = !0);
|
|
391
391
|
}
|
|
392
|
-
if (s instanceof Date && k === "HH:mm") return
|
|
393
|
-
|
|
392
|
+
if (s instanceof Date && k === "HH:mm") return se ? "24:00" : te(s);
|
|
393
|
+
W = {}, D || (D = v.value);
|
|
394
394
|
const me = ve(s, D), o = k.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (T, M) => {
|
|
395
395
|
const w = me[M.replace(/\{|\}/g, "")];
|
|
396
396
|
return w !== void 0 ? w : M;
|
|
397
397
|
});
|
|
398
|
-
return
|
|
398
|
+
return se ? o.replace("23:59", "24:00") : o;
|
|
399
399
|
}, te = (s) => {
|
|
400
400
|
const k = s.getHours(), D = s.getMinutes();
|
|
401
401
|
return `${(k < 10 ? "0" : "") + k}:${(D < 10 ? "0" : "") + D}`;
|
|
402
402
|
}, q = (s) => {
|
|
403
403
|
const k = Math.floor(s / 60).toString().padStart(2, 0), D = (s % 60).toString().padStart(2, 0);
|
|
404
404
|
return `${k}:${D}`;
|
|
405
|
-
},
|
|
405
|
+
}, re = (s) => {
|
|
406
406
|
if (s > 3 && s < 21) return "th";
|
|
407
407
|
switch (s % 10) {
|
|
408
408
|
case 1:
|
|
@@ -416,7 +416,7 @@ const lt = (y, t) => {
|
|
|
416
416
|
}
|
|
417
417
|
}, ae = (s, k) => {
|
|
418
418
|
if (C.D) return C;
|
|
419
|
-
const D = s.getFullYear(), J = s.getMonth() + 1,
|
|
419
|
+
const D = s.getFullYear(), J = s.getMonth() + 1, se = s.getDate(), o = (s.getDay() - 1 + 7) % 7;
|
|
420
420
|
return C = {
|
|
421
421
|
// Year.
|
|
422
422
|
YYYY: D,
|
|
@@ -435,11 +435,11 @@ const lt = (y, t) => {
|
|
|
435
435
|
MMMMG: () => (k.monthsGenitive || k.months)[J - 1],
|
|
436
436
|
// January to December in genitive form (Greek...)
|
|
437
437
|
// Day.
|
|
438
|
-
D:
|
|
438
|
+
D: se,
|
|
439
439
|
// 1 to 31.
|
|
440
|
-
DD: () =>
|
|
440
|
+
DD: () => se.toString().padStart(2, 0),
|
|
441
441
|
// 01 to 31.
|
|
442
|
-
S: () =>
|
|
442
|
+
S: () => re(se),
|
|
443
443
|
// st, nd, rd, th.
|
|
444
444
|
// Day of the week.
|
|
445
445
|
d: o + 1,
|
|
@@ -453,11 +453,11 @@ const lt = (y, t) => {
|
|
|
453
453
|
// Monday to Sunday.
|
|
454
454
|
}, C;
|
|
455
455
|
}, ve = (s, k) => {
|
|
456
|
-
if (
|
|
457
|
-
let D, J,
|
|
458
|
-
s instanceof Date ? (D = s.getHours(), J = s.getMinutes(),
|
|
456
|
+
if (W.am) return W;
|
|
457
|
+
let D, J, se;
|
|
458
|
+
s instanceof Date ? (D = s.getHours(), J = s.getMinutes(), se = s.getSeconds()) : (D = Math.floor(s / 60), J = Math.floor(s % 60));
|
|
459
459
|
const me = D % 12 ? D % 12 : 12, o = (k || { am: "am", pm: "pm" })[D === 24 || D < 12 ? "am" : "pm"];
|
|
460
|
-
return
|
|
460
|
+
return W = {
|
|
461
461
|
H: D,
|
|
462
462
|
h: me,
|
|
463
463
|
HH: D.toString().padStart(2, 0),
|
|
@@ -466,8 +466,8 @@ const lt = (y, t) => {
|
|
|
466
466
|
AM: o.toUpperCase(),
|
|
467
467
|
m: J,
|
|
468
468
|
mm: J.toString().padStart(2, 0),
|
|
469
|
-
s:
|
|
470
|
-
},
|
|
469
|
+
s: se
|
|
470
|
+
}, W;
|
|
471
471
|
};
|
|
472
472
|
return {
|
|
473
473
|
addDatePrototypes: A,
|
|
@@ -478,19 +478,19 @@ const lt = (y, t) => {
|
|
|
478
478
|
addHours: m,
|
|
479
479
|
subtractHours: i,
|
|
480
480
|
addMinutes: S,
|
|
481
|
-
subtractMinutes:
|
|
481
|
+
subtractMinutes: a,
|
|
482
482
|
snapToInterval: I,
|
|
483
483
|
getWeek: e,
|
|
484
484
|
isToday: z,
|
|
485
485
|
isSameDate: H,
|
|
486
486
|
isInRange: Y,
|
|
487
487
|
isLeapYear: _,
|
|
488
|
-
getPreviousFirstDayOfWeek:
|
|
488
|
+
getPreviousFirstDayOfWeek: f,
|
|
489
489
|
stringToDate: c,
|
|
490
490
|
dateToMinutes: u,
|
|
491
491
|
countDays: p,
|
|
492
|
-
datesInSameTimeStep:
|
|
493
|
-
isValid:
|
|
492
|
+
datesInSameTimeStep: n,
|
|
493
|
+
isValid: j,
|
|
494
494
|
formatDate: X,
|
|
495
495
|
formatDateLite: U,
|
|
496
496
|
formatTime: K,
|
|
@@ -501,7 +501,7 @@ const lt = (y, t) => {
|
|
|
501
501
|
const { dateUtils: t, config: d } = y;
|
|
502
502
|
let r = 0;
|
|
503
503
|
const h = b(() => {
|
|
504
|
-
var H, Y, _,
|
|
504
|
+
var H, Y, _, f, c;
|
|
505
505
|
const e = {
|
|
506
506
|
// A map of events indexed by { YYYY: { MM: { DD: [] } } }.
|
|
507
507
|
// Each year contains a map of 12 months starting from 1, each containing a map of days starting from 1, each containing an array of event IDs.
|
|
@@ -516,16 +516,16 @@ const lt = (y, t) => {
|
|
|
516
516
|
// A map of all the events indexed by ID for fast lookup. Each event is the original full event object.
|
|
517
517
|
}, z = d.events.slice().sort((u, p) => u.start - p.start < 0 ? -1 : 1);
|
|
518
518
|
for (let u of z) {
|
|
519
|
-
const p = typeof u.start == "string" || typeof u.end == "string",
|
|
520
|
-
let
|
|
521
|
-
if (!p && ((Y = u._) != null && Y.cachedStart) && ((_ = u._) != null && _.cachedEnd) && (
|
|
519
|
+
const p = typeof u.start == "string" || typeof u.end == "string", n = !((H = u._) != null && H.register) || !u.isOverlapping || !u.delete;
|
|
520
|
+
let j = !1;
|
|
521
|
+
if (!p && ((Y = u._) != null && Y.cachedStart) && ((_ = u._) != null && _.cachedEnd) && (j = u.start.getTime() !== ((f = u._) == null ? void 0 : f.cachedStart) || u.end.getTime() !== ((c = u._) == null ? void 0 : c.cachedEnd)), p || n || j) {
|
|
522
522
|
if (!C(u)) continue;
|
|
523
|
-
|
|
523
|
+
W(u), u._.cachedStart = u.start.getTime(), u._.cachedEnd = u.end.getTime();
|
|
524
524
|
}
|
|
525
525
|
if (e.byId[u._.id] = u, u.recurring)
|
|
526
526
|
e.recurring.push(u._.id);
|
|
527
527
|
else if (!t.isSameDate(u.start, new Date(u.end.getTime() - 1)))
|
|
528
|
-
u._.multiday = d.multidayEvents, d.multidayEvents ? e.multiday.push(u._.id) : (console.info("Vue Cal: Multi-day events provided without being enabled. Truncating event end to next midnight."), u.end = new Date(new Date(u.start).setHours(23, 59, 59, 999)),
|
|
528
|
+
u._.multiday = d.multidayEvents, d.multidayEvents ? e.multiday.push(u._.id) : (console.info("Vue Cal: Multi-day events provided without being enabled. Truncating event end to next midnight."), u.end = new Date(new Date(u.start).setHours(23, 59, 59, 999)), W(u)), e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
|
|
529
529
|
else {
|
|
530
530
|
e.byDate[u._.startFormatted] || (e.byDate[u._.startFormatted] = []), e.byDate[u._.startFormatted].push(u._.id);
|
|
531
531
|
const X = u._.startFormatted.substring(0, 4), U = u._.startFormatted.substring(5, 7), K = u._.startFormatted.substring(8, 10);
|
|
@@ -533,23 +533,23 @@ const lt = (y, t) => {
|
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
return e;
|
|
536
|
-
}), C = (e) => !e.start || !e.end ? (console.error("Vue Cal: Event is missing start or end date", e), !1) : (typeof e.start == "string" && (e.start = t.stringToDate(e.start)), typeof e.end == "string" && (e.end = t.stringToDate(e.end)), e.start.setSeconds(0, 0), e.end.getSeconds() === 59 ? e.end.setMinutes(e.end.getMinutes() + 1, 0, 0) : e.end.setSeconds(0, 0), isNaN(e.start) || isNaN(e.end) || e.end.getTime() < e.start.getTime() ? (isNaN(e.start) ? console.error(`Vue Cal: invalid start date for event "${e.title}".`, e.start) : isNaN(e.end) ? console.error(`Vue Cal: invalid end date for event "${e.title}".`, e.end) : console.error(`Vue Cal: invalid event dates for event "${e.title}". The event ends before it starts.`, e.start, e.end), !1) : !0),
|
|
536
|
+
}), C = (e) => !e.start || !e.end ? (console.error("Vue Cal: Event is missing start or end date", e), !1) : (typeof e.start == "string" && (e.start = t.stringToDate(e.start)), typeof e.end == "string" && (e.end = t.stringToDate(e.end)), e.start.setSeconds(0, 0), e.end.getSeconds() === 59 ? e.end.setMinutes(e.end.getMinutes() + 1, 0, 0) : e.end.setSeconds(0, 0), isNaN(e.start) || isNaN(e.end) || e.end.getTime() < e.start.getTime() ? (isNaN(e.start) ? console.error(`Vue Cal: invalid start date for event "${e.title}".`, e.start) : isNaN(e.end) ? console.error(`Vue Cal: invalid end date for event "${e.title}".`, e.end) : console.error(`Vue Cal: invalid event dates for event "${e.title}". The event ends before it starts.`, e.start, e.end), !1) : !0), W = (e) => {
|
|
537
537
|
e._ || (e._ = {}), e._.id = e._.id || ++r, e._.multiday = !t.isSameDate(e.start, new Date(e.end.getTime() - 1)), e._.startFormatted = t.formatDate(e.start), e._.endFormatted = t.formatDate(e.end), e._.startMinutes = ~~t.dateToMinutes(e.start), e._.endMinutes = ~~t.dateToMinutes(e.end);
|
|
538
538
|
const z = e.start.getHours(), H = e.start.getMinutes().toString().padStart(2, 0), Y = e.end.getHours(), _ = e.end.getMinutes().toString().padStart(2, 0);
|
|
539
|
-
e._.startTimeFormatted24 = `${z.toString().padStart(2, 0)}:${H}`, e._.startTimeFormatted12 = `${z % 12 || 12}${H ? `:${H}` : ""} ${z < 12 ? "AM" : "PM"}`, e._.endTimeFormatted24 = `${Y.toString().padStart(2, 0)}:${_}`, e._.endTimeFormatted12 = `${Y % 12 || 12}${_ ? `:${_}` : ""} ${Y < 12 ? "AM" : "PM"}`, e._.duration = Math.abs(~~((e.end - e.start) / 6e4)), e.delete || (e.delete = function(
|
|
540
|
-
return L(this._.id,
|
|
541
|
-
}), e._.deleting === void 0 && (e._.deleting = !1), e._.deleted === void 0 && (e._.deleted = !1), e.isOverlapping || (e.isOverlapping = function(
|
|
542
|
-
return this.getOverlappingEvents(
|
|
543
|
-
}), e.getOverlappingEvents || (e.getOverlappingEvents = function(
|
|
544
|
-
var
|
|
545
|
-
const c = (
|
|
539
|
+
e._.startTimeFormatted24 = `${z.toString().padStart(2, 0)}:${H}`, e._.startTimeFormatted12 = `${z % 12 || 12}${H ? `:${H}` : ""} ${z < 12 ? "AM" : "PM"}`, e._.endTimeFormatted24 = `${Y.toString().padStart(2, 0)}:${_}`, e._.endTimeFormatted12 = `${Y % 12 || 12}${_ ? `:${_}` : ""} ${Y < 12 ? "AM" : "PM"}`, e._.duration = Math.abs(~~((e.end - e.start) / 6e4)), e.delete || (e.delete = function(f) {
|
|
540
|
+
return L(this._.id, f);
|
|
541
|
+
}), e._.deleting === void 0 && (e._.deleting = !1), e._.deleted === void 0 && (e._.deleted = !1), e.isOverlapping || (e.isOverlapping = function(f = null) {
|
|
542
|
+
return this.getOverlappingEvents(f).length;
|
|
543
|
+
}), e.getOverlappingEvents || (e.getOverlappingEvents = function(f = null) {
|
|
544
|
+
var n;
|
|
545
|
+
const c = (f == null ? void 0 : f.start) || this.start, u = (f == null ? void 0 : f.end) || this.end, p = (n = d.schedules) != null && n.length ? ~~((f == null ? void 0 : f.schedule) || this.schedule) : null;
|
|
546
546
|
return E(c, u, { excludeIds: [this._.id], schedule: p });
|
|
547
|
-
}), e._.register || (e._.register = (
|
|
548
|
-
e._.$el =
|
|
547
|
+
}), e._.register || (e._.register = (f) => {
|
|
548
|
+
e._.$el = f, e._.fireCreated && (y.emit("event-created", e), delete e._.fireCreated);
|
|
549
549
|
}), e._.unregister || (e._.unregister = () => {
|
|
550
550
|
e._.$el = null, e._.register = null, e.isOverlapping = null, e.getOverlappingEvents = null, e.delete = null;
|
|
551
551
|
});
|
|
552
|
-
},
|
|
552
|
+
}, v = (e) => h.value.byId[e], A = (e) => {
|
|
553
553
|
const z = [];
|
|
554
554
|
for (const { start: H, end: Y } of e) {
|
|
555
555
|
const _ = E(H, Y);
|
|
@@ -568,99 +568,99 @@ const lt = (y, t) => {
|
|
|
568
568
|
let H = typeof e == "string" || !isNaN(e) ? e : null;
|
|
569
569
|
const Y = typeof e == "object" ? Object.entries(e) : null;
|
|
570
570
|
if (Y) {
|
|
571
|
-
const [p,
|
|
572
|
-
H = (c = d.events.find((
|
|
571
|
+
const [p, n] = Y[0];
|
|
572
|
+
H = (c = d.events.find((j) => j[p] === n)) == null ? void 0 : c._.id;
|
|
573
573
|
}
|
|
574
574
|
if (!d.editableEvents.delete)
|
|
575
575
|
return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
|
|
576
576
|
if (!H) return console.warn("Vue Cal: Cannot delete event without its ID.");
|
|
577
577
|
const _ = d.events.findIndex((p) => p._.id === H);
|
|
578
578
|
if (_ === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${H}\`.`);
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
579
|
+
const f = d.events[_];
|
|
580
|
+
if (f.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${H}\` since it was explicitely set to \`delete: false\`.`);
|
|
581
581
|
switch (z) {
|
|
582
582
|
case 0:
|
|
583
|
-
|
|
583
|
+
f._.deleting ? d.events.splice(_, 1) : f._.deleting = !0;
|
|
584
584
|
break;
|
|
585
585
|
// Display the delete button.
|
|
586
586
|
case 1:
|
|
587
|
-
|
|
587
|
+
f._.deleting = !0;
|
|
588
588
|
break;
|
|
589
589
|
// Visual deletion + external DOM event firing.
|
|
590
590
|
// When explicitly using this stage, the event will be visually deleted but still present in the
|
|
591
591
|
// source of truth until the cell is unmounted (by navigating away).
|
|
592
592
|
case 2:
|
|
593
|
-
|
|
593
|
+
f._.deleted = !0, d.events[_]._.deleted = !0, (u = f._.$el) == null || u.dispatchEvent(new CustomEvent("event-deleted", { detail: f._.id }));
|
|
594
594
|
break;
|
|
595
595
|
// Effective deletion from the source of truth (by default, when unmounting the cell).
|
|
596
596
|
case 3:
|
|
597
|
-
d.events.splice(_, 1), y.emit("update:events", d.events), y.emit("event-delete",
|
|
597
|
+
d.events.splice(_, 1), y.emit("update:events", d.events), y.emit("event-delete", f);
|
|
598
598
|
break;
|
|
599
599
|
}
|
|
600
600
|
return !0;
|
|
601
601
|
}, l = (e, z, H) => {
|
|
602
602
|
const Y = d.allDayEvents ? { allDay: H } : {}, _ = E(e, z, { background: !1, ...Y });
|
|
603
603
|
if (!_.length) return { cellOverlaps: {}, longestStreak: 0 };
|
|
604
|
-
const
|
|
604
|
+
const f = {};
|
|
605
605
|
let c = [], u = 0;
|
|
606
|
-
_.sort((p,
|
|
606
|
+
_.sort((p, n) => p.start - n.start || p.end - p.start - (n.end - n.start));
|
|
607
607
|
for (const p of _) {
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
var
|
|
612
|
-
return (!((
|
|
613
|
-
}), X = new Set(
|
|
608
|
+
const n = p._.id;
|
|
609
|
+
f[n] || (f[n] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), c = c.filter((te) => te.end > p.start);
|
|
610
|
+
const j = c.filter((te) => {
|
|
611
|
+
var re;
|
|
612
|
+
return (!((re = d.schedules) != null && re.length) || p.schedule === te.schedule) && te.start < p.end;
|
|
613
|
+
}), X = new Set(j.map((te) => {
|
|
614
614
|
var q;
|
|
615
|
-
return ((q =
|
|
615
|
+
return ((q = f[te._.id]) == null ? void 0 : q.position) ?? 0;
|
|
616
616
|
}));
|
|
617
617
|
let U = 0;
|
|
618
618
|
for (; X.has(U); ) U++;
|
|
619
|
-
|
|
620
|
-
const K = Math.max(1, ...
|
|
619
|
+
f[n].position = U, c.push(p);
|
|
620
|
+
const K = Math.max(1, ...j.map((te) => {
|
|
621
621
|
var q;
|
|
622
|
-
return ((q =
|
|
622
|
+
return ((q = f[te._.id]) == null ? void 0 : q.maxConcurrent) ?? 1;
|
|
623
623
|
}));
|
|
624
|
-
|
|
625
|
-
for (const te of
|
|
626
|
-
|
|
627
|
-
u = Math.max(u,
|
|
624
|
+
f[n].maxConcurrent = Math.max(j.length + 1, K);
|
|
625
|
+
for (const te of j)
|
|
626
|
+
f[te._.id].overlaps.add(n), f[n].overlaps.add(te._.id), f[te._.id].maxConcurrent = f[n].maxConcurrent;
|
|
627
|
+
u = Math.max(u, f[n].maxConcurrent);
|
|
628
628
|
}
|
|
629
|
-
for (const p in
|
|
630
|
-
return { cellOverlaps:
|
|
631
|
-
}, E = (e, z, { excludeIds: H = [], schedule: Y = null, background: _ = !0, allDay:
|
|
629
|
+
for (const p in f) f[p].overlaps = [...f[p].overlaps];
|
|
630
|
+
return { cellOverlaps: f, longestStreak: u };
|
|
631
|
+
}, E = (e, z, { excludeIds: H = [], schedule: Y = null, background: _ = !0, allDay: f = !1 } = {}) => {
|
|
632
632
|
if (!Object.keys(h.value.byId).length) return [];
|
|
633
|
-
const c = e.getFullYear(), u = z.getFullYear(), p = e.getMonth() + 1,
|
|
633
|
+
const c = e.getFullYear(), u = z.getFullYear(), p = e.getMonth() + 1, n = z.getMonth() + 1, j = e.getDate(), X = z.getDate();
|
|
634
634
|
e.getTime(), z.getTime();
|
|
635
635
|
const U = new Date(e).setHours(0, 0, 0, 0), K = new Date(z).setHours(23, 59, 59, 999), te = new Set(H), q = [];
|
|
636
636
|
if (Object.keys(h.value.byId).length <= 100) {
|
|
637
|
-
for (const
|
|
638
|
-
!
|
|
637
|
+
for (const re of Object.values(h.value.byId))
|
|
638
|
+
!re || te.has(re._.id) || Y !== null && Y !== re.schedule || _ === !1 && re.background || d.allDayEvents && (f && !re.allDay || !f && re.allDay) || re.start.getTime() < K && re.end.getTime() > U && q.push(re);
|
|
639
639
|
return q;
|
|
640
640
|
}
|
|
641
|
-
for (let
|
|
642
|
-
const ae = `${
|
|
641
|
+
for (let re = c; re <= u; re++) {
|
|
642
|
+
const ae = `${re}`, ve = h.value.byYear[ae];
|
|
643
643
|
if (!ve) continue;
|
|
644
|
-
const s =
|
|
644
|
+
const s = re === c ? p : 1, k = re === u ? n : 12;
|
|
645
645
|
for (let D = s; D <= k; D++) {
|
|
646
|
-
const J = String(D).padStart(2, "0"),
|
|
647
|
-
if (
|
|
648
|
-
for (const me in
|
|
646
|
+
const J = String(D).padStart(2, "0"), se = ve[J];
|
|
647
|
+
if (se)
|
|
648
|
+
for (const me in se) {
|
|
649
649
|
const o = +me;
|
|
650
|
-
if (o > X || o <
|
|
651
|
-
const T =
|
|
650
|
+
if (o > X || o < j) continue;
|
|
651
|
+
const T = se[me];
|
|
652
652
|
if (T != null && T.length)
|
|
653
653
|
for (let M = 0; M < T.length; M++) {
|
|
654
654
|
const w = h.value.byId[T[M]];
|
|
655
|
-
!w || te.has(w._.id) || Y !== null && Y !== w.schedule || _ === !1 && w.background || d.allDayEvents && (
|
|
655
|
+
!w || te.has(w._.id) || Y !== null && Y !== w.schedule || _ === !1 && w.background || d.allDayEvents && (f && !w.allDay || !f && w.allDay) || w.start.getTime() < K && w.end.getTime() > U && q.push(w);
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
return q;
|
|
661
661
|
}, F = (e, z, H) => {
|
|
662
|
-
const Y = e.allDay || !d.time, _ = Y ? new Date(e.start).setHours(0, 0, 0, 0) : e.start.getTime(),
|
|
663
|
-
return
|
|
662
|
+
const Y = e.allDay || !d.time, _ = Y ? new Date(e.start).setHours(0, 0, 0, 0) : e.start.getTime(), f = Y ? new Date(e.end).setHours(23, 59, 59, 999) : e.end.getTime(), c = Y ? new Date(z).setHours(0, 0, 0, 0) : z.getTime(), u = Y ? new Date(H).setHours(23, 59, 59, 999) : H.getTime();
|
|
663
|
+
return f > c && _ < u;
|
|
664
664
|
}, m = be({
|
|
665
665
|
isResizing: !1,
|
|
666
666
|
fromResizer: !1,
|
|
@@ -681,43 +681,43 @@ const lt = (y, t) => {
|
|
|
681
681
|
cellEl: null,
|
|
682
682
|
schedule: null
|
|
683
683
|
}), i = (e, z) => {
|
|
684
|
-
var
|
|
684
|
+
var f;
|
|
685
685
|
let H = je(m.movePercentageY, d);
|
|
686
686
|
if (H = Math.max(0, Math.min(H, 1440)), d.snapToInterval) {
|
|
687
687
|
const c = H + d.snapToInterval / 2;
|
|
688
688
|
H = c - c % d.snapToInterval;
|
|
689
689
|
}
|
|
690
690
|
let Y = e.start, _ = new Date(z.getTime() + H * 6e4);
|
|
691
|
-
return m.moveX && ((
|
|
691
|
+
return m.moveX && ((f = y.touch) != null && f.currentHoveredCell) && m.cellEl && new Date(y.touch.currentHoveredCell.__vueParentComponent.props.start), _ < m.resizeStartDate && (Y = _, _ = m.resizeStartDate), { newStart: Y, newEnd: _ };
|
|
692
692
|
}, S = async (e) => {
|
|
693
|
-
var Y, _,
|
|
693
|
+
var Y, _, f, c, u;
|
|
694
694
|
const { clientX: z, clientY: H } = ((Y = e.touches) == null ? void 0 : Y[0]) || e;
|
|
695
695
|
if (m.fromResizer && !((_ = y.touch) != null && _.isResizingEvent)) {
|
|
696
696
|
m.resizingOriginalEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } }, y.touch.isResizingEvent = !0;
|
|
697
|
-
const p = ((
|
|
697
|
+
const p = ((f = d.eventListeners) == null ? void 0 : f.event) || {};
|
|
698
698
|
(c = p["resize-start"]) == null || c.call(p, { e, event: m.resizingEvent });
|
|
699
699
|
}
|
|
700
700
|
if (m.cellEl) {
|
|
701
|
-
const { top: p, left:
|
|
702
|
-
m.moveX = z -
|
|
701
|
+
const { top: p, left: n, width: j, height: X } = m.cellEl.getBoundingClientRect();
|
|
702
|
+
m.moveX = z - n, m.moveY = H - p, m.movePercentageX = m.moveX * 100 / j, m.movePercentageY = m.moveY * 100 / X;
|
|
703
703
|
}
|
|
704
704
|
if (m.documentMouseX = z, m.documentMouseY = H, m.fromResizer && m.resizingEvent) {
|
|
705
|
-
const p = m.cellEl.__vueParentComponent.props.start, { newStart:
|
|
705
|
+
const p = m.cellEl.__vueParentComponent.props.start, { newStart: n, newEnd: j } = i(m.resizingEvent, p);
|
|
706
706
|
let X = !0;
|
|
707
707
|
const { resize: U } = ((u = d.eventListeners) == null ? void 0 : u.event) || {};
|
|
708
708
|
U && (X = await U({
|
|
709
709
|
e,
|
|
710
|
-
event: { ...m.resizingEvent, start:
|
|
711
|
-
overlaps: m.resizingEvent.getOverlappingEvents({ start:
|
|
712
|
-
})), X !== !1 ? (m.resizingEvent.start =
|
|
710
|
+
event: { ...m.resizingEvent, start: n, end: j },
|
|
711
|
+
overlaps: m.resizingEvent.getOverlappingEvents({ start: n, end: j })
|
|
712
|
+
})), X !== !1 ? (m.resizingEvent.start = n, m.resizingEvent.end = j, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null), e.preventDefault()) : U && (m.resizingLastAcceptedEvent = { ...m.resizingEvent, _: { ...m.resizingEvent._ } });
|
|
713
713
|
}
|
|
714
|
-
},
|
|
714
|
+
}, a = async (e) => {
|
|
715
715
|
var z, H, Y, _;
|
|
716
716
|
if ((z = y.touch) != null && z.isResizingEvent && m.resizingEvent) {
|
|
717
|
-
const
|
|
717
|
+
const f = m.cellEl.__vueParentComponent.props.start, { newStart: c, newEnd: u } = i(m.resizingEvent, f);
|
|
718
718
|
let p = !0;
|
|
719
|
-
const
|
|
720
|
-
|
|
719
|
+
const j = (((H = d.eventListeners) == null ? void 0 : H.event) || {})["resize-end"];
|
|
720
|
+
j && (p = await j({
|
|
721
721
|
e,
|
|
722
722
|
event: m.resizingEvent,
|
|
723
723
|
original: m.resizingOriginalEvent,
|
|
@@ -730,7 +730,7 @@ const lt = (y, t) => {
|
|
|
730
730
|
return {
|
|
731
731
|
events: h,
|
|
732
732
|
resizeState: m,
|
|
733
|
-
getEvent:
|
|
733
|
+
getEvent: v,
|
|
734
734
|
getViewEvents: A,
|
|
735
735
|
getCellOverlappingEvents: l,
|
|
736
736
|
getEventsInRange: E,
|
|
@@ -741,28 +741,28 @@ const lt = (y, t) => {
|
|
|
741
741
|
var _;
|
|
742
742
|
const Y = ((_ = e.touches) == null ? void 0 : _[0]) || e;
|
|
743
743
|
if (m.fromResizer = !!Y.target.closest(".vuecal__event-resizer"), m.fromResizer) {
|
|
744
|
-
const
|
|
745
|
-
m.startX = Y.clientX -
|
|
744
|
+
const f = H.getBoundingClientRect();
|
|
745
|
+
m.startX = Y.clientX - f.left, m.startY = Y.clientY - f.top, m.startPercentageX = m.startX * 100 / f.width, m.startPercentageY = m.startY * 100 / f.height, m.cellEl = H.closest(".vuecal__cell"), m.resizeStartDate = z.start, m.resizingEvent = z, document.addEventListener(e.type === "touchstart" ? "touchmove" : "mousemove", S, { passive: !m.fromResizer }), document.addEventListener(e.type === "touchstart" ? "touchend" : "mouseup", a, { once: !0 });
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
};
|
|
749
749
|
}, Ot = ({ config: y, dateUtils: t, emit: d, texts: r, eventsManager: h }, C) => {
|
|
750
|
-
const { availableViews:
|
|
750
|
+
const { availableViews: W } = y, v = ue(y.view && W[y.view] ? y.view : y.defaultView), A = ue(y.selectedDate || null), Z = ue(/* @__PURE__ */ new Date()), L = ue(new Date(y.viewDate || Z.value));
|
|
751
751
|
L.value.setHours(0, 0, 0, 0);
|
|
752
752
|
const l = ue(new Date(L));
|
|
753
753
|
let E = null;
|
|
754
|
-
const F = b(() =>
|
|
755
|
-
if (
|
|
754
|
+
const F = b(() => v.value === "month" ? l.value : _.value), m = b(() => v.value === "month" ? new Date(l.value.getFullYear(), l.value.getMonth() + 1, 0, 23, 59, 59, 999) : c.value), i = b(() => v.value === "week" ? t.getPreviousFirstDayOfWeek(_.value, y.startWeekOnSunday) : v.value === "month" ? _.value : F.value), S = b(() => {
|
|
755
|
+
if (v.value === "week") {
|
|
756
756
|
const g = t.addDays(i.value, 7);
|
|
757
757
|
return g.setMilliseconds(-1), g;
|
|
758
758
|
}
|
|
759
|
-
return
|
|
760
|
-
}),
|
|
759
|
+
return v.value === "month" ? c.value : m.value;
|
|
760
|
+
}), a = b(() => {
|
|
761
761
|
const g = Z.value.getTime();
|
|
762
|
-
if (
|
|
762
|
+
if (v.value === "week")
|
|
763
763
|
return i.value.getTime() <= g && g <= S.value.getTime();
|
|
764
|
-
const
|
|
765
|
-
return
|
|
764
|
+
const R = _.value.getTime(), ee = c.value.getTime();
|
|
765
|
+
return R <= g && g <= ee;
|
|
766
766
|
});
|
|
767
767
|
function I() {
|
|
768
768
|
Z.value = /* @__PURE__ */ new Date(), E = setTimeout(I, 60 * 1e3);
|
|
@@ -771,34 +771,34 @@ const lt = (y, t) => {
|
|
|
771
771
|
E = setTimeout(I, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), I();
|
|
772
772
|
}
|
|
773
773
|
const z = b(() => {
|
|
774
|
-
if (!y.availableViews[
|
|
775
|
-
let g = y.availableViews[
|
|
776
|
-
return y.hasHiddenDays && ["week", "month"].includes(
|
|
774
|
+
if (!y.availableViews[v.value]) return 1;
|
|
775
|
+
let g = y.availableViews[v.value].cols;
|
|
776
|
+
return y.hasHiddenDays && ["week", "month"].includes(v.value) && (g -= y.hasHiddenDays), g;
|
|
777
777
|
}), H = b(() => {
|
|
778
778
|
var g;
|
|
779
|
-
return ((g = y.availableViews[
|
|
779
|
+
return ((g = y.availableViews[v.value]) == null ? void 0 : g.rows) || 1;
|
|
780
780
|
}), Y = b(() => z.value * H.value), _ = b(() => {
|
|
781
|
-
if (
|
|
781
|
+
if (v.value === "month") {
|
|
782
782
|
let g = l.value.getDay() || 7;
|
|
783
783
|
return y.startWeekOnSunday && !y.hideWeekdays[7] && (g += 1), y.viewDayOffset && (g -= y.viewDayOffset), t.subtractDays(l.value, g - 1);
|
|
784
784
|
}
|
|
785
|
-
if (
|
|
785
|
+
if (v.value === "week") {
|
|
786
786
|
const g = "1234567".split("").filter((ee) => !Object.keys(y.hideWeekdays).includes(ee));
|
|
787
|
-
let
|
|
788
|
-
return y.startWeekOnSunday && !y.hideWeekdays[7] && (
|
|
787
|
+
let R = Math.min(...g);
|
|
788
|
+
return y.startWeekOnSunday && !y.hideWeekdays[7] && (R = 1), y.viewDayOffset && (R += y.viewDayOffset), t.addDays(l.value, R - 1);
|
|
789
789
|
}
|
|
790
790
|
return l.value;
|
|
791
|
-
}),
|
|
792
|
-
const g = [],
|
|
791
|
+
}), f = b(() => {
|
|
792
|
+
const g = [], R = ["days", "week", "month"].includes(v.value);
|
|
793
793
|
let ee = 0;
|
|
794
|
-
for (let
|
|
795
|
-
switch (
|
|
794
|
+
for (let Q = 0; Q < Y.value + ee; Q++)
|
|
795
|
+
switch (v.value) {
|
|
796
796
|
case "day":
|
|
797
797
|
case "days":
|
|
798
798
|
case "week":
|
|
799
799
|
case "month": {
|
|
800
|
-
const ye = t.addDays(_.value,
|
|
801
|
-
if (
|
|
800
|
+
const ye = t.addDays(_.value, Q), Ne = ye.getDay() || 7;
|
|
801
|
+
if (R && y.hasHiddenDays && y.hideWeekdays[Ne]) {
|
|
802
802
|
ee++;
|
|
803
803
|
continue;
|
|
804
804
|
}
|
|
@@ -808,37 +808,37 @@ const lt = (y, t) => {
|
|
|
808
808
|
}
|
|
809
809
|
case "year":
|
|
810
810
|
g.push({
|
|
811
|
-
start: new Date(_.value.getFullYear(),
|
|
812
|
-
end: new Date(_.value.getFullYear(),
|
|
811
|
+
start: new Date(_.value.getFullYear(), Q, 1, 0, 0, 0, 0),
|
|
812
|
+
end: new Date(_.value.getFullYear(), Q + 1, 0, 23, 59, 59, 999)
|
|
813
813
|
});
|
|
814
814
|
break;
|
|
815
815
|
case "years":
|
|
816
816
|
g.push({
|
|
817
|
-
start: new Date(_.value.getFullYear() +
|
|
818
|
-
end: new Date(_.value.getFullYear() +
|
|
817
|
+
start: new Date(_.value.getFullYear() + Q, 0, 1, 0, 0, 0, 0),
|
|
818
|
+
end: new Date(_.value.getFullYear() + Q + 1, 0, 0, 23, 59, 59, 999)
|
|
819
819
|
});
|
|
820
820
|
break;
|
|
821
821
|
}
|
|
822
822
|
return g;
|
|
823
|
-
}), c = b(() =>
|
|
823
|
+
}), c = b(() => f.value[f.value.length - 1].end), u = ue("right"), p = b(() => {
|
|
824
824
|
const g = Object.keys(y.availableViews);
|
|
825
|
-
return g[g.indexOf(
|
|
826
|
-
}),
|
|
825
|
+
return g[g.indexOf(v.value) + 1];
|
|
826
|
+
}), n = b(() => {
|
|
827
827
|
const g = Object.keys(y.availableViews);
|
|
828
|
-
return g[g.indexOf(
|
|
828
|
+
return g[g.indexOf(v.value) - 1];
|
|
829
829
|
});
|
|
830
|
-
function
|
|
831
|
-
if (!
|
|
832
|
-
const
|
|
833
|
-
return ee && typeof
|
|
830
|
+
function j(g, R, ee = !1) {
|
|
831
|
+
if (!R || !R[g]) return g + 1;
|
|
832
|
+
const Q = R[g];
|
|
833
|
+
return ee && typeof Q == "string" ? Q.substring(0, 3) : Q;
|
|
834
834
|
}
|
|
835
|
-
function X(g,
|
|
836
|
-
const { monthsArray:
|
|
837
|
-
return $t ? ye ? `${
|
|
835
|
+
function X(g, R, ee) {
|
|
836
|
+
const { monthsArray: Q, monthBeforeDay: ye, canTruncate: Ne, xs: ze } = ee, Me = g.getMonth(), Ee = g.getFullYear(), Ye = R.getMonth(), Pe = R.getFullYear(), Be = Me !== Ye, $t = Ee !== Pe, Te = Ne && (ze || Be), Le = g.getDate(), Ae = R.getDate();
|
|
837
|
+
return $t ? ye ? `${j(Me, Q, Te)} ${Le}, ${Ee} - ${j(Ye, Q, Te)} ${Ae}, ${Pe}` : `${Le} ${j(Me, Q, Te)} ${Ee} - ${Ae} ${j(Ye, Q, Te)} ${Pe}` : Be ? ye ? `${j(Me, Q, Te)} ${Le} - ${j(Ye, Q, Te)} ${Ae}, ${Ee}` : `${Le} ${j(Me, Q, Te)} - ${Ae} ${j(Ye, Q, Te)} ${Ee}` : ye ? `${j(Me, Q, Te)} ${Le}-${Ae}, ${Ee}` : `${Le}-${Ae} ${j(Me, Q, Te)} ${Ee}`;
|
|
838
838
|
}
|
|
839
839
|
const U = b(() => {
|
|
840
|
-
const { dateFormat: g, months:
|
|
841
|
-
switch (
|
|
840
|
+
const { dateFormat: g, months: R, monthsGenitive: ee, week: Q, truncations: ye } = r, Ne = y.locale, ze = ye !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ee = ee && Ne === "el" ? ee : R;
|
|
841
|
+
switch (v.value) {
|
|
842
842
|
case "day":
|
|
843
843
|
return t.formatDate(_.value, g);
|
|
844
844
|
case "days":
|
|
@@ -850,12 +850,12 @@ const lt = (y, t) => {
|
|
|
850
850
|
xs: y.xs
|
|
851
851
|
};
|
|
852
852
|
let Pe = X(_.value, c.value, Ye);
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
853
|
+
if (v.value === "week") {
|
|
854
|
+
const Be = t.getWeek(
|
|
855
855
|
_.value,
|
|
856
856
|
y.startWeekOnSunday && !y.hideWeekdays[7]
|
|
857
857
|
);
|
|
858
|
-
Pe += ` <small>${
|
|
858
|
+
Pe += ` <small>${Q} ${Be}</small>`;
|
|
859
859
|
}
|
|
860
860
|
return Pe;
|
|
861
861
|
}
|
|
@@ -870,7 +870,7 @@ const lt = (y, t) => {
|
|
|
870
870
|
}
|
|
871
871
|
});
|
|
872
872
|
async function K() {
|
|
873
|
-
switch (l.value = new Date(L.value || Z.value), l.value.setHours(0, 0, 0, 0),
|
|
873
|
+
switch (l.value = new Date(L.value || Z.value), l.value.setHours(0, 0, 0, 0), v.value) {
|
|
874
874
|
case "day":
|
|
875
875
|
break;
|
|
876
876
|
case "days":
|
|
@@ -889,30 +889,30 @@ const lt = (y, t) => {
|
|
|
889
889
|
break;
|
|
890
890
|
}
|
|
891
891
|
Z.value = /* @__PURE__ */ new Date(), y.ready && (await Xe(), d("view-change", {
|
|
892
|
-
id:
|
|
892
|
+
id: v.value,
|
|
893
893
|
title: U.value,
|
|
894
894
|
start: F.value,
|
|
895
895
|
end: m.value,
|
|
896
896
|
extendedStart: i.value,
|
|
897
897
|
extendedEnd: S.value,
|
|
898
|
-
cellDates:
|
|
899
|
-
containsToday:
|
|
898
|
+
cellDates: f.value,
|
|
899
|
+
containsToday: a.value,
|
|
900
900
|
events: G.value
|
|
901
901
|
}));
|
|
902
902
|
}
|
|
903
903
|
function te(g) {
|
|
904
|
-
const
|
|
905
|
-
g[
|
|
904
|
+
const R = v.value, ee = y.availableViews[R];
|
|
905
|
+
g[R] && JSON.stringify(g[R]) === JSON.stringify(ee) || K();
|
|
906
906
|
}
|
|
907
|
-
function q(g,
|
|
908
|
-
const
|
|
909
|
-
|
|
907
|
+
function q(g, R = !0, ee = null) {
|
|
908
|
+
const Q = Object.keys(y.availableViews);
|
|
909
|
+
v.value === g && !ee || (Q.includes(g) ? (u.value = Q.indexOf(g) < Q.indexOf(v.value) ? "left" : "right", R && v.value !== g && d("update:view", g), v.value = g, ee ? J(ee) : K()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function re() {
|
|
912
912
|
p.value ? q(p.value) : console.warn("Vue Cal: no broader view is available.");
|
|
913
913
|
}
|
|
914
914
|
function ae() {
|
|
915
|
-
|
|
915
|
+
n.value ? q(n.value) : console.warn("Vue Cal: no narrower view is available.");
|
|
916
916
|
}
|
|
917
917
|
function ve() {
|
|
918
918
|
k(!1);
|
|
@@ -921,47 +921,47 @@ const lt = (y, t) => {
|
|
|
921
921
|
k(!0);
|
|
922
922
|
}
|
|
923
923
|
function k(g = !0) {
|
|
924
|
-
let
|
|
925
|
-
switch (
|
|
924
|
+
let R = new Date(L.value);
|
|
925
|
+
switch (v.value) {
|
|
926
926
|
case "day":
|
|
927
927
|
case "days":
|
|
928
|
-
g ?
|
|
928
|
+
g ? R = t.addDays(c.value, 1) : R = t.subtractDays(_.value, Y.value);
|
|
929
929
|
break;
|
|
930
930
|
case "week": {
|
|
931
|
-
g ? (
|
|
931
|
+
g ? (R = t.addDays(S.value, 1), R.setHours(0, 0, 0, 0)) : R = t.subtractDays(i.value, Y.value);
|
|
932
932
|
break;
|
|
933
933
|
}
|
|
934
934
|
case "month": {
|
|
935
935
|
const ee = g ? 1 : -1;
|
|
936
|
-
|
|
936
|
+
R = new Date(R.getFullYear(), R.getMonth() + ee, 1, 0, 0, 0, 0);
|
|
937
937
|
break;
|
|
938
938
|
}
|
|
939
939
|
case "year": {
|
|
940
940
|
const ee = g ? 1 : -1;
|
|
941
|
-
|
|
941
|
+
R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
|
|
942
942
|
break;
|
|
943
943
|
}
|
|
944
944
|
case "years": {
|
|
945
945
|
const ee = g ? Y.value : -Y.value;
|
|
946
|
-
|
|
946
|
+
R = new Date(R.getFullYear() + ee, 1, 1, 0, 0, 0, 0);
|
|
947
947
|
break;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
J(
|
|
950
|
+
J(R);
|
|
951
951
|
}
|
|
952
952
|
function D() {
|
|
953
953
|
const g = /* @__PURE__ */ new Date();
|
|
954
954
|
g.setHours(0, 0, 0, 0), J(g);
|
|
955
955
|
}
|
|
956
|
-
function J(g,
|
|
956
|
+
function J(g, R = !0, ee = !1) {
|
|
957
957
|
if (!t.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
|
|
958
|
-
let [
|
|
959
|
-
|
|
958
|
+
let [Q, ye] = [_.value, c.value];
|
|
959
|
+
v.value === "month" && ([Q, ye] = [F.value, m.value]), (!t.isInRange(g, Q, ye) || ee) && (g.setHours(0, 0, 0, 0), u.value = g.getTime() < Q.getTime() ? "left" : "right", L.value = g, R && d("update:viewDate", g), K());
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function se(g, R = !0) {
|
|
962
962
|
if (!t.isValid(g)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
|
|
963
|
-
const { isValid: ee, isSameDate:
|
|
964
|
-
(!A.value || !ee(A.value) || !
|
|
963
|
+
const { isValid: ee, isSameDate: Q } = t;
|
|
964
|
+
(!A.value || !ee(A.value) || !Q(g, A.value)) && (g.setHours(0, 0, 0, 0), A.value = g, R && d("update:selectedDate", g));
|
|
965
965
|
}
|
|
966
966
|
function me(g) {
|
|
967
967
|
!g && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : (u.value = "left", K());
|
|
@@ -970,30 +970,30 @@ const lt = (y, t) => {
|
|
|
970
970
|
g && y.startWeekOnSunday && !l.value.getDay() ? J(t.addDays(l.value, 1), !0, !0) : !g && y.startWeekOnSunday && l.value.getDay() === 1 && J(t.subtractDays(l.value, 1), !0, !0);
|
|
971
971
|
}
|
|
972
972
|
function T() {
|
|
973
|
-
|
|
973
|
+
K();
|
|
974
974
|
}
|
|
975
975
|
function M(g) {
|
|
976
|
-
var
|
|
977
|
-
const
|
|
978
|
-
|
|
976
|
+
var Q;
|
|
977
|
+
const R = (Q = C.value) == null ? void 0 : Q.querySelector(".vuecal__scrollable"), ee = g ? g * y.timeCellHeight / y.timeStep : 0;
|
|
978
|
+
R == null || R.scrollTo({ top: ee, behavior: "smooth" });
|
|
979
979
|
}
|
|
980
980
|
function w() {
|
|
981
981
|
const g = /* @__PURE__ */ new Date();
|
|
982
982
|
M(g.getHours() * 60 + g.getMinutes());
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function B() {
|
|
985
985
|
M(0);
|
|
986
986
|
}
|
|
987
|
-
const G = b(() => h.getViewEvents(
|
|
988
|
-
return De(() => y.view, (g) => q(g, !1)), De(() => y.availableViews, te), De(() => y.datePicker, () => q("month")), De(() => y.viewDate, (g) => J(g, !1)), De(() => y.selectedDate, (g) =>
|
|
987
|
+
const G = b(() => h.getViewEvents(f.value)), oe = h.createEvent, ge = h.deleteEvent;
|
|
988
|
+
return De(() => y.view, (g) => q(g, !1)), De(() => y.availableViews, te), De(() => y.datePicker, () => q("month")), De(() => y.viewDate, (g) => J(g, !1)), De(() => y.selectedDate, (g) => se(g, !1)), De(() => y.startWeekOnSunday, (g) => me(g)), De(() => y.hideWeekends, (g) => o(g)), De(() => y.hideWeekdays, T), De(() => Y.value, () => {
|
|
989
989
|
Y.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
|
|
990
990
|
}), De(() => y.watchRealTime, (g) => {
|
|
991
991
|
g && y.time ? e() : E = clearTimeout(E);
|
|
992
992
|
}), K(), y.time && y.watchRealTime && e(), Re(() => E = clearTimeout(E)), {
|
|
993
993
|
now: Z,
|
|
994
|
-
id:
|
|
994
|
+
id: v,
|
|
995
995
|
broaderView: p,
|
|
996
|
-
narrowerView:
|
|
996
|
+
narrowerView: n,
|
|
997
997
|
title: U,
|
|
998
998
|
viewDate: L,
|
|
999
999
|
start: F,
|
|
@@ -1004,9 +1004,9 @@ const lt = (y, t) => {
|
|
|
1004
1004
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
1005
1005
|
firstCellDate: _,
|
|
1006
1006
|
lastCellDate: c,
|
|
1007
|
-
containsToday:
|
|
1007
|
+
containsToday: a,
|
|
1008
1008
|
selectedDate: A,
|
|
1009
|
-
cellDates:
|
|
1009
|
+
cellDates: f,
|
|
1010
1010
|
cols: z,
|
|
1011
1011
|
rows: H,
|
|
1012
1012
|
// All the events are stored and indexed in the events object of the eventsManager.
|
|
@@ -1014,38 +1014,38 @@ const lt = (y, t) => {
|
|
|
1014
1014
|
// and multi-day events.
|
|
1015
1015
|
events: G,
|
|
1016
1016
|
transitionDirection: u,
|
|
1017
|
-
switch: q,
|
|
1018
|
-
broader:
|
|
1017
|
+
switch: (g, R) => q(g, !0, R),
|
|
1018
|
+
broader: re,
|
|
1019
1019
|
narrower: ae,
|
|
1020
1020
|
previous: ve,
|
|
1021
1021
|
next: s,
|
|
1022
1022
|
navigate: k,
|
|
1023
1023
|
goToToday: D,
|
|
1024
1024
|
updateViewDate: J,
|
|
1025
|
-
updateSelectedDate:
|
|
1025
|
+
updateSelectedDate: se,
|
|
1026
1026
|
scrollToCurrentTime: w,
|
|
1027
1027
|
scrollToTime: M,
|
|
1028
|
-
scrollTop:
|
|
1028
|
+
scrollTop: B,
|
|
1029
1029
|
createEvent: oe,
|
|
1030
1030
|
deleteEvent: ge,
|
|
1031
1031
|
// Getters.
|
|
1032
1032
|
get isDay() {
|
|
1033
|
-
return
|
|
1033
|
+
return v.value === "day";
|
|
1034
1034
|
},
|
|
1035
1035
|
get isDays() {
|
|
1036
|
-
return
|
|
1036
|
+
return v.value === "days";
|
|
1037
1037
|
},
|
|
1038
1038
|
get isWeek() {
|
|
1039
|
-
return
|
|
1039
|
+
return v.value === "week";
|
|
1040
1040
|
},
|
|
1041
1041
|
get isMonth() {
|
|
1042
|
-
return
|
|
1042
|
+
return v.value === "month";
|
|
1043
1043
|
},
|
|
1044
1044
|
get isYear() {
|
|
1045
|
-
return
|
|
1045
|
+
return v.value === "year";
|
|
1046
1046
|
},
|
|
1047
1047
|
get isYears() {
|
|
1048
|
-
return
|
|
1048
|
+
return v.value === "years";
|
|
1049
1049
|
}
|
|
1050
1050
|
};
|
|
1051
1051
|
}, rt = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], ot = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], it = "Years", ut = "Year", ct = "Month", dt = "Week", vt = "Days", ft = "Day", mt = "Today", gt = "No Event", ht = "All-day", yt = "Delete", Dt = "Create an event", pt = "dddd, MMMM D, YYYY", wt = "am", _t = "pm", Qe = {
|
|
@@ -1223,19 +1223,19 @@ const lt = (y, t) => {
|
|
|
1223
1223
|
}, Rt = ["onClick", "innerHTML"], Nt = {
|
|
1224
1224
|
key: 1,
|
|
1225
1225
|
class: "vuecal__title-bar"
|
|
1226
|
-
},
|
|
1226
|
+
}, Bt = { class: "vuecal__transition-wrap" }, Wt = ["disabled", "innerHTML"], Xt = {
|
|
1227
1227
|
__name: "header",
|
|
1228
1228
|
setup(y) {
|
|
1229
1229
|
const t = He("vuecal"), { view: d, config: r } = t, h = () => {
|
|
1230
1230
|
r.clickToNavigate && d.broader();
|
|
1231
1231
|
}, C = b(() => r.clickToNavigate ? { click: h } : {});
|
|
1232
|
-
return (
|
|
1233
|
-
|
|
1232
|
+
return (W, v) => (V(), P("div", At, [
|
|
1233
|
+
O(W.$slots, "header", {
|
|
1234
1234
|
view: $(d),
|
|
1235
1235
|
availableViews: $(r).availableViews,
|
|
1236
1236
|
vuecal: $(t)
|
|
1237
1237
|
}),
|
|
1238
|
-
|
|
1238
|
+
W.$slots.header ? x("", !0) : (V(), P(de, { key: 0 }, [
|
|
1239
1239
|
$(r).viewsBar ? (V(), P("div", Ft, [
|
|
1240
1240
|
(V(!0), P(de, null, we($(r).availableViews, (A, Z) => (V(), P("button", {
|
|
1241
1241
|
class: pe(["vuecal__view-button", { "vuecal__view-button--active": $(d).id === Z }]),
|
|
@@ -1243,29 +1243,29 @@ const lt = (y, t) => {
|
|
|
1243
1243
|
innerHTML: $(t).texts[Z],
|
|
1244
1244
|
type: "button"
|
|
1245
1245
|
}, null, 10, Rt))), 256))
|
|
1246
|
-
])) :
|
|
1246
|
+
])) : x("", !0),
|
|
1247
1247
|
$(r).titleBar ? (V(), P("nav", Nt, [
|
|
1248
1248
|
he("button", {
|
|
1249
|
-
class: pe(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !
|
|
1250
|
-
onClick:
|
|
1249
|
+
class: pe(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !W.$slots["previous-button"] }]),
|
|
1250
|
+
onClick: v[0] || (v[0] = (...A) => $(d).previous && $(d).previous(...A)),
|
|
1251
1251
|
type: "button"
|
|
1252
1252
|
}, [
|
|
1253
|
-
|
|
1253
|
+
O(W.$slots, "previous-button")
|
|
1254
1254
|
], 2),
|
|
1255
|
-
he("div",
|
|
1255
|
+
he("div", Bt, [
|
|
1256
1256
|
Oe(Ue, {
|
|
1257
1257
|
name: `vuecal-slide-fade--${$(d).transitionDirection}`
|
|
1258
1258
|
}, {
|
|
1259
|
-
default:
|
|
1259
|
+
default: N(() => [
|
|
1260
1260
|
(V(), P("div", {
|
|
1261
1261
|
key: $(d).id + $(d).start.getTime()
|
|
1262
1262
|
}, [
|
|
1263
|
-
|
|
1263
|
+
W.$slots.title || W.$slots[`title.${$(d).id}`] ? (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
|
|
1264
1264
|
key: 0,
|
|
1265
1265
|
class: "vuecal__title"
|
|
1266
1266
|
}, Ie(C.value)), {
|
|
1267
|
-
default:
|
|
1268
|
-
|
|
1267
|
+
default: N(() => [
|
|
1268
|
+
W.$slots[`title.${$(d).id}`] ? O(W.$slots, `title.${$(d).id}`, ne(ie({ key: 0 }, $(d)))) : O(W.$slots, "title", ne(ie({ key: 1 }, $(d))))
|
|
1269
1269
|
]),
|
|
1270
1270
|
_: 3
|
|
1271
1271
|
}, 16)) : (V(), Se(xe($(r).clickToNavigate && $(d).broaderView ? "button" : "div"), ie({
|
|
@@ -1280,27 +1280,27 @@ const lt = (y, t) => {
|
|
|
1280
1280
|
}, 8, ["name"])
|
|
1281
1281
|
]),
|
|
1282
1282
|
$(r).todayButton ? (V(), P(de, { key: 0 }, [
|
|
1283
|
-
|
|
1283
|
+
W.$slots["today-button"] ? O(W.$slots, "today-button", {
|
|
1284
1284
|
key: 0,
|
|
1285
1285
|
navigate: () => !$(d).containsToday && $(d).goToToday(),
|
|
1286
1286
|
active: $(d).containsToday
|
|
1287
1287
|
}) : (V(), P("button", {
|
|
1288
1288
|
key: 1,
|
|
1289
1289
|
class: pe(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": $(d).containsToday }]),
|
|
1290
|
-
onClick:
|
|
1290
|
+
onClick: v[1] || (v[1] = (A) => !$(d).containsToday && $(d).goToToday()),
|
|
1291
1291
|
disabled: !!$(d).containsToday,
|
|
1292
1292
|
type: "button",
|
|
1293
1293
|
innerHTML: $(t).texts.today
|
|
1294
|
-
}, null, 10,
|
|
1295
|
-
], 64)) :
|
|
1294
|
+
}, null, 10, Wt))
|
|
1295
|
+
], 64)) : x("", !0),
|
|
1296
1296
|
he("button", {
|
|
1297
|
-
class: pe(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !
|
|
1298
|
-
onClick:
|
|
1297
|
+
class: pe(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !W.$slots["next-button"] }]),
|
|
1298
|
+
onClick: v[2] || (v[2] = (...A) => $(d).next && $(d).next(...A)),
|
|
1299
1299
|
type: "button"
|
|
1300
1300
|
}, [
|
|
1301
|
-
|
|
1301
|
+
O(W.$slots, "next-button")
|
|
1302
1302
|
], 2)
|
|
1303
|
-
])) :
|
|
1303
|
+
])) : x("", !0)
|
|
1304
1304
|
], 64))
|
|
1305
1305
|
]));
|
|
1306
1306
|
}
|
|
@@ -1313,7 +1313,7 @@ const lt = (y, t) => {
|
|
|
1313
1313
|
}, Zt = { class: "vuecal__event-start" }, Kt = {
|
|
1314
1314
|
key: 1,
|
|
1315
1315
|
class: "vuecal__event-end"
|
|
1316
|
-
}, Qt = { key: 0 }, xt = ["innerHTML"],
|
|
1316
|
+
}, Qt = { key: 0 }, xt = ["innerHTML"], en = 16, st = {
|
|
1317
1317
|
__name: "event",
|
|
1318
1318
|
props: {
|
|
1319
1319
|
event: { type: Object, required: !0 },
|
|
@@ -1323,7 +1323,7 @@ const lt = (y, t) => {
|
|
|
1323
1323
|
},
|
|
1324
1324
|
emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
|
|
1325
1325
|
setup(y, { emit: t }) {
|
|
1326
|
-
const d = y, { config: r, view: h, dnd: C, touch:
|
|
1326
|
+
const d = y, { config: r, view: h, dnd: C, touch: W, dateUtils: v, eventsManager: A } = He("vuecal"), { handleEventResize: Z } = A, L = ue(null), l = be(d.event), E = be({
|
|
1327
1327
|
dragging: !1,
|
|
1328
1328
|
fromResizer: !1,
|
|
1329
1329
|
// If the drag originates from the resizer element.
|
|
@@ -1364,20 +1364,20 @@ const lt = (y, t) => {
|
|
|
1364
1364
|
cellEl: null,
|
|
1365
1365
|
// Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
|
|
1366
1366
|
schedule: null
|
|
1367
|
-
}), F = b(() => r.editableEvents.drag && l.draggable !== !1 && !l.background && E.canTouchAndDrag !== !1), m = b(() => h.isMonth || h.isYear || h.isYears || d.inAllDayBar || l._.multiday && !
|
|
1367
|
+
}), F = b(() => r.editableEvents.drag && l.draggable !== !1 && !l.background && E.canTouchAndDrag !== !1), m = b(() => h.isMonth || h.isYear || h.isYears || d.inAllDayBar || l._.multiday && !a.value ? !1 : r.time && r.editableEvents.resize && l.resizable !== !1 && !l.background);
|
|
1368
1368
|
b(() => r.editableEvents.delete && l.deletable !== !1 && !l.background);
|
|
1369
1369
|
const i = b(() => {
|
|
1370
|
-
var c, u, p,
|
|
1371
|
-
const
|
|
1370
|
+
var c, u, p, n, j;
|
|
1371
|
+
const f = !!((c = l._) != null && c.multiday);
|
|
1372
1372
|
return {
|
|
1373
1373
|
[`vuecal__event--${l._.id}`]: !0,
|
|
1374
1374
|
[l.class]: !!l.class,
|
|
1375
1375
|
"vuecal__event--recurring": !!l.recurring,
|
|
1376
1376
|
"vuecal__event--background": !!l.background,
|
|
1377
1377
|
"vuecal__event--all-day": l.allDay || ((u = l._) == null ? void 0 : u.startMinutes) === 0 && ((p = l._) == null ? void 0 : p.duration) === 1440,
|
|
1378
|
-
"vuecal__event--multiday":
|
|
1379
|
-
"vuecal__event--cut-top": !d.inAllDayBar && (((
|
|
1380
|
-
"vuecal__event--cut-bottom": !d.inAllDayBar && (((
|
|
1378
|
+
"vuecal__event--multiday": f,
|
|
1379
|
+
"vuecal__event--cut-top": !d.inAllDayBar && (((n = l._) == null ? void 0 : n.startMinutes) < r.timeFrom || f && !S.value),
|
|
1380
|
+
"vuecal__event--cut-bottom": !d.inAllDayBar && (((j = l._) == null ? void 0 : j.endMinutes) > r.timeTo || f && !a.value),
|
|
1381
1381
|
// Only apply the dragging class on the event copy that is being dragged.
|
|
1382
1382
|
"vuecal__event--dragging": !l._.draggingGhost && l._.dragging,
|
|
1383
1383
|
// Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
|
|
@@ -1387,68 +1387,68 @@ const lt = (y, t) => {
|
|
|
1387
1387
|
// after event deletion (event._.dragging is already false) so the event ghost does not flash in before
|
|
1388
1388
|
// deletion.
|
|
1389
1389
|
"vuecal__event--dragging-ghost": l._.draggingGhost,
|
|
1390
|
-
"vuecal__event--resizing":
|
|
1390
|
+
"vuecal__event--resizing": W.isResizingEvent
|
|
1391
1391
|
};
|
|
1392
|
-
}), S = b(() => l._.multiday ? new Date(l.start).setHours(0, 0, 0, 0) === d.cellStart.getTime() : !0),
|
|
1393
|
-
const
|
|
1394
|
-
return Math.ceil((c -
|
|
1392
|
+
}), S = b(() => l._.multiday ? new Date(l.start).setHours(0, 0, 0, 0) === d.cellStart.getTime() : !0), a = b(() => l._.multiday ? v.isSameDate(new Date(new Date(l.end).setMilliseconds(-1)), d.cellEnd) : !0), I = b(() => {
|
|
1393
|
+
const f = new Date(l.start).setHours(0, 0, 0, 0), c = new Date(l.end).setHours(0, 0, 0, 0);
|
|
1394
|
+
return Math.ceil((c - f) / (1e3 * 60 * 60 * 24));
|
|
1395
1395
|
}), e = b(() => {
|
|
1396
|
-
const
|
|
1397
|
-
if (!
|
|
1396
|
+
const f = (h.isDay || h.isDays || h.isWeek) && r.time && !d.inAllDayBar, c = r.horizontal;
|
|
1397
|
+
if (!f && !l.backgroundColor && !l.color) return !1;
|
|
1398
1398
|
const u = {
|
|
1399
1399
|
backgroundColor: l.backgroundColor || null,
|
|
1400
1400
|
color: l.color || null
|
|
1401
1401
|
};
|
|
1402
|
-
if (
|
|
1403
|
-
let p = l._.startMinutes,
|
|
1404
|
-
l._.multiday && (S.value || (p = 0),
|
|
1405
|
-
const
|
|
1402
|
+
if (f) {
|
|
1403
|
+
let p = l._.startMinutes, n = l._.endMinutes;
|
|
1404
|
+
l._.multiday && (S.value || (p = 0), a.value || (n = 1440));
|
|
1405
|
+
const j = Math.max(r.timeFrom, p), X = Math.min(r.timeTo, n) + (l._.duration && !n ? 1440 : 0), U = Ve(j, r), K = Ve(X, r) - U;
|
|
1406
1406
|
u[c ? "left" : "top"] = `${U}%`, u[c ? "width" : "height"] = `${K}%`;
|
|
1407
1407
|
}
|
|
1408
1408
|
return u;
|
|
1409
1409
|
}), z = b(() => {
|
|
1410
|
-
const
|
|
1411
|
-
for (const [p,
|
|
1412
|
-
["resize-end"].includes(p) || (
|
|
1413
|
-
|
|
1410
|
+
const f = { ...r.eventListeners.event };
|
|
1411
|
+
for (const [p, n] of Object.entries(f))
|
|
1412
|
+
["resize-end"].includes(p) || (f[p] = (j) => {
|
|
1413
|
+
j.type !== "drop" && n(j.type ? { e: j, event: l } : j);
|
|
1414
1414
|
});
|
|
1415
|
-
const c = { ...
|
|
1416
|
-
|
|
1417
|
-
var
|
|
1415
|
+
const c = { ...f };
|
|
1416
|
+
f.touchstart = (p) => {
|
|
1417
|
+
var n;
|
|
1418
1418
|
p.stopPropagation(), E.touchAndDragTimer = setTimeout(() => {
|
|
1419
1419
|
E.canTouchAndDrag = !0;
|
|
1420
|
-
}, 500), _(p), (
|
|
1421
|
-
},
|
|
1422
|
-
var
|
|
1423
|
-
p.stopPropagation(), _(p), (
|
|
1420
|
+
}, 500), _(p), (n = c.touchstart) == null || n.call(c, { e: p, event: l });
|
|
1421
|
+
}, f.mousedown = (p) => {
|
|
1422
|
+
var n;
|
|
1423
|
+
p.stopPropagation(), _(p), (n = c.mousedown) == null || n.call(c, { e: p, event: l });
|
|
1424
1424
|
};
|
|
1425
1425
|
let u = null;
|
|
1426
|
-
return
|
|
1427
|
-
var
|
|
1428
|
-
(
|
|
1429
|
-
var
|
|
1430
|
-
u = null, (
|
|
1426
|
+
return f.click = (p) => {
|
|
1427
|
+
var n;
|
|
1428
|
+
(n = c.click) == null || n.call(c, { e: p, event: l }), u ? u = clearTimeout(u) : u = setTimeout(() => {
|
|
1429
|
+
var j;
|
|
1430
|
+
u = null, (j = c["delayed-click"]) == null || j.call(c, { e: p, event: l });
|
|
1431
1431
|
}, 400);
|
|
1432
|
-
},
|
|
1432
|
+
}, f.dblclick = (p) => {
|
|
1433
1433
|
c.dblclick ? c.dblclick({ e: p, event: l }) : l.delete(1);
|
|
1434
|
-
},
|
|
1434
|
+
}, f;
|
|
1435
1435
|
});
|
|
1436
1436
|
let H = null, Y = 0;
|
|
1437
|
-
const _ = (
|
|
1438
|
-
var
|
|
1439
|
-
const c = ((
|
|
1437
|
+
const _ = (f) => {
|
|
1438
|
+
var n, j, X;
|
|
1439
|
+
const c = ((n = f.touches) == null ? void 0 : n[0]) || f;
|
|
1440
1440
|
E.fromResizer = c.target.closest(".vuecal__event-resizer");
|
|
1441
1441
|
const u = Date.now();
|
|
1442
|
-
(!H || u - Y >
|
|
1442
|
+
(!H || u - Y > en) && (H = L.value.getBoundingClientRect(), Y = u);
|
|
1443
1443
|
const p = H;
|
|
1444
|
-
E.startX = (((
|
|
1444
|
+
E.startX = (((j = f.touches) == null ? void 0 : j[0]) || f).clientX - p.left, E.startY = (((X = f.touches) == null ? void 0 : X[0]) || f).clientY - p.top, E.startPercentageX = E.startX * 100 / p.width, E.startPercentageY = E.startY * 100 / p.height, E.cellEl = L.value.closest(".vuecal__cell"), E.resizeStartDate = l.start, E.fromResizer && Z(f, l, L.value), E.holdTimer = setTimeout(() => {
|
|
1445
1445
|
var U, K;
|
|
1446
|
-
E.holding = !0, (K = (U = z.value).hold) == null || K.call(U, { e:
|
|
1446
|
+
E.holding = !0, (K = (U = z.value).hold) == null || K.call(U, { e: f, event: l });
|
|
1447
1447
|
}, 1e3);
|
|
1448
1448
|
};
|
|
1449
1449
|
return Ze(() => l._.register(L.value)), Re(() => {
|
|
1450
1450
|
E.holdTimer && (E.holdTimer = clearTimeout(E.holdTimer)), E.touchAndDragTimer && (E.touchAndDragTimer = clearTimeout(E.touchAndDragTimer)), l._.unregister();
|
|
1451
|
-
}), (
|
|
1451
|
+
}), (f, c) => (V(), P("div", ie({ class: "vuecal__event" }, Ie(z.value, !0), {
|
|
1452
1452
|
ref_key: "eventEl",
|
|
1453
1453
|
ref: L,
|
|
1454
1454
|
class: i.value,
|
|
@@ -1458,26 +1458,26 @@ const lt = (y, t) => {
|
|
|
1458
1458
|
onDragend: c[3] || (c[3] = (u) => F.value && $(C).eventDragEnd(u, l))
|
|
1459
1459
|
}), [
|
|
1460
1460
|
he("div", qt, [
|
|
1461
|
-
|
|
1461
|
+
f.$slots["event.all-day"] ? O(f.$slots, "event.all-day", {
|
|
1462
1462
|
key: 0,
|
|
1463
1463
|
event: l
|
|
1464
|
-
}) :
|
|
1464
|
+
}) : f.$slots[`event.${$(h).id}`] ? O(f.$slots, `event.${$(h).id}`, {
|
|
1465
1465
|
key: 1,
|
|
1466
1466
|
event: l
|
|
1467
|
-
}) :
|
|
1467
|
+
}) : O(f.$slots, "event", {
|
|
1468
1468
|
key: 2,
|
|
1469
1469
|
event: l
|
|
1470
1470
|
}, () => [
|
|
1471
1471
|
he("div", Gt, ce(l.title), 1),
|
|
1472
1472
|
$(r).time && !y.inAllDayBar && !(l._.multiday && !S.value) ? (V(), P("div", Ut, [
|
|
1473
|
-
$(h).isMonth ? (V(), P("span", Jt, ",")) :
|
|
1473
|
+
$(h).isMonth ? (V(), P("span", Jt, ",")) : x("", !0),
|
|
1474
1474
|
he("span", Zt, ce(l._[`startTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
|
|
1475
|
-
$(h).isMonth ?
|
|
1475
|
+
$(h).isMonth ? x("", !0) : (V(), P("span", Kt, [
|
|
1476
1476
|
qe(" - " + ce(l._[`endTimeFormatted${$(r).twelveHour ? 12 : 24}`]), 1),
|
|
1477
|
-
l._.multiday && S.value ? (V(), P("span", Qt, "+" + ce(I.value) + "d", 1)) :
|
|
1477
|
+
l._.multiday && S.value ? (V(), P("span", Qt, "+" + ce(I.value) + "d", 1)) : x("", !0)
|
|
1478
1478
|
]))
|
|
1479
|
-
])) :
|
|
1480
|
-
y.inAllDayBar ?
|
|
1479
|
+
])) : x("", !0),
|
|
1480
|
+
y.inAllDayBar ? x("", !0) : (V(), P("div", {
|
|
1481
1481
|
key: 1,
|
|
1482
1482
|
class: "vuecal__event-content",
|
|
1483
1483
|
innerHTML: l.content
|
|
@@ -1489,41 +1489,41 @@ const lt = (y, t) => {
|
|
|
1489
1489
|
class: "vuecal__event-resizer",
|
|
1490
1490
|
onDragstart: c[0] || (c[0] = et(() => {
|
|
1491
1491
|
}, ["prevent", "stop"]))
|
|
1492
|
-
}, null, 32)) :
|
|
1492
|
+
}, null, 32)) : x("", !0),
|
|
1493
1493
|
Oe(Ue, { name: "vuecal-delete-btn" }, {
|
|
1494
|
-
default:
|
|
1494
|
+
default: N(() => [
|
|
1495
1495
|
l._.deleting ? (V(), P("div", {
|
|
1496
1496
|
key: 0,
|
|
1497
1497
|
class: "vuecal__event-delete",
|
|
1498
1498
|
onClick: c[1] || (c[1] = et((u) => l.delete(3), ["stop"]))
|
|
1499
|
-
}, "Delete")) :
|
|
1499
|
+
}, "Delete")) : x("", !0)
|
|
1500
1500
|
]),
|
|
1501
1501
|
_: 1
|
|
1502
1502
|
})
|
|
1503
1503
|
], 16, It));
|
|
1504
1504
|
}
|
|
1505
|
-
},
|
|
1505
|
+
}, tn = ["innerHTML"], nn = ["data-schedule"], an = {
|
|
1506
1506
|
key: 1,
|
|
1507
1507
|
class: "vuecal__cell-date"
|
|
1508
|
-
},
|
|
1508
|
+
}, sn = {
|
|
1509
1509
|
key: 2,
|
|
1510
1510
|
class: "vuecal__cell-content"
|
|
1511
|
-
},
|
|
1511
|
+
}, ln = {
|
|
1512
1512
|
key: 3,
|
|
1513
1513
|
class: "vuecal__cell-events"
|
|
1514
|
-
},
|
|
1514
|
+
}, rn = {
|
|
1515
1515
|
key: 1,
|
|
1516
1516
|
class: "vuecal__cell-date"
|
|
1517
|
-
},
|
|
1517
|
+
}, on = {
|
|
1518
1518
|
key: 2,
|
|
1519
1519
|
class: "vuecal__cell-content"
|
|
1520
|
-
},
|
|
1520
|
+
}, un = {
|
|
1521
1521
|
key: 3,
|
|
1522
1522
|
class: "vuecal__cell-events"
|
|
1523
|
-
},
|
|
1523
|
+
}, cn = {
|
|
1524
1524
|
key: 5,
|
|
1525
1525
|
class: "vuecal__cell-events-count"
|
|
1526
|
-
},
|
|
1526
|
+
}, dn = ["title"], kt = {
|
|
1527
1527
|
__name: "cell",
|
|
1528
1528
|
props: {
|
|
1529
1529
|
// Even with time=false, the date of the cell will still be provided in order to attach
|
|
@@ -1535,7 +1535,7 @@ const lt = (y, t) => {
|
|
|
1535
1535
|
// True when the cell is an all-day cell.
|
|
1536
1536
|
},
|
|
1537
1537
|
setup(y) {
|
|
1538
|
-
const t = y, d = He("vuecal"), { view: r, config: h, dateUtils: C, eventsManager:
|
|
1538
|
+
const t = y, d = He("vuecal"), { view: r, config: h, dateUtils: C, eventsManager: W, dnd: v, touch: A } = d, Z = b(() => C.isToday(t.start)), L = ue(null), l = ue([]), E = ue(!1), F = (o) => {
|
|
1539
1539
|
l.value.push(o.detail), E.value = !0;
|
|
1540
1540
|
}, m = () => setTimeout(() => E.value = !1, 300), i = be({
|
|
1541
1541
|
dragging: !1,
|
|
@@ -1562,7 +1562,7 @@ const lt = (y, t) => {
|
|
|
1562
1562
|
movePercentageX: 0,
|
|
1563
1563
|
movePercentageY: 0,
|
|
1564
1564
|
schedule: null
|
|
1565
|
-
}), S = ue(!1),
|
|
1565
|
+
}), S = ue(!1), a = ue({ cellOverlaps: {}, longestStreak: 0 }), I = b(() => {
|
|
1566
1566
|
let o = Math.min(i.startPercentageY, i.movePercentageY), T = Math.max(i.startPercentageY, i.movePercentageY), M = je(o, h), w = je(T, h);
|
|
1567
1567
|
return h.snapToInterval && (M = C.snapToInterval(M, h.snapToInterval), w = C.snapToInterval(w, h.snapToInterval), o = Ve(M, h), T = Ve(w, h)), {
|
|
1568
1568
|
style: {
|
|
@@ -1580,16 +1580,16 @@ const lt = (y, t) => {
|
|
|
1580
1580
|
return o && T && M;
|
|
1581
1581
|
}), z = b(() => {
|
|
1582
1582
|
var oe;
|
|
1583
|
-
const o = /* @__PURE__ */ new Date(), T = r.start.getFullYear(), M = r.start.getMonth(), w = t.start.getFullYear(),
|
|
1583
|
+
const o = /* @__PURE__ */ new Date(), T = r.start.getFullYear(), M = r.start.getMonth(), w = t.start.getFullYear(), B = t.start.getMonth();
|
|
1584
1584
|
return {
|
|
1585
1585
|
[`vuecal__cell--${Ge[t.start.getDay()]}`]: r.isDay || r.isDays || r.isWeek || r.isMonth,
|
|
1586
|
-
[`vuecal__cell--${Yt[
|
|
1586
|
+
[`vuecal__cell--${Yt[B]}`]: r.isYear,
|
|
1587
1587
|
[`vuecal__cell--${w}`]: r.isYears,
|
|
1588
1588
|
"vuecal__cell--today": Z.value,
|
|
1589
|
-
"vuecal__cell--current-month": r.isYear && w === o.getFullYear() &&
|
|
1589
|
+
"vuecal__cell--current-month": r.isYear && w === o.getFullYear() && B === o.getMonth(),
|
|
1590
1590
|
"vuecal__cell--current-year": r.isYears && w === o.getFullYear(),
|
|
1591
|
-
"vuecal__cell--out-of-range": r.isMonth && (w !== T ||
|
|
1592
|
-
"vuecal__cell--before-min": U.value &&
|
|
1591
|
+
"vuecal__cell--out-of-range": r.isMonth && (w !== T || B !== M),
|
|
1592
|
+
"vuecal__cell--before-min": U.value && j.value,
|
|
1593
1593
|
"vuecal__cell--after-max": U.value && X.value,
|
|
1594
1594
|
"vuecal__cell--disabled": U.value,
|
|
1595
1595
|
"vuecal__cell--selected": r.selectedDate && r.selectedDate.getTime() >= t.start.getTime() && r.selectedDate.getTime() <= t.end.getTime(),
|
|
@@ -1614,48 +1614,48 @@ const lt = (y, t) => {
|
|
|
1614
1614
|
case "years":
|
|
1615
1615
|
return C.formatDate(t.start, "YYYY");
|
|
1616
1616
|
}
|
|
1617
|
-
}), Y = b(() => h.datePicker ? [] :
|
|
1617
|
+
}), Y = b(() => h.datePicker ? [] : W.getEventsInRange(
|
|
1618
1618
|
t.start,
|
|
1619
1619
|
t.end,
|
|
1620
1620
|
{ excludeIds: l.value, ...h.allDayEvents ? { allDay: t.allDay } : {} }
|
|
1621
|
-
)), _ = b(() => Y.value.filter((o) => !o.background)),
|
|
1621
|
+
)), _ = b(() => Y.value.filter((o) => !o.background)), f = b(() => {
|
|
1622
1622
|
var o;
|
|
1623
1623
|
return (o = h.schedules) == null ? void 0 : o.reduce((T, M) => (T[M.id] = Y.value.filter((w) => w.schedule === M.id), T), {});
|
|
1624
1624
|
}), c = b(() => {
|
|
1625
1625
|
if (r.isMonth || r.isYear || r.isYears || t.allDay) return {};
|
|
1626
1626
|
const o = typeof document < "u" && document.documentElement.getAttribute("dir") === "rtl", T = h.horizontal, M = {};
|
|
1627
1627
|
for (const w of Y.value) {
|
|
1628
|
-
const
|
|
1629
|
-
M[
|
|
1628
|
+
const B = w._.id, { maxConcurrent: G = 1, position: oe = 0 } = a.value.cellOverlaps[B] || {}, ge = o ? "right" : "left", g = T ? "height" : "width";
|
|
1629
|
+
M[B] = { [T ? "top" : ge]: `${100 / G * oe}%` }, h.stackEvents ? M[B][g] = `${100 / G + (oe === G - 1 ? 0 : 15)}%` : M[B][g] = `${100 / G}%`;
|
|
1630
1630
|
}
|
|
1631
1631
|
return M;
|
|
1632
1632
|
}), u = b(() => {
|
|
1633
1633
|
const o = {};
|
|
1634
1634
|
for (const T of Y.value) {
|
|
1635
|
-
const M = T._.id, { maxConcurrent: w = 1, position:
|
|
1636
|
-
o[M] = `vuecal__event--stack-${
|
|
1635
|
+
const M = T._.id, { maxConcurrent: w = 1, position: B = 0 } = a.value.cellOverlaps[M] || {};
|
|
1636
|
+
o[M] = `vuecal__event--stack-${B + 1}-${w}`;
|
|
1637
1637
|
}
|
|
1638
1638
|
return o;
|
|
1639
|
-
}), p = b(() => h.showCellEventCount && _.value.length),
|
|
1639
|
+
}), p = b(() => h.showCellEventCount && _.value.length), n = b(() => {
|
|
1640
1640
|
var M;
|
|
1641
1641
|
if (!h.specialHours || r.isMonth || r.isYear || r.isYears || t.allDay) return;
|
|
1642
1642
|
const o = Ge[t.start.getDay()];
|
|
1643
1643
|
let T = (M = h.specialHours) == null ? void 0 : M[o];
|
|
1644
1644
|
if (T)
|
|
1645
1645
|
return Array.isArray(T) || (T = [T]), T.map((w) => {
|
|
1646
|
-
let { from:
|
|
1647
|
-
if (isNaN(
|
|
1648
|
-
|
|
1649
|
-
const g = Ve(
|
|
1646
|
+
let { from: B, to: G, class: oe, label: ge } = w;
|
|
1647
|
+
if (isNaN(B) || isNaN(G) || h.timeFrom >= G || h.timeTo <= B) return;
|
|
1648
|
+
B = Math.max(h.timeFrom, B), G = Math.min(h.timeTo, G);
|
|
1649
|
+
const g = Ve(B, h), R = Ve(G, h) - g;
|
|
1650
1650
|
return {
|
|
1651
|
-
style: { top: `${g}%`, height: `${
|
|
1651
|
+
style: { top: `${g}%`, height: `${R}%` },
|
|
1652
1652
|
label: ge,
|
|
1653
1653
|
class: oe
|
|
1654
1654
|
};
|
|
1655
1655
|
}).filter((w) => !!w);
|
|
1656
|
-
}),
|
|
1656
|
+
}), j = b(() => h.minTimestamp !== null && h.minTimestamp > t.end.getTime()), X = b(() => h.maxTimestamp && h.maxTimestamp < t.start.getTime()), U = b(() => {
|
|
1657
1657
|
const { disableDays: o } = h, T = r.isYear || r.isYears;
|
|
1658
|
-
return o.length && o.includes(C.formatDate(t.start)) && !T ? !0 :
|
|
1658
|
+
return o.length && o.includes(C.formatDate(t.start)) && !T ? !0 : j.value || X.value;
|
|
1659
1659
|
}), K = be({
|
|
1660
1660
|
show: b(() => {
|
|
1661
1661
|
if (!(!r.isDay && !r.isDays && !r.isWeek) && !(!Z.value || !h.time || t.allDay) && !(h.timeFrom > C.dateToMinutes(r.now)) && !(C.dateToMinutes(r.now) > h.timeTo))
|
|
@@ -1664,37 +1664,37 @@ const lt = (y, t) => {
|
|
|
1664
1664
|
nowInMinutes: b(() => C.dateToMinutes(r.now)),
|
|
1665
1665
|
todaysTimePosition: b(() => Ve(K.nowInMinutes, h)),
|
|
1666
1666
|
style: b(() => `${h.horizontal ? "left" : "top"}: ${K.todaysTimePosition}%`),
|
|
1667
|
-
currentTime: b(() => C.formatTime(r.now))
|
|
1667
|
+
currentTime: b(() => C.formatTime(r.now, h.twelveHour ? "h:mm {am}" : "HH:mm"))
|
|
1668
1668
|
}), te = b(() => {
|
|
1669
1669
|
if (U.value) return {};
|
|
1670
1670
|
const o = { ...h.eventListeners.cell };
|
|
1671
|
-
for (const [w,
|
|
1671
|
+
for (const [w, B] of Object.entries(o))
|
|
1672
1672
|
o[w] = (G) => {
|
|
1673
1673
|
var oe, ge, g;
|
|
1674
|
-
(g = (ge = G.target || ((oe = G.e) == null ? void 0 : oe.target)).closest) != null && g.call(ge, ".vuecal__event") ||
|
|
1674
|
+
(g = (ge = G.target || ((oe = G.e) == null ? void 0 : oe.target)).closest) != null && g.call(ge, ".vuecal__event") || B(G.type ? { e: G, cell: q.value, cursor: ae.value } : G);
|
|
1675
1675
|
};
|
|
1676
1676
|
const T = { ...o };
|
|
1677
1677
|
let M = null;
|
|
1678
1678
|
return o.click = (w) => {
|
|
1679
1679
|
var G;
|
|
1680
1680
|
ve();
|
|
1681
|
-
const
|
|
1682
|
-
(G = T.click) == null || G.call(T, { e: w, cell: q.value, cursor:
|
|
1681
|
+
const B = re(w);
|
|
1682
|
+
(G = T.click) == null || G.call(T, { e: w, cell: q.value, cursor: B }), M ? M = clearTimeout(M) : M = setTimeout(() => {
|
|
1683
1683
|
var oe;
|
|
1684
|
-
M = null, (oe = T["delayed-click"]) == null || oe.call(T, { e: w, cell: q.value, cursor:
|
|
1684
|
+
M = null, (oe = T["delayed-click"]) == null || oe.call(T, { e: w, cell: q.value, cursor: B });
|
|
1685
1685
|
}, 400);
|
|
1686
1686
|
}, (h.time && r.isDay || r.isDays || r.isWeek) && (o.touchstart = (w) => {
|
|
1687
|
-
var
|
|
1688
|
-
s(w.e || w), (
|
|
1687
|
+
var B;
|
|
1688
|
+
s(w.e || w), (B = T.touchstart) == null || B.call(T, { e: w, cell: q.value, cursor: ae.value });
|
|
1689
1689
|
}, o.mousedown = (w) => {
|
|
1690
|
-
var
|
|
1691
|
-
s(w.e || w), (
|
|
1690
|
+
var B;
|
|
1691
|
+
s(w.e || w), (B = T.mousedown) == null || B.call(T, { e: w, cell: q.value, cursor: ae.value });
|
|
1692
1692
|
}), T.dblclick && (o.dblclick = (w) => {
|
|
1693
|
-
var
|
|
1694
|
-
(
|
|
1695
|
-
}), h.editableEvents.drag && (o.dragenter = (w) =>
|
|
1696
|
-
w.preventDefault(),
|
|
1697
|
-
}, o.dragleave = (w) =>
|
|
1693
|
+
var B;
|
|
1694
|
+
(B = T.dblclick) == null || B.call(T, { e: w, cell: q.value, cursor: re(w) });
|
|
1695
|
+
}), h.editableEvents.drag && (o.dragenter = (w) => v.cellDragEnter(w, q.value), o.dragover = (w) => {
|
|
1696
|
+
w.preventDefault(), v.cellDragOver(w, q.value);
|
|
1697
|
+
}, o.dragleave = (w) => v.cellDragLeave(w, q.value), o.drop = (w) => v.cellDragDrop(w, q.value, t.allDay)), o;
|
|
1698
1698
|
}), q = b(() => ({
|
|
1699
1699
|
start: t.start,
|
|
1700
1700
|
end: t.end,
|
|
@@ -1704,10 +1704,10 @@ const lt = (y, t) => {
|
|
|
1704
1704
|
goBroader: () => r.broader(),
|
|
1705
1705
|
broader: r.broaderView,
|
|
1706
1706
|
narrower: r.narrowerView
|
|
1707
|
-
})),
|
|
1707
|
+
})), re = (o) => {
|
|
1708
1708
|
var G;
|
|
1709
|
-
const T = (((G = o.touches) == null ? void 0 : G[0]) || o).clientY, { top: M } = L.value.getBoundingClientRect(), w = Ke(T - M, L.value),
|
|
1710
|
-
return
|
|
1709
|
+
const T = (((G = o.touches) == null ? void 0 : G[0]) || o).clientY, { top: M } = L.value.getBoundingClientRect(), w = Ke(T - M, L.value), B = new Date(t.start);
|
|
1710
|
+
return B.setMinutes(je(w, h)), { y: w, date: B };
|
|
1711
1711
|
}, ae = b(() => {
|
|
1712
1712
|
const o = je(i.movePercentageY || i.startPercentageY, h), T = new Date(t.start);
|
|
1713
1713
|
return T.setMinutes(o), {
|
|
@@ -1718,24 +1718,24 @@ const lt = (y, t) => {
|
|
|
1718
1718
|
}), ve = () => {
|
|
1719
1719
|
r.updateSelectedDate(t.start), h.clickToNavigate && ((r.isMonth || r.isDays || r.isWeek) && h.availableViews.day ? r.switch("day") : r.isYear && h.availableViews.month ? r.switch("month") : r.isYears && h.availableViews.year && r.switch("year")), r.updateViewDate(t.start);
|
|
1720
1720
|
}, s = (o) => {
|
|
1721
|
-
var w,
|
|
1721
|
+
var w, B;
|
|
1722
1722
|
const T = o.type === "touchstart";
|
|
1723
1723
|
T ? (i.canTouchAndDrag = !1, i.touchAndDragTimer = setTimeout(() => {
|
|
1724
1724
|
i.canTouchAndDrag = !0, (i.holding || i.dragging) && o.preventDefault();
|
|
1725
1725
|
}, 500)) : i.canTouchAndDrag = !0, i.schedule = ~~o.target.dataset.schedule;
|
|
1726
1726
|
const M = L.value.getBoundingClientRect();
|
|
1727
|
-
i.startX = (((w = o.touches) == null ? void 0 : w[0]) || o).clientX - M.left, i.startY = (((
|
|
1727
|
+
i.startX = (((w = o.touches) == null ? void 0 : w[0]) || o).clientX - M.left, i.startY = (((B = o.touches) == null ? void 0 : B[0]) || o).clientY - M.top, i.startPercentageX = i.startX * 100 / M.width, i.startPercentageY = i.startY * 100 / M.height, i.thresholdPassed = !1, document.addEventListener(T ? "touchmove" : "mousemove", k, { passive: !T }), document.addEventListener(T ? "touchend" : "mouseup", D, { once: !0 }), i.holdTimer = setTimeout(() => {
|
|
1728
1728
|
var G, oe;
|
|
1729
1729
|
i.holding = !0, (oe = (G = te.value).hold) == null || oe.call(G, { e: o, cell: q.value, cursor: ae.value });
|
|
1730
1730
|
}, 1e3);
|
|
1731
1731
|
}, k = (o) => {
|
|
1732
|
-
var w,
|
|
1732
|
+
var w, B, G, oe, ge, g;
|
|
1733
1733
|
const T = o.type === "touchmove";
|
|
1734
1734
|
if (T && !i.canTouchAndDrag) {
|
|
1735
1735
|
i.touchAndDragTimer && (clearTimeout(i.touchAndDragTimer), i.touchAndDragTimer = null), D(o);
|
|
1736
1736
|
return;
|
|
1737
1737
|
}
|
|
1738
|
-
T && o.preventDefault(), i.dragging || (A.isDraggingCell = !0, (
|
|
1738
|
+
T && o.preventDefault(), i.dragging || (A.isDraggingCell = !0, (B = (w = te.value)["drag-start"]) == null || B.call(w, { e: o, cell: q.value, cursor: ae.value })), i.dragging = !0, i.holdTimer = clearTimeout(i.holdTimer), i.holding = !1;
|
|
1739
1739
|
const M = L.value.getBoundingClientRect();
|
|
1740
1740
|
i.moveX = (((G = o.touches) == null ? void 0 : G[0]) || o).clientX - M.left, i.moveY = (((oe = o.touches) == null ? void 0 : oe[0]) || o).clientY - M.top, i.movePercentageX = i.moveX * 100 / M.width, i.movePercentageY = i.moveY * 100 / M.height, h.eventCreateMinDrag && Math.abs(i.startY - i.moveY) > h.eventCreateMinDrag && (i.thresholdPassed = !0), (g = (ge = te.value).drag) == null || g.call(ge, { e: o, cell: q.value, cursor: ae.value });
|
|
1741
1741
|
}, D = async (o) => {
|
|
@@ -1745,21 +1745,21 @@ const lt = (y, t) => {
|
|
|
1745
1745
|
}, J = async (o) => {
|
|
1746
1746
|
var ge;
|
|
1747
1747
|
if (!e.value) return;
|
|
1748
|
-
let { start: T, end: M, startMinutes: w, endMinutes:
|
|
1749
|
-
T = new Date(t.start), T.setMinutes(w), M = new Date(t.start), M.setMinutes(
|
|
1748
|
+
let { start: T, end: M, startMinutes: w, endMinutes: B } = I.value;
|
|
1749
|
+
T = new Date(t.start), T.setMinutes(w), M = new Date(t.start), M.setMinutes(B);
|
|
1750
1750
|
let G = { ...I.value, start: T, end: M };
|
|
1751
1751
|
const { create: oe } = h.eventListeners.event;
|
|
1752
1752
|
if (typeof oe == "function") {
|
|
1753
1753
|
const g = G;
|
|
1754
|
-
G = await new Promise((
|
|
1754
|
+
G = await new Promise((R) => oe({ e: o, event: G, cell: q.value, resolve: R, cursor: ae.value })), G && typeof G == "object" && r.createEvent(G), G && typeof G == "boolean" && r.createEvent(g);
|
|
1755
1755
|
} else r.createEvent(G);
|
|
1756
1756
|
(ge = navigator.vibrate) == null || ge.call(navigator, 200);
|
|
1757
|
-
},
|
|
1757
|
+
}, se = () => {
|
|
1758
1758
|
var o;
|
|
1759
1759
|
for (const T of Object.keys(te.value))
|
|
1760
1760
|
(o = L.value) == null || o.removeEventListener(T, te.value[T]);
|
|
1761
1761
|
}, me = () => {
|
|
1762
|
-
|
|
1762
|
+
a.value = W.getCellOverlappingEvents(t.start, t.end, t.allDay);
|
|
1763
1763
|
};
|
|
1764
1764
|
return De(
|
|
1765
1765
|
// Watch event IDs and start/end dates (only) to detect event resizing/dnd.
|
|
@@ -1770,42 +1770,42 @@ const lt = (y, t) => {
|
|
|
1770
1770
|
{ immediate: !0, flush: "post" }
|
|
1771
1771
|
// Use flush: 'post' to prevent infinite updates.
|
|
1772
1772
|
), Re(async () => {
|
|
1773
|
-
for (const o of l.value)
|
|
1774
|
-
|
|
1773
|
+
for (const o of l.value) W.deleteEvent(o, 3);
|
|
1774
|
+
se(), await Xe();
|
|
1775
1775
|
}), (o, T) => (V(), P("div", ie({
|
|
1776
1776
|
class: ["vuecal__cell", z.value],
|
|
1777
1777
|
ref_key: "cellEl",
|
|
1778
1778
|
ref: L
|
|
1779
1779
|
}, Ie(te.value, !0)), [
|
|
1780
|
-
o.$slots.cell ?
|
|
1780
|
+
o.$slots.cell ? O(o.$slots, "cell", {
|
|
1781
1781
|
key: 0,
|
|
1782
1782
|
cell: q.value
|
|
1783
|
-
}) :
|
|
1784
|
-
|
|
1783
|
+
}) : x("", !0),
|
|
1784
|
+
n.value ? (V(!0), P(de, { key: 1 }, we(n.value, (M, w) => (V(), P("div", {
|
|
1785
1785
|
class: pe(["vuecal__special-hours", M.class]),
|
|
1786
1786
|
style: $e(M.style),
|
|
1787
1787
|
innerHTML: M.label || ""
|
|
1788
|
-
}, null, 14,
|
|
1788
|
+
}, null, 14, tn))), 256)) : x("", !0),
|
|
1789
1789
|
!o.$slots.cell && $(h).schedules ? (V(!0), P(de, { key: 2 }, we($(h).schedules, (M) => (V(), P("div", {
|
|
1790
1790
|
class: pe(["vuecal__schedule vuecal__schedule--cell", M.class]),
|
|
1791
1791
|
key: M.id,
|
|
1792
1792
|
style: $e(M.style || null),
|
|
1793
1793
|
"data-schedule": M.id
|
|
1794
1794
|
}, [
|
|
1795
|
-
o.$slots["cell-events"] ?
|
|
1795
|
+
o.$slots["cell-events"] ? O(o.$slots, "cell-events", {
|
|
1796
1796
|
key: 0,
|
|
1797
1797
|
cell: q.value
|
|
1798
|
-
}) :
|
|
1799
|
-
H.value || o.$slots["cell-date"] ? (V(), P("div",
|
|
1800
|
-
|
|
1798
|
+
}) : x("", !0),
|
|
1799
|
+
H.value || o.$slots["cell-date"] ? (V(), P("div", an, [
|
|
1800
|
+
O(o.$slots, "cell-date", { cell: q.value }, () => [
|
|
1801
1801
|
qe(ce(H.value), 1)
|
|
1802
1802
|
])
|
|
1803
|
-
])) :
|
|
1804
|
-
o.$slots["cell-content"] ? (V(), P("div",
|
|
1805
|
-
|
|
1806
|
-
])) :
|
|
1807
|
-
o.$slots["cell-events"] && Y.value.length ? (V(), P("div",
|
|
1808
|
-
|
|
1803
|
+
])) : x("", !0),
|
|
1804
|
+
o.$slots["cell-content"] ? (V(), P("div", sn, [
|
|
1805
|
+
O(o.$slots, "cell-content", { cell: q.value })
|
|
1806
|
+
])) : x("", !0),
|
|
1807
|
+
o.$slots["cell-events"] && Y.value.length ? (V(), P("div", ln, [
|
|
1808
|
+
O(o.$slots, "cell-events", { cell: q.value })
|
|
1809
1809
|
])) : Y.value.length || E.value ? (V(), Se(tt, {
|
|
1810
1810
|
key: 4,
|
|
1811
1811
|
class: "vuecal__cell-events",
|
|
@@ -1814,8 +1814,8 @@ const lt = (y, t) => {
|
|
|
1814
1814
|
onAfterLeave: m,
|
|
1815
1815
|
tag: "div"
|
|
1816
1816
|
}, {
|
|
1817
|
-
default:
|
|
1818
|
-
(V(!0), P(de, null, we(
|
|
1817
|
+
default: N(() => [
|
|
1818
|
+
(V(!0), P(de, null, we(f.value[M.id], (w) => (V(), Se(st, {
|
|
1819
1819
|
key: w._.id,
|
|
1820
1820
|
event: w,
|
|
1821
1821
|
onEventDeleted: F,
|
|
@@ -1826,50 +1826,50 @@ const lt = (y, t) => {
|
|
|
1826
1826
|
}, Ce({ _: 2 }, [
|
|
1827
1827
|
o.$slots["event.all-day"] && t.allDay ? {
|
|
1828
1828
|
name: "event.all-day",
|
|
1829
|
-
fn:
|
|
1830
|
-
|
|
1829
|
+
fn: N((B) => [
|
|
1830
|
+
O(o.$slots, "event.all-day", ie({ ref_for: !0 }, B))
|
|
1831
1831
|
]),
|
|
1832
1832
|
key: "0"
|
|
1833
1833
|
} : void 0,
|
|
1834
1834
|
o.$slots[`event.${$(r).id}`] ? {
|
|
1835
1835
|
name: `event.${$(r).id}`,
|
|
1836
|
-
fn:
|
|
1837
|
-
|
|
1836
|
+
fn: N((B) => [
|
|
1837
|
+
O(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, B))
|
|
1838
1838
|
]),
|
|
1839
1839
|
key: "1"
|
|
1840
1840
|
} : void 0,
|
|
1841
1841
|
o.$slots.event ? {
|
|
1842
1842
|
name: "event",
|
|
1843
|
-
fn:
|
|
1844
|
-
|
|
1843
|
+
fn: N((B) => [
|
|
1844
|
+
O(o.$slots, "event", ie({ ref_for: !0 }, B))
|
|
1845
1845
|
]),
|
|
1846
1846
|
key: "2"
|
|
1847
1847
|
} : void 0
|
|
1848
1848
|
]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "style"]))), 128))
|
|
1849
1849
|
]),
|
|
1850
1850
|
_: 2
|
|
1851
|
-
}, 1024)) :
|
|
1851
|
+
}, 1024)) : x("", !0),
|
|
1852
1852
|
e.value && i.schedule === M.id && !t.allDay ? (V(), P("div", {
|
|
1853
1853
|
key: 5,
|
|
1854
1854
|
class: "vuecal__event-placeholder",
|
|
1855
1855
|
style: $e(I.value.style)
|
|
1856
|
-
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) :
|
|
1857
|
-
], 14,
|
|
1856
|
+
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) : x("", !0)
|
|
1857
|
+
], 14, nn))), 128)) : x("", !0),
|
|
1858
1858
|
!o.$slots.cell && !$(h).schedules ? (V(), P(de, { key: 3 }, [
|
|
1859
|
-
o.$slots["cell-events"] ?
|
|
1859
|
+
o.$slots["cell-events"] ? O(o.$slots, "cell-events", {
|
|
1860
1860
|
key: 0,
|
|
1861
1861
|
cell: q.value
|
|
1862
|
-
}) :
|
|
1863
|
-
H.value || o.$slots["cell-date"] ? (V(), P("div",
|
|
1864
|
-
|
|
1862
|
+
}) : x("", !0),
|
|
1863
|
+
H.value || o.$slots["cell-date"] ? (V(), P("div", rn, [
|
|
1864
|
+
O(o.$slots, "cell-date", { cell: q.value }, () => [
|
|
1865
1865
|
qe(ce(H.value), 1)
|
|
1866
1866
|
])
|
|
1867
|
-
])) :
|
|
1868
|
-
o.$slots["cell-content"] ? (V(), P("div",
|
|
1869
|
-
|
|
1870
|
-
])) :
|
|
1871
|
-
o.$slots["cell-events"] && Y.value.length ? (V(), P("div",
|
|
1872
|
-
|
|
1867
|
+
])) : x("", !0),
|
|
1868
|
+
o.$slots["cell-content"] ? (V(), P("div", on, [
|
|
1869
|
+
O(o.$slots, "cell-content", { cell: q.value })
|
|
1870
|
+
])) : x("", !0),
|
|
1871
|
+
o.$slots["cell-events"] && Y.value.length ? (V(), P("div", un, [
|
|
1872
|
+
O(o.$slots, "cell-events", { cell: q.value })
|
|
1873
1873
|
])) : !($(r).isMonth && !$(h).eventsOnMonthView) && !$(r).isYear && !$(r).isYears && (Y.value.length || E.value) ? (V(), Se(tt, {
|
|
1874
1874
|
key: 4,
|
|
1875
1875
|
class: "vuecal__cell-events",
|
|
@@ -1878,7 +1878,7 @@ const lt = (y, t) => {
|
|
|
1878
1878
|
onAfterLeave: m,
|
|
1879
1879
|
tag: "div"
|
|
1880
1880
|
}, {
|
|
1881
|
-
default:
|
|
1881
|
+
default: N(() => [
|
|
1882
1882
|
(V(!0), P(de, null, we(Y.value, (M) => (V(), Se(st, {
|
|
1883
1883
|
key: M._.id,
|
|
1884
1884
|
event: M,
|
|
@@ -1891,68 +1891,73 @@ const lt = (y, t) => {
|
|
|
1891
1891
|
}, Ce({ _: 2 }, [
|
|
1892
1892
|
o.$slots["event.all-day"] && t.allDay ? {
|
|
1893
1893
|
name: "event.all-day",
|
|
1894
|
-
fn:
|
|
1895
|
-
|
|
1894
|
+
fn: N((w) => [
|
|
1895
|
+
O(o.$slots, "event.all-day", ie({ ref_for: !0 }, w))
|
|
1896
1896
|
]),
|
|
1897
1897
|
key: "0"
|
|
1898
1898
|
} : void 0,
|
|
1899
1899
|
o.$slots[`event.${$(r).id}`] ? {
|
|
1900
1900
|
name: `event.${$(r).id}`,
|
|
1901
|
-
fn:
|
|
1902
|
-
|
|
1901
|
+
fn: N((w) => [
|
|
1902
|
+
O(o.$slots, `event.${$(r).id}`, ie({ ref_for: !0 }, w))
|
|
1903
1903
|
]),
|
|
1904
1904
|
key: "1"
|
|
1905
1905
|
} : void 0,
|
|
1906
1906
|
o.$slots.event ? {
|
|
1907
1907
|
name: "event",
|
|
1908
|
-
fn:
|
|
1909
|
-
|
|
1908
|
+
fn: N((w) => [
|
|
1909
|
+
O(o.$slots, "event", ie({ ref_for: !0 }, w))
|
|
1910
1910
|
]),
|
|
1911
1911
|
key: "2"
|
|
1912
1912
|
} : void 0
|
|
1913
1913
|
]), 1032, ["event", "in-all-day-bar", "cell-start", "cell-end", "class", "style"]))), 128))
|
|
1914
1914
|
]),
|
|
1915
1915
|
_: 3
|
|
1916
|
-
})) :
|
|
1916
|
+
})) : x("", !0),
|
|
1917
1917
|
e.value ? (V(), P("div", {
|
|
1918
1918
|
key: 5,
|
|
1919
1919
|
class: "vuecal__event-placeholder",
|
|
1920
1920
|
style: $e(I.value.style)
|
|
1921
|
-
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) :
|
|
1922
|
-
], 64)) :
|
|
1923
|
-
o.$slots["event-count"] ?
|
|
1921
|
+
}, ce(I.value.start) + " - " + ce(I.value.end), 5)) : x("", !0)
|
|
1922
|
+
], 64)) : x("", !0),
|
|
1923
|
+
o.$slots["event-count"] ? O(o.$slots, "event-count", {
|
|
1924
1924
|
key: 4,
|
|
1925
1925
|
events: _.value
|
|
1926
|
-
}) : p.value ? (V(), P("div",
|
|
1926
|
+
}) : p.value ? (V(), P("div", cn, ce(_.value.length), 1)) : x("", !0),
|
|
1927
1927
|
K.show ? (V(), P("div", {
|
|
1928
1928
|
key: 6,
|
|
1929
1929
|
class: "vuecal__now-line",
|
|
1930
1930
|
style: $e(K.style),
|
|
1931
1931
|
title: K.currentTime
|
|
1932
1932
|
}, [
|
|
1933
|
-
|
|
1934
|
-
|
|
1933
|
+
O(o.$slots, "now-line", {
|
|
1934
|
+
now: $(r).now,
|
|
1935
|
+
timeFormatted: K.currentTime
|
|
1936
|
+
}, () => [
|
|
1937
|
+
he("span", null, ce(K.currentTime), 1)
|
|
1938
|
+
])
|
|
1939
|
+
], 12, dn)) : x("", !0)
|
|
1935
1940
|
], 16));
|
|
1936
1941
|
}
|
|
1937
|
-
},
|
|
1942
|
+
}, vn = {
|
|
1938
1943
|
key: 0,
|
|
1939
1944
|
class: "vuecal__headings"
|
|
1940
|
-
},
|
|
1945
|
+
}, fn = {
|
|
1941
1946
|
key: 0,
|
|
1942
1947
|
class: "vuecal__weekdays-headings"
|
|
1943
|
-
},
|
|
1948
|
+
}, mn = ["onClick"], gn = { class: "vuecal__weekday-day" }, hn = {
|
|
1944
1949
|
key: 0,
|
|
1945
1950
|
class: "vuecal__weekday-date"
|
|
1946
|
-
},
|
|
1951
|
+
}, yn = {
|
|
1947
1952
|
key: 1,
|
|
1948
1953
|
class: "vuecal__schedules-headings w-flex grow"
|
|
1949
|
-
},
|
|
1954
|
+
}, Dn = ["innerHTML"], pn = {
|
|
1950
1955
|
key: 2,
|
|
1951
1956
|
class: "vuecal__all-day w-flex grow"
|
|
1952
|
-
},
|
|
1957
|
+
}, wn = {
|
|
1953
1958
|
__name: "headings-bar",
|
|
1954
1959
|
setup(y) {
|
|
1955
|
-
const t = He("vuecal"), d = He("$vuecalEl"), { view: r, config: h, dateUtils: C } = t,
|
|
1960
|
+
const t = He("vuecal"), d = He("$vuecalEl"), { view: r, config: h, dateUtils: C } = t, W = b(() => h.xs ? "day-xs" : h.sm || r.isDays || r.isMonth ? "day-sm" : "day"), v = b(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !h.schedules && !h.allDayEvents)), A = b(() => r.cellDates.slice(0, h.horizontal ? r.rows : r.cols).map(({ start: l }) => ({
|
|
1956
1961
|
id: Ge[l.getDay()],
|
|
1957
1962
|
date: l,
|
|
1958
1963
|
dateNumber: l.getDate(),
|
|
@@ -2013,31 +2018,31 @@ const lt = (y, t) => {
|
|
|
2013
2018
|
};
|
|
2014
2019
|
return Re(() => {
|
|
2015
2020
|
L.cleanup();
|
|
2016
|
-
}), (l, E) =>
|
|
2017
|
-
$(r).isDay ?
|
|
2021
|
+
}), (l, E) => v.value ? (V(), P("div", vn, [
|
|
2022
|
+
$(r).isDay ? x("", !0) : (V(), P("div", fn, [
|
|
2018
2023
|
(V(!0), P(de, null, we(A.value, (F, m) => (V(), P("div", {
|
|
2019
2024
|
class: pe(["vuecal__weekday", { "vuecal__weekday--today": F.isToday }]),
|
|
2020
2025
|
key: m,
|
|
2021
2026
|
onClick: (i) => Z.click(F.date)
|
|
2022
2027
|
}, [
|
|
2023
|
-
|
|
2024
|
-
label: F[
|
|
2028
|
+
O(l.$slots, "weekday-heading", {
|
|
2029
|
+
label: F[W.value],
|
|
2025
2030
|
id: F.id,
|
|
2026
2031
|
date: F.date
|
|
2027
2032
|
}, () => [
|
|
2028
|
-
he("span",
|
|
2029
|
-
$(r).isMonth ?
|
|
2033
|
+
he("span", gn, ce(F[W.value]), 1),
|
|
2034
|
+
$(r).isMonth ? x("", !0) : (V(), P("strong", hn, ce(F.dateNumber), 1))
|
|
2030
2035
|
])
|
|
2031
|
-
], 10,
|
|
2036
|
+
], 10, mn))), 128))
|
|
2032
2037
|
])),
|
|
2033
|
-
$(h).schedules ? (V(), P("div",
|
|
2038
|
+
$(h).schedules ? (V(), P("div", yn, [
|
|
2034
2039
|
(V(!0), P(de, null, we(A.value, (F, m) => (V(), P(de, { key: m }, [
|
|
2035
2040
|
(V(!0), P(de, null, we($(h).schedules, (i, S) => (V(), P(de, { key: S }, [
|
|
2036
2041
|
l.$slots["schedule-heading"] ? (V(), P("div", {
|
|
2037
2042
|
key: 0,
|
|
2038
2043
|
class: pe(["vuecal__schedule vuecal__schedule--heading", i.class])
|
|
2039
2044
|
}, [
|
|
2040
|
-
|
|
2045
|
+
O(l.$slots, "schedule-heading", {
|
|
2041
2046
|
schedule: i,
|
|
2042
2047
|
view: $(r)
|
|
2043
2048
|
})
|
|
@@ -2045,11 +2050,11 @@ const lt = (y, t) => {
|
|
|
2045
2050
|
key: 1,
|
|
2046
2051
|
class: pe(["vuecal__schedule vuecal__schedule--heading", i.class]),
|
|
2047
2052
|
innerHTML: i.label
|
|
2048
|
-
}, null, 10,
|
|
2053
|
+
}, null, 10, Dn))
|
|
2049
2054
|
], 64))), 128))
|
|
2050
2055
|
], 64))), 128))
|
|
2051
|
-
])) :
|
|
2052
|
-
$(h).allDayEvents ? (V(), P("div",
|
|
2056
|
+
])) : x("", !0),
|
|
2057
|
+
$(h).allDayEvents ? (V(), P("div", pn, [
|
|
2053
2058
|
(V(!0), P(de, null, we(A.value, (F, m) => (V(), Se(kt, {
|
|
2054
2059
|
class: pe(["vuecal__all-day-cell", { "vuecal__weekday--today": F.isToday }]),
|
|
2055
2060
|
key: m,
|
|
@@ -2060,14 +2065,14 @@ const lt = (y, t) => {
|
|
|
2060
2065
|
}, Ce({ _: 2 }, [
|
|
2061
2066
|
l.$slots["event.all-day"] ? {
|
|
2062
2067
|
name: "event.all-day",
|
|
2063
|
-
fn:
|
|
2064
|
-
|
|
2068
|
+
fn: N((i) => [
|
|
2069
|
+
O(l.$slots, "event.all-day", ie({ ref_for: !0 }, i))
|
|
2065
2070
|
]),
|
|
2066
2071
|
key: "0"
|
|
2067
2072
|
} : {
|
|
2068
2073
|
name: "event",
|
|
2069
|
-
fn:
|
|
2070
|
-
|
|
2074
|
+
fn: N((i) => [
|
|
2075
|
+
O(l.$slots, "event", ie({ ref_for: !0 }, i))
|
|
2071
2076
|
]),
|
|
2072
2077
|
key: "1"
|
|
2073
2078
|
}
|
|
@@ -2077,22 +2082,22 @@ const lt = (y, t) => {
|
|
|
2077
2082
|
onMousedown: E[0] || (E[0] = (...F) => L.handleMouseDown && L.handleMouseDown(...F)),
|
|
2078
2083
|
onTouchstart: E[1] || (E[1] = (...F) => L.handleTouchStart && L.handleTouchStart(...F))
|
|
2079
2084
|
}, null, 32)
|
|
2080
|
-
])) :
|
|
2081
|
-
])) :
|
|
2085
|
+
])) : x("", !0)
|
|
2086
|
+
])) : x("", !0);
|
|
2082
2087
|
}
|
|
2083
|
-
},
|
|
2088
|
+
}, _n = { class: "vuecal__time-column" }, kn = {
|
|
2084
2089
|
key: 0,
|
|
2085
2090
|
class: "vuecal__all-day-label"
|
|
2086
|
-
},
|
|
2091
|
+
}, $n = {
|
|
2087
2092
|
__name: "time-column",
|
|
2088
2093
|
setup(y) {
|
|
2089
2094
|
const t = He("vuecal"), { config: d, texts: r } = t, h = b(() => {
|
|
2090
2095
|
const C = [];
|
|
2091
|
-
for (let
|
|
2092
|
-
const A =
|
|
2096
|
+
for (let v = d.timeFrom; v < d.timeTo; v += d.timeStep) {
|
|
2097
|
+
const A = v + d.timeStep > d.timeTo, Z = ~~(v / 60), L = v % 60, l = r[v < 720 ? "am" : "pm"];
|
|
2093
2098
|
let E = null;
|
|
2094
|
-
A && (E = `calc(var(--vuecal-time-cell-height) * ${(d.timeTo -
|
|
2095
|
-
minutesSum:
|
|
2099
|
+
A && (E = `calc(var(--vuecal-time-cell-height) * ${(d.timeTo - v) / d.timeStep})`), C.push({
|
|
2100
|
+
minutesSum: v,
|
|
2096
2101
|
// The sum of hours + minutes in minutes.
|
|
2097
2102
|
hours: Z,
|
|
2098
2103
|
minutes: L,
|
|
@@ -2103,34 +2108,34 @@ const lt = (y, t) => {
|
|
|
2103
2108
|
}
|
|
2104
2109
|
return C;
|
|
2105
2110
|
});
|
|
2106
|
-
return (C,
|
|
2107
|
-
$(d).allDayEvents ? (V(), P("div",
|
|
2108
|
-
|
|
2111
|
+
return (C, W) => (V(), P("div", _n, [
|
|
2112
|
+
$(d).allDayEvents ? (V(), P("div", kn, [
|
|
2113
|
+
O(C.$slots, "all-day-label", {}, () => [
|
|
2109
2114
|
qe(ce($(t).texts.allDay), 1)
|
|
2110
2115
|
])
|
|
2111
|
-
])) :
|
|
2112
|
-
(V(!0), P(de, null, we(h.value, (
|
|
2116
|
+
])) : x("", !0),
|
|
2117
|
+
(V(!0), P(de, null, we(h.value, (v, A) => (V(), P("div", {
|
|
2113
2118
|
class: "vuecal__time-cell",
|
|
2114
2119
|
key: A,
|
|
2115
|
-
style: $e({ height:
|
|
2120
|
+
style: $e({ height: v.height || null })
|
|
2116
2121
|
}, [
|
|
2117
|
-
|
|
2122
|
+
O(C.$slots, "time-cell", {
|
|
2118
2123
|
index: A,
|
|
2119
|
-
minutes:
|
|
2120
|
-
hours:
|
|
2121
|
-
minutesSum:
|
|
2122
|
-
format12:
|
|
2123
|
-
format24:
|
|
2124
|
+
minutes: v.minutes,
|
|
2125
|
+
hours: v.hours,
|
|
2126
|
+
minutesSum: v.minutesSum,
|
|
2127
|
+
format12: v.formatted12,
|
|
2128
|
+
format24: v.formatted24
|
|
2124
2129
|
}, () => [
|
|
2125
|
-
he("label", null, ce($(d).twelveHour ?
|
|
2130
|
+
he("label", null, ce($(d).twelveHour ? v.formatted12 : v.formatted24), 1)
|
|
2126
2131
|
])
|
|
2127
2132
|
], 4))), 128))
|
|
2128
2133
|
]));
|
|
2129
2134
|
}
|
|
2130
|
-
},
|
|
2135
|
+
}, bn = {
|
|
2131
2136
|
__name: "body",
|
|
2132
2137
|
setup(y) {
|
|
2133
|
-
const t = He("vuecal"), { view: d, config: r, dateUtils: h, touch: C, eventsManager:
|
|
2138
|
+
const t = He("vuecal"), { view: d, config: r, dateUtils: h, touch: C, eventsManager: W } = t, v = ue(null), A = ue(null), { resizeState: Z } = W, L = b(() => ({
|
|
2134
2139
|
"--vuecal-grid-columns": d.cols,
|
|
2135
2140
|
"--vuecal-grid-rows": d.rows,
|
|
2136
2141
|
"--vuecal-body-max-height": r.time ? `${r.timeCellHeight * (r.timeTo - r.timeFrom) / r.timeStep}px` : null
|
|
@@ -2143,105 +2148,112 @@ const lt = (y, t) => {
|
|
|
2143
2148
|
}), E = (i) => {
|
|
2144
2149
|
var z;
|
|
2145
2150
|
if (d.isMonth || d.isYear || d.isYears) return;
|
|
2146
|
-
const S = ((z = i.touches) == null ? void 0 : z[0]) || i, { clientX:
|
|
2147
|
-
A.value = Ke(I - e,
|
|
2151
|
+
const S = ((z = i.touches) == null ? void 0 : z[0]) || i, { clientX: a, clientY: I } = S, { top: e } = v.value.getBoundingClientRect();
|
|
2152
|
+
A.value = Ke(I - e, v.value), C.isResizingEvent && r.editableEvents.resizeX && (Z.cellEl = m(a, I));
|
|
2148
2153
|
}, F = () => {
|
|
2149
2154
|
A.value = null;
|
|
2150
2155
|
}, m = (i, S) => {
|
|
2151
|
-
const
|
|
2152
|
-
return console.log(
|
|
2156
|
+
const a = document.elementFromPoint(i, S);
|
|
2157
|
+
return console.log(a == null ? void 0 : a.closest(".vuecal__cell")), (a == null ? void 0 : a.closest(".vuecal__cell")) || null;
|
|
2153
2158
|
};
|
|
2154
2159
|
return Ze(() => {
|
|
2155
|
-
|
|
2160
|
+
v.value.addEventListener("mousemove", E), v.value.addEventListener("touchmove", E), v.value.addEventListener("mouseleave", F), v.value.addEventListener("touchend", F);
|
|
2156
2161
|
}), Re(() => {
|
|
2157
|
-
|
|
2162
|
+
v.value && (v.value.removeEventListener("mousemove", E), v.value.removeEventListener("touchmove", E), v.value.removeEventListener("mouseleave", F), v.value.removeEventListener("touchend", F));
|
|
2158
2163
|
}), (i, S) => (V(), P("div", {
|
|
2159
2164
|
class: "vuecal__body",
|
|
2160
2165
|
ref_key: "bodyEl",
|
|
2161
|
-
ref:
|
|
2166
|
+
ref: v,
|
|
2162
2167
|
style: $e(L.value)
|
|
2163
2168
|
}, [
|
|
2164
2169
|
Oe(Ue, { name: "vuecal-shrink" }, {
|
|
2165
|
-
default:
|
|
2170
|
+
default: N(() => [
|
|
2166
2171
|
$(r).timeAtCursor && A.value !== null ? (V(), P("div", {
|
|
2167
2172
|
key: 0,
|
|
2168
2173
|
class: "vuecal__time-at-cursor",
|
|
2169
2174
|
style: $e(l.value.style)
|
|
2170
2175
|
}, [
|
|
2171
2176
|
he("label", null, ce(l.value.time), 1)
|
|
2172
|
-
], 4)) :
|
|
2177
|
+
], 4)) : x("", !0)
|
|
2173
2178
|
]),
|
|
2174
2179
|
_: 1
|
|
2175
2180
|
}),
|
|
2176
|
-
(V(!0), P(de, null, we($(d).cellDates, (
|
|
2181
|
+
(V(!0), P(de, null, we($(d).cellDates, (a, I) => (V(), Se(kt, {
|
|
2177
2182
|
key: I,
|
|
2178
|
-
start:
|
|
2179
|
-
end:
|
|
2183
|
+
start: a.start,
|
|
2184
|
+
end: a.end,
|
|
2180
2185
|
index: I
|
|
2181
2186
|
}, Ce({ _: 2 }, [
|
|
2182
2187
|
i.$slots.cell ? {
|
|
2183
2188
|
name: "cell",
|
|
2184
|
-
fn:
|
|
2185
|
-
|
|
2189
|
+
fn: N((e) => [
|
|
2190
|
+
O(i.$slots, "cell", ie({ ref_for: !0 }, e))
|
|
2186
2191
|
]),
|
|
2187
2192
|
key: "0"
|
|
2188
2193
|
} : void 0,
|
|
2189
2194
|
i.$slots["cell-date"] ? {
|
|
2190
2195
|
name: "cell-date",
|
|
2191
|
-
fn:
|
|
2192
|
-
|
|
2196
|
+
fn: N((e) => [
|
|
2197
|
+
O(i.$slots, "cell-date", ie({ ref_for: !0 }, e))
|
|
2193
2198
|
]),
|
|
2194
2199
|
key: "1"
|
|
2195
2200
|
} : void 0,
|
|
2196
2201
|
i.$slots["cell-content"] ? {
|
|
2197
2202
|
name: "cell-content",
|
|
2198
|
-
fn:
|
|
2199
|
-
|
|
2203
|
+
fn: N((e) => [
|
|
2204
|
+
O(i.$slots, "cell-content", ie({ ref_for: !0 }, e))
|
|
2200
2205
|
]),
|
|
2201
2206
|
key: "2"
|
|
2202
2207
|
} : void 0,
|
|
2203
2208
|
i.$slots["cell-events"] ? {
|
|
2204
2209
|
name: "cell-events",
|
|
2205
|
-
fn:
|
|
2206
|
-
|
|
2210
|
+
fn: N((e) => [
|
|
2211
|
+
O(i.$slots, "cell-events", ie({ ref_for: !0 }, e))
|
|
2207
2212
|
]),
|
|
2208
2213
|
key: "3"
|
|
2209
2214
|
} : void 0,
|
|
2210
2215
|
i.$slots[`event.${$(d).id}`] ? {
|
|
2211
2216
|
name: `event.${$(d).id}`,
|
|
2212
|
-
fn:
|
|
2213
|
-
|
|
2217
|
+
fn: N((e) => [
|
|
2218
|
+
O(i.$slots, `event.${$(d).id}`, ie({ ref_for: !0 }, e))
|
|
2214
2219
|
]),
|
|
2215
2220
|
key: "4"
|
|
2216
2221
|
} : void 0,
|
|
2217
2222
|
i.$slots["event.all-day"] ? {
|
|
2218
2223
|
name: "event.all-day",
|
|
2219
|
-
fn:
|
|
2220
|
-
|
|
2224
|
+
fn: N((e) => [
|
|
2225
|
+
O(i.$slots, "event.all-day", ie({ ref_for: !0 }, e))
|
|
2221
2226
|
]),
|
|
2222
2227
|
key: "5"
|
|
2223
2228
|
} : void 0,
|
|
2224
2229
|
i.$slots.event ? {
|
|
2225
2230
|
name: "event",
|
|
2226
|
-
fn:
|
|
2227
|
-
|
|
2231
|
+
fn: N((e) => [
|
|
2232
|
+
O(i.$slots, "event", ie({ ref_for: !0 }, e))
|
|
2228
2233
|
]),
|
|
2229
2234
|
key: "6"
|
|
2230
2235
|
} : void 0,
|
|
2231
2236
|
i.$slots["event-count"] ? {
|
|
2232
2237
|
name: "event-count",
|
|
2233
|
-
fn:
|
|
2234
|
-
|
|
2238
|
+
fn: N((e) => [
|
|
2239
|
+
O(i.$slots, "event-count", ie({ ref_for: !0 }, e))
|
|
2235
2240
|
]),
|
|
2236
2241
|
key: "7"
|
|
2242
|
+
} : void 0,
|
|
2243
|
+
i.$slots["now-line"] ? {
|
|
2244
|
+
name: "now-line",
|
|
2245
|
+
fn: N((e) => [
|
|
2246
|
+
O(i.$slots, "now-line", ie({ ref_for: !0 }, e))
|
|
2247
|
+
]),
|
|
2248
|
+
key: "8"
|
|
2237
2249
|
} : void 0
|
|
2238
2250
|
]), 1032, ["start", "end", "index"]))), 128))
|
|
2239
2251
|
], 4));
|
|
2240
2252
|
}
|
|
2241
|
-
},
|
|
2253
|
+
}, Tn = ["data-locale"], Mn = { class: "vuecal__scrollable-wrap" }, En = {
|
|
2242
2254
|
key: 1,
|
|
2243
2255
|
class: "vuecal__week-numbers"
|
|
2244
|
-
},
|
|
2256
|
+
}, Yn = { class: "vuecal__week-number" }, Sn = { class: "vuecal__body-wrap" }, zn = {
|
|
2245
2257
|
__name: "index",
|
|
2246
2258
|
props: Lt,
|
|
2247
2259
|
emits: [
|
|
@@ -2258,253 +2270,260 @@ const lt = (y, t) => {
|
|
|
2258
2270
|
"event-drag-end"
|
|
2259
2271
|
],
|
|
2260
2272
|
setup(y, { expose: t, emit: d }) {
|
|
2261
|
-
const r = y, h = d, C = Tt("vuecal-el"),
|
|
2262
|
-
var
|
|
2273
|
+
const r = y, h = d, C = Tt("vuecal-el"), W = Ht({ props: r, emit: h, attrs: Et(), vuecalEl: C, uid: Mt() }), { config: v, view: A, dateUtils: Z, touch: L } = W, l = b(() => v.time && (A.isDay || A.isDays || A.isWeek)), E = b(() => Array(A.rows).fill().map((a, I) => Z.getWeek(Z.addDays(A.firstCellDate, 7 * I)))), F = b(() => {
|
|
2274
|
+
var a;
|
|
2263
2275
|
return {
|
|
2264
|
-
"vuecal--ready":
|
|
2265
|
-
[`vuecal--${
|
|
2266
|
-
[`vuecal--${
|
|
2267
|
-
"vuecal--date-picker":
|
|
2268
|
-
"vuecal--dark":
|
|
2269
|
-
"vuecal--light": !
|
|
2276
|
+
"vuecal--ready": v.ready,
|
|
2277
|
+
[`vuecal--${v.theme}-theme`]: v.theme,
|
|
2278
|
+
[`vuecal--${v.size}`]: !0,
|
|
2279
|
+
"vuecal--date-picker": v.datePicker,
|
|
2280
|
+
"vuecal--dark": v.dark,
|
|
2281
|
+
"vuecal--light": !v.dark,
|
|
2270
2282
|
[`vuecal--${A.id}-view`]: !0,
|
|
2271
2283
|
"vuecal--view-has-time": l.value,
|
|
2272
|
-
"vuecal--timeless": !
|
|
2284
|
+
"vuecal--timeless": !v.time,
|
|
2273
2285
|
"vuecal--dragging-cell": L.isDraggingCell,
|
|
2274
2286
|
"vuecal--dragging-event": L.isDraggingEvent,
|
|
2275
2287
|
"vuecal--resizing-event": L.isResizingEvent,
|
|
2276
|
-
"vuecal--has-schedules": (
|
|
2277
|
-
"vuecal--horizontal":
|
|
2288
|
+
"vuecal--has-schedules": (a = v.schedules) == null ? void 0 : a.length,
|
|
2289
|
+
"vuecal--horizontal": v.horizontal
|
|
2278
2290
|
};
|
|
2279
2291
|
}), m = b(() => ({
|
|
2280
|
-
"--vuecal-time-cell-height":
|
|
2292
|
+
"--vuecal-time-cell-height": v.timeCellHeight && `${v.timeCellHeight}px`
|
|
2281
2293
|
})), i = b(() => {
|
|
2282
|
-
var
|
|
2294
|
+
var a, I;
|
|
2283
2295
|
return {
|
|
2284
|
-
"vuecal__scrollable--row": l.value ||
|
|
2296
|
+
"vuecal__scrollable--row": l.value || v.weekNumbers && A.isMonth,
|
|
2285
2297
|
// Keep the states inside the Vue transition wrapper for smooth CSS transitions.
|
|
2286
2298
|
[`vuecal__scrollable--${A.id}-view`]: !0,
|
|
2287
|
-
"vuecal__scrollable--has-schedules": (
|
|
2288
|
-
"vuecal__scrollable--no-schedules": !((I =
|
|
2289
|
-
"vuecal__scrollable--no-all-day-bar": !
|
|
2290
|
-
"vuecal__scrollable--has-all-day-bar":
|
|
2299
|
+
"vuecal__scrollable--has-schedules": (a = v.schedules) == null ? void 0 : a.length,
|
|
2300
|
+
"vuecal__scrollable--no-schedules": !((I = v.schedules) != null && I.length),
|
|
2301
|
+
"vuecal__scrollable--no-all-day-bar": !v.allDayEvents,
|
|
2302
|
+
"vuecal__scrollable--has-all-day-bar": v.allDayEvents
|
|
2291
2303
|
};
|
|
2292
|
-
}), S = (
|
|
2293
|
-
|
|
2304
|
+
}), S = (a) => {
|
|
2305
|
+
a.target.closest(".vuecal__cell") && a.preventDefault();
|
|
2294
2306
|
};
|
|
2295
2307
|
return Ze(async () => {
|
|
2296
|
-
typeof window < "u" && window.hasOwnProperty("ontouchstart") && C.value.addEventListener("contextmenu", S), await Xe(),
|
|
2308
|
+
typeof window < "u" && window.hasOwnProperty("ontouchstart") && C.value.addEventListener("contextmenu", S), await Xe(), v.ready = !0, h("ready", { config: v, view: A });
|
|
2297
2309
|
}), Re(() => {
|
|
2298
|
-
var
|
|
2299
|
-
(
|
|
2300
|
-
}),
|
|
2310
|
+
var a;
|
|
2311
|
+
(a = C == null ? void 0 : C.value) == null || a.removeEventListener("contextmenu", S);
|
|
2312
|
+
}), nt("vuecal", W), nt("$vuecalEl", C), t({ view: W.view }), (a, I) => (V(), P("div", {
|
|
2301
2313
|
class: pe(["vuecal", F.value]),
|
|
2302
2314
|
ref: "vuecal-el",
|
|
2303
|
-
"data-locale":
|
|
2315
|
+
"data-locale": a.locale,
|
|
2304
2316
|
style: $e(m.value)
|
|
2305
2317
|
}, [
|
|
2306
|
-
|
|
2318
|
+
a.$slots.diy ? O(a.$slots, "diy", {
|
|
2307
2319
|
key: 0,
|
|
2308
|
-
vuecal: $(
|
|
2320
|
+
vuecal: $(W)
|
|
2309
2321
|
}) : (V(), P(de, { key: 1 }, [
|
|
2310
2322
|
Oe(Xt, null, Ce({ _: 2 }, [
|
|
2311
|
-
|
|
2323
|
+
a.$slots.header ? {
|
|
2312
2324
|
name: "header",
|
|
2313
|
-
fn:
|
|
2314
|
-
|
|
2325
|
+
fn: N((e) => [
|
|
2326
|
+
O(a.$slots, "header", ne(le(e)))
|
|
2315
2327
|
]),
|
|
2316
2328
|
key: "0"
|
|
2317
2329
|
} : void 0,
|
|
2318
|
-
!
|
|
2330
|
+
!a.$slots.header && a.$slots["previous-button"] ? {
|
|
2319
2331
|
name: "previous-button",
|
|
2320
|
-
fn:
|
|
2321
|
-
|
|
2332
|
+
fn: N((e) => [
|
|
2333
|
+
O(a.$slots, "previous-button", ne(le(e)))
|
|
2322
2334
|
]),
|
|
2323
2335
|
key: "1"
|
|
2324
2336
|
} : void 0,
|
|
2325
|
-
!
|
|
2337
|
+
!a.$slots.header && a.$slots["next-button"] ? {
|
|
2326
2338
|
name: "next-button",
|
|
2327
|
-
fn:
|
|
2328
|
-
|
|
2339
|
+
fn: N((e) => [
|
|
2340
|
+
O(a.$slots, "next-button", ne(le(e)))
|
|
2329
2341
|
]),
|
|
2330
2342
|
key: "2"
|
|
2331
2343
|
} : void 0,
|
|
2332
|
-
!
|
|
2344
|
+
!a.$slots.header && a.$slots["today-button"] ? {
|
|
2333
2345
|
name: "today-button",
|
|
2334
|
-
fn:
|
|
2335
|
-
|
|
2346
|
+
fn: N((e) => [
|
|
2347
|
+
O(a.$slots, "today-button", ne(le(e)))
|
|
2336
2348
|
]),
|
|
2337
2349
|
key: "3"
|
|
2338
2350
|
} : void 0,
|
|
2339
|
-
!
|
|
2351
|
+
!a.$slots.header && a.$slots.title ? {
|
|
2340
2352
|
name: "title",
|
|
2341
|
-
fn:
|
|
2342
|
-
|
|
2353
|
+
fn: N((e) => [
|
|
2354
|
+
O(a.$slots, "title", ne(le(e)))
|
|
2343
2355
|
]),
|
|
2344
2356
|
key: "4"
|
|
2345
2357
|
} : void 0,
|
|
2346
|
-
!
|
|
2358
|
+
!a.$slots.header && a.$slots["title.day"] ? {
|
|
2347
2359
|
name: "title.day",
|
|
2348
|
-
fn:
|
|
2349
|
-
|
|
2360
|
+
fn: N((e) => [
|
|
2361
|
+
O(a.$slots, "title.day", ne(le(e)))
|
|
2350
2362
|
]),
|
|
2351
2363
|
key: "5"
|
|
2352
2364
|
} : void 0,
|
|
2353
|
-
!
|
|
2365
|
+
!a.$slots.header && a.$slots["title.days"] ? {
|
|
2354
2366
|
name: "title.days",
|
|
2355
|
-
fn:
|
|
2356
|
-
|
|
2367
|
+
fn: N((e) => [
|
|
2368
|
+
O(a.$slots, "title.days", ne(le(e)))
|
|
2357
2369
|
]),
|
|
2358
2370
|
key: "6"
|
|
2359
2371
|
} : void 0,
|
|
2360
|
-
!
|
|
2372
|
+
!a.$slots.header && a.$slots["title.week"] ? {
|
|
2361
2373
|
name: "title.week",
|
|
2362
|
-
fn:
|
|
2363
|
-
|
|
2374
|
+
fn: N((e) => [
|
|
2375
|
+
O(a.$slots, "title.week", ne(le(e)))
|
|
2364
2376
|
]),
|
|
2365
2377
|
key: "7"
|
|
2366
2378
|
} : void 0,
|
|
2367
|
-
!
|
|
2379
|
+
!a.$slots.header && a.$slots["title.month"] ? {
|
|
2368
2380
|
name: "title.month",
|
|
2369
|
-
fn:
|
|
2370
|
-
|
|
2381
|
+
fn: N((e) => [
|
|
2382
|
+
O(a.$slots, "title.month", ne(le(e)))
|
|
2371
2383
|
]),
|
|
2372
2384
|
key: "8"
|
|
2373
2385
|
} : void 0,
|
|
2374
|
-
!
|
|
2386
|
+
!a.$slots.header && a.$slots["title.year"] ? {
|
|
2375
2387
|
name: "title.year",
|
|
2376
|
-
fn:
|
|
2377
|
-
|
|
2388
|
+
fn: N((e) => [
|
|
2389
|
+
O(a.$slots, "title.year", ne(le(e)))
|
|
2378
2390
|
]),
|
|
2379
2391
|
key: "9"
|
|
2380
2392
|
} : void 0,
|
|
2381
|
-
!
|
|
2393
|
+
!a.$slots.header && a.$slots["title.years"] ? {
|
|
2382
2394
|
name: "title.years",
|
|
2383
|
-
fn:
|
|
2384
|
-
|
|
2395
|
+
fn: N((e) => [
|
|
2396
|
+
O(a.$slots, "title.years", ne(le(e)))
|
|
2385
2397
|
]),
|
|
2386
2398
|
key: "10"
|
|
2387
2399
|
} : void 0,
|
|
2388
|
-
!
|
|
2400
|
+
!a.$slots.header && a.$slots["schedule-heading"] ? {
|
|
2389
2401
|
name: "schedule-heading",
|
|
2390
|
-
fn:
|
|
2391
|
-
|
|
2402
|
+
fn: N((e) => [
|
|
2403
|
+
O(a.$slots, "schedule-heading", ne(le(e)))
|
|
2392
2404
|
]),
|
|
2393
2405
|
key: "11"
|
|
2394
2406
|
} : void 0
|
|
2395
2407
|
]), 1024),
|
|
2396
|
-
he("div",
|
|
2408
|
+
he("div", Mn, [
|
|
2397
2409
|
Oe(Ue, {
|
|
2398
2410
|
name: `vuecal-slide-fade--${$(A).transitionDirection}`
|
|
2399
2411
|
}, {
|
|
2400
|
-
default:
|
|
2412
|
+
default: N(() => [
|
|
2401
2413
|
(V(), P("div", {
|
|
2402
2414
|
class: pe(["vuecal__scrollable", i.value]),
|
|
2403
2415
|
key: $(A).id + $(A).start.getTime()
|
|
2404
2416
|
}, [
|
|
2405
|
-
l.value ? (V(), Se(
|
|
2406
|
-
|
|
2417
|
+
l.value ? (V(), Se($n, { key: 0 }, Ce({ _: 2 }, [
|
|
2418
|
+
a.$slots["time-cell"] ? {
|
|
2407
2419
|
name: "time-cell",
|
|
2408
|
-
fn:
|
|
2409
|
-
|
|
2420
|
+
fn: N((e) => [
|
|
2421
|
+
O(a.$slots, "time-cell", ne(le(e)))
|
|
2410
2422
|
]),
|
|
2411
2423
|
key: "0"
|
|
2412
2424
|
} : void 0
|
|
2413
|
-
]), 1024)) :
|
|
2414
|
-
$(
|
|
2415
|
-
(V(!0), P(de, null, we(E.value, (e) => (V(), P("div",
|
|
2416
|
-
|
|
2425
|
+
]), 1024)) : x("", !0),
|
|
2426
|
+
$(v).weekNumbers && $(A).isMonth ? (V(), P("div", En, [
|
|
2427
|
+
(V(!0), P(de, null, we(E.value, (e) => (V(), P("div", Yn, [
|
|
2428
|
+
O(a.$slots, "week-number", {}, () => [
|
|
2417
2429
|
he("small", null, ce(e), 1)
|
|
2418
2430
|
])
|
|
2419
2431
|
]))), 256))
|
|
2420
|
-
])) :
|
|
2421
|
-
he("div",
|
|
2422
|
-
Oe(
|
|
2423
|
-
|
|
2432
|
+
])) : x("", !0),
|
|
2433
|
+
he("div", Sn, [
|
|
2434
|
+
Oe(wn, null, Ce({ _: 2 }, [
|
|
2435
|
+
a.$slots["weekday-heading"] ? {
|
|
2424
2436
|
name: "weekday-heading",
|
|
2425
|
-
fn:
|
|
2426
|
-
|
|
2437
|
+
fn: N((e) => [
|
|
2438
|
+
O(a.$slots, "weekday-heading", ne(le(e)))
|
|
2427
2439
|
]),
|
|
2428
2440
|
key: "0"
|
|
2429
2441
|
} : void 0,
|
|
2430
|
-
|
|
2442
|
+
a.$slots["schedule-heading"] ? {
|
|
2431
2443
|
name: "schedule-heading",
|
|
2432
|
-
fn:
|
|
2433
|
-
|
|
2444
|
+
fn: N((e) => [
|
|
2445
|
+
O(a.$slots, "schedule-heading", ne(le(e)))
|
|
2434
2446
|
]),
|
|
2435
2447
|
key: "1"
|
|
2436
2448
|
} : void 0,
|
|
2437
|
-
|
|
2449
|
+
a.$slots["event.all-day"] ? {
|
|
2438
2450
|
name: "event.all-day",
|
|
2439
|
-
fn:
|
|
2440
|
-
|
|
2451
|
+
fn: N((e) => [
|
|
2452
|
+
O(a.$slots, "event.all-day", ne(le(e)))
|
|
2441
2453
|
]),
|
|
2442
2454
|
key: "2"
|
|
2443
2455
|
} : void 0,
|
|
2444
|
-
|
|
2456
|
+
a.$slots.event ? {
|
|
2445
2457
|
name: "event",
|
|
2446
|
-
fn:
|
|
2447
|
-
|
|
2458
|
+
fn: N((e) => [
|
|
2459
|
+
O(a.$slots, "event", ne(le(e)))
|
|
2448
2460
|
]),
|
|
2449
2461
|
key: "3"
|
|
2450
2462
|
} : void 0
|
|
2451
2463
|
]), 1024),
|
|
2452
|
-
Oe(
|
|
2453
|
-
|
|
2464
|
+
Oe(bn, null, Ce({ _: 2 }, [
|
|
2465
|
+
a.$slots.cell ? {
|
|
2454
2466
|
name: "cell",
|
|
2455
|
-
fn:
|
|
2456
|
-
|
|
2467
|
+
fn: N((e) => [
|
|
2468
|
+
O(a.$slots, "cell", ne(le(e)))
|
|
2457
2469
|
]),
|
|
2458
2470
|
key: "0"
|
|
2459
2471
|
} : void 0,
|
|
2460
|
-
!
|
|
2472
|
+
!a.$slots.cell && a.$slots["cell-date"] ? {
|
|
2461
2473
|
name: "cell-date",
|
|
2462
|
-
fn:
|
|
2463
|
-
|
|
2474
|
+
fn: N((e) => [
|
|
2475
|
+
O(a.$slots, "cell-date", ne(le(e)))
|
|
2464
2476
|
]),
|
|
2465
2477
|
key: "1"
|
|
2466
2478
|
} : void 0,
|
|
2467
|
-
!
|
|
2479
|
+
!a.$slots.cell && a.$slots["cell-content"] ? {
|
|
2468
2480
|
name: "cell-content",
|
|
2469
|
-
fn:
|
|
2470
|
-
|
|
2481
|
+
fn: N((e) => [
|
|
2482
|
+
O(a.$slots, "cell-content", ne(le(e)))
|
|
2471
2483
|
]),
|
|
2472
2484
|
key: "2"
|
|
2473
2485
|
} : void 0,
|
|
2474
|
-
!
|
|
2486
|
+
!a.$slots.cell && a.$slots["cell-events"] ? {
|
|
2475
2487
|
name: "cell-events",
|
|
2476
|
-
fn:
|
|
2477
|
-
|
|
2488
|
+
fn: N((e) => [
|
|
2489
|
+
O(a.$slots, "cell-events", ne(le(e)))
|
|
2478
2490
|
]),
|
|
2479
2491
|
key: "3"
|
|
2480
2492
|
} : void 0,
|
|
2481
|
-
!
|
|
2493
|
+
!a.$slots.cell && !a.$slots["cell-events"] && a.$slots["event.all-day"] ? {
|
|
2482
2494
|
name: "event.all-day",
|
|
2483
|
-
fn:
|
|
2484
|
-
|
|
2495
|
+
fn: N((e) => [
|
|
2496
|
+
O(a.$slots, "event.all-day", ne(le(e)))
|
|
2485
2497
|
]),
|
|
2486
2498
|
key: "4"
|
|
2487
2499
|
} : void 0,
|
|
2488
|
-
!
|
|
2500
|
+
!a.$slots.cell && !a.$slots["cell-events"] && a.$slots[`event.${$(A).id}`] ? {
|
|
2489
2501
|
name: `event.${$(A).id}`,
|
|
2490
|
-
fn:
|
|
2491
|
-
|
|
2502
|
+
fn: N((e) => [
|
|
2503
|
+
O(a.$slots, `event.${$(A).id}`, ne(le(e)))
|
|
2492
2504
|
]),
|
|
2493
2505
|
key: "5"
|
|
2494
2506
|
} : void 0,
|
|
2495
|
-
!
|
|
2507
|
+
!a.$slots.cell && !a.$slots["cell-events"] && a.$slots.event ? {
|
|
2496
2508
|
name: "event",
|
|
2497
|
-
fn:
|
|
2498
|
-
|
|
2509
|
+
fn: N((e) => [
|
|
2510
|
+
O(a.$slots, "event", ne(le(e)))
|
|
2499
2511
|
]),
|
|
2500
2512
|
key: "6"
|
|
2501
2513
|
} : void 0,
|
|
2502
|
-
!
|
|
2514
|
+
!a.$slots.cell && a.$slots["event-count"] ? {
|
|
2503
2515
|
name: "event-count",
|
|
2504
|
-
fn:
|
|
2505
|
-
|
|
2516
|
+
fn: N((e) => [
|
|
2517
|
+
O(a.$slots, "event-count", ne(le(e)))
|
|
2506
2518
|
]),
|
|
2507
2519
|
key: "7"
|
|
2520
|
+
} : void 0,
|
|
2521
|
+
a.$slots["now-line"] ? {
|
|
2522
|
+
name: "now-line",
|
|
2523
|
+
fn: N((e) => [
|
|
2524
|
+
O(a.$slots, "now-line", ne(le(e)))
|
|
2525
|
+
]),
|
|
2526
|
+
key: "8"
|
|
2508
2527
|
} : void 0
|
|
2509
2528
|
]), 1024)
|
|
2510
2529
|
])
|
|
@@ -2514,63 +2533,63 @@ const lt = (y, t) => {
|
|
|
2514
2533
|
}, 8, ["name"])
|
|
2515
2534
|
])
|
|
2516
2535
|
], 64))
|
|
2517
|
-
], 14,
|
|
2536
|
+
], 14, Tn));
|
|
2518
2537
|
}
|
|
2519
|
-
},
|
|
2538
|
+
}, Vn = (y) => {
|
|
2520
2539
|
Fe.texts = { ...fe.texts, ...y }, Fe.dateUtils.updateTexts(Fe.texts);
|
|
2521
2540
|
}, {
|
|
2522
|
-
addDatePrototypes:
|
|
2523
|
-
removeDatePrototypes:
|
|
2524
|
-
updateTexts:
|
|
2525
|
-
addDays:
|
|
2526
|
-
subtractDays:
|
|
2527
|
-
addHours:
|
|
2528
|
-
subtractHours:
|
|
2529
|
-
addMinutes:
|
|
2530
|
-
subtractMinutes:
|
|
2531
|
-
getWeek:
|
|
2532
|
-
isToday:
|
|
2533
|
-
isSameDate:
|
|
2534
|
-
isInRange:
|
|
2535
|
-
isLeapYear:
|
|
2536
|
-
getPreviousFirstDayOfWeek:
|
|
2537
|
-
stringToDate:
|
|
2538
|
-
dateToMinutes:
|
|
2539
|
-
countDays:
|
|
2540
|
-
datesInSameTimeStep:
|
|
2541
|
-
isValid:
|
|
2542
|
-
formatDate:
|
|
2543
|
-
formatDateLite:
|
|
2544
|
-
formatTime:
|
|
2545
|
-
formatTimeLite:
|
|
2546
|
-
formatMinutes:
|
|
2541
|
+
addDatePrototypes: On,
|
|
2542
|
+
removeDatePrototypes: jn,
|
|
2543
|
+
updateTexts: Hn,
|
|
2544
|
+
addDays: Pn,
|
|
2545
|
+
subtractDays: Ln,
|
|
2546
|
+
addHours: An,
|
|
2547
|
+
subtractHours: Fn,
|
|
2548
|
+
addMinutes: Rn,
|
|
2549
|
+
subtractMinutes: Nn,
|
|
2550
|
+
getWeek: Bn,
|
|
2551
|
+
isToday: Wn,
|
|
2552
|
+
isSameDate: Xn,
|
|
2553
|
+
isInRange: In,
|
|
2554
|
+
isLeapYear: qn,
|
|
2555
|
+
getPreviousFirstDayOfWeek: Gn,
|
|
2556
|
+
stringToDate: Un,
|
|
2557
|
+
dateToMinutes: Jn,
|
|
2558
|
+
countDays: Zn,
|
|
2559
|
+
datesInSameTimeStep: Kn,
|
|
2560
|
+
isValid: Qn,
|
|
2561
|
+
formatDate: xn,
|
|
2562
|
+
formatDateLite: ea,
|
|
2563
|
+
formatTime: ta,
|
|
2564
|
+
formatTimeLite: na,
|
|
2565
|
+
formatMinutes: aa
|
|
2547
2566
|
} = Fe.dateUtils;
|
|
2548
2567
|
export {
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2568
|
+
zn as VueCal,
|
|
2569
|
+
On as addDatePrototypes,
|
|
2570
|
+
Pn as addDays,
|
|
2571
|
+
An as addHours,
|
|
2572
|
+
Rn as addMinutes,
|
|
2573
|
+
Zn as countDays,
|
|
2574
|
+
Jn as dateToMinutes,
|
|
2575
|
+
Kn as datesInSameTimeStep,
|
|
2576
|
+
xn as formatDate,
|
|
2577
|
+
ea as formatDateLite,
|
|
2578
|
+
aa as formatMinutes,
|
|
2579
|
+
ta as formatTime,
|
|
2580
|
+
na as formatTimeLite,
|
|
2581
|
+
Gn as getPreviousFirstDayOfWeek,
|
|
2582
|
+
Bn as getWeek,
|
|
2583
|
+
In as isInRange,
|
|
2584
|
+
qn as isLeapYear,
|
|
2585
|
+
Xn as isSameDate,
|
|
2586
|
+
Wn as isToday,
|
|
2587
|
+
Qn as isValidDate,
|
|
2588
|
+
jn as removeDatePrototypes,
|
|
2589
|
+
Un as stringToDate,
|
|
2590
|
+
Ln as subtractDays,
|
|
2591
|
+
Fn as subtractHours,
|
|
2592
|
+
Nn as subtractMinutes,
|
|
2593
|
+
Hn as updateTexts,
|
|
2594
|
+
Vn as useLocale
|
|
2576
2595
|
};
|