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