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