@cocoar/vue-calendar 1.17.0 → 2.0.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/dist/builders/calendar-builder.d.ts +179 -2
- package/dist/builders/calendar-builder.d.ts.map +1 -1
- package/dist/builders/types.d.ts +41 -0
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/components/CoarAgendaView.vue.d.ts.map +1 -1
- package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
- package/dist/components/CoarTimelineView.vue.d.ts +68 -0
- package/dist/components/CoarTimelineView.vue.d.ts.map +1 -0
- package/dist/components/CoarWorkWeekView.vue.d.ts +53 -0
- package/dist/components/CoarWorkWeekView.vue.d.ts.map +1 -0
- package/dist/components/internal/CoarEventDecorations.vue.d.ts +1 -1
- package/dist/components/internal/CoarEventDecorations.vue.d.ts.map +1 -1
- package/dist/composables/useViewWindow.d.ts.map +1 -1
- package/dist/core/dnd/move-math.d.ts +23 -0
- package/dist/core/dnd/move-math.d.ts.map +1 -1
- package/dist/core/index.d.ts +8 -15
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/temporal.d.ts +13 -0
- package/dist/core/temporal.d.ts.map +1 -1
- package/dist/core/timelineLayout.d.ts +77 -0
- package/dist/core/timelineLayout.d.ts.map +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/viewWindow.d.ts +8 -1
- package/dist/core/viewWindow.d.ts.map +1 -1
- package/dist/{core-DK63eHat.js → core-D-gBBiQ5.js} +276 -400
- package/dist/core.js +3 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1739 -1232
- package/dist/move-math-vYSpEW-r.js +215 -0
- package/dist/recurrence/index.d.ts +70 -0
- package/dist/recurrence/index.d.ts.map +1 -0
- package/dist/recurrence/internal/default-engine.d.ts +20 -0
- package/dist/recurrence/internal/default-engine.d.ts.map +1 -0
- package/dist/recurrence/internal/dst-resolve.d.ts +12 -0
- package/dist/recurrence/internal/dst-resolve.d.ts.map +1 -0
- package/dist/recurrence/internal/engine-to-events.d.ts +38 -0
- package/dist/recurrence/internal/engine-to-events.d.ts.map +1 -0
- package/dist/recurrence/internal/series-to-engine.d.ts +4 -0
- package/dist/recurrence/internal/series-to-engine.d.ts.map +1 -0
- package/dist/recurrence/types.d.ts +252 -0
- package/dist/recurrence/types.d.ts.map +1 -0
- package/dist/recurrence-rrule-temporal/index.d.ts +12 -0
- package/dist/recurrence-rrule-temporal/index.d.ts.map +1 -0
- package/dist/recurrence-rrule-temporal.js +158 -0
- package/dist/recurrence.js +225 -0
- package/dist/types-fzCER_SC.js +4 -0
- package/dist/useTimelineView.d.ts +6 -0
- package/dist/useTimelineView.d.ts.map +1 -0
- package/dist/useWorkWeekView.d.ts +6 -0
- package/dist/useWorkWeekView.d.ts.map +1 -0
- package/dist/vue-calendar.css +1 -1
- package/package.json +12 -7
- package/dist/core/recurrence-public.d.ts +0 -59
- package/dist/core/recurrence-public.d.ts.map +0 -1
- package/dist/core/recurrence.d.ts +0 -112
- package/dist/core/recurrence.d.ts.map +0 -1
- package/dist/core/recurrenceWorker.d.ts +0 -62
- package/dist/core/recurrenceWorker.d.ts.map +0 -1
|
@@ -1,100 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function n(e) {
|
|
4
|
-
return "timeZoneId" in e.start;
|
|
5
|
-
}
|
|
6
|
-
function r(e) {
|
|
7
|
-
return !("timeZoneId" in e.start);
|
|
8
|
-
}
|
|
9
|
-
function i(t) {
|
|
10
|
-
let { id: n, start: r, end: i } = t, o = r instanceof e.ZonedDateTime, s = r instanceof e.PlainDate;
|
|
11
|
-
if (!o && !s) throw TypeError(`[CalendarEvent ${n}] start must be Temporal.ZonedDateTime or Temporal.PlainDate. Got ${r?.constructor?.name ?? typeof r}.`);
|
|
12
|
-
if (o) try {
|
|
13
|
-
r.toInstant();
|
|
14
|
-
} catch (e) {
|
|
15
|
-
let t = r.timeZoneId;
|
|
16
|
-
throw TypeError(`[CalendarEvent ${n}] start.timeZoneId='${t}' is not a recognised IANA zone (Temporal threw '${e.message}'). Use a real IANA name like 'Europe/Vienna' / 'America/Los_Angeles'.`, { cause: e });
|
|
17
|
-
}
|
|
18
|
-
if (i !== void 0) {
|
|
19
|
-
let t = i instanceof e.ZonedDateTime, a = i instanceof e.PlainDate;
|
|
20
|
-
if (!t && !a) throw TypeError(`[CalendarEvent ${n}] end must be Temporal.ZonedDateTime or Temporal.PlainDate. Got ${i?.constructor?.name ?? typeof i}.`);
|
|
21
|
-
if (o !== t) throw TypeError(`[CalendarEvent ${n}] start and end must be the same shape. Got start=${o ? "ZonedDateTime" : "PlainDate"}, end=${t ? "ZonedDateTime" : "PlainDate"}.`);
|
|
22
|
-
if (o) {
|
|
23
|
-
if (e.Instant.compare(r.toInstant(), i.toInstant()) >= 0) throw RangeError(`[CalendarEvent ${n}] end must be strictly after start.`);
|
|
24
|
-
} else if (e.PlainDate.compare(r, i) >= 0) throw RangeError(`[CalendarEvent ${n}] end must be strictly after start.`);
|
|
25
|
-
}
|
|
26
|
-
let c = t.meta;
|
|
27
|
-
if ((c?.rrule !== void 0 || c?.rdate !== void 0 || c?.exdate !== void 0 || c?.recurrenceId !== void 0) && !a.has(n)) {
|
|
28
|
-
a.add(n);
|
|
29
|
-
let e = `[@cocoar/vue-calendar] [CalendarEvent ${n}] meta.rrule / .rdate / .exdate / .recurrenceId is set, but recurrence is not yet wired (Phase 4). The event will render only as a single occurrence at \`start\`. Construct a \`RecurringSeries\` and use \`expandSeries()\` (when available) instead of stuffing rrule into meta.`;
|
|
30
|
-
typeof console < "u" && console.warn(e);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
var a = /* @__PURE__ */ new Set();
|
|
34
|
-
//#endregion
|
|
1
|
+
import { o as e, s as t } from "./move-math-vYSpEW-r.js";
|
|
2
|
+
import { Temporal as n, Temporal as r } from "@js-temporal/polyfill";
|
|
35
3
|
//#region src/core/temporal.ts
|
|
36
|
-
function
|
|
4
|
+
function i(e) {
|
|
37
5
|
return e % 7;
|
|
38
6
|
}
|
|
39
|
-
var
|
|
40
|
-
function
|
|
7
|
+
var a = !1;
|
|
8
|
+
function o(e) {
|
|
41
9
|
try {
|
|
42
10
|
let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
|
|
43
|
-
if (n && typeof n.firstDay == "number") return
|
|
11
|
+
if (n && typeof n.firstDay == "number") return i(n.firstDay);
|
|
44
12
|
} catch {}
|
|
45
|
-
return !
|
|
13
|
+
return !a && typeof console < "u" && (a = !0, console.warn(`[@cocoar/vue-calendar] Intl.Locale.weekInfo is not available on this runtime — falling back to Monday for locale '${e}'. Article 9: defaults are not decisions. Pass \`.firstDayOfWeek(0)\` (Sunday) / \`.firstDayOfWeek(6)\` (Saturday) etc. explicitly so the week-start is deterministic across browsers.`)), 1;
|
|
46
14
|
}
|
|
47
|
-
function
|
|
15
|
+
function s(e) {
|
|
48
16
|
try {
|
|
49
17
|
return new Intl.DateTimeFormat(e, { hour: "numeric" }).resolvedOptions().hour12 ?? !1;
|
|
50
18
|
} catch {
|
|
51
19
|
return !1;
|
|
52
20
|
}
|
|
53
21
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
22
|
+
var c = !1;
|
|
23
|
+
function l() {
|
|
56
24
|
try {
|
|
57
25
|
let e = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
58
26
|
if (e) return e;
|
|
59
27
|
} catch {}
|
|
60
|
-
return !
|
|
28
|
+
return !c && typeof console < "u" && (c = !0, console.warn("[@cocoar/vue-calendar] detectBrowserTimezone() couldn't read Intl.DateTimeFormat — falling back to 'UTC'. This is the Article-4 anti-pattern: human-meaningful times will render at the wrong wall-clock for users not in UTC. Pass an explicit IANA zone to `builder.timezone(...)` (e.g. 'Europe/Vienna'). If your app really does run in UTC, pass 'UTC' explicitly to silence this warning.")), "UTC";
|
|
61
29
|
}
|
|
62
|
-
function
|
|
30
|
+
function u(e, t) {
|
|
63
31
|
if (!t) return e;
|
|
64
32
|
let n = { ...e };
|
|
65
33
|
return t.hour12 !== void 0 && (n.hour12 = t.hour12), (t.dateStyle !== void 0 || t.timeStyle !== void 0) && (delete n.weekday, delete n.era, delete n.year, delete n.month, delete n.day, delete n.dayPeriod, delete n.hour, delete n.minute, delete n.second, delete n.fractionalSecondDigits, delete n.timeZoneName), t.dateStyle !== void 0 && (n.dateStyle = t.dateStyle), t.timeStyle !== void 0 && (n.timeStyle = t.timeStyle), n;
|
|
66
34
|
}
|
|
67
|
-
function
|
|
68
|
-
let n = (
|
|
35
|
+
function d(e, t) {
|
|
36
|
+
let n = (i(e.dayOfWeek) - t + 7) % 7;
|
|
69
37
|
return n === 0 ? e : e.subtract({ days: n });
|
|
70
38
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
39
|
+
function f(e, t) {
|
|
40
|
+
return d(e, t).add({ days: 6 });
|
|
73
41
|
}
|
|
74
|
-
function
|
|
42
|
+
function p(e) {
|
|
75
43
|
return e.with({ day: 1 });
|
|
76
44
|
}
|
|
77
|
-
function
|
|
45
|
+
function m(e) {
|
|
78
46
|
return e.with({ day: e.daysInMonth });
|
|
79
47
|
}
|
|
80
|
-
function
|
|
48
|
+
function h(e) {
|
|
81
49
|
let t = e.dayOfWeek, n = e.add({ days: 4 - t }), r = n.with({
|
|
82
50
|
month: 1,
|
|
83
51
|
day: 1
|
|
84
52
|
}), i = (4 - r.dayOfWeek + 7) % 7, a = r.add({ days: i }), o = n.since(a, { largestUnit: "days" }).days;
|
|
85
53
|
return Math.floor(o / 7) + 1;
|
|
86
54
|
}
|
|
87
|
-
function
|
|
88
|
-
let n =
|
|
55
|
+
function g(e, t) {
|
|
56
|
+
let n = d(e, t), r = Array(7);
|
|
89
57
|
for (let e = 0; e < 7; e++) r[e] = n.add({ days: e });
|
|
90
58
|
return r;
|
|
91
59
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
60
|
+
function _(e, t, n) {
|
|
61
|
+
if (n.length === 0) return [];
|
|
62
|
+
let r = new Set(n);
|
|
63
|
+
return g(e, t).filter((e) => r.has(i(e.dayOfWeek)));
|
|
64
|
+
}
|
|
65
|
+
function v(e, t) {
|
|
66
|
+
let n = d(e.toPlainDate({ day: 1 }), t), r = Array(42);
|
|
94
67
|
for (let e = 0; e < 42; e++) r[e] = n.add({ days: e });
|
|
95
68
|
return r;
|
|
96
69
|
}
|
|
97
|
-
function
|
|
70
|
+
function y(e, t, n = "short") {
|
|
98
71
|
let r = new Intl.DateTimeFormat(e, { weekday: n }), i = new Date(Date.UTC(2024, 0, 7)), a = Array(7);
|
|
99
72
|
for (let e = 0; e < 7; e++) {
|
|
100
73
|
let n = (t + e) % 7, o = new Date(i.getTime());
|
|
@@ -102,126 +75,144 @@ function b(e, t, n = "short") {
|
|
|
102
75
|
}
|
|
103
76
|
return a;
|
|
104
77
|
}
|
|
105
|
-
function
|
|
78
|
+
function b(e) {
|
|
106
79
|
return e.toString();
|
|
107
80
|
}
|
|
108
|
-
function
|
|
109
|
-
return e instanceof
|
|
81
|
+
function x(e, t) {
|
|
82
|
+
return e instanceof r.PlainDate ? e : e.withTimeZone(t).toPlainDate();
|
|
83
|
+
}
|
|
84
|
+
function S(e) {
|
|
85
|
+
return r.Now.plainDateISO(e);
|
|
110
86
|
}
|
|
111
87
|
function C(e) {
|
|
112
|
-
return
|
|
88
|
+
return r.Now.zonedDateTimeISO(e);
|
|
113
89
|
}
|
|
114
90
|
function w(e) {
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
function ee(e) {
|
|
118
|
-
let { local: n, timeZoneId: r, dstPolicy: i = "compatible" } = e, a;
|
|
91
|
+
let { local: t, timeZoneId: n, dstPolicy: i = "compatible" } = e, a;
|
|
119
92
|
try {
|
|
120
|
-
a =
|
|
93
|
+
a = r.PlainDateTime.from(t);
|
|
121
94
|
} catch (e) {
|
|
122
|
-
throw RangeError(`[parseScheduledTime] local='${
|
|
95
|
+
throw RangeError(`[parseScheduledTime] local='${t}' is not a parseable ISO-8601 datetime (${e.message}). Expected format: 'YYYY-MM-DDTHH:MM[:SS]'.`, { cause: e });
|
|
123
96
|
}
|
|
124
97
|
let o;
|
|
125
98
|
try {
|
|
126
|
-
o = a.toZonedDateTime(
|
|
99
|
+
o = a.toZonedDateTime(n, { disambiguation: i });
|
|
127
100
|
} catch (e) {
|
|
128
|
-
let
|
|
129
|
-
throw TypeError(i === "reject" ? `[parseScheduledTime] local='${
|
|
101
|
+
let r = e.message;
|
|
102
|
+
throw TypeError(i === "reject" ? `[parseScheduledTime] local='${t}' in '${n}' could not be resolved (${r}). Likely cause: dstPolicy='reject' on a DST gap (e.g. 02:30 on the spring-forward day). Use 'earlier' / 'later' / 'compatible' if you want the engine to resolve, or pick a different time.` : `[parseScheduledTime] timeZoneId='${n}' is not a recognised IANA zone (${r}). Use a real name like 'Europe/Vienna' / 'America/Los_Angeles' — abbreviations like 'CET' / 'EST' are ambiguous and intentionally rejected.`, { cause: e });
|
|
130
103
|
}
|
|
131
104
|
return o;
|
|
132
105
|
}
|
|
133
|
-
function
|
|
106
|
+
function T(e) {
|
|
134
107
|
try {
|
|
135
|
-
return
|
|
108
|
+
return r.PlainDate.from(e);
|
|
136
109
|
} catch (t) {
|
|
137
110
|
throw RangeError(`[parsePlainDate] iso='${e}' is not a parseable ISO-8601 date (${t.message}). Expected format: 'YYYY-MM-DD'.`, { cause: t });
|
|
138
111
|
}
|
|
139
112
|
}
|
|
140
|
-
function
|
|
113
|
+
function E(e) {
|
|
141
114
|
return {
|
|
142
115
|
local: e.toPlainDateTime().toString(),
|
|
143
116
|
timeZoneId: e.timeZoneId
|
|
144
117
|
};
|
|
145
118
|
}
|
|
146
119
|
//#endregion
|
|
147
|
-
//#region src/core/recurrence-public.ts
|
|
148
|
-
var E = "[@cocoar/vue-calendar] expandSeries() is not implemented yet — the recurrence engine integration is Phase 4. The TYPE contract for RecurringSeries is enforced from Session 2 so your data layer can build against it now; expansion will become available without API changes.";
|
|
149
|
-
function D(e, t, n) {
|
|
150
|
-
throw TypeError(E);
|
|
151
|
-
}
|
|
152
|
-
var ne = E;
|
|
153
|
-
//#endregion
|
|
154
120
|
//#region src/core/viewWindow.ts
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
121
|
+
var D = [
|
|
122
|
+
1,
|
|
123
|
+
2,
|
|
124
|
+
3,
|
|
125
|
+
4,
|
|
126
|
+
5
|
|
127
|
+
];
|
|
128
|
+
function O(e) {
|
|
129
|
+
let { view: t, cursor: r, firstDayOfWeek: i, timezone: a } = e;
|
|
130
|
+
switch (t) {
|
|
158
131
|
case "day": return {
|
|
159
|
-
view:
|
|
132
|
+
view: t,
|
|
160
133
|
start: r.toString(),
|
|
161
134
|
end: r.add({ days: 1 }).toString(),
|
|
162
135
|
timezone: a
|
|
163
136
|
};
|
|
164
137
|
case "week": {
|
|
165
|
-
let e =
|
|
138
|
+
let e = d(r, i);
|
|
139
|
+
return {
|
|
140
|
+
view: t,
|
|
141
|
+
start: e.toString(),
|
|
142
|
+
end: e.add({ days: 7 }).toString(),
|
|
143
|
+
timezone: a
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
case "workWeek": {
|
|
147
|
+
let e = d(r, i);
|
|
166
148
|
return {
|
|
167
|
-
view:
|
|
149
|
+
view: t,
|
|
168
150
|
start: e.toString(),
|
|
169
151
|
end: e.add({ days: 7 }).toString(),
|
|
170
152
|
timezone: a
|
|
171
153
|
};
|
|
172
154
|
}
|
|
173
155
|
case "month": {
|
|
174
|
-
let
|
|
156
|
+
let e = v(n.PlainYearMonth.from({
|
|
175
157
|
year: r.year,
|
|
176
158
|
month: r.month
|
|
177
159
|
}), i);
|
|
178
160
|
return {
|
|
179
|
-
view:
|
|
180
|
-
start:
|
|
181
|
-
end:
|
|
161
|
+
view: t,
|
|
162
|
+
start: e[0].toString(),
|
|
163
|
+
end: e[41].add({ days: 1 }).toString(),
|
|
182
164
|
timezone: a
|
|
183
165
|
};
|
|
184
166
|
}
|
|
185
167
|
case "agenda": {
|
|
186
|
-
let
|
|
168
|
+
let n = e.agendaLengthDays ?? 30;
|
|
187
169
|
return {
|
|
188
|
-
view:
|
|
170
|
+
view: t,
|
|
189
171
|
start: r.toString(),
|
|
190
|
-
end: r.add({ days:
|
|
172
|
+
end: r.add({ days: n }).toString(),
|
|
173
|
+
timezone: a
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
case "timeline": {
|
|
177
|
+
let n = e.timelineRangeDays ?? 60;
|
|
178
|
+
return {
|
|
179
|
+
view: t,
|
|
180
|
+
start: r.toString(),
|
|
181
|
+
end: r.add({ days: n }).toString(),
|
|
191
182
|
timezone: a
|
|
192
183
|
};
|
|
193
184
|
}
|
|
194
|
-
case "timeline":
|
|
195
185
|
case "year": return {
|
|
196
|
-
view:
|
|
186
|
+
view: t,
|
|
197
187
|
start: r.toString(),
|
|
198
188
|
end: r.add({ days: 1 }).toString(),
|
|
199
189
|
timezone: a
|
|
200
190
|
};
|
|
201
|
-
default: throw Error(`Unsupported view: ${String(
|
|
191
|
+
default: throw Error(`Unsupported view: ${String(t)}`);
|
|
202
192
|
}
|
|
203
193
|
}
|
|
204
|
-
function* k(
|
|
205
|
-
let
|
|
206
|
-
for (;
|
|
194
|
+
function* k(e) {
|
|
195
|
+
let t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end);
|
|
196
|
+
for (; n.PlainDate.compare(t, r) < 0;) yield t, t = t.add({ days: 1 });
|
|
207
197
|
}
|
|
208
|
-
function A(
|
|
209
|
-
let
|
|
210
|
-
return
|
|
198
|
+
function A(e) {
|
|
199
|
+
let t = n.PlainDate.from(e.start);
|
|
200
|
+
return n.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
|
|
211
201
|
}
|
|
212
|
-
function j(
|
|
213
|
-
let r =
|
|
214
|
-
return
|
|
202
|
+
function j(e, t) {
|
|
203
|
+
let r = n.PlainDate.from(e.start), i = n.PlainDate.from(e.end);
|
|
204
|
+
return n.PlainDate.compare(t, r) >= 0 && n.PlainDate.compare(t, i) < 0;
|
|
215
205
|
}
|
|
216
|
-
function M(e, t, n, r = 30) {
|
|
217
|
-
let
|
|
206
|
+
function M(e, t, n, r = 30, i = 60) {
|
|
207
|
+
let a = n === "next" ? 1 : -1;
|
|
218
208
|
switch (e) {
|
|
219
|
-
case "day": return t.add({ days: 1 *
|
|
220
|
-
case "week":
|
|
221
|
-
case "
|
|
222
|
-
case "
|
|
223
|
-
case "
|
|
224
|
-
case "
|
|
209
|
+
case "day": return t.add({ days: 1 * a });
|
|
210
|
+
case "week":
|
|
211
|
+
case "workWeek": return t.add({ days: 7 * a });
|
|
212
|
+
case "month": return t.add({ months: 1 * a });
|
|
213
|
+
case "agenda": return t.add({ days: r * a });
|
|
214
|
+
case "timeline": return t.add({ days: i * a });
|
|
215
|
+
case "year": return t.add({ months: 1 * a });
|
|
225
216
|
default: throw Error(`Unsupported view: ${String(e)}`);
|
|
226
217
|
}
|
|
227
218
|
}
|
|
@@ -312,15 +303,15 @@ function R(e) {
|
|
|
312
303
|
}
|
|
313
304
|
//#endregion
|
|
314
305
|
//#region src/core/timeGridLayout.ts
|
|
315
|
-
function z(e,
|
|
316
|
-
let { day: r, timeRange: i, timezone: a } =
|
|
306
|
+
function z(e, n) {
|
|
307
|
+
let { day: r, timeRange: i, timezone: a } = n, [o, s] = i, c = o * 60, l = s * 60;
|
|
317
308
|
if (l - c <= 0) return [];
|
|
318
309
|
let u = [], d = /* @__PURE__ */ new Set();
|
|
319
|
-
for (let
|
|
320
|
-
if (d.has(
|
|
321
|
-
let e = V(
|
|
310
|
+
for (let n of e) {
|
|
311
|
+
if (d.has(n.id) || (d.add(n.id), !t(n))) continue;
|
|
312
|
+
let e = V(n.start, r, a), i = n.end ? V(n.end, r, a) : e + 30, o = e, s = i, f = Math.max(o, c), p = Math.min(s, l);
|
|
322
313
|
p > 1440 && (p = Math.min(p, 1440)), f < 0 && (f = 0), !(p <= f) && (p <= c || f >= l || u.push({
|
|
323
|
-
event:
|
|
314
|
+
event: n,
|
|
324
315
|
startMinutes: f - c,
|
|
325
316
|
endMinutes: p - c,
|
|
326
317
|
clippedTop: o < c,
|
|
@@ -336,23 +327,23 @@ function z(e, t) {
|
|
|
336
327
|
m.length > 0 && p.push(m);
|
|
337
328
|
let g = /* @__PURE__ */ new Map();
|
|
338
329
|
for (let e of p) {
|
|
339
|
-
let
|
|
330
|
+
let t = R(e.map((e) => ({
|
|
340
331
|
id: e.event.id,
|
|
341
332
|
start: e.startMinutes,
|
|
342
333
|
end: Math.max(e.startMinutes, e.endMinutes - 1)
|
|
343
334
|
}))), r = -1;
|
|
344
|
-
if (
|
|
345
|
-
for (let e of
|
|
335
|
+
if (n.priorityId !== void 0) {
|
|
336
|
+
for (let e of t.bars) if (e.id === n.priorityId) {
|
|
346
337
|
r = e.lane;
|
|
347
338
|
break;
|
|
348
339
|
}
|
|
349
340
|
}
|
|
350
|
-
let i =
|
|
351
|
-
for (let e of
|
|
352
|
-
let
|
|
353
|
-
r >= 0 && r < i && (
|
|
354
|
-
lane:
|
|
355
|
-
laneCount:
|
|
341
|
+
let i = t.laneCount - 1;
|
|
342
|
+
for (let e of t.bars) {
|
|
343
|
+
let n = e.lane;
|
|
344
|
+
r >= 0 && r < i && (n === r ? n = i : n > r && --n), g.set(e.id, {
|
|
345
|
+
lane: n,
|
|
346
|
+
laneCount: t.laneCount
|
|
356
347
|
});
|
|
357
348
|
}
|
|
358
349
|
}
|
|
@@ -372,26 +363,26 @@ function z(e, t) {
|
|
|
372
363
|
};
|
|
373
364
|
});
|
|
374
365
|
}
|
|
375
|
-
function B(
|
|
366
|
+
function B(t, n) {
|
|
376
367
|
let { days: i } = n;
|
|
377
368
|
if (n.timezone, i.length === 0) return [];
|
|
378
369
|
let a = /* @__PURE__ */ new Map();
|
|
379
|
-
for (let e = 0; e < i.length; e++) a.set(
|
|
380
|
-
|
|
370
|
+
for (let e = 0; e < i.length; e++) a.set(b(i[e]), e);
|
|
371
|
+
b(i[i.length - 1]);
|
|
381
372
|
let o = [], s = /* @__PURE__ */ new Set();
|
|
382
|
-
for (let n of
|
|
383
|
-
if (s.has(n.id) || (s.add(n.id), !
|
|
384
|
-
let
|
|
385
|
-
n.end ? (c = n.end.subtract({ days: 1 }),
|
|
373
|
+
for (let n of t) {
|
|
374
|
+
if (s.has(n.id) || (s.add(n.id), !e(n))) continue;
|
|
375
|
+
let t = n.start, c;
|
|
376
|
+
n.end ? (c = n.end.subtract({ days: 1 }), r.PlainDate.compare(c, t) < 0 && (c = t)) : c = t;
|
|
386
377
|
let l = i[0], u = i[i.length - 1];
|
|
387
|
-
if (
|
|
388
|
-
let d =
|
|
378
|
+
if (r.PlainDate.compare(c, l) < 0 || r.PlainDate.compare(t, u) > 0) continue;
|
|
379
|
+
let d = r.PlainDate.compare(t, l) < 0 ? l : t, f = r.PlainDate.compare(c, u) > 0 ? u : c, p = a.get(b(d)), m = a.get(b(f));
|
|
389
380
|
p === void 0 || m === void 0 || o.push({
|
|
390
381
|
event: n,
|
|
391
382
|
startCol: p,
|
|
392
383
|
endCol: m,
|
|
393
|
-
clippedStart:
|
|
394
|
-
clippedEnd:
|
|
384
|
+
clippedStart: r.PlainDate.compare(t, l) < 0,
|
|
385
|
+
clippedEnd: r.PlainDate.compare(c, u) > 0
|
|
395
386
|
});
|
|
396
387
|
}
|
|
397
388
|
if (o.length === 0) return [];
|
|
@@ -411,29 +402,29 @@ function B(e, n) {
|
|
|
411
402
|
clippedEnd: e.clippedEnd
|
|
412
403
|
}));
|
|
413
404
|
}
|
|
414
|
-
function V(e,
|
|
415
|
-
let i = e.withTimeZone(
|
|
416
|
-
year:
|
|
417
|
-
month:
|
|
418
|
-
day:
|
|
405
|
+
function V(e, t, n) {
|
|
406
|
+
let i = e.withTimeZone(n), a = r.PlainDateTime.from({
|
|
407
|
+
year: t.year,
|
|
408
|
+
month: t.month,
|
|
409
|
+
day: t.day,
|
|
419
410
|
hour: 0,
|
|
420
411
|
minute: 0
|
|
421
|
-
}).toZonedDateTime(
|
|
422
|
-
return
|
|
412
|
+
}).toZonedDateTime(n, { disambiguation: "compatible" }), o = a.add({ days: 1 });
|
|
413
|
+
return r.ZonedDateTime.compare(i, a) < 0 ? -1 : r.ZonedDateTime.compare(i, o) >= 0 ? 1441 : i.hour * 60 + i.minute + i.second / 60;
|
|
423
414
|
}
|
|
424
415
|
//#endregion
|
|
425
416
|
//#region src/core/monthGridLayout.ts
|
|
426
|
-
function H(e,
|
|
427
|
-
let { gridDates:
|
|
428
|
-
if (
|
|
417
|
+
function H(e, t) {
|
|
418
|
+
let { gridDates: n, timezone: i } = t;
|
|
419
|
+
if (n.length !== 42) throw RangeError(`gridDates must have exactly 42 entries (got ${n.length})`);
|
|
429
420
|
let a = [];
|
|
430
421
|
for (let e = 0; e < 6; e++) {
|
|
431
|
-
let t =
|
|
432
|
-
for (let e = 0; e < 7; e++)
|
|
422
|
+
let t = n.slice(e * 7, e * 7 + 7), r = /* @__PURE__ */ new Map();
|
|
423
|
+
for (let e = 0; e < 7; e++) r.set(b(t[e]), e);
|
|
433
424
|
a.push({
|
|
434
425
|
rowIndex: e,
|
|
435
426
|
days: t,
|
|
436
|
-
dayKeyToCol:
|
|
427
|
+
dayKeyToCol: r,
|
|
437
428
|
weekStart: t[0],
|
|
438
429
|
weekEnd: t[6]
|
|
439
430
|
});
|
|
@@ -449,7 +440,7 @@ function H(e, n) {
|
|
|
449
440
|
lastDayInclusive: n
|
|
450
441
|
});
|
|
451
442
|
else {
|
|
452
|
-
let n =
|
|
443
|
+
let n = b(e), r = c.get(n), i = {
|
|
453
444
|
event: t,
|
|
454
445
|
order: r ? r.length : 0
|
|
455
446
|
};
|
|
@@ -457,60 +448,60 @@ function H(e, n) {
|
|
|
457
448
|
}
|
|
458
449
|
}
|
|
459
450
|
return { weekRows: a.map((e) => {
|
|
460
|
-
let
|
|
461
|
-
for (let
|
|
462
|
-
if (
|
|
463
|
-
let i =
|
|
464
|
-
o === void 0 || s === void 0 ||
|
|
465
|
-
...
|
|
451
|
+
let t = [];
|
|
452
|
+
for (let n of s) {
|
|
453
|
+
if (r.PlainDate.compare(n.lastDayInclusive, e.weekStart) < 0 || r.PlainDate.compare(n.firstDay, e.weekEnd) > 0) continue;
|
|
454
|
+
let i = r.PlainDate.compare(n.firstDay, e.weekStart) < 0 ? e.weekStart : n.firstDay, a = r.PlainDate.compare(n.lastDayInclusive, e.weekEnd) > 0 ? e.weekEnd : n.lastDayInclusive, o = e.dayKeyToCol.get(b(i)), s = e.dayKeyToCol.get(b(a));
|
|
455
|
+
o === void 0 || s === void 0 || t.push({
|
|
456
|
+
...n,
|
|
466
457
|
startCol: o,
|
|
467
458
|
endCol: s,
|
|
468
|
-
clippedStart:
|
|
469
|
-
clippedEnd:
|
|
459
|
+
clippedStart: r.PlainDate.compare(n.firstDay, e.weekStart) < 0,
|
|
460
|
+
clippedEnd: r.PlainDate.compare(n.lastDayInclusive, e.weekEnd) > 0
|
|
470
461
|
});
|
|
471
462
|
}
|
|
472
|
-
let
|
|
473
|
-
if (
|
|
474
|
-
let e = R(
|
|
463
|
+
let n = [];
|
|
464
|
+
if (t.length > 0) {
|
|
465
|
+
let e = R(t.map((e) => ({
|
|
475
466
|
id: e.event.id,
|
|
476
467
|
start: e.startCol,
|
|
477
468
|
end: e.endCol
|
|
478
|
-
}))),
|
|
479
|
-
for (let
|
|
480
|
-
|
|
481
|
-
event:
|
|
482
|
-
lane:
|
|
469
|
+
}))), r = /* @__PURE__ */ new Map();
|
|
470
|
+
for (let t of e.bars) r.set(t.id, t.lane);
|
|
471
|
+
n = t.map((t) => ({
|
|
472
|
+
event: t.event,
|
|
473
|
+
lane: r.get(t.event.id) ?? 0,
|
|
483
474
|
laneCount: e.laneCount,
|
|
484
|
-
startCol:
|
|
485
|
-
endCol:
|
|
486
|
-
clippedStart:
|
|
487
|
-
clippedEnd:
|
|
475
|
+
startCol: t.startCol,
|
|
476
|
+
endCol: t.endCol,
|
|
477
|
+
clippedStart: t.clippedStart,
|
|
478
|
+
clippedEnd: t.clippedEnd
|
|
488
479
|
}));
|
|
489
480
|
}
|
|
490
481
|
let i = /* @__PURE__ */ new Map();
|
|
491
482
|
for (let t of e.days) {
|
|
492
|
-
let e =
|
|
483
|
+
let e = b(t), n = c.get(e);
|
|
493
484
|
n && i.set(e, n);
|
|
494
485
|
}
|
|
495
486
|
return {
|
|
496
487
|
rowIndex: e.rowIndex,
|
|
497
488
|
weekStart: e.weekStart,
|
|
498
489
|
days: e.days,
|
|
499
|
-
multiDayBars:
|
|
490
|
+
multiDayBars: n,
|
|
500
491
|
cellPills: i
|
|
501
492
|
};
|
|
502
493
|
}) };
|
|
503
494
|
}
|
|
504
|
-
function U(
|
|
505
|
-
if (
|
|
506
|
-
let
|
|
507
|
-
return
|
|
508
|
-
firstDay:
|
|
509
|
-
lastDayInclusive:
|
|
510
|
-
isMultiDay:
|
|
495
|
+
function U(t, n) {
|
|
496
|
+
if (e(t)) {
|
|
497
|
+
let e = t.start, n;
|
|
498
|
+
return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
|
|
499
|
+
firstDay: e,
|
|
500
|
+
lastDayInclusive: n,
|
|
501
|
+
isMultiDay: r.PlainDate.compare(n, e) > 0
|
|
511
502
|
};
|
|
512
503
|
}
|
|
513
|
-
let i =
|
|
504
|
+
let i = x(t.start, n);
|
|
514
505
|
return {
|
|
515
506
|
firstDay: i,
|
|
516
507
|
lastDayInclusive: i,
|
|
@@ -519,9 +510,9 @@ function U(e, n) {
|
|
|
519
510
|
}
|
|
520
511
|
//#endregion
|
|
521
512
|
//#region src/core/agendaLayout.ts
|
|
522
|
-
function W(
|
|
523
|
-
let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c =
|
|
524
|
-
if (
|
|
513
|
+
function W(t, n) {
|
|
514
|
+
let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c = r.PlainDate.from(i), l = r.PlainDate.from(a);
|
|
515
|
+
if (r.PlainDate.compare(l, c) <= 0) return [];
|
|
525
516
|
let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
|
|
526
517
|
function f(e) {
|
|
527
518
|
let t = u.get(e);
|
|
@@ -530,23 +521,23 @@ function W(e, n) {
|
|
|
530
521
|
timed: []
|
|
531
522
|
}, u.set(e, t)), t;
|
|
532
523
|
}
|
|
533
|
-
for (let n of
|
|
524
|
+
for (let n of t) {
|
|
534
525
|
if (d.has(n.id)) continue;
|
|
535
526
|
d.add(n.id);
|
|
536
|
-
let
|
|
537
|
-
if (
|
|
527
|
+
let t = e(n), { firstDay: i, lastDayInclusive: a } = G(n, o), s = r.PlainDate.compare(i, c) < 0 ? c : i, u = l.subtract({ days: 1 }), p = r.PlainDate.compare(a, u) > 0 ? u : a;
|
|
528
|
+
if (r.PlainDate.compare(p, s) < 0) continue;
|
|
538
529
|
let m = s, h = !0;
|
|
539
|
-
for (;
|
|
540
|
-
let
|
|
541
|
-
if (
|
|
530
|
+
for (; r.PlainDate.compare(m, p) <= 0;) {
|
|
531
|
+
let e = f(b(m)), a = r.PlainDate.compare(m, i) > 0 || !h;
|
|
532
|
+
if (t) e.allDay.push({
|
|
542
533
|
event: n,
|
|
543
534
|
isContinuation: a
|
|
544
535
|
});
|
|
545
536
|
else {
|
|
546
|
-
let
|
|
547
|
-
|
|
537
|
+
let t = a ? -Infinity : K(n, o);
|
|
538
|
+
e.timed.push({
|
|
548
539
|
event: n,
|
|
549
|
-
startMs:
|
|
540
|
+
startMs: t,
|
|
550
541
|
isContinuation: a
|
|
551
542
|
});
|
|
552
543
|
}
|
|
@@ -554,8 +545,8 @@ function W(e, n) {
|
|
|
554
545
|
}
|
|
555
546
|
}
|
|
556
547
|
let p = [], m = c;
|
|
557
|
-
for (;
|
|
558
|
-
let e =
|
|
548
|
+
for (; r.PlainDate.compare(m, l) < 0;) {
|
|
549
|
+
let e = b(m), t = u.get(e), n = !!t && (t.allDay.length > 0 || t.timed.length > 0);
|
|
559
550
|
if ((n || s) && (p.push({
|
|
560
551
|
kind: "header",
|
|
561
552
|
date: e,
|
|
@@ -583,30 +574,98 @@ function W(e, n) {
|
|
|
583
574
|
}
|
|
584
575
|
return p;
|
|
585
576
|
}
|
|
586
|
-
function G(
|
|
587
|
-
if (
|
|
588
|
-
let
|
|
589
|
-
return
|
|
590
|
-
firstDay:
|
|
591
|
-
lastDayInclusive:
|
|
577
|
+
function G(t, n) {
|
|
578
|
+
if (e(t)) {
|
|
579
|
+
let e = t.start, n;
|
|
580
|
+
return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
|
|
581
|
+
firstDay: e,
|
|
582
|
+
lastDayInclusive: n
|
|
592
583
|
};
|
|
593
584
|
}
|
|
594
|
-
let i =
|
|
595
|
-
if (
|
|
596
|
-
let
|
|
597
|
-
|
|
585
|
+
let i = x(t.start, n), a = i;
|
|
586
|
+
if (t.end) {
|
|
587
|
+
let e = t.end.withTimeZone(n), o = e.toPlainDate();
|
|
588
|
+
e.hour === 0 && e.minute === 0 && e.second === 0 && e.millisecond === 0 && e.microsecond === 0 && e.nanosecond === 0 ? (a = o.subtract({ days: 1 }), r.PlainDate.compare(a, i) < 0 && (a = i)) : a = o;
|
|
598
589
|
}
|
|
599
590
|
return {
|
|
600
591
|
firstDay: i,
|
|
601
592
|
lastDayInclusive: a
|
|
602
593
|
};
|
|
603
594
|
}
|
|
604
|
-
function K(
|
|
605
|
-
return
|
|
595
|
+
function K(t, n) {
|
|
596
|
+
return e(t) ? t.start.toZonedDateTime({ timeZone: n }).epochMilliseconds : t.start.epochMilliseconds;
|
|
597
|
+
}
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/core/timelineLayout.ts
|
|
600
|
+
function q(e, t) {
|
|
601
|
+
let { windowStart: r, windowEnd: i, pixelsPerDay: a, rowHeight: o, displayZone: s } = t, c = r.until(i, { largestUnit: "days" }).days * a, l = /* @__PURE__ */ new Map();
|
|
602
|
+
for (let t of e) {
|
|
603
|
+
let e = Y(t), n = J(t) !== null, r = l.get(e);
|
|
604
|
+
r || (r = {
|
|
605
|
+
events: [],
|
|
606
|
+
isRecurring: n
|
|
607
|
+
}, l.set(e, r)), r.events.push(t);
|
|
608
|
+
}
|
|
609
|
+
let u = [];
|
|
610
|
+
for (let [e, t] of l) {
|
|
611
|
+
let o = [];
|
|
612
|
+
for (let e of t.events) {
|
|
613
|
+
let { startDate: t, endDate: c } = X(e, s);
|
|
614
|
+
if (n.PlainDate.compare(c, r) <= 0 || n.PlainDate.compare(t, i) >= 0) continue;
|
|
615
|
+
let l = n.PlainDate.compare(t, r) < 0, u = n.PlainDate.compare(c, i) > 0, d = l ? r : t, f = u ? i : c, p = r.until(d, { largestUnit: "days" }).days, m = d.until(f, { largestUnit: "days" }).days;
|
|
616
|
+
o.push({
|
|
617
|
+
event: e,
|
|
618
|
+
left: p * a,
|
|
619
|
+
width: Math.max(1, m) * a,
|
|
620
|
+
clippedStart: l,
|
|
621
|
+
clippedEnd: u
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
o.length !== 0 && (o.sort((e, t) => e.left - t.left), u.push({
|
|
625
|
+
id: e,
|
|
626
|
+
isRecurring: t.isRecurring,
|
|
627
|
+
bars: o,
|
|
628
|
+
firstLeft: o[0].left
|
|
629
|
+
}));
|
|
630
|
+
}
|
|
631
|
+
u.sort((e, t) => e.firstLeft === t.firstLeft ? e.id < t.id ? -1 : +(e.id > t.id) : e.firstLeft - t.firstLeft);
|
|
632
|
+
let d = u.map((e, t) => ({
|
|
633
|
+
id: e.id,
|
|
634
|
+
top: t * o,
|
|
635
|
+
height: o,
|
|
636
|
+
isRecurring: e.isRecurring,
|
|
637
|
+
bars: e.bars
|
|
638
|
+
}));
|
|
639
|
+
return {
|
|
640
|
+
rows: d,
|
|
641
|
+
totalWidth: c,
|
|
642
|
+
totalHeight: d.length * o
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function J(e) {
|
|
646
|
+
let t = e.meta?.__recurrence?.seriesId;
|
|
647
|
+
return typeof t == "string" ? t : null;
|
|
648
|
+
}
|
|
649
|
+
function Y(e) {
|
|
650
|
+
return J(e) ?? e.id;
|
|
651
|
+
}
|
|
652
|
+
function X(e, t) {
|
|
653
|
+
if (e.start instanceof n.PlainDate) {
|
|
654
|
+
let t = e.start;
|
|
655
|
+
return {
|
|
656
|
+
startDate: t,
|
|
657
|
+
endDate: e.end instanceof n.PlainDate ? e.end : t.add({ days: 1 })
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
let r = e.start.withTimeZone(t), i = e.end instanceof n.ZonedDateTime ? e.end.withTimeZone(t) : r.add({ minutes: 30 });
|
|
661
|
+
return {
|
|
662
|
+
startDate: r.toPlainDate(),
|
|
663
|
+
endDate: i.toPlainDate().add({ days: 1 })
|
|
664
|
+
};
|
|
606
665
|
}
|
|
607
666
|
//#endregion
|
|
608
667
|
//#region src/core/measurementCache.ts
|
|
609
|
-
var
|
|
668
|
+
var Z = class {
|
|
610
669
|
_itemCount;
|
|
611
670
|
_estimatedSize;
|
|
612
671
|
_measured;
|
|
@@ -688,7 +747,7 @@ var q = class {
|
|
|
688
747
|
};
|
|
689
748
|
//#endregion
|
|
690
749
|
//#region src/core/virtualScroll.ts
|
|
691
|
-
function
|
|
750
|
+
function Q(e, t, n, r = 3) {
|
|
692
751
|
if (e.itemCount === 0) return {
|
|
693
752
|
startIndex: 0,
|
|
694
753
|
endIndex: 0,
|
|
@@ -705,20 +764,20 @@ function J(e, t, n, r = 3) {
|
|
|
705
764
|
totalSize: i
|
|
706
765
|
};
|
|
707
766
|
}
|
|
708
|
-
function
|
|
767
|
+
function $(e, t, n, r, i, a, o = 3, s = 3) {
|
|
709
768
|
return {
|
|
710
|
-
x:
|
|
711
|
-
y:
|
|
769
|
+
x: Q(e, n, i, o),
|
|
770
|
+
y: Q(t, r, a, s)
|
|
712
771
|
};
|
|
713
772
|
}
|
|
714
|
-
function
|
|
773
|
+
function ee(e, t, n) {
|
|
715
774
|
if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
|
|
716
775
|
let r = e.prefixSum(n);
|
|
717
776
|
return t.prefixSum(n) - r;
|
|
718
777
|
}
|
|
719
778
|
//#endregion
|
|
720
779
|
//#region src/core/dragHitTest.ts
|
|
721
|
-
function
|
|
780
|
+
function te(e, t, n, r, i) {
|
|
722
781
|
if (r.itemCount === 0) return {
|
|
723
782
|
itemIndex: -1,
|
|
724
783
|
ratio: NaN,
|
|
@@ -749,7 +808,7 @@ function re(e, t, n, r, i) {
|
|
|
749
808
|
pixelInItem: u
|
|
750
809
|
};
|
|
751
810
|
}
|
|
752
|
-
function
|
|
811
|
+
function ne(e, t, n, r = {}) {
|
|
753
812
|
let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
|
|
754
813
|
if (i <= 0 || a <= 0) return {
|
|
755
814
|
velocityX: 0,
|
|
@@ -773,187 +832,4 @@ function ie(e, t, n, r = {}) {
|
|
|
773
832
|
};
|
|
774
833
|
}
|
|
775
834
|
//#endregion
|
|
776
|
-
|
|
777
|
-
var ae = 15, Z = class extends Error {
|
|
778
|
-
disambiguation;
|
|
779
|
-
constructor(e, t) {
|
|
780
|
-
super(t), this.name = "DstResolutionError", this.disambiguation = e;
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
function Q(t, n) {
|
|
784
|
-
let r;
|
|
785
|
-
try {
|
|
786
|
-
r = e.PlainDateTime.from({
|
|
787
|
-
year: n.year,
|
|
788
|
-
month: n.month,
|
|
789
|
-
day: n.day,
|
|
790
|
-
hour: n.hour,
|
|
791
|
-
minute: n.minute,
|
|
792
|
-
second: n.second ?? 0
|
|
793
|
-
});
|
|
794
|
-
} catch {
|
|
795
|
-
return null;
|
|
796
|
-
}
|
|
797
|
-
try {
|
|
798
|
-
return r.toZonedDateTime(t, { disambiguation: "reject" }), null;
|
|
799
|
-
} catch {}
|
|
800
|
-
let i;
|
|
801
|
-
try {
|
|
802
|
-
i = r.toZonedDateTime(t, { disambiguation: "earlier" });
|
|
803
|
-
} catch {
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
let a = i.toPlainDateTime();
|
|
807
|
-
return e.PlainDateTime.compare(a, r) === 0 ? "overlap" : "gap";
|
|
808
|
-
}
|
|
809
|
-
function oe(e, t, n, r, i, a) {
|
|
810
|
-
let o = $(t, r, i, e);
|
|
811
|
-
return {
|
|
812
|
-
event: t,
|
|
813
|
-
original: {
|
|
814
|
-
start: n.start,
|
|
815
|
-
...n.end === void 0 ? {} : { end: n.end },
|
|
816
|
-
displayZone: n.displayZone
|
|
817
|
-
},
|
|
818
|
-
next: o,
|
|
819
|
-
target: {
|
|
820
|
-
...r,
|
|
821
|
-
date: r.date,
|
|
822
|
-
minutes: r.minutes,
|
|
823
|
-
displayZone: r.displayZone,
|
|
824
|
-
disambiguation: o.disambiguation ?? null
|
|
825
|
-
},
|
|
826
|
-
native: a
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
function $(t, i, a, o = "compatible") {
|
|
830
|
-
if (r(t)) {
|
|
831
|
-
let n = t.start, r = t.end ?? n.add({ days: 1 }), o = e.PlainDate.from(i.date);
|
|
832
|
-
if (a === "allDay-resize-start" || a === "month-resize-start") {
|
|
833
|
-
let t = r.subtract({ days: 1 });
|
|
834
|
-
return {
|
|
835
|
-
start: e.PlainDate.compare(o, t) > 0 ? t : o,
|
|
836
|
-
end: r
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
if (a === "allDay-resize-end" || a === "month-resize-end") {
|
|
840
|
-
let t = n.add({ days: 1 }), r = o.add({ days: 1 });
|
|
841
|
-
return {
|
|
842
|
-
start: n,
|
|
843
|
-
end: e.PlainDate.compare(r, t) < 0 ? t : r
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
let s = n.until(r).total({ unit: "days" }), c = o, l = c.add({ days: s });
|
|
847
|
-
return t.end ? {
|
|
848
|
-
start: c,
|
|
849
|
-
end: l
|
|
850
|
-
} : { start: c };
|
|
851
|
-
}
|
|
852
|
-
if (!n(t)) throw TypeError(`[applyMoveToEvent] event ${t.id} has unrecognised start shape`);
|
|
853
|
-
let s = t.start.timeZoneId, c = t.end?.timeZoneId ?? s, l = t.start, u = t.end ?? null, d = e.PlainDate.from(i.date);
|
|
854
|
-
if (i.minutes === null && (a === "timed" || a === "timed-resize-start" || a === "timed-resize-end")) throw TypeError(`[applyMoveToEvent] timed event ${t.id} cannot be dropped onto an all-day target (target.minutes === null). To convert a timed event to all-day, change the event's start to a Temporal.PlainDate explicitly in your event-source — the drop API does not auto-convert.`);
|
|
855
|
-
let f = e.PlainTime.from({
|
|
856
|
-
hour: Math.floor(i.minutes / 60),
|
|
857
|
-
minute: i.minutes % 60
|
|
858
|
-
}), p = Q(i.displayZone, {
|
|
859
|
-
year: d.year,
|
|
860
|
-
month: d.month,
|
|
861
|
-
day: d.day,
|
|
862
|
-
hour: f.hour,
|
|
863
|
-
minute: f.minute
|
|
864
|
-
});
|
|
865
|
-
if (p && o === "reject") throw new Z(p, `[applyMoveToEvent] target ${i.date}T${String(f.hour).padStart(2, "0")}:${String(f.minute).padStart(2, "0")} is a DST ${p} in ${i.displayZone}; policy='reject'.`);
|
|
866
|
-
let m = o === "reject" ? "compatible" : o, h = e.PlainDateTime.from({
|
|
867
|
-
year: d.year,
|
|
868
|
-
month: d.month,
|
|
869
|
-
day: d.day,
|
|
870
|
-
hour: f.hour,
|
|
871
|
-
minute: f.minute
|
|
872
|
-
}).toZonedDateTime(i.displayZone, { disambiguation: m }), g = h.withTimeZone(s), _ = h.withTimeZone(c), v = p;
|
|
873
|
-
if (a === "timed-resize-start") {
|
|
874
|
-
let t = g;
|
|
875
|
-
if (u) {
|
|
876
|
-
let n = u.subtract({ minutes: 15 }).withTimeZone(s);
|
|
877
|
-
e.Instant.compare(t.toInstant(), n.toInstant()) > 0 && (t = n);
|
|
878
|
-
}
|
|
879
|
-
return {
|
|
880
|
-
start: t,
|
|
881
|
-
...u ? { end: u } : {},
|
|
882
|
-
disambiguation: v
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
if (a === "timed-resize-end") {
|
|
886
|
-
let t = l.add({ minutes: 15 }).withTimeZone(c), n = _;
|
|
887
|
-
return e.Instant.compare(n.toInstant(), t.toInstant()) < 0 && (n = t), {
|
|
888
|
-
start: l,
|
|
889
|
-
end: n,
|
|
890
|
-
disambiguation: v
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
if (a === "month-resize-start") {
|
|
894
|
-
let t = l.withTimeZone(i.displayZone), n = Q(i.displayZone, {
|
|
895
|
-
year: d.year,
|
|
896
|
-
month: d.month,
|
|
897
|
-
day: d.day,
|
|
898
|
-
hour: t.hour,
|
|
899
|
-
minute: t.minute,
|
|
900
|
-
second: t.second
|
|
901
|
-
});
|
|
902
|
-
if (n && o === "reject") throw new Z(n, `[applyMoveToEvent] month-resize-start lands in a DST ${n} in ${i.displayZone}; policy='reject'.`);
|
|
903
|
-
let r = o === "reject" ? "compatible" : o, a = e.PlainDateTime.from({
|
|
904
|
-
year: d.year,
|
|
905
|
-
month: d.month,
|
|
906
|
-
day: d.day,
|
|
907
|
-
hour: t.hour,
|
|
908
|
-
minute: t.minute,
|
|
909
|
-
second: t.second
|
|
910
|
-
}).toZonedDateTime(i.displayZone, { disambiguation: r }).withTimeZone(s);
|
|
911
|
-
if (u) {
|
|
912
|
-
let t = u.subtract({ minutes: 15 }).withTimeZone(s);
|
|
913
|
-
e.Instant.compare(a.toInstant(), t.toInstant()) > 0 && (a = t);
|
|
914
|
-
}
|
|
915
|
-
return {
|
|
916
|
-
start: a,
|
|
917
|
-
...u ? { end: u } : {},
|
|
918
|
-
disambiguation: n
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
if (a === "month-resize-end") {
|
|
922
|
-
let t = u ?? l, n = u ? c : s, r = t.withTimeZone(i.displayZone), a = Q(i.displayZone, {
|
|
923
|
-
year: d.year,
|
|
924
|
-
month: d.month,
|
|
925
|
-
day: d.day,
|
|
926
|
-
hour: r.hour,
|
|
927
|
-
minute: r.minute,
|
|
928
|
-
second: r.second
|
|
929
|
-
});
|
|
930
|
-
if (a && o === "reject") throw new Z(a, `[applyMoveToEvent] month-resize-end lands in a DST ${a} in ${i.displayZone}; policy='reject'.`);
|
|
931
|
-
let f = o === "reject" ? "compatible" : o, p = e.PlainDateTime.from({
|
|
932
|
-
year: d.year,
|
|
933
|
-
month: d.month,
|
|
934
|
-
day: d.day,
|
|
935
|
-
hour: r.hour,
|
|
936
|
-
minute: r.minute,
|
|
937
|
-
second: r.second
|
|
938
|
-
}).toZonedDateTime(i.displayZone, { disambiguation: f }).withTimeZone(n), m = l.add({ minutes: 15 }).withTimeZone(n);
|
|
939
|
-
return e.Instant.compare(p.toInstant(), m.toInstant()) < 0 && (p = m), {
|
|
940
|
-
start: l,
|
|
941
|
-
end: p,
|
|
942
|
-
disambiguation: a
|
|
943
|
-
};
|
|
944
|
-
}
|
|
945
|
-
if (u) {
|
|
946
|
-
let e = u.epochMilliseconds - l.epochMilliseconds;
|
|
947
|
-
return {
|
|
948
|
-
start: g,
|
|
949
|
-
end: g.add({ milliseconds: e }).withTimeZone(c),
|
|
950
|
-
disambiguation: v
|
|
951
|
-
};
|
|
952
|
-
}
|
|
953
|
-
return {
|
|
954
|
-
start: g,
|
|
955
|
-
disambiguation: v
|
|
956
|
-
};
|
|
957
|
-
}
|
|
958
|
-
//#endregion
|
|
959
|
-
export { m as A, p as B, t as C, c as D, d as E, y as F, i as G, v as H, w as I, te as L, T as M, _ as N, l as O, b as P, ee as R, D as S, x as T, r as U, C as V, n as W, k as _, ie as a, A as b, J as c, W as d, H as f, O as g, R as h, oe as i, S as j, g as k, Y as l, z as m, ae as n, re as o, B as p, $ as r, X as s, Z as t, q as u, M as v, f as w, ne as x, j as y, h as z };
|
|
835
|
+
export { y as A, o as C, x as D, f as E, p as F, d as I, S as L, C as M, T as N, E as O, w as P, g as R, l as S, m as T, j as _, $ as a, u as b, W as c, z as d, R as f, M as g, k as h, Q as i, v as j, h as k, H as l, O as m, te as n, Z as o, D as p, ee as r, q as s, ne as t, B as u, A as v, s as w, b as x, r as y, _ as z };
|