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