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