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