@cocoar/vue-calendar 3.4.0-beta.38 → 3.4.0-beta.40
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/components/CoarCalendar.vue.d.ts +4 -0
- package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
- package/dist/components/CoarCalendarBoard.vue.d.ts.map +1 -1
- package/dist/components/CoarContinuousMonthView.vue.d.ts +4 -0
- package/dist/components/CoarContinuousMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarMiniMonth.vue.d.ts +10 -0
- package/dist/components/CoarMiniMonth.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthView.vue.d.ts +4 -0
- package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarPagedMonthView.vue.d.ts +4 -0
- package/dist/components/CoarPagedMonthView.vue.d.ts.map +1 -1
- package/dist/components/internal/eventActivation.d.ts +11 -0
- package/dist/components/internal/eventActivation.d.ts.map +1 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts +4 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarResourceDayGrid.vue.d.ts.map +1 -1
- package/dist/composables/useMonthGeometry.d.ts +5 -6
- package/dist/composables/useMonthGeometry.d.ts.map +1 -1
- package/dist/composables/useMonthMetrics.d.ts +2 -0
- package/dist/composables/useMonthMetrics.d.ts.map +1 -1
- package/dist/core/boardLayout.d.ts.map +1 -1
- package/dist/core/eventOrder.d.ts +8 -0
- package/dist/core/eventOrder.d.ts.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/monthGridLayout.d.ts +11 -3
- package/dist/core/monthGridLayout.d.ts.map +1 -1
- package/dist/{core-B2rsRJDp.js → core-BcJBiqFt.js} +198 -165
- package/dist/core.js +2 -2
- package/dist/index.js +1745 -1622
- package/dist/vue-calendar.css +1 -1
- package/package.json +6 -6
|
@@ -85,16 +85,22 @@ function g(e) {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
|
+
//#region src/core/eventOrder.ts
|
|
89
|
+
function _(e, t) {
|
|
90
|
+
let n = o(e);
|
|
91
|
+
return n === o(t) ? n ? 0 : e.start.epochMilliseconds - t.start.epochMilliseconds : n ? -1 : 1;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
88
94
|
//#region src/core/monthGridLayout.ts
|
|
89
|
-
var
|
|
90
|
-
function
|
|
95
|
+
var v = 2, y = 6;
|
|
96
|
+
function b(e, t) {
|
|
91
97
|
switch (e) {
|
|
92
98
|
case "compact": return 6;
|
|
93
99
|
case "stacked": return 2;
|
|
94
100
|
default: return t;
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
|
-
function
|
|
103
|
+
function x(e, t) {
|
|
98
104
|
if (!Number.isFinite(t) || t < 0) return {
|
|
99
105
|
visible: e,
|
|
100
106
|
hidden: 0
|
|
@@ -149,11 +155,31 @@ function te(e, t) {
|
|
|
149
155
|
laneCount: r
|
|
150
156
|
};
|
|
151
157
|
}
|
|
158
|
+
function S(e) {
|
|
159
|
+
return e.rowHeight - e.dayNumberHeight - e.pillsPaddingTop - e.pillsPaddingBottom;
|
|
160
|
+
}
|
|
161
|
+
function C(e, t) {
|
|
162
|
+
let n = e.pillHeight + e.pillGap;
|
|
163
|
+
if (n <= 0) return {
|
|
164
|
+
pillLimit: 0,
|
|
165
|
+
pillLimitWithoutMarker: 0
|
|
166
|
+
};
|
|
167
|
+
let r = S(e) - t * (e.barHeight + e.barGap), i = Math.min(Math.max(0, Math.floor((r + e.pillGap) / n)), e.pillLimit);
|
|
168
|
+
if (e.markerHeight <= 0) return {
|
|
169
|
+
pillLimit: i,
|
|
170
|
+
pillLimitWithoutMarker: i
|
|
171
|
+
};
|
|
172
|
+
let a = Math.max(0, Math.floor((r - e.markerHeight) / n));
|
|
173
|
+
return {
|
|
174
|
+
pillLimit: Math.min(a, e.pillLimit),
|
|
175
|
+
pillLimitWithoutMarker: i
|
|
176
|
+
};
|
|
177
|
+
}
|
|
152
178
|
function ne(e) {
|
|
153
|
-
let t =
|
|
179
|
+
let t = e.barHeight + e.barGap, n = Math.max(0, S(e) - e.markerHeight), r = t > 0 ? Math.floor(n / t) : 0, i = e.maxLanes === null || !Number.isFinite(e.maxLanes) || e.maxLanes < 0 ? r : Math.min(r, Math.floor(e.maxLanes));
|
|
154
180
|
return {
|
|
155
181
|
maxLanes: i,
|
|
156
|
-
|
|
182
|
+
...C(e, Math.min(e.laneCount, i))
|
|
157
183
|
};
|
|
158
184
|
}
|
|
159
185
|
function re(e, t) {
|
|
@@ -171,11 +197,11 @@ function re(e, t) {
|
|
|
171
197
|
weekEnd: t[6]
|
|
172
198
|
});
|
|
173
199
|
}
|
|
174
|
-
let s = /* @__PURE__ */ new Set(), c = [], l = /* @__PURE__ */ new Map(), u =
|
|
200
|
+
let s = /* @__PURE__ */ new Set(), c = [], l = /* @__PURE__ */ new Map(), u = w(n[0]), d = w(n[n.length - 1]), f = t.visibleStart ? w(t.visibleStart) : -Infinity, p = t.visibleEnd ? w(t.visibleEnd) : Infinity;
|
|
175
201
|
for (let t of e) {
|
|
176
202
|
if (s.has(t.id)) continue;
|
|
177
203
|
s.add(t.id);
|
|
178
|
-
let e =
|
|
204
|
+
let e = T(t, i);
|
|
179
205
|
if (e.lastOrd < u || e.firstOrd > d) continue;
|
|
180
206
|
let { firstDay: n, lastDayInclusive: r, isMultiDay: a } = e;
|
|
181
207
|
if (a) c.push({
|
|
@@ -191,6 +217,13 @@ function re(e, t) {
|
|
|
191
217
|
r ? r.push(i) : l.set(n, [i]);
|
|
192
218
|
}
|
|
193
219
|
}
|
|
220
|
+
for (let [e, t] of l) {
|
|
221
|
+
let n = [...t].sort((e, t) => _(e.event, t.event));
|
|
222
|
+
l.set(e, n.map((e, t) => ({
|
|
223
|
+
...e,
|
|
224
|
+
order: t
|
|
225
|
+
})));
|
|
226
|
+
}
|
|
194
227
|
return { weekRows: o.map((e) => {
|
|
195
228
|
let n = [];
|
|
196
229
|
for (let i of c) {
|
|
@@ -247,29 +280,29 @@ function re(e, t) {
|
|
|
247
280
|
};
|
|
248
281
|
}) };
|
|
249
282
|
}
|
|
250
|
-
function
|
|
283
|
+
function w(e) {
|
|
251
284
|
return e.year * 1e4 + e.month * 100 + e.day;
|
|
252
285
|
}
|
|
253
|
-
var
|
|
254
|
-
function
|
|
255
|
-
let n =
|
|
286
|
+
var ie = /* @__PURE__ */ new WeakMap();
|
|
287
|
+
function T(e, t) {
|
|
288
|
+
let n = ie.get(e);
|
|
256
289
|
if (n && n.start === e.start && n.end === e.end && n.timezone === t) return n.bounds;
|
|
257
|
-
let { firstDay: i, lastDayInclusive: a, isMultiDay: o } =
|
|
290
|
+
let { firstDay: i, lastDayInclusive: a, isMultiDay: o } = ae(e, t), s = {
|
|
258
291
|
firstDay: i,
|
|
259
292
|
lastDayInclusive: a,
|
|
260
293
|
isMultiDay: o,
|
|
261
|
-
firstOrd:
|
|
262
|
-
lastOrd:
|
|
294
|
+
firstOrd: w(i),
|
|
295
|
+
lastOrd: w(a),
|
|
263
296
|
firstKey: r(i)
|
|
264
297
|
};
|
|
265
|
-
return
|
|
298
|
+
return ie.set(e, {
|
|
266
299
|
start: e.start,
|
|
267
300
|
end: e.end,
|
|
268
301
|
timezone: t,
|
|
269
302
|
bounds: s
|
|
270
303
|
}), s;
|
|
271
304
|
}
|
|
272
|
-
function
|
|
305
|
+
function ae(e, t) {
|
|
273
306
|
if (o(e)) {
|
|
274
307
|
let t = e.start, n;
|
|
275
308
|
return e.end ? (n = e.end.subtract({ days: 1 }), a.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
|
|
@@ -291,14 +324,14 @@ function ie(e, t) {
|
|
|
291
324
|
}
|
|
292
325
|
//#endregion
|
|
293
326
|
//#region src/core/timeGridLayout.ts
|
|
294
|
-
function
|
|
327
|
+
function E(e, t) {
|
|
295
328
|
let { day: n, timeRange: r, timezone: i } = t, [a, o] = r, c = a * 60, l = o * 60;
|
|
296
329
|
if (l - c <= 0) return [];
|
|
297
330
|
let u = [], d = /* @__PURE__ */ new Set();
|
|
298
331
|
for (let t of e) {
|
|
299
332
|
if (d.has(t.id) || (d.add(t.id), !s(t))) continue;
|
|
300
|
-
let e =
|
|
301
|
-
if (t.end) r =
|
|
333
|
+
let e = D(t.start, n, i), r;
|
|
334
|
+
if (t.end) r = D(t.end, n, i);
|
|
302
335
|
else {
|
|
303
336
|
if (e < 0) continue;
|
|
304
337
|
r = e + 30;
|
|
@@ -357,7 +390,7 @@ function w(e, t) {
|
|
|
357
390
|
};
|
|
358
391
|
});
|
|
359
392
|
}
|
|
360
|
-
function
|
|
393
|
+
function oe(e, t) {
|
|
361
394
|
let { days: n } = t;
|
|
362
395
|
if (t.timezone, n.length === 0) return [];
|
|
363
396
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -396,7 +429,7 @@ function ae(e, t) {
|
|
|
396
429
|
clippedEnd: e.clippedEnd
|
|
397
430
|
}));
|
|
398
431
|
}
|
|
399
|
-
function
|
|
432
|
+
function D(e, t, n) {
|
|
400
433
|
let r = e.withTimeZone(n), i = a.PlainDateTime.from({
|
|
401
434
|
year: t.year,
|
|
402
435
|
month: t.month,
|
|
@@ -408,8 +441,8 @@ function T(e, t, n) {
|
|
|
408
441
|
}
|
|
409
442
|
//#endregion
|
|
410
443
|
//#region src/core/resourceDayLayout.ts
|
|
411
|
-
var
|
|
412
|
-
function
|
|
444
|
+
var O = "__unassigned";
|
|
445
|
+
function k(e) {
|
|
413
446
|
let t = [];
|
|
414
447
|
for (let n of e) {
|
|
415
448
|
let e = t[t.length - 1];
|
|
@@ -417,19 +450,19 @@ function D(e) {
|
|
|
417
450
|
}
|
|
418
451
|
return t;
|
|
419
452
|
}
|
|
420
|
-
function
|
|
421
|
-
let { day: n, resources: r, resourcesOf: i, timeRange: a, timezone: s } = t, c =
|
|
422
|
-
let t =
|
|
453
|
+
function se(e, t) {
|
|
454
|
+
let { day: n, resources: r, resourcesOf: i, timeRange: a, timezone: s } = t, c = w(n), l = e.filter((e) => {
|
|
455
|
+
let t = T(e, s);
|
|
423
456
|
return t.firstOrd <= c && t.lastOrd >= c;
|
|
424
|
-
}), u = new Map(r.map((e, t) => [e, t])), d = (e) => [...new Set(i(e).flatMap((e) => u.get(e) ?? []))].sort((e, t) => e - t), f = l.some((e) => d(e).length === 0) ? [...r,
|
|
457
|
+
}), u = new Map(r.map((e, t) => [e, t])), d = (e) => [...new Set(i(e).flatMap((e) => u.get(e) ?? []))].sort((e, t) => e - t), f = l.some((e) => d(e).length === 0) ? [...r, O] : [...r], p = (e) => {
|
|
425
458
|
let t = d(e);
|
|
426
459
|
return t.length > 0 ? t : [f.length - 1];
|
|
427
|
-
}, m = l.filter((e) => !o(e)), h = f.map((e, t) =>
|
|
460
|
+
}, m = l.filter((e) => !o(e)), h = f.map((e, t) => E(m.filter((e) => p(e).includes(t)), {
|
|
428
461
|
day: n,
|
|
429
462
|
timeRange: a,
|
|
430
463
|
timezone: s
|
|
431
464
|
})), _ = (e, t) => !h[e].some((e) => e.event.id !== t.event.id && e.startMinutes < t.endMinutes && e.endMinutes > t.startMinutes), v = [];
|
|
432
|
-
for (let e of m) for (let t of
|
|
465
|
+
for (let e of m) for (let t of k(p(e))) {
|
|
433
466
|
let n = t.map((t) => h[t].find((t) => t.event.id === e.id)), r = n[0];
|
|
434
467
|
if (r) {
|
|
435
468
|
if (t.every((e, t) => n[t] && _(e, n[t]))) {
|
|
@@ -454,7 +487,7 @@ function oe(e, t) {
|
|
|
454
487
|
});
|
|
455
488
|
}
|
|
456
489
|
}
|
|
457
|
-
let y = l.filter((e) => o(e)).flatMap((e) =>
|
|
490
|
+
let y = l.filter((e) => o(e)).flatMap((e) => k(p(e)).map((t) => ({
|
|
458
491
|
event: e,
|
|
459
492
|
startCol: t[0],
|
|
460
493
|
endCol: t[t.length - 1],
|
|
@@ -463,15 +496,15 @@ function oe(e, t) {
|
|
|
463
496
|
id: e.key,
|
|
464
497
|
start: e.startCol,
|
|
465
498
|
end: e.endCol
|
|
466
|
-
}))),
|
|
499
|
+
}))), x = new Map(b.bars.map((e) => [e.id, e.lane]));
|
|
467
500
|
return {
|
|
468
501
|
columns: f,
|
|
469
502
|
blocks: v,
|
|
470
503
|
allDay: y.map((e) => {
|
|
471
|
-
let t =
|
|
504
|
+
let t = T(e.event, s);
|
|
472
505
|
return {
|
|
473
506
|
...e,
|
|
474
|
-
lane:
|
|
507
|
+
lane: x.get(e.key) ?? 0,
|
|
475
508
|
laneCount: b.laneCount,
|
|
476
509
|
clippedStart: t.firstOrd < c,
|
|
477
510
|
clippedEnd: t.lastOrd > c
|
|
@@ -482,7 +515,7 @@ function oe(e, t) {
|
|
|
482
515
|
}
|
|
483
516
|
//#endregion
|
|
484
517
|
//#region src/core/boardLayout.ts
|
|
485
|
-
function
|
|
518
|
+
function ce(e, t, n) {
|
|
486
519
|
let r = [], i = -1;
|
|
487
520
|
for (let a = 0; a <= e.length; a++) {
|
|
488
521
|
let o = e[a], s = o != null && o >= t && o <= n;
|
|
@@ -490,21 +523,21 @@ function se(e, t, n) {
|
|
|
490
523
|
}
|
|
491
524
|
return r;
|
|
492
525
|
}
|
|
493
|
-
function
|
|
526
|
+
function le(e, t) {
|
|
494
527
|
let { rows: n, timezone: r } = t, i = [];
|
|
495
528
|
for (let t of n) {
|
|
496
529
|
let n = t.dates.map(() => []), a = [];
|
|
497
530
|
if (t.kind !== "custom") {
|
|
498
|
-
let i = t.dates.map((e) => e ?
|
|
531
|
+
let i = t.dates.map((e) => e ? w(e) : null), o = i.filter((e) => e !== null), s = o.length ? Math.min(...o) : Infinity, c = o.length ? Math.max(...o) : -Infinity;
|
|
499
532
|
for (let o of e) {
|
|
500
|
-
let e =
|
|
533
|
+
let e = T(o, r);
|
|
501
534
|
if (!(e.lastOrd < s || e.firstOrd > c) && !(t.match && !t.match(o))) {
|
|
502
535
|
if (t.kind === "cells" && !e.isMultiDay) {
|
|
503
536
|
let t = i.indexOf(e.firstOrd);
|
|
504
537
|
t >= 0 && n[t].push(o);
|
|
505
538
|
continue;
|
|
506
539
|
}
|
|
507
|
-
for (let [t, n] of
|
|
540
|
+
for (let [t, n] of ce(i, e.firstOrd, e.lastOrd)) a.push({
|
|
508
541
|
event: o,
|
|
509
542
|
startCol: t,
|
|
510
543
|
endCol: n,
|
|
@@ -529,13 +562,13 @@ function ce(e, t) {
|
|
|
529
562
|
laneCount: s.laneCount,
|
|
530
563
|
cells: t.dates.map((e, t) => ({
|
|
531
564
|
date: e,
|
|
532
|
-
events: n[t]
|
|
565
|
+
events: n[t].sort(_)
|
|
533
566
|
}))
|
|
534
567
|
});
|
|
535
568
|
}
|
|
536
569
|
return i;
|
|
537
570
|
}
|
|
538
|
-
function
|
|
571
|
+
function ue(e) {
|
|
539
572
|
let { event: t, row: n, date: r, sourceRow: i, grabOffsetDays: a, timezone: o } = e;
|
|
540
573
|
if (n.kind === "custom") return null;
|
|
541
574
|
let c = r.subtract({ days: a }).toString();
|
|
@@ -544,20 +577,20 @@ function le(e) {
|
|
|
544
577
|
minutes: null,
|
|
545
578
|
mode: "allDay"
|
|
546
579
|
};
|
|
547
|
-
let l = !!n.period && !!i.period && n.period.key !== i.period.key, u =
|
|
580
|
+
let l = !!n.period && !!i.period && n.period.key !== i.period.key, u = T(t, o).isMultiDay;
|
|
548
581
|
return {
|
|
549
582
|
date: c,
|
|
550
|
-
minutes: l && !u ? n.period.dropMinutes ?? n.period.startMinutes :
|
|
583
|
+
minutes: l && !u ? n.period.dropMinutes ?? n.period.startMinutes : M(t, o),
|
|
551
584
|
mode: "timed"
|
|
552
585
|
};
|
|
553
586
|
}
|
|
554
|
-
var
|
|
555
|
-
function
|
|
587
|
+
var A = "__all-day", j = "__unassigned";
|
|
588
|
+
function M(e, t) {
|
|
556
589
|
let n = e.start.withTimeZone(t);
|
|
557
590
|
return n.hour * 60 + n.minute;
|
|
558
591
|
}
|
|
559
|
-
function
|
|
560
|
-
let { dates: t, periods: n, timezone: r, allDay: i = !0, extraRows: a = [] } = e, o = (e) => !s(e) ||
|
|
592
|
+
function de(e) {
|
|
593
|
+
let { dates: t, periods: n, timezone: r, allDay: i = !0, extraRows: a = [] } = e, o = (e) => !s(e) || T(e, r).isMultiDay, c = (e) => {
|
|
561
594
|
let t = n.findIndex((t) => e >= t.startMinutes && e < t.endMinutes);
|
|
562
595
|
if (t >= 0) return t;
|
|
563
596
|
let r = n.findIndex((t) => t.startMinutes > e);
|
|
@@ -565,7 +598,7 @@ function ue(e) {
|
|
|
565
598
|
};
|
|
566
599
|
return [
|
|
567
600
|
...i ? [{
|
|
568
|
-
key:
|
|
601
|
+
key: A,
|
|
569
602
|
dates: t,
|
|
570
603
|
kind: "bars",
|
|
571
604
|
match: o
|
|
@@ -575,7 +608,7 @@ function ue(e) {
|
|
|
575
608
|
dates: t,
|
|
576
609
|
kind: "cells",
|
|
577
610
|
period: e,
|
|
578
|
-
match: (e) => !o(e) && c(
|
|
611
|
+
match: (e) => !o(e) && c(M(e, r)) === n
|
|
579
612
|
})),
|
|
580
613
|
...a.map((e) => ({
|
|
581
614
|
key: e,
|
|
@@ -584,7 +617,7 @@ function ue(e) {
|
|
|
584
617
|
}))
|
|
585
618
|
];
|
|
586
619
|
}
|
|
587
|
-
function
|
|
620
|
+
function fe(e) {
|
|
588
621
|
let { year: t, locale: n, match: r } = e, i = new Intl.DateTimeFormat(n, {
|
|
589
622
|
month: "short",
|
|
590
623
|
timeZone: "UTC"
|
|
@@ -604,13 +637,13 @@ function de(e) {
|
|
|
604
637
|
};
|
|
605
638
|
});
|
|
606
639
|
}
|
|
607
|
-
function
|
|
640
|
+
function pe() {
|
|
608
641
|
return Array.from({ length: 31 }, (e, t) => ({
|
|
609
642
|
key: String(t + 1),
|
|
610
643
|
label: String(t + 1)
|
|
611
644
|
}));
|
|
612
645
|
}
|
|
613
|
-
function
|
|
646
|
+
function me(e) {
|
|
614
647
|
let { dates: t, resources: n, resourcesOf: r, extraRows: i = [] } = e;
|
|
615
648
|
return [
|
|
616
649
|
...n.map((e) => ({
|
|
@@ -620,7 +653,7 @@ function pe(e) {
|
|
|
620
653
|
match: (t) => r(t).includes(e)
|
|
621
654
|
})),
|
|
622
655
|
{
|
|
623
|
-
key:
|
|
656
|
+
key: j,
|
|
624
657
|
dates: t,
|
|
625
658
|
kind: "cells",
|
|
626
659
|
hideWhenEmpty: !0,
|
|
@@ -635,14 +668,14 @@ function pe(e) {
|
|
|
635
668
|
}
|
|
636
669
|
//#endregion
|
|
637
670
|
//#region src/core/occupancy.ts
|
|
638
|
-
function
|
|
671
|
+
function N(e, t, n) {
|
|
639
672
|
let r = e.add({ days: Math.floor(t / 1440) }), i = t - Math.floor(t / 1440) * 1440;
|
|
640
673
|
return r.toZonedDateTime({
|
|
641
674
|
timeZone: n,
|
|
642
675
|
plainTime: new a.PlainTime(Math.floor(i / 60), i % 60)
|
|
643
676
|
}).epochMilliseconds;
|
|
644
677
|
}
|
|
645
|
-
function
|
|
678
|
+
function he(e) {
|
|
646
679
|
if (!(e.start instanceof a.ZonedDateTime)) return null;
|
|
647
680
|
let t = e.end instanceof a.ZonedDateTime ? e.end : e.start.add({ minutes: 30 });
|
|
648
681
|
return {
|
|
@@ -650,23 +683,23 @@ function M(e) {
|
|
|
650
683
|
end: t.epochMilliseconds
|
|
651
684
|
};
|
|
652
685
|
}
|
|
653
|
-
function
|
|
686
|
+
function ge(e, t) {
|
|
654
687
|
let n = e.start, r = e.end instanceof a.PlainDate ? e.end : n.add({ days: 1 });
|
|
655
688
|
return {
|
|
656
|
-
start:
|
|
657
|
-
end:
|
|
689
|
+
start: N(n, 0, t),
|
|
690
|
+
end: N(r, 0, t)
|
|
658
691
|
};
|
|
659
692
|
}
|
|
660
|
-
var
|
|
661
|
-
function
|
|
693
|
+
var P = (e, t) => `${e.toString()}|${t}`;
|
|
694
|
+
function _e(e, t) {
|
|
662
695
|
let { dates: n, periods: r, resources: i, timezone: a, resourcesOf: o } = t, c = t.counts ?? s, l = new Set(i), u = n.flatMap((e) => r.map((t) => ({
|
|
663
|
-
key:
|
|
664
|
-
start:
|
|
665
|
-
end:
|
|
696
|
+
key: P(e, t.key),
|
|
697
|
+
start: N(e, t.startMinutes, a),
|
|
698
|
+
end: N(e, t.endMinutes, a)
|
|
666
699
|
}))), d = /* @__PURE__ */ new Map();
|
|
667
700
|
for (let t of e) {
|
|
668
701
|
if (!c(t)) continue;
|
|
669
|
-
let e =
|
|
702
|
+
let e = he(t) ?? ge(t, a), n = o(t).filter((e) => l.has(e));
|
|
670
703
|
if (n.length !== 0) for (let t of u) {
|
|
671
704
|
if (e.start >= t.end || e.end <= t.start) continue;
|
|
672
705
|
let r = d.get(t.key);
|
|
@@ -676,18 +709,18 @@ function he(e, t) {
|
|
|
676
709
|
}
|
|
677
710
|
return {
|
|
678
711
|
busyResources(e, t) {
|
|
679
|
-
let n = d.get(
|
|
712
|
+
let n = d.get(P(e, t));
|
|
680
713
|
return n ? i.filter((e) => n.has(e)) : [];
|
|
681
714
|
},
|
|
682
715
|
isFree(e, t, n) {
|
|
683
|
-
let r = d.get(
|
|
716
|
+
let r = d.get(P(e, t));
|
|
684
717
|
return !r || n.every((e) => !r.has(e));
|
|
685
718
|
}
|
|
686
719
|
};
|
|
687
720
|
}
|
|
688
|
-
function
|
|
689
|
-
let { date: n, timezone: r, fromMinutes: i = 0, toMinutes: o = 1440, minMinutes: s = 1 } = t, c =
|
|
690
|
-
let t =
|
|
721
|
+
function ve(e, t) {
|
|
722
|
+
let { date: n, timezone: r, fromMinutes: i = 0, toMinutes: o = 1440, minMinutes: s = 1 } = t, c = N(n, i, r), l = N(n, o, r), u = e.flatMap((e) => {
|
|
723
|
+
let t = he(e);
|
|
691
724
|
return !t || t.end <= c || t.start >= l ? [] : [{
|
|
692
725
|
start: Math.max(t.start, c),
|
|
693
726
|
end: Math.min(t.end, l)
|
|
@@ -708,7 +741,7 @@ function ge(e, t) {
|
|
|
708
741
|
}
|
|
709
742
|
//#endregion
|
|
710
743
|
//#region src/core/timeGridRange.ts
|
|
711
|
-
var
|
|
744
|
+
var F = {
|
|
712
745
|
daySingle: {
|
|
713
746
|
anchor: "cursor",
|
|
714
747
|
span: 1,
|
|
@@ -734,41 +767,41 @@ var P = {
|
|
|
734
767
|
step: 7
|
|
735
768
|
}
|
|
736
769
|
};
|
|
737
|
-
function
|
|
738
|
-
return e === "week" ?
|
|
770
|
+
function I(e, t = {}) {
|
|
771
|
+
return e === "week" ? F.week : e === "workWeek" ? F.workWeek : t.explicit ? t.explicit : t.dayMode === "multiDay" ? F.dayMulti : F.daySingle;
|
|
739
772
|
}
|
|
740
|
-
function
|
|
741
|
-
let { spec: n, cursor: r, firstDayOfWeek: a, workDays: o } = t, s = n.anchor === "weekStart" ? e(r, a) : r, c =
|
|
773
|
+
function L(t) {
|
|
774
|
+
let { spec: n, cursor: r, firstDayOfWeek: a, workDays: o } = t, s = n.anchor === "weekStart" ? e(r, a) : r, c = R(n, t.responsiveColumns), l = Array.from({ length: c }, (e, t) => s.add({ days: t }));
|
|
742
775
|
return {
|
|
743
776
|
start: s,
|
|
744
777
|
spanDays: c,
|
|
745
778
|
days: n.filter === "workDays" ? l.filter((e) => o.includes(i(e.dayOfWeek))) : l,
|
|
746
|
-
stepDays:
|
|
779
|
+
stepDays: z(n, c)
|
|
747
780
|
};
|
|
748
781
|
}
|
|
749
|
-
function
|
|
782
|
+
function R(e, t) {
|
|
750
783
|
return e.span === "responsive" ? Math.max(1, Math.floor(t)) : Math.max(1, Math.floor(e.span));
|
|
751
784
|
}
|
|
752
|
-
function
|
|
785
|
+
function z(e, t) {
|
|
753
786
|
return e.step === "span" ? Math.max(1, t) : Math.max(1, Math.floor(e.step));
|
|
754
787
|
}
|
|
755
788
|
//#endregion
|
|
756
789
|
//#region src/core/viewWindow.ts
|
|
757
|
-
var
|
|
790
|
+
var ye = [
|
|
758
791
|
1,
|
|
759
792
|
2,
|
|
760
793
|
3,
|
|
761
794
|
4,
|
|
762
795
|
5
|
|
763
796
|
];
|
|
764
|
-
function
|
|
797
|
+
function be(n) {
|
|
765
798
|
let { view: r, cursor: i, firstDayOfWeek: a, timezone: o } = n;
|
|
766
799
|
switch (r) {
|
|
767
800
|
case "day":
|
|
768
801
|
case "week":
|
|
769
802
|
case "workWeek": {
|
|
770
|
-
let e =
|
|
771
|
-
spec:
|
|
803
|
+
let e = L({
|
|
804
|
+
spec: I(r, {
|
|
772
805
|
dayMode: "multiDay",
|
|
773
806
|
explicit: r === "day" ? n.timeGridRange ?? null : null
|
|
774
807
|
}),
|
|
@@ -851,19 +884,19 @@ function ve(n) {
|
|
|
851
884
|
default: throw Error(`Unsupported view: ${String(r)}`);
|
|
852
885
|
}
|
|
853
886
|
}
|
|
854
|
-
function*
|
|
887
|
+
function* xe(e) {
|
|
855
888
|
let t = u.PlainDate.from(e.start), n = u.PlainDate.from(e.end);
|
|
856
889
|
for (; u.PlainDate.compare(t, n) < 0;) yield t, t = t.add({ days: 1 });
|
|
857
890
|
}
|
|
858
|
-
function
|
|
891
|
+
function Se(e) {
|
|
859
892
|
let t = u.PlainDate.from(e.start);
|
|
860
893
|
return u.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
|
|
861
894
|
}
|
|
862
|
-
function
|
|
895
|
+
function Ce(e, t) {
|
|
863
896
|
let n = u.PlainDate.from(e.start), r = u.PlainDate.from(e.end);
|
|
864
897
|
return u.PlainDate.compare(t, n) >= 0 && u.PlainDate.compare(t, r) < 0;
|
|
865
898
|
}
|
|
866
|
-
function
|
|
899
|
+
function we(e, t, n, r = 30, i = 60, a = 1) {
|
|
867
900
|
let o = n === "next" ? 1 : -1;
|
|
868
901
|
switch (e) {
|
|
869
902
|
case "day": return t.add({ days: Math.max(1, a) * o });
|
|
@@ -880,7 +913,7 @@ function Se(e, t, n, r = 30, i = 60, a = 1) {
|
|
|
880
913
|
}
|
|
881
914
|
//#endregion
|
|
882
915
|
//#region src/core/dayColumns.ts
|
|
883
|
-
function
|
|
916
|
+
function Te(e, t = 1, n = 220, r = 64, i = 7) {
|
|
884
917
|
let a = Math.max(1, Math.round(t));
|
|
885
918
|
if (!Number.isFinite(e) || e <= 0) return a;
|
|
886
919
|
let o = Math.max(120, Number.isFinite(n) ? n : 220), s = Math.floor(Math.max(0, e - Math.max(0, r)) / o);
|
|
@@ -888,38 +921,38 @@ function Ce(e, t = 1, n = 220, r = 64, i = 7) {
|
|
|
888
921
|
}
|
|
889
922
|
//#endregion
|
|
890
923
|
//#region src/core/rangeLabel.ts
|
|
891
|
-
var
|
|
924
|
+
var Ee = {
|
|
892
925
|
month: "short",
|
|
893
926
|
day: "numeric",
|
|
894
927
|
year: "numeric",
|
|
895
928
|
timeZone: "UTC"
|
|
896
|
-
},
|
|
929
|
+
}, B = {
|
|
897
930
|
weekday: "long",
|
|
898
931
|
day: "numeric",
|
|
899
932
|
month: "long",
|
|
900
933
|
year: "numeric",
|
|
901
934
|
timeZone: "UTC"
|
|
902
|
-
},
|
|
935
|
+
}, De = {
|
|
903
936
|
year: "numeric",
|
|
904
937
|
month: "long",
|
|
905
938
|
timeZone: "UTC"
|
|
906
939
|
};
|
|
907
|
-
function
|
|
940
|
+
function V(e) {
|
|
908
941
|
return new Date(Date.UTC(e.year, e.month - 1, e.day));
|
|
909
942
|
}
|
|
910
|
-
function
|
|
943
|
+
function Oe(e) {
|
|
911
944
|
let { view: t, window: n, cursor: r, locale: i } = e, a = {
|
|
912
945
|
dateStyle: e.dateStyle,
|
|
913
946
|
timeStyle: e.timeStyle,
|
|
914
947
|
hour12: e.hour12
|
|
915
|
-
}, o = u.PlainDate.from(n.start), s = u.PlainDate.from(n.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(i, c(
|
|
948
|
+
}, o = u.PlainDate.from(n.start), s = u.PlainDate.from(n.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(i, c(Ee, a)).formatRange(V(o), V(s)), d = (e) => new Intl.DateTimeFormat(i, c(e, a)).format(V(r));
|
|
916
949
|
switch (t) {
|
|
917
|
-
case "day": return o.until(s, { largestUnit: "day" }).days > 0 ? l() : d(
|
|
918
|
-
case "dayAgenda": return d(
|
|
950
|
+
case "day": return o.until(s, { largestUnit: "day" }).days > 0 ? l() : d(B);
|
|
951
|
+
case "dayAgenda": return d(B);
|
|
919
952
|
case "week":
|
|
920
953
|
case "workWeek": return l();
|
|
921
954
|
case "month":
|
|
922
|
-
case "monthList": return d(
|
|
955
|
+
case "monthList": return d(De);
|
|
923
956
|
case "agenda":
|
|
924
957
|
case "timeline": return l();
|
|
925
958
|
case "year": return String(r.year);
|
|
@@ -928,15 +961,15 @@ function Ee(e) {
|
|
|
928
961
|
}
|
|
929
962
|
//#endregion
|
|
930
963
|
//#region src/core/timedCardAnatomy.ts
|
|
931
|
-
var
|
|
964
|
+
var ke = 112, Ae = Object.freeze({
|
|
932
965
|
compact: !0,
|
|
933
966
|
titleLines: 1,
|
|
934
967
|
showLocation: !1,
|
|
935
968
|
showTime: !1
|
|
936
969
|
});
|
|
937
|
-
function
|
|
970
|
+
function je(e) {
|
|
938
971
|
let { durationMinutes: t, visibleWidthPx: n, detailMinWidth: r, overlapped: i, hasLocation: a } = e;
|
|
939
|
-
return i && r > 0 && n !== null && n < r ?
|
|
972
|
+
return i && r > 0 && n !== null && n < r ? Ae : {
|
|
940
973
|
compact: !1,
|
|
941
974
|
titleLines: t >= 70 ? 2 : 1,
|
|
942
975
|
showLocation: a && t >= 34,
|
|
@@ -945,8 +978,8 @@ function ke(e) {
|
|
|
945
978
|
}
|
|
946
979
|
//#endregion
|
|
947
980
|
//#region src/core/allDayBandCap.ts
|
|
948
|
-
var
|
|
949
|
-
function
|
|
981
|
+
var Me = 3;
|
|
982
|
+
function Ne(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
|
|
950
983
|
let i = e.length === 0 ? 0 : e[0].laneCount, a = t === null ? null : Math.max(1, Math.floor(t)), o = a !== null && i > a;
|
|
951
984
|
if (!o || n) return {
|
|
952
985
|
bars: [...e],
|
|
@@ -975,7 +1008,7 @@ function je(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
|
|
|
975
1008
|
exceedsCap: o
|
|
976
1009
|
};
|
|
977
1010
|
}
|
|
978
|
-
function
|
|
1011
|
+
function Pe(e, t, n) {
|
|
979
1012
|
switch (t) {
|
|
980
1013
|
case "alwaysOneLane": return Math.max(1, e);
|
|
981
1014
|
case "reservesCap": return Math.max(n ?? 0, e);
|
|
@@ -984,7 +1017,7 @@ function Me(e, t, n) {
|
|
|
984
1017
|
}
|
|
985
1018
|
//#endregion
|
|
986
1019
|
//#region src/core/cascadeLayout.ts
|
|
987
|
-
function
|
|
1020
|
+
function Fe(e, t = 100, n = 1.5, r = 18) {
|
|
988
1021
|
let i = /* @__PURE__ */ new Map();
|
|
989
1022
|
if (!Number.isFinite(t) || t <= 0 || e.length === 0) return i;
|
|
990
1023
|
let a = Number.isFinite(n) ? Math.min(t / 2, Math.max(0, n)) : 0, o = Math.max(0, t - 2 * a), s = Number.isFinite(r) ? Math.max(0, r) : 0, c = e.map((e, t) => ({
|
|
@@ -1023,26 +1056,26 @@ function Ne(e, t = 100, n = 1.5, r = 18) {
|
|
|
1023
1056
|
}
|
|
1024
1057
|
return i;
|
|
1025
1058
|
}
|
|
1026
|
-
var
|
|
1027
|
-
function
|
|
1028
|
-
let n = typeof t == "string" ? { fallback: t } : t, r =
|
|
1029
|
-
return r ? (n.policy ?? "wcag") === "apca" ?
|
|
1059
|
+
var H = "#ffffff", U = "#000000", Ie = "var(--coar-text-base, #1a1c1f)";
|
|
1060
|
+
function W(e, t = {}) {
|
|
1061
|
+
let n = typeof t == "string" ? { fallback: t } : t, r = Be(e);
|
|
1062
|
+
return r ? (n.policy ?? "wcag") === "apca" ? ze(r) : Re(r) : n.fallback ?? Ie;
|
|
1030
1063
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
1064
|
+
function Le({ background: e, textColor: t, policy: n, fallback: r }) {
|
|
1065
|
+
return typeof t == "string" && t.trim() !== "" ? t : W(e, {
|
|
1033
1066
|
policy: n,
|
|
1034
1067
|
fallback: r
|
|
1035
1068
|
});
|
|
1036
1069
|
}
|
|
1037
|
-
function
|
|
1038
|
-
let t = .2126 *
|
|
1039
|
-
return 1.05 / (t + .05) >= (t + .05) / .05 ?
|
|
1070
|
+
function Re(e) {
|
|
1071
|
+
let t = .2126 * G(e[0]) + .7152 * G(e[1]) + .0722 * G(e[2]);
|
|
1072
|
+
return 1.05 / (t + .05) >= (t + .05) / .05 ? H : U;
|
|
1040
1073
|
}
|
|
1041
|
-
function
|
|
1074
|
+
function G(e) {
|
|
1042
1075
|
let t = e / 255;
|
|
1043
1076
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1044
1077
|
}
|
|
1045
|
-
var
|
|
1078
|
+
var K = {
|
|
1046
1079
|
exponent: 2.4,
|
|
1047
1080
|
blackThreshold: .022,
|
|
1048
1081
|
blackClamp: 1.414,
|
|
@@ -1054,31 +1087,31 @@ var G = {
|
|
|
1054
1087
|
loClip: .1,
|
|
1055
1088
|
loOffset: .027
|
|
1056
1089
|
};
|
|
1057
|
-
function
|
|
1058
|
-
let t = (e) => (e / 255) **
|
|
1059
|
-
return n <
|
|
1090
|
+
function q(e) {
|
|
1091
|
+
let t = (e) => (e / 255) ** K.exponent, n = .2126729 * t(e[0]) + .7151522 * t(e[1]) + .072175 * t(e[2]);
|
|
1092
|
+
return n < K.blackThreshold ? n + (K.blackThreshold - n) ** K.blackClamp : n;
|
|
1060
1093
|
}
|
|
1061
|
-
function
|
|
1062
|
-
let n =
|
|
1094
|
+
function J(e, t) {
|
|
1095
|
+
let n = q(e), r = q(t);
|
|
1063
1096
|
if (r > n) {
|
|
1064
|
-
let e = (r **
|
|
1065
|
-
return e <
|
|
1097
|
+
let e = (r ** K.normBg - n ** K.normText) * K.scale;
|
|
1098
|
+
return e < K.loClip ? 0 : (e - K.loOffset) * 100;
|
|
1066
1099
|
}
|
|
1067
|
-
let i = (r **
|
|
1068
|
-
return i > -
|
|
1100
|
+
let i = (r ** K.revBg - n ** K.revText) * K.scale;
|
|
1101
|
+
return i > -K.loClip ? 0 : (i + K.loOffset) * 100;
|
|
1069
1102
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return Math.abs(
|
|
1103
|
+
function ze(e) {
|
|
1104
|
+
return Math.abs(J([
|
|
1072
1105
|
255,
|
|
1073
1106
|
255,
|
|
1074
1107
|
255
|
|
1075
|
-
], e)) >= Math.abs(
|
|
1108
|
+
], e)) >= Math.abs(J([
|
|
1076
1109
|
0,
|
|
1077
1110
|
0,
|
|
1078
1111
|
0
|
|
1079
|
-
], e)) ?
|
|
1112
|
+
], e)) ? H : U;
|
|
1080
1113
|
}
|
|
1081
|
-
function
|
|
1114
|
+
function Be(e) {
|
|
1082
1115
|
let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
|
|
1083
1116
|
if (!t) return null;
|
|
1084
1117
|
let n = t[1].length === 3 ? [...t[1]].map((e) => e + e).join("") : t[1];
|
|
@@ -1090,18 +1123,18 @@ function Re(e) {
|
|
|
1090
1123
|
}
|
|
1091
1124
|
//#endregion
|
|
1092
1125
|
//#region src/core/timeSelection.ts
|
|
1093
|
-
var
|
|
1126
|
+
var Y = 1440, Ve = {
|
|
1094
1127
|
start: 0,
|
|
1095
|
-
end:
|
|
1128
|
+
end: Y
|
|
1096
1129
|
};
|
|
1097
|
-
function
|
|
1130
|
+
function X(e, t) {
|
|
1098
1131
|
return t <= 0 ? e : Math.round(e / t) * t;
|
|
1099
1132
|
}
|
|
1100
|
-
function
|
|
1133
|
+
function Z(e, t) {
|
|
1101
1134
|
return Math.min(t.end, Math.max(t.start, e));
|
|
1102
1135
|
}
|
|
1103
|
-
function
|
|
1104
|
-
return
|
|
1136
|
+
function He(e, t, n) {
|
|
1137
|
+
return E(e, {
|
|
1105
1138
|
day: t,
|
|
1106
1139
|
timeRange: [0, 24],
|
|
1107
1140
|
timezone: n
|
|
@@ -1111,8 +1144,8 @@ function Be(e, t, n) {
|
|
|
1111
1144
|
event: e.event
|
|
1112
1145
|
})).sort((e, t) => e.start - t.start || e.end - t.end);
|
|
1113
1146
|
}
|
|
1114
|
-
function
|
|
1115
|
-
let r =
|
|
1147
|
+
function Q(e, t, n = Ve) {
|
|
1148
|
+
let r = Z(t, n), i = n.start, a = n.end;
|
|
1116
1149
|
for (let t of e) if (!(t.end <= t.start)) {
|
|
1117
1150
|
if (r >= t.start && r < t.end) return null;
|
|
1118
1151
|
t.end <= r ? i = Math.max(i, t.end) : a = Math.min(a, t.start);
|
|
@@ -1122,31 +1155,31 @@ function Z(e, t, n = ze) {
|
|
|
1122
1155
|
end: a
|
|
1123
1156
|
} : null;
|
|
1124
1157
|
}
|
|
1125
|
-
function
|
|
1158
|
+
function Ue() {
|
|
1126
1159
|
return (e) => {
|
|
1127
1160
|
let t = e.slotDuration;
|
|
1128
1161
|
if (e.phase === "drag") {
|
|
1129
|
-
let n = X(
|
|
1162
|
+
let n = Z(X(e.anchorMinute ?? e.minute, t), e.bounds), r = Z(X(e.minute, t), e.bounds), i = {
|
|
1130
1163
|
start: Math.min(n, r),
|
|
1131
1164
|
end: Math.max(n, r)
|
|
1132
1165
|
};
|
|
1133
1166
|
return i.end > i.start ? i : null;
|
|
1134
1167
|
}
|
|
1135
|
-
let n =
|
|
1168
|
+
let n = Z(Math.floor(e.minute / t) * t, e.bounds), r = Math.min(e.bounds.end, n + t);
|
|
1136
1169
|
return r > n ? {
|
|
1137
1170
|
start: n,
|
|
1138
1171
|
end: r
|
|
1139
1172
|
} : null;
|
|
1140
1173
|
};
|
|
1141
1174
|
}
|
|
1142
|
-
function
|
|
1143
|
-
let t = Math.max(1, e.minutes), n =
|
|
1175
|
+
function We(e) {
|
|
1176
|
+
let t = Math.max(1, e.minutes), n = Ue();
|
|
1144
1177
|
return (r) => {
|
|
1145
1178
|
let i = r.slotDuration, a = r.bounds;
|
|
1146
1179
|
if (e.overlap) {
|
|
1147
1180
|
if (r.phase === "drag") return n(r);
|
|
1148
|
-
let e = X(
|
|
1149
|
-
e >= a.end && (e =
|
|
1181
|
+
let e = Z(X(r.minute, i), a);
|
|
1182
|
+
e >= a.end && (e = Z(Math.floor(r.minute / i) * i, a));
|
|
1150
1183
|
let o = Math.min(a.end, e + t);
|
|
1151
1184
|
return o > e ? {
|
|
1152
1185
|
start: e,
|
|
@@ -1154,19 +1187,19 @@ function Ve(e) {
|
|
|
1154
1187
|
} : null;
|
|
1155
1188
|
}
|
|
1156
1189
|
if (r.phase === "drag") {
|
|
1157
|
-
let e = r.anchorMinute ?? r.minute, t =
|
|
1190
|
+
let e = r.anchorMinute ?? r.minute, t = Q(r.busy, e, a);
|
|
1158
1191
|
if (!t) return null;
|
|
1159
|
-
let n = X(
|
|
1192
|
+
let n = Z(X(e, i), t), o = Z(X(r.minute, i), t), s = {
|
|
1160
1193
|
start: Math.min(n, o),
|
|
1161
1194
|
end: Math.max(n, o)
|
|
1162
1195
|
};
|
|
1163
1196
|
return s.end > s.start ? s : null;
|
|
1164
1197
|
}
|
|
1165
|
-
let o =
|
|
1198
|
+
let o = Q(r.busy, r.minute, a);
|
|
1166
1199
|
if (!o) return null;
|
|
1167
1200
|
let s = r.busy.some((e) => e.end === o.start), c = r.busy.some((e) => e.start === o.end);
|
|
1168
1201
|
if (s && c) return o;
|
|
1169
|
-
let l =
|
|
1202
|
+
let l = X(r.minute, i);
|
|
1170
1203
|
l >= o.end && (l = Math.floor(r.minute / i) * i), l = Math.max(o.start, l), s && l - o.start < i && (l = o.start);
|
|
1171
1204
|
let u = Math.min(o.end, l + t);
|
|
1172
1205
|
return u > l ? {
|
|
@@ -1175,8 +1208,8 @@ function Ve(e) {
|
|
|
1175
1208
|
} : null;
|
|
1176
1209
|
};
|
|
1177
1210
|
}
|
|
1178
|
-
function
|
|
1179
|
-
let i = Math.round(t), o = i >=
|
|
1211
|
+
function Ge(e, t, n, r = "compatible") {
|
|
1212
|
+
let i = Math.round(t), o = i >= Y ? e.add({ days: Math.floor(i / Y) }) : e, s = i >= Y ? i % Y : Math.max(0, i), c = o.toPlainDateTime(a.PlainTime.from({
|
|
1180
1213
|
hour: Math.floor(s / 60),
|
|
1181
1214
|
minute: s % 60
|
|
1182
1215
|
}));
|
|
@@ -1188,7 +1221,7 @@ function He(e, t, n, r = "compatible") {
|
|
|
1188
1221
|
}
|
|
1189
1222
|
//#endregion
|
|
1190
1223
|
//#region src/core/agendaLayout.ts
|
|
1191
|
-
function
|
|
1224
|
+
function Ke(e, t) {
|
|
1192
1225
|
let { rangeStart: n, rangeEnd: i, timezone: s, showEmptyDays: c = !1 } = t, l = a.PlainDate.from(n), u = a.PlainDate.from(i);
|
|
1193
1226
|
if (a.PlainDate.compare(u, l) <= 0) return [];
|
|
1194
1227
|
let d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
|
|
@@ -1202,7 +1235,7 @@ function Ue(e, t) {
|
|
|
1202
1235
|
for (let t of e) {
|
|
1203
1236
|
if (f.has(t.id)) continue;
|
|
1204
1237
|
f.add(t.id);
|
|
1205
|
-
let e = o(t), { firstDay: n, lastDayInclusive: i } =
|
|
1238
|
+
let e = o(t), { firstDay: n, lastDayInclusive: i } = qe(t, s), c = a.PlainDate.compare(n, l) < 0 ? l : n, d = u.subtract({ days: 1 }), m = a.PlainDate.compare(i, d) > 0 ? d : i;
|
|
1206
1239
|
if (a.PlainDate.compare(m, c) < 0) continue;
|
|
1207
1240
|
let h = c, g = !0;
|
|
1208
1241
|
for (; a.PlainDate.compare(h, m) <= 0;) {
|
|
@@ -1212,7 +1245,7 @@ function Ue(e, t) {
|
|
|
1212
1245
|
isContinuation: o
|
|
1213
1246
|
});
|
|
1214
1247
|
else {
|
|
1215
|
-
let e = o ? -Infinity :
|
|
1248
|
+
let e = o ? -Infinity : Je(t, s);
|
|
1216
1249
|
i.timed.push({
|
|
1217
1250
|
event: t,
|
|
1218
1251
|
startMs: e,
|
|
@@ -1252,7 +1285,7 @@ function Ue(e, t) {
|
|
|
1252
1285
|
}
|
|
1253
1286
|
return m;
|
|
1254
1287
|
}
|
|
1255
|
-
function
|
|
1288
|
+
function qe(e, t) {
|
|
1256
1289
|
if (o(e)) {
|
|
1257
1290
|
let t = e.start, n;
|
|
1258
1291
|
return e.end ? (n = e.end.subtract({ days: 1 }), a.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
|
|
@@ -1270,15 +1303,15 @@ function We(e, t) {
|
|
|
1270
1303
|
lastDayInclusive: r
|
|
1271
1304
|
};
|
|
1272
1305
|
}
|
|
1273
|
-
function
|
|
1306
|
+
function Je(e, t) {
|
|
1274
1307
|
return o(e) ? e.start.toZonedDateTime({ timeZone: t }).epochMilliseconds : e.start.epochMilliseconds;
|
|
1275
1308
|
}
|
|
1276
1309
|
//#endregion
|
|
1277
1310
|
//#region src/core/timelineLayout.ts
|
|
1278
|
-
function
|
|
1311
|
+
function Ye(e, t) {
|
|
1279
1312
|
let { windowStart: n, windowEnd: r, pixelsPerDay: i, rowHeight: a, displayZone: o } = t, s = n.until(r, { largestUnit: "days" }).days * i, c = /* @__PURE__ */ new Map();
|
|
1280
1313
|
for (let t of e) {
|
|
1281
|
-
let e =
|
|
1314
|
+
let e = Ze(t), n = Xe(t) !== null, r = c.get(e);
|
|
1282
1315
|
r || (r = {
|
|
1283
1316
|
events: [],
|
|
1284
1317
|
isRecurring: n
|
|
@@ -1288,7 +1321,7 @@ function Ke(e, t) {
|
|
|
1288
1321
|
for (let [e, t] of c) {
|
|
1289
1322
|
let a = [];
|
|
1290
1323
|
for (let e of t.events) {
|
|
1291
|
-
let { startDate: t, endDate: s } =
|
|
1324
|
+
let { startDate: t, endDate: s } = Qe(e, o);
|
|
1292
1325
|
if (u.PlainDate.compare(s, n) <= 0 || u.PlainDate.compare(t, r) >= 0) continue;
|
|
1293
1326
|
let c = u.PlainDate.compare(t, n) < 0, l = u.PlainDate.compare(s, r) > 0, d = c ? n : t, f = l ? r : s, p = n.until(d, { largestUnit: "days" }).days, m = d.until(f, { largestUnit: "days" }).days;
|
|
1294
1327
|
a.push({
|
|
@@ -1320,14 +1353,14 @@ function Ke(e, t) {
|
|
|
1320
1353
|
totalHeight: d.length * a
|
|
1321
1354
|
};
|
|
1322
1355
|
}
|
|
1323
|
-
function
|
|
1356
|
+
function Xe(e) {
|
|
1324
1357
|
let t = e.meta?.__recurrence?.seriesId;
|
|
1325
1358
|
return typeof t == "string" ? t : null;
|
|
1326
1359
|
}
|
|
1327
|
-
function
|
|
1328
|
-
return
|
|
1360
|
+
function Ze(e) {
|
|
1361
|
+
return Xe(e) ?? e.id;
|
|
1329
1362
|
}
|
|
1330
|
-
function
|
|
1363
|
+
function Qe(e, t) {
|
|
1331
1364
|
if (e.start instanceof u.PlainDate) {
|
|
1332
1365
|
let t = e.start;
|
|
1333
1366
|
return {
|
|
@@ -1343,7 +1376,7 @@ function Ye(e, t) {
|
|
|
1343
1376
|
}
|
|
1344
1377
|
//#endregion
|
|
1345
1378
|
//#region src/core/measurementCache.ts
|
|
1346
|
-
var
|
|
1379
|
+
var $e = class {
|
|
1347
1380
|
_itemCount;
|
|
1348
1381
|
_estimatedSize;
|
|
1349
1382
|
_measured;
|
|
@@ -1442,20 +1475,20 @@ function $(e, t, n, r = 3) {
|
|
|
1442
1475
|
totalSize: i
|
|
1443
1476
|
};
|
|
1444
1477
|
}
|
|
1445
|
-
function
|
|
1478
|
+
function et(e, t, n, r, i, a, o = 3, s = 3) {
|
|
1446
1479
|
return {
|
|
1447
1480
|
x: $(e, n, i, o),
|
|
1448
1481
|
y: $(t, r, a, s)
|
|
1449
1482
|
};
|
|
1450
1483
|
}
|
|
1451
|
-
function
|
|
1484
|
+
function tt(e, t, n) {
|
|
1452
1485
|
if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
|
|
1453
1486
|
let r = e.prefixSum(n);
|
|
1454
1487
|
return t.prefixSum(n) - r;
|
|
1455
1488
|
}
|
|
1456
1489
|
//#endregion
|
|
1457
1490
|
//#region src/core/dragHitTest.ts
|
|
1458
|
-
function
|
|
1491
|
+
function nt(e, t, n, r, i) {
|
|
1459
1492
|
if (r.itemCount === 0) return {
|
|
1460
1493
|
itemIndex: -1,
|
|
1461
1494
|
ratio: NaN,
|
|
@@ -1486,7 +1519,7 @@ function $e(e, t, n, r, i) {
|
|
|
1486
1519
|
pixelInItem: u
|
|
1487
1520
|
};
|
|
1488
1521
|
}
|
|
1489
|
-
function
|
|
1522
|
+
function rt(e, t, n, r = {}) {
|
|
1490
1523
|
let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
|
|
1491
1524
|
if (i <= 0 || a <= 0) return {
|
|
1492
1525
|
velocityX: 0,
|
|
@@ -1510,4 +1543,4 @@ function et(e, t, n, r = {}) {
|
|
|
1510
1543
|
};
|
|
1511
1544
|
}
|
|
1512
1545
|
//#endregion
|
|
1513
|
-
export {
|
|
1546
|
+
export { x as $, Se as A, ue as B, Oe as C, xe as D, be as E, z as F, fe as G, me as H, _e as I, oe as J, O as K, ve as L, R as M, L as N, we as O, I as P, v as Q, A as R, je as S, ye as T, de as U, le as V, pe as W, y as X, E as Y, ee as Z, Fe as _, et as a, g as at, Ne as b, Ke as c, Q as d, te as et, We as f, W as g, Le as h, $ as i, b as it, F as j, Ce as k, He as l, X as m, nt as n, ne as nt, $e as o, Ge as p, se as q, tt as r, re as rt, Ye as s, rt as t, C as tt, Ue as u, Me as v, Te as w, ke as x, Pe as y, j as z };
|