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