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