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