vue-cal 5.0.1-rc.3 → 5.0.1-rc.5
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 +920 -906
- package/dist/vue-cal.umd.js +3 -3
- package/package.json +7 -3
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.5
|
|
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
|
-
}),
|
|
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
|
+
}), G = 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
|
-
defaultView:
|
|
123
|
-
availableViews:
|
|
122
|
+
defaultView: G,
|
|
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,117 +139,117 @@ 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
|
-
return
|
|
252
|
+
return G(this, a || 0);
|
|
253
253
|
}, Date.prototype.subtractHours = function(a) {
|
|
254
254
|
return u(this, a || 0);
|
|
255
255
|
}, Date.prototype.addMinutes = 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
|
|
278
|
-
},
|
|
279
|
-
const
|
|
280
|
-
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
|
+
}, G = (a, p) => {
|
|
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 = (q) => {
|
|
292
|
+
const J = q % p;
|
|
293
|
+
return J !== 0 && (q += J >= p / 2 ? p - J : -J), q;
|
|
294
294
|
};
|
|
295
|
-
if (typeof a == "number") return
|
|
295
|
+
if (typeof a == "number") return y(a);
|
|
296
296
|
if (a instanceof Date) {
|
|
297
|
-
let
|
|
298
|
-
|
|
297
|
+
let q = y(a.getMinutes());
|
|
298
|
+
q >= 60 && (a.setHours(a.getHours() + 1), q = 0), a.setMinutes(q, 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())), q = y.getUTCDay() || 7;
|
|
302
|
+
y.setUTCDate(y.getUTCDate() + 4 - q);
|
|
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(), q = p ? 7 : 6;
|
|
316
|
+
return y.setDate(y.getDate() - (y.getDay() + q) % 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
|
-
const
|
|
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: () =>
|
|
324
|
+
const q = {
|
|
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 =
|
|
351
|
-
return r !== void 0 ? r() :
|
|
349
|
+
return p.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (J, ce) => {
|
|
350
|
+
const r = q[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
|
|
358
|
-
if (
|
|
359
|
-
const [
|
|
360
|
-
|
|
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, q = !1) => {
|
|
357
|
+
let J = !1;
|
|
358
|
+
if (q) {
|
|
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,32 +384,32 @@ 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(), q = 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
|
-
M:
|
|
397
|
+
M: q,
|
|
398
398
|
// 1 to 12.
|
|
399
|
-
MM: () =>
|
|
399
|
+
MM: () => q.toString().padStart(2, 0),
|
|
400
400
|
// 01 to 12.
|
|
401
|
-
MMM: () => p.months[
|
|
401
|
+
MMM: () => p.months[q - 1].substring(0, 3),
|
|
402
402
|
// Jan to Dec.
|
|
403
|
-
MMMM: () => p.months[
|
|
403
|
+
MMMM: () => p.months[q - 1],
|
|
404
404
|
// January to December.
|
|
405
|
-
MMMMG: () => (p.monthsGenitive || p.months)[
|
|
405
|
+
MMMMG: () => (p.monthsGenitive || p.months)[q - 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, q, J;
|
|
428
|
+
a instanceof Date ? (y = a.getHours(), q = a.getMinutes(), J = a.getSeconds()) : (y = Math.floor(a / 60), q = 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
|
-
m:
|
|
438
|
-
mm:
|
|
439
|
-
s:
|
|
437
|
+
m: q,
|
|
438
|
+
mm: q.toString().padStart(2, 0),
|
|
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:
|
|
448
|
-
addHours:
|
|
447
|
+
subtractDays: N,
|
|
448
|
+
addHours: G,
|
|
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
|
|
585
|
-
},
|
|
586
|
-
const v = u.allDay || !i.time,
|
|
587
|
-
return E >
|
|
583
|
+
!E.has((B = l._) == null ? void 0 : B.id) && (h === null || h === l.schedule) && G(l, d, e) && L.push(l);
|
|
584
|
+
return L;
|
|
585
|
+
}, G = (u, d, 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
|
-
isEventInRange:
|
|
598
|
+
isEventInRange: G
|
|
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
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
return
|
|
611
|
-
} else if (
|
|
605
|
+
const b = ie(new Date(f));
|
|
606
|
+
let N = null;
|
|
607
|
+
const G = 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 : G.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 X = 0; X < l.value + R; X++)
|
|
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, X), 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(), X, 1, 0, 0, 0, 0),
|
|
663
|
+
end: new Date(n.value.getFullYear(), X + 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() + X, 0, 1, 0, 0, 0, 0),
|
|
669
|
+
end: new Date(n.value.getFullYear() + X + 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 X = H[g];
|
|
684
|
+
return R && typeof X == "string" ? X.substring(0, 3) : X;
|
|
685
|
+
}
|
|
686
|
+
function oe(g, H, R) {
|
|
687
|
+
const { monthsArray: X, 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, X, _e)} ${Le}, ${Ee} - ${K(Ye, X, _e)} ${ze}, ${He}` : `${Le} ${K(Me, X, _e)} ${Ee} - ${ze} ${K(Ye, X, _e)} ${He}` : Be ? ve ? `${K(Me, X, _e)} ${Le} - ${K(Ye, X, _e)} ${ze}, ${Ee}` : `${Le} ${K(Me, X, _e)} - ${ze} ${K(Ye, X, _e)} ${Ee}` : ve ? `${K(Me, X, _e)} ${Le}-${ze}, ${Ee}` : `${Le}-${ze} ${K(Me, X, _e)} ${Ee}`;
|
|
689
|
+
}
|
|
690
|
+
const ae = T(() => {
|
|
691
|
+
const { dateFormat: g, months: H, monthsGenitive: R, week: X, 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>${X} ${Be}</small>`;
|
|
710
|
+
}
|
|
711
|
+
return He;
|
|
699
712
|
}
|
|
700
713
|
case "month": {
|
|
701
|
-
const
|
|
702
|
-
return s.formatDate(
|
|
714
|
+
const Ye = `${c.xs && Ce ? "MMM" : "MMMM"} YYYY`;
|
|
715
|
+
return s.formatDate(G.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,115 +740,116 @@ const Ke = (c) => {
|
|
|
727
740
|
break;
|
|
728
741
|
}
|
|
729
742
|
i("view-change", {
|
|
730
|
-
id:
|
|
731
|
-
title:
|
|
732
|
-
start:
|
|
743
|
+
id: m.value,
|
|
744
|
+
title: ae.value,
|
|
745
|
+
start: G.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 q() {
|
|
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 [X, ve] = [n.value, t.value];
|
|
810
|
+
m.value === "month" && ([X, ve] = [G.value, u.value]), (!s.isInRange(g, X, ve) || R) && (g.setHours(0, 0, 0, 0), O.value = g.getTime() < X.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: X } = s;
|
|
815
|
+
(!V.value || !R(V.value) || !X(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
|
-
|
|
817
|
-
|
|
828
|
+
function M(g) {
|
|
829
|
+
var X;
|
|
830
|
+
const H = (X = _.value) == null ? void 0 : X.querySelector(".vuecal__scrollable"), R = g ? g * c.timeCellHeight / c.timeStep : 0;
|
|
831
|
+
H == null || H.scrollTo({ top: R, behavior: "smooth" });
|
|
818
832
|
}
|
|
819
|
-
function
|
|
820
|
-
const
|
|
821
|
-
|
|
833
|
+
function W() {
|
|
834
|
+
const g = /* @__PURE__ */ new Date();
|
|
835
|
+
M(g.getHours() * 60 + g.getMinutes());
|
|
822
836
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
837
|
+
function A() {
|
|
838
|
+
M(0);
|
|
825
839
|
}
|
|
826
|
-
const
|
|
827
|
-
return
|
|
840
|
+
const ee = T(() => w.getViewEvents(k.value)), de = w.createEvent, he = w.deleteEvent;
|
|
841
|
+
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
842
|
l.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
|
|
829
|
-
}),
|
|
830
|
-
|
|
831
|
-
}),
|
|
843
|
+
}), me(() => c.watchRealTime, (g) => {
|
|
844
|
+
g && c.time ? E() : N = clearTimeout(N);
|
|
845
|
+
}), re(), c.time && c.watchRealTime && E(), Xe(() => N = clearTimeout(N)), {
|
|
832
846
|
now: o,
|
|
833
|
-
id:
|
|
834
|
-
broaderView:
|
|
835
|
-
narrowerView:
|
|
836
|
-
title:
|
|
847
|
+
id: m,
|
|
848
|
+
broaderView: P,
|
|
849
|
+
narrowerView: I,
|
|
850
|
+
title: ae,
|
|
837
851
|
viewDate: f,
|
|
838
|
-
start:
|
|
852
|
+
start: G,
|
|
839
853
|
end: u,
|
|
840
854
|
extendedStart: d,
|
|
841
855
|
// Full range, including out of scope month days, and hidden leading/trailing days.
|
|
@@ -846,63 +860,63 @@ const Ke = (c) => {
|
|
|
846
860
|
containsToday: v,
|
|
847
861
|
selectedDate: V,
|
|
848
862
|
cellDates: k,
|
|
849
|
-
cols:
|
|
863
|
+
cols: L,
|
|
850
864
|
rows: B,
|
|
851
865
|
// All the events are stored and indexed in the events object of the eventsManager.
|
|
852
866
|
// The following events array is only a subset of visible ones, plus any potential recurring
|
|
853
867
|
// and multi-day events.
|
|
854
|
-
events:
|
|
868
|
+
events: ee,
|
|
855
869
|
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:
|
|
870
|
+
switch: x,
|
|
871
|
+
broader: Q,
|
|
872
|
+
narrower: ue,
|
|
873
|
+
previous: a,
|
|
874
|
+
next: p,
|
|
875
|
+
navigate: y,
|
|
876
|
+
goToToday: q,
|
|
877
|
+
updateViewDate: J,
|
|
878
|
+
updateSelectedDate: ce,
|
|
879
|
+
scrollToCurrentTime: W,
|
|
880
|
+
scrollToTime: M,
|
|
881
|
+
scrollTop: A,
|
|
882
|
+
createEvent: de,
|
|
883
|
+
deleteEvent: he,
|
|
870
884
|
// Getters.
|
|
871
885
|
get isDay() {
|
|
872
|
-
return
|
|
886
|
+
return m.value === "day";
|
|
873
887
|
},
|
|
874
888
|
get isDays() {
|
|
875
|
-
return
|
|
889
|
+
return m.value === "days";
|
|
876
890
|
},
|
|
877
891
|
get isWeek() {
|
|
878
|
-
return
|
|
892
|
+
return m.value === "week";
|
|
879
893
|
},
|
|
880
894
|
get isMonth() {
|
|
881
|
-
return
|
|
895
|
+
return m.value === "month";
|
|
882
896
|
},
|
|
883
897
|
get isYear() {
|
|
884
|
-
return
|
|
898
|
+
return m.value === "year";
|
|
885
899
|
},
|
|
886
900
|
get isYears() {
|
|
887
|
-
return
|
|
901
|
+
return m.value === "years";
|
|
888
902
|
}
|
|
889
903
|
};
|
|
890
|
-
},
|
|
891
|
-
texts: { ...
|
|
904
|
+
}, Fe = $e({
|
|
905
|
+
texts: { ...fe.texts },
|
|
892
906
|
// Make texts reactive before a locale is loaded.
|
|
893
|
-
dateUtils:
|
|
907
|
+
dateUtils: st(fe.texts)
|
|
894
908
|
// Some Date utils functions need localized texts.
|
|
895
|
-
}),
|
|
896
|
-
const _ =
|
|
909
|
+
}), ht = ({ props: c, emit: s, attrs: i, vuecalEl: D, uid: w }) => {
|
|
910
|
+
const _ = $e({
|
|
897
911
|
uid: w,
|
|
898
912
|
// The Vuecal instance unique ID, used for dnd source-target identification.
|
|
899
913
|
emit: s,
|
|
900
|
-
texts: { ...
|
|
914
|
+
texts: { ...Fe.texts },
|
|
901
915
|
// Make texts reactive before a locale is loaded.
|
|
902
916
|
// The date utils composable.
|
|
903
917
|
// A class/composable is needed in order to access the user locale in all the methods, and
|
|
904
918
|
// independently of other potential Vue Cal instances on the same page.
|
|
905
|
-
dateUtils: { ...
|
|
919
|
+
dateUtils: { ...Fe.dateUtils },
|
|
906
920
|
now: /* @__PURE__ */ new Date(),
|
|
907
921
|
config: {},
|
|
908
922
|
eventsManager: {},
|
|
@@ -917,8 +931,8 @@ const Ke = (c) => {
|
|
|
917
931
|
isResizingEvent: !1
|
|
918
932
|
}
|
|
919
933
|
});
|
|
920
|
-
return _.dateUtils =
|
|
921
|
-
},
|
|
934
|
+
return _.dateUtils = st(Object.assign(fe.texts, _.texts)), _.config = vt(_, c, i), _.eventsManager = ft(_), _.view = gt(_, D), _.dnd = mt(_), _;
|
|
935
|
+
}, yt = 24 * 60, Dt = {
|
|
922
936
|
allDayEvents: { type: [Boolean, String], default: !1 },
|
|
923
937
|
// Coming soon.
|
|
924
938
|
// avoidEventOverlap: { type: Boolean, default: undefined }, // Coming soon.
|
|
@@ -982,7 +996,7 @@ const Ke = (c) => {
|
|
|
982
996
|
// Start time of the time column, in minutes.
|
|
983
997
|
timeStep: { type: Number, default: 60 },
|
|
984
998
|
// Step amount for the time in the time column, in minutes.
|
|
985
|
-
timeTo: { type: Number, default:
|
|
999
|
+
timeTo: { type: Number, default: yt },
|
|
986
1000
|
// End time of the time column, in minutes.
|
|
987
1001
|
titleBar: { type: Boolean, default: !0 },
|
|
988
1002
|
// Show or hide the header title bar.
|
|
@@ -1014,61 +1028,61 @@ const Ke = (c) => {
|
|
|
1014
1028
|
// minScheduleWidth: { type: Number, default: 0 },
|
|
1015
1029
|
// overlapsPerTimeStep: { type: Boolean, default: false },
|
|
1016
1030
|
// resizeX: { type: Boolean, default: false },
|
|
1017
|
-
},
|
|
1031
|
+
}, wt = { class: "vuecal__header" }, pt = {
|
|
1018
1032
|
key: 0,
|
|
1019
1033
|
class: "vuecal__views-bar"
|
|
1020
|
-
},
|
|
1034
|
+
}, kt = ["onClick", "innerHTML"], _t = {
|
|
1021
1035
|
key: 1,
|
|
1022
1036
|
class: "vuecal__title-bar"
|
|
1023
|
-
},
|
|
1037
|
+
}, bt = { class: "vuecal__transition-wrap" }, Tt = ["disabled", "innerHTML"], $t = {
|
|
1024
1038
|
__name: "header",
|
|
1025
1039
|
setup(c) {
|
|
1026
|
-
const s =
|
|
1040
|
+
const s = Ne("vuecal"), { view: i, config: D } = s, w = () => {
|
|
1027
1041
|
D.clickToNavigate && i.broader();
|
|
1028
|
-
}, _ =
|
|
1029
|
-
return (
|
|
1030
|
-
F(
|
|
1042
|
+
}, _ = T(() => D.clickToNavigate ? { click: w } : {});
|
|
1043
|
+
return (z, m) => (Y(), j("div", wt, [
|
|
1044
|
+
F(z.$slots, "header", {
|
|
1031
1045
|
view: C(i),
|
|
1032
1046
|
availableViews: C(D).availableViews,
|
|
1033
1047
|
vuecal: C(s)
|
|
1034
1048
|
}),
|
|
1035
|
-
|
|
1036
|
-
C(D).viewsBar ? (Y(), j("div",
|
|
1037
|
-
(Y(!0), j(
|
|
1038
|
-
class:
|
|
1049
|
+
z.$slots.header ? U("", !0) : (Y(), j(te, { key: 0 }, [
|
|
1050
|
+
C(D).viewsBar ? (Y(), j("div", pt, [
|
|
1051
|
+
(Y(!0), j(te, null, pe(C(D).availableViews, (V, o) => (Y(), j("button", {
|
|
1052
|
+
class: ke(["vuecal__view-button", { "vuecal__view-button--active": C(i).id === o }]),
|
|
1039
1053
|
onClick: (f) => C(i).switch(o),
|
|
1040
1054
|
innerHTML: C(s).texts[o],
|
|
1041
1055
|
type: "button"
|
|
1042
|
-
}, null, 10,
|
|
1043
|
-
])) :
|
|
1044
|
-
C(D).titleBar ? (Y(), j("nav",
|
|
1045
|
-
|
|
1046
|
-
class:
|
|
1047
|
-
onClick:
|
|
1056
|
+
}, null, 10, kt))), 256))
|
|
1057
|
+
])) : U("", !0),
|
|
1058
|
+
C(D).titleBar ? (Y(), j("nav", _t, [
|
|
1059
|
+
ge("button", {
|
|
1060
|
+
class: ke(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !z.$slots["previous-button"] }]),
|
|
1061
|
+
onClick: m[0] || (m[0] = (...V) => C(i).previous && C(i).previous(...V)),
|
|
1048
1062
|
type: "button"
|
|
1049
1063
|
}, [
|
|
1050
|
-
F(
|
|
1064
|
+
F(z.$slots, "previous-button")
|
|
1051
1065
|
], 2),
|
|
1052
|
-
|
|
1053
|
-
|
|
1066
|
+
ge("div", bt, [
|
|
1067
|
+
Oe(Ge, {
|
|
1054
1068
|
name: `vuecal-slide-fade--${C(i).transitionDirection}`
|
|
1055
1069
|
}, {
|
|
1056
|
-
default:
|
|
1070
|
+
default: Z(() => [
|
|
1057
1071
|
(Y(), j("div", {
|
|
1058
1072
|
key: C(i).id + C(i).start.getTime()
|
|
1059
1073
|
}, [
|
|
1060
|
-
|
|
1074
|
+
z.$slots.title ? (Y(), Se(Ke(C(D).clickToNavigate && C(i).broaderView ? "button" : "div"), ye({
|
|
1061
1075
|
key: 0,
|
|
1062
1076
|
class: "vuecal__title"
|
|
1063
|
-
},
|
|
1064
|
-
default:
|
|
1065
|
-
F(
|
|
1077
|
+
}, Ie(_.value)), {
|
|
1078
|
+
default: Z(() => [
|
|
1079
|
+
F(z.$slots, "title", se(ne(C(i))))
|
|
1066
1080
|
]),
|
|
1067
1081
|
_: 3
|
|
1068
|
-
}, 16)) : (Y(),
|
|
1082
|
+
}, 16)) : (Y(), Se(Ke(C(D).clickToNavigate && C(i).broaderView ? "button" : "div"), ye({
|
|
1069
1083
|
key: 1,
|
|
1070
1084
|
class: "vuecal__title"
|
|
1071
|
-
},
|
|
1085
|
+
}, Ie(_.value), {
|
|
1072
1086
|
innerHTML: C(i).title
|
|
1073
1087
|
}), null, 16, ["innerHTML"]))
|
|
1074
1088
|
]))
|
|
@@ -1076,48 +1090,48 @@ const Ke = (c) => {
|
|
|
1076
1090
|
_: 3
|
|
1077
1091
|
}, 8, ["name"])
|
|
1078
1092
|
]),
|
|
1079
|
-
C(D).todayButton ? (Y(), j(
|
|
1080
|
-
|
|
1093
|
+
C(D).todayButton ? (Y(), j(te, { key: 0 }, [
|
|
1094
|
+
z.$slots["today-button"] ? F(z.$slots, "today-button", {
|
|
1081
1095
|
key: 0,
|
|
1082
1096
|
navigate: () => !C(i).containsToday && C(i).goToToday(),
|
|
1083
1097
|
active: C(i).containsToday
|
|
1084
1098
|
}) : (Y(), j("button", {
|
|
1085
1099
|
key: 1,
|
|
1086
|
-
class:
|
|
1087
|
-
onClick:
|
|
1100
|
+
class: ke(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": C(i).containsToday }]),
|
|
1101
|
+
onClick: m[1] || (m[1] = (V) => !C(i).containsToday && C(i).goToToday()),
|
|
1088
1102
|
disabled: !!C(i).containsToday,
|
|
1089
1103
|
type: "button",
|
|
1090
1104
|
innerHTML: C(s).texts.today
|
|
1091
|
-
}, null, 10,
|
|
1092
|
-
], 64)) :
|
|
1093
|
-
|
|
1094
|
-
class:
|
|
1095
|
-
onClick:
|
|
1105
|
+
}, null, 10, Tt))
|
|
1106
|
+
], 64)) : U("", !0),
|
|
1107
|
+
ge("button", {
|
|
1108
|
+
class: ke(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !z.$slots["next-button"] }]),
|
|
1109
|
+
onClick: m[2] || (m[2] = (...V) => C(i).next && C(i).next(...V)),
|
|
1096
1110
|
type: "button"
|
|
1097
1111
|
}, [
|
|
1098
|
-
F(
|
|
1112
|
+
F(z.$slots, "next-button")
|
|
1099
1113
|
], 2)
|
|
1100
|
-
])) :
|
|
1114
|
+
])) : U("", !0)
|
|
1101
1115
|
], 64))
|
|
1102
1116
|
]));
|
|
1103
1117
|
}
|
|
1104
|
-
},
|
|
1118
|
+
}, Mt = {
|
|
1105
1119
|
key: 0,
|
|
1106
1120
|
class: "vuecal__headings"
|
|
1107
|
-
},
|
|
1121
|
+
}, Et = {
|
|
1108
1122
|
key: 0,
|
|
1109
1123
|
class: "vuecal__weekdays-headings"
|
|
1110
|
-
},
|
|
1124
|
+
}, Yt = ["onClick"], St = { class: "vuecal__weekday-day" }, Ct = {
|
|
1111
1125
|
key: 0,
|
|
1112
1126
|
class: "vuecal__weekday-date"
|
|
1113
|
-
},
|
|
1127
|
+
}, Vt = {
|
|
1114
1128
|
key: 1,
|
|
1115
1129
|
class: "vuecal__schedules-headings w-flex grow"
|
|
1116
|
-
},
|
|
1130
|
+
}, Ot = ["innerHTML"], jt = {
|
|
1117
1131
|
__name: "headings-bar",
|
|
1118
1132
|
setup(c) {
|
|
1119
|
-
const s =
|
|
1120
|
-
id:
|
|
1133
|
+
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 }) => ({
|
|
1134
|
+
id: Re[o.getDay()],
|
|
1121
1135
|
date: o,
|
|
1122
1136
|
dateNumber: o.getDate(),
|
|
1123
1137
|
day: w.formatDate(o, "dddd"),
|
|
@@ -1129,53 +1143,53 @@ const Ke = (c) => {
|
|
|
1129
1143
|
(i.isDays || i.isWeek) && i.updateSelectedDate(o);
|
|
1130
1144
|
}
|
|
1131
1145
|
};
|
|
1132
|
-
return (o, f) =>
|
|
1133
|
-
C(i).isDay ?
|
|
1134
|
-
(Y(!0), j(
|
|
1135
|
-
class:
|
|
1136
|
-
key:
|
|
1137
|
-
onClick: (
|
|
1146
|
+
return (o, f) => z.value ? (Y(), j("div", Mt, [
|
|
1147
|
+
C(i).isDay ? U("", !0) : (Y(), j("div", Et, [
|
|
1148
|
+
(Y(!0), j(te, null, pe(m.value, (b, N) => (Y(), j("div", {
|
|
1149
|
+
class: ke(["vuecal__weekday", { "vuecal__weekday--today": b.isToday }]),
|
|
1150
|
+
key: N,
|
|
1151
|
+
onClick: (G) => V.click(b.date)
|
|
1138
1152
|
}, [
|
|
1139
1153
|
F(o.$slots, "weekday-heading", {
|
|
1140
1154
|
label: b[_.value],
|
|
1141
1155
|
id: b.id,
|
|
1142
1156
|
date: b.date
|
|
1143
1157
|
}, () => [
|
|
1144
|
-
|
|
1145
|
-
C(i).isMonth ?
|
|
1158
|
+
ge("span", St, le(b[_.value]), 1),
|
|
1159
|
+
C(i).isMonth ? U("", !0) : (Y(), j("strong", Ct, le(b.dateNumber), 1))
|
|
1146
1160
|
])
|
|
1147
|
-
], 10,
|
|
1161
|
+
], 10, Yt))), 128))
|
|
1148
1162
|
])),
|
|
1149
|
-
C(D).schedules ? (Y(), j("div",
|
|
1150
|
-
(Y(!0), j(
|
|
1151
|
-
(Y(!0), j(
|
|
1163
|
+
C(D).schedules ? (Y(), j("div", Vt, [
|
|
1164
|
+
(Y(!0), j(te, null, pe(m.value, (b, N) => (Y(), j(te, { key: N }, [
|
|
1165
|
+
(Y(!0), j(te, null, pe(C(D).schedules, (G, u) => (Y(), j(te, { key: u }, [
|
|
1152
1166
|
o.$slots["schedule-heading"] ? (Y(), j("div", {
|
|
1153
1167
|
key: 0,
|
|
1154
|
-
class:
|
|
1168
|
+
class: ke(["vuecal__schedule vuecal__schedule--heading", G.class])
|
|
1155
1169
|
}, [
|
|
1156
1170
|
F(o.$slots, "schedule-heading", {
|
|
1157
|
-
schedule:
|
|
1171
|
+
schedule: G,
|
|
1158
1172
|
view: C(i)
|
|
1159
1173
|
})
|
|
1160
1174
|
], 2)) : (Y(), j("div", {
|
|
1161
1175
|
key: 1,
|
|
1162
|
-
class:
|
|
1163
|
-
innerHTML:
|
|
1164
|
-
}, null, 10,
|
|
1176
|
+
class: ke(["vuecal__schedule vuecal__schedule--heading", G.class]),
|
|
1177
|
+
innerHTML: G.label
|
|
1178
|
+
}, null, 10, Ot))
|
|
1165
1179
|
], 64))), 128))
|
|
1166
1180
|
], 64))), 128))
|
|
1167
|
-
])) :
|
|
1168
|
-
])) :
|
|
1181
|
+
])) : U("", !0)
|
|
1182
|
+
])) : U("", !0);
|
|
1169
1183
|
}
|
|
1170
|
-
},
|
|
1184
|
+
}, Pt = { class: "vuecal__time-column" }, Ht = {
|
|
1171
1185
|
__name: "time-column",
|
|
1172
1186
|
setup(c) {
|
|
1173
|
-
const s =
|
|
1187
|
+
const s = Ne("vuecal"), { config: i, texts: D } = s, w = T(() => {
|
|
1174
1188
|
const _ = [];
|
|
1175
|
-
for (let
|
|
1176
|
-
const V = ~~(
|
|
1189
|
+
for (let m = i.timeFrom; m < i.timeTo; m += i.timeStep) {
|
|
1190
|
+
const V = ~~(m / 60), o = m % 60, f = D[m < 720 ? "am" : "pm"];
|
|
1177
1191
|
_.push({
|
|
1178
|
-
minutesSum:
|
|
1192
|
+
minutesSum: m,
|
|
1179
1193
|
// The sum of hours + minutes in minutes.
|
|
1180
1194
|
hours: V,
|
|
1181
1195
|
minutes: o,
|
|
@@ -1185,35 +1199,35 @@ const Ke = (c) => {
|
|
|
1185
1199
|
}
|
|
1186
1200
|
return _;
|
|
1187
1201
|
});
|
|
1188
|
-
return (_,
|
|
1189
|
-
(Y(!0), j(
|
|
1202
|
+
return (_, z) => (Y(), j("div", Pt, [
|
|
1203
|
+
(Y(!0), j(te, null, pe(w.value, (m, V) => (Y(), j("div", {
|
|
1190
1204
|
class: "vuecal__time-cell",
|
|
1191
1205
|
key: V
|
|
1192
1206
|
}, [
|
|
1193
1207
|
F(_.$slots, "time-cell", {
|
|
1194
1208
|
index: V,
|
|
1195
|
-
minutes:
|
|
1196
|
-
hours:
|
|
1197
|
-
minutesSum:
|
|
1198
|
-
format12:
|
|
1199
|
-
format24:
|
|
1209
|
+
minutes: m.minutes,
|
|
1210
|
+
hours: m.hours,
|
|
1211
|
+
minutesSum: m.minutesSum,
|
|
1212
|
+
format12: m.formatted12,
|
|
1213
|
+
format24: m.formatted24
|
|
1200
1214
|
}, () => [
|
|
1201
|
-
|
|
1215
|
+
ge("label", null, le(C(i).twelveHour ? m.formatted12 : m.formatted24), 1)
|
|
1202
1216
|
])
|
|
1203
1217
|
]))), 128))
|
|
1204
1218
|
]));
|
|
1205
1219
|
}
|
|
1206
|
-
},
|
|
1220
|
+
}, Lt = ["draggable"], zt = { class: "vuecal__event-details" }, Ft = { class: "vuecal__event-title" }, Nt = {
|
|
1207
1221
|
key: 0,
|
|
1208
1222
|
class: "vuecal__event-time"
|
|
1209
|
-
},
|
|
1223
|
+
}, Wt = ["innerHTML"], at = {
|
|
1210
1224
|
__name: "event",
|
|
1211
1225
|
props: {
|
|
1212
1226
|
event: { type: Object, required: !0 }
|
|
1213
1227
|
},
|
|
1214
1228
|
emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
|
|
1215
1229
|
setup(c, { emit: s }) {
|
|
1216
|
-
const { config: i, view: D, dnd: w, touch: _, dateUtils:
|
|
1230
|
+
const { config: i, view: D, dnd: w, touch: _, dateUtils: z } = Ne("vuecal"), m = c, V = ie(null), o = $e(m.event), f = $e({
|
|
1217
1231
|
dragging: !1,
|
|
1218
1232
|
resizing: !1,
|
|
1219
1233
|
fromResizer: !1,
|
|
@@ -1247,9 +1261,9 @@ const Ke = (c) => {
|
|
|
1247
1261
|
cellEl: null,
|
|
1248
1262
|
// Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
|
|
1249
1263
|
schedule: null
|
|
1250
|
-
}), b =
|
|
1251
|
-
|
|
1252
|
-
const
|
|
1264
|
+
}), b = T(() => i.editableEvents.drag && o.draggable !== !1 && !o.background), N = T(() => i.time && i.editableEvents.resize && o.resizable !== !1 && !o.background);
|
|
1265
|
+
T(() => i.editableEvents.delete && o.deletable !== !1 && !o.background);
|
|
1266
|
+
const G = T(() => {
|
|
1253
1267
|
var l, n, k;
|
|
1254
1268
|
return {
|
|
1255
1269
|
[`vuecal__event--${o._.id}`]: !0,
|
|
@@ -1270,7 +1284,7 @@ const Ke = (c) => {
|
|
|
1270
1284
|
"vuecal__event--dragging-ghost": o._.draggingGhost,
|
|
1271
1285
|
"vuecal__event--resizing": f.resizing
|
|
1272
1286
|
};
|
|
1273
|
-
}), u =
|
|
1287
|
+
}), u = T(() => {
|
|
1274
1288
|
const l = (D.isDay || D.isDays || D.isWeek) && i.time;
|
|
1275
1289
|
if (!l && !o.backgroundColor && !o.color) return !1;
|
|
1276
1290
|
const n = {
|
|
@@ -1278,21 +1292,21 @@ const Ke = (c) => {
|
|
|
1278
1292
|
color: o.color || null
|
|
1279
1293
|
};
|
|
1280
1294
|
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 = `${
|
|
1295
|
+
const k = Math.max(i.timeFrom, o._.startMinutes), t = Math.min(i.timeTo, o._.endMinutes), O = Ve(k, i), P = Ve(t, i) - O;
|
|
1296
|
+
n.top = `${O}%`, n.height = `${P}%`;
|
|
1283
1297
|
}
|
|
1284
1298
|
return n;
|
|
1285
|
-
}), d =
|
|
1299
|
+
}), d = T(() => {
|
|
1286
1300
|
const l = { ...i.eventListeners.event };
|
|
1287
1301
|
Object.entries(l).forEach(([t, O]) => {
|
|
1288
|
-
["resize-end"].includes(t) || (l[t] = (
|
|
1289
|
-
|
|
1302
|
+
["resize-end"].includes(t) || (l[t] = (P) => {
|
|
1303
|
+
P.type !== "drop" && O(P.type ? { e: P, event: o } : P);
|
|
1290
1304
|
});
|
|
1291
1305
|
});
|
|
1292
1306
|
const n = { ...l };
|
|
1293
1307
|
l.touchstart = (t) => {
|
|
1294
1308
|
var O;
|
|
1295
|
-
t.stopPropagation(), (O = n.touchstart) == null || O.call(n, { e: t, event: o });
|
|
1309
|
+
t.stopPropagation(), e(t), (O = n.touchstart) == null || O.call(n, { e: t, event: o });
|
|
1296
1310
|
}, l.mousedown = (t) => {
|
|
1297
1311
|
var O;
|
|
1298
1312
|
t.stopPropagation(), e(t), (O = n.mousedown) == null || O.call(n, { e: t, event: o });
|
|
@@ -1301,132 +1315,132 @@ const Ke = (c) => {
|
|
|
1301
1315
|
return l.click = (t) => {
|
|
1302
1316
|
var O;
|
|
1303
1317
|
(O = n.click) == null || O.call(n, { e: t, event: o }), k ? k = clearTimeout(k) : k = setTimeout(() => {
|
|
1304
|
-
var
|
|
1305
|
-
k = null, (
|
|
1318
|
+
var P;
|
|
1319
|
+
k = null, (P = n["delayed-click"]) == null || P.call(n, { e: t, event: o });
|
|
1306
1320
|
}, 400);
|
|
1307
1321
|
}, l.dblclick = (t) => {
|
|
1308
1322
|
n.dblclick ? n.dblclick({ e: t, event: o }) : o.delete(1);
|
|
1309
1323
|
}, l;
|
|
1310
1324
|
}), e = (l) => {
|
|
1311
|
-
var t, O,
|
|
1325
|
+
var t, O, P;
|
|
1312
1326
|
const n = ((t = l.touches) == null ? void 0 : t[0]) || l;
|
|
1313
1327
|
f.fromResizer = n.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
|
|
1314
1328
|
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, (
|
|
1329
|
+
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(() => {
|
|
1330
|
+
var I, K;
|
|
1331
|
+
f.holding = !0, (K = (I = d.value).hold) == null || K.call(I, { e: l, event: o });
|
|
1318
1332
|
}, 1e3);
|
|
1319
1333
|
}, v = async (l) => {
|
|
1320
|
-
var k, t, O,
|
|
1334
|
+
var k, t, O, P;
|
|
1321
1335
|
const n = ((k = l.touches) == null ? void 0 : k[0]) || l;
|
|
1322
1336
|
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 -
|
|
1337
|
+
const { top: I, left: K, width: oe, height: ae } = f.cellEl.getBoundingClientRect();
|
|
1338
|
+
f.moveX = n.clientX - K, f.moveY = n.clientY - I, f.movePercentageX = f.moveX * 100 / oe, f.movePercentageY = f.moveY * 100 / ae;
|
|
1325
1339
|
}
|
|
1326
1340
|
if (f.fromResizer) {
|
|
1327
|
-
const { newStart:
|
|
1328
|
-
let
|
|
1329
|
-
const { resize:
|
|
1330
|
-
|
|
1341
|
+
const { newStart: I, newEnd: K } = E(o);
|
|
1342
|
+
let oe = !0;
|
|
1343
|
+
const { resize: ae } = (P = i.eventListeners) == null ? void 0 : P.event;
|
|
1344
|
+
ae && (oe = await ae({
|
|
1331
1345
|
e: l,
|
|
1332
|
-
event: { ...o, start:
|
|
1333
|
-
overlaps: o.getOverlappingEvents({ start:
|
|
1334
|
-
})),
|
|
1346
|
+
event: { ...o, start: I, end: K },
|
|
1347
|
+
overlaps: o.getOverlappingEvents({ start: I, end: K })
|
|
1348
|
+
})), oe !== !1 ? (o.start = I, o.end = K, f.resizingLastAcceptedEvent && (f.resizingLastAcceptedEvent = null)) : ae && (f.resizingLastAcceptedEvent = { ...o, _: { ...o._ } });
|
|
1335
1349
|
}
|
|
1336
|
-
},
|
|
1350
|
+
}, h = async (l) => {
|
|
1337
1351
|
var n, k;
|
|
1338
1352
|
if (f.holdTimer = clearTimeout(f.holdTimer), f.holding = !1, f.resizing) {
|
|
1339
1353
|
const { newStart: t, newEnd: O } = E(o);
|
|
1340
|
-
let
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1354
|
+
let P = !0;
|
|
1355
|
+
const I = d.value["resize-end"];
|
|
1356
|
+
I && (P = await I({
|
|
1343
1357
|
e: l,
|
|
1344
1358
|
event: o,
|
|
1345
1359
|
original: f.resizingOriginalEvent,
|
|
1346
1360
|
// Original event details before resizing.
|
|
1347
1361
|
overlaps: o.getOverlappingEvents({ start: t, end: O })
|
|
1348
|
-
})), o.start =
|
|
1362
|
+
})), 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
1363
|
}
|
|
1350
1364
|
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
1365
|
}, E = (l) => {
|
|
1352
1366
|
const n = new Date(l.start.getFullYear(), l.start.getMonth(), l.start.getDate());
|
|
1353
1367
|
new Date(n).setDate(n.getDate() + 1);
|
|
1354
|
-
let t =
|
|
1368
|
+
let t = Pe(f.movePercentageY, i);
|
|
1355
1369
|
if (t = Math.max(0, Math.min(t, 24 * 60)), i.snapToInterval) {
|
|
1356
|
-
const
|
|
1357
|
-
t =
|
|
1370
|
+
const I = t + i.snapToInterval / 2;
|
|
1371
|
+
t = I - I % i.snapToInterval;
|
|
1358
1372
|
}
|
|
1359
|
-
let O = l.start,
|
|
1360
|
-
return
|
|
1373
|
+
let O = l.start, P = new Date(n.getTime() + t * 6e4);
|
|
1374
|
+
return P < f.resizeStartDate && (O = P, P = f.resizeStartDate), { newStart: O, newEnd: P };
|
|
1361
1375
|
};
|
|
1362
|
-
|
|
1363
|
-
const
|
|
1364
|
-
document.addEventListener(l, n, k),
|
|
1376
|
+
Ze(() => o._.register(V.value));
|
|
1377
|
+
const L = [], B = (l, n, k) => {
|
|
1378
|
+
document.addEventListener(l, n, k), L.push({ event: l, handler: n, options: k });
|
|
1365
1379
|
};
|
|
1366
|
-
return
|
|
1367
|
-
o._.unregister(),
|
|
1380
|
+
return Xe(() => {
|
|
1381
|
+
o._.unregister(), L.forEach(({ event: l, handler: n, options: k }) => {
|
|
1368
1382
|
document.removeEventListener(l, n, k);
|
|
1369
1383
|
});
|
|
1370
|
-
}), (l, n) => (Y(), j("div",
|
|
1384
|
+
}), (l, n) => (Y(), j("div", ye({ class: "vuecal__event" }, Ie(d.value, !0), {
|
|
1371
1385
|
ref_key: "eventEl",
|
|
1372
1386
|
ref: V,
|
|
1373
|
-
class:
|
|
1387
|
+
class: G.value,
|
|
1374
1388
|
style: u.value,
|
|
1375
1389
|
draggable: b.value ? "true" : void 0,
|
|
1376
1390
|
onDragstart: n[2] || (n[2] = (k) => b.value && C(w).eventDragStart(k, o)),
|
|
1377
1391
|
onDragend: n[3] || (n[3] = (k) => b.value && C(w).eventDragEnd(k, o))
|
|
1378
1392
|
}), [
|
|
1379
|
-
|
|
1393
|
+
ge("div", zt, [
|
|
1380
1394
|
F(l.$slots, "event", { event: o }, () => [
|
|
1381
|
-
|
|
1382
|
-
C(i).time ? (Y(), j("div",
|
|
1383
|
-
- ` +
|
|
1384
|
-
|
|
1395
|
+
ge("div", Ft, le(o.title), 1),
|
|
1396
|
+
C(i).time ? (Y(), j("div", Nt, le(o._[`startTimeFormatted${C(i).twelveHour ? 12 : 24}`]) + `
|
|
1397
|
+
- ` + le(o._[`endTimeFormatted${C(i).twelveHour ? 12 : 24}`]), 1)) : U("", !0),
|
|
1398
|
+
ge("div", {
|
|
1385
1399
|
class: "vuecal__event-content",
|
|
1386
1400
|
innerHTML: o.content
|
|
1387
|
-
}, null, 8,
|
|
1401
|
+
}, null, 8, Wt)
|
|
1388
1402
|
])
|
|
1389
1403
|
]),
|
|
1390
|
-
|
|
1404
|
+
N.value ? (Y(), j("div", {
|
|
1391
1405
|
key: 0,
|
|
1392
1406
|
class: "vuecal__event-resizer",
|
|
1393
|
-
onDragstart: n[0] || (n[0] =
|
|
1407
|
+
onDragstart: n[0] || (n[0] = Qe(() => {
|
|
1394
1408
|
}, ["prevent", "stop"]))
|
|
1395
|
-
}, null, 32)) :
|
|
1396
|
-
|
|
1397
|
-
default:
|
|
1409
|
+
}, null, 32)) : U("", !0),
|
|
1410
|
+
Oe(Ge, { name: "vuecal-delete-btn" }, {
|
|
1411
|
+
default: Z(() => [
|
|
1398
1412
|
o._.deleting ? (Y(), j("div", {
|
|
1399
1413
|
key: 0,
|
|
1400
1414
|
class: "vuecal__event-delete",
|
|
1401
|
-
onClick: n[1] || (n[1] =
|
|
1402
|
-
}, "Delete")) :
|
|
1415
|
+
onClick: n[1] || (n[1] = Qe((k) => o.delete(3), ["stop"]))
|
|
1416
|
+
}, "Delete")) : U("", !0)
|
|
1403
1417
|
]),
|
|
1404
1418
|
_: 1
|
|
1405
1419
|
})
|
|
1406
|
-
], 16,
|
|
1420
|
+
], 16, Lt));
|
|
1407
1421
|
}
|
|
1408
|
-
},
|
|
1422
|
+
}, Bt = ["innerHTML"], At = ["data-schedule"], It = {
|
|
1409
1423
|
key: 1,
|
|
1410
1424
|
class: "vuecal__cell-date"
|
|
1411
|
-
},
|
|
1425
|
+
}, Rt = {
|
|
1412
1426
|
key: 2,
|
|
1413
1427
|
class: "vuecal__cell-content"
|
|
1414
|
-
},
|
|
1428
|
+
}, Xt = {
|
|
1415
1429
|
key: 3,
|
|
1416
1430
|
class: "vuecal__cell-events"
|
|
1417
|
-
},
|
|
1431
|
+
}, Gt = {
|
|
1418
1432
|
key: 1,
|
|
1419
1433
|
class: "vuecal__cell-date"
|
|
1420
|
-
},
|
|
1434
|
+
}, qt = {
|
|
1421
1435
|
key: 2,
|
|
1422
1436
|
class: "vuecal__cell-content"
|
|
1423
|
-
},
|
|
1437
|
+
}, Ut = {
|
|
1424
1438
|
key: 3,
|
|
1425
1439
|
class: "vuecal__cell-events"
|
|
1426
|
-
},
|
|
1440
|
+
}, Zt = {
|
|
1427
1441
|
key: 5,
|
|
1428
1442
|
class: "vuecal__cell-events-count"
|
|
1429
|
-
},
|
|
1443
|
+
}, Jt = ["title"], Kt = {
|
|
1430
1444
|
__name: "cell",
|
|
1431
1445
|
props: {
|
|
1432
1446
|
// Even with time=false, the date of the cell will still be provided in order to attach
|
|
@@ -1436,9 +1450,9 @@ const Ke = (c) => {
|
|
|
1436
1450
|
index: { type: Number, required: !0 }
|
|
1437
1451
|
},
|
|
1438
1452
|
setup(c) {
|
|
1439
|
-
const s = c, i =
|
|
1440
|
-
b.value.push(r.detail),
|
|
1441
|
-
}, u = () => setTimeout(() =>
|
|
1453
|
+
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), G = (r) => {
|
|
1454
|
+
b.value.push(r.detail), N.value = !0;
|
|
1455
|
+
}, u = () => setTimeout(() => N.value = !1, 300), d = $e({
|
|
1442
1456
|
dragging: !1,
|
|
1443
1457
|
holding: !1,
|
|
1444
1458
|
// When the cell is clicked and hold for a certain amount of time.
|
|
@@ -1459,42 +1473,42 @@ const Ke = (c) => {
|
|
|
1459
1473
|
movePercentageX: 0,
|
|
1460
1474
|
movePercentageY: 0,
|
|
1461
1475
|
schedule: null
|
|
1462
|
-
}), e =
|
|
1463
|
-
let r = Math.min(d.startPercentageY, d.movePercentageY),
|
|
1464
|
-
return w.snapToInterval && (S = _.snapToInterval(S, w.snapToInterval),
|
|
1476
|
+
}), e = ie(!1), v = ie({ cellOverlaps: {}, longestStreak: 0 }), h = T(() => {
|
|
1477
|
+
let r = Math.min(d.startPercentageY, d.movePercentageY), $ = Math.max(d.startPercentageY, d.movePercentageY), S = Pe(r, w), M = Pe($, w);
|
|
1478
|
+
return w.snapToInterval && (S = _.snapToInterval(S, w.snapToInterval), M = _.snapToInterval(M, w.snapToInterval), r = Ve(S, w), $ = Ve(M, w)), {
|
|
1465
1479
|
style: {
|
|
1466
1480
|
top: r + "%",
|
|
1467
|
-
height: Math.abs(
|
|
1481
|
+
height: Math.abs($ - r) + "%"
|
|
1468
1482
|
},
|
|
1469
1483
|
startMinutes: S,
|
|
1470
|
-
endMinutes:
|
|
1484
|
+
endMinutes: M,
|
|
1471
1485
|
start: _.formatMinutes(S),
|
|
1472
|
-
end: _.formatMinutes(
|
|
1486
|
+
end: _.formatMinutes(M),
|
|
1473
1487
|
...d.schedule ? { schedule: d.schedule } : {}
|
|
1474
1488
|
};
|
|
1475
|
-
}), E =
|
|
1476
|
-
const r = w.editableEvents.create && (d.dragging || e.value),
|
|
1477
|
-
return r &&
|
|
1478
|
-
}),
|
|
1479
|
-
var
|
|
1480
|
-
const r = /* @__PURE__ */ new Date(),
|
|
1489
|
+
}), E = T(() => {
|
|
1490
|
+
const r = w.editableEvents.create && (d.dragging || e.value), $ = w.eventCreateMinDrag && d.thresholdPassed || !w.eventCreateMinDrag;
|
|
1491
|
+
return r && $;
|
|
1492
|
+
}), L = T(() => {
|
|
1493
|
+
var ee;
|
|
1494
|
+
const r = /* @__PURE__ */ new Date(), $ = D.start.getFullYear(), S = D.start.getMonth(), M = s.start.getFullYear(), W = s.start.getMonth();
|
|
1481
1495
|
return {
|
|
1482
|
-
[`vuecal__cell--${
|
|
1483
|
-
[`vuecal__cell--${
|
|
1484
|
-
[`vuecal__cell--${
|
|
1496
|
+
[`vuecal__cell--${Re[s.start.getDay()]}`]: D.isDay || D.isDays || D.isWeek || D.isMonth,
|
|
1497
|
+
[`vuecal__cell--${ct[W]}`]: D.isYear,
|
|
1498
|
+
[`vuecal__cell--${M}`]: D.isYears,
|
|
1485
1499
|
"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":
|
|
1500
|
+
"vuecal__cell--current-month": D.isYear && M === r.getFullYear() && W === r.getMonth(),
|
|
1501
|
+
"vuecal__cell--current-year": D.isYears && M === r.getFullYear(),
|
|
1502
|
+
"vuecal__cell--out-of-range": D.isMonth && (M !== $ || W !== S),
|
|
1503
|
+
"vuecal__cell--before-min": ae.value && K.value,
|
|
1504
|
+
"vuecal__cell--after-max": ae.value && oe.value,
|
|
1505
|
+
"vuecal__cell--disabled": ae.value,
|
|
1492
1506
|
"vuecal__cell--selected": D.selectedDate && D.selectedDate.getTime() >= s.start.getTime() && D.selectedDate.getTime() <= s.end.getTime(),
|
|
1493
|
-
"vuecal__cell--has-schedules": (
|
|
1507
|
+
"vuecal__cell--has-schedules": (ee = w.schedules) == null ? void 0 : ee.length,
|
|
1494
1508
|
"vuecal__cell--dragging": d.dragging,
|
|
1495
1509
|
"vuecal__cell--has-events": n.value.length
|
|
1496
1510
|
};
|
|
1497
|
-
}), B =
|
|
1511
|
+
}), B = T(() => _.formatDate(s.start)), l = T(() => {
|
|
1498
1512
|
switch (D.id) {
|
|
1499
1513
|
case "day":
|
|
1500
1514
|
return "";
|
|
@@ -1509,162 +1523,162 @@ const Ke = (c) => {
|
|
|
1509
1523
|
case "years":
|
|
1510
1524
|
return _.formatDate(s.start, "YYYY");
|
|
1511
1525
|
}
|
|
1512
|
-
}), n =
|
|
1526
|
+
}), 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
1527
|
var r;
|
|
1514
|
-
return (r = w.schedules) == null ? void 0 : r.reduce((
|
|
1515
|
-
}), O =
|
|
1528
|
+
return (r = w.schedules) == null ? void 0 : r.reduce(($, S) => ($[S.id] = n.value.filter((M) => M.schedule === S.id), $), {});
|
|
1529
|
+
}), O = T(() => {
|
|
1516
1530
|
const r = {};
|
|
1517
|
-
for (const
|
|
1518
|
-
const S =
|
|
1531
|
+
for (const $ of n.value) {
|
|
1532
|
+
const S = $._.id, { maxConcurrent: M = 1, position: W = 0 } = v.value.cellOverlaps[S] || {};
|
|
1519
1533
|
r[S] = {
|
|
1520
|
-
width: `${100 /
|
|
1521
|
-
left: `${100 /
|
|
1534
|
+
width: `${100 / M}%`,
|
|
1535
|
+
left: `${100 / M * W}%`
|
|
1522
1536
|
};
|
|
1523
1537
|
}
|
|
1524
1538
|
return r;
|
|
1525
|
-
}),
|
|
1539
|
+
}), P = T(() => D.isMonth && w.eventCount && !w.eventsOnMonthView && k.value.length), I = T(() => {
|
|
1526
1540
|
var S;
|
|
1527
1541
|
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
|
|
1542
|
+
const r = Re[s.start.getDay()];
|
|
1543
|
+
let $ = (S = w.specialHours) == null ? void 0 : S[r];
|
|
1544
|
+
if ($)
|
|
1545
|
+
return Array.isArray($) || ($ = [$]), $.map((M) => {
|
|
1546
|
+
let { from: W, to: A, class: ee, label: de } = M;
|
|
1547
|
+
if (isNaN(W) || isNaN(A) || w.timeFrom >= A || w.timeTo <= W) return;
|
|
1548
|
+
W = Math.max(w.timeFrom, W), A = Math.min(w.timeTo, A);
|
|
1549
|
+
const he = Ve(W, w), g = Ve(A, w) - he;
|
|
1536
1550
|
return {
|
|
1537
|
-
style: { top: `${
|
|
1538
|
-
label:
|
|
1539
|
-
class:
|
|
1551
|
+
style: { top: `${he}%`, height: `${g}%` },
|
|
1552
|
+
label: de,
|
|
1553
|
+
class: ee
|
|
1540
1554
|
};
|
|
1541
|
-
}).filter((
|
|
1542
|
-
}),
|
|
1543
|
-
const { disableDays: r } = w,
|
|
1544
|
-
return r.length && r.includes(_.formatDate(s.start)) &&
|
|
1545
|
-
}),
|
|
1546
|
-
show:
|
|
1555
|
+
}).filter((M) => !!M);
|
|
1556
|
+
}), K = T(() => w.minTimestamp !== null && w.minTimestamp > s.end.getTime()), oe = T(() => w.maxTimestamp && w.maxTimestamp < s.start.getTime()), ae = T(() => {
|
|
1557
|
+
const { disableDays: r } = w, $ = D.isYear || D.isYears;
|
|
1558
|
+
return r.length && r.includes(_.formatDate(s.start)) && !$ ? !0 : K.value || oe.value;
|
|
1559
|
+
}), re = $e({
|
|
1560
|
+
show: T(() => {
|
|
1547
1561
|
if (!(!D.isDay && !D.isDays && !D.isWeek) && !(!o.value || !w.time) && !(w.timeFrom > _.dateToMinutes(D.now)) && !(_.dateToMinutes(D.now) > w.timeTo))
|
|
1548
1562
|
return !0;
|
|
1549
1563
|
}),
|
|
1550
|
-
nowInMinutes:
|
|
1551
|
-
todaysTimePosition:
|
|
1552
|
-
style:
|
|
1553
|
-
currentTime:
|
|
1554
|
-
}),
|
|
1555
|
-
if (
|
|
1564
|
+
nowInMinutes: T(() => _.dateToMinutes(D.now)),
|
|
1565
|
+
todaysTimePosition: T(() => Ve(re.nowInMinutes, w)),
|
|
1566
|
+
style: T(() => `top: ${re.todaysTimePosition}%`),
|
|
1567
|
+
currentTime: T(() => _.formatTime(D.now))
|
|
1568
|
+
}), De = T(() => {
|
|
1569
|
+
if (ae.value) return {};
|
|
1556
1570
|
const r = { ...w.eventListeners.cell };
|
|
1557
|
-
Object.entries(r).forEach(([
|
|
1558
|
-
r[
|
|
1559
|
-
var
|
|
1560
|
-
(
|
|
1571
|
+
Object.entries(r).forEach(([M, W]) => {
|
|
1572
|
+
r[M] = (A) => {
|
|
1573
|
+
var ee, de, he;
|
|
1574
|
+
(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
1575
|
};
|
|
1562
1576
|
});
|
|
1563
|
-
const
|
|
1577
|
+
const $ = { ...r };
|
|
1564
1578
|
let S = null;
|
|
1565
|
-
return r.click = (
|
|
1566
|
-
var
|
|
1567
|
-
|
|
1568
|
-
var
|
|
1569
|
-
S = null, (
|
|
1579
|
+
return r.click = (M) => {
|
|
1580
|
+
var W;
|
|
1581
|
+
ue(), (W = $.click) == null || W.call($, { e: M, cell: x.value, cursor: Q.value }), S ? S = clearTimeout(S) : S = setTimeout(() => {
|
|
1582
|
+
var A;
|
|
1583
|
+
S = null, (A = $["delayed-click"]) == null || A.call($, { e: M, cell: x.value, cursor: Q.value });
|
|
1570
1584
|
}, 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:
|
|
1585
|
+
}, (w.time && D.isDay || D.isDays || D.isWeek) && (r.touchstart = (M) => {
|
|
1586
|
+
var W;
|
|
1587
|
+
a(M.e || M), (W = $.touchstart) == null || W.call($, { e: M, cell: x.value, cursor: Q.value });
|
|
1588
|
+
}, r.mousedown = (M) => {
|
|
1589
|
+
var W;
|
|
1590
|
+
a(M.e || M), (W = $.mousedown) == null || W.call($, { e: M, cell: x.value, cursor: Q.value });
|
|
1591
|
+
}), $.dblclick && (r.dblclick = (M) => {
|
|
1592
|
+
var H, R;
|
|
1593
|
+
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);
|
|
1594
|
+
he.setMinutes(de);
|
|
1595
|
+
const g = {
|
|
1596
|
+
y: ee,
|
|
1597
|
+
date: he
|
|
1584
1598
|
};
|
|
1585
|
-
(
|
|
1586
|
-
}), w.editableEvents.drag && (r.dragenter = (
|
|
1587
|
-
|
|
1588
|
-
}, r.dragleave = (
|
|
1589
|
-
}), x =
|
|
1599
|
+
(R = $.dblclick) == null || R.call($, { e: M, cell: x.value, cursor: g });
|
|
1600
|
+
}), w.editableEvents.drag && (r.dragenter = (M) => m.cellDragEnter(M, x.value), r.dragover = (M) => {
|
|
1601
|
+
M.preventDefault(), m.cellDragOver(M, x.value);
|
|
1602
|
+
}, r.dragleave = (M) => m.cellDragLeave(M, x.value), r.drop = (M) => m.cellDragDrop(M, x.value)), r;
|
|
1603
|
+
}), x = T(() => ({
|
|
1590
1604
|
start: s.start,
|
|
1591
1605
|
end: s.end,
|
|
1592
1606
|
events: n,
|
|
1593
1607
|
...d.schedule ? { schedule: d.schedule } : {}
|
|
1594
|
-
})),
|
|
1595
|
-
const r =
|
|
1596
|
-
return
|
|
1608
|
+
})), Q = T(() => {
|
|
1609
|
+
const r = Pe(d.movePercentageY || d.startPercentageY, w), $ = new Date(s.start);
|
|
1610
|
+
return $.setMinutes(r), {
|
|
1597
1611
|
x: d.movePercentageX || d.startPercentageX,
|
|
1598
1612
|
y: d.movePercentageY || d.startPercentageY,
|
|
1599
|
-
date:
|
|
1613
|
+
date: $
|
|
1600
1614
|
};
|
|
1601
|
-
}),
|
|
1615
|
+
}), ue = () => {
|
|
1602
1616
|
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
1617
|
}, a = (r) => {
|
|
1604
|
-
var S,
|
|
1618
|
+
var S, M;
|
|
1605
1619
|
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, (
|
|
1620
|
+
const $ = f.value.getBoundingClientRect();
|
|
1621
|
+
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(() => {
|
|
1622
|
+
var W, A;
|
|
1623
|
+
d.holding = !0, (A = (W = De.value).hold) == null || A.call(W, { e: r, cell: x.value, cursor: Q.value });
|
|
1610
1624
|
}, 1e3);
|
|
1611
1625
|
}, 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 = (
|
|
1619
|
-
},
|
|
1626
|
+
var S, M, W, A, ee, de;
|
|
1627
|
+
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;
|
|
1628
|
+
const $ = f.value.getBoundingClientRect();
|
|
1629
|
+
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 });
|
|
1630
|
+
}, y = async (r) => {
|
|
1631
|
+
var $, S;
|
|
1632
|
+
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 q(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;
|
|
1633
|
+
}, q = async (r) => {
|
|
1620
1634
|
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
|
-
(
|
|
1635
|
+
let { start: $, end: S, startMinutes: M, endMinutes: W } = h.value;
|
|
1636
|
+
$ = new Date(s.start), $.setMinutes(M), S = new Date(s.start), S.setMinutes(W);
|
|
1637
|
+
let A = { ...h.value, start: $, end: S };
|
|
1638
|
+
const { create: ee } = w.eventListeners.event;
|
|
1639
|
+
if (typeof ee == "function") {
|
|
1640
|
+
const de = A;
|
|
1641
|
+
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);
|
|
1642
|
+
} else D.createEvent(A);
|
|
1643
|
+
}, J = () => {
|
|
1644
|
+
Object.keys(De.value).forEach((r) => {
|
|
1645
|
+
var $;
|
|
1646
|
+
($ = f.value) == null || $.removeEventListener(r, De.value[r]);
|
|
1633
1647
|
});
|
|
1634
|
-
},
|
|
1635
|
-
v.value =
|
|
1648
|
+
}, ce = () => {
|
|
1649
|
+
v.value = z.getCellOverlappingEvents(B.value);
|
|
1636
1650
|
};
|
|
1637
|
-
return
|
|
1651
|
+
return me(
|
|
1638
1652
|
// Watch event IDs and start/end dates (only) to detect event resizing/dnd.
|
|
1639
1653
|
() => k.value.map((r) => `${r._.id}${r.start.getTime()}${r.end.getTime()}`).join(),
|
|
1640
1654
|
async () => {
|
|
1641
|
-
await
|
|
1655
|
+
await Ue(), ce();
|
|
1642
1656
|
},
|
|
1643
1657
|
{ immediate: !0, flush: "post" }
|
|
1644
1658
|
// Use flush: 'post' to prevent infinite updates.
|
|
1645
|
-
),
|
|
1646
|
-
b.value.forEach((r) =>
|
|
1647
|
-
}), (r,
|
|
1648
|
-
class: ["vuecal__cell",
|
|
1659
|
+
), Xe(async () => {
|
|
1660
|
+
b.value.forEach((r) => z.deleteEvent(r, 3)), J(), await Ue();
|
|
1661
|
+
}), (r, $) => (Y(), j("div", ye({
|
|
1662
|
+
class: ["vuecal__cell", L.value],
|
|
1649
1663
|
ref_key: "cellEl",
|
|
1650
1664
|
ref: f
|
|
1651
|
-
},
|
|
1665
|
+
}, Ie(De.value, !0)), [
|
|
1652
1666
|
r.$slots.cell ? F(r.$slots, "cell", {
|
|
1653
1667
|
key: 0,
|
|
1654
1668
|
start: c.start,
|
|
1655
1669
|
end: c.end,
|
|
1656
1670
|
index: c.index,
|
|
1657
1671
|
events: n.value
|
|
1658
|
-
}) :
|
|
1659
|
-
|
|
1660
|
-
class:
|
|
1661
|
-
style:
|
|
1672
|
+
}) : U("", !0),
|
|
1673
|
+
I.value ? (Y(!0), j(te, { key: 1 }, pe(I.value, (S, M) => (Y(), j("div", {
|
|
1674
|
+
class: ke(["vuecal__special-hours", S.class]),
|
|
1675
|
+
style: Te(S.style),
|
|
1662
1676
|
innerHTML: S.label || ""
|
|
1663
|
-
}, null, 14,
|
|
1664
|
-
!r.$slots.cell && C(w).schedules ? (Y(!0), j(
|
|
1665
|
-
class:
|
|
1677
|
+
}, null, 14, Bt))), 256)) : U("", !0),
|
|
1678
|
+
!r.$slots.cell && C(w).schedules ? (Y(!0), j(te, { key: 2 }, pe(C(w).schedules, (S) => (Y(), j("div", {
|
|
1679
|
+
class: ke(["vuecal__schedule vuecal__schedule--cell", S.class]),
|
|
1666
1680
|
key: S.id,
|
|
1667
|
-
style:
|
|
1681
|
+
style: Te(S.style || null),
|
|
1668
1682
|
"data-schedule": S.id
|
|
1669
1683
|
}, [
|
|
1670
1684
|
r.$slots["cell-events"] ? F(r.$slots, "cell-events", {
|
|
@@ -1672,230 +1686,230 @@ const Ke = (c) => {
|
|
|
1672
1686
|
start: c.start,
|
|
1673
1687
|
end: c.end,
|
|
1674
1688
|
events: n.value
|
|
1675
|
-
}) :
|
|
1676
|
-
l.value || r.$slots["cell-date"] ? (Y(), j("div",
|
|
1689
|
+
}) : U("", !0),
|
|
1690
|
+
l.value || r.$slots["cell-date"] ? (Y(), j("div", It, [
|
|
1677
1691
|
F(r.$slots, "cell-date", {
|
|
1678
1692
|
start: c.start,
|
|
1679
1693
|
end: c.end,
|
|
1680
1694
|
events: n.value
|
|
1681
1695
|
}, () => [
|
|
1682
|
-
|
|
1696
|
+
xe(le(l.value), 1)
|
|
1683
1697
|
])
|
|
1684
|
-
])) :
|
|
1685
|
-
r.$slots["cell-content"] ? (Y(), j("div",
|
|
1698
|
+
])) : U("", !0),
|
|
1699
|
+
r.$slots["cell-content"] ? (Y(), j("div", Rt, [
|
|
1686
1700
|
F(r.$slots, "cell-content", {
|
|
1687
1701
|
start: c.start,
|
|
1688
1702
|
end: c.end,
|
|
1689
1703
|
events: n.value
|
|
1690
1704
|
})
|
|
1691
|
-
])) :
|
|
1692
|
-
r.$slots["cell-events"] && n.value.length ? (Y(), j("div",
|
|
1705
|
+
])) : U("", !0),
|
|
1706
|
+
r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Xt, [
|
|
1693
1707
|
F(r.$slots, "cell-events", {
|
|
1694
1708
|
start: c.start,
|
|
1695
1709
|
end: c.end,
|
|
1696
1710
|
events: n.value
|
|
1697
1711
|
})
|
|
1698
|
-
])) : n.value.length ||
|
|
1712
|
+
])) : n.value.length || N.value ? (Y(), Se(et, {
|
|
1699
1713
|
key: 4,
|
|
1700
1714
|
class: "vuecal__cell-events",
|
|
1701
1715
|
name: "vuecal-event-delete",
|
|
1702
|
-
onBeforeLeave:
|
|
1716
|
+
onBeforeLeave: $[0] || ($[0] = (M) => N.value = !0),
|
|
1703
1717
|
onAfterLeave: u,
|
|
1704
1718
|
tag: "div"
|
|
1705
1719
|
}, {
|
|
1706
|
-
default:
|
|
1707
|
-
(Y(!0), j(
|
|
1708
|
-
key:
|
|
1709
|
-
event:
|
|
1710
|
-
onEventDeleted:
|
|
1711
|
-
style:
|
|
1712
|
-
},
|
|
1720
|
+
default: Z(() => [
|
|
1721
|
+
(Y(!0), j(te, null, pe(t.value[S.id], (M) => (Y(), Se(at, {
|
|
1722
|
+
key: M._.id,
|
|
1723
|
+
event: M,
|
|
1724
|
+
onEventDeleted: G,
|
|
1725
|
+
style: Te(O.value[M._.id])
|
|
1726
|
+
}, je({ _: 2 }, [
|
|
1713
1727
|
r.$slots.event ? {
|
|
1714
1728
|
name: "event",
|
|
1715
|
-
fn:
|
|
1716
|
-
F(r.$slots, "event",
|
|
1729
|
+
fn: Z((W) => [
|
|
1730
|
+
F(r.$slots, "event", ye({ ref_for: !0 }, W))
|
|
1717
1731
|
]),
|
|
1718
1732
|
key: "0"
|
|
1719
1733
|
} : void 0
|
|
1720
1734
|
]), 1032, ["event", "style"]))), 128))
|
|
1721
1735
|
]),
|
|
1722
1736
|
_: 2
|
|
1723
|
-
}, 1024)) :
|
|
1737
|
+
}, 1024)) : U("", !0),
|
|
1724
1738
|
E.value && d.schedule === S.id ? (Y(), j("div", {
|
|
1725
1739
|
key: 5,
|
|
1726
1740
|
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",
|
|
1741
|
+
style: Te(h.value.style)
|
|
1742
|
+
}, le(h.value.start) + " - " + le(h.value.end), 5)) : U("", !0)
|
|
1743
|
+
], 14, At))), 128)) : U("", !0),
|
|
1744
|
+
!r.$slots.cell && !C(w).schedules ? (Y(), j(te, { key: 3 }, [
|
|
1745
|
+
r.$slots["cell-events"] ? F(r.$slots, "cell-events", { key: 0 }) : U("", !0),
|
|
1746
|
+
l.value || r.$slots["cell-date"] ? (Y(), j("div", Gt, [
|
|
1733
1747
|
F(r.$slots, "cell-date", {
|
|
1734
1748
|
start: c.start,
|
|
1735
1749
|
end: c.end,
|
|
1736
1750
|
events: n.value
|
|
1737
1751
|
}, () => [
|
|
1738
|
-
|
|
1752
|
+
xe(le(l.value), 1)
|
|
1739
1753
|
])
|
|
1740
|
-
])) :
|
|
1741
|
-
r.$slots["cell-content"] ? (Y(), j("div",
|
|
1754
|
+
])) : U("", !0),
|
|
1755
|
+
r.$slots["cell-content"] ? (Y(), j("div", qt, [
|
|
1742
1756
|
F(r.$slots, "cell-content", {
|
|
1743
1757
|
start: c.start,
|
|
1744
1758
|
end: c.end,
|
|
1745
1759
|
events: n.value
|
|
1746
1760
|
})
|
|
1747
|
-
])) :
|
|
1748
|
-
r.$slots["cell-events"] && n.value.length ? (Y(), j("div",
|
|
1761
|
+
])) : U("", !0),
|
|
1762
|
+
r.$slots["cell-events"] && n.value.length ? (Y(), j("div", Ut, [
|
|
1749
1763
|
F(r.$slots, "cell-events", {
|
|
1750
1764
|
start: c.start,
|
|
1751
1765
|
end: c.end,
|
|
1752
1766
|
events: n.value
|
|
1753
1767
|
})
|
|
1754
|
-
])) : (n.value.length ||
|
|
1768
|
+
])) : (n.value.length || N.value) && !(C(D).isMonth && !C(w).eventsOnMonthView) ? (Y(), Se(et, {
|
|
1755
1769
|
key: 4,
|
|
1756
1770
|
class: "vuecal__cell-events",
|
|
1757
1771
|
name: "vuecal-event-delete",
|
|
1758
|
-
onBeforeLeave:
|
|
1772
|
+
onBeforeLeave: $[1] || ($[1] = (S) => N.value = !0),
|
|
1759
1773
|
onAfterLeave: u,
|
|
1760
1774
|
tag: "div"
|
|
1761
1775
|
}, {
|
|
1762
|
-
default:
|
|
1763
|
-
(Y(!0), j(
|
|
1776
|
+
default: Z(() => [
|
|
1777
|
+
(Y(!0), j(te, null, pe(n.value, (S) => (Y(), Se(at, {
|
|
1764
1778
|
key: S._.id,
|
|
1765
1779
|
event: S,
|
|
1766
|
-
onEventDeleted:
|
|
1767
|
-
style:
|
|
1768
|
-
},
|
|
1780
|
+
onEventDeleted: G,
|
|
1781
|
+
style: Te(O.value[S._.id])
|
|
1782
|
+
}, je({ _: 2 }, [
|
|
1769
1783
|
r.$slots.event ? {
|
|
1770
1784
|
name: "event",
|
|
1771
|
-
fn:
|
|
1772
|
-
F(r.$slots, "event",
|
|
1785
|
+
fn: Z((M) => [
|
|
1786
|
+
F(r.$slots, "event", ye({ ref_for: !0 }, M))
|
|
1773
1787
|
]),
|
|
1774
1788
|
key: "0"
|
|
1775
1789
|
} : void 0
|
|
1776
1790
|
]), 1032, ["event", "style"]))), 128))
|
|
1777
1791
|
]),
|
|
1778
1792
|
_: 3
|
|
1779
|
-
})) :
|
|
1793
|
+
})) : U("", !0),
|
|
1780
1794
|
E.value ? (Y(), j("div", {
|
|
1781
1795
|
key: 5,
|
|
1782
1796
|
class: "vuecal__event-placeholder",
|
|
1783
|
-
style:
|
|
1784
|
-
},
|
|
1785
|
-
], 64)) :
|
|
1797
|
+
style: Te(h.value.style)
|
|
1798
|
+
}, le(h.value.start) + " - " + le(h.value.end), 5)) : U("", !0)
|
|
1799
|
+
], 64)) : U("", !0),
|
|
1786
1800
|
r.$slots["event-count"] ? F(r.$slots, "event-count", {
|
|
1787
1801
|
key: 4,
|
|
1788
1802
|
events: k.value
|
|
1789
|
-
}) :
|
|
1790
|
-
|
|
1803
|
+
}) : P.value ? (Y(), j("div", Zt, le(k.value.length), 1)) : U("", !0),
|
|
1804
|
+
re.show ? (Y(), j("div", {
|
|
1791
1805
|
key: 6,
|
|
1792
1806
|
class: "vuecal__now-line",
|
|
1793
|
-
style:
|
|
1794
|
-
title:
|
|
1807
|
+
style: Te(re.style),
|
|
1808
|
+
title: re.currentTime
|
|
1795
1809
|
}, [
|
|
1796
|
-
|
|
1797
|
-
], 12,
|
|
1810
|
+
ge("span", null, le(re.currentTime), 1)
|
|
1811
|
+
], 12, Jt)) : U("", !0)
|
|
1798
1812
|
], 16));
|
|
1799
1813
|
}
|
|
1800
|
-
},
|
|
1814
|
+
}, Qt = {
|
|
1801
1815
|
__name: "body",
|
|
1802
1816
|
setup(c) {
|
|
1803
|
-
const s =
|
|
1817
|
+
const s = Ne("vuecal");
|
|
1804
1818
|
let { view: i, config: D, dateUtils: w } = s;
|
|
1805
|
-
const _ =
|
|
1819
|
+
const _ = ie(null), z = ie(null), m = T(() => ({
|
|
1806
1820
|
"--vuecal-grid-columns": i.cols,
|
|
1807
1821
|
"--vuecal-grid-rows": i.rows
|
|
1808
|
-
})), V =
|
|
1809
|
-
const b = w.formatTime(
|
|
1822
|
+
})), V = T(() => {
|
|
1823
|
+
const b = w.formatTime(Pe(z.value, D));
|
|
1810
1824
|
return {
|
|
1811
|
-
style: { top:
|
|
1825
|
+
style: { top: z.value + "%" },
|
|
1812
1826
|
time: b
|
|
1813
1827
|
};
|
|
1814
1828
|
}), o = (b) => {
|
|
1815
1829
|
var u;
|
|
1816
1830
|
if (i.isMonth || i.isYear || i.isYears) return;
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1831
|
+
const N = (((u = b.touches) == null ? void 0 : u[0]) || b).clientY, { top: G } = _.value.getBoundingClientRect();
|
|
1832
|
+
z.value = Je(N - G, _.value);
|
|
1819
1833
|
}, f = () => {
|
|
1820
|
-
|
|
1834
|
+
z.value = null;
|
|
1821
1835
|
};
|
|
1822
|
-
return
|
|
1836
|
+
return Ze(() => {
|
|
1823
1837
|
_.value.addEventListener("mousemove", o), _.value.addEventListener("touchmove", o), _.value.addEventListener("mouseleave", f), _.value.addEventListener("touchend", f);
|
|
1824
|
-
}),
|
|
1838
|
+
}), Xe(() => {
|
|
1825
1839
|
_.value && (_.value.removeEventListener("mousemove", o), _.value.removeEventListener("touchmove", o), _.value.removeEventListener("mouseleave", f), _.value.removeEventListener("touchend", f));
|
|
1826
|
-
}), (b,
|
|
1840
|
+
}), (b, N) => (Y(), j("div", {
|
|
1827
1841
|
class: "vuecal__body",
|
|
1828
1842
|
ref_key: "bodyEl",
|
|
1829
1843
|
ref: _,
|
|
1830
|
-
style:
|
|
1844
|
+
style: Te(m.value)
|
|
1831
1845
|
}, [
|
|
1832
|
-
|
|
1833
|
-
default:
|
|
1834
|
-
C(D).timeAtCursor &&
|
|
1846
|
+
Oe(Ge, { name: "vuecal-shrink" }, {
|
|
1847
|
+
default: Z(() => [
|
|
1848
|
+
C(D).timeAtCursor && z.value !== null ? (Y(), j("div", {
|
|
1835
1849
|
key: 0,
|
|
1836
1850
|
class: "vuecal__time-at-cursor",
|
|
1837
|
-
style:
|
|
1851
|
+
style: Te(V.value.style)
|
|
1838
1852
|
}, [
|
|
1839
|
-
|
|
1840
|
-
], 4)) :
|
|
1853
|
+
ge("label", null, le(V.value.time), 1)
|
|
1854
|
+
], 4)) : U("", !0)
|
|
1841
1855
|
]),
|
|
1842
1856
|
_: 1
|
|
1843
1857
|
}),
|
|
1844
|
-
(Y(!0), j(
|
|
1858
|
+
(Y(!0), j(te, null, pe(C(i).cellDates, (G, u) => (Y(), Se(Kt, {
|
|
1845
1859
|
key: u,
|
|
1846
|
-
start:
|
|
1847
|
-
end:
|
|
1860
|
+
start: G.start,
|
|
1861
|
+
end: G.end,
|
|
1848
1862
|
index: u
|
|
1849
|
-
},
|
|
1863
|
+
}, je({ _: 2 }, [
|
|
1850
1864
|
b.$slots.cell ? {
|
|
1851
1865
|
name: "cell",
|
|
1852
|
-
fn:
|
|
1853
|
-
F(b.$slots, "cell",
|
|
1866
|
+
fn: Z((d) => [
|
|
1867
|
+
F(b.$slots, "cell", ye({ ref_for: !0 }, d))
|
|
1854
1868
|
]),
|
|
1855
1869
|
key: "0"
|
|
1856
1870
|
} : void 0,
|
|
1857
1871
|
b.$slots["cell-date"] ? {
|
|
1858
1872
|
name: "cell-date",
|
|
1859
|
-
fn:
|
|
1860
|
-
F(b.$slots, "cell-date",
|
|
1873
|
+
fn: Z((d) => [
|
|
1874
|
+
F(b.$slots, "cell-date", ye({ ref_for: !0 }, d))
|
|
1861
1875
|
]),
|
|
1862
1876
|
key: "1"
|
|
1863
1877
|
} : void 0,
|
|
1864
1878
|
b.$slots["cell-content"] ? {
|
|
1865
1879
|
name: "cell-content",
|
|
1866
|
-
fn:
|
|
1867
|
-
F(b.$slots, "cell-content",
|
|
1880
|
+
fn: Z((d) => [
|
|
1881
|
+
F(b.$slots, "cell-content", ye({ ref_for: !0 }, d))
|
|
1868
1882
|
]),
|
|
1869
1883
|
key: "2"
|
|
1870
1884
|
} : void 0,
|
|
1871
1885
|
b.$slots["cell-events"] ? {
|
|
1872
1886
|
name: "cell-events",
|
|
1873
|
-
fn:
|
|
1874
|
-
F(b.$slots, "cell-events",
|
|
1887
|
+
fn: Z((d) => [
|
|
1888
|
+
F(b.$slots, "cell-events", ye({ ref_for: !0 }, d))
|
|
1875
1889
|
]),
|
|
1876
1890
|
key: "3"
|
|
1877
1891
|
} : b.$slots.event ? {
|
|
1878
1892
|
name: "event",
|
|
1879
|
-
fn:
|
|
1880
|
-
F(b.$slots, "event",
|
|
1893
|
+
fn: Z((d) => [
|
|
1894
|
+
F(b.$slots, "event", ye({ ref_for: !0 }, d))
|
|
1881
1895
|
]),
|
|
1882
1896
|
key: "4"
|
|
1883
1897
|
} : b.$slots["event-count"] ? {
|
|
1884
1898
|
name: "event-count",
|
|
1885
|
-
fn:
|
|
1886
|
-
F(b.$slots, "event-count",
|
|
1899
|
+
fn: Z((d) => [
|
|
1900
|
+
F(b.$slots, "event-count", ye({ ref_for: !0 }, d))
|
|
1887
1901
|
]),
|
|
1888
1902
|
key: "5"
|
|
1889
1903
|
} : void 0
|
|
1890
1904
|
]), 1032, ["start", "end", "index"]))), 128))
|
|
1891
1905
|
], 4));
|
|
1892
1906
|
}
|
|
1893
|
-
},
|
|
1907
|
+
}, xt = ["data-locale"], ea = { class: "vuecal__scrollable-wrap" }, ta = {
|
|
1894
1908
|
key: 1,
|
|
1895
1909
|
class: "vuecal__week-numbers"
|
|
1896
|
-
},
|
|
1910
|
+
}, aa = { class: "vuecal__week-number" }, sa = { class: "vuecal__body-wrap" }, la = {
|
|
1897
1911
|
__name: "index",
|
|
1898
|
-
props:
|
|
1912
|
+
props: Dt,
|
|
1899
1913
|
emits: [
|
|
1900
1914
|
"ready",
|
|
1901
1915
|
"view-change",
|
|
@@ -1909,175 +1923,175 @@ const Ke = (c) => {
|
|
|
1909
1923
|
"event-change"
|
|
1910
1924
|
],
|
|
1911
1925
|
setup(c, { expose: s, emit: i }) {
|
|
1912
|
-
const D = c, w = i, _ =
|
|
1926
|
+
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)))), G = T(() => {
|
|
1913
1927
|
var e;
|
|
1914
1928
|
return {
|
|
1915
|
-
"vuecal--ready":
|
|
1916
|
-
[`vuecal--${
|
|
1917
|
-
[`vuecal--${
|
|
1918
|
-
"vuecal--date-picker":
|
|
1919
|
-
"vuecal--dark":
|
|
1920
|
-
"vuecal--light": !
|
|
1929
|
+
"vuecal--ready": m.ready,
|
|
1930
|
+
[`vuecal--${m.theme}-theme`]: m.theme,
|
|
1931
|
+
[`vuecal--${m.size}`]: !0,
|
|
1932
|
+
"vuecal--date-picker": m.datePicker,
|
|
1933
|
+
"vuecal--dark": m.dark,
|
|
1934
|
+
"vuecal--light": !m.dark,
|
|
1921
1935
|
[`vuecal--${V.id}-view`]: !0,
|
|
1922
1936
|
"vuecal--view-has-time": b.value,
|
|
1923
|
-
"vuecal--timeless": !
|
|
1937
|
+
"vuecal--timeless": !m.time,
|
|
1924
1938
|
"vuecal--dragging-cell": f.isDraggingCell,
|
|
1925
1939
|
"vuecal--dragging-event": f.isDraggingEvent,
|
|
1926
1940
|
"vuecal--resizing-event": f.isResizingEvent,
|
|
1927
|
-
"vuecal--has-schedules": (e =
|
|
1941
|
+
"vuecal--has-schedules": (e = m.schedules) == null ? void 0 : e.length
|
|
1928
1942
|
};
|
|
1929
|
-
}), u =
|
|
1930
|
-
"--vuecal-time-cell-height":
|
|
1931
|
-
})), d =
|
|
1943
|
+
}), u = T(() => ({
|
|
1944
|
+
"--vuecal-time-cell-height": m.timeCellHeight && `${m.timeCellHeight}px`
|
|
1945
|
+
})), d = T(() => {
|
|
1932
1946
|
var e, v;
|
|
1933
1947
|
return {
|
|
1934
|
-
"vuecal__scrollable--row": b.value ||
|
|
1948
|
+
"vuecal__scrollable--row": b.value || m.weekNumbers && V.isMonth,
|
|
1935
1949
|
// Keep the states inside the Vue transition wrapper for smooth CSS transitions.
|
|
1936
1950
|
[`vuecal__scrollable--${V.id}-view`]: !0,
|
|
1937
|
-
"vuecal__scrollable--has-schedules": (e =
|
|
1938
|
-
"vuecal__scrollable--no-schedules": !((v =
|
|
1951
|
+
"vuecal__scrollable--has-schedules": (e = m.schedules) == null ? void 0 : e.length,
|
|
1952
|
+
"vuecal__scrollable--no-schedules": !((v = m.schedules) != null && v.length)
|
|
1939
1953
|
};
|
|
1940
1954
|
});
|
|
1941
|
-
return
|
|
1942
|
-
await
|
|
1943
|
-
}),
|
|
1944
|
-
class:
|
|
1955
|
+
return Ze(async () => {
|
|
1956
|
+
await Ue(), w("ready", { config: m, view: V });
|
|
1957
|
+
}), me(() => m.locale, (e) => m.loadTexts(e)), ut("vuecal", z), s({ view: z.view }), (e, v) => (Y(), j("div", {
|
|
1958
|
+
class: ke(["vuecal", G.value]),
|
|
1945
1959
|
ref: "vuecal-el",
|
|
1946
1960
|
"data-locale": e.locale,
|
|
1947
|
-
style:
|
|
1961
|
+
style: Te(u.value)
|
|
1948
1962
|
}, [
|
|
1949
1963
|
e.$slots.diy ? F(e.$slots, "diy", {
|
|
1950
1964
|
key: 0,
|
|
1951
|
-
vuecal: C(
|
|
1965
|
+
vuecal: C(z),
|
|
1952
1966
|
view: C(V),
|
|
1953
|
-
availableViews: C(
|
|
1954
|
-
}) : (Y(), j(
|
|
1955
|
-
|
|
1967
|
+
availableViews: C(m).availableViews
|
|
1968
|
+
}) : (Y(), j(te, { key: 1 }, [
|
|
1969
|
+
Oe($t, null, je({ _: 2 }, [
|
|
1956
1970
|
e.$slots.header ? {
|
|
1957
1971
|
name: "header",
|
|
1958
|
-
fn:
|
|
1959
|
-
F(e.$slots, "header", ne(
|
|
1972
|
+
fn: Z((h) => [
|
|
1973
|
+
F(e.$slots, "header", se(ne(h)))
|
|
1960
1974
|
]),
|
|
1961
1975
|
key: "0"
|
|
1962
1976
|
} : void 0,
|
|
1963
1977
|
!e.$slots.header && e.$slots["previous-button"] ? {
|
|
1964
1978
|
name: "previous-button",
|
|
1965
|
-
fn:
|
|
1966
|
-
F(e.$slots, "previous-button", ne(
|
|
1979
|
+
fn: Z((h) => [
|
|
1980
|
+
F(e.$slots, "previous-button", se(ne(h)))
|
|
1967
1981
|
]),
|
|
1968
1982
|
key: "1"
|
|
1969
1983
|
} : void 0,
|
|
1970
1984
|
!e.$slots.header && e.$slots["next-button"] ? {
|
|
1971
1985
|
name: "next-button",
|
|
1972
|
-
fn:
|
|
1973
|
-
F(e.$slots, "next-button", ne(
|
|
1986
|
+
fn: Z((h) => [
|
|
1987
|
+
F(e.$slots, "next-button", se(ne(h)))
|
|
1974
1988
|
]),
|
|
1975
1989
|
key: "2"
|
|
1976
1990
|
} : void 0,
|
|
1977
1991
|
!e.$slots.header && e.$slots["today-button"] ? {
|
|
1978
1992
|
name: "today-button",
|
|
1979
|
-
fn:
|
|
1980
|
-
F(e.$slots, "today-button", ne(
|
|
1993
|
+
fn: Z((h) => [
|
|
1994
|
+
F(e.$slots, "today-button", se(ne(h)))
|
|
1981
1995
|
]),
|
|
1982
1996
|
key: "3"
|
|
1983
1997
|
} : void 0,
|
|
1984
1998
|
!e.$slots.header && e.$slots.title ? {
|
|
1985
1999
|
name: "title",
|
|
1986
|
-
fn:
|
|
1987
|
-
F(e.$slots, "title", ne(
|
|
2000
|
+
fn: Z((h) => [
|
|
2001
|
+
F(e.$slots, "title", se(ne(h)))
|
|
1988
2002
|
]),
|
|
1989
2003
|
key: "4"
|
|
1990
2004
|
} : void 0,
|
|
1991
2005
|
!e.$slots.header && e.$slots["schedule-heading"] ? {
|
|
1992
2006
|
name: "schedule-heading",
|
|
1993
|
-
fn:
|
|
1994
|
-
F(e.$slots, "schedule-heading", ne(
|
|
2007
|
+
fn: Z((h) => [
|
|
2008
|
+
F(e.$slots, "schedule-heading", se(ne(h)))
|
|
1995
2009
|
]),
|
|
1996
2010
|
key: "5"
|
|
1997
2011
|
} : void 0
|
|
1998
2012
|
]), 1024),
|
|
1999
|
-
|
|
2000
|
-
|
|
2013
|
+
ge("div", ea, [
|
|
2014
|
+
Oe(Ge, {
|
|
2001
2015
|
name: `vuecal-slide-fade--${C(V).transitionDirection}`
|
|
2002
2016
|
}, {
|
|
2003
|
-
default:
|
|
2017
|
+
default: Z(() => [
|
|
2004
2018
|
(Y(), j("div", {
|
|
2005
|
-
class:
|
|
2019
|
+
class: ke(["vuecal__scrollable", d.value]),
|
|
2006
2020
|
key: C(V).id + C(V).start.getTime()
|
|
2007
2021
|
}, [
|
|
2008
|
-
b.value ? (Y(),
|
|
2022
|
+
b.value ? (Y(), Se(Ht, { key: 0 }, je({ _: 2 }, [
|
|
2009
2023
|
e.$slots["time-cell"] ? {
|
|
2010
2024
|
name: "time-cell",
|
|
2011
|
-
fn:
|
|
2012
|
-
F(e.$slots, "time-cell", ne(
|
|
2025
|
+
fn: Z((h) => [
|
|
2026
|
+
F(e.$slots, "time-cell", se(ne(h)))
|
|
2013
2027
|
]),
|
|
2014
2028
|
key: "0"
|
|
2015
2029
|
} : void 0
|
|
2016
|
-
]), 1024)) :
|
|
2017
|
-
C(
|
|
2018
|
-
(Y(!0), j(
|
|
2030
|
+
]), 1024)) : U("", !0),
|
|
2031
|
+
C(m).weekNumbers && C(V).isMonth ? (Y(), j("div", ta, [
|
|
2032
|
+
(Y(!0), j(te, null, pe(N.value, (h) => (Y(), j("div", aa, [
|
|
2019
2033
|
F(e.$slots, "week-number", {}, () => [
|
|
2020
|
-
|
|
2034
|
+
ge("small", null, le(h), 1)
|
|
2021
2035
|
])
|
|
2022
2036
|
]))), 256))
|
|
2023
|
-
])) :
|
|
2024
|
-
|
|
2025
|
-
|
|
2037
|
+
])) : U("", !0),
|
|
2038
|
+
ge("div", sa, [
|
|
2039
|
+
Oe(jt, null, je({ _: 2 }, [
|
|
2026
2040
|
e.$slots["weekday-heading"] ? {
|
|
2027
2041
|
name: "weekday-heading",
|
|
2028
|
-
fn:
|
|
2029
|
-
F(e.$slots, "weekday-heading", ne(
|
|
2042
|
+
fn: Z((h) => [
|
|
2043
|
+
F(e.$slots, "weekday-heading", se(ne(h)))
|
|
2030
2044
|
]),
|
|
2031
2045
|
key: "0"
|
|
2032
2046
|
} : void 0,
|
|
2033
2047
|
e.$slots["schedule-heading"] ? {
|
|
2034
2048
|
name: "schedule-heading",
|
|
2035
|
-
fn:
|
|
2036
|
-
F(e.$slots, "schedule-heading", ne(
|
|
2049
|
+
fn: Z((h) => [
|
|
2050
|
+
F(e.$slots, "schedule-heading", se(ne(h)))
|
|
2037
2051
|
]),
|
|
2038
2052
|
key: "1"
|
|
2039
2053
|
} : void 0
|
|
2040
2054
|
]), 1024),
|
|
2041
|
-
|
|
2055
|
+
Oe(Qt, null, je({ _: 2 }, [
|
|
2042
2056
|
e.$slots.cell ? {
|
|
2043
2057
|
name: "cell",
|
|
2044
|
-
fn:
|
|
2045
|
-
F(e.$slots, "cell", ne(
|
|
2058
|
+
fn: Z((h) => [
|
|
2059
|
+
F(e.$slots, "cell", se(ne(h)))
|
|
2046
2060
|
]),
|
|
2047
2061
|
key: "0"
|
|
2048
2062
|
} : void 0,
|
|
2049
2063
|
!e.$slots.cell && e.$slots["cell-date"] ? {
|
|
2050
2064
|
name: "cell-date",
|
|
2051
|
-
fn:
|
|
2052
|
-
F(e.$slots, "cell-date", ne(
|
|
2065
|
+
fn: Z((h) => [
|
|
2066
|
+
F(e.$slots, "cell-date", se(ne(h)))
|
|
2053
2067
|
]),
|
|
2054
2068
|
key: "1"
|
|
2055
2069
|
} : void 0,
|
|
2056
2070
|
!e.$slots.cell && e.$slots["cell-content"] ? {
|
|
2057
2071
|
name: "cell-content",
|
|
2058
|
-
fn:
|
|
2059
|
-
F(e.$slots, "cell-content", ne(
|
|
2072
|
+
fn: Z((h) => [
|
|
2073
|
+
F(e.$slots, "cell-content", se(ne(h)))
|
|
2060
2074
|
]),
|
|
2061
2075
|
key: "2"
|
|
2062
2076
|
} : void 0,
|
|
2063
2077
|
!e.$slots.cell && e.$slots["cell-events"] ? {
|
|
2064
2078
|
name: "cell-events",
|
|
2065
|
-
fn:
|
|
2066
|
-
F(e.$slots, "cell-events", ne(
|
|
2079
|
+
fn: Z((h) => [
|
|
2080
|
+
F(e.$slots, "cell-events", se(ne(h)))
|
|
2067
2081
|
]),
|
|
2068
2082
|
key: "3"
|
|
2069
2083
|
} : void 0,
|
|
2070
2084
|
!e.$slots.cell && e.$slots.event ? {
|
|
2071
2085
|
name: "event",
|
|
2072
|
-
fn:
|
|
2073
|
-
F(e.$slots, "event", ne(
|
|
2086
|
+
fn: Z((h) => [
|
|
2087
|
+
F(e.$slots, "event", se(ne(h)))
|
|
2074
2088
|
]),
|
|
2075
2089
|
key: "4"
|
|
2076
2090
|
} : void 0,
|
|
2077
2091
|
!e.$slots.cell && e.$slots["event-count"] ? {
|
|
2078
2092
|
name: "event-count",
|
|
2079
|
-
fn:
|
|
2080
|
-
F(e.$slots, "event-count", ne(
|
|
2093
|
+
fn: Z((h) => [
|
|
2094
|
+
F(e.$slots, "event-count", se(ne(h)))
|
|
2081
2095
|
]),
|
|
2082
2096
|
key: "5"
|
|
2083
2097
|
} : void 0
|
|
@@ -2089,63 +2103,63 @@ const Ke = (c) => {
|
|
|
2089
2103
|
}, 8, ["name"])
|
|
2090
2104
|
])
|
|
2091
2105
|
], 64))
|
|
2092
|
-
], 14,
|
|
2106
|
+
], 14, xt));
|
|
2093
2107
|
}
|
|
2094
|
-
},
|
|
2095
|
-
|
|
2108
|
+
}, ra = (c) => {
|
|
2109
|
+
Fe.texts = { ...fe.texts, ...c }, Fe.dateUtils.updateTexts(Fe.texts);
|
|
2096
2110
|
}, {
|
|
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
|
-
} =
|
|
2111
|
+
addDatePrototypes: ia,
|
|
2112
|
+
removeDatePrototypes: oa,
|
|
2113
|
+
updateTexts: ua,
|
|
2114
|
+
addDays: ca,
|
|
2115
|
+
subtractDays: da,
|
|
2116
|
+
addHours: va,
|
|
2117
|
+
subtractHours: ma,
|
|
2118
|
+
addMinutes: fa,
|
|
2119
|
+
subtractMinutes: ga,
|
|
2120
|
+
getWeek: ha,
|
|
2121
|
+
isToday: ya,
|
|
2122
|
+
isSameDate: Da,
|
|
2123
|
+
isInRange: wa,
|
|
2124
|
+
isLeapYear: pa,
|
|
2125
|
+
getPreviousFirstDayOfWeek: ka,
|
|
2126
|
+
stringToDate: _a,
|
|
2127
|
+
dateToMinutes: ba,
|
|
2128
|
+
countDays: Ta,
|
|
2129
|
+
datesInSameTimeStep: $a,
|
|
2130
|
+
isValid: Ma,
|
|
2131
|
+
formatDate: Ea,
|
|
2132
|
+
formatDateLite: Ya,
|
|
2133
|
+
formatTime: Sa,
|
|
2134
|
+
formatTimeLite: Ca,
|
|
2135
|
+
formatMinutes: Va
|
|
2136
|
+
} = Fe.dateUtils;
|
|
2123
2137
|
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
|
-
|
|
2138
|
+
la as VueCal,
|
|
2139
|
+
ia as addDatePrototypes,
|
|
2140
|
+
ca as addDays,
|
|
2141
|
+
va as addHours,
|
|
2142
|
+
fa as addMinutes,
|
|
2143
|
+
Ta as countDays,
|
|
2144
|
+
ba as dateToMinutes,
|
|
2145
|
+
$a as datesInSameTimeStep,
|
|
2146
|
+
Ea as formatDate,
|
|
2147
|
+
Ya as formatDateLite,
|
|
2148
|
+
Va as formatMinutes,
|
|
2149
|
+
Sa as formatTime,
|
|
2150
|
+
Ca as formatTimeLite,
|
|
2151
|
+
ka as getPreviousFirstDayOfWeek,
|
|
2152
|
+
ha as getWeek,
|
|
2153
|
+
wa as isInRange,
|
|
2154
|
+
pa as isLeapYear,
|
|
2155
|
+
Da as isSameDate,
|
|
2156
|
+
ya as isToday,
|
|
2157
|
+
Ma as isValidDate,
|
|
2158
|
+
oa as removeDatePrototypes,
|
|
2159
|
+
_a as stringToDate,
|
|
2160
|
+
da as subtractDays,
|
|
2161
|
+
ma as subtractHours,
|
|
2162
|
+
ga as subtractMinutes,
|
|
2163
|
+
ua as updateTexts,
|
|
2164
|
+
ra as useLocale
|
|
2151
2165
|
};
|