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