@cocoar/vue-calendar 1.16.0
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 +257 -0
- package/dist/__test-utils__/event-fixtures.d.ts +4 -0
- package/dist/__test-utils__/event-fixtures.d.ts.map +1 -0
- package/dist/builders/calendar-builder-internals.d.ts +14 -0
- package/dist/builders/calendar-builder-internals.d.ts.map +1 -0
- package/dist/builders/calendar-builder.d.ts +296 -0
- package/dist/builders/calendar-builder.d.ts.map +1 -0
- package/dist/builders/event-zone-hints.d.ts +20 -0
- package/dist/builders/event-zone-hints.d.ts.map +1 -0
- package/dist/builders/render-helpers.d.ts +19 -0
- package/dist/builders/render-helpers.d.ts.map +1 -0
- package/dist/builders/types.d.ts +175 -0
- package/dist/builders/types.d.ts.map +1 -0
- package/dist/components/CoarCalendar.vue.d.ts +150 -0
- package/dist/components/CoarCalendar.vue.d.ts.map +1 -0
- package/dist/components/CoarDisplayZoneSwitcher.vue.d.ts +28 -0
- package/dist/components/CoarDisplayZoneSwitcher.vue.d.ts.map +1 -0
- package/dist/components/VirtualizedSurface1DY.vue.d.ts +90 -0
- package/dist/components/VirtualizedSurface1DY.vue.d.ts.map +1 -0
- package/dist/components/VirtualizedSurface2D.vue.d.ts +71 -0
- package/dist/components/VirtualizedSurface2D.vue.d.ts.map +1 -0
- package/dist/components/internal/CoarEventDecorations.vue.d.ts +13 -0
- package/dist/components/internal/CoarEventDecorations.vue.d.ts.map +1 -0
- package/dist/components/internal/RenderEventFallback.d.ts +17 -0
- package/dist/components/internal/RenderEventFallback.d.ts.map +1 -0
- package/dist/components/internal/agenda/CoarAgendaDayHeader.vue.d.ts +54 -0
- package/dist/components/internal/agenda/CoarAgendaDayHeader.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthBar.vue.d.ts +80 -0
- package/dist/components/internal/month/CoarMonthBar.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts +74 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthGrid.vue.d.ts +50 -0
- package/dist/components/internal/month/CoarMonthGrid.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthPill.vue.d.ts +83 -0
- package/dist/components/internal/month/CoarMonthPill.vue.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthRow.vue.d.ts +44 -0
- package/dist/components/internal/month/CoarMonthRow.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts +39 -0
- package/dist/components/internal/time-grid/CoarTimeGridAllDayBand.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts +44 -0
- package/dist/components/internal/time-grid/CoarTimeGridColumn.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts +44 -0
- package/dist/components/internal/time-grid/CoarTimeGridHeader.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridNowMarker.vue.d.ts +18 -0
- package/dist/components/internal/time-grid/CoarTimeGridNowMarker.vue.d.ts.map +1 -0
- package/dist/composables/useA11yAnnouncer.d.ts +9 -0
- package/dist/composables/useA11yAnnouncer.d.ts.map +1 -0
- package/dist/composables/useCalendarDnd.d.ts +212 -0
- package/dist/composables/useCalendarDnd.d.ts.map +1 -0
- package/dist/composables/useCoarDrag.d.ts +97 -0
- package/dist/composables/useCoarDrag.d.ts.map +1 -0
- package/dist/composables/useMonthDnd.d.ts +89 -0
- package/dist/composables/useMonthDnd.d.ts.map +1 -0
- package/dist/composables/useMonthExpansion.d.ts +35 -0
- package/dist/composables/useMonthExpansion.d.ts.map +1 -0
- package/dist/composables/useTimeGridDnd.d.ts +104 -0
- package/dist/composables/useTimeGridDnd.d.ts.map +1 -0
- package/dist/composables/useViewWindow.d.ts +14 -0
- package/dist/composables/useViewWindow.d.ts.map +1 -0
- package/dist/core/agendaLayout.d.ts +47 -0
- package/dist/core/agendaLayout.d.ts.map +1 -0
- package/dist/core/dnd/move-math.d.ts +136 -0
- package/dist/core/dnd/move-math.d.ts.map +1 -0
- package/dist/core/dragHitTest.d.ts +74 -0
- package/dist/core/dragHitTest.d.ts.map +1 -0
- package/dist/core/eventIndex.d.ts +106 -0
- package/dist/core/eventIndex.d.ts.map +1 -0
- package/dist/core/index.d.ts +32 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/measurementCache.d.ts +87 -0
- package/dist/core/measurementCache.d.ts.map +1 -0
- package/dist/core/monthGridLayout.d.ts +68 -0
- package/dist/core/monthGridLayout.d.ts.map +1 -0
- package/dist/core/overlapLayout.d.ts +88 -0
- package/dist/core/overlapLayout.d.ts.map +1 -0
- package/dist/core/recurrence-public.d.ts +59 -0
- package/dist/core/recurrence-public.d.ts.map +1 -0
- package/dist/core/recurrence.d.ts +112 -0
- package/dist/core/recurrence.d.ts.map +1 -0
- package/dist/core/recurrenceWorker.d.ts +62 -0
- package/dist/core/recurrenceWorker.d.ts.map +1 -0
- package/dist/core/temporal.d.ts +214 -0
- package/dist/core/temporal.d.ts.map +1 -0
- package/dist/core/timeGridLayout.d.ts +109 -0
- package/dist/core/timeGridLayout.d.ts.map +1 -0
- package/dist/core/types.d.ts +211 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/viewWindow.d.ts +53 -0
- package/dist/core/viewWindow.d.ts.map +1 -0
- package/dist/core/virtualScroll.d.ts +91 -0
- package/dist/core/virtualScroll.d.ts.map +1 -0
- package/dist/core-DK63eHat.js +959 -0
- package/dist/core.js +2 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4221 -0
- package/dist/useAgendaView.d.ts +6 -0
- package/dist/useAgendaView.d.ts.map +1 -0
- package/dist/useCalendar.d.ts +6 -0
- package/dist/useCalendar.d.ts.map +1 -0
- package/dist/useDayView.d.ts +6 -0
- package/dist/useDayView.d.ts.map +1 -0
- package/dist/useMonthView.d.ts +6 -0
- package/dist/useMonthView.d.ts.map +1 -0
- package/dist/useWeekView.d.ts +6 -0
- package/dist/useWeekView.d.ts.map +1 -0
- package/dist/vue-calendar.css +2 -0
- package/package.json +68 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4221 @@
|
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, L as l, M as u, N as d, O as f, P as p, R as m, S as h, T as g, U as _, V as v, W as y, _ as b, a as x, b as S, c as ee, d as C, f as te, g as w, h as ne, i as T, j as E, k as re, l as D, m as ie, n as ae, o as oe, p as se, r as O, s as ce, t as le, u as ue, v as de, w as k, x as fe, y as pe, z as me } from "./core-DK63eHat.js";
|
|
2
|
+
import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createSlots as he, createTextVNode as ge, createVNode as I, defineComponent as L, effectScope as _e, guardReactiveProps as ve, h as ye, isRef as be, isVNode as R, mergeProps as xe, nextTick as Se, normalizeClass as z, normalizeProps as B, normalizeStyle as V, onBeforeUnmount as Ce, onMounted as we, onScopeDispose as H, openBlock as U, ref as W, renderList as G, renderSlot as K, shallowReactive as Te, shallowRef as q, toDisplayString as J, toValue as Y, unref as X, useTemplateRef as Ee, watch as Z, watchEffect as De, withCtx as Q, withDirectives as Oe, withModifiers as ke } from "vue";
|
|
3
|
+
import { useI18n as Ae, useLocalization as je } from "@cocoar/vue-localization";
|
|
4
|
+
import { CoarButton as Me, CoarContextMenu as Ne, CoarIcon as Pe, CoarMenuItem as Fe, CoarSegmentedControl as Ie, CoarSelect as Le, useContextMenu as Re } from "@cocoar/vue-ui";
|
|
5
|
+
//#region src/builders/calendar-builder-internals.ts
|
|
6
|
+
var ze = Symbol("CalendarBuilder.setVisibleRange"), Be = Symbol("CalendarBuilder.invalidateLoaderCache"), Ve = 50, He = !1;
|
|
7
|
+
function Ue(e) {
|
|
8
|
+
return `${e.view}|${e.timezone}|${e.start}|${e.end}`;
|
|
9
|
+
}
|
|
10
|
+
function We(e, t) {
|
|
11
|
+
return e === t ? !0 : e === null || t === null ? !1 : e.view === t.view && e.start === t.start && e.end === t.end && e.timezone === t.timezone;
|
|
12
|
+
}
|
|
13
|
+
function Ge(e, t) {
|
|
14
|
+
if (typeof e == "function") throw TypeError(`[CalendarBuilder.${t}] navigation setters require a Ref or a plain value, never a getter function. api.next() / setView() must be able to write back. Pass \`ref(...)\` if you want two-way binding.`);
|
|
15
|
+
return be(e) ? e : W(e);
|
|
16
|
+
}
|
|
17
|
+
var Ke = class e {
|
|
18
|
+
state;
|
|
19
|
+
api;
|
|
20
|
+
_loading = W(!1);
|
|
21
|
+
_visibleRange = q(null);
|
|
22
|
+
_gridReady = W(!1);
|
|
23
|
+
_scrollToTimeImpl;
|
|
24
|
+
_scrollToDateImpl;
|
|
25
|
+
_loaderCache = q(/* @__PURE__ */ new Map());
|
|
26
|
+
_inFlight = 0;
|
|
27
|
+
_debounceHandle = null;
|
|
28
|
+
_generation = 0;
|
|
29
|
+
_scope = _e(!0);
|
|
30
|
+
_validatedEventObjects = /* @__PURE__ */ new WeakSet();
|
|
31
|
+
constructor() {
|
|
32
|
+
let e = i();
|
|
33
|
+
typeof console < "u" && e === "UTC" && console.error("[CalendarBuilder] Browser timezone detection failed and silently fell back to UTC. This builder will render every event in UTC unless you call `builder.timezone(\"Europe/Vienna\")` (or similar IANA zone) explicitly. If you intentionally want UTC, call `.timezone(\"UTC\")` to silence this error.");
|
|
34
|
+
let t = W("month"), r = W(n.Now.plainDateISO(e));
|
|
35
|
+
this.state = Te({
|
|
36
|
+
events: null,
|
|
37
|
+
eventsLoader: null,
|
|
38
|
+
timezone: e,
|
|
39
|
+
locale: "en-US",
|
|
40
|
+
firstDayOfWeek: void 0,
|
|
41
|
+
density: "comfortable",
|
|
42
|
+
dateStyle: void 0,
|
|
43
|
+
timeStyle: void 0,
|
|
44
|
+
hour12: void 0,
|
|
45
|
+
dstPolicy: "compatible",
|
|
46
|
+
availableViews: [
|
|
47
|
+
"month",
|
|
48
|
+
"week",
|
|
49
|
+
"day",
|
|
50
|
+
"agenda"
|
|
51
|
+
],
|
|
52
|
+
timeRange: {
|
|
53
|
+
startMinutes: 0,
|
|
54
|
+
endMinutes: 1439
|
|
55
|
+
},
|
|
56
|
+
slotDuration: 30,
|
|
57
|
+
pixelsPerHour: 60,
|
|
58
|
+
maxEventsPerCell: 3,
|
|
59
|
+
agendaLengthDays: 30,
|
|
60
|
+
showEmptyDays: !1,
|
|
61
|
+
view: t,
|
|
62
|
+
date: r,
|
|
63
|
+
canDrop: null,
|
|
64
|
+
eventRenderer: null,
|
|
65
|
+
dayHeaderRenderer: null,
|
|
66
|
+
onEventClick: null,
|
|
67
|
+
onEventDoubleClick: null,
|
|
68
|
+
onEventDrop: null,
|
|
69
|
+
onDateClick: null,
|
|
70
|
+
onTimeClick: null,
|
|
71
|
+
onMoreClick: null,
|
|
72
|
+
onRangeChange: null
|
|
73
|
+
}), this.api = {
|
|
74
|
+
loading: this._loading,
|
|
75
|
+
visibleRange: this._visibleRange,
|
|
76
|
+
gridReady: this._gridReady,
|
|
77
|
+
goTo: (e) => this._goTo(e),
|
|
78
|
+
goToToday: () => this._goToToday(),
|
|
79
|
+
next: () => this._navigate(1),
|
|
80
|
+
prev: () => this._navigate(-1),
|
|
81
|
+
setView: (e) => this._setView(e),
|
|
82
|
+
scrollToTime: (e) => {
|
|
83
|
+
this._scrollToTimeImpl ? this._scrollToTimeImpl(e) : this._warnScrollNotWired("scrollToTime");
|
|
84
|
+
},
|
|
85
|
+
scrollToDate: (e) => {
|
|
86
|
+
this._scrollToDateImpl ? this._scrollToDateImpl(e) : this._warnScrollNotWired("scrollToDate");
|
|
87
|
+
},
|
|
88
|
+
refresh: () => this._refresh(),
|
|
89
|
+
refreshRange: (e) => this._refreshRange(e),
|
|
90
|
+
getVisibleRange: () => this._visibleRange.value,
|
|
91
|
+
getVisibleEvents: () => this._getVisibleEvents()
|
|
92
|
+
}, this._scope.run(() => {
|
|
93
|
+
Z(() => this.state.events ? Y(this.state.events) : null, (e) => {
|
|
94
|
+
if (e) try {
|
|
95
|
+
this._validateEvents(e);
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.error("[CalendarBuilder] reactive event-source change failed validation:", e);
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
immediate: !1,
|
|
101
|
+
flush: "post"
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
static create() {
|
|
106
|
+
return new e();
|
|
107
|
+
}
|
|
108
|
+
events(e) {
|
|
109
|
+
this.state.events = e, this.state.eventsLoader !== null && (this.state.eventsLoader = null, this._loaderCache.value = /* @__PURE__ */ new Map());
|
|
110
|
+
let t = Y(e);
|
|
111
|
+
return t && this._validateEvents(t), this;
|
|
112
|
+
}
|
|
113
|
+
eventsLoader(e) {
|
|
114
|
+
return this.state.eventsLoader = e, this.state.events !== null && (this.state.events = null), this._loaderCache.value = /* @__PURE__ */ new Map(), this;
|
|
115
|
+
}
|
|
116
|
+
timezone(e) {
|
|
117
|
+
return this.state.timezone = e, this;
|
|
118
|
+
}
|
|
119
|
+
locale(e) {
|
|
120
|
+
return this.state.locale = e, this;
|
|
121
|
+
}
|
|
122
|
+
firstDayOfWeek(e) {
|
|
123
|
+
return this.state.firstDayOfWeek = e, this;
|
|
124
|
+
}
|
|
125
|
+
density(e) {
|
|
126
|
+
return this.state.density = e, this;
|
|
127
|
+
}
|
|
128
|
+
dateStyle(e) {
|
|
129
|
+
return this.state.dateStyle = e, this;
|
|
130
|
+
}
|
|
131
|
+
timeStyle(e) {
|
|
132
|
+
return this.state.timeStyle = e, this;
|
|
133
|
+
}
|
|
134
|
+
hour12(e) {
|
|
135
|
+
return this.state.hour12 = e, this;
|
|
136
|
+
}
|
|
137
|
+
dstPolicy(e) {
|
|
138
|
+
return this.state.dstPolicy = e, this;
|
|
139
|
+
}
|
|
140
|
+
view(e) {
|
|
141
|
+
return this.state.view = Ge(e, "view"), this;
|
|
142
|
+
}
|
|
143
|
+
availableViews(e) {
|
|
144
|
+
return this.state.availableViews = e, this;
|
|
145
|
+
}
|
|
146
|
+
date(e) {
|
|
147
|
+
return this.state.date = Ge(e, "date"), this;
|
|
148
|
+
}
|
|
149
|
+
timeRange(e) {
|
|
150
|
+
return this.state.timeRange = e, this;
|
|
151
|
+
}
|
|
152
|
+
slotDuration(e) {
|
|
153
|
+
return this.state.slotDuration = e, this;
|
|
154
|
+
}
|
|
155
|
+
pixelsPerHour(e) {
|
|
156
|
+
return this.state.pixelsPerHour = e, this;
|
|
157
|
+
}
|
|
158
|
+
maxEventsPerCell(e) {
|
|
159
|
+
return this.state.maxEventsPerCell = e, this;
|
|
160
|
+
}
|
|
161
|
+
agendaLengthDays(e) {
|
|
162
|
+
return this.state.agendaLengthDays = e, this;
|
|
163
|
+
}
|
|
164
|
+
showEmptyDays(e) {
|
|
165
|
+
return this.state.showEmptyDays = e, this;
|
|
166
|
+
}
|
|
167
|
+
canDrop(e) {
|
|
168
|
+
return this.state.canDrop = e, this;
|
|
169
|
+
}
|
|
170
|
+
eventRenderer(e) {
|
|
171
|
+
return this.state.eventRenderer = e, this;
|
|
172
|
+
}
|
|
173
|
+
dayHeaderRenderer(e) {
|
|
174
|
+
return this.state.dayHeaderRenderer = e, this;
|
|
175
|
+
}
|
|
176
|
+
onEventClick(e) {
|
|
177
|
+
return this.state.onEventClick = e, this;
|
|
178
|
+
}
|
|
179
|
+
onEventDoubleClick(e) {
|
|
180
|
+
return this.state.onEventDoubleClick = e, this;
|
|
181
|
+
}
|
|
182
|
+
onEventDrop(e) {
|
|
183
|
+
return this.state.onEventDrop = e, this;
|
|
184
|
+
}
|
|
185
|
+
onDateClick(e) {
|
|
186
|
+
return this.state.onDateClick = e, this;
|
|
187
|
+
}
|
|
188
|
+
onTimeClick(e) {
|
|
189
|
+
return this.state.onTimeClick = e, this;
|
|
190
|
+
}
|
|
191
|
+
onMoreClick(e) {
|
|
192
|
+
return this.state.onMoreClick = e, He || (He = !0, typeof console < "u" && console.warn("[CalendarBuilder.onMoreClick] handler registered, but the \"+N more\" overflow surface is not yet wired in <CoarMonthView>. The handler will start firing once month-view overflow ships in Session 3.5+. Until then, this setter is typed-but-dead.")), this;
|
|
193
|
+
}
|
|
194
|
+
onRangeChange(e) {
|
|
195
|
+
return this.state.onRangeChange = e, this;
|
|
196
|
+
}
|
|
197
|
+
_goTo(e) {
|
|
198
|
+
this.state.date.value = e;
|
|
199
|
+
}
|
|
200
|
+
_goToToday() {
|
|
201
|
+
let e = Y(this.state.timezone);
|
|
202
|
+
this.state.date.value = n.Now.plainDateISO(e);
|
|
203
|
+
}
|
|
204
|
+
_navigate(e) {
|
|
205
|
+
let t = this.state.view.value, n = this.state.date.value, r = Y(this.state.agendaLengthDays);
|
|
206
|
+
this.state.date.value = de(t, n, e === 1 ? "next" : "prev", r);
|
|
207
|
+
}
|
|
208
|
+
_setView(e) {
|
|
209
|
+
let t = Y(this.state.availableViews);
|
|
210
|
+
t.includes(e) || typeof console < "u" && console.warn(`[CalendarBuilder.api.setView] view='${e}' is not in availableViews=[${t.join(", ")}]. Setting anyway, but the active view-switcher won't show it and the body may render an "unsupported" placeholder. Add it to availableViews(...) or pick from the allowed set.`), this.state.view.value = e;
|
|
211
|
+
}
|
|
212
|
+
[ze](e) {
|
|
213
|
+
if (!We(this._visibleRange.value, e) && (this._visibleRange.value = e, e)) {
|
|
214
|
+
let t = this.state.onRangeChange;
|
|
215
|
+
if (t) try {
|
|
216
|
+
t(e);
|
|
217
|
+
} catch (e) {
|
|
218
|
+
console.error("[CalendarBuilder] onRangeChange handler threw:", e);
|
|
219
|
+
}
|
|
220
|
+
this._maybeScheduleLoad(e);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
[Be]() {
|
|
224
|
+
this._loaderCache.value = /* @__PURE__ */ new Map(), this._generation += 1;
|
|
225
|
+
}
|
|
226
|
+
_maybeScheduleLoad(e) {
|
|
227
|
+
if (!this.state.eventsLoader) return;
|
|
228
|
+
let t = Ue(e);
|
|
229
|
+
this._loaderCache.value.has(t) || (this._debounceHandle !== null && clearTimeout(this._debounceHandle), this._debounceHandle = setTimeout(() => {
|
|
230
|
+
this._debounceHandle = null, this._runLoader(e);
|
|
231
|
+
}, Ve));
|
|
232
|
+
}
|
|
233
|
+
_runLoader(e) {
|
|
234
|
+
let t = this.state.eventsLoader;
|
|
235
|
+
if (!t) return;
|
|
236
|
+
let n = Ue(e), r = this._generation;
|
|
237
|
+
this._inFlight += 1, this._loading.value = !0, Promise.resolve().then(() => t(e)).then((e) => {
|
|
238
|
+
if (r !== this._generation) return;
|
|
239
|
+
this._validateEvents(e);
|
|
240
|
+
let t = new Map(this._loaderCache.value);
|
|
241
|
+
t.set(n, e), this._loaderCache.value = t;
|
|
242
|
+
}).catch((e) => {
|
|
243
|
+
console.error(`[CalendarBuilder] eventsLoader rejected for window ${n}:`, e);
|
|
244
|
+
}).finally(() => {
|
|
245
|
+
--this._inFlight, this._inFlight <= 0 && (this._inFlight = 0, this._loading.value = !1);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
_validateEvents(e) {
|
|
249
|
+
for (let t of e) {
|
|
250
|
+
if (typeof t != "object" || !t) throw TypeError(`[CalendarBuilder] events array contains a non-object entry: ${String(t)}. Each entry must be a CalendarEvent.`);
|
|
251
|
+
this._validatedEventObjects.has(t) || (o(t), this._validatedEventObjects.add(t));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
_warnedScrollMethods = /* @__PURE__ */ new Set();
|
|
255
|
+
_warnScrollNotWired(e) {
|
|
256
|
+
this._warnedScrollMethods.has(e) || (this._warnedScrollMethods.add(e), typeof console < "u" && console.warn(`[CalendarBuilder.api.${e}] not wired yet — components ship in Session 3. This call is a no-op. Once <CoarCalendar> mounts, ${e} will work; remove this call or move it to after-mount.`));
|
|
257
|
+
}
|
|
258
|
+
_refresh() {
|
|
259
|
+
this[Be]();
|
|
260
|
+
let e = this._visibleRange.value;
|
|
261
|
+
e && this._maybeScheduleLoad(e);
|
|
262
|
+
}
|
|
263
|
+
_refreshRange(e) {
|
|
264
|
+
let t = /* @__PURE__ */ new Map(), n = !1;
|
|
265
|
+
for (let [r, i] of this._loaderCache.value.entries()) {
|
|
266
|
+
let [a, o, s, c] = r.split("|");
|
|
267
|
+
if (a === e.view && o === e.timezone && s < e.end && c > e.start) {
|
|
268
|
+
n = !0;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
t.set(r, i);
|
|
272
|
+
}
|
|
273
|
+
n && (this._loaderCache.value = t, this._generation += 1);
|
|
274
|
+
let r = this._visibleRange.value;
|
|
275
|
+
if (r) {
|
|
276
|
+
let e = Ue(r);
|
|
277
|
+
this._loaderCache.value.has(e) || this._maybeScheduleLoad(r);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
_getVisibleEvents() {
|
|
281
|
+
let e = this.state.events;
|
|
282
|
+
if (e !== null) return Y(e) ?? [];
|
|
283
|
+
let t = this._visibleRange.value;
|
|
284
|
+
if (t) {
|
|
285
|
+
let e = this._loaderCache.value.get(Ue(t));
|
|
286
|
+
if (e) return e;
|
|
287
|
+
}
|
|
288
|
+
return [];
|
|
289
|
+
}
|
|
290
|
+
_debug_cacheKeys() {
|
|
291
|
+
return Array.from(this._loaderCache.value.keys());
|
|
292
|
+
}
|
|
293
|
+
_debug_inFlight() {
|
|
294
|
+
return this._inFlight;
|
|
295
|
+
}
|
|
296
|
+
_setScrollToTime(e) {
|
|
297
|
+
this._scrollToTimeImpl = e;
|
|
298
|
+
}
|
|
299
|
+
_setScrollToDate(e) {
|
|
300
|
+
this._scrollToDateImpl = e;
|
|
301
|
+
}
|
|
302
|
+
_setGridReady(e) {
|
|
303
|
+
this._gridReady.value = e;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/useCalendar.ts
|
|
308
|
+
function qe() {
|
|
309
|
+
let e = Ke.create();
|
|
310
|
+
return {
|
|
311
|
+
builder: e,
|
|
312
|
+
api: e.api
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/builders/event-zone-hints.ts
|
|
317
|
+
var Je = {
|
|
318
|
+
isUtcAnchored: !1,
|
|
319
|
+
sourceZone: null
|
|
320
|
+
};
|
|
321
|
+
function Ye(e, t) {
|
|
322
|
+
if (!(e.start instanceof n.ZonedDateTime)) return Je;
|
|
323
|
+
let r = e.start.timeZoneId;
|
|
324
|
+
return r === "UTC" ? {
|
|
325
|
+
isUtcAnchored: !0,
|
|
326
|
+
sourceZone: null
|
|
327
|
+
} : !t || r === t ? Je : {
|
|
328
|
+
isUtcAnchored: !1,
|
|
329
|
+
sourceZone: r
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/composables/useViewWindow.ts
|
|
334
|
+
var Xe = /* @__PURE__ */ new WeakSet();
|
|
335
|
+
function Ze(e) {
|
|
336
|
+
return Xe.has(e) && typeof console < "u" && console.warn("[useViewWindow] A second useViewWindow() composable mounted against the same CalendarBuilder. The C5 invariant calls for a single writer for _visibleRange — duplicate writers compute identical windows but fire onRangeChange / schedule the eventsLoader twice per change. Mount useViewWindow in exactly ONE place per builder (typically the active sub-view component)."), Xe.add(e), Z(j(() => {
|
|
337
|
+
let t = Y(e.state.firstDayOfWeek) ?? r(Y(e.state.locale) ?? "en-US");
|
|
338
|
+
return w({
|
|
339
|
+
view: e.state.view.value,
|
|
340
|
+
cursor: e.state.date.value,
|
|
341
|
+
firstDayOfWeek: t,
|
|
342
|
+
agendaLengthDays: Y(e.state.agendaLengthDays),
|
|
343
|
+
timezone: Y(e.state.timezone)
|
|
344
|
+
});
|
|
345
|
+
}), (t) => {
|
|
346
|
+
e[ze](t);
|
|
347
|
+
}, {
|
|
348
|
+
immediate: !0,
|
|
349
|
+
flush: "post"
|
|
350
|
+
}), H(() => {
|
|
351
|
+
Xe.delete(e);
|
|
352
|
+
}), { visibleRange: e.api.visibleRange };
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/composables/useCoarDrag.ts
|
|
356
|
+
function Qe(e) {
|
|
357
|
+
let t = q(null), n = q(!1), r = j(() => t.value !== null && n.value), i = 0, a = -1, o = null, s = 0, c = 0, l = 0, u = 0, d = 0, f = 0, p = !1, m = 0;
|
|
358
|
+
function h() {
|
|
359
|
+
if (e.autoScroll === null) return;
|
|
360
|
+
let t = e.surfaceRef.value;
|
|
361
|
+
if (!t) return;
|
|
362
|
+
let n = t.getBoundingClientRect(), { velocityX: r, velocityY: i } = x(d, f, n, e.autoScroll ?? void 0);
|
|
363
|
+
r !== 0 && (t.scrollLeft += r), i !== 0 && (t.scrollTop += i);
|
|
364
|
+
}
|
|
365
|
+
function g() {
|
|
366
|
+
let r = e.surfaceRef.value, i = {
|
|
367
|
+
left: r ? r.scrollLeft : 0,
|
|
368
|
+
top: r ? r.scrollTop : 0
|
|
369
|
+
};
|
|
370
|
+
return {
|
|
371
|
+
data: t.value,
|
|
372
|
+
pointer: {
|
|
373
|
+
x: d,
|
|
374
|
+
y: f
|
|
375
|
+
},
|
|
376
|
+
delta: {
|
|
377
|
+
x: d - s,
|
|
378
|
+
y: f - c
|
|
379
|
+
},
|
|
380
|
+
startScroll: {
|
|
381
|
+
left: l,
|
|
382
|
+
top: u
|
|
383
|
+
},
|
|
384
|
+
scroll: i,
|
|
385
|
+
totalDelta: {
|
|
386
|
+
x: d - s + (i.left - l),
|
|
387
|
+
y: f - c + (i.top - u)
|
|
388
|
+
},
|
|
389
|
+
crossedThreshold: n.value
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function _() {
|
|
393
|
+
if (m = 0, t.value === null) return;
|
|
394
|
+
if (h(), p = !1, !n.value) {
|
|
395
|
+
let t = e.dragThreshold ?? 0, r = d - s + (e.surfaceRef.value ? e.surfaceRef.value.scrollLeft - l : 0), i = f - c + (e.surfaceRef.value ? e.surfaceRef.value.scrollTop - u : 0);
|
|
396
|
+
(Math.abs(r) > t || Math.abs(i) > t) && (n.value = !0);
|
|
397
|
+
}
|
|
398
|
+
n.value && e.onDragMove?.(g());
|
|
399
|
+
let r = e.surfaceRef.value;
|
|
400
|
+
if (r && e.autoScroll !== null) {
|
|
401
|
+
let t = r.getBoundingClientRect(), n = x(d, f, t, e.autoScroll ?? void 0);
|
|
402
|
+
(n.velocityX !== 0 || n.velocityY !== 0) && v();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function v() {
|
|
406
|
+
m === 0 && (m = requestAnimationFrame(_));
|
|
407
|
+
}
|
|
408
|
+
function y(e) {
|
|
409
|
+
e.pointerId === a && (d = e.clientX, f = e.clientY, p || (p = !0, v()));
|
|
410
|
+
}
|
|
411
|
+
function b(n) {
|
|
412
|
+
if (t.value === null) return;
|
|
413
|
+
m !== 0 && (cancelAnimationFrame(m), m = 0);
|
|
414
|
+
let r = g();
|
|
415
|
+
n === "drop" ? e.onDragEnd?.(r) : e.onDragCancel?.(r), te();
|
|
416
|
+
}
|
|
417
|
+
function S(e) {
|
|
418
|
+
e.pointerId === a && b("drop");
|
|
419
|
+
}
|
|
420
|
+
function ee(e) {
|
|
421
|
+
e.pointerId === a && b("cancel");
|
|
422
|
+
}
|
|
423
|
+
function C(e) {
|
|
424
|
+
e.key === "Escape" && b("cancel");
|
|
425
|
+
}
|
|
426
|
+
function te() {
|
|
427
|
+
if (o && o instanceof Element && a >= 0) try {
|
|
428
|
+
o.releasePointerCapture?.(a);
|
|
429
|
+
} catch {}
|
|
430
|
+
window.removeEventListener("pointermove", y), window.removeEventListener("pointerup", S), window.removeEventListener("pointercancel", ee), window.removeEventListener("keydown", C), a = -1, o = null, p = !1, t.value = null, n.value = !1, i++;
|
|
431
|
+
}
|
|
432
|
+
function w(r) {
|
|
433
|
+
return (i) => {
|
|
434
|
+
if (i.button !== 0 || t.value !== null || e.onDragStart?.({
|
|
435
|
+
event: i,
|
|
436
|
+
data: r
|
|
437
|
+
}) === !1) return;
|
|
438
|
+
let p = i.currentTarget;
|
|
439
|
+
a = i.pointerId, o = p, s = i.clientX, c = i.clientY, d = s, f = c;
|
|
440
|
+
let m = e.surfaceRef.value;
|
|
441
|
+
l = m ? m.scrollLeft : 0, u = m ? m.scrollTop : 0, t.value = r, n.value = (e.dragThreshold ?? 0) === 0;
|
|
442
|
+
try {
|
|
443
|
+
p?.setPointerCapture?.(a);
|
|
444
|
+
} catch {}
|
|
445
|
+
window.addEventListener("pointermove", y, { passive: !0 }), window.addEventListener("pointerup", S), window.addEventListener("pointercancel", ee), window.addEventListener("keydown", C), i.preventDefault();
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
return Ce(() => {
|
|
449
|
+
r.value && b("cancel"), m !== 0 && (cancelAnimationFrame(m), m = 0);
|
|
450
|
+
}), {
|
|
451
|
+
isDragging: r,
|
|
452
|
+
draggedData: t,
|
|
453
|
+
startDrag: w
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/composables/useCalendarDnd.ts
|
|
458
|
+
var $e = null;
|
|
459
|
+
function et(e) {
|
|
460
|
+
if (!(typeof document > "u")) {
|
|
461
|
+
if (e === null) {
|
|
462
|
+
$e?.remove(), $e = null;
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
$e || ($e = document.createElement("style"), $e.setAttribute("data-coar-drag-cursor", ""), document.head.appendChild($e)), $e.textContent = `*, *::before, *::after { cursor: ${e} !important; }`;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function tt(e) {
|
|
469
|
+
switch (e) {
|
|
470
|
+
case "timed-resize-start":
|
|
471
|
+
case "timed-resize-end": return "ns-resize";
|
|
472
|
+
case "allDay-resize-start":
|
|
473
|
+
case "allDay-resize-end":
|
|
474
|
+
case "month-resize-start":
|
|
475
|
+
case "month-resize-end": return "ew-resize";
|
|
476
|
+
case "timed":
|
|
477
|
+
case "allDay":
|
|
478
|
+
case "month": return "grabbing";
|
|
479
|
+
default: return null;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function nt(e) {
|
|
483
|
+
let t = W(null), n = W(0), r = j(() => n.value > 0), i = null;
|
|
484
|
+
function a() {
|
|
485
|
+
i !== null && clearTimeout(i), n.value = performance.now() + 220, i = setTimeout(() => {
|
|
486
|
+
n.value = 0, t.value = null, o.value = null, i = null;
|
|
487
|
+
}, 220);
|
|
488
|
+
}
|
|
489
|
+
let o = W(null), s = 0, c = 0, l = 0;
|
|
490
|
+
function u(t, n) {
|
|
491
|
+
let r = e.columnsRef?.value;
|
|
492
|
+
if (!r) return null;
|
|
493
|
+
let i = r.getBoundingClientRect(), a = t - i.left, o = n - i.top;
|
|
494
|
+
if (a < 0 || a >= i.width || o < 0) return null;
|
|
495
|
+
let s = e.days?.value;
|
|
496
|
+
if (!s || s.length === 0) return null;
|
|
497
|
+
let l = i.width / s.length, u = s[Math.min(s.length - 1, Math.max(0, Math.floor(a / l)))], d = (e.pixelsPerHour?.value ?? 60) / 60, f = e.timeGridTopBufferMinutes?.value ?? 0, p = Math.max(0, o / d - f), m = e.slotDuration?.value ?? 30, h = e.timeRange?.value[0] ?? 0, g = e.timeRange?.value[1] ?? 24, _ = h * 60 + p - c, y = Math.round(_ / m) * m, b = v?.draggedData.value, x = m;
|
|
498
|
+
if (b && "timeZoneId" in b.start) {
|
|
499
|
+
let e = b.start, t = b.end;
|
|
500
|
+
t && (x = Math.max(m, (t.epochMilliseconds - e.epochMilliseconds) / 6e4));
|
|
501
|
+
}
|
|
502
|
+
let S = g * 60 - x;
|
|
503
|
+
return y < h * 60 || y > S ? null : {
|
|
504
|
+
date: u.toString(),
|
|
505
|
+
minutes: y,
|
|
506
|
+
displayZone: e.timezone.value,
|
|
507
|
+
valid: !0
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
function d(t) {
|
|
511
|
+
let n = e.allDayColumnsRef?.value ?? e.columnsRef?.value;
|
|
512
|
+
if (!n) return null;
|
|
513
|
+
let r = n.getBoundingClientRect(), i = t - r.left, a = e.days?.value;
|
|
514
|
+
if (!a || a.length === 0 || r.width <= 0) return null;
|
|
515
|
+
let o = r.width / a.length;
|
|
516
|
+
return {
|
|
517
|
+
date: a[Math.min(a.length - 1, Math.max(0, Math.floor(i / o) - l))].toString(),
|
|
518
|
+
minutes: null,
|
|
519
|
+
displayZone: e.timezone.value,
|
|
520
|
+
valid: !0
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function f(t, n) {
|
|
524
|
+
let r = e.monthGridRef?.value, i = e.monthGridDates?.value;
|
|
525
|
+
if (!r || !i || i.length === 0) return null;
|
|
526
|
+
let a = r.getBoundingClientRect(), o = t - a.left;
|
|
527
|
+
if (a.width <= 0 || a.height <= 0 || o < 0 || o >= a.width) return null;
|
|
528
|
+
let c = a.width / 7, l = Math.min(6, Math.max(0, Math.floor(o / c))), u = Array.from(r.children);
|
|
529
|
+
if (u.length === 0) return null;
|
|
530
|
+
let d = -1;
|
|
531
|
+
for (let e = 0; e < u.length; e++) {
|
|
532
|
+
let t = u[e].getBoundingClientRect();
|
|
533
|
+
if (n >= t.top && n < t.bottom) {
|
|
534
|
+
d = e;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
d === -1 && (d = n < u[0].getBoundingClientRect().top ? 0 : u.length - 1);
|
|
539
|
+
let f = d * 7 + l - s;
|
|
540
|
+
return {
|
|
541
|
+
date: i[Math.min(i.length - 1, Math.max(0, f))].toString(),
|
|
542
|
+
minutes: null,
|
|
543
|
+
displayZone: e.timezone.value,
|
|
544
|
+
valid: !0
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function p(t, n) {
|
|
548
|
+
if (n === null) return n;
|
|
549
|
+
let r = e.dstPolicy?.value ?? "compatible";
|
|
550
|
+
if (r === "reject") try {
|
|
551
|
+
O(t, n, o.value, r);
|
|
552
|
+
} catch (e) {
|
|
553
|
+
if (e instanceof le) return {
|
|
554
|
+
...n,
|
|
555
|
+
valid: !1
|
|
556
|
+
};
|
|
557
|
+
throw e;
|
|
558
|
+
}
|
|
559
|
+
return e.canDrop ? {
|
|
560
|
+
...n,
|
|
561
|
+
valid: e.canDrop(t, n)
|
|
562
|
+
} : n;
|
|
563
|
+
}
|
|
564
|
+
let m = null, h = e.timezone.value, g = null, _, v = Qe({
|
|
565
|
+
surfaceRef: e.surfaceRef,
|
|
566
|
+
dragThreshold: e.dragThreshold ?? 5,
|
|
567
|
+
onDragStart: ({ event: t, data: n }) => {
|
|
568
|
+
m = t, h = e.timezone.value, g = n?.start ?? null, _ = n?.end;
|
|
569
|
+
},
|
|
570
|
+
onDragMove: (e) => {
|
|
571
|
+
let n = o.value, r;
|
|
572
|
+
r = n === "month" || n === "month-resize-start" || n === "month-resize-end" ? f(e.pointer.x, e.pointer.y) : n === "allDay" || n === "allDay-resize-start" || n === "allDay-resize-end" ? d(e.pointer.x) : u(e.pointer.x, e.pointer.y), t.value = p(e.data, r);
|
|
573
|
+
},
|
|
574
|
+
onDragEnd: (n) => {
|
|
575
|
+
let r = !1;
|
|
576
|
+
if (n.crossedThreshold) {
|
|
577
|
+
let i = t.value;
|
|
578
|
+
if (i && i.valid && e.onEventDrop) {
|
|
579
|
+
let t = e.dstPolicy?.value ?? "compatible";
|
|
580
|
+
try {
|
|
581
|
+
let r = T(t, n.data, {
|
|
582
|
+
start: g ?? n.data.start,
|
|
583
|
+
..._ === void 0 ? {} : { end: _ },
|
|
584
|
+
displayZone: h
|
|
585
|
+
}, i, o.value, m);
|
|
586
|
+
e.onEventDrop(r);
|
|
587
|
+
} catch (e) {
|
|
588
|
+
if (e instanceof le) r = !0;
|
|
589
|
+
else throw e;
|
|
590
|
+
}
|
|
591
|
+
} else i && i.valid === !1 && (r = !0);
|
|
592
|
+
} else e.onEventClick?.(n.data, m);
|
|
593
|
+
c = 0, l = 0, s = 0, r ? a() : (t.value = null, o.value = null);
|
|
594
|
+
},
|
|
595
|
+
onDragCancel: () => {
|
|
596
|
+
t.value = null, o.value = null, c = 0, l = 0, s = 0;
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
function y(t) {
|
|
600
|
+
let n = v.startDrag(t);
|
|
601
|
+
return (t) => {
|
|
602
|
+
o.value = "timed";
|
|
603
|
+
let r = t.currentTarget;
|
|
604
|
+
if (r) {
|
|
605
|
+
let n = r.getBoundingClientRect(), i = (e.pixelsPerHour?.value ?? 60) / 60;
|
|
606
|
+
c = i > 0 ? (t.clientY - n.top) / i : 0;
|
|
607
|
+
} else c = 0;
|
|
608
|
+
l = 0, s = 0, n(t);
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
function b(t) {
|
|
612
|
+
let n = v.startDrag(t);
|
|
613
|
+
return (t) => {
|
|
614
|
+
o.value = "allDay";
|
|
615
|
+
let r = t.currentTarget, i = e.allDayColumnsRef?.value ?? e.columnsRef?.value, a = e.days?.value;
|
|
616
|
+
if (r && i && a && a.length > 0) {
|
|
617
|
+
let e = r.getBoundingClientRect(), n = i.getBoundingClientRect().width / a.length;
|
|
618
|
+
l = n > 0 ? Math.floor((t.clientX - e.left) / n) : 0;
|
|
619
|
+
} else l = 0;
|
|
620
|
+
c = 0, s = 0, n(t);
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
function x(t) {
|
|
624
|
+
let n = v.startDrag(t);
|
|
625
|
+
return (t) => {
|
|
626
|
+
o.value = "month";
|
|
627
|
+
let r = t.currentTarget, i = e.monthGridRef?.value;
|
|
628
|
+
if (r && i) {
|
|
629
|
+
let e = r.getBoundingClientRect(), n = i.getBoundingClientRect().width / 7;
|
|
630
|
+
s = n > 0 ? Math.floor((t.clientX - e.left) / n) : 0;
|
|
631
|
+
} else s = 0;
|
|
632
|
+
c = 0, l = 0, n(t);
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
function S(e) {
|
|
636
|
+
let t = v.startDrag(e);
|
|
637
|
+
return (e) => {
|
|
638
|
+
o.value = "timed-resize-start", c = 0, l = 0, s = 0, t(e);
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function ee(e) {
|
|
642
|
+
let t = v.startDrag(e);
|
|
643
|
+
return (e) => {
|
|
644
|
+
o.value = "timed-resize-end", c = 0, l = 0, s = 0, t(e);
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
function C(e) {
|
|
648
|
+
let t = v.startDrag(e);
|
|
649
|
+
return (e) => {
|
|
650
|
+
o.value = "allDay-resize-start", c = 0, l = 0, s = 0, t(e);
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
function te(e) {
|
|
654
|
+
let t = v.startDrag(e);
|
|
655
|
+
return (e) => {
|
|
656
|
+
o.value = "allDay-resize-end", c = 0, l = 0, s = 0, t(e);
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
function w(e) {
|
|
660
|
+
let t = v.startDrag(e);
|
|
661
|
+
return (e) => {
|
|
662
|
+
o.value = "month-resize-start", c = 0, l = 0, s = 0, t(e);
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
function ne(e) {
|
|
666
|
+
let t = v.startDrag(e);
|
|
667
|
+
return (e) => {
|
|
668
|
+
o.value = "month-resize-end", c = 0, l = 0, s = 0, t(e);
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
return Z(() => v.isDragging.value, (e) => et(e ? tt(o.value) : null)), {
|
|
672
|
+
isDragging: v.isDragging,
|
|
673
|
+
draggedEvent: j(() => v.draggedData.value),
|
|
674
|
+
dragMode: j(() => o.value),
|
|
675
|
+
dropTarget: t,
|
|
676
|
+
snappingBack: r,
|
|
677
|
+
startDrag: y,
|
|
678
|
+
startTimedResizeStart: S,
|
|
679
|
+
startTimedResizeEnd: ee,
|
|
680
|
+
startAllDayDrag: b,
|
|
681
|
+
startAllDayResizeStart: C,
|
|
682
|
+
startAllDayResizeEnd: te,
|
|
683
|
+
startMonthDrag: x,
|
|
684
|
+
startMonthResizeStart: w,
|
|
685
|
+
startMonthResizeEnd: ne
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region src/composables/useA11yAnnouncer.ts
|
|
690
|
+
var rt = "";
|
|
691
|
+
function it() {
|
|
692
|
+
let e = W(""), t = !1;
|
|
693
|
+
function n(n) {
|
|
694
|
+
t = !t, e.value = t ? `${n}${rt}` : n;
|
|
695
|
+
}
|
|
696
|
+
return {
|
|
697
|
+
message: e,
|
|
698
|
+
announce: n
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region src/composables/useTimeGridDnd.ts
|
|
703
|
+
function at(e) {
|
|
704
|
+
let t = nt({
|
|
705
|
+
surfaceRef: e.surfaceRef,
|
|
706
|
+
columnsRef: e.columnsRef,
|
|
707
|
+
allDayColumnsRef: e.allDayColumnsRef,
|
|
708
|
+
days: e.days,
|
|
709
|
+
timeRange: e.timeRange,
|
|
710
|
+
pixelsPerHour: e.pixelsPerHour,
|
|
711
|
+
slotDuration: e.slotDuration,
|
|
712
|
+
timezone: j(() => Y(e.timezone)),
|
|
713
|
+
dstPolicy: e.dstPolicy ? j(() => Y(e.dstPolicy)) : void 0,
|
|
714
|
+
timeGridTopBufferMinutes: e.topBufferMinutes,
|
|
715
|
+
canDrop: e.canDrop ? (t, n) => e.canDrop(t, {
|
|
716
|
+
date: n.date,
|
|
717
|
+
minutes: n.minutes
|
|
718
|
+
}) : void 0,
|
|
719
|
+
onEventClick: (t, n) => {
|
|
720
|
+
e.onEventClick?.(t, n);
|
|
721
|
+
},
|
|
722
|
+
onEventDrop: (t) => {
|
|
723
|
+
e.onEventDrop?.(t), e.onAnnounce?.("committed", t);
|
|
724
|
+
}
|
|
725
|
+
}), r = W(null), i = j(() => {
|
|
726
|
+
let n = Y(e.events), i = t.draggedEvent.value, a = t.dropTarget.value, o = t.dragMode.value;
|
|
727
|
+
if (i && a && o) {
|
|
728
|
+
if (a.valid === !1 || o === "month") return n;
|
|
729
|
+
let t = O(i, a, o, e.dstPolicy ? Y(e.dstPolicy) : "compatible"), r = {
|
|
730
|
+
...i,
|
|
731
|
+
id: `${i.id}__preview`,
|
|
732
|
+
start: t.start,
|
|
733
|
+
end: t.end
|
|
734
|
+
};
|
|
735
|
+
return [...n.filter((e) => e.id !== i.id), r];
|
|
736
|
+
}
|
|
737
|
+
let s = r.value;
|
|
738
|
+
if (s) {
|
|
739
|
+
let e = {
|
|
740
|
+
...s.event,
|
|
741
|
+
id: `${s.event.id}__preview`,
|
|
742
|
+
start: s.next.start,
|
|
743
|
+
end: s.next.end
|
|
744
|
+
};
|
|
745
|
+
return [...n.filter((e) => e.id !== s.event.id), e];
|
|
746
|
+
}
|
|
747
|
+
return n;
|
|
748
|
+
});
|
|
749
|
+
function a(e) {
|
|
750
|
+
let n = t.draggedEvent.value;
|
|
751
|
+
if (n !== null && e === `${n.id}__preview`) return !0;
|
|
752
|
+
let i = r.value;
|
|
753
|
+
return i !== null && e === `${i.event.id}__preview`;
|
|
754
|
+
}
|
|
755
|
+
let o = W(null), s = W(null);
|
|
756
|
+
Z(() => t.isDragging.value, (n, r) => {
|
|
757
|
+
if (n && !r) {
|
|
758
|
+
let n = t.dragMode.value, r = t.draggedEvent.value;
|
|
759
|
+
if (!r) return;
|
|
760
|
+
let i = Y(e.events), a = Y(e.timezone);
|
|
761
|
+
if (n === "allDay" || n === "allDay-resize-start" || n === "allDay-resize-end") {
|
|
762
|
+
let t = se(i, {
|
|
763
|
+
days: e.days.value,
|
|
764
|
+
timezone: a
|
|
765
|
+
}).find((e) => e.event.id === r.id);
|
|
766
|
+
t && (s.value = {
|
|
767
|
+
startCol: t.startCol,
|
|
768
|
+
endCol: t.endCol,
|
|
769
|
+
lane: t.lane,
|
|
770
|
+
laneCount: t.laneCount,
|
|
771
|
+
clippedStart: t.clippedStart,
|
|
772
|
+
clippedEnd: t.clippedEnd,
|
|
773
|
+
event: r
|
|
774
|
+
});
|
|
775
|
+
} else {
|
|
776
|
+
let t = E(r.start, a), n = ie(i, {
|
|
777
|
+
day: t,
|
|
778
|
+
timeRange: e.timeRange.value,
|
|
779
|
+
timezone: a
|
|
780
|
+
}).find((e) => e.event.id === r.id);
|
|
781
|
+
n && (o.value = {
|
|
782
|
+
dayKey: t.toString(),
|
|
783
|
+
lane: n.lane,
|
|
784
|
+
laneCount: n.laneCount,
|
|
785
|
+
startMinutes: n.startMinutes,
|
|
786
|
+
endMinutes: n.endMinutes,
|
|
787
|
+
event: r
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
} else !n && r && (o.value = null, s.value = null);
|
|
791
|
+
}), Z(() => r.value !== null, (t, n) => {
|
|
792
|
+
if (t && !n) {
|
|
793
|
+
let t = r.value;
|
|
794
|
+
if (!t) return;
|
|
795
|
+
let n = Y(e.events), i = Y(e.timezone);
|
|
796
|
+
if (t.mode === "allDay" || t.mode === "allDay-resize-start" || t.mode === "allDay-resize-end") {
|
|
797
|
+
let r = se(n, {
|
|
798
|
+
days: e.days.value,
|
|
799
|
+
timezone: i
|
|
800
|
+
}).find((e) => e.event.id === t.event.id);
|
|
801
|
+
r && (s.value = {
|
|
802
|
+
startCol: r.startCol,
|
|
803
|
+
endCol: r.endCol,
|
|
804
|
+
lane: r.lane,
|
|
805
|
+
laneCount: r.laneCount,
|
|
806
|
+
clippedStart: r.clippedStart,
|
|
807
|
+
clippedEnd: r.clippedEnd,
|
|
808
|
+
event: t.event
|
|
809
|
+
});
|
|
810
|
+
} else {
|
|
811
|
+
let r = E(t.event.start, i), a = ie(n, {
|
|
812
|
+
day: r,
|
|
813
|
+
timeRange: e.timeRange.value,
|
|
814
|
+
timezone: i
|
|
815
|
+
}).find((e) => e.event.id === t.event.id);
|
|
816
|
+
a && (o.value = {
|
|
817
|
+
dayKey: r.toString(),
|
|
818
|
+
lane: a.lane,
|
|
819
|
+
laneCount: a.laneCount,
|
|
820
|
+
startMinutes: a.startMinutes,
|
|
821
|
+
endMinutes: a.endMinutes,
|
|
822
|
+
event: t.event
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
} else !t && n && (o.value = null, s.value = null);
|
|
826
|
+
});
|
|
827
|
+
let c = j(() => {
|
|
828
|
+
let n = t.draggedEvent.value;
|
|
829
|
+
if (!n || !y(n)) return null;
|
|
830
|
+
let r = e.slotDuration.value;
|
|
831
|
+
if (!n.end) return r;
|
|
832
|
+
let i = n.start.toInstant().until(n.end.toInstant()).total({ unit: "minute" });
|
|
833
|
+
return Math.max(r, i);
|
|
834
|
+
}), l = j(() => {
|
|
835
|
+
if (!t.isDragging.value && !t.snappingBack.value) return null;
|
|
836
|
+
let n = t.dropTarget.value;
|
|
837
|
+
if (!n || n.valid !== !1 || t.dragMode.value !== "timed" || n.minutes === null) return null;
|
|
838
|
+
let r = c.value;
|
|
839
|
+
if (r === null) return null;
|
|
840
|
+
let [i] = e.timeRange.value;
|
|
841
|
+
return {
|
|
842
|
+
dayKey: n.date,
|
|
843
|
+
startMinutes: n.minutes - i * 60,
|
|
844
|
+
durationMinutes: r
|
|
845
|
+
};
|
|
846
|
+
}), u = j(() => {
|
|
847
|
+
if (!t.isDragging.value && !t.snappingBack.value) return null;
|
|
848
|
+
let n = t.dropTarget.value;
|
|
849
|
+
if (!n || n.valid !== !1 || t.dragMode.value !== "allDay") return null;
|
|
850
|
+
let r = s.value;
|
|
851
|
+
if (!r) return null;
|
|
852
|
+
let i = r.endCol - r.startCol, a = e.days.value, o = a.findIndex((e) => e.toString() === n.date);
|
|
853
|
+
return o < 0 ? null : {
|
|
854
|
+
startCol: o,
|
|
855
|
+
endCol: Math.min(a.length - 1, o + i)
|
|
856
|
+
};
|
|
857
|
+
});
|
|
858
|
+
function d(e, t, n) {
|
|
859
|
+
let r = e.currentTarget;
|
|
860
|
+
r instanceof HTMLElement && r.focus({ preventScroll: !0 }), n(t)(e);
|
|
861
|
+
}
|
|
862
|
+
function f(e, t) {
|
|
863
|
+
if (e.start instanceof n.PlainDate) return {
|
|
864
|
+
date: e.start.toString(),
|
|
865
|
+
minutes: null,
|
|
866
|
+
displayZone: t,
|
|
867
|
+
disambiguation: e.disambiguation ?? null
|
|
868
|
+
};
|
|
869
|
+
let r = e.start.withTimeZone(t);
|
|
870
|
+
return {
|
|
871
|
+
date: r.toPlainDate().toString(),
|
|
872
|
+
minutes: r.hour * 60 + r.minute,
|
|
873
|
+
displayZone: t,
|
|
874
|
+
disambiguation: e.disambiguation ?? null
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
function p(t, n, r, i) {
|
|
878
|
+
let a = y(n), o = _(n), s = Y(e.timezone), c = e.dstPolicy ? Y(e.dstPolicy) : "compatible", l = {
|
|
879
|
+
id: n.id,
|
|
880
|
+
start: t.start,
|
|
881
|
+
...t.end ? { end: t.end } : {}
|
|
882
|
+
};
|
|
883
|
+
if (r.shiftKey && (r.key === "ArrowUp" || r.key === "ArrowDown") && a) {
|
|
884
|
+
let e = (t.end ?? t.start.add({ minutes: 30 })).withTimeZone(s), n = r.key === "ArrowDown" ? i : -i, a = e.hour * 60 + e.minute + n, { date: o, minutes: u } = m(e.toPlainDate(), a);
|
|
885
|
+
try {
|
|
886
|
+
return {
|
|
887
|
+
next: O(l, {
|
|
888
|
+
date: o,
|
|
889
|
+
minutes: u,
|
|
890
|
+
displayZone: s,
|
|
891
|
+
valid: !0
|
|
892
|
+
}, "timed-resize-end", c),
|
|
893
|
+
mode: "timed-resize-end"
|
|
894
|
+
};
|
|
895
|
+
} catch {
|
|
896
|
+
return null;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (r.key === "ArrowUp" || r.key === "ArrowDown") {
|
|
900
|
+
if (!a) return null;
|
|
901
|
+
let e = t.start.withTimeZone(s), n = r.key === "ArrowDown" ? i : -i, o = e.hour * 60 + e.minute + n, { date: u, minutes: d } = m(e.toPlainDate(), o);
|
|
902
|
+
try {
|
|
903
|
+
return {
|
|
904
|
+
next: O(l, {
|
|
905
|
+
date: u,
|
|
906
|
+
minutes: d,
|
|
907
|
+
displayZone: s,
|
|
908
|
+
valid: !0
|
|
909
|
+
}, "timed", c),
|
|
910
|
+
mode: "timed"
|
|
911
|
+
};
|
|
912
|
+
} catch {
|
|
913
|
+
return null;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
if (r.key === "ArrowLeft" || r.key === "ArrowRight") {
|
|
917
|
+
if (e.days.value.length <= 1) return null;
|
|
918
|
+
let n = r.key === "ArrowRight" ? 1 : -1;
|
|
919
|
+
if (o) {
|
|
920
|
+
let e = t.start.add({ days: n });
|
|
921
|
+
try {
|
|
922
|
+
return {
|
|
923
|
+
next: O(l, {
|
|
924
|
+
date: e.toString(),
|
|
925
|
+
minutes: null,
|
|
926
|
+
displayZone: s,
|
|
927
|
+
valid: !0
|
|
928
|
+
}, "allDay", c),
|
|
929
|
+
mode: "allDay"
|
|
930
|
+
};
|
|
931
|
+
} catch {
|
|
932
|
+
return null;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
if (a) {
|
|
936
|
+
let e = t.start.withTimeZone(s), r = e.toPlainDate().add({ days: n }), i = e.hour * 60 + e.minute;
|
|
937
|
+
try {
|
|
938
|
+
return {
|
|
939
|
+
next: O(l, {
|
|
940
|
+
date: r.toString(),
|
|
941
|
+
minutes: i,
|
|
942
|
+
displayZone: s,
|
|
943
|
+
valid: !0
|
|
944
|
+
}, "timed", c),
|
|
945
|
+
mode: "timed"
|
|
946
|
+
};
|
|
947
|
+
} catch {
|
|
948
|
+
return null;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return null;
|
|
953
|
+
}
|
|
954
|
+
function m(e, t) {
|
|
955
|
+
let n = e, r = t;
|
|
956
|
+
for (; r < 0;) n = n.subtract({ days: 1 }), r += 1440;
|
|
957
|
+
for (; r >= 1440;) n = n.add({ days: 1 }), r -= 1440;
|
|
958
|
+
return {
|
|
959
|
+
date: n.toString(),
|
|
960
|
+
minutes: r
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
function h() {
|
|
964
|
+
let t = r.value;
|
|
965
|
+
if (!t) return;
|
|
966
|
+
let n = Y(e.timezone);
|
|
967
|
+
if (e.canDrop) {
|
|
968
|
+
let i = f(t.next, n);
|
|
969
|
+
if (!e.canDrop(t.event, i)) {
|
|
970
|
+
r.value = null;
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
let i = {
|
|
975
|
+
event: t.event,
|
|
976
|
+
original: {
|
|
977
|
+
start: t.originalStart,
|
|
978
|
+
...t.originalEnd === void 0 ? {} : { end: t.originalEnd },
|
|
979
|
+
displayZone: t.startDisplayZone
|
|
980
|
+
},
|
|
981
|
+
next: t.next,
|
|
982
|
+
target: f(t.next, n),
|
|
983
|
+
native: null
|
|
984
|
+
};
|
|
985
|
+
e.onEventDrop?.(i), e.onAnnounce?.("committed", i), r.value = null;
|
|
986
|
+
let a = t.event.id;
|
|
987
|
+
Se(() => {
|
|
988
|
+
let e = document.querySelector(`[data-event-id="${CSS.escape(a)}"]`);
|
|
989
|
+
e instanceof HTMLElement && e.focus();
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
function g(t, n) {
|
|
993
|
+
if (t.key === "Escape") {
|
|
994
|
+
if (r.value) {
|
|
995
|
+
r.value = null, e.onAnnounce?.("cancelled"), t.preventDefault();
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
let n = t.currentTarget;
|
|
999
|
+
n instanceof HTMLElement && n.blur(), t.preventDefault();
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
if (t.key === "Enter") {
|
|
1003
|
+
if (!r.value) return;
|
|
1004
|
+
t.preventDefault(), h();
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
if (t.key !== "ArrowUp" && t.key !== "ArrowDown" && t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
|
|
1008
|
+
let i = e.slotDuration.value, a = p(r.value ? r.value.next : {
|
|
1009
|
+
start: n.start,
|
|
1010
|
+
...n.end ? { end: n.end } : {}
|
|
1011
|
+
}, n, t, i);
|
|
1012
|
+
if (!a) {
|
|
1013
|
+
e.onAnnounce?.("cancelled");
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
t.preventDefault();
|
|
1017
|
+
let o = r.value, s = o?.startDisplayZone ?? Y(e.timezone), c = o?.originalStart ?? n.start, l = o?.originalEnd ?? n.end;
|
|
1018
|
+
r.value = {
|
|
1019
|
+
event: n,
|
|
1020
|
+
next: a.next,
|
|
1021
|
+
mode: a.mode,
|
|
1022
|
+
startDisplayZone: s,
|
|
1023
|
+
originalStart: c,
|
|
1024
|
+
...l ? { originalEnd: l } : {}
|
|
1025
|
+
}, Se(() => {
|
|
1026
|
+
let e = document.querySelector(".coar-time-grid-event--ghost[tabindex=\"0\"], .coar-time-grid-all-day-bar--ghost[tabindex=\"0\"]");
|
|
1027
|
+
e && e.focus({ preventScroll: !0 });
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
return {
|
|
1031
|
+
dnd: t,
|
|
1032
|
+
workingEvents: i,
|
|
1033
|
+
dragSourceSnapshot: o,
|
|
1034
|
+
dragAllDaySourceSnapshot: s,
|
|
1035
|
+
invalidTimedGhost: l,
|
|
1036
|
+
invalidAllDayGhost: u,
|
|
1037
|
+
isPreviewEvent: a,
|
|
1038
|
+
onEventPointerdown: d,
|
|
1039
|
+
onEventKeydown: g,
|
|
1040
|
+
draggedDurationMinutes: c,
|
|
1041
|
+
keyboardDrag: r
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
//#endregion
|
|
1045
|
+
//#region src/composables/useMonthDnd.ts
|
|
1046
|
+
function ot(e) {
|
|
1047
|
+
let t = nt({
|
|
1048
|
+
surfaceRef: e.gridRef,
|
|
1049
|
+
monthGridRef: e.gridRef,
|
|
1050
|
+
monthGridDates: e.gridDates,
|
|
1051
|
+
timezone: j(() => Y(e.timezone)),
|
|
1052
|
+
dstPolicy: e.dstPolicy ? j(() => Y(e.dstPolicy)) : void 0,
|
|
1053
|
+
canDrop: e.canDrop ? (t, n) => e.canDrop(t, {
|
|
1054
|
+
date: n.date,
|
|
1055
|
+
minutes: n.minutes
|
|
1056
|
+
}) : void 0,
|
|
1057
|
+
onEventClick: (t, n) => {
|
|
1058
|
+
e.onEventClick?.(t, n);
|
|
1059
|
+
},
|
|
1060
|
+
onEventDrop: (t) => {
|
|
1061
|
+
e.onEventDrop?.(t), e.onAnnounce?.("committed", t);
|
|
1062
|
+
}
|
|
1063
|
+
}), r = W(null), i = j(() => {
|
|
1064
|
+
let n = Y(e.events), i = t.draggedEvent.value, a = t.dropTarget.value, o = t.dragMode.value;
|
|
1065
|
+
if (i && a && o) {
|
|
1066
|
+
if (a.valid === !1 || o !== "month" && o !== "month-resize-start" && o !== "month-resize-end") return n;
|
|
1067
|
+
let t = O(i, a, o, e.dstPolicy ? Y(e.dstPolicy) : "compatible"), r = {
|
|
1068
|
+
...i,
|
|
1069
|
+
id: `${i.id}__preview`,
|
|
1070
|
+
start: t.start,
|
|
1071
|
+
end: t.end
|
|
1072
|
+
};
|
|
1073
|
+
return [...n.filter((e) => e.id !== i.id), r];
|
|
1074
|
+
}
|
|
1075
|
+
let s = r.value;
|
|
1076
|
+
if (s) {
|
|
1077
|
+
let e = {
|
|
1078
|
+
...s.event,
|
|
1079
|
+
id: `${s.event.id}__preview`,
|
|
1080
|
+
start: s.next.start,
|
|
1081
|
+
end: s.next.end
|
|
1082
|
+
};
|
|
1083
|
+
return [...n.filter((e) => e.id !== s.event.id), e];
|
|
1084
|
+
}
|
|
1085
|
+
return n;
|
|
1086
|
+
});
|
|
1087
|
+
function a(e) {
|
|
1088
|
+
let n = t.draggedEvent.value;
|
|
1089
|
+
if (n !== null && e === `${n.id}__preview`) return !0;
|
|
1090
|
+
let i = r.value;
|
|
1091
|
+
return i !== null && e === `${i.event.id}__preview`;
|
|
1092
|
+
}
|
|
1093
|
+
let o = W(null);
|
|
1094
|
+
Z(() => t.isDragging.value, (n, r) => {
|
|
1095
|
+
let i = t.dragMode.value;
|
|
1096
|
+
if (n && !r && (i === "month" || i === "month-resize-start" || i === "month-resize-end")) {
|
|
1097
|
+
let n = t.draggedEvent.value;
|
|
1098
|
+
if (!n) return;
|
|
1099
|
+
let r = te(Y(e.events), {
|
|
1100
|
+
gridDates: e.gridDates.value,
|
|
1101
|
+
timezone: Y(e.timezone)
|
|
1102
|
+
}), i = [], a = [];
|
|
1103
|
+
for (let e = 0; e < r.weekRows.length; e++) {
|
|
1104
|
+
let t = r.weekRows[e];
|
|
1105
|
+
for (let [e, r] of t.cellPills) r.some((e) => e.event.id === n.id) && i.push(e);
|
|
1106
|
+
for (let r of t.multiDayBars) r.event.id === n.id && a.push({
|
|
1107
|
+
rowIndex: e,
|
|
1108
|
+
startCol: r.startCol,
|
|
1109
|
+
endCol: r.endCol,
|
|
1110
|
+
lane: r.lane,
|
|
1111
|
+
clippedStart: r.clippedStart,
|
|
1112
|
+
clippedEnd: r.clippedEnd
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
o.value = {
|
|
1116
|
+
pillCells: i,
|
|
1117
|
+
bars: a,
|
|
1118
|
+
event: n
|
|
1119
|
+
};
|
|
1120
|
+
} else !n && r && (o.value = null);
|
|
1121
|
+
}), Z(() => r.value !== null, (t, n) => {
|
|
1122
|
+
if (t && !n) {
|
|
1123
|
+
let t = r.value;
|
|
1124
|
+
if (!t) return;
|
|
1125
|
+
let n = te(Y(e.events), {
|
|
1126
|
+
gridDates: e.gridDates.value,
|
|
1127
|
+
timezone: Y(e.timezone)
|
|
1128
|
+
}), i = [], a = [];
|
|
1129
|
+
for (let e = 0; e < n.weekRows.length; e++) {
|
|
1130
|
+
let r = n.weekRows[e];
|
|
1131
|
+
for (let [e, n] of r.cellPills) n.some((e) => e.event.id === t.event.id) && i.push(e);
|
|
1132
|
+
for (let n of r.multiDayBars) n.event.id === t.event.id && a.push({
|
|
1133
|
+
rowIndex: e,
|
|
1134
|
+
startCol: n.startCol,
|
|
1135
|
+
endCol: n.endCol,
|
|
1136
|
+
lane: n.lane,
|
|
1137
|
+
clippedStart: n.clippedStart,
|
|
1138
|
+
clippedEnd: n.clippedEnd
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
o.value = {
|
|
1142
|
+
pillCells: i,
|
|
1143
|
+
bars: a,
|
|
1144
|
+
event: t.event
|
|
1145
|
+
};
|
|
1146
|
+
} else !t && n && (o.value = null);
|
|
1147
|
+
});
|
|
1148
|
+
let s = j(() => {
|
|
1149
|
+
if (!t.isDragging.value && !t.snappingBack.value) return null;
|
|
1150
|
+
let n = t.dropTarget.value;
|
|
1151
|
+
if (!n || n.valid !== !1 || t.dragMode.value !== "month") return null;
|
|
1152
|
+
let r = o.value;
|
|
1153
|
+
if (!r) return null;
|
|
1154
|
+
let i = e.gridDates.value.findIndex((e) => e.toString() === n.date);
|
|
1155
|
+
if (i < 0) return null;
|
|
1156
|
+
let a = Math.floor(i / 7), s = i % 7;
|
|
1157
|
+
if (r.bars.length > 0) {
|
|
1158
|
+
let e = r.bars[0].endCol - r.bars[0].startCol;
|
|
1159
|
+
return {
|
|
1160
|
+
rowIndex: a,
|
|
1161
|
+
startCol: s,
|
|
1162
|
+
endCol: Math.min(6, s + e),
|
|
1163
|
+
isBar: !0
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
return {
|
|
1167
|
+
rowIndex: a,
|
|
1168
|
+
startCol: s,
|
|
1169
|
+
endCol: s,
|
|
1170
|
+
isBar: !1
|
|
1171
|
+
};
|
|
1172
|
+
});
|
|
1173
|
+
function c(t) {
|
|
1174
|
+
let r = s.value;
|
|
1175
|
+
if (!r || r.isBar) return !1;
|
|
1176
|
+
let i = r.rowIndex * 7 + r.startCol, a = e.gridDates.value[i];
|
|
1177
|
+
return a ? n.PlainDate.compare(t, a) === 0 : !1;
|
|
1178
|
+
}
|
|
1179
|
+
function l(e, n) {
|
|
1180
|
+
let r = e.currentTarget;
|
|
1181
|
+
r instanceof HTMLElement && r.focus({ preventScroll: !0 }), t.startMonthDrag(n)(e);
|
|
1182
|
+
}
|
|
1183
|
+
function u(e, t) {
|
|
1184
|
+
return e.start instanceof n.PlainDate ? {
|
|
1185
|
+
date: e.start.toString(),
|
|
1186
|
+
minutes: null,
|
|
1187
|
+
displayZone: t,
|
|
1188
|
+
disambiguation: e.disambiguation ?? null
|
|
1189
|
+
} : {
|
|
1190
|
+
date: e.start.withTimeZone(t).toPlainDate().toString(),
|
|
1191
|
+
minutes: null,
|
|
1192
|
+
displayZone: t,
|
|
1193
|
+
disambiguation: e.disambiguation ?? null
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
function d(t, n, r) {
|
|
1197
|
+
let i = Y(e.timezone), a = e.dstPolicy ? Y(e.dstPolicy) : "compatible", o = r.key === "ArrowRight" ? 1 : r.key === "ArrowLeft" ? -1 : r.key === "ArrowDown" ? 7 : -7, s = {
|
|
1198
|
+
id: n.id,
|
|
1199
|
+
start: t.start,
|
|
1200
|
+
...t.end ? { end: t.end } : {}
|
|
1201
|
+
};
|
|
1202
|
+
if (_(n)) {
|
|
1203
|
+
let e = t.start, n = t.end;
|
|
1204
|
+
if (r.shiftKey && n) {
|
|
1205
|
+
let e = n.subtract({ days: 1 }).add({ days: o });
|
|
1206
|
+
try {
|
|
1207
|
+
return {
|
|
1208
|
+
next: O(s, {
|
|
1209
|
+
date: e.toString(),
|
|
1210
|
+
minutes: null,
|
|
1211
|
+
displayZone: i,
|
|
1212
|
+
valid: !0
|
|
1213
|
+
}, "allDay-resize-end", a),
|
|
1214
|
+
mode: "month-resize-end"
|
|
1215
|
+
};
|
|
1216
|
+
} catch {
|
|
1217
|
+
return null;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
let c = e.add({ days: o });
|
|
1221
|
+
try {
|
|
1222
|
+
return {
|
|
1223
|
+
next: O(s, {
|
|
1224
|
+
date: c.toString(),
|
|
1225
|
+
minutes: null,
|
|
1226
|
+
displayZone: i,
|
|
1227
|
+
valid: !0
|
|
1228
|
+
}, "allDay", a),
|
|
1229
|
+
mode: "month"
|
|
1230
|
+
};
|
|
1231
|
+
} catch {
|
|
1232
|
+
return null;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
if (y(n)) {
|
|
1236
|
+
let e = t.start.withTimeZone(i), n = e.toPlainDate().add({ days: o }), r = e.hour * 60 + e.minute;
|
|
1237
|
+
try {
|
|
1238
|
+
return {
|
|
1239
|
+
next: O(s, {
|
|
1240
|
+
date: n.toString(),
|
|
1241
|
+
minutes: r,
|
|
1242
|
+
displayZone: i,
|
|
1243
|
+
valid: !0
|
|
1244
|
+
}, "timed", a),
|
|
1245
|
+
mode: "month"
|
|
1246
|
+
};
|
|
1247
|
+
} catch {
|
|
1248
|
+
return null;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
return null;
|
|
1252
|
+
}
|
|
1253
|
+
function f() {
|
|
1254
|
+
let t = r.value;
|
|
1255
|
+
if (!t) return;
|
|
1256
|
+
let n = Y(e.timezone);
|
|
1257
|
+
if (e.canDrop) {
|
|
1258
|
+
let i = u(t.next, n);
|
|
1259
|
+
if (!e.canDrop(t.event, i)) {
|
|
1260
|
+
r.value = null;
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
let i = {
|
|
1265
|
+
event: t.event,
|
|
1266
|
+
original: {
|
|
1267
|
+
start: t.originalStart,
|
|
1268
|
+
...t.originalEnd === void 0 ? {} : { end: t.originalEnd },
|
|
1269
|
+
displayZone: t.startDisplayZone
|
|
1270
|
+
},
|
|
1271
|
+
next: t.next,
|
|
1272
|
+
target: u(t.next, n),
|
|
1273
|
+
native: null
|
|
1274
|
+
};
|
|
1275
|
+
e.onEventDrop?.(i), e.onAnnounce?.("committed", i), r.value = null;
|
|
1276
|
+
let a = t.event.id;
|
|
1277
|
+
Se(() => {
|
|
1278
|
+
let e = document.querySelector(`[data-event-id="${CSS.escape(a)}"]`);
|
|
1279
|
+
e instanceof HTMLElement && e.focus();
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
function p(t, n) {
|
|
1283
|
+
if (t.key === "Escape") {
|
|
1284
|
+
if (r.value) {
|
|
1285
|
+
r.value = null, e.onAnnounce?.("cancelled"), t.preventDefault();
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
1288
|
+
let n = t.currentTarget;
|
|
1289
|
+
n instanceof HTMLElement && n.blur(), t.preventDefault();
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
if (t.key === "Enter") {
|
|
1293
|
+
if (!r.value) return;
|
|
1294
|
+
t.preventDefault(), f();
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
if (t.key !== "ArrowLeft" && t.key !== "ArrowRight" && t.key !== "ArrowUp" && t.key !== "ArrowDown") return;
|
|
1298
|
+
let i = d(r.value ? r.value.next : {
|
|
1299
|
+
start: n.start,
|
|
1300
|
+
...n.end ? { end: n.end } : {}
|
|
1301
|
+
}, n, t);
|
|
1302
|
+
if (!i) {
|
|
1303
|
+
e.onAnnounce?.("cancelled");
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
t.preventDefault();
|
|
1307
|
+
let a = r.value, o = a?.startDisplayZone ?? Y(e.timezone), s = a?.originalStart ?? n.start, c = a?.originalEnd ?? n.end;
|
|
1308
|
+
r.value = {
|
|
1309
|
+
event: n,
|
|
1310
|
+
next: i.next,
|
|
1311
|
+
mode: i.mode,
|
|
1312
|
+
startDisplayZone: o,
|
|
1313
|
+
originalStart: s,
|
|
1314
|
+
...c ? { originalEnd: c } : {}
|
|
1315
|
+
}, Se(() => {
|
|
1316
|
+
let e = document.querySelector(".coar-month-pill--ghost[tabindex=\"0\"], .coar-month-bar--ghost[tabindex=\"0\"]");
|
|
1317
|
+
e && e.focus({ preventScroll: !0 });
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
return {
|
|
1321
|
+
dnd: t,
|
|
1322
|
+
workingEvents: i,
|
|
1323
|
+
dragSourceSnapshot: o,
|
|
1324
|
+
invalidMonthGhost: s,
|
|
1325
|
+
isPreviewId: a,
|
|
1326
|
+
isInvalidPillTarget: c,
|
|
1327
|
+
onMonthEventPointerdown: l,
|
|
1328
|
+
onMonthEventKeydown: p,
|
|
1329
|
+
keyboardDrag: r
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region src/useDayView.ts
|
|
1334
|
+
function st() {
|
|
1335
|
+
let { builder: e, api: t } = qe();
|
|
1336
|
+
return e.view(W("day")), e.availableViews(["day"]), {
|
|
1337
|
+
builder: e,
|
|
1338
|
+
api: t
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
//#endregion
|
|
1342
|
+
//#region src/useWeekView.ts
|
|
1343
|
+
function ct() {
|
|
1344
|
+
let { builder: e, api: t } = qe();
|
|
1345
|
+
return e.view(W("week")), e.availableViews(["week"]), {
|
|
1346
|
+
builder: e,
|
|
1347
|
+
api: t
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
//#endregion
|
|
1351
|
+
//#region src/useMonthView.ts
|
|
1352
|
+
function lt() {
|
|
1353
|
+
let { builder: e, api: t } = qe();
|
|
1354
|
+
return e.view(W("month")), e.availableViews(["month"]), {
|
|
1355
|
+
builder: e,
|
|
1356
|
+
api: t
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
//#endregion
|
|
1360
|
+
//#region src/useAgendaView.ts
|
|
1361
|
+
function ut() {
|
|
1362
|
+
let { builder: e, api: t } = qe();
|
|
1363
|
+
return e.view(W("agenda")), e.availableViews(["agenda"]), {
|
|
1364
|
+
builder: e,
|
|
1365
|
+
api: t
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/builders/render-helpers.ts
|
|
1370
|
+
var dt = (e) => {
|
|
1371
|
+
let { renderer: t, ctx: n } = e;
|
|
1372
|
+
if (!t || !n) return null;
|
|
1373
|
+
if (typeof t == "function") {
|
|
1374
|
+
let e = t(n);
|
|
1375
|
+
return R(e) ? e : ye(e, n);
|
|
1376
|
+
}
|
|
1377
|
+
return ye(t, n);
|
|
1378
|
+
};
|
|
1379
|
+
dt.props = ["renderer", "ctx"], dt.displayName = "CoarRenderEvent";
|
|
1380
|
+
var ft = (e) => {
|
|
1381
|
+
let { renderer: t, ctx: n } = e;
|
|
1382
|
+
if (typeof t == "function") {
|
|
1383
|
+
let e = t(n);
|
|
1384
|
+
return R(e) ? e : ye(e, n);
|
|
1385
|
+
}
|
|
1386
|
+
return ye(t, n);
|
|
1387
|
+
};
|
|
1388
|
+
ft.props = ["renderer", "ctx"], ft.displayName = "CoarRenderDayHeader";
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/components/internal/CoarEventDecorations.vue?vue&type=script&setup=true&lang.ts
|
|
1391
|
+
var pt = ["title", "aria-label"], mt = { class: "coar-event-decorations__sr-only" }, ht = ["title", "aria-label"], gt = { class: "coar-event-decorations__sr-only" }, _t = /* @__PURE__ */ L({
|
|
1392
|
+
__name: "CoarEventDecorations",
|
|
1393
|
+
props: {
|
|
1394
|
+
event: {},
|
|
1395
|
+
displayZone: {},
|
|
1396
|
+
size: { default: "xs" }
|
|
1397
|
+
},
|
|
1398
|
+
setup(e) {
|
|
1399
|
+
let t = e, n = je()?.t ?? ((e, t, n) => n ?? ""), r = j(() => Ye(t.event, t.displayZone)), i = j(() => n("coar.calendar.event.utcLabel", void 0, "Global")), a = j(() => n("coar.calendar.event.utcGlobalHint", void 0, "Global event — same instant worldwide")), o = j(() => {
|
|
1400
|
+
let e = r.value.sourceZone;
|
|
1401
|
+
return e ? n("coar.calendar.event.crossZoneHint", { zone: e }, `Source zone: ${e}`) : "";
|
|
1402
|
+
}), s = j(() => t.size === "s" ? 14 : 12);
|
|
1403
|
+
return (e, t) => r.value.isUtcAnchored ? (U(), P("span", {
|
|
1404
|
+
key: 0,
|
|
1405
|
+
class: "coar-event-decorations__utc",
|
|
1406
|
+
title: a.value,
|
|
1407
|
+
"aria-label": a.value
|
|
1408
|
+
}, [I(X(Pe), {
|
|
1409
|
+
name: "globe",
|
|
1410
|
+
size: s.value
|
|
1411
|
+
}, null, 8, ["size"]), F("span", mt, J(i.value), 1)], 8, pt)) : r.value.sourceZone ? (U(), P("span", {
|
|
1412
|
+
key: 1,
|
|
1413
|
+
class: "coar-event-decorations__cross-zone",
|
|
1414
|
+
title: o.value,
|
|
1415
|
+
"aria-label": o.value
|
|
1416
|
+
}, [I(X(Pe), {
|
|
1417
|
+
name: "globe",
|
|
1418
|
+
size: s.value
|
|
1419
|
+
}, null, 8, ["size"]), F("span", gt, J(o.value), 1)], 8, ht)) : N("", !0);
|
|
1420
|
+
}
|
|
1421
|
+
}), $ = (e, t) => {
|
|
1422
|
+
let n = e.__vccOpts || e;
|
|
1423
|
+
for (let [e, r] of t) n[e] = r;
|
|
1424
|
+
return n;
|
|
1425
|
+
}, vt = /* @__PURE__ */ $(_t, [["__scopeId", "data-v-18289212"]]), yt = [
|
|
1426
|
+
"data-event-id",
|
|
1427
|
+
"tabindex",
|
|
1428
|
+
"role",
|
|
1429
|
+
"aria-label",
|
|
1430
|
+
"aria-hidden"
|
|
1431
|
+
], bt = { class: "coar-time-grid-event__default" }, xt = { class: "coar-time-grid-event__title-row" }, St = { class: "coar-time-grid-event__title" }, Ct = {
|
|
1432
|
+
key: 2,
|
|
1433
|
+
class: "coar-time-grid-event__default"
|
|
1434
|
+
}, wt = { class: "coar-time-grid-event__title-row" }, Tt = { class: "coar-time-grid-event__title" }, Et = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1435
|
+
__name: "CoarTimeGridEvent",
|
|
1436
|
+
props: {
|
|
1437
|
+
event: {},
|
|
1438
|
+
positioned: {},
|
|
1439
|
+
variant: { default: "live" },
|
|
1440
|
+
bg: {},
|
|
1441
|
+
border: {},
|
|
1442
|
+
title: {},
|
|
1443
|
+
displayZone: { default: void 0 },
|
|
1444
|
+
ariaLabel: { default: void 0 },
|
|
1445
|
+
snappingBack: {
|
|
1446
|
+
type: Boolean,
|
|
1447
|
+
default: !1
|
|
1448
|
+
},
|
|
1449
|
+
density: { default: "comfortable" },
|
|
1450
|
+
top: {},
|
|
1451
|
+
height: {},
|
|
1452
|
+
left: {},
|
|
1453
|
+
width: {},
|
|
1454
|
+
zIndex: {},
|
|
1455
|
+
clippedTop: {
|
|
1456
|
+
type: Boolean,
|
|
1457
|
+
default: !1
|
|
1458
|
+
},
|
|
1459
|
+
clippedBottom: {
|
|
1460
|
+
type: Boolean,
|
|
1461
|
+
default: !1
|
|
1462
|
+
},
|
|
1463
|
+
kbdActive: {
|
|
1464
|
+
type: Boolean,
|
|
1465
|
+
default: !1
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
emits: [
|
|
1469
|
+
"pointerdown",
|
|
1470
|
+
"keydown",
|
|
1471
|
+
"dblclick",
|
|
1472
|
+
"startResize",
|
|
1473
|
+
"endResize"
|
|
1474
|
+
],
|
|
1475
|
+
setup(e, { emit: t }) {
|
|
1476
|
+
let n = e, r = t, i = j(() => n.variant === "live" || n.variant === "preview" && n.kbdActive), a = j(() => n.variant === "live" || n.variant === "preview");
|
|
1477
|
+
function o(e) {
|
|
1478
|
+
i.value && r("pointerdown", e);
|
|
1479
|
+
}
|
|
1480
|
+
function s(e) {
|
|
1481
|
+
i.value && r("keydown", e);
|
|
1482
|
+
}
|
|
1483
|
+
function c(e) {
|
|
1484
|
+
i.value && (e.stopPropagation(), r("dblclick", e));
|
|
1485
|
+
}
|
|
1486
|
+
function l(e) {
|
|
1487
|
+
e.stopPropagation(), r("startResize", e);
|
|
1488
|
+
}
|
|
1489
|
+
function u(e) {
|
|
1490
|
+
e.stopPropagation(), r("endResize", e);
|
|
1491
|
+
}
|
|
1492
|
+
return (t, n) => (U(), P("div", {
|
|
1493
|
+
class: z(["coar-time-grid-event", {
|
|
1494
|
+
"coar-time-grid-event--clipped-top": e.clippedTop,
|
|
1495
|
+
"coar-time-grid-event--clipped-bottom": e.clippedBottom,
|
|
1496
|
+
"coar-time-grid-event--ghost": e.variant === "preview",
|
|
1497
|
+
"coar-time-grid-event--source-phantom": e.variant === "phantom",
|
|
1498
|
+
"coar-time-grid-event--invalid": e.variant === "invalid",
|
|
1499
|
+
"coar-time-grid-event--snap-back": e.variant === "invalid" && e.snappingBack,
|
|
1500
|
+
"coar-time-grid-event--density-compact": e.density === "compact"
|
|
1501
|
+
}]),
|
|
1502
|
+
style: V({
|
|
1503
|
+
top: e.top + "px",
|
|
1504
|
+
height: e.height + "px",
|
|
1505
|
+
left: e.left,
|
|
1506
|
+
width: e.width,
|
|
1507
|
+
zIndex: e.zIndex,
|
|
1508
|
+
background: e.bg,
|
|
1509
|
+
borderLeft: `3px solid ${e.border}`
|
|
1510
|
+
}),
|
|
1511
|
+
"data-event-id": i.value ? e.event.id : void 0,
|
|
1512
|
+
tabindex: i.value ? 0 : -1,
|
|
1513
|
+
role: i.value ? "button" : void 0,
|
|
1514
|
+
"aria-label": i.value ? e.ariaLabel : void 0,
|
|
1515
|
+
"aria-hidden": i.value ? void 0 : "true",
|
|
1516
|
+
onPointerdown: o,
|
|
1517
|
+
onKeydown: s,
|
|
1518
|
+
onDblclick: c
|
|
1519
|
+
}, [
|
|
1520
|
+
i.value ? (U(), P("div", {
|
|
1521
|
+
key: 0,
|
|
1522
|
+
class: "coar-time-grid-event__resize coar-time-grid-event__resize--top",
|
|
1523
|
+
"aria-hidden": "true",
|
|
1524
|
+
onPointerdown: l
|
|
1525
|
+
}, null, 32)) : N("", !0),
|
|
1526
|
+
a.value ? K(t.$slots, "default", {
|
|
1527
|
+
key: 1,
|
|
1528
|
+
event: e.event,
|
|
1529
|
+
positioned: e.positioned
|
|
1530
|
+
}, () => [F("div", bt, [F("span", xt, [I(vt, {
|
|
1531
|
+
event: e.event,
|
|
1532
|
+
"display-zone": e.displayZone,
|
|
1533
|
+
size: "s"
|
|
1534
|
+
}, null, 8, ["event", "display-zone"]), F("span", St, J(e.title), 1)])])], !0) : (U(), P("div", Ct, [F("span", wt, [I(vt, {
|
|
1535
|
+
event: e.event,
|
|
1536
|
+
"display-zone": e.displayZone,
|
|
1537
|
+
size: "s"
|
|
1538
|
+
}, null, 8, ["event", "display-zone"]), F("span", Tt, J(e.title), 1)])])),
|
|
1539
|
+
i.value ? (U(), P("div", {
|
|
1540
|
+
key: 3,
|
|
1541
|
+
class: "coar-time-grid-event__resize coar-time-grid-event__resize--bottom",
|
|
1542
|
+
"aria-hidden": "true",
|
|
1543
|
+
onPointerdown: u
|
|
1544
|
+
}, null, 32)) : N("", !0)
|
|
1545
|
+
], 46, yt));
|
|
1546
|
+
}
|
|
1547
|
+
}), [["__scopeId", "data-v-b99b5154"]]), Dt = [
|
|
1548
|
+
"data-event-id",
|
|
1549
|
+
"tabindex",
|
|
1550
|
+
"role",
|
|
1551
|
+
"aria-label",
|
|
1552
|
+
"aria-hidden"
|
|
1553
|
+
], Ot = { class: "coar-time-grid-all-day-bar__title" }, kt = {
|
|
1554
|
+
key: 2,
|
|
1555
|
+
class: "coar-time-grid-all-day-bar__title"
|
|
1556
|
+
}, At = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1557
|
+
__name: "CoarTimeGridAllDayBar",
|
|
1558
|
+
props: {
|
|
1559
|
+
event: {},
|
|
1560
|
+
bar: {},
|
|
1561
|
+
variant: { default: "live" },
|
|
1562
|
+
bg: {},
|
|
1563
|
+
border: {},
|
|
1564
|
+
title: {},
|
|
1565
|
+
ariaLabel: { default: void 0 },
|
|
1566
|
+
snappingBack: {
|
|
1567
|
+
type: Boolean,
|
|
1568
|
+
default: !1
|
|
1569
|
+
},
|
|
1570
|
+
density: { default: "comfortable" },
|
|
1571
|
+
top: {},
|
|
1572
|
+
left: {},
|
|
1573
|
+
width: {},
|
|
1574
|
+
height: {},
|
|
1575
|
+
zIndex: {},
|
|
1576
|
+
clippedStart: {
|
|
1577
|
+
type: Boolean,
|
|
1578
|
+
default: !1
|
|
1579
|
+
},
|
|
1580
|
+
clippedEnd: {
|
|
1581
|
+
type: Boolean,
|
|
1582
|
+
default: !1
|
|
1583
|
+
},
|
|
1584
|
+
kbdActive: {
|
|
1585
|
+
type: Boolean,
|
|
1586
|
+
default: !1
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
emits: [
|
|
1590
|
+
"pointerdown",
|
|
1591
|
+
"keydown",
|
|
1592
|
+
"dblclick",
|
|
1593
|
+
"startResize",
|
|
1594
|
+
"endResize"
|
|
1595
|
+
],
|
|
1596
|
+
setup(e, { emit: t }) {
|
|
1597
|
+
let n = e, r = t, i = j(() => n.variant === "live" || n.variant === "preview" && n.kbdActive), a = j(() => n.variant === "live" || n.variant === "preview"), o = j(() => i.value && !n.clippedStart), s = j(() => i.value && !n.clippedEnd), c = j(() => n.clippedStart ? "none" : `3px solid ${n.border}`);
|
|
1598
|
+
function l(e) {
|
|
1599
|
+
i.value && r("pointerdown", e);
|
|
1600
|
+
}
|
|
1601
|
+
function u(e) {
|
|
1602
|
+
i.value && r("keydown", e);
|
|
1603
|
+
}
|
|
1604
|
+
function d(e) {
|
|
1605
|
+
i.value && (e.stopPropagation(), r("dblclick", e));
|
|
1606
|
+
}
|
|
1607
|
+
function f(e) {
|
|
1608
|
+
e.stopPropagation(), r("startResize", e);
|
|
1609
|
+
}
|
|
1610
|
+
function p(e) {
|
|
1611
|
+
e.stopPropagation(), r("endResize", e);
|
|
1612
|
+
}
|
|
1613
|
+
return (t, n) => (U(), P("div", {
|
|
1614
|
+
class: z(["coar-time-grid-all-day-bar", {
|
|
1615
|
+
"coar-time-grid-all-day-bar--clipped-start": e.clippedStart,
|
|
1616
|
+
"coar-time-grid-all-day-bar--clipped-end": e.clippedEnd,
|
|
1617
|
+
"coar-time-grid-all-day-bar--ghost": e.variant === "preview",
|
|
1618
|
+
"coar-time-grid-all-day-bar--source-phantom": e.variant === "phantom",
|
|
1619
|
+
"coar-time-grid-all-day-bar--invalid": e.variant === "invalid",
|
|
1620
|
+
"coar-time-grid-all-day-bar--snap-back": e.variant === "invalid" && e.snappingBack,
|
|
1621
|
+
"coar-time-grid-all-day-bar--density-compact": e.density === "compact"
|
|
1622
|
+
}]),
|
|
1623
|
+
style: V({
|
|
1624
|
+
top: e.top + "px",
|
|
1625
|
+
left: e.left,
|
|
1626
|
+
width: e.width,
|
|
1627
|
+
height: e.height + "px",
|
|
1628
|
+
background: e.bg,
|
|
1629
|
+
borderLeft: c.value,
|
|
1630
|
+
zIndex: e.zIndex
|
|
1631
|
+
}),
|
|
1632
|
+
"data-event-id": i.value ? e.event.id : void 0,
|
|
1633
|
+
tabindex: i.value ? 0 : -1,
|
|
1634
|
+
role: i.value ? "button" : void 0,
|
|
1635
|
+
"aria-label": i.value ? e.ariaLabel : void 0,
|
|
1636
|
+
"aria-hidden": i.value ? void 0 : "true",
|
|
1637
|
+
onPointerdown: l,
|
|
1638
|
+
onKeydown: u,
|
|
1639
|
+
onDblclick: d
|
|
1640
|
+
}, [
|
|
1641
|
+
o.value ? (U(), P("div", {
|
|
1642
|
+
key: 0,
|
|
1643
|
+
class: "coar-time-grid-all-day-bar__resize coar-time-grid-all-day-bar__resize--start",
|
|
1644
|
+
"aria-hidden": "true",
|
|
1645
|
+
onPointerdown: f
|
|
1646
|
+
}, null, 32)) : N("", !0),
|
|
1647
|
+
a.value ? K(t.$slots, "default", {
|
|
1648
|
+
key: 1,
|
|
1649
|
+
event: e.event,
|
|
1650
|
+
bar: e.bar
|
|
1651
|
+
}, () => [F("span", Ot, J(e.title), 1)], !0) : (U(), P("span", kt, J(e.title), 1)),
|
|
1652
|
+
s.value ? (U(), P("div", {
|
|
1653
|
+
key: 3,
|
|
1654
|
+
class: "coar-time-grid-all-day-bar__resize coar-time-grid-all-day-bar__resize--end",
|
|
1655
|
+
"aria-hidden": "true",
|
|
1656
|
+
onPointerdown: p
|
|
1657
|
+
}, null, 32)) : N("", !0)
|
|
1658
|
+
], 46, Dt));
|
|
1659
|
+
}
|
|
1660
|
+
}), [["__scopeId", "data-v-d0d396ea"]]), jt = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1661
|
+
__name: "CoarTimeGridNowMarker",
|
|
1662
|
+
props: { topPx: {} },
|
|
1663
|
+
setup(e) {
|
|
1664
|
+
return (t, n) => (U(), P("div", {
|
|
1665
|
+
class: "coar-time-grid-now-marker",
|
|
1666
|
+
style: V({ top: e.topPx + "px" }),
|
|
1667
|
+
"aria-hidden": "true"
|
|
1668
|
+
}, [...n[0] ||= [F("span", { class: "coar-time-grid-now-marker__dot" }, null, -1), F("span", { class: "coar-time-grid-now-marker__line" }, null, -1)]], 4));
|
|
1669
|
+
}
|
|
1670
|
+
}), [["__scopeId", "data-v-ce9e34d0"]]), Mt = {
|
|
1671
|
+
class: "coar-time-grid-header__cells",
|
|
1672
|
+
role: "row"
|
|
1673
|
+
}, Nt = ["aria-colindex", "aria-current"], Pt = { class: "coar-time-grid-header__label" }, Ft = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1674
|
+
__name: "CoarTimeGridHeader",
|
|
1675
|
+
props: {
|
|
1676
|
+
days: {},
|
|
1677
|
+
isToday: {},
|
|
1678
|
+
isWeekend: {},
|
|
1679
|
+
formatLabel: {},
|
|
1680
|
+
density: { default: "comfortable" }
|
|
1681
|
+
},
|
|
1682
|
+
setup(e) {
|
|
1683
|
+
return (t, n) => (U(), P("div", { class: z(["coar-time-grid-header", { "coar-time-grid-header--density-compact": e.density === "compact" }]) }, [n[0] ||= F("div", {
|
|
1684
|
+
class: "coar-time-grid-header__corner",
|
|
1685
|
+
"aria-hidden": "true"
|
|
1686
|
+
}, null, -1), F("div", Mt, [(U(!0), P(A, null, G(e.days, (n, r) => (U(), P("div", {
|
|
1687
|
+
key: n.toString(),
|
|
1688
|
+
class: z(["coar-time-grid-header__cell", {
|
|
1689
|
+
"coar-time-grid-header__cell--today": e.isToday(n),
|
|
1690
|
+
"coar-time-grid-header__cell--weekend": e.isWeekend(n)
|
|
1691
|
+
}]),
|
|
1692
|
+
role: "columnheader",
|
|
1693
|
+
"aria-colindex": r + 1,
|
|
1694
|
+
"aria-current": e.isToday(n) ? "date" : void 0
|
|
1695
|
+
}, [K(t.$slots, "dayHeader", {
|
|
1696
|
+
date: n,
|
|
1697
|
+
isToday: e.isToday(n),
|
|
1698
|
+
isWeekend: e.isWeekend(n)
|
|
1699
|
+
}, () => [F("span", Pt, J(e.formatLabel(n)), 1)], !0)], 10, Nt))), 128))])], 2));
|
|
1700
|
+
}
|
|
1701
|
+
}), [["__scopeId", "data-v-ec745d3f"]]), It = ["aria-label"], Lt = {
|
|
1702
|
+
class: "coar-time-grid-all-day-band__axis",
|
|
1703
|
+
"aria-hidden": "true"
|
|
1704
|
+
}, Rt = ["onPointerdown"], zt = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1705
|
+
__name: "CoarTimeGridAllDayBand",
|
|
1706
|
+
props: {
|
|
1707
|
+
days: {},
|
|
1708
|
+
axisLabel: {},
|
|
1709
|
+
bandHeightPx: {},
|
|
1710
|
+
isToday: { type: Function },
|
|
1711
|
+
isWeekend: { type: Function },
|
|
1712
|
+
setColumnsEl: { type: Function }
|
|
1713
|
+
},
|
|
1714
|
+
emits: ["cellPointerdown"],
|
|
1715
|
+
setup(e, { emit: t }) {
|
|
1716
|
+
let n = t;
|
|
1717
|
+
function r(e, t) {
|
|
1718
|
+
n("cellPointerdown", e, t);
|
|
1719
|
+
}
|
|
1720
|
+
return (t, n) => (U(), P("div", {
|
|
1721
|
+
class: "coar-time-grid-all-day-band",
|
|
1722
|
+
style: V({ minHeight: e.bandHeightPx + "px" }),
|
|
1723
|
+
role: "region",
|
|
1724
|
+
"aria-label": e.axisLabel
|
|
1725
|
+
}, [F("div", Lt, J(e.axisLabel), 1), F("div", {
|
|
1726
|
+
ref: (t) => e.setColumnsEl(t),
|
|
1727
|
+
class: "coar-time-grid-all-day-band__columns"
|
|
1728
|
+
}, [(U(!0), P(A, null, G(e.days, (t, n) => (U(), P("div", {
|
|
1729
|
+
key: t.toString(),
|
|
1730
|
+
class: z(["coar-time-grid-all-day-band__cell", {
|
|
1731
|
+
"coar-time-grid-all-day-band__cell--today": e.isToday(t),
|
|
1732
|
+
"coar-time-grid-all-day-band__cell--weekend": e.isWeekend(t)
|
|
1733
|
+
}]),
|
|
1734
|
+
style: V({ gridColumn: n + 1 }),
|
|
1735
|
+
onPointerdown: (e) => r(e, t)
|
|
1736
|
+
}, null, 46, Rt))), 128)), K(t.$slots, "default", {}, void 0, !0)], 512)], 12, It));
|
|
1737
|
+
}
|
|
1738
|
+
}), [["__scopeId", "data-v-4eabecb1"]]), Bt = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1739
|
+
__name: "CoarTimeGridColumn",
|
|
1740
|
+
props: {
|
|
1741
|
+
day: {},
|
|
1742
|
+
isToday: {
|
|
1743
|
+
type: Boolean,
|
|
1744
|
+
default: !1
|
|
1745
|
+
},
|
|
1746
|
+
isWeekend: {
|
|
1747
|
+
type: Boolean,
|
|
1748
|
+
default: !1
|
|
1749
|
+
},
|
|
1750
|
+
heightPx: {},
|
|
1751
|
+
slotHeightPx: {},
|
|
1752
|
+
renderBufferOffsetPx: {}
|
|
1753
|
+
},
|
|
1754
|
+
emits: ["pointerdown"],
|
|
1755
|
+
setup(e, { emit: t }) {
|
|
1756
|
+
let n = e, r = t, i = j(() => `repeating-linear-gradient(to bottom, transparent 0, transparent ${n.slotHeightPx - 1}px, var(--coar-calendar-grid-line, #e3e5e9) ${n.slotHeightPx - 1}px, var(--coar-calendar-grid-line, #e3e5e9) ${n.slotHeightPx}px)`);
|
|
1757
|
+
function a(e) {
|
|
1758
|
+
r("pointerdown", e, n.day);
|
|
1759
|
+
}
|
|
1760
|
+
return (t, n) => (U(), P("div", {
|
|
1761
|
+
class: z(["coar-time-grid-column", {
|
|
1762
|
+
"coar-time-grid-column--today": e.isToday,
|
|
1763
|
+
"coar-time-grid-column--weekend": e.isWeekend
|
|
1764
|
+
}]),
|
|
1765
|
+
style: V({
|
|
1766
|
+
height: e.heightPx + "px",
|
|
1767
|
+
backgroundImage: i.value,
|
|
1768
|
+
backgroundPosition: `0 ${e.renderBufferOffsetPx}px`
|
|
1769
|
+
}),
|
|
1770
|
+
onPointerdown: a
|
|
1771
|
+
}, [K(t.$slots, "default", {}, void 0, !0)], 38));
|
|
1772
|
+
}
|
|
1773
|
+
}), [["__scopeId", "data-v-32d41217"]]), Vt = ["aria-label"], Ht = {
|
|
1774
|
+
class: "coar-time-grid__a11y-live",
|
|
1775
|
+
role: "status",
|
|
1776
|
+
"aria-live": "polite",
|
|
1777
|
+
"aria-atomic": "true"
|
|
1778
|
+
}, Ut = { class: "coar-time-grid__sticky-top" }, Wt = {
|
|
1779
|
+
key: 2,
|
|
1780
|
+
class: "coar-time-grid__all-day-bar-title"
|
|
1781
|
+
}, Gt = ["data-hour"], Kt = {
|
|
1782
|
+
ref: "columns",
|
|
1783
|
+
class: "coar-time-grid__columns"
|
|
1784
|
+
}, qt = {
|
|
1785
|
+
key: 2,
|
|
1786
|
+
class: "coar-time-grid__event-default"
|
|
1787
|
+
}, Jt = { class: "coar-time-grid__event-title" }, Yt = 15, Xt = 24, Zt = 2, Qt = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
1788
|
+
__name: "CoarTimeGrid",
|
|
1789
|
+
props: {
|
|
1790
|
+
builder: {},
|
|
1791
|
+
dates: {}
|
|
1792
|
+
},
|
|
1793
|
+
setup(e, { expose: t }) {
|
|
1794
|
+
let r = e, { t: i } = Ae(), a = j(() => {
|
|
1795
|
+
let e = r.builder.state, t = Y(e.timeRange);
|
|
1796
|
+
return {
|
|
1797
|
+
events: e.events ? Y(e.events) : [],
|
|
1798
|
+
timezone: Y(e.timezone),
|
|
1799
|
+
locale: Y(e.locale),
|
|
1800
|
+
density: Y(e.density),
|
|
1801
|
+
dateStyle: Y(e.dateStyle),
|
|
1802
|
+
timeStyle: Y(e.timeStyle),
|
|
1803
|
+
hour12: Y(e.hour12),
|
|
1804
|
+
timeRange: [Math.floor(t.startMinutes / 60), Math.ceil(t.endMinutes / 60)],
|
|
1805
|
+
timeRangeMinutes: t,
|
|
1806
|
+
slotDuration: Y(e.slotDuration),
|
|
1807
|
+
pixelsPerHour: Y(e.pixelsPerHour),
|
|
1808
|
+
canDrop: e.canDrop,
|
|
1809
|
+
eventRenderer: e.eventRenderer,
|
|
1810
|
+
dayHeaderRenderer: e.dayHeaderRenderer,
|
|
1811
|
+
dstPolicy: Y(e.dstPolicy)
|
|
1812
|
+
};
|
|
1813
|
+
}), o = j(() => a.value.events), s = j(() => a.value.timeRange), l = j(() => a.value.slotDuration), u = j(() => a.value.pixelsPerHour), d = j(() => a.value.timezone), f = je(), p = j(() => a.value.locale ?? f?.language.value ?? "en-US"), m = j(() => a.value.density), h = j(() => a.value.canDrop), g = j(() => r.dates ?? []), y = g, b = {
|
|
1814
|
+
event: {
|
|
1815
|
+
id: "__phantom__",
|
|
1816
|
+
start: "1970-01-01T00:00:00Z"
|
|
1817
|
+
},
|
|
1818
|
+
startMinutes: 0,
|
|
1819
|
+
endMinutes: 0,
|
|
1820
|
+
lane: 0,
|
|
1821
|
+
laneCount: 1,
|
|
1822
|
+
clippedTop: !1,
|
|
1823
|
+
clippedBottom: !1
|
|
1824
|
+
}, x = {
|
|
1825
|
+
event: {
|
|
1826
|
+
id: "__phantom__",
|
|
1827
|
+
start: "1970-01-01"
|
|
1828
|
+
},
|
|
1829
|
+
lane: 0,
|
|
1830
|
+
laneCount: 1,
|
|
1831
|
+
startCol: 0,
|
|
1832
|
+
endCol: 0,
|
|
1833
|
+
clippedStart: !1,
|
|
1834
|
+
clippedEnd: !1
|
|
1835
|
+
}, S = Ee("columns"), ee = W(null);
|
|
1836
|
+
function C(e) {
|
|
1837
|
+
ee.value = e;
|
|
1838
|
+
}
|
|
1839
|
+
let te = j(() => {
|
|
1840
|
+
let e = S.value;
|
|
1841
|
+
for (; e && e !== document.body;) {
|
|
1842
|
+
let t = window.getComputedStyle(e).overflowY;
|
|
1843
|
+
if (t === "auto" || t === "scroll") return e;
|
|
1844
|
+
e = e.parentElement;
|
|
1845
|
+
}
|
|
1846
|
+
return null;
|
|
1847
|
+
}), { dnd: w, workingEvents: ne, dragSourceSnapshot: T, dragAllDaySourceSnapshot: E, invalidTimedGhost: re, invalidAllDayGhost: D, isPreviewEvent: ae, onEventPointerdown: oe, onEventKeydown: O, keyboardDrag: ce } = at({
|
|
1848
|
+
events: () => o.value,
|
|
1849
|
+
days: g,
|
|
1850
|
+
timeRange: s,
|
|
1851
|
+
pixelsPerHour: u,
|
|
1852
|
+
slotDuration: l,
|
|
1853
|
+
timezone: () => d.value,
|
|
1854
|
+
dstPolicy: () => a.value.dstPolicy,
|
|
1855
|
+
surfaceRef: te,
|
|
1856
|
+
columnsRef: S,
|
|
1857
|
+
allDayColumnsRef: ee,
|
|
1858
|
+
topBufferMinutes: j(() => Yt),
|
|
1859
|
+
canDrop: h.value,
|
|
1860
|
+
onEventClick: (e, t) => {
|
|
1861
|
+
t && r.builder.state.onEventClick?.({
|
|
1862
|
+
event: e,
|
|
1863
|
+
native: t
|
|
1864
|
+
});
|
|
1865
|
+
},
|
|
1866
|
+
onEventDrop: (e) => r.builder.state.onEventDrop?.(e),
|
|
1867
|
+
onAnnounce: (e, t) => pe(e, t)
|
|
1868
|
+
}), le = it();
|
|
1869
|
+
function ue(e) {
|
|
1870
|
+
let t = e.next.start instanceof n.PlainDate, r = {
|
|
1871
|
+
dateStyle: a.value.dateStyle,
|
|
1872
|
+
timeStyle: a.value.timeStyle,
|
|
1873
|
+
hour12: a.value.hour12
|
|
1874
|
+
};
|
|
1875
|
+
try {
|
|
1876
|
+
let n = new Intl.DateTimeFormat(p.value, k(t ? {
|
|
1877
|
+
weekday: "short",
|
|
1878
|
+
day: "numeric",
|
|
1879
|
+
month: "short",
|
|
1880
|
+
timeZone: "UTC"
|
|
1881
|
+
} : {
|
|
1882
|
+
weekday: "short",
|
|
1883
|
+
day: "numeric",
|
|
1884
|
+
month: "short",
|
|
1885
|
+
hour: "numeric",
|
|
1886
|
+
minute: "2-digit",
|
|
1887
|
+
timeZone: d.value
|
|
1888
|
+
}, r));
|
|
1889
|
+
if (t) {
|
|
1890
|
+
let t = e.next.start;
|
|
1891
|
+
return n.format(new Date(Date.UTC(t.year, t.month - 1, t.day)));
|
|
1892
|
+
}
|
|
1893
|
+
let i = e.next.start.withTimeZone(d.value);
|
|
1894
|
+
return n.format(new Date(i.epochMilliseconds));
|
|
1895
|
+
} catch {
|
|
1896
|
+
return e.target.date;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
function de(e) {
|
|
1900
|
+
let t = e.meta, n = (typeof t?.title == "string" ? t.title : void 0) ?? i("coar.calendar.a11y.unnamedEvent", void 0, "Event");
|
|
1901
|
+
return i("coar.calendar.a11y.kbdPreviewLabel", { title: n }, `${n} preview — Arrow keys to move, Enter to commit, Escape to cancel`);
|
|
1902
|
+
}
|
|
1903
|
+
function fe(e) {
|
|
1904
|
+
let t = e.event.meta;
|
|
1905
|
+
return typeof t?.title == "string" ? t.title : i("coar.calendar.a11y.unnamedEvent", void 0, "Event");
|
|
1906
|
+
}
|
|
1907
|
+
function pe(e, t) {
|
|
1908
|
+
if (e === "cancelled") {
|
|
1909
|
+
le.announce(i("coar.calendar.a11y.moveCancelled", void 0, "Move cancelled"));
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
if (!t) return;
|
|
1913
|
+
let n = fe(t), r = ue(t);
|
|
1914
|
+
le.announce(i("coar.calendar.a11y.eventMovedTo", {
|
|
1915
|
+
title: n,
|
|
1916
|
+
when: r
|
|
1917
|
+
}, `${n} moved to ${r}`));
|
|
1918
|
+
}
|
|
1919
|
+
let me = j(() => s.value[1] - s.value[0]), ge = j(() => me.value * 60), L = j(() => me.value * u.value + 2 * (u.value * Yt) / 60), _e = j(() => u.value * l.value / 60), ve = j(() => {
|
|
1920
|
+
let e = [], t = new Intl.DateTimeFormat(p.value, k({ hour: "numeric" }, {
|
|
1921
|
+
timeStyle: a.value.timeStyle,
|
|
1922
|
+
hour12: a.value.hour12
|
|
1923
|
+
}));
|
|
1924
|
+
for (let n = s.value[0]; n <= s.value[1]; n++) {
|
|
1925
|
+
let r = new Date(2024, 0, 1, n);
|
|
1926
|
+
e.push({
|
|
1927
|
+
hour: n,
|
|
1928
|
+
label: t.format(r)
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
return e;
|
|
1932
|
+
}), ye = j(() => {
|
|
1933
|
+
let e = w.draggedEvent.value, t = w.dragMode.value, n = e !== null && (t === "timed" || t === "timed-resize-start" || t === "timed-resize-end") ? `${e.id}__preview` : void 0;
|
|
1934
|
+
return g.value.map((e) => ({
|
|
1935
|
+
date: e,
|
|
1936
|
+
positioned: ie(ne.value, {
|
|
1937
|
+
day: e,
|
|
1938
|
+
timeRange: s.value,
|
|
1939
|
+
timezone: d.value,
|
|
1940
|
+
priorityId: n
|
|
1941
|
+
})
|
|
1942
|
+
}));
|
|
1943
|
+
}), be = j(() => se(ne.value, {
|
|
1944
|
+
days: g.value,
|
|
1945
|
+
timezone: d.value
|
|
1946
|
+
})), R = j(() => be.value.length === 0 ? 0 : be.value[0].laneCount), Se = j(() => R.value === 0 ? 0 : R.value * (Xt + Zt) + 8);
|
|
1947
|
+
function H(e) {
|
|
1948
|
+
return e * u.value / 60;
|
|
1949
|
+
}
|
|
1950
|
+
function Te(e) {
|
|
1951
|
+
return H(e + Yt);
|
|
1952
|
+
}
|
|
1953
|
+
let q = W(v(d.value)), Z = W(c(d.value)), Oe = 0;
|
|
1954
|
+
we(() => {
|
|
1955
|
+
Oe = window.setInterval(() => {
|
|
1956
|
+
q.value = v(d.value), Z.value = c(d.value);
|
|
1957
|
+
}, 3e4);
|
|
1958
|
+
}), Ce(() => {
|
|
1959
|
+
Oe && clearInterval(Oe);
|
|
1960
|
+
}), De(() => {
|
|
1961
|
+
q.value = v(d.value), Z.value = c(d.value);
|
|
1962
|
+
});
|
|
1963
|
+
let ke = j(() => {
|
|
1964
|
+
let e = Z.value.hour * 60 + Z.value.minute - s.value[0] * 60;
|
|
1965
|
+
return e < 0 || e >= ge.value ? null : e;
|
|
1966
|
+
});
|
|
1967
|
+
function Me(e) {
|
|
1968
|
+
return n.PlainDate.compare(e, q.value) === 0;
|
|
1969
|
+
}
|
|
1970
|
+
function Ne(e) {
|
|
1971
|
+
let t = e.dayOfWeek;
|
|
1972
|
+
return t === 6 || t === 7;
|
|
1973
|
+
}
|
|
1974
|
+
let Pe = j(() => new Intl.DateTimeFormat(p.value, k({
|
|
1975
|
+
weekday: "short",
|
|
1976
|
+
day: "numeric",
|
|
1977
|
+
month: "short"
|
|
1978
|
+
}, {
|
|
1979
|
+
dateStyle: a.value.dateStyle,
|
|
1980
|
+
hour12: a.value.hour12
|
|
1981
|
+
})));
|
|
1982
|
+
function Fe(e) {
|
|
1983
|
+
return Pe.value.format(new Date(Date.UTC(e.year, e.month - 1, e.day)));
|
|
1984
|
+
}
|
|
1985
|
+
function Ie(e, t) {
|
|
1986
|
+
let i = e.currentTarget.getBoundingClientRect(), a = e.clientY - i.top, o = Math.floor(a / _e.value) * l.value, c = s.value[0] * 60 + o, u = Math.floor(c / 60), d = c % 60;
|
|
1987
|
+
u < 0 || u >= 24 || r.builder.state.onTimeClick?.({
|
|
1988
|
+
date: t,
|
|
1989
|
+
time: n.PlainTime.from({
|
|
1990
|
+
hour: u,
|
|
1991
|
+
minute: d
|
|
1992
|
+
}),
|
|
1993
|
+
native: e
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
function Le(e, t) {
|
|
1997
|
+
r.builder.state.onDateClick?.({
|
|
1998
|
+
date: t,
|
|
1999
|
+
native: e
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
function Re(e) {
|
|
2003
|
+
let t = e.meta;
|
|
2004
|
+
return typeof t?.title == "string" ? t.title : "(untitled)";
|
|
2005
|
+
}
|
|
2006
|
+
function ze(e) {
|
|
2007
|
+
let t = Re(e);
|
|
2008
|
+
if (_(e)) return `${t} (${i("coar.calendar.timegrid.allDay", void 0, "all-day")})`;
|
|
2009
|
+
try {
|
|
2010
|
+
let n = new Intl.DateTimeFormat(p.value, k({
|
|
2011
|
+
weekday: "short",
|
|
2012
|
+
day: "numeric",
|
|
2013
|
+
month: "short",
|
|
2014
|
+
hour: "numeric",
|
|
2015
|
+
minute: "2-digit",
|
|
2016
|
+
timeZone: d.value
|
|
2017
|
+
}, {
|
|
2018
|
+
dateStyle: a.value.dateStyle,
|
|
2019
|
+
timeStyle: a.value.timeStyle,
|
|
2020
|
+
hour12: a.value.hour12
|
|
2021
|
+
})), r = n.formatRange, i = new Date(e.start.epochMilliseconds), o = e.end ? new Date(e.end.epochMilliseconds) : i;
|
|
2022
|
+
return r ? `${t}, ${r.call(n, i, o)}` : `${t}, ${n.format(i)} – ${n.format(o)}`;
|
|
2023
|
+
} catch {
|
|
2024
|
+
return t;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
function Be(e) {
|
|
2028
|
+
let t = e.meta;
|
|
2029
|
+
return typeof t?.color == "string" ? t.color : void 0;
|
|
2030
|
+
}
|
|
2031
|
+
function Ve(e) {
|
|
2032
|
+
return Be(e) ?? "var(--coar-color-accent-soft, #93c5fd)";
|
|
2033
|
+
}
|
|
2034
|
+
function He(e) {
|
|
2035
|
+
return Be(e) ?? "var(--coar-color-accent, #2563eb)";
|
|
2036
|
+
}
|
|
2037
|
+
function Ue(e) {
|
|
2038
|
+
let t = e.hour, n = te.value;
|
|
2039
|
+
if (!n) return;
|
|
2040
|
+
let r = (t - s.value[0]) * u.value;
|
|
2041
|
+
n.scrollTo({
|
|
2042
|
+
top: Math.max(0, r),
|
|
2043
|
+
behavior: "smooth"
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
return we(() => {
|
|
2047
|
+
r.builder._setScrollToTime(Ue);
|
|
2048
|
+
}), Ce(() => {
|
|
2049
|
+
r.builder._setScrollToTime(void 0);
|
|
2050
|
+
}), t({
|
|
2051
|
+
getLayout: () => ye.value,
|
|
2052
|
+
scrollToTime: Ue
|
|
2053
|
+
}), (e, t) => (U(), P("div", {
|
|
2054
|
+
class: z(["coar-time-grid", [`coar-time-grid--density-${m.value}`]]),
|
|
2055
|
+
role: "region",
|
|
2056
|
+
"aria-label": X(y).length === 1 ? X(i)("coar.calendar.timegrid.dayLabel", void 0, "Day view") : X(i)("coar.calendar.timegrid.weekLabel", void 0, "Week view")
|
|
2057
|
+
}, [
|
|
2058
|
+
F("div", Ht, J(X(le).message.value), 1),
|
|
2059
|
+
F("div", Ut, [I(Ft, {
|
|
2060
|
+
days: X(y),
|
|
2061
|
+
"is-today": Me,
|
|
2062
|
+
"is-weekend": Ne,
|
|
2063
|
+
"format-label": Fe,
|
|
2064
|
+
density: m.value
|
|
2065
|
+
}, he({ _: 2 }, [e.$slots.dayHeader || a.value.dayHeaderRenderer ? {
|
|
2066
|
+
name: "dayHeader",
|
|
2067
|
+
fn: Q((t) => [e.$slots.dayHeader ? K(e.$slots, "dayHeader", B(xe({ key: 0 }, t)), void 0, !0) : a.value.dayHeaderRenderer ? (U(), M(X(ft), {
|
|
2068
|
+
key: 1,
|
|
2069
|
+
renderer: a.value.dayHeaderRenderer,
|
|
2070
|
+
ctx: t
|
|
2071
|
+
}, null, 8, ["renderer", "ctx"])) : N("", !0)]),
|
|
2072
|
+
key: "0"
|
|
2073
|
+
} : void 0]), 1032, ["days", "density"]), R.value > 0 ? (U(), M(zt, {
|
|
2074
|
+
key: 0,
|
|
2075
|
+
days: X(y),
|
|
2076
|
+
"axis-label": X(i)("coar.calendar.timegrid.allDay", void 0, "all-day"),
|
|
2077
|
+
"band-height-px": Se.value,
|
|
2078
|
+
"is-today": Me,
|
|
2079
|
+
"is-weekend": Ne,
|
|
2080
|
+
"set-columns-el": C,
|
|
2081
|
+
onCellPointerdown: t[0] ||= (e, t) => Le(e, t)
|
|
2082
|
+
}, {
|
|
2083
|
+
default: Q(() => [
|
|
2084
|
+
(U(!0), P(A, null, G(be.value, (t) => (U(), M(At, {
|
|
2085
|
+
key: t.event.id,
|
|
2086
|
+
event: t.event,
|
|
2087
|
+
bar: t,
|
|
2088
|
+
variant: X(ae)(t.event.id) ? "preview" : "live",
|
|
2089
|
+
"kbd-active": X(ce) !== null,
|
|
2090
|
+
bg: Ve(t.event),
|
|
2091
|
+
border: He(t.event),
|
|
2092
|
+
title: Re(t.event),
|
|
2093
|
+
"aria-label": X(ae)(t.event.id) && X(ce) ? de(t.event) : ze(t.event),
|
|
2094
|
+
density: m.value,
|
|
2095
|
+
top: 4 + t.lane * (Xt + Zt),
|
|
2096
|
+
left: `calc(${t.startCol / X(y).length * 100}% + ${t.startCol === 0 ? 4 : 2}px)`,
|
|
2097
|
+
width: `calc(${(t.endCol - t.startCol + 1) / X(y).length * 100}% - ${(t.startCol === 0 ? 4 : 2) + (t.endCol === X(y).length - 1 ? 4 : 2)}px)`,
|
|
2098
|
+
height: Xt,
|
|
2099
|
+
"z-index": X(ae)(t.event.id) ? 100 : 1,
|
|
2100
|
+
"clipped-start": t.clippedStart,
|
|
2101
|
+
"clipped-end": t.clippedEnd,
|
|
2102
|
+
onPointerdown: (e) => X(oe)(e, t.event, X(w).startAllDayDrag),
|
|
2103
|
+
onKeydown: (e) => X(O)(e, t.event),
|
|
2104
|
+
onDblclick: (e) => r.builder.state.onEventDoubleClick?.({
|
|
2105
|
+
event: t.event,
|
|
2106
|
+
native: e
|
|
2107
|
+
}),
|
|
2108
|
+
onStartResize: (e) => X(w).startAllDayResizeStart(t.event)(e),
|
|
2109
|
+
onEndResize: (e) => X(w).startAllDayResizeEnd(t.event)(e)
|
|
2110
|
+
}, {
|
|
2111
|
+
default: Q(({ event: t, bar: n }) => [e.$slots.allDayEvent ? K(e.$slots, "allDayEvent", {
|
|
2112
|
+
key: 0,
|
|
2113
|
+
event: t,
|
|
2114
|
+
layout: n
|
|
2115
|
+
}, void 0, !0) : a.value.allDayEventRenderer ?? a.value.eventRenderer ? (U(), M(X(dt), {
|
|
2116
|
+
key: 1,
|
|
2117
|
+
renderer: a.value.allDayEventRenderer ?? a.value.eventRenderer,
|
|
2118
|
+
ctx: {
|
|
2119
|
+
event: t,
|
|
2120
|
+
view: "week",
|
|
2121
|
+
layout: {
|
|
2122
|
+
kind: "allDayBar",
|
|
2123
|
+
layout: n
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}, null, 8, ["renderer", "ctx"])) : (U(), P("span", Wt, J(Re(t)), 1))]),
|
|
2127
|
+
_: 3
|
|
2128
|
+
}, 8, [
|
|
2129
|
+
"event",
|
|
2130
|
+
"bar",
|
|
2131
|
+
"variant",
|
|
2132
|
+
"kbd-active",
|
|
2133
|
+
"bg",
|
|
2134
|
+
"border",
|
|
2135
|
+
"title",
|
|
2136
|
+
"aria-label",
|
|
2137
|
+
"density",
|
|
2138
|
+
"top",
|
|
2139
|
+
"left",
|
|
2140
|
+
"width",
|
|
2141
|
+
"z-index",
|
|
2142
|
+
"clipped-start",
|
|
2143
|
+
"clipped-end",
|
|
2144
|
+
"onPointerdown",
|
|
2145
|
+
"onKeydown",
|
|
2146
|
+
"onDblclick",
|
|
2147
|
+
"onStartResize",
|
|
2148
|
+
"onEndResize"
|
|
2149
|
+
]))), 128)),
|
|
2150
|
+
X(E) ? (U(), M(At, {
|
|
2151
|
+
key: 0,
|
|
2152
|
+
variant: "phantom",
|
|
2153
|
+
event: X(E).event,
|
|
2154
|
+
bar: x,
|
|
2155
|
+
bg: Ve(X(E).event),
|
|
2156
|
+
border: He(X(E).event),
|
|
2157
|
+
title: Re(X(E).event),
|
|
2158
|
+
density: m.value,
|
|
2159
|
+
top: 4 + X(E).lane * (Xt + Zt),
|
|
2160
|
+
left: `calc(${X(E).startCol / X(y).length * 100}% + ${X(E).startCol === 0 ? 4 : 2}px)`,
|
|
2161
|
+
width: `calc(${(X(E).endCol - X(E).startCol + 1) / X(y).length * 100}% - ${(X(E).startCol === 0 ? 4 : 2) + (X(E).endCol === X(y).length - 1 ? 4 : 2)}px)`,
|
|
2162
|
+
height: Xt,
|
|
2163
|
+
"z-index": 1,
|
|
2164
|
+
"clipped-start": X(E).clippedStart,
|
|
2165
|
+
"clipped-end": X(E).clippedEnd
|
|
2166
|
+
}, null, 8, [
|
|
2167
|
+
"event",
|
|
2168
|
+
"bg",
|
|
2169
|
+
"border",
|
|
2170
|
+
"title",
|
|
2171
|
+
"density",
|
|
2172
|
+
"top",
|
|
2173
|
+
"left",
|
|
2174
|
+
"width",
|
|
2175
|
+
"clipped-start",
|
|
2176
|
+
"clipped-end"
|
|
2177
|
+
])) : N("", !0),
|
|
2178
|
+
X(D) && X(w).draggedEvent.value ? (U(), M(At, {
|
|
2179
|
+
key: 1,
|
|
2180
|
+
variant: "invalid",
|
|
2181
|
+
event: X(w).draggedEvent.value,
|
|
2182
|
+
bar: x,
|
|
2183
|
+
bg: Ve(X(w).draggedEvent.value),
|
|
2184
|
+
border: He(X(w).draggedEvent.value),
|
|
2185
|
+
title: Re(X(w).draggedEvent.value),
|
|
2186
|
+
"snapping-back": X(w).snappingBack.value,
|
|
2187
|
+
density: m.value,
|
|
2188
|
+
top: 4 + (X(E)?.lane ?? 0) * (Xt + Zt),
|
|
2189
|
+
left: `calc(${X(D).startCol / X(y).length * 100}% + ${X(D).startCol === 0 ? 4 : 2}px)`,
|
|
2190
|
+
width: `calc(${(X(D).endCol - X(D).startCol + 1) / X(y).length * 100}% - ${(X(D).startCol === 0 ? 4 : 2) + (X(D).endCol === X(y).length - 1 ? 4 : 2)}px)`,
|
|
2191
|
+
height: Xt,
|
|
2192
|
+
"z-index": 100
|
|
2193
|
+
}, null, 8, [
|
|
2194
|
+
"event",
|
|
2195
|
+
"bg",
|
|
2196
|
+
"border",
|
|
2197
|
+
"title",
|
|
2198
|
+
"snapping-back",
|
|
2199
|
+
"density",
|
|
2200
|
+
"top",
|
|
2201
|
+
"left",
|
|
2202
|
+
"width"
|
|
2203
|
+
])) : N("", !0)
|
|
2204
|
+
]),
|
|
2205
|
+
_: 3
|
|
2206
|
+
}, 8, [
|
|
2207
|
+
"days",
|
|
2208
|
+
"axis-label",
|
|
2209
|
+
"band-height-px"
|
|
2210
|
+
])) : N("", !0)]),
|
|
2211
|
+
F("div", {
|
|
2212
|
+
class: "coar-time-grid__body",
|
|
2213
|
+
style: V({ height: L.value + "px" })
|
|
2214
|
+
}, [F("div", {
|
|
2215
|
+
class: "coar-time-grid__hour-axis",
|
|
2216
|
+
style: V({ height: L.value + "px" })
|
|
2217
|
+
}, [(U(!0), P(A, null, G(ve.value, (e) => (U(), P("div", {
|
|
2218
|
+
key: e.hour,
|
|
2219
|
+
class: "coar-time-grid__hour-label",
|
|
2220
|
+
"data-hour": e.hour,
|
|
2221
|
+
style: V({ top: Te((e.hour - s.value[0]) * 60) + "px" })
|
|
2222
|
+
}, J(e.label), 13, Gt))), 128))], 4), F("div", Kt, [(U(!0), P(A, null, G(ye.value, (n) => (U(), M(Bt, {
|
|
2223
|
+
key: n.date.toString(),
|
|
2224
|
+
day: n.date,
|
|
2225
|
+
"is-today": Me(n.date),
|
|
2226
|
+
"is-weekend": Ne(n.date),
|
|
2227
|
+
"height-px": L.value,
|
|
2228
|
+
"slot-height-px": _e.value,
|
|
2229
|
+
"render-buffer-offset-px": H(Yt),
|
|
2230
|
+
onPointerdown: t[1] ||= (e, t) => Ie(e, t)
|
|
2231
|
+
}, {
|
|
2232
|
+
default: Q(() => [
|
|
2233
|
+
(U(!0), P(A, null, G(n.positioned, (t) => (U(), M(Et, {
|
|
2234
|
+
key: t.event.id,
|
|
2235
|
+
event: t.event,
|
|
2236
|
+
positioned: t,
|
|
2237
|
+
variant: X(ae)(t.event.id) ? "preview" : "live",
|
|
2238
|
+
"kbd-active": X(ce) !== null,
|
|
2239
|
+
bg: Ve(t.event),
|
|
2240
|
+
border: He(t.event),
|
|
2241
|
+
title: Re(t.event),
|
|
2242
|
+
"display-zone": d.value,
|
|
2243
|
+
"aria-label": X(ae)(t.event.id) && X(ce) ? de(t.event) : ze(t.event),
|
|
2244
|
+
density: m.value,
|
|
2245
|
+
top: Te(t.startMinutes),
|
|
2246
|
+
height: Math.max(16, H(t.endMinutes - t.startMinutes)),
|
|
2247
|
+
left: `calc(${t.lane / t.laneCount * 100}% + ${t.lane === 0 ? 4 : 2}px)`,
|
|
2248
|
+
width: `calc(${100 / t.laneCount}% - ${(t.lane === 0 ? 4 : 2) + (t.lane === t.laneCount - 1 ? 4 : 2)}px)`,
|
|
2249
|
+
"z-index": X(ae)(t.event.id) ? 100 : t.lane + 1,
|
|
2250
|
+
"clipped-top": t.clippedTop,
|
|
2251
|
+
"clipped-bottom": t.clippedBottom,
|
|
2252
|
+
onPointerdown: (e) => X(oe)(e, t.event, X(w).startDrag),
|
|
2253
|
+
onKeydown: (e) => X(O)(e, t.event),
|
|
2254
|
+
onDblclick: (e) => r.builder.state.onEventDoubleClick?.({
|
|
2255
|
+
event: t.event,
|
|
2256
|
+
native: e
|
|
2257
|
+
}),
|
|
2258
|
+
onStartResize: (e) => X(w).startTimedResizeStart(t.event)(e),
|
|
2259
|
+
onEndResize: (e) => X(w).startTimedResizeEnd(t.event)(e)
|
|
2260
|
+
}, {
|
|
2261
|
+
default: Q(({ event: t, positioned: n }) => [e.$slots.event ? K(e.$slots, "event", {
|
|
2262
|
+
key: 0,
|
|
2263
|
+
event: t,
|
|
2264
|
+
layout: n
|
|
2265
|
+
}, void 0, !0) : a.value.eventRenderer ? (U(), M(X(dt), {
|
|
2266
|
+
key: 1,
|
|
2267
|
+
renderer: a.value.eventRenderer,
|
|
2268
|
+
ctx: {
|
|
2269
|
+
event: t,
|
|
2270
|
+
view: X(y).length === 1 ? "day" : "week",
|
|
2271
|
+
layout: {
|
|
2272
|
+
kind: "positioned",
|
|
2273
|
+
layout: n
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}, null, 8, ["renderer", "ctx"])) : (U(), P("div", qt, [F("span", Jt, J(Re(t)), 1)]))]),
|
|
2277
|
+
_: 3
|
|
2278
|
+
}, 8, [
|
|
2279
|
+
"event",
|
|
2280
|
+
"positioned",
|
|
2281
|
+
"variant",
|
|
2282
|
+
"kbd-active",
|
|
2283
|
+
"bg",
|
|
2284
|
+
"border",
|
|
2285
|
+
"title",
|
|
2286
|
+
"display-zone",
|
|
2287
|
+
"aria-label",
|
|
2288
|
+
"density",
|
|
2289
|
+
"top",
|
|
2290
|
+
"height",
|
|
2291
|
+
"left",
|
|
2292
|
+
"width",
|
|
2293
|
+
"z-index",
|
|
2294
|
+
"clipped-top",
|
|
2295
|
+
"clipped-bottom",
|
|
2296
|
+
"onPointerdown",
|
|
2297
|
+
"onKeydown",
|
|
2298
|
+
"onDblclick",
|
|
2299
|
+
"onStartResize",
|
|
2300
|
+
"onEndResize"
|
|
2301
|
+
]))), 128)),
|
|
2302
|
+
X(T) && X(T).dayKey === n.date.toString() ? (U(), M(Et, {
|
|
2303
|
+
key: 0,
|
|
2304
|
+
variant: "phantom",
|
|
2305
|
+
event: X(T).event,
|
|
2306
|
+
positioned: b,
|
|
2307
|
+
bg: Ve(X(T).event),
|
|
2308
|
+
border: He(X(T).event),
|
|
2309
|
+
title: Re(X(T).event),
|
|
2310
|
+
"display-zone": d.value,
|
|
2311
|
+
density: m.value,
|
|
2312
|
+
top: Te(X(T).startMinutes),
|
|
2313
|
+
height: Math.max(16, H(X(T).endMinutes - X(T).startMinutes)),
|
|
2314
|
+
left: `calc(${X(T).lane / X(T).laneCount * 100}% + ${X(T).lane === 0 ? 4 : 2}px)`,
|
|
2315
|
+
width: `calc(${100 / X(T).laneCount}% - ${(X(T).lane === 0 ? 4 : 2) + (X(T).lane === X(T).laneCount - 1 ? 4 : 2)}px)`,
|
|
2316
|
+
"z-index": X(T).lane + 1
|
|
2317
|
+
}, null, 8, [
|
|
2318
|
+
"event",
|
|
2319
|
+
"bg",
|
|
2320
|
+
"border",
|
|
2321
|
+
"title",
|
|
2322
|
+
"display-zone",
|
|
2323
|
+
"density",
|
|
2324
|
+
"top",
|
|
2325
|
+
"height",
|
|
2326
|
+
"left",
|
|
2327
|
+
"width",
|
|
2328
|
+
"z-index"
|
|
2329
|
+
])) : N("", !0),
|
|
2330
|
+
X(re) && X(re).dayKey === n.date.toString() && X(w).draggedEvent.value ? (U(), M(Et, {
|
|
2331
|
+
key: 1,
|
|
2332
|
+
variant: "invalid",
|
|
2333
|
+
event: X(w).draggedEvent.value,
|
|
2334
|
+
positioned: b,
|
|
2335
|
+
bg: Ve(X(w).draggedEvent.value),
|
|
2336
|
+
border: He(X(w).draggedEvent.value),
|
|
2337
|
+
title: Re(X(w).draggedEvent.value),
|
|
2338
|
+
"snapping-back": X(w).snappingBack.value,
|
|
2339
|
+
density: m.value,
|
|
2340
|
+
top: Te(X(re).startMinutes),
|
|
2341
|
+
height: Math.max(16, H(X(re).durationMinutes)),
|
|
2342
|
+
left: "calc(0% + 4px)",
|
|
2343
|
+
width: "calc(100% - 8px)",
|
|
2344
|
+
"z-index": 100
|
|
2345
|
+
}, null, 8, [
|
|
2346
|
+
"event",
|
|
2347
|
+
"bg",
|
|
2348
|
+
"border",
|
|
2349
|
+
"title",
|
|
2350
|
+
"snapping-back",
|
|
2351
|
+
"density",
|
|
2352
|
+
"top",
|
|
2353
|
+
"height"
|
|
2354
|
+
])) : N("", !0),
|
|
2355
|
+
Me(n.date) && ke.value !== null ? (U(), M(jt, {
|
|
2356
|
+
key: 2,
|
|
2357
|
+
"top-px": Te(ke.value)
|
|
2358
|
+
}, null, 8, ["top-px"])) : N("", !0)
|
|
2359
|
+
]),
|
|
2360
|
+
_: 2
|
|
2361
|
+
}, 1032, [
|
|
2362
|
+
"day",
|
|
2363
|
+
"is-today",
|
|
2364
|
+
"is-weekend",
|
|
2365
|
+
"height-px",
|
|
2366
|
+
"slot-height-px",
|
|
2367
|
+
"render-buffer-offset-px"
|
|
2368
|
+
]))), 128))], 512)], 4)
|
|
2369
|
+
], 10, Vt));
|
|
2370
|
+
}
|
|
2371
|
+
}), [["__scopeId", "data-v-49edd9f1"]]), $t = { class: "coar-day-view" }, en = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2372
|
+
__name: "CoarDayView",
|
|
2373
|
+
props: { builder: {} },
|
|
2374
|
+
setup(e) {
|
|
2375
|
+
let t = e;
|
|
2376
|
+
Ze(t.builder, { view: "day" }), we(() => {
|
|
2377
|
+
t.builder.state.view.value !== "day" && (t.builder.state.view.value = "day");
|
|
2378
|
+
});
|
|
2379
|
+
let n = j(() => [t.builder.state.date.value]);
|
|
2380
|
+
return (t, r) => (U(), P("div", $t, [I(Qt, {
|
|
2381
|
+
builder: e.builder,
|
|
2382
|
+
dates: n.value
|
|
2383
|
+
}, he({ _: 2 }, [t.$slots.event ? {
|
|
2384
|
+
name: "event",
|
|
2385
|
+
fn: Q((e) => [K(t.$slots, "event", B(ve(e)), void 0, !0)]),
|
|
2386
|
+
key: "0"
|
|
2387
|
+
} : void 0, t.$slots.dayHeader ? {
|
|
2388
|
+
name: "dayHeader",
|
|
2389
|
+
fn: Q((e) => [K(t.$slots, "dayHeader", B(ve(e)), void 0, !0)]),
|
|
2390
|
+
key: "1"
|
|
2391
|
+
} : void 0]), 1032, ["builder", "dates"])]));
|
|
2392
|
+
}
|
|
2393
|
+
}), [["__scopeId", "data-v-5a323d36"]]), tn = { class: "coar-week-view" }, nn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2394
|
+
__name: "CoarWeekView",
|
|
2395
|
+
props: { builder: {} },
|
|
2396
|
+
setup(e, { expose: t }) {
|
|
2397
|
+
let n = e;
|
|
2398
|
+
Ze(n.builder, { view: "week" }), we(() => {
|
|
2399
|
+
n.builder.state.view.value !== "week" && (n.builder.state.view.value = "week");
|
|
2400
|
+
});
|
|
2401
|
+
let i = je(), a = j(() => Y(n.builder.state.locale) ?? i?.language.value ?? "en-US"), o = j(() => Y(n.builder.state.firstDayOfWeek) ?? r(a.value)), c = j(() => s(n.builder.state.date.value, o.value));
|
|
2402
|
+
return t({ getVisibleRange() {
|
|
2403
|
+
let e = c.value;
|
|
2404
|
+
return {
|
|
2405
|
+
start: e[0],
|
|
2406
|
+
end: e[e.length - 1]
|
|
2407
|
+
};
|
|
2408
|
+
} }), (t, n) => (U(), P("div", tn, [I(Qt, {
|
|
2409
|
+
builder: e.builder,
|
|
2410
|
+
dates: c.value
|
|
2411
|
+
}, he({ _: 2 }, [
|
|
2412
|
+
t.$slots.event ? {
|
|
2413
|
+
name: "event",
|
|
2414
|
+
fn: Q((e) => [K(t.$slots, "event", B(ve(e)), void 0, !0)]),
|
|
2415
|
+
key: "0"
|
|
2416
|
+
} : void 0,
|
|
2417
|
+
t.$slots.allDayEvent ? {
|
|
2418
|
+
name: "allDayEvent",
|
|
2419
|
+
fn: Q((e) => [K(t.$slots, "allDayEvent", B(ve(e)), void 0, !0)]),
|
|
2420
|
+
key: "1"
|
|
2421
|
+
} : void 0,
|
|
2422
|
+
t.$slots.dayHeader ? {
|
|
2423
|
+
name: "dayHeader",
|
|
2424
|
+
fn: Q((e) => [K(t.$slots, "dayHeader", B(ve(e)), void 0, !0)]),
|
|
2425
|
+
key: "2"
|
|
2426
|
+
} : void 0
|
|
2427
|
+
]), 1032, ["builder", "dates"])]));
|
|
2428
|
+
}
|
|
2429
|
+
}), [["__scopeId", "data-v-3f269ddb"]]), rn = 20, an = 2, on = 24, sn = 76, cn = 100, ln = 300;
|
|
2430
|
+
function un(e) {
|
|
2431
|
+
function t(e) {
|
|
2432
|
+
return on + e * (rn + an);
|
|
2433
|
+
}
|
|
2434
|
+
let n = j(() => e.layout.value.weekRows.map((e) => e.multiDayBars.length === 0 ? on : on + e.multiDayBars[0].laneCount * (rn + an))), r = W(/* @__PURE__ */ new Set()), i = j(() => n.value.map((e, t) => r.value.has(t) ? ln : Math.max(cn, e + sn)));
|
|
2435
|
+
function a(e) {
|
|
2436
|
+
r.value.has(e) || (r.value = new Set([e]));
|
|
2437
|
+
}
|
|
2438
|
+
function o(e) {
|
|
2439
|
+
if (!r.value.has(e)) return;
|
|
2440
|
+
let t = new Set(r.value);
|
|
2441
|
+
t.delete(e), r.value = t;
|
|
2442
|
+
}
|
|
2443
|
+
let s = W(/* @__PURE__ */ new Set());
|
|
2444
|
+
function c() {
|
|
2445
|
+
let t = e.gridRef.value;
|
|
2446
|
+
if (!t) return;
|
|
2447
|
+
let n = /* @__PURE__ */ new Set();
|
|
2448
|
+
t.querySelectorAll("[data-day-key]").forEach((e) => {
|
|
2449
|
+
let t = e.querySelector(".coar-month-cell__pills");
|
|
2450
|
+
if (t && t.scrollHeight > t.clientHeight + 1) {
|
|
2451
|
+
let t = e.getAttribute("data-day-key");
|
|
2452
|
+
t && n.add(t);
|
|
2453
|
+
}
|
|
2454
|
+
});
|
|
2455
|
+
let r = s.value;
|
|
2456
|
+
if (r.size === n.size) {
|
|
2457
|
+
let e = !0;
|
|
2458
|
+
for (let t of n) if (!r.has(t)) {
|
|
2459
|
+
e = !1;
|
|
2460
|
+
break;
|
|
2461
|
+
}
|
|
2462
|
+
if (e) return;
|
|
2463
|
+
}
|
|
2464
|
+
s.value = n;
|
|
2465
|
+
}
|
|
2466
|
+
return Z([
|
|
2467
|
+
e.layout,
|
|
2468
|
+
i,
|
|
2469
|
+
r
|
|
2470
|
+
], () => Se(c), { deep: !1 }), we(() => {
|
|
2471
|
+
Se(c), window.addEventListener("resize", c);
|
|
2472
|
+
}), Ce(() => {
|
|
2473
|
+
window.removeEventListener("resize", c);
|
|
2474
|
+
}), Z(e.resetToken, () => {
|
|
2475
|
+
r.value = /* @__PURE__ */ new Set();
|
|
2476
|
+
}), {
|
|
2477
|
+
BAR_HEIGHT: rn,
|
|
2478
|
+
BAR_GAP: an,
|
|
2479
|
+
DAY_NUMBER_HEIGHT: on,
|
|
2480
|
+
barTopPx: t,
|
|
2481
|
+
rowBarHeightsPx: n,
|
|
2482
|
+
rowHeightPx: i,
|
|
2483
|
+
expandedRows: r,
|
|
2484
|
+
expandRow: a,
|
|
2485
|
+
collapseRow: o,
|
|
2486
|
+
overflowingCells: s
|
|
2487
|
+
};
|
|
2488
|
+
}
|
|
2489
|
+
//#endregion
|
|
2490
|
+
//#region src/components/internal/month/CoarMonthPill.vue?vue&type=script&setup=true&lang.ts
|
|
2491
|
+
var dn = [
|
|
2492
|
+
"data-event-id",
|
|
2493
|
+
"tabindex",
|
|
2494
|
+
"role",
|
|
2495
|
+
"aria-label",
|
|
2496
|
+
"aria-hidden"
|
|
2497
|
+
], fn = { class: "coar-month-pill__title" }, pn = { class: "coar-month-pill__title" }, mn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2498
|
+
__name: "CoarMonthPill",
|
|
2499
|
+
props: {
|
|
2500
|
+
event: {},
|
|
2501
|
+
pill: {},
|
|
2502
|
+
variant: { default: "live" },
|
|
2503
|
+
bg: {},
|
|
2504
|
+
border: {},
|
|
2505
|
+
title: {},
|
|
2506
|
+
displayZone: { default: void 0 },
|
|
2507
|
+
ariaLabel: { default: void 0 },
|
|
2508
|
+
snappingBack: {
|
|
2509
|
+
type: Boolean,
|
|
2510
|
+
default: !1
|
|
2511
|
+
},
|
|
2512
|
+
density: { default: "comfortable" },
|
|
2513
|
+
kbdActive: {
|
|
2514
|
+
type: Boolean,
|
|
2515
|
+
default: !1
|
|
2516
|
+
}
|
|
2517
|
+
},
|
|
2518
|
+
emits: [
|
|
2519
|
+
"pointerdown",
|
|
2520
|
+
"keydown",
|
|
2521
|
+
"dblclick"
|
|
2522
|
+
],
|
|
2523
|
+
setup(e, { emit: t }) {
|
|
2524
|
+
let n = e, r = t, i = j(() => n.variant === "live" || n.variant === "preview" && n.kbdActive), a = j(() => n.variant === "live" || n.variant === "preview");
|
|
2525
|
+
function o(e) {
|
|
2526
|
+
i.value && r("pointerdown", e);
|
|
2527
|
+
}
|
|
2528
|
+
function s(e) {
|
|
2529
|
+
i.value && r("keydown", e);
|
|
2530
|
+
}
|
|
2531
|
+
function c(e) {
|
|
2532
|
+
i.value && (e.stopPropagation(), r("dblclick", e));
|
|
2533
|
+
}
|
|
2534
|
+
return (t, n) => (U(), P("div", {
|
|
2535
|
+
class: z(["coar-month-pill", {
|
|
2536
|
+
"coar-month-pill--ghost": e.variant === "preview",
|
|
2537
|
+
"coar-month-pill--source-phantom": e.variant === "phantom",
|
|
2538
|
+
"coar-month-pill--invalid": e.variant === "invalid",
|
|
2539
|
+
"coar-month-pill--snap-back": e.variant === "invalid" && e.snappingBack,
|
|
2540
|
+
"coar-month-pill--density-compact": e.density === "compact"
|
|
2541
|
+
}]),
|
|
2542
|
+
style: V({
|
|
2543
|
+
background: e.bg,
|
|
2544
|
+
borderLeft: `3px solid ${e.border}`
|
|
2545
|
+
}),
|
|
2546
|
+
"data-event-id": i.value ? e.event.id : void 0,
|
|
2547
|
+
tabindex: i.value ? 0 : -1,
|
|
2548
|
+
role: i.value ? "button" : void 0,
|
|
2549
|
+
"aria-label": i.value ? e.ariaLabel : void 0,
|
|
2550
|
+
"aria-hidden": i.value ? void 0 : "true",
|
|
2551
|
+
onPointerdown: o,
|
|
2552
|
+
onKeydown: s,
|
|
2553
|
+
onDblclick: c
|
|
2554
|
+
}, [a.value ? K(t.$slots, "default", {
|
|
2555
|
+
key: 0,
|
|
2556
|
+
event: e.event,
|
|
2557
|
+
pill: e.pill
|
|
2558
|
+
}, () => [I(vt, {
|
|
2559
|
+
event: e.event,
|
|
2560
|
+
"display-zone": e.displayZone,
|
|
2561
|
+
size: "xs"
|
|
2562
|
+
}, null, 8, ["event", "display-zone"]), F("span", fn, J(e.title), 1)], !0) : (U(), P(A, { key: 1 }, [I(vt, {
|
|
2563
|
+
event: e.event,
|
|
2564
|
+
"display-zone": e.displayZone,
|
|
2565
|
+
size: "xs"
|
|
2566
|
+
}, null, 8, ["event", "display-zone"]), F("span", pn, J(e.title), 1)], 64))], 46, dn));
|
|
2567
|
+
}
|
|
2568
|
+
}), [["__scopeId", "data-v-037f7ee1"]]), hn = [
|
|
2569
|
+
"data-event-id",
|
|
2570
|
+
"tabindex",
|
|
2571
|
+
"role",
|
|
2572
|
+
"aria-label",
|
|
2573
|
+
"aria-hidden"
|
|
2574
|
+
], gn = { class: "coar-month-bar__title" }, _n = { class: "coar-month-bar__title" }, vn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2575
|
+
__name: "CoarMonthBar",
|
|
2576
|
+
props: {
|
|
2577
|
+
event: {},
|
|
2578
|
+
bar: {},
|
|
2579
|
+
variant: { default: "live" },
|
|
2580
|
+
bg: {},
|
|
2581
|
+
border: {},
|
|
2582
|
+
title: {},
|
|
2583
|
+
displayZone: { default: void 0 },
|
|
2584
|
+
ariaLabel: { default: void 0 },
|
|
2585
|
+
snappingBack: {
|
|
2586
|
+
type: Boolean,
|
|
2587
|
+
default: !1
|
|
2588
|
+
},
|
|
2589
|
+
density: { default: "comfortable" },
|
|
2590
|
+
top: {},
|
|
2591
|
+
left: {},
|
|
2592
|
+
width: {},
|
|
2593
|
+
height: {},
|
|
2594
|
+
zIndex: {},
|
|
2595
|
+
clippedStart: {
|
|
2596
|
+
type: Boolean,
|
|
2597
|
+
default: !1
|
|
2598
|
+
},
|
|
2599
|
+
clippedEnd: {
|
|
2600
|
+
type: Boolean,
|
|
2601
|
+
default: !1
|
|
2602
|
+
},
|
|
2603
|
+
kbdActive: {
|
|
2604
|
+
type: Boolean,
|
|
2605
|
+
default: !1
|
|
2606
|
+
}
|
|
2607
|
+
},
|
|
2608
|
+
emits: [
|
|
2609
|
+
"pointerdown",
|
|
2610
|
+
"keydown",
|
|
2611
|
+
"dblclick",
|
|
2612
|
+
"startResize",
|
|
2613
|
+
"endResize"
|
|
2614
|
+
],
|
|
2615
|
+
setup(e, { emit: t }) {
|
|
2616
|
+
let n = e, r = t, i = j(() => n.variant === "live" || n.variant === "preview" && n.kbdActive), a = j(() => n.variant === "live" || n.variant === "preview"), o = j(() => i.value && !n.clippedStart), s = j(() => i.value && !n.clippedEnd), c = j(() => n.clippedStart ? "none" : `3px solid ${n.border}`);
|
|
2617
|
+
function l(e) {
|
|
2618
|
+
i.value && r("pointerdown", e);
|
|
2619
|
+
}
|
|
2620
|
+
function u(e) {
|
|
2621
|
+
i.value && r("keydown", e);
|
|
2622
|
+
}
|
|
2623
|
+
function d(e) {
|
|
2624
|
+
i.value && (e.stopPropagation(), r("dblclick", e));
|
|
2625
|
+
}
|
|
2626
|
+
function f(e) {
|
|
2627
|
+
e.stopPropagation(), r("startResize", e);
|
|
2628
|
+
}
|
|
2629
|
+
function p(e) {
|
|
2630
|
+
e.stopPropagation(), r("endResize", e);
|
|
2631
|
+
}
|
|
2632
|
+
return (t, n) => (U(), P("div", {
|
|
2633
|
+
class: z(["coar-month-bar", {
|
|
2634
|
+
"coar-month-bar--clipped-start": e.clippedStart,
|
|
2635
|
+
"coar-month-bar--clipped-end": e.clippedEnd,
|
|
2636
|
+
"coar-month-bar--ghost": e.variant === "preview",
|
|
2637
|
+
"coar-month-bar--source-phantom": e.variant === "phantom",
|
|
2638
|
+
"coar-month-bar--invalid": e.variant === "invalid",
|
|
2639
|
+
"coar-month-bar--snap-back": e.variant === "invalid" && e.snappingBack,
|
|
2640
|
+
"coar-month-bar--density-compact": e.density === "compact"
|
|
2641
|
+
}]),
|
|
2642
|
+
style: V({
|
|
2643
|
+
top: e.top + "px",
|
|
2644
|
+
left: e.left,
|
|
2645
|
+
width: e.width,
|
|
2646
|
+
height: e.height + "px",
|
|
2647
|
+
background: e.bg,
|
|
2648
|
+
borderLeft: c.value,
|
|
2649
|
+
zIndex: e.zIndex
|
|
2650
|
+
}),
|
|
2651
|
+
"data-event-id": i.value ? e.event.id : void 0,
|
|
2652
|
+
tabindex: i.value ? 0 : -1,
|
|
2653
|
+
role: i.value ? "button" : void 0,
|
|
2654
|
+
"aria-label": i.value ? e.ariaLabel : void 0,
|
|
2655
|
+
"aria-hidden": i.value ? void 0 : "true",
|
|
2656
|
+
onPointerdown: l,
|
|
2657
|
+
onKeydown: u,
|
|
2658
|
+
onDblclick: d
|
|
2659
|
+
}, [
|
|
2660
|
+
o.value ? (U(), P("div", {
|
|
2661
|
+
key: 0,
|
|
2662
|
+
class: "coar-month-bar__resize coar-month-bar__resize--start",
|
|
2663
|
+
"aria-hidden": "true",
|
|
2664
|
+
onPointerdown: f
|
|
2665
|
+
}, null, 32)) : N("", !0),
|
|
2666
|
+
a.value ? K(t.$slots, "default", {
|
|
2667
|
+
key: 1,
|
|
2668
|
+
event: e.event,
|
|
2669
|
+
bar: e.bar
|
|
2670
|
+
}, () => [e.clippedStart ? N("", !0) : (U(), M(vt, {
|
|
2671
|
+
key: 0,
|
|
2672
|
+
event: e.event,
|
|
2673
|
+
"display-zone": e.displayZone,
|
|
2674
|
+
size: "xs"
|
|
2675
|
+
}, null, 8, ["event", "display-zone"])), F("span", gn, J(e.title), 1)], !0) : (U(), P(A, { key: 2 }, [e.clippedStart ? N("", !0) : (U(), M(vt, {
|
|
2676
|
+
key: 0,
|
|
2677
|
+
event: e.event,
|
|
2678
|
+
"display-zone": e.displayZone,
|
|
2679
|
+
size: "xs"
|
|
2680
|
+
}, null, 8, ["event", "display-zone"])), F("span", _n, J(e.title), 1)], 64)),
|
|
2681
|
+
s.value ? (U(), P("div", {
|
|
2682
|
+
key: 3,
|
|
2683
|
+
class: "coar-month-bar__resize coar-month-bar__resize--end",
|
|
2684
|
+
"aria-hidden": "true",
|
|
2685
|
+
onPointerdown: p
|
|
2686
|
+
}, null, 32)) : N("", !0)
|
|
2687
|
+
], 46, hn));
|
|
2688
|
+
}
|
|
2689
|
+
}), [["__scopeId", "data-v-5ade6911"]]), yn = [
|
|
2690
|
+
"data-day-key",
|
|
2691
|
+
"aria-rowindex",
|
|
2692
|
+
"aria-colindex",
|
|
2693
|
+
"aria-label",
|
|
2694
|
+
"aria-current"
|
|
2695
|
+
], bn = { class: "coar-month-cell__day-number-row" }, xn = { class: "coar-month-cell__day-number" }, Sn = ["aria-label", "aria-expanded"], Cn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2696
|
+
__name: "CoarMonthCell",
|
|
2697
|
+
props: {
|
|
2698
|
+
day: {},
|
|
2699
|
+
dayKey: {},
|
|
2700
|
+
isToday: {
|
|
2701
|
+
type: Boolean,
|
|
2702
|
+
default: !1
|
|
2703
|
+
},
|
|
2704
|
+
isOtherMonth: {
|
|
2705
|
+
type: Boolean,
|
|
2706
|
+
default: !1
|
|
2707
|
+
},
|
|
2708
|
+
isWeekend: {
|
|
2709
|
+
type: Boolean,
|
|
2710
|
+
default: !1
|
|
2711
|
+
},
|
|
2712
|
+
pillsMarginTopPx: {},
|
|
2713
|
+
menuOpenForThisCell: {
|
|
2714
|
+
type: Boolean,
|
|
2715
|
+
default: !1
|
|
2716
|
+
},
|
|
2717
|
+
kebabAriaLabel: {},
|
|
2718
|
+
density: { default: "comfortable" },
|
|
2719
|
+
ariaRowIndex: {},
|
|
2720
|
+
ariaColIndex: {},
|
|
2721
|
+
ariaLabel: {}
|
|
2722
|
+
},
|
|
2723
|
+
emits: [
|
|
2724
|
+
"cellPointerdown",
|
|
2725
|
+
"cellContextmenu",
|
|
2726
|
+
"kebabClick"
|
|
2727
|
+
],
|
|
2728
|
+
setup(e, { emit: t }) {
|
|
2729
|
+
let n = e, r = t, i = j(() => n.menuOpenForThisCell ? "true" : "false");
|
|
2730
|
+
function a(e) {
|
|
2731
|
+
r("cellPointerdown", e, n.day);
|
|
2732
|
+
}
|
|
2733
|
+
function o(e) {
|
|
2734
|
+
r("cellContextmenu", e, n.day);
|
|
2735
|
+
}
|
|
2736
|
+
function s(e) {
|
|
2737
|
+
r("kebabClick", e, n.day);
|
|
2738
|
+
}
|
|
2739
|
+
return (t, n) => (U(), P("div", {
|
|
2740
|
+
class: z(["coar-month-cell", {
|
|
2741
|
+
"coar-month-cell--today": e.isToday,
|
|
2742
|
+
"coar-month-cell--other-month": e.isOtherMonth,
|
|
2743
|
+
"coar-month-cell--weekend": e.isWeekend,
|
|
2744
|
+
"coar-month-cell--density-compact": e.density === "compact"
|
|
2745
|
+
}]),
|
|
2746
|
+
"data-day-key": e.dayKey,
|
|
2747
|
+
role: "gridcell",
|
|
2748
|
+
"aria-rowindex": e.ariaRowIndex,
|
|
2749
|
+
"aria-colindex": e.ariaColIndex,
|
|
2750
|
+
"aria-label": e.ariaLabel,
|
|
2751
|
+
"aria-current": e.isToday ? "date" : void 0,
|
|
2752
|
+
onPointerdown: a,
|
|
2753
|
+
onContextmenu: o
|
|
2754
|
+
}, [F("div", bn, [F("span", xn, J(e.day.day), 1), F("button", {
|
|
2755
|
+
type: "button",
|
|
2756
|
+
class: "coar-month-cell__menu-trigger",
|
|
2757
|
+
"aria-label": e.kebabAriaLabel,
|
|
2758
|
+
"aria-haspopup": "menu",
|
|
2759
|
+
"aria-expanded": i.value,
|
|
2760
|
+
onPointerdown: n[0] ||= ke(() => {}, ["stop"]),
|
|
2761
|
+
onClick: ke(s, ["stop"])
|
|
2762
|
+
}, [...n[1] ||= [F("svg", {
|
|
2763
|
+
viewBox: "0 0 12 12",
|
|
2764
|
+
width: "12",
|
|
2765
|
+
height: "12",
|
|
2766
|
+
"aria-hidden": "true"
|
|
2767
|
+
}, [
|
|
2768
|
+
F("circle", {
|
|
2769
|
+
cx: "6",
|
|
2770
|
+
cy: "2.5",
|
|
2771
|
+
r: "1",
|
|
2772
|
+
fill: "currentColor"
|
|
2773
|
+
}),
|
|
2774
|
+
F("circle", {
|
|
2775
|
+
cx: "6",
|
|
2776
|
+
cy: "6",
|
|
2777
|
+
r: "1",
|
|
2778
|
+
fill: "currentColor"
|
|
2779
|
+
}),
|
|
2780
|
+
F("circle", {
|
|
2781
|
+
cx: "6",
|
|
2782
|
+
cy: "9.5",
|
|
2783
|
+
r: "1",
|
|
2784
|
+
fill: "currentColor"
|
|
2785
|
+
})
|
|
2786
|
+
], -1)]], 40, Sn)]), F("div", {
|
|
2787
|
+
class: "coar-month-cell__pills",
|
|
2788
|
+
style: V({ marginTop: e.pillsMarginTopPx + "px" })
|
|
2789
|
+
}, [K(t.$slots, "default", {}, void 0, !0)], 4)], 42, yn));
|
|
2790
|
+
}
|
|
2791
|
+
}), [["__scopeId", "data-v-72760fa4"]]), wn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2792
|
+
__name: "CoarMonthRow",
|
|
2793
|
+
props: {
|
|
2794
|
+
heightPx: {},
|
|
2795
|
+
density: { default: "comfortable" }
|
|
2796
|
+
},
|
|
2797
|
+
setup(e) {
|
|
2798
|
+
return (t, n) => (U(), P("div", {
|
|
2799
|
+
class: z(["coar-month-row", { "coar-month-row--density-compact": e.density === "compact" }]),
|
|
2800
|
+
style: V({ height: e.heightPx + "px" }),
|
|
2801
|
+
role: "row"
|
|
2802
|
+
}, [K(t.$slots, "default", {}, void 0, !0)], 6));
|
|
2803
|
+
}
|
|
2804
|
+
}), [["__scopeId", "data-v-0d63c1bf"]]), Tn = { class: "coar-month-grid" }, En = {
|
|
2805
|
+
class: "coar-month-grid__weekday-row",
|
|
2806
|
+
role: "row",
|
|
2807
|
+
"aria-rowindex": "1"
|
|
2808
|
+
}, Dn = ["aria-colindex"], On = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2809
|
+
__name: "CoarMonthGrid",
|
|
2810
|
+
props: {
|
|
2811
|
+
weekdayHeaders: {},
|
|
2812
|
+
setRowsEl: { type: Function }
|
|
2813
|
+
},
|
|
2814
|
+
setup(e) {
|
|
2815
|
+
return (t, n) => (U(), P("div", Tn, [F("div", En, [(U(!0), P(A, null, G(e.weekdayHeaders, (e, t) => (U(), P("div", {
|
|
2816
|
+
key: t,
|
|
2817
|
+
class: "coar-month-grid__weekday-cell",
|
|
2818
|
+
role: "columnheader",
|
|
2819
|
+
"aria-colindex": t + 1
|
|
2820
|
+
}, J(e), 9, Dn))), 128))]), F("div", {
|
|
2821
|
+
ref: (t) => e.setRowsEl(t),
|
|
2822
|
+
class: "coar-month-grid__rows"
|
|
2823
|
+
}, [K(t.$slots, "default", {}, void 0, !0)], 512)]));
|
|
2824
|
+
}
|
|
2825
|
+
}), [["__scopeId", "data-v-d0d74cdf"]]), kn = ["aria-label", "aria-rowcount"], An = {
|
|
2826
|
+
class: "coar-month-view__a11y-live",
|
|
2827
|
+
role: "status",
|
|
2828
|
+
"aria-live": "polite",
|
|
2829
|
+
"aria-atomic": "true"
|
|
2830
|
+
}, jn = {
|
|
2831
|
+
key: 2,
|
|
2832
|
+
class: "coar-month-view__pill-title"
|
|
2833
|
+
}, Mn = {
|
|
2834
|
+
key: 2,
|
|
2835
|
+
class: "coar-month-view__bar-title"
|
|
2836
|
+
}, Nn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
2837
|
+
__name: "CoarMonthView",
|
|
2838
|
+
props: { builder: {} },
|
|
2839
|
+
setup(e, { expose: t }) {
|
|
2840
|
+
let i = e, { t: o } = Ae(), s = j(() => {
|
|
2841
|
+
let e = i.builder.state;
|
|
2842
|
+
return {
|
|
2843
|
+
events: e.events ? Y(e.events) : [],
|
|
2844
|
+
timezone: Y(e.timezone),
|
|
2845
|
+
locale: Y(e.locale),
|
|
2846
|
+
firstDayOfWeek: Y(e.firstDayOfWeek),
|
|
2847
|
+
density: Y(e.density),
|
|
2848
|
+
dateStyle: Y(e.dateStyle),
|
|
2849
|
+
timeStyle: Y(e.timeStyle),
|
|
2850
|
+
hour12: Y(e.hour12),
|
|
2851
|
+
dstPolicy: Y(e.dstPolicy),
|
|
2852
|
+
canDrop: e.canDrop,
|
|
2853
|
+
eventRenderer: e.eventRenderer,
|
|
2854
|
+
maxEventsPerCell: Y(e.maxEventsPerCell)
|
|
2855
|
+
};
|
|
2856
|
+
}), c = j(() => i.builder.state.date.value), l = je(), u = j(() => s.value.locale ?? l?.language.value ?? "en-US"), d = j(() => s.value.timezone), f = j(() => s.value.firstDayOfWeek ?? r(u.value));
|
|
2857
|
+
Ze(i.builder, { view: "month" });
|
|
2858
|
+
let m = j(() => {
|
|
2859
|
+
let e = n.PlainDate.from(c.value);
|
|
2860
|
+
return n.PlainYearMonth.from({
|
|
2861
|
+
year: e.year,
|
|
2862
|
+
month: e.month
|
|
2863
|
+
});
|
|
2864
|
+
}), h = j(() => a(m.value, f.value)), y = j(() => p(u.value, f.value, "short")), b = W(null);
|
|
2865
|
+
function x(e) {
|
|
2866
|
+
b.value = e;
|
|
2867
|
+
}
|
|
2868
|
+
let { dnd: S, workingEvents: ee, dragSourceSnapshot: C, invalidMonthGhost: w, isPreviewId: ne, isInvalidPillTarget: T, onMonthEventPointerdown: E, onMonthEventKeydown: re, keyboardDrag: D } = ot({
|
|
2869
|
+
events: () => s.value.events,
|
|
2870
|
+
gridDates: h,
|
|
2871
|
+
gridRef: b,
|
|
2872
|
+
timezone: () => d.value,
|
|
2873
|
+
dstPolicy: () => s.value.dstPolicy,
|
|
2874
|
+
canDrop: s.value.canDrop,
|
|
2875
|
+
onEventClick: (e, t) => {
|
|
2876
|
+
t && i.builder.state.onEventClick?.({
|
|
2877
|
+
event: e,
|
|
2878
|
+
native: t
|
|
2879
|
+
});
|
|
2880
|
+
},
|
|
2881
|
+
onEventDrop: (e) => i.builder.state.onEventDrop?.(e),
|
|
2882
|
+
onAnnounce: (e, t) => O(e, t)
|
|
2883
|
+
}), ie = it();
|
|
2884
|
+
function ae(e) {
|
|
2885
|
+
let t = e.meta, n = (typeof t?.title == "string" ? t.title : void 0) ?? o("coar.calendar.a11y.unnamedEvent", void 0, "Event");
|
|
2886
|
+
return o("coar.calendar.a11y.kbdPreviewLabel", { title: n }, `${n} preview — Arrow keys to move, Enter to commit, Escape to cancel`);
|
|
2887
|
+
}
|
|
2888
|
+
function oe(e) {
|
|
2889
|
+
let t = e.meta;
|
|
2890
|
+
return typeof t?.title == "string" ? t.title : o("coar.calendar.a11y.unnamedEvent", void 0, "Event");
|
|
2891
|
+
}
|
|
2892
|
+
function se(e) {
|
|
2893
|
+
try {
|
|
2894
|
+
let t = new Intl.DateTimeFormat(u.value, k({
|
|
2895
|
+
weekday: "short",
|
|
2896
|
+
day: "numeric",
|
|
2897
|
+
month: "short",
|
|
2898
|
+
timeZone: "UTC"
|
|
2899
|
+
}, {
|
|
2900
|
+
dateStyle: s.value.dateStyle,
|
|
2901
|
+
hour12: s.value.hour12
|
|
2902
|
+
})), n = /* @__PURE__ */ new Date(e.target.date + "T00:00:00Z");
|
|
2903
|
+
return t.format(n);
|
|
2904
|
+
} catch {
|
|
2905
|
+
return e.target.date;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
function O(e, t) {
|
|
2909
|
+
if (e === "cancelled") {
|
|
2910
|
+
ie.announce(o("coar.calendar.a11y.moveCancelled", void 0, "Move cancelled"));
|
|
2911
|
+
return;
|
|
2912
|
+
}
|
|
2913
|
+
if (!t) return;
|
|
2914
|
+
let n = oe(t.event), r = se(t);
|
|
2915
|
+
ie.announce(o("coar.calendar.a11y.eventMovedTo", {
|
|
2916
|
+
title: n,
|
|
2917
|
+
when: r
|
|
2918
|
+
}, `${n} moved to ${r}`));
|
|
2919
|
+
}
|
|
2920
|
+
let ce = j(() => te(ee.value, {
|
|
2921
|
+
gridDates: h.value,
|
|
2922
|
+
timezone: d.value
|
|
2923
|
+
})), le = W(v(d.value));
|
|
2924
|
+
function ue(e) {
|
|
2925
|
+
return n.PlainDate.compare(e, le.value) === 0;
|
|
2926
|
+
}
|
|
2927
|
+
function de(e) {
|
|
2928
|
+
return e.year !== m.value.year || e.month !== m.value.month;
|
|
2929
|
+
}
|
|
2930
|
+
function fe(e) {
|
|
2931
|
+
return e.dayOfWeek === 6 || e.dayOfWeek === 7;
|
|
2932
|
+
}
|
|
2933
|
+
let { BAR_HEIGHT: pe, DAY_NUMBER_HEIGHT: me, barTopPx: he, rowBarHeightsPx: ge, rowHeightPx: L, expandedRows: _e, expandRow: ve, collapseRow: ye } = un({
|
|
2934
|
+
layout: ce,
|
|
2935
|
+
gridRef: b,
|
|
2936
|
+
resetToken: m
|
|
2937
|
+
}), be = Re(), R = W(null), xe = W(null), Se = W(!1);
|
|
2938
|
+
function B(e, t, n) {
|
|
2939
|
+
let r = e.currentTarget;
|
|
2940
|
+
if (!r) return;
|
|
2941
|
+
let i = r.getBoundingClientRect();
|
|
2942
|
+
R.value = t, xe.value = g(n), Se.value = !0, be.open({
|
|
2943
|
+
clientX: i.left,
|
|
2944
|
+
clientY: i.bottom + 4
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
function V(e, t, n) {
|
|
2948
|
+
R.value = t, xe.value = g(n), Se.value = !1, be.open(e);
|
|
2949
|
+
}
|
|
2950
|
+
Z(() => be.isOpen.value, (e) => {
|
|
2951
|
+
e || (Se.value = !1);
|
|
2952
|
+
}), Z(m, () => {
|
|
2953
|
+
be.close(), R.value = null, xe.value = null, Se.value = !1;
|
|
2954
|
+
});
|
|
2955
|
+
let Ce = j(() => {
|
|
2956
|
+
let e = /* @__PURE__ */ new Map();
|
|
2957
|
+
for (let t of ce.value.weekRows) for (let n of t.days) {
|
|
2958
|
+
let r = g(n);
|
|
2959
|
+
e.set(r, t.cellPills.get(r) ?? []);
|
|
2960
|
+
}
|
|
2961
|
+
return e;
|
|
2962
|
+
});
|
|
2963
|
+
function we(e) {
|
|
2964
|
+
return Ce.value.get(g(e)) ?? [];
|
|
2965
|
+
}
|
|
2966
|
+
function H(e) {
|
|
2967
|
+
let t = e.meta;
|
|
2968
|
+
return typeof t?.title == "string" ? t.title : "(untitled)";
|
|
2969
|
+
}
|
|
2970
|
+
function Te(e) {
|
|
2971
|
+
let t = e.meta;
|
|
2972
|
+
return typeof t?.color == "string" ? t.color : void 0;
|
|
2973
|
+
}
|
|
2974
|
+
function q(e) {
|
|
2975
|
+
return Te(e) ?? "var(--coar-color-accent-soft, #93c5fd)";
|
|
2976
|
+
}
|
|
2977
|
+
function Ee(e) {
|
|
2978
|
+
return Te(e) ?? "var(--coar-color-accent, #2563eb)";
|
|
2979
|
+
}
|
|
2980
|
+
let De = j(() => new Intl.DateTimeFormat(u.value, k({
|
|
2981
|
+
weekday: "long",
|
|
2982
|
+
day: "numeric",
|
|
2983
|
+
month: "long",
|
|
2984
|
+
year: "numeric",
|
|
2985
|
+
timeZone: "UTC"
|
|
2986
|
+
}, {
|
|
2987
|
+
dateStyle: s.value.dateStyle,
|
|
2988
|
+
hour12: s.value.hour12
|
|
2989
|
+
})));
|
|
2990
|
+
function Oe(e) {
|
|
2991
|
+
return De.value.format(new Date(Date.UTC(e.year, e.month - 1, e.day)));
|
|
2992
|
+
}
|
|
2993
|
+
function ke(e) {
|
|
2994
|
+
let t = H(e), n = {
|
|
2995
|
+
dateStyle: s.value.dateStyle,
|
|
2996
|
+
timeStyle: s.value.timeStyle,
|
|
2997
|
+
hour12: s.value.hour12
|
|
2998
|
+
};
|
|
2999
|
+
try {
|
|
3000
|
+
if (_(e)) {
|
|
3001
|
+
let r = new Intl.DateTimeFormat(u.value, k({
|
|
3002
|
+
weekday: "short",
|
|
3003
|
+
day: "numeric",
|
|
3004
|
+
month: "short",
|
|
3005
|
+
timeZone: "UTC"
|
|
3006
|
+
}, n)), i = e.start, a = new Date(Date.UTC(i.year, i.month - 1, i.day)), o = e.end ?? i, s = new Date(Date.UTC(o.year, o.month - 1, o.day));
|
|
3007
|
+
return `${t}, ${r.format(a)} – ${r.format(s)}`;
|
|
3008
|
+
}
|
|
3009
|
+
return `${t}, ${new Intl.DateTimeFormat(u.value, k({
|
|
3010
|
+
weekday: "short",
|
|
3011
|
+
day: "numeric",
|
|
3012
|
+
month: "short",
|
|
3013
|
+
hour: "numeric",
|
|
3014
|
+
minute: "2-digit",
|
|
3015
|
+
timeZone: d.value
|
|
3016
|
+
}, n)).format(new Date(e.start.epochMilliseconds))}`;
|
|
3017
|
+
} catch {
|
|
3018
|
+
return t;
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
function Me(e, t) {
|
|
3022
|
+
i.builder.state.onDateClick?.({
|
|
3023
|
+
date: t,
|
|
3024
|
+
native: e
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
let Pe = {
|
|
3028
|
+
event: {
|
|
3029
|
+
id: "__phantom__",
|
|
3030
|
+
start: "1970-01-01"
|
|
3031
|
+
},
|
|
3032
|
+
order: 0
|
|
3033
|
+
}, Ie = {
|
|
3034
|
+
event: {
|
|
3035
|
+
id: "__phantom__",
|
|
3036
|
+
start: "1970-01-01"
|
|
3037
|
+
},
|
|
3038
|
+
lane: 0,
|
|
3039
|
+
laneCount: 1,
|
|
3040
|
+
startCol: 0,
|
|
3041
|
+
endCol: 0,
|
|
3042
|
+
clippedStart: !1,
|
|
3043
|
+
clippedEnd: !1
|
|
3044
|
+
};
|
|
3045
|
+
return t({ getLayout: () => ce.value }), (e, t) => (U(), P("div", {
|
|
3046
|
+
class: z(["coar-month-view", [`coar-month-view--density-${s.value.density}`]]),
|
|
3047
|
+
role: "grid",
|
|
3048
|
+
"aria-label": X(o)("coar.calendar.month.gridLabel", void 0, "Month grid"),
|
|
3049
|
+
"aria-rowcount": ce.value.weekRows.length + 1,
|
|
3050
|
+
"aria-colcount": 7
|
|
3051
|
+
}, [
|
|
3052
|
+
F("div", An, J(X(ie).message.value), 1),
|
|
3053
|
+
I(On, {
|
|
3054
|
+
"weekday-headers": y.value,
|
|
3055
|
+
"set-rows-el": x
|
|
3056
|
+
}, {
|
|
3057
|
+
default: Q(() => [(U(!0), P(A, null, G(ce.value.weekRows, (t, n) => (U(), M(wn, {
|
|
3058
|
+
key: t.weekStart.toString(),
|
|
3059
|
+
"height-px": X(L)[n],
|
|
3060
|
+
density: s.value.density
|
|
3061
|
+
}, {
|
|
3062
|
+
default: Q(() => [
|
|
3063
|
+
(U(!0), P(A, null, G(t.days, (t, r) => (U(), M(Cn, {
|
|
3064
|
+
key: t.toString(),
|
|
3065
|
+
day: t,
|
|
3066
|
+
"day-key": X(g)(t),
|
|
3067
|
+
"is-today": ue(t),
|
|
3068
|
+
"is-other-month": de(t),
|
|
3069
|
+
"is-weekend": fe(t),
|
|
3070
|
+
"pills-margin-top-px": X(ge)[n] - X(me),
|
|
3071
|
+
"menu-open-for-this-cell": X(be).isOpen.value && Se.value && xe.value === X(g)(t),
|
|
3072
|
+
"kebab-aria-label": X(o)("coar.calendar.month.cellMenu", void 0, "Day actions"),
|
|
3073
|
+
density: s.value.density,
|
|
3074
|
+
"aria-row-index": n + 2,
|
|
3075
|
+
"aria-col-index": r + 1,
|
|
3076
|
+
"aria-label": Oe(t),
|
|
3077
|
+
onCellPointerdown: (e) => Me(e, t),
|
|
3078
|
+
onCellContextmenu: (e) => V(e, n, t),
|
|
3079
|
+
onKebabClick: (e) => B(e, n, t)
|
|
3080
|
+
}, {
|
|
3081
|
+
default: Q(() => [
|
|
3082
|
+
(U(!0), P(A, null, G(we(t), (t) => (U(), M(mn, {
|
|
3083
|
+
key: t.event.id,
|
|
3084
|
+
event: t.event,
|
|
3085
|
+
pill: t,
|
|
3086
|
+
variant: X(ne)(t.event.id) ? "preview" : "live",
|
|
3087
|
+
"kbd-active": X(D) !== null,
|
|
3088
|
+
bg: q(t.event),
|
|
3089
|
+
border: Ee(t.event),
|
|
3090
|
+
title: H(t.event),
|
|
3091
|
+
"display-zone": d.value,
|
|
3092
|
+
"aria-label": X(ne)(t.event.id) && X(D) ? ae(t.event) : ke(t.event),
|
|
3093
|
+
density: s.value.density,
|
|
3094
|
+
onPointerdown: (e) => X(E)(e, t.event),
|
|
3095
|
+
onKeydown: (e) => X(re)(e, t.event),
|
|
3096
|
+
onDblclick: (e) => i.builder.state.onEventDoubleClick?.({
|
|
3097
|
+
event: t.event,
|
|
3098
|
+
native: e
|
|
3099
|
+
})
|
|
3100
|
+
}, {
|
|
3101
|
+
default: Q(({ event: t, pill: n }) => [e.$slots.pill ? K(e.$slots, "pill", {
|
|
3102
|
+
key: 0,
|
|
3103
|
+
event: t,
|
|
3104
|
+
pill: n
|
|
3105
|
+
}, void 0, !0) : s.value.pillRenderer ?? s.value.eventRenderer ? (U(), M(X(dt), {
|
|
3106
|
+
key: 1,
|
|
3107
|
+
renderer: s.value.pillRenderer ?? s.value.eventRenderer,
|
|
3108
|
+
ctx: {
|
|
3109
|
+
event: t,
|
|
3110
|
+
view: "month",
|
|
3111
|
+
layout: {
|
|
3112
|
+
kind: "monthPill",
|
|
3113
|
+
layout: n
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
}, null, 8, ["renderer", "ctx"])) : (U(), P("span", jn, J(H(t)), 1))]),
|
|
3117
|
+
_: 2
|
|
3118
|
+
}, 1032, [
|
|
3119
|
+
"event",
|
|
3120
|
+
"pill",
|
|
3121
|
+
"variant",
|
|
3122
|
+
"kbd-active",
|
|
3123
|
+
"bg",
|
|
3124
|
+
"border",
|
|
3125
|
+
"title",
|
|
3126
|
+
"display-zone",
|
|
3127
|
+
"aria-label",
|
|
3128
|
+
"density",
|
|
3129
|
+
"onPointerdown",
|
|
3130
|
+
"onKeydown",
|
|
3131
|
+
"onDblclick"
|
|
3132
|
+
]))), 128)),
|
|
3133
|
+
X(C) && X(C).bars.length === 0 && X(C).pillCells.includes(X(g)(t)) ? (U(), M(mn, {
|
|
3134
|
+
key: 0,
|
|
3135
|
+
variant: "phantom",
|
|
3136
|
+
event: X(C).event,
|
|
3137
|
+
pill: Pe,
|
|
3138
|
+
bg: q(X(C).event),
|
|
3139
|
+
border: Ee(X(C).event),
|
|
3140
|
+
title: H(X(C).event),
|
|
3141
|
+
"display-zone": d.value,
|
|
3142
|
+
density: s.value.density
|
|
3143
|
+
}, null, 8, [
|
|
3144
|
+
"event",
|
|
3145
|
+
"bg",
|
|
3146
|
+
"border",
|
|
3147
|
+
"title",
|
|
3148
|
+
"display-zone",
|
|
3149
|
+
"density"
|
|
3150
|
+
])) : N("", !0),
|
|
3151
|
+
X(T)(t) && X(S).draggedEvent.value ? (U(), M(mn, {
|
|
3152
|
+
key: 1,
|
|
3153
|
+
variant: "invalid",
|
|
3154
|
+
event: X(S).draggedEvent.value,
|
|
3155
|
+
pill: Pe,
|
|
3156
|
+
bg: q(X(S).draggedEvent.value),
|
|
3157
|
+
border: Ee(X(S).draggedEvent.value),
|
|
3158
|
+
title: H(X(S).draggedEvent.value),
|
|
3159
|
+
"display-zone": d.value,
|
|
3160
|
+
"snapping-back": X(S).snappingBack.value,
|
|
3161
|
+
density: s.value.density
|
|
3162
|
+
}, null, 8, [
|
|
3163
|
+
"event",
|
|
3164
|
+
"bg",
|
|
3165
|
+
"border",
|
|
3166
|
+
"title",
|
|
3167
|
+
"display-zone",
|
|
3168
|
+
"snapping-back",
|
|
3169
|
+
"density"
|
|
3170
|
+
])) : N("", !0)
|
|
3171
|
+
]),
|
|
3172
|
+
_: 2
|
|
3173
|
+
}, 1032, [
|
|
3174
|
+
"day",
|
|
3175
|
+
"day-key",
|
|
3176
|
+
"is-today",
|
|
3177
|
+
"is-other-month",
|
|
3178
|
+
"is-weekend",
|
|
3179
|
+
"pills-margin-top-px",
|
|
3180
|
+
"menu-open-for-this-cell",
|
|
3181
|
+
"kebab-aria-label",
|
|
3182
|
+
"density",
|
|
3183
|
+
"aria-row-index",
|
|
3184
|
+
"aria-col-index",
|
|
3185
|
+
"aria-label",
|
|
3186
|
+
"onCellPointerdown",
|
|
3187
|
+
"onCellContextmenu",
|
|
3188
|
+
"onKebabClick"
|
|
3189
|
+
]))), 128)),
|
|
3190
|
+
(U(!0), P(A, null, G(t.multiDayBars, (t) => (U(), M(vn, {
|
|
3191
|
+
key: t.event.id,
|
|
3192
|
+
event: t.event,
|
|
3193
|
+
bar: t,
|
|
3194
|
+
variant: X(ne)(t.event.id) ? "preview" : "live",
|
|
3195
|
+
"kbd-active": X(D) !== null,
|
|
3196
|
+
bg: q(t.event),
|
|
3197
|
+
border: Ee(t.event),
|
|
3198
|
+
title: H(t.event),
|
|
3199
|
+
"display-zone": d.value,
|
|
3200
|
+
"aria-label": X(ne)(t.event.id) && X(D) ? ae(t.event) : ke(t.event),
|
|
3201
|
+
density: s.value.density,
|
|
3202
|
+
top: X(he)(t.lane),
|
|
3203
|
+
left: `calc(${t.startCol / 7 * 100}% + 2px)`,
|
|
3204
|
+
width: `calc(${(t.endCol - t.startCol + 1) / 7 * 100}% - 4px)`,
|
|
3205
|
+
height: X(pe),
|
|
3206
|
+
"z-index": X(ne)(t.event.id) ? 100 : t.lane + 1,
|
|
3207
|
+
"clipped-start": t.clippedStart,
|
|
3208
|
+
"clipped-end": t.clippedEnd,
|
|
3209
|
+
onPointerdown: (e) => X(E)(e, t.event),
|
|
3210
|
+
onKeydown: (e) => X(re)(e, t.event),
|
|
3211
|
+
onDblclick: (e) => i.builder.state.onEventDoubleClick?.({
|
|
3212
|
+
event: t.event,
|
|
3213
|
+
native: e
|
|
3214
|
+
}),
|
|
3215
|
+
onStartResize: (e) => X(S).startMonthResizeStart(t.event)(e),
|
|
3216
|
+
onEndResize: (e) => X(S).startMonthResizeEnd(t.event)(e)
|
|
3217
|
+
}, {
|
|
3218
|
+
default: Q(({ event: t, bar: n }) => [e.$slots.multiDayBar ? K(e.$slots, "multiDayBar", {
|
|
3219
|
+
key: 0,
|
|
3220
|
+
event: t,
|
|
3221
|
+
bar: n
|
|
3222
|
+
}, void 0, !0) : s.value.barRenderer ?? s.value.eventRenderer ? (U(), M(X(dt), {
|
|
3223
|
+
key: 1,
|
|
3224
|
+
renderer: s.value.barRenderer ?? s.value.eventRenderer,
|
|
3225
|
+
ctx: {
|
|
3226
|
+
event: t,
|
|
3227
|
+
view: "month",
|
|
3228
|
+
layout: {
|
|
3229
|
+
kind: "monthBar",
|
|
3230
|
+
layout: n
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
}, null, 8, ["renderer", "ctx"])) : (U(), P("span", Mn, J(H(t)), 1))]),
|
|
3234
|
+
_: 3
|
|
3235
|
+
}, 8, [
|
|
3236
|
+
"event",
|
|
3237
|
+
"bar",
|
|
3238
|
+
"variant",
|
|
3239
|
+
"kbd-active",
|
|
3240
|
+
"bg",
|
|
3241
|
+
"border",
|
|
3242
|
+
"title",
|
|
3243
|
+
"display-zone",
|
|
3244
|
+
"aria-label",
|
|
3245
|
+
"density",
|
|
3246
|
+
"top",
|
|
3247
|
+
"left",
|
|
3248
|
+
"width",
|
|
3249
|
+
"height",
|
|
3250
|
+
"z-index",
|
|
3251
|
+
"clipped-start",
|
|
3252
|
+
"clipped-end",
|
|
3253
|
+
"onPointerdown",
|
|
3254
|
+
"onKeydown",
|
|
3255
|
+
"onDblclick",
|
|
3256
|
+
"onStartResize",
|
|
3257
|
+
"onEndResize"
|
|
3258
|
+
]))), 128)),
|
|
3259
|
+
(U(!0), P(A, null, G(X(C) && X(C).bars.length > 0 ? X(C).bars.filter((e) => e.rowIndex === n) : [], (e) => (U(), M(vn, {
|
|
3260
|
+
key: `phantom-${e.startCol}-${e.endCol}`,
|
|
3261
|
+
variant: "phantom",
|
|
3262
|
+
event: X(C).event,
|
|
3263
|
+
bar: Ie,
|
|
3264
|
+
bg: q(X(C).event),
|
|
3265
|
+
border: Ee(X(C).event),
|
|
3266
|
+
title: H(X(C).event),
|
|
3267
|
+
"display-zone": d.value,
|
|
3268
|
+
density: s.value.density,
|
|
3269
|
+
top: X(he)(e.lane),
|
|
3270
|
+
left: `calc(${e.startCol / 7 * 100}% + 2px)`,
|
|
3271
|
+
width: `calc(${(e.endCol - e.startCol + 1) / 7 * 100}% - 4px)`,
|
|
3272
|
+
height: X(pe),
|
|
3273
|
+
"z-index": e.lane + 1,
|
|
3274
|
+
"clipped-start": e.clippedStart,
|
|
3275
|
+
"clipped-end": e.clippedEnd
|
|
3276
|
+
}, null, 8, [
|
|
3277
|
+
"event",
|
|
3278
|
+
"bg",
|
|
3279
|
+
"border",
|
|
3280
|
+
"title",
|
|
3281
|
+
"display-zone",
|
|
3282
|
+
"density",
|
|
3283
|
+
"top",
|
|
3284
|
+
"left",
|
|
3285
|
+
"width",
|
|
3286
|
+
"height",
|
|
3287
|
+
"z-index",
|
|
3288
|
+
"clipped-start",
|
|
3289
|
+
"clipped-end"
|
|
3290
|
+
]))), 128)),
|
|
3291
|
+
X(w) && X(w).rowIndex === n && X(w).isBar && X(S).draggedEvent.value ? (U(), M(vn, {
|
|
3292
|
+
key: 0,
|
|
3293
|
+
variant: "invalid",
|
|
3294
|
+
event: X(S).draggedEvent.value,
|
|
3295
|
+
bar: Ie,
|
|
3296
|
+
bg: q(X(S).draggedEvent.value),
|
|
3297
|
+
border: Ee(X(S).draggedEvent.value),
|
|
3298
|
+
title: H(X(S).draggedEvent.value),
|
|
3299
|
+
"display-zone": d.value,
|
|
3300
|
+
"snapping-back": X(S).snappingBack.value,
|
|
3301
|
+
density: s.value.density,
|
|
3302
|
+
top: X(he)(0),
|
|
3303
|
+
left: `calc(${X(w).startCol / 7 * 100}% + 2px)`,
|
|
3304
|
+
width: `calc(${(X(w).endCol - X(w).startCol + 1) / 7 * 100}% - 4px)`,
|
|
3305
|
+
height: X(pe),
|
|
3306
|
+
"z-index": 100
|
|
3307
|
+
}, null, 8, [
|
|
3308
|
+
"event",
|
|
3309
|
+
"bg",
|
|
3310
|
+
"border",
|
|
3311
|
+
"title",
|
|
3312
|
+
"display-zone",
|
|
3313
|
+
"snapping-back",
|
|
3314
|
+
"density",
|
|
3315
|
+
"top",
|
|
3316
|
+
"left",
|
|
3317
|
+
"width",
|
|
3318
|
+
"height"
|
|
3319
|
+
])) : N("", !0)
|
|
3320
|
+
]),
|
|
3321
|
+
_: 2
|
|
3322
|
+
}, 1032, ["height-px", "density"]))), 128))]),
|
|
3323
|
+
_: 3
|
|
3324
|
+
}, 8, ["weekday-headers"]),
|
|
3325
|
+
I(X(Ne), { menu: X(be) }, {
|
|
3326
|
+
default: Q(() => [R.value !== null && !X(_e).has(R.value) ? (U(), M(X(Fe), {
|
|
3327
|
+
key: 0,
|
|
3328
|
+
label: X(o)("coar.calendar.month.expandRow", void 0, "Show more events"),
|
|
3329
|
+
onClick: t[0] ||= (e) => R.value !== null && X(ve)(R.value)
|
|
3330
|
+
}, null, 8, ["label"])) : N("", !0), R.value !== null && X(_e).has(R.value) ? (U(), M(X(Fe), {
|
|
3331
|
+
key: 1,
|
|
3332
|
+
label: X(o)("coar.calendar.month.collapseRow", void 0, "Show fewer events"),
|
|
3333
|
+
onClick: t[1] ||= (e) => R.value !== null && X(ye)(R.value)
|
|
3334
|
+
}, null, 8, ["label"])) : N("", !0)]),
|
|
3335
|
+
_: 1
|
|
3336
|
+
}, 8, ["menu"])
|
|
3337
|
+
], 10, kn));
|
|
3338
|
+
}
|
|
3339
|
+
}), [["__scopeId", "data-v-06e4bae9"]]), Pn = ["data-y"], Fn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
3340
|
+
__name: "VirtualizedSurface1DY",
|
|
3341
|
+
props: {
|
|
3342
|
+
itemCount: {},
|
|
3343
|
+
estimatedItemSize: {},
|
|
3344
|
+
fixedItemSize: { default: void 0 },
|
|
3345
|
+
overscan: { default: 3 },
|
|
3346
|
+
anchor: { default: "auto" }
|
|
3347
|
+
},
|
|
3348
|
+
emits: ["rangeChange", "scroll"],
|
|
3349
|
+
setup(e, { expose: t, emit: n }) {
|
|
3350
|
+
let r = e, i = n, a = j(() => r.fixedItemSize !== void 0), o = W(null), s = W(0), c = W(0), l = q(null);
|
|
3351
|
+
function u() {
|
|
3352
|
+
return l.value ||= new ue(r.itemCount, r.estimatedItemSize), l.value;
|
|
3353
|
+
}
|
|
3354
|
+
let d = W(0), f = j(() => a.value ? r.itemCount * r.fixedItemSize : (d.value, l.value ? l.value.totalSize() : r.itemCount * r.estimatedItemSize)), p = j(() => {
|
|
3355
|
+
if (a.value) {
|
|
3356
|
+
let e = r.fixedItemSize;
|
|
3357
|
+
if (r.itemCount === 0 || e === 0) return {
|
|
3358
|
+
startIndex: 0,
|
|
3359
|
+
endIndex: 0,
|
|
3360
|
+
offset: 0,
|
|
3361
|
+
totalSize: 0
|
|
3362
|
+
};
|
|
3363
|
+
let t = r.itemCount * e, n = Math.max(0, Math.min(s.value, t)), i = Math.floor(n / e), a = n + c.value >= t ? r.itemCount - 1 : Math.floor((n + c.value) / e), o = Math.max(0, i - Math.floor(r.overscan));
|
|
3364
|
+
return {
|
|
3365
|
+
startIndex: o,
|
|
3366
|
+
endIndex: Math.min(r.itemCount, a + 1 + Math.floor(r.overscan)),
|
|
3367
|
+
offset: o * e,
|
|
3368
|
+
totalSize: t
|
|
3369
|
+
};
|
|
3370
|
+
}
|
|
3371
|
+
return d.value, ee(u(), s.value, c.value, r.overscan);
|
|
3372
|
+
}), m = j(() => {
|
|
3373
|
+
let e = p.value, t = [];
|
|
3374
|
+
for (let n = e.startIndex; n < e.endIndex; n++) t.push(n);
|
|
3375
|
+
return t;
|
|
3376
|
+
});
|
|
3377
|
+
function h(e) {
|
|
3378
|
+
return a.value ? e * r.fixedItemSize : l.value ? l.value.prefixSum(e) : e * r.estimatedItemSize;
|
|
3379
|
+
}
|
|
3380
|
+
Z(p, (e) => {
|
|
3381
|
+
i("rangeChange", e);
|
|
3382
|
+
}, { immediate: !1 });
|
|
3383
|
+
let g = !1;
|
|
3384
|
+
function _(e) {
|
|
3385
|
+
g || (g = !0, requestAnimationFrame(() => {
|
|
3386
|
+
g = !1;
|
|
3387
|
+
let t = e.target;
|
|
3388
|
+
s.value = t.scrollTop, i("scroll", t.scrollTop);
|
|
3389
|
+
}));
|
|
3390
|
+
}
|
|
3391
|
+
let v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Map(), b = !1, x = null;
|
|
3392
|
+
function S() {
|
|
3393
|
+
x || a.value || typeof ResizeObserver > "u" || (x = new ResizeObserver((e) => {
|
|
3394
|
+
for (let t of e) {
|
|
3395
|
+
let e = v.get(t.target);
|
|
3396
|
+
if (!e) continue;
|
|
3397
|
+
let n = t.contentRect.height, i = l.value, a = i && i.has(e.index) ? i.get(e.index) : r.estimatedItemSize;
|
|
3398
|
+
Math.abs(n - a) < .5 || y.set(e.index, n);
|
|
3399
|
+
}
|
|
3400
|
+
y.size > 0 && w();
|
|
3401
|
+
}));
|
|
3402
|
+
}
|
|
3403
|
+
let C = {
|
|
3404
|
+
mounted(e, t) {
|
|
3405
|
+
a.value || (S(), x && (v.set(e, { index: t.value }), x.observe(e)));
|
|
3406
|
+
},
|
|
3407
|
+
updated(e, t) {
|
|
3408
|
+
let n = v.get(e);
|
|
3409
|
+
n && n.index !== t.value && (n.index = t.value);
|
|
3410
|
+
},
|
|
3411
|
+
unmounted(e) {
|
|
3412
|
+
x && x.unobserve(e), v.delete(e);
|
|
3413
|
+
}
|
|
3414
|
+
};
|
|
3415
|
+
function te(e) {
|
|
3416
|
+
if (r.anchor === null) return null;
|
|
3417
|
+
if (typeof r.anchor == "number") return r.anchor;
|
|
3418
|
+
if (r.itemCount === 0) return null;
|
|
3419
|
+
if (a.value) {
|
|
3420
|
+
let e = r.fixedItemSize;
|
|
3421
|
+
return e <= 0 ? 0 : Math.min(r.itemCount - 1, Math.floor(s.value / e));
|
|
3422
|
+
}
|
|
3423
|
+
return e.indexAtOffset(s.value);
|
|
3424
|
+
}
|
|
3425
|
+
function w() {
|
|
3426
|
+
b || (b = !0, requestAnimationFrame(ne));
|
|
3427
|
+
}
|
|
3428
|
+
function ne() {
|
|
3429
|
+
if (b = !1, y.size === 0) return;
|
|
3430
|
+
let e = u(), t = T(e), n = te(t);
|
|
3431
|
+
for (let [t, n] of y) t >= 0 && t < e.itemCount && e.set(t, n);
|
|
3432
|
+
if (y.clear(), d.value++, n !== null && o.value) {
|
|
3433
|
+
let r = ce(t, e, n);
|
|
3434
|
+
if (r !== 0) {
|
|
3435
|
+
let e = o.value;
|
|
3436
|
+
e.scrollTop += r, s.value = e.scrollTop;
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
function T(e) {
|
|
3441
|
+
let t = new ue(e.itemCount, e.estimatedSize);
|
|
3442
|
+
for (let n = 0; n < e.itemCount; n++) e.has(n) && t.set(n, e.get(n));
|
|
3443
|
+
return t;
|
|
3444
|
+
}
|
|
3445
|
+
Z(() => r.itemCount, (e) => {
|
|
3446
|
+
l.value && (l.value.resize(e), d.value++);
|
|
3447
|
+
}), Z(() => r.estimatedItemSize, (e) => {
|
|
3448
|
+
if (!l.value) return;
|
|
3449
|
+
let t = l.value, n = new ue(t.itemCount, e);
|
|
3450
|
+
for (let e = 0; e < t.itemCount; e++) t.has(e) && n.set(e, t.get(e));
|
|
3451
|
+
l.value = n, d.value++;
|
|
3452
|
+
});
|
|
3453
|
+
let E = null;
|
|
3454
|
+
return we(() => {
|
|
3455
|
+
let e = o.value;
|
|
3456
|
+
e && (c.value = e.clientHeight, s.value = e.scrollTop, typeof ResizeObserver < "u" && (E = new ResizeObserver(() => {
|
|
3457
|
+
let t = e.clientHeight;
|
|
3458
|
+
t !== c.value && (c.value = t);
|
|
3459
|
+
}), E.observe(e)));
|
|
3460
|
+
}), Ce(() => {
|
|
3461
|
+
x?.disconnect(), E?.disconnect(), y.clear();
|
|
3462
|
+
}), t({
|
|
3463
|
+
getContainerElement: () => o.value,
|
|
3464
|
+
getRange: () => p.value,
|
|
3465
|
+
getFirstVisibleIndex() {
|
|
3466
|
+
if (r.itemCount === 0) return 0;
|
|
3467
|
+
if (a.value) {
|
|
3468
|
+
let e = r.fixedItemSize;
|
|
3469
|
+
return e <= 0 ? 0 : Math.min(r.itemCount - 1, Math.floor(s.value / e));
|
|
3470
|
+
}
|
|
3471
|
+
return l.value ? l.value.indexAtOffset(s.value) : Math.floor(s.value / r.estimatedItemSize);
|
|
3472
|
+
},
|
|
3473
|
+
scrollToIndex(e, t = "auto") {
|
|
3474
|
+
let n = o.value;
|
|
3475
|
+
if (!n) return;
|
|
3476
|
+
let r = h(e);
|
|
3477
|
+
n.scrollTo({
|
|
3478
|
+
top: r,
|
|
3479
|
+
behavior: t
|
|
3480
|
+
});
|
|
3481
|
+
},
|
|
3482
|
+
getCache: () => l.value ? l.value : a.value ? (l.value = new ue(r.itemCount, r.fixedItemSize), l.value) : u()
|
|
3483
|
+
}), (e, t) => (U(), P("div", {
|
|
3484
|
+
ref_key: "containerRef",
|
|
3485
|
+
ref: o,
|
|
3486
|
+
class: "coar-virtualized-surface-1dy",
|
|
3487
|
+
onScroll: _
|
|
3488
|
+
}, [F("div", {
|
|
3489
|
+
class: "coar-virtualized-surface-1dy__spacer",
|
|
3490
|
+
style: V({ height: f.value + "px" })
|
|
3491
|
+
}, [(U(!0), P(A, null, G(m.value, (t) => Oe((U(), P("div", {
|
|
3492
|
+
key: t,
|
|
3493
|
+
class: "coar-virtualized-surface-1dy__item",
|
|
3494
|
+
style: V({ transform: `translateY(${h(t)}px)` }),
|
|
3495
|
+
"data-y": t
|
|
3496
|
+
}, [K(e.$slots, "item", { y: t }, void 0, !0)], 12, Pn)), [[C, t]])), 128))], 4)], 544));
|
|
3497
|
+
}
|
|
3498
|
+
}), [["__scopeId", "data-v-50d47c8e"]]), In = ["role", "aria-level"], Ln = { class: "coar-agenda-day-header__label" }, Rn = {
|
|
3499
|
+
key: 0,
|
|
3500
|
+
class: "coar-agenda-day-header__today"
|
|
3501
|
+
}, zn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
3502
|
+
__name: "CoarAgendaDayHeader",
|
|
3503
|
+
props: {
|
|
3504
|
+
date: {},
|
|
3505
|
+
item: {},
|
|
3506
|
+
isToday: {
|
|
3507
|
+
type: Boolean,
|
|
3508
|
+
default: !1
|
|
3509
|
+
},
|
|
3510
|
+
label: {},
|
|
3511
|
+
todayLabel: {},
|
|
3512
|
+
floating: {
|
|
3513
|
+
type: Boolean,
|
|
3514
|
+
default: !1
|
|
3515
|
+
},
|
|
3516
|
+
transform: { default: "none" }
|
|
3517
|
+
},
|
|
3518
|
+
emits: ["pointerdown"],
|
|
3519
|
+
setup(e, { emit: t }) {
|
|
3520
|
+
let n = t;
|
|
3521
|
+
function r(e) {
|
|
3522
|
+
n("pointerdown", e);
|
|
3523
|
+
}
|
|
3524
|
+
return (t, n) => (U(), P("div", {
|
|
3525
|
+
class: z(["coar-agenda-day-header", {
|
|
3526
|
+
"coar-agenda-day-header--today": e.isToday,
|
|
3527
|
+
"coar-agenda-day-header--empty": e.item.isEmpty,
|
|
3528
|
+
"coar-agenda-day-header--floating": e.floating
|
|
3529
|
+
}]),
|
|
3530
|
+
style: V(e.floating ? { transform: e.transform } : void 0),
|
|
3531
|
+
role: e.floating ? "presentation" : "heading",
|
|
3532
|
+
"aria-level": e.floating ? void 0 : 3,
|
|
3533
|
+
onPointerdown: r
|
|
3534
|
+
}, [K(t.$slots, "default", {
|
|
3535
|
+
date: e.date,
|
|
3536
|
+
item: e.item,
|
|
3537
|
+
isToday: e.isToday
|
|
3538
|
+
}, () => [F("span", Ln, J(e.label), 1), e.isToday ? (U(), P("span", Rn, J(e.todayLabel), 1)) : N("", !0)], !0)], 46, In));
|
|
3539
|
+
}
|
|
3540
|
+
}), [["__scopeId", "data-v-990c502f"]]), Bn = { class: "coar-agenda-event__default" }, Vn = { class: "coar-agenda-event__time" }, Hn = { class: "coar-agenda-event__title" }, Un = {
|
|
3541
|
+
key: 0,
|
|
3542
|
+
class: "coar-agenda-event__continuation-tag"
|
|
3543
|
+
}, Wn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
3544
|
+
__name: "CoarAgendaEvent",
|
|
3545
|
+
props: {
|
|
3546
|
+
event: {},
|
|
3547
|
+
item: {},
|
|
3548
|
+
timeLabel: {},
|
|
3549
|
+
title: {},
|
|
3550
|
+
color: {},
|
|
3551
|
+
continuationTag: {},
|
|
3552
|
+
displayZone: {}
|
|
3553
|
+
},
|
|
3554
|
+
emits: ["pointerdown", "dblclick"],
|
|
3555
|
+
setup(e, { emit: t }) {
|
|
3556
|
+
let n = t;
|
|
3557
|
+
function r(e) {
|
|
3558
|
+
n("pointerdown", e);
|
|
3559
|
+
}
|
|
3560
|
+
function i(e) {
|
|
3561
|
+
e.stopPropagation(), n("dblclick", e);
|
|
3562
|
+
}
|
|
3563
|
+
return (t, n) => (U(), P("div", {
|
|
3564
|
+
class: z(["coar-agenda-event", { "coar-agenda-event--continuation": e.item.isContinuation }]),
|
|
3565
|
+
role: "listitem",
|
|
3566
|
+
onPointerdown: r,
|
|
3567
|
+
onDblclick: i
|
|
3568
|
+
}, [K(t.$slots, "default", {
|
|
3569
|
+
event: e.event,
|
|
3570
|
+
item: e.item
|
|
3571
|
+
}, () => [F("div", Bn, [
|
|
3572
|
+
F("span", {
|
|
3573
|
+
class: "coar-agenda-event__color",
|
|
3574
|
+
style: V({ background: e.color })
|
|
3575
|
+
}, null, 4),
|
|
3576
|
+
F("span", Vn, J(e.timeLabel), 1),
|
|
3577
|
+
F("span", Hn, [
|
|
3578
|
+
I(vt, {
|
|
3579
|
+
event: e.event,
|
|
3580
|
+
"display-zone": e.displayZone,
|
|
3581
|
+
size: "s"
|
|
3582
|
+
}, null, 8, ["event", "display-zone"]),
|
|
3583
|
+
ge(" " + J(e.title) + " ", 1),
|
|
3584
|
+
e.item.isContinuation ? (U(), P("span", Un, J(e.continuationTag), 1)) : N("", !0)
|
|
3585
|
+
])
|
|
3586
|
+
])], !0)], 34));
|
|
3587
|
+
}
|
|
3588
|
+
}), [["__scopeId", "data-v-8e1578ed"]]), Gn = ["aria-label"], Kn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
3589
|
+
__name: "CoarAgendaView",
|
|
3590
|
+
props: {
|
|
3591
|
+
builder: {},
|
|
3592
|
+
estimatedItemSize: { default: 64 },
|
|
3593
|
+
overscan: { default: 5 }
|
|
3594
|
+
},
|
|
3595
|
+
setup(e, { expose: t }) {
|
|
3596
|
+
let r = e, { t: i } = Ae(), a = j(() => {
|
|
3597
|
+
let e = r.builder.state;
|
|
3598
|
+
return {
|
|
3599
|
+
events: e.events ? Y(e.events) : [],
|
|
3600
|
+
timezone: Y(e.timezone),
|
|
3601
|
+
locale: Y(e.locale),
|
|
3602
|
+
density: Y(e.density),
|
|
3603
|
+
dateStyle: Y(e.dateStyle),
|
|
3604
|
+
timeStyle: Y(e.timeStyle),
|
|
3605
|
+
hour12: Y(e.hour12),
|
|
3606
|
+
showEmptyDays: Y(e.showEmptyDays),
|
|
3607
|
+
agendaLengthDays: Y(e.agendaLengthDays),
|
|
3608
|
+
eventRenderer: e.eventRenderer
|
|
3609
|
+
};
|
|
3610
|
+
}), o = j(() => a.value.events), s = j(() => a.value.timezone), c = je(), l = j(() => a.value.locale ?? c?.language.value ?? "en-US"), u = j(() => a.value.density), d = j(() => a.value.showEmptyDays), f = j(() => a.value.agendaLengthDays), p = j(() => r.builder.state.date.value);
|
|
3611
|
+
Ze(r.builder, { view: "agenda" });
|
|
3612
|
+
let m = j(() => n.PlainDate.from(p.value.length >= 10 ? p.value.slice(0, 10) : p.value)), h = j(() => m.value.toString()), g = j(() => m.value.add({ days: f.value }).toString()), y = j(() => C(o.value, {
|
|
3613
|
+
rangeStart: h.value,
|
|
3614
|
+
rangeEnd: g.value,
|
|
3615
|
+
timezone: s.value,
|
|
3616
|
+
showEmptyDays: d.value
|
|
3617
|
+
})), b = W(v(s.value));
|
|
3618
|
+
De(() => {
|
|
3619
|
+
b.value = v(s.value);
|
|
3620
|
+
});
|
|
3621
|
+
function x(e) {
|
|
3622
|
+
return n.PlainDate.compare(e, b.value) === 0;
|
|
3623
|
+
}
|
|
3624
|
+
let S = j(() => new Intl.DateTimeFormat(l.value, k({
|
|
3625
|
+
weekday: "long",
|
|
3626
|
+
day: "numeric",
|
|
3627
|
+
month: "long",
|
|
3628
|
+
timeZone: "UTC"
|
|
3629
|
+
}, {
|
|
3630
|
+
dateStyle: a.value.dateStyle,
|
|
3631
|
+
timeStyle: a.value.timeStyle,
|
|
3632
|
+
hour12: a.value.hour12
|
|
3633
|
+
}))), ee = j(() => new Intl.DateTimeFormat(l.value, k({
|
|
3634
|
+
hour: "numeric",
|
|
3635
|
+
minute: "2-digit",
|
|
3636
|
+
timeZone: s.value
|
|
3637
|
+
}, {
|
|
3638
|
+
timeStyle: a.value.timeStyle,
|
|
3639
|
+
hour12: a.value.hour12
|
|
3640
|
+
})));
|
|
3641
|
+
function te(e) {
|
|
3642
|
+
let t = /* @__PURE__ */ new Date(e + "T00:00:00Z");
|
|
3643
|
+
return S.value.format(t);
|
|
3644
|
+
}
|
|
3645
|
+
function w(e) {
|
|
3646
|
+
return _(e) ? i("coar.calendar.agenda.allDay", void 0, "All day") : ee.value.format(new Date(e.start.epochMilliseconds));
|
|
3647
|
+
}
|
|
3648
|
+
function ne(e) {
|
|
3649
|
+
let t = e.meta;
|
|
3650
|
+
return typeof t?.title == "string" ? t.title : "(untitled)";
|
|
3651
|
+
}
|
|
3652
|
+
function T(e) {
|
|
3653
|
+
let t = e.meta;
|
|
3654
|
+
return typeof t?.color == "string" ? t.color : void 0;
|
|
3655
|
+
}
|
|
3656
|
+
function E(e) {
|
|
3657
|
+
return T(e) ?? "var(--coar-color-accent, #2563eb)";
|
|
3658
|
+
}
|
|
3659
|
+
function re(e, t) {
|
|
3660
|
+
r.builder.state.onEventClick?.({
|
|
3661
|
+
event: t,
|
|
3662
|
+
native: e
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
function D(e, t) {
|
|
3666
|
+
r.builder.state.onDateClick?.({
|
|
3667
|
+
date: n.PlainDate.from(t),
|
|
3668
|
+
native: e
|
|
3669
|
+
});
|
|
3670
|
+
}
|
|
3671
|
+
let ie = Ee("surface"), ae = W(0), oe = null;
|
|
3672
|
+
function se() {
|
|
3673
|
+
oe && (ae.value = oe.scrollTop);
|
|
3674
|
+
}
|
|
3675
|
+
we(() => {
|
|
3676
|
+
let e = ie.value?.$el ?? null;
|
|
3677
|
+
e && (oe = e, oe.addEventListener("scroll", se, { passive: !0 }), ae.value = oe.scrollTop), r.builder._setScrollToDate((e) => pe(e.toString()));
|
|
3678
|
+
}), Ce(() => {
|
|
3679
|
+
oe &&= (oe.removeEventListener("scroll", se), null), r.builder._setScrollToDate(void 0);
|
|
3680
|
+
});
|
|
3681
|
+
let O = W(0), ce = j(() => {
|
|
3682
|
+
let e = ae.value;
|
|
3683
|
+
if (y.value.length === 0) return null;
|
|
3684
|
+
let t = ie.value;
|
|
3685
|
+
if (!t) return null;
|
|
3686
|
+
let n = t.getCache(), r = y.value, i = -1, a = -1, o = Infinity;
|
|
3687
|
+
for (let t = 0; t < r.length; t++) {
|
|
3688
|
+
if (r[t].kind !== "header") continue;
|
|
3689
|
+
let s = n.prefixSum(t);
|
|
3690
|
+
if (s <= e) i = t;
|
|
3691
|
+
else {
|
|
3692
|
+
a = t, o = s;
|
|
3693
|
+
break;
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
if (i < 0) return null;
|
|
3697
|
+
let s = 0;
|
|
3698
|
+
if (a >= 0 && O.value > 0) {
|
|
3699
|
+
let t = o - e;
|
|
3700
|
+
t < O.value && (s = O.value - t);
|
|
3701
|
+
}
|
|
3702
|
+
return {
|
|
3703
|
+
current: r[i],
|
|
3704
|
+
pushOffset: s
|
|
3705
|
+
};
|
|
3706
|
+
}), le = j(() => ce.value?.current ?? null), ue = j(() => {
|
|
3707
|
+
let e = ce.value?.pushOffset ?? 0;
|
|
3708
|
+
return e > 0 ? `translateY(-${e}px)` : "none";
|
|
3709
|
+
}), de = Ee("overlayEl");
|
|
3710
|
+
function fe() {
|
|
3711
|
+
let e = de.value;
|
|
3712
|
+
e?.$el && (O.value = e.$el.offsetHeight);
|
|
3713
|
+
}
|
|
3714
|
+
De(fe);
|
|
3715
|
+
function pe(e) {
|
|
3716
|
+
let t = y.value.findIndex((t) => t.kind === "header" && t.date === e);
|
|
3717
|
+
t >= 0 && ie.value?.scrollToIndex(t);
|
|
3718
|
+
}
|
|
3719
|
+
return t({
|
|
3720
|
+
getItems: () => y.value,
|
|
3721
|
+
scrollToDate: pe
|
|
3722
|
+
}), (t, o) => (U(), P("div", {
|
|
3723
|
+
class: z(["coar-agenda-view", [`coar-agenda-view--density-${u.value}`]]),
|
|
3724
|
+
role: "region",
|
|
3725
|
+
"aria-label": X(i)("coar.calendar.agenda.viewLabel", void 0, "Agenda view")
|
|
3726
|
+
}, [le.value ? (U(), M(zn, {
|
|
3727
|
+
key: 0,
|
|
3728
|
+
ref: "overlayEl",
|
|
3729
|
+
floating: "",
|
|
3730
|
+
date: X(n).PlainDate.from(le.value.date),
|
|
3731
|
+
item: le.value,
|
|
3732
|
+
"is-today": x(X(n).PlainDate.from(le.value.date)),
|
|
3733
|
+
label: te(le.value.date),
|
|
3734
|
+
"today-label": X(i)("coar.calendar.agenda.todayBadge", void 0, "today"),
|
|
3735
|
+
transform: ue.value,
|
|
3736
|
+
onPointerdown: o[0] ||= (e) => D(e, le.value.date)
|
|
3737
|
+
}, he({ _: 2 }, [t.$slots.dayGroupHeader || a.value.dayHeaderRenderer ? {
|
|
3738
|
+
name: "default",
|
|
3739
|
+
fn: Q((e) => [t.$slots.dayGroupHeader ? K(t.$slots, "dayGroupHeader", B(xe({ key: 0 }, e)), void 0, !0) : N("", !0)]),
|
|
3740
|
+
key: "0"
|
|
3741
|
+
} : void 0]), 1032, [
|
|
3742
|
+
"date",
|
|
3743
|
+
"item",
|
|
3744
|
+
"is-today",
|
|
3745
|
+
"label",
|
|
3746
|
+
"today-label",
|
|
3747
|
+
"transform"
|
|
3748
|
+
])) : N("", !0), I(Fn, {
|
|
3749
|
+
ref: "surface",
|
|
3750
|
+
role: "list",
|
|
3751
|
+
"aria-label": X(i)("coar.calendar.agenda.listLabel", void 0, "Agenda"),
|
|
3752
|
+
"item-count": y.value.length,
|
|
3753
|
+
"estimated-item-size": e.estimatedItemSize,
|
|
3754
|
+
overscan: e.overscan,
|
|
3755
|
+
class: "coar-agenda-view__surface"
|
|
3756
|
+
}, {
|
|
3757
|
+
item: Q(({ y: e }) => [y.value[e].kind === "header" ? (U(), M(zn, {
|
|
3758
|
+
key: 0,
|
|
3759
|
+
date: X(n).PlainDate.from(y.value[e].date),
|
|
3760
|
+
item: y.value[e],
|
|
3761
|
+
"is-today": x(X(n).PlainDate.from(y.value[e].date)),
|
|
3762
|
+
label: te(y.value[e].date),
|
|
3763
|
+
"today-label": X(i)("coar.calendar.agenda.todayBadge", void 0, "today"),
|
|
3764
|
+
onPointerdown: (t) => D(t, y.value[e].date)
|
|
3765
|
+
}, he({ _: 2 }, [t.$slots.dayGroupHeader ? {
|
|
3766
|
+
name: "default",
|
|
3767
|
+
fn: Q((e) => [K(t.$slots, "dayGroupHeader", B(ve(e)), void 0, !0)]),
|
|
3768
|
+
key: "0"
|
|
3769
|
+
} : void 0]), 1032, [
|
|
3770
|
+
"date",
|
|
3771
|
+
"item",
|
|
3772
|
+
"is-today",
|
|
3773
|
+
"label",
|
|
3774
|
+
"today-label",
|
|
3775
|
+
"onPointerdown"
|
|
3776
|
+
])) : (U(), M(Wn, {
|
|
3777
|
+
key: 1,
|
|
3778
|
+
event: y.value[e].event,
|
|
3779
|
+
item: y.value[e],
|
|
3780
|
+
"time-label": w(y.value[e].event),
|
|
3781
|
+
title: ne(y.value[e].event),
|
|
3782
|
+
color: E(y.value[e].event),
|
|
3783
|
+
"continuation-tag": X(i)("coar.calendar.agenda.continuationTag", void 0, "(cont.)"),
|
|
3784
|
+
"display-zone": s.value,
|
|
3785
|
+
onPointerdown: (t) => re(t, y.value[e].event),
|
|
3786
|
+
onDblclick: (t) => r.builder.state.onEventDoubleClick?.({
|
|
3787
|
+
event: y.value[e].event,
|
|
3788
|
+
native: t
|
|
3789
|
+
})
|
|
3790
|
+
}, he({ _: 2 }, [t.$slots.event ? {
|
|
3791
|
+
name: "default",
|
|
3792
|
+
fn: Q((e) => [K(t.$slots, "event", B(ve(e)), void 0, !0)]),
|
|
3793
|
+
key: "0"
|
|
3794
|
+
} : void 0]), 1032, [
|
|
3795
|
+
"event",
|
|
3796
|
+
"item",
|
|
3797
|
+
"time-label",
|
|
3798
|
+
"title",
|
|
3799
|
+
"color",
|
|
3800
|
+
"continuation-tag",
|
|
3801
|
+
"display-zone",
|
|
3802
|
+
"onPointerdown",
|
|
3803
|
+
"onDblclick"
|
|
3804
|
+
]))]),
|
|
3805
|
+
_: 3
|
|
3806
|
+
}, 8, [
|
|
3807
|
+
"aria-label",
|
|
3808
|
+
"item-count",
|
|
3809
|
+
"estimated-item-size",
|
|
3810
|
+
"overscan"
|
|
3811
|
+
])], 10, Gn));
|
|
3812
|
+
}
|
|
3813
|
+
}), [["__scopeId", "data-v-19b1e099"]]), qn = { class: "coar-calendar__header" }, Jn = { class: "coar-calendar__nav" }, Yn = { class: "coar-calendar__range-label" }, Xn = 100, Zn = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
3814
|
+
__name: "CoarCalendar",
|
|
3815
|
+
props: { builder: {} },
|
|
3816
|
+
setup(e) {
|
|
3817
|
+
let t = e, i = j(() => {
|
|
3818
|
+
let e = t.builder.state, n = Y(e.timeRange), r = [Math.floor(n.startMinutes / 60), Math.ceil(n.endMinutes / 60)];
|
|
3819
|
+
return {
|
|
3820
|
+
locale: Y(e.locale),
|
|
3821
|
+
timezone: Y(e.timezone),
|
|
3822
|
+
firstDayOfWeek: Y(e.firstDayOfWeek),
|
|
3823
|
+
density: Y(e.density),
|
|
3824
|
+
dateStyle: Y(e.dateStyle),
|
|
3825
|
+
timeStyle: Y(e.timeStyle),
|
|
3826
|
+
hour12: Y(e.hour12),
|
|
3827
|
+
availableViews: Y(e.availableViews),
|
|
3828
|
+
timeRange: r,
|
|
3829
|
+
timeRangeMinutes: n,
|
|
3830
|
+
slotDuration: Y(e.slotDuration),
|
|
3831
|
+
pixelsPerHour: Y(e.pixelsPerHour),
|
|
3832
|
+
agendaLengthDays: Y(e.agendaLengthDays),
|
|
3833
|
+
showEmptyDays: Y(e.showEmptyDays),
|
|
3834
|
+
maxEventsPerCell: Y(e.maxEventsPerCell),
|
|
3835
|
+
dstPolicy: Y(e.dstPolicy),
|
|
3836
|
+
canDrop: e.canDrop,
|
|
3837
|
+
eventRenderer: e.eventRenderer,
|
|
3838
|
+
dayHeaderRenderer: e.dayHeaderRenderer
|
|
3839
|
+
};
|
|
3840
|
+
}), a = t.builder.state.view, o = t.builder.state.date, s = je(), { t: c } = Ae(), l = j(() => i.value.locale ?? s?.language.value ?? "en-US"), u = j(() => o.value), d = j(() => i.value.firstDayOfWeek ?? r(l.value)), f = j(() => w({
|
|
3841
|
+
view: a.value,
|
|
3842
|
+
cursor: u.value,
|
|
3843
|
+
firstDayOfWeek: d.value,
|
|
3844
|
+
agendaLengthDays: i.value.agendaLengthDays,
|
|
3845
|
+
timezone: i.value.timezone
|
|
3846
|
+
})), p = () => t.builder.api.goToToday(), m = () => t.builder.api.next(), h = () => t.builder.api.prev(), g = (e) => t.builder.api.setView(e), _ = j(() => {
|
|
3847
|
+
let e = f.value, t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end).subtract({ days: 1 }), o = l.value, s = {
|
|
3848
|
+
dateStyle: i.value.dateStyle,
|
|
3849
|
+
timeStyle: i.value.timeStyle,
|
|
3850
|
+
hour12: i.value.hour12
|
|
3851
|
+
};
|
|
3852
|
+
switch (a.value) {
|
|
3853
|
+
case "day": return new Intl.DateTimeFormat(o, k({
|
|
3854
|
+
weekday: "long",
|
|
3855
|
+
day: "numeric",
|
|
3856
|
+
month: "long",
|
|
3857
|
+
year: "numeric",
|
|
3858
|
+
timeZone: "UTC"
|
|
3859
|
+
}, s)).format(v(u.value));
|
|
3860
|
+
case "week": return new Intl.DateTimeFormat(o, k({
|
|
3861
|
+
month: "short",
|
|
3862
|
+
day: "numeric",
|
|
3863
|
+
year: "numeric",
|
|
3864
|
+
timeZone: "UTC"
|
|
3865
|
+
}, s)).formatRange(v(t), v(r));
|
|
3866
|
+
case "month": return new Intl.DateTimeFormat(o, k({
|
|
3867
|
+
year: "numeric",
|
|
3868
|
+
month: "long",
|
|
3869
|
+
timeZone: "UTC"
|
|
3870
|
+
}, s)).format(v(u.value));
|
|
3871
|
+
case "agenda": return new Intl.DateTimeFormat(o, k({
|
|
3872
|
+
month: "short",
|
|
3873
|
+
day: "numeric",
|
|
3874
|
+
year: "numeric",
|
|
3875
|
+
timeZone: "UTC"
|
|
3876
|
+
}, s)).formatRange(v(t), v(r));
|
|
3877
|
+
default: return "";
|
|
3878
|
+
}
|
|
3879
|
+
});
|
|
3880
|
+
function v(e) {
|
|
3881
|
+
return new Date(Date.UTC(e.year, e.month - 1, e.day));
|
|
3882
|
+
}
|
|
3883
|
+
let y = j(() => ({
|
|
3884
|
+
day: c("coar.calendar.view.day", void 0, "Day"),
|
|
3885
|
+
week: c("coar.calendar.view.week", void 0, "Week"),
|
|
3886
|
+
month: c("coar.calendar.view.month", void 0, "Month"),
|
|
3887
|
+
agenda: c("coar.calendar.view.agenda", void 0, "Agenda"),
|
|
3888
|
+
timeline: c("coar.calendar.view.timeline", void 0, "Timeline"),
|
|
3889
|
+
year: c("coar.calendar.view.year", void 0, "Year")
|
|
3890
|
+
})), b = j(() => i.value.availableViews.map((e) => ({
|
|
3891
|
+
value: e,
|
|
3892
|
+
label: y.value[e]
|
|
3893
|
+
}))), x = j(() => ({
|
|
3894
|
+
prev: h,
|
|
3895
|
+
next: m,
|
|
3896
|
+
goToToday: p,
|
|
3897
|
+
setView: g,
|
|
3898
|
+
rangeLabel: _.value,
|
|
3899
|
+
view: a.value,
|
|
3900
|
+
available: i.value.availableViews
|
|
3901
|
+
})), S = Ee("bodyEl"), ee = Ee("agendaView"), C = 0;
|
|
3902
|
+
function te(e, t) {
|
|
3903
|
+
if (f.value.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
3904
|
+
e.scrollTop = t;
|
|
3905
|
+
return;
|
|
3906
|
+
}
|
|
3907
|
+
let n = e.scrollTop, r = t - n;
|
|
3908
|
+
if (Math.abs(r) < 1) {
|
|
3909
|
+
e.scrollTop = t;
|
|
3910
|
+
return;
|
|
3911
|
+
}
|
|
3912
|
+
let i = performance.now(), a = ++C;
|
|
3913
|
+
function o(t) {
|
|
3914
|
+
if (a !== C) return;
|
|
3915
|
+
let s = Math.min(1, (t - i) / Xn);
|
|
3916
|
+
e.scrollTop = n + r * (1 - (1 - s) ** 3), s < 1 && requestAnimationFrame(o);
|
|
3917
|
+
}
|
|
3918
|
+
requestAnimationFrame(o);
|
|
3919
|
+
}
|
|
3920
|
+
return we(() => {
|
|
3921
|
+
t.builder._setScrollToTime((e) => {
|
|
3922
|
+
let t = e.hour;
|
|
3923
|
+
if (a.value !== "day" && a.value !== "week") return;
|
|
3924
|
+
let n = S.value;
|
|
3925
|
+
if (!n) return;
|
|
3926
|
+
let r = n.querySelector(`.coar-time-grid__hour-label[data-hour="${t}"]`);
|
|
3927
|
+
if (!r) return;
|
|
3928
|
+
let i = n.querySelector(".coar-time-grid__sticky-top"), o = n.getBoundingClientRect().top, s = i ? i.getBoundingClientRect().bottom : o, c = r.getBoundingClientRect().top;
|
|
3929
|
+
te(n, n.scrollTop + (c - s));
|
|
3930
|
+
}), t.builder._setScrollToDate((e) => {
|
|
3931
|
+
a.value === "agenda" && ee.value?.scrollToDate?.(e.toString());
|
|
3932
|
+
}), t.builder._setGridReady(!0);
|
|
3933
|
+
}), Ce(() => {
|
|
3934
|
+
t.builder._setScrollToTime(void 0), t.builder._setScrollToDate(void 0), t.builder._setGridReady(!1);
|
|
3935
|
+
}), (e, n) => (U(), P("div", { class: z(["coar-calendar", [`coar-calendar--density-${i.value.density}`]]) }, [K(e.$slots, "header", {
|
|
3936
|
+
view: X(a),
|
|
3937
|
+
cursor: u.value,
|
|
3938
|
+
range: f.value,
|
|
3939
|
+
controls: x.value
|
|
3940
|
+
}, () => [F("header", qn, [
|
|
3941
|
+
K(e.$slots, "headerStart", { controls: x.value }, void 0, !0),
|
|
3942
|
+
F("div", Jn, [
|
|
3943
|
+
I(X(Me), {
|
|
3944
|
+
variant: "secondary",
|
|
3945
|
+
size: "s",
|
|
3946
|
+
"icon-start": "chevron-left",
|
|
3947
|
+
"aria-label": X(c)("coar.calendar.nav.previous", void 0, "Previous"),
|
|
3948
|
+
onClick: h
|
|
3949
|
+
}, null, 8, ["aria-label"]),
|
|
3950
|
+
I(X(Me), {
|
|
3951
|
+
variant: "secondary",
|
|
3952
|
+
size: "s",
|
|
3953
|
+
onClick: p
|
|
3954
|
+
}, {
|
|
3955
|
+
default: Q(() => [ge(J(X(c)("coar.calendar.nav.today", void 0, "Today")), 1)]),
|
|
3956
|
+
_: 1
|
|
3957
|
+
}),
|
|
3958
|
+
I(X(Me), {
|
|
3959
|
+
variant: "secondary",
|
|
3960
|
+
size: "s",
|
|
3961
|
+
"icon-start": "chevron-right",
|
|
3962
|
+
"aria-label": X(c)("coar.calendar.nav.next", void 0, "Next"),
|
|
3963
|
+
onClick: m
|
|
3964
|
+
}, null, 8, ["aria-label"])
|
|
3965
|
+
]),
|
|
3966
|
+
F("span", Yn, J(_.value), 1),
|
|
3967
|
+
n[1] ||= F("span", { class: "coar-calendar__spacer" }, null, -1),
|
|
3968
|
+
K(e.$slots, "viewSwitcher", {
|
|
3969
|
+
view: X(a),
|
|
3970
|
+
available: i.value.availableViews,
|
|
3971
|
+
setView: g
|
|
3972
|
+
}, () => [I(X(Ie), {
|
|
3973
|
+
modelValue: X(a),
|
|
3974
|
+
"onUpdate:modelValue": n[0] ||= (e) => be(a) ? a.value = e : null,
|
|
3975
|
+
options: b.value,
|
|
3976
|
+
size: "s",
|
|
3977
|
+
"aria-label": X(c)("coar.calendar.viewSwitcher.label", void 0, "Change view")
|
|
3978
|
+
}, null, 8, [
|
|
3979
|
+
"modelValue",
|
|
3980
|
+
"options",
|
|
3981
|
+
"aria-label"
|
|
3982
|
+
])], !0),
|
|
3983
|
+
K(e.$slots, "headerEnd", { controls: x.value }, void 0, !0)
|
|
3984
|
+
])], !0), F("div", {
|
|
3985
|
+
ref_key: "bodyEl",
|
|
3986
|
+
ref: S,
|
|
3987
|
+
class: z(["coar-calendar__body", `coar-calendar__body--${X(a)}`])
|
|
3988
|
+
}, [X(a) === "day" ? (U(), M(en, {
|
|
3989
|
+
key: 0,
|
|
3990
|
+
builder: t.builder
|
|
3991
|
+
}, he({ _: 2 }, [e.$slots.event ? {
|
|
3992
|
+
name: "event",
|
|
3993
|
+
fn: Q((t) => [K(e.$slots, "event", xe(t, { view: X(a) }), void 0, !0)]),
|
|
3994
|
+
key: "0"
|
|
3995
|
+
} : void 0, e.$slots.dayHeader ? {
|
|
3996
|
+
name: "dayHeader",
|
|
3997
|
+
fn: Q((t) => [K(e.$slots, "dayHeader", B(ve(t)), void 0, !0)]),
|
|
3998
|
+
key: "1"
|
|
3999
|
+
} : void 0]), 1032, ["builder"])) : X(a) === "week" ? (U(), M(nn, {
|
|
4000
|
+
key: 1,
|
|
4001
|
+
builder: t.builder
|
|
4002
|
+
}, he({ _: 2 }, [
|
|
4003
|
+
e.$slots.event ? {
|
|
4004
|
+
name: "event",
|
|
4005
|
+
fn: Q((t) => [K(e.$slots, "event", xe(t, { view: X(a) }), void 0, !0)]),
|
|
4006
|
+
key: "0"
|
|
4007
|
+
} : void 0,
|
|
4008
|
+
e.$slots.allDayEvent ? {
|
|
4009
|
+
name: "allDayEvent",
|
|
4010
|
+
fn: Q((t) => [K(e.$slots, "allDayEvent", B(ve(t)), void 0, !0)]),
|
|
4011
|
+
key: "1"
|
|
4012
|
+
} : void 0,
|
|
4013
|
+
e.$slots.dayHeader ? {
|
|
4014
|
+
name: "dayHeader",
|
|
4015
|
+
fn: Q((t) => [K(e.$slots, "dayHeader", B(ve(t)), void 0, !0)]),
|
|
4016
|
+
key: "2"
|
|
4017
|
+
} : void 0
|
|
4018
|
+
]), 1032, ["builder"])) : X(a) === "month" ? (U(), M(Nn, {
|
|
4019
|
+
key: 2,
|
|
4020
|
+
builder: t.builder
|
|
4021
|
+
}, he({ _: 2 }, [e.$slots.pill || e.$slots.event ? {
|
|
4022
|
+
name: "pill",
|
|
4023
|
+
fn: Q((t) => [e.$slots.pill ? K(e.$slots, "pill", B(xe({ key: 0 }, t)), void 0, !0) : K(e.$slots, "event", {
|
|
4024
|
+
key: 1,
|
|
4025
|
+
event: t.event,
|
|
4026
|
+
view: X(a),
|
|
4027
|
+
layout: t.pill
|
|
4028
|
+
}, void 0, !0)]),
|
|
4029
|
+
key: "0"
|
|
4030
|
+
} : void 0, e.$slots.multiDayBar || e.$slots.event ? {
|
|
4031
|
+
name: "multiDayBar",
|
|
4032
|
+
fn: Q((t) => [e.$slots.multiDayBar ? K(e.$slots, "multiDayBar", B(xe({ key: 0 }, t)), void 0, !0) : K(e.$slots, "event", {
|
|
4033
|
+
key: 1,
|
|
4034
|
+
event: t.event,
|
|
4035
|
+
view: X(a),
|
|
4036
|
+
layout: t.bar
|
|
4037
|
+
}, void 0, !0)]),
|
|
4038
|
+
key: "1"
|
|
4039
|
+
} : void 0]), 1032, ["builder"])) : X(a) === "agenda" ? (U(), M(Kn, {
|
|
4040
|
+
key: 3,
|
|
4041
|
+
ref: "agendaView",
|
|
4042
|
+
builder: t.builder
|
|
4043
|
+
}, he({ _: 2 }, [e.$slots.event ? {
|
|
4044
|
+
name: "event",
|
|
4045
|
+
fn: Q((t) => [K(e.$slots, "event", xe(t, { view: X(a) }), void 0, !0)]),
|
|
4046
|
+
key: "0"
|
|
4047
|
+
} : void 0]), 1032, ["builder"])) : N("", !0)], 2)], 2));
|
|
4048
|
+
}
|
|
4049
|
+
}), [["__scopeId", "data-v-9ea7b027"]]), Qn = /* @__PURE__ */ L({
|
|
4050
|
+
__name: "CoarDisplayZoneSwitcher",
|
|
4051
|
+
props: {
|
|
4052
|
+
modelValue: {},
|
|
4053
|
+
options: { default: void 0 },
|
|
4054
|
+
size: { default: "m" },
|
|
4055
|
+
fullWidth: {
|
|
4056
|
+
type: Boolean,
|
|
4057
|
+
default: !1
|
|
4058
|
+
},
|
|
4059
|
+
disabled: {
|
|
4060
|
+
type: Boolean,
|
|
4061
|
+
default: !1
|
|
4062
|
+
}
|
|
4063
|
+
},
|
|
4064
|
+
emits: ["update:modelValue"],
|
|
4065
|
+
setup(e, { emit: t }) {
|
|
4066
|
+
let n = e, r = t, i = je()?.t ?? ((e, t, n) => n ?? ""), a = [
|
|
4067
|
+
{
|
|
4068
|
+
id: "Europe/Vienna",
|
|
4069
|
+
label: "Vienna (Europe/Vienna)"
|
|
4070
|
+
},
|
|
4071
|
+
{
|
|
4072
|
+
id: "Europe/Berlin",
|
|
4073
|
+
label: "Berlin (Europe/Berlin)"
|
|
4074
|
+
},
|
|
4075
|
+
{
|
|
4076
|
+
id: "Europe/London",
|
|
4077
|
+
label: "London (Europe/London)"
|
|
4078
|
+
},
|
|
4079
|
+
{
|
|
4080
|
+
id: "America/New_York",
|
|
4081
|
+
label: "New York (America/New_York)"
|
|
4082
|
+
},
|
|
4083
|
+
{
|
|
4084
|
+
id: "America/Los_Angeles",
|
|
4085
|
+
label: "Los Angeles (America/Los_Angeles)"
|
|
4086
|
+
},
|
|
4087
|
+
{
|
|
4088
|
+
id: "Asia/Tokyo",
|
|
4089
|
+
label: "Tokyo (Asia/Tokyo)"
|
|
4090
|
+
},
|
|
4091
|
+
{
|
|
4092
|
+
id: "UTC",
|
|
4093
|
+
label: "UTC"
|
|
4094
|
+
}
|
|
4095
|
+
];
|
|
4096
|
+
function o() {
|
|
4097
|
+
try {
|
|
4098
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
4099
|
+
} catch {
|
|
4100
|
+
return "UTC";
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
let s = j(() => {
|
|
4104
|
+
if (n.options) return n.options;
|
|
4105
|
+
let e = o(), t = i("coar.calendar.zoneSwitcher.browserSuffix", void 0, "browser"), r = a.map((e) => ({
|
|
4106
|
+
value: e.id,
|
|
4107
|
+
label: e.label
|
|
4108
|
+
}));
|
|
4109
|
+
return r.some((t) => t.value === e) || r.unshift({
|
|
4110
|
+
value: e,
|
|
4111
|
+
label: `${e} (${t})`
|
|
4112
|
+
}), r;
|
|
4113
|
+
}), c = j(() => i("coar.calendar.zoneSwitcher.label", void 0, "Display timezone"));
|
|
4114
|
+
function l(e) {
|
|
4115
|
+
e != null && r("update:modelValue", e);
|
|
4116
|
+
}
|
|
4117
|
+
return (t, n) => (U(), M(X(Le), {
|
|
4118
|
+
"model-value": e.modelValue,
|
|
4119
|
+
options: s.value,
|
|
4120
|
+
size: e.size,
|
|
4121
|
+
"full-width": e.fullWidth,
|
|
4122
|
+
disabled: e.disabled,
|
|
4123
|
+
"aria-label": c.value,
|
|
4124
|
+
class: "coar-display-zone-switcher",
|
|
4125
|
+
"onUpdate:modelValue": l
|
|
4126
|
+
}, null, 8, [
|
|
4127
|
+
"model-value",
|
|
4128
|
+
"options",
|
|
4129
|
+
"size",
|
|
4130
|
+
"full-width",
|
|
4131
|
+
"disabled",
|
|
4132
|
+
"aria-label"
|
|
4133
|
+
]));
|
|
4134
|
+
}
|
|
4135
|
+
}), $n = ["data-x", "data-y"], er = /* @__PURE__ */ $(/* @__PURE__ */ L({
|
|
4136
|
+
__name: "VirtualizedSurface2D",
|
|
4137
|
+
props: {
|
|
4138
|
+
itemCountX: {},
|
|
4139
|
+
itemCountY: {},
|
|
4140
|
+
cellWidth: {},
|
|
4141
|
+
cellHeight: {},
|
|
4142
|
+
overscanX: { default: 3 },
|
|
4143
|
+
overscanY: { default: 3 }
|
|
4144
|
+
},
|
|
4145
|
+
emits: ["rangeChange", "scroll"],
|
|
4146
|
+
setup(e, { expose: t, emit: n }) {
|
|
4147
|
+
let r = e, i = n, a = W(null), o = W(0), s = W(0), c = W(0), l = W(0), u = j(() => new ue(r.itemCountX, r.cellWidth)), d = j(() => new ue(r.itemCountY, r.cellHeight)), f = j(() => ({
|
|
4148
|
+
x: ee(u.value, o.value, c.value, r.overscanX),
|
|
4149
|
+
y: ee(d.value, s.value, l.value, r.overscanY)
|
|
4150
|
+
})), p = j(() => r.itemCountX * r.cellWidth), m = j(() => r.itemCountY * r.cellHeight), h = j(() => {
|
|
4151
|
+
let e = f.value, t = r.cellWidth, n = r.cellHeight, i = [];
|
|
4152
|
+
for (let a = e.y.startIndex; a < e.y.endIndex; a++) for (let o = e.x.startIndex; o < e.x.endIndex; o++) i.push({
|
|
4153
|
+
x: o,
|
|
4154
|
+
y: a,
|
|
4155
|
+
tx: o * t,
|
|
4156
|
+
ty: a * n,
|
|
4157
|
+
key: a * r.itemCountX + o
|
|
4158
|
+
});
|
|
4159
|
+
return i;
|
|
4160
|
+
}), g = !1;
|
|
4161
|
+
function _(e) {
|
|
4162
|
+
g || (g = !0, requestAnimationFrame(() => {
|
|
4163
|
+
g = !1;
|
|
4164
|
+
let t = e.target;
|
|
4165
|
+
t.scrollLeft !== o.value && (o.value = t.scrollLeft), t.scrollTop !== s.value && (s.value = t.scrollTop), i("scroll", {
|
|
4166
|
+
scrollX: t.scrollLeft,
|
|
4167
|
+
scrollY: t.scrollTop
|
|
4168
|
+
});
|
|
4169
|
+
}));
|
|
4170
|
+
}
|
|
4171
|
+
Z(f, (e) => i("rangeChange", e));
|
|
4172
|
+
let v = null;
|
|
4173
|
+
return we(() => {
|
|
4174
|
+
let e = a.value;
|
|
4175
|
+
e && (c.value = e.clientWidth, l.value = e.clientHeight, o.value = e.scrollLeft, s.value = e.scrollTop, typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
4176
|
+
let t = e.clientWidth, n = e.clientHeight;
|
|
4177
|
+
t !== c.value && (c.value = t), n !== l.value && (l.value = n);
|
|
4178
|
+
}), v.observe(e)));
|
|
4179
|
+
}), Ce(() => {
|
|
4180
|
+
v?.disconnect();
|
|
4181
|
+
}), t({
|
|
4182
|
+
getRange: () => f.value,
|
|
4183
|
+
getFirstVisibleCell: () => ({
|
|
4184
|
+
x: r.itemCountX === 0 || r.cellWidth <= 0 ? 0 : Math.min(r.itemCountX - 1, Math.floor(o.value / r.cellWidth)),
|
|
4185
|
+
y: r.itemCountY === 0 || r.cellHeight <= 0 ? 0 : Math.min(r.itemCountY - 1, Math.floor(s.value / r.cellHeight))
|
|
4186
|
+
}),
|
|
4187
|
+
scrollToCell(e, t = "auto") {
|
|
4188
|
+
let n = a.value;
|
|
4189
|
+
if (!n) return;
|
|
4190
|
+
let i = { behavior: t };
|
|
4191
|
+
e.x !== void 0 && (i.left = e.x * r.cellWidth), e.y !== void 0 && (i.top = e.y * r.cellHeight), n.scrollTo(i);
|
|
4192
|
+
}
|
|
4193
|
+
}), (e, t) => (U(), P("div", {
|
|
4194
|
+
ref_key: "containerRef",
|
|
4195
|
+
ref: a,
|
|
4196
|
+
class: "coar-virtualized-surface-2d",
|
|
4197
|
+
onScroll: _
|
|
4198
|
+
}, [F("div", {
|
|
4199
|
+
class: "coar-virtualized-surface-2d__spacer",
|
|
4200
|
+
style: V({
|
|
4201
|
+
width: p.value + "px",
|
|
4202
|
+
height: m.value + "px"
|
|
4203
|
+
})
|
|
4204
|
+
}, [(U(!0), P(A, null, G(h.value, (t) => (U(), P("div", {
|
|
4205
|
+
key: t.key,
|
|
4206
|
+
class: "coar-virtualized-surface-2d__cell",
|
|
4207
|
+
style: V({
|
|
4208
|
+
width: r.cellWidth + "px",
|
|
4209
|
+
height: r.cellHeight + "px",
|
|
4210
|
+
transform: `translate(${t.tx}px, ${t.ty}px)`
|
|
4211
|
+
}),
|
|
4212
|
+
"data-x": t.x,
|
|
4213
|
+
"data-y": t.y
|
|
4214
|
+
}, [K(e.$slots, "cell", {
|
|
4215
|
+
x: t.x,
|
|
4216
|
+
y: t.y
|
|
4217
|
+
}, void 0, !0)], 12, $n))), 128))], 4)], 544));
|
|
4218
|
+
}
|
|
4219
|
+
}), [["__scopeId", "data-v-fbba32db"]]);
|
|
4220
|
+
//#endregion
|
|
4221
|
+
export { Ke as CalendarBuilder, Kn as CoarAgendaView, Zn as CoarCalendar, en as CoarDayView, Qn as CoarDisplayZoneSwitcher, Nn as CoarMonthView, Qt as CoarTimeGrid, nn as CoarWeekView, le as DstResolutionError, fe as EXPAND_SERIES_NOT_IMPLEMENTED_MESSAGE, ae as MIN_RESIZE_MINUTES, ue as MeasurementCache, n as Temporal, Fn as VirtualizedSurface1DY, er as VirtualizedSurface2D, O as applyMoveToEvent, C as buildAgendaItems, T as buildDropPayload, k as buildFormatOptions, ce as computeAnchorAdjustment, x as computeAutoScrollVelocity, w as computeViewWindow, g as dateKey, b as daysInWindow, i as detectBrowserTimezone, r as detectFirstDayOfWeekFromLocale, f as detectHour12FromLocale, re as endOfMonth, e as endOfWeek, E as eventStartDateInZone, h as expandSeries, u as formatScheduledTime, Ye as getEventZoneHints, ee as getVisibleRange1D, D as getVisibleRange2D, oe as hitTestVerticalSurface, _ as isAllDayEvent, y as isTimedEvent, d as isoWeekNumber, se as layoutAllDayBand, ie as layoutDayEvents, te as layoutMonthGrid, ne as layoutOverlappingIntervals, p as localizedWeekdayNames, a as monthGridDates, de as navigateCursor, c as nowInZone, l as parsePlainDate, m as parseScheduledTime, me as startOfMonth, t as startOfWeek, v as todayInZone, it as useA11yAnnouncer, ut as useAgendaView, qe as useCalendar, nt as useCalendarDnd, Qe as useCoarDrag, st as useDayView, ot as useMonthDnd, lt as useMonthView, at as useTimeGridDnd, Ze as useViewWindow, ct as useWeekView, o as validateCalendarEvent, s as weekDates, pe as windowContainsDate, S as windowDayCount };
|