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