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