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