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