@cocoar/vue-calendar 3.4.0-beta.39 → 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/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/month/CoarMonthCell.vue.d.ts +4 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
- 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/monthGridLayout.d.ts.map +1 -1
- package/dist/{core-DfQCk0--.js → core-BcJBiqFt.js} +143 -130
- package/dist/core.js +1 -1
- package/dist/index.js +795 -737
- 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
|
|
@@ -108,8 +114,8 @@ function b(e, t) {
|
|
|
108
114
|
hidden: e.length - n
|
|
109
115
|
};
|
|
110
116
|
}
|
|
111
|
-
var
|
|
112
|
-
function
|
|
117
|
+
var ee = 2;
|
|
118
|
+
function te(e, t) {
|
|
113
119
|
let n = e.length ? e[0].laneCount : 0, r = t === null || !Number.isFinite(t) || t < 0 ? n : Math.floor(t);
|
|
114
120
|
if (n <= r) return {
|
|
115
121
|
visible: e,
|
|
@@ -149,16 +155,16 @@ function ee(e, t) {
|
|
|
149
155
|
laneCount: r
|
|
150
156
|
};
|
|
151
157
|
}
|
|
152
|
-
function
|
|
158
|
+
function S(e) {
|
|
153
159
|
return e.rowHeight - e.dayNumberHeight - e.pillsPaddingTop - e.pillsPaddingBottom;
|
|
154
160
|
}
|
|
155
|
-
function
|
|
161
|
+
function C(e, t) {
|
|
156
162
|
let n = e.pillHeight + e.pillGap;
|
|
157
163
|
if (n <= 0) return {
|
|
158
164
|
pillLimit: 0,
|
|
159
165
|
pillLimitWithoutMarker: 0
|
|
160
166
|
};
|
|
161
|
-
let r =
|
|
167
|
+
let r = S(e) - t * (e.barHeight + e.barGap), i = Math.min(Math.max(0, Math.floor((r + e.pillGap) / n)), e.pillLimit);
|
|
162
168
|
if (e.markerHeight <= 0) return {
|
|
163
169
|
pillLimit: i,
|
|
164
170
|
pillLimitWithoutMarker: i
|
|
@@ -170,10 +176,10 @@ function S(e, t) {
|
|
|
170
176
|
};
|
|
171
177
|
}
|
|
172
178
|
function ne(e) {
|
|
173
|
-
let t = e.barHeight + e.barGap, n = Math.max(0,
|
|
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));
|
|
174
180
|
return {
|
|
175
181
|
maxLanes: i,
|
|
176
|
-
...
|
|
182
|
+
...C(e, Math.min(e.laneCount, i))
|
|
177
183
|
};
|
|
178
184
|
}
|
|
179
185
|
function re(e, t) {
|
|
@@ -191,7 +197,7 @@ function re(e, t) {
|
|
|
191
197
|
weekEnd: t[6]
|
|
192
198
|
});
|
|
193
199
|
}
|
|
194
|
-
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;
|
|
195
201
|
for (let t of e) {
|
|
196
202
|
if (s.has(t.id)) continue;
|
|
197
203
|
s.add(t.id);
|
|
@@ -211,6 +217,13 @@ function re(e, t) {
|
|
|
211
217
|
r ? r.push(i) : l.set(n, [i]);
|
|
212
218
|
}
|
|
213
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
|
+
}
|
|
214
227
|
return { weekRows: o.map((e) => {
|
|
215
228
|
let n = [];
|
|
216
229
|
for (let i of c) {
|
|
@@ -267,29 +280,29 @@ function re(e, t) {
|
|
|
267
280
|
};
|
|
268
281
|
}) };
|
|
269
282
|
}
|
|
270
|
-
function
|
|
283
|
+
function w(e) {
|
|
271
284
|
return e.year * 1e4 + e.month * 100 + e.day;
|
|
272
285
|
}
|
|
273
|
-
var
|
|
286
|
+
var ie = /* @__PURE__ */ new WeakMap();
|
|
274
287
|
function T(e, t) {
|
|
275
|
-
let n =
|
|
288
|
+
let n = ie.get(e);
|
|
276
289
|
if (n && n.start === e.start && n.end === e.end && n.timezone === t) return n.bounds;
|
|
277
|
-
let { firstDay: i, lastDayInclusive: a, isMultiDay: o } =
|
|
290
|
+
let { firstDay: i, lastDayInclusive: a, isMultiDay: o } = ae(e, t), s = {
|
|
278
291
|
firstDay: i,
|
|
279
292
|
lastDayInclusive: a,
|
|
280
293
|
isMultiDay: o,
|
|
281
|
-
firstOrd:
|
|
282
|
-
lastOrd:
|
|
294
|
+
firstOrd: w(i),
|
|
295
|
+
lastOrd: w(a),
|
|
283
296
|
firstKey: r(i)
|
|
284
297
|
};
|
|
285
|
-
return
|
|
298
|
+
return ie.set(e, {
|
|
286
299
|
start: e.start,
|
|
287
300
|
end: e.end,
|
|
288
301
|
timezone: t,
|
|
289
302
|
bounds: s
|
|
290
303
|
}), s;
|
|
291
304
|
}
|
|
292
|
-
function
|
|
305
|
+
function ae(e, t) {
|
|
293
306
|
if (o(e)) {
|
|
294
307
|
let t = e.start, n;
|
|
295
308
|
return e.end ? (n = e.end.subtract({ days: 1 }), a.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
|
|
@@ -317,8 +330,8 @@ function E(e, t) {
|
|
|
317
330
|
let u = [], d = /* @__PURE__ */ new Set();
|
|
318
331
|
for (let t of e) {
|
|
319
332
|
if (d.has(t.id) || (d.add(t.id), !s(t))) continue;
|
|
320
|
-
let e =
|
|
321
|
-
if (t.end) r =
|
|
333
|
+
let e = D(t.start, n, i), r;
|
|
334
|
+
if (t.end) r = D(t.end, n, i);
|
|
322
335
|
else {
|
|
323
336
|
if (e < 0) continue;
|
|
324
337
|
r = e + 30;
|
|
@@ -377,7 +390,7 @@ function E(e, t) {
|
|
|
377
390
|
};
|
|
378
391
|
});
|
|
379
392
|
}
|
|
380
|
-
function
|
|
393
|
+
function oe(e, t) {
|
|
381
394
|
let { days: n } = t;
|
|
382
395
|
if (t.timezone, n.length === 0) return [];
|
|
383
396
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -416,7 +429,7 @@ function ae(e, t) {
|
|
|
416
429
|
clippedEnd: e.clippedEnd
|
|
417
430
|
}));
|
|
418
431
|
}
|
|
419
|
-
function
|
|
432
|
+
function D(e, t, n) {
|
|
420
433
|
let r = e.withTimeZone(n), i = a.PlainDateTime.from({
|
|
421
434
|
year: t.year,
|
|
422
435
|
month: t.month,
|
|
@@ -428,8 +441,8 @@ function oe(e, t, n) {
|
|
|
428
441
|
}
|
|
429
442
|
//#endregion
|
|
430
443
|
//#region src/core/resourceDayLayout.ts
|
|
431
|
-
var
|
|
432
|
-
function
|
|
444
|
+
var O = "__unassigned";
|
|
445
|
+
function k(e) {
|
|
433
446
|
let t = [];
|
|
434
447
|
for (let n of e) {
|
|
435
448
|
let e = t[t.length - 1];
|
|
@@ -437,11 +450,11 @@ function D(e) {
|
|
|
437
450
|
}
|
|
438
451
|
return t;
|
|
439
452
|
}
|
|
440
|
-
function
|
|
441
|
-
let { day: n, resources: r, resourcesOf: i, timeRange: a, timezone: s } = t, c =
|
|
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) => {
|
|
442
455
|
let t = T(e, s);
|
|
443
456
|
return t.firstOrd <= c && t.lastOrd >= c;
|
|
444
|
-
}), 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) => {
|
|
445
458
|
let t = d(e);
|
|
446
459
|
return t.length > 0 ? t : [f.length - 1];
|
|
447
460
|
}, m = l.filter((e) => !o(e)), h = f.map((e, t) => E(m.filter((e) => p(e).includes(t)), {
|
|
@@ -449,7 +462,7 @@ function ce(e, t) {
|
|
|
449
462
|
timeRange: a,
|
|
450
463
|
timezone: s
|
|
451
464
|
})), _ = (e, t) => !h[e].some((e) => e.event.id !== t.event.id && e.startMinutes < t.endMinutes && e.endMinutes > t.startMinutes), v = [];
|
|
452
|
-
for (let e of m) for (let t of
|
|
465
|
+
for (let e of m) for (let t of k(p(e))) {
|
|
453
466
|
let n = t.map((t) => h[t].find((t) => t.event.id === e.id)), r = n[0];
|
|
454
467
|
if (r) {
|
|
455
468
|
if (t.every((e, t) => n[t] && _(e, n[t]))) {
|
|
@@ -474,7 +487,7 @@ function ce(e, t) {
|
|
|
474
487
|
});
|
|
475
488
|
}
|
|
476
489
|
}
|
|
477
|
-
let y = l.filter((e) => o(e)).flatMap((e) =>
|
|
490
|
+
let y = l.filter((e) => o(e)).flatMap((e) => k(p(e)).map((t) => ({
|
|
478
491
|
event: e,
|
|
479
492
|
startCol: t[0],
|
|
480
493
|
endCol: t[t.length - 1],
|
|
@@ -502,7 +515,7 @@ function ce(e, t) {
|
|
|
502
515
|
}
|
|
503
516
|
//#endregion
|
|
504
517
|
//#region src/core/boardLayout.ts
|
|
505
|
-
function
|
|
518
|
+
function ce(e, t, n) {
|
|
506
519
|
let r = [], i = -1;
|
|
507
520
|
for (let a = 0; a <= e.length; a++) {
|
|
508
521
|
let o = e[a], s = o != null && o >= t && o <= n;
|
|
@@ -510,12 +523,12 @@ function le(e, t, n) {
|
|
|
510
523
|
}
|
|
511
524
|
return r;
|
|
512
525
|
}
|
|
513
|
-
function
|
|
526
|
+
function le(e, t) {
|
|
514
527
|
let { rows: n, timezone: r } = t, i = [];
|
|
515
528
|
for (let t of n) {
|
|
516
529
|
let n = t.dates.map(() => []), a = [];
|
|
517
530
|
if (t.kind !== "custom") {
|
|
518
|
-
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;
|
|
519
532
|
for (let o of e) {
|
|
520
533
|
let e = T(o, r);
|
|
521
534
|
if (!(e.lastOrd < s || e.firstOrd > c) && !(t.match && !t.match(o))) {
|
|
@@ -524,7 +537,7 @@ function ue(e, t) {
|
|
|
524
537
|
t >= 0 && n[t].push(o);
|
|
525
538
|
continue;
|
|
526
539
|
}
|
|
527
|
-
for (let [t, n] of
|
|
540
|
+
for (let [t, n] of ce(i, e.firstOrd, e.lastOrd)) a.push({
|
|
528
541
|
event: o,
|
|
529
542
|
startCol: t,
|
|
530
543
|
endCol: n,
|
|
@@ -549,13 +562,13 @@ function ue(e, t) {
|
|
|
549
562
|
laneCount: s.laneCount,
|
|
550
563
|
cells: t.dates.map((e, t) => ({
|
|
551
564
|
date: e,
|
|
552
|
-
events: n[t]
|
|
565
|
+
events: n[t].sort(_)
|
|
553
566
|
}))
|
|
554
567
|
});
|
|
555
568
|
}
|
|
556
569
|
return i;
|
|
557
570
|
}
|
|
558
|
-
function
|
|
571
|
+
function ue(e) {
|
|
559
572
|
let { event: t, row: n, date: r, sourceRow: i, grabOffsetDays: a, timezone: o } = e;
|
|
560
573
|
if (n.kind === "custom") return null;
|
|
561
574
|
let c = r.subtract({ days: a }).toString();
|
|
@@ -567,16 +580,16 @@ function de(e) {
|
|
|
567
580
|
let l = !!n.period && !!i.period && n.period.key !== i.period.key, u = T(t, o).isMultiDay;
|
|
568
581
|
return {
|
|
569
582
|
date: c,
|
|
570
|
-
minutes: l && !u ? n.period.dropMinutes ?? n.period.startMinutes :
|
|
583
|
+
minutes: l && !u ? n.period.dropMinutes ?? n.period.startMinutes : M(t, o),
|
|
571
584
|
mode: "timed"
|
|
572
585
|
};
|
|
573
586
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
587
|
+
var A = "__all-day", j = "__unassigned";
|
|
588
|
+
function M(e, t) {
|
|
576
589
|
let n = e.start.withTimeZone(t);
|
|
577
590
|
return n.hour * 60 + n.minute;
|
|
578
591
|
}
|
|
579
|
-
function
|
|
592
|
+
function de(e) {
|
|
580
593
|
let { dates: t, periods: n, timezone: r, allDay: i = !0, extraRows: a = [] } = e, o = (e) => !s(e) || T(e, r).isMultiDay, c = (e) => {
|
|
581
594
|
let t = n.findIndex((t) => e >= t.startMinutes && e < t.endMinutes);
|
|
582
595
|
if (t >= 0) return t;
|
|
@@ -585,7 +598,7 @@ function fe(e) {
|
|
|
585
598
|
};
|
|
586
599
|
return [
|
|
587
600
|
...i ? [{
|
|
588
|
-
key:
|
|
601
|
+
key: A,
|
|
589
602
|
dates: t,
|
|
590
603
|
kind: "bars",
|
|
591
604
|
match: o
|
|
@@ -595,7 +608,7 @@ function fe(e) {
|
|
|
595
608
|
dates: t,
|
|
596
609
|
kind: "cells",
|
|
597
610
|
period: e,
|
|
598
|
-
match: (e) => !o(e) && c(
|
|
611
|
+
match: (e) => !o(e) && c(M(e, r)) === n
|
|
599
612
|
})),
|
|
600
613
|
...a.map((e) => ({
|
|
601
614
|
key: e,
|
|
@@ -604,7 +617,7 @@ function fe(e) {
|
|
|
604
617
|
}))
|
|
605
618
|
];
|
|
606
619
|
}
|
|
607
|
-
function
|
|
620
|
+
function fe(e) {
|
|
608
621
|
let { year: t, locale: n, match: r } = e, i = new Intl.DateTimeFormat(n, {
|
|
609
622
|
month: "short",
|
|
610
623
|
timeZone: "UTC"
|
|
@@ -624,13 +637,13 @@ function pe(e) {
|
|
|
624
637
|
};
|
|
625
638
|
});
|
|
626
639
|
}
|
|
627
|
-
function
|
|
640
|
+
function pe() {
|
|
628
641
|
return Array.from({ length: 31 }, (e, t) => ({
|
|
629
642
|
key: String(t + 1),
|
|
630
643
|
label: String(t + 1)
|
|
631
644
|
}));
|
|
632
645
|
}
|
|
633
|
-
function
|
|
646
|
+
function me(e) {
|
|
634
647
|
let { dates: t, resources: n, resourcesOf: r, extraRows: i = [] } = e;
|
|
635
648
|
return [
|
|
636
649
|
...n.map((e) => ({
|
|
@@ -640,7 +653,7 @@ function he(e) {
|
|
|
640
653
|
match: (t) => r(t).includes(e)
|
|
641
654
|
})),
|
|
642
655
|
{
|
|
643
|
-
key:
|
|
656
|
+
key: j,
|
|
644
657
|
dates: t,
|
|
645
658
|
kind: "cells",
|
|
646
659
|
hideWhenEmpty: !0,
|
|
@@ -655,14 +668,14 @@ function he(e) {
|
|
|
655
668
|
}
|
|
656
669
|
//#endregion
|
|
657
670
|
//#region src/core/occupancy.ts
|
|
658
|
-
function
|
|
671
|
+
function N(e, t, n) {
|
|
659
672
|
let r = e.add({ days: Math.floor(t / 1440) }), i = t - Math.floor(t / 1440) * 1440;
|
|
660
673
|
return r.toZonedDateTime({
|
|
661
674
|
timeZone: n,
|
|
662
675
|
plainTime: new a.PlainTime(Math.floor(i / 60), i % 60)
|
|
663
676
|
}).epochMilliseconds;
|
|
664
677
|
}
|
|
665
|
-
function
|
|
678
|
+
function he(e) {
|
|
666
679
|
if (!(e.start instanceof a.ZonedDateTime)) return null;
|
|
667
680
|
let t = e.end instanceof a.ZonedDateTime ? e.end : e.start.add({ minutes: 30 });
|
|
668
681
|
return {
|
|
@@ -673,20 +686,20 @@ function M(e) {
|
|
|
673
686
|
function ge(e, t) {
|
|
674
687
|
let n = e.start, r = e.end instanceof a.PlainDate ? e.end : n.add({ days: 1 });
|
|
675
688
|
return {
|
|
676
|
-
start:
|
|
677
|
-
end:
|
|
689
|
+
start: N(n, 0, t),
|
|
690
|
+
end: N(r, 0, t)
|
|
678
691
|
};
|
|
679
692
|
}
|
|
680
|
-
var
|
|
693
|
+
var P = (e, t) => `${e.toString()}|${t}`;
|
|
681
694
|
function _e(e, t) {
|
|
682
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) => ({
|
|
683
|
-
key:
|
|
684
|
-
start:
|
|
685
|
-
end:
|
|
696
|
+
key: P(e, t.key),
|
|
697
|
+
start: N(e, t.startMinutes, a),
|
|
698
|
+
end: N(e, t.endMinutes, a)
|
|
686
699
|
}))), d = /* @__PURE__ */ new Map();
|
|
687
700
|
for (let t of e) {
|
|
688
701
|
if (!c(t)) continue;
|
|
689
|
-
let e =
|
|
702
|
+
let e = he(t) ?? ge(t, a), n = o(t).filter((e) => l.has(e));
|
|
690
703
|
if (n.length !== 0) for (let t of u) {
|
|
691
704
|
if (e.start >= t.end || e.end <= t.start) continue;
|
|
692
705
|
let r = d.get(t.key);
|
|
@@ -696,18 +709,18 @@ function _e(e, t) {
|
|
|
696
709
|
}
|
|
697
710
|
return {
|
|
698
711
|
busyResources(e, t) {
|
|
699
|
-
let n = d.get(
|
|
712
|
+
let n = d.get(P(e, t));
|
|
700
713
|
return n ? i.filter((e) => n.has(e)) : [];
|
|
701
714
|
},
|
|
702
715
|
isFree(e, t, n) {
|
|
703
|
-
let r = d.get(
|
|
716
|
+
let r = d.get(P(e, t));
|
|
704
717
|
return !r || n.every((e) => !r.has(e));
|
|
705
718
|
}
|
|
706
719
|
};
|
|
707
720
|
}
|
|
708
721
|
function ve(e, t) {
|
|
709
|
-
let { date: n, timezone: r, fromMinutes: i = 0, toMinutes: o = 1440, minMinutes: s = 1 } = t, c =
|
|
710
|
-
let 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);
|
|
711
724
|
return !t || t.end <= c || t.start >= l ? [] : [{
|
|
712
725
|
start: Math.max(t.start, c),
|
|
713
726
|
end: Math.min(t.end, l)
|
|
@@ -728,7 +741,7 @@ function ve(e, t) {
|
|
|
728
741
|
}
|
|
729
742
|
//#endregion
|
|
730
743
|
//#region src/core/timeGridRange.ts
|
|
731
|
-
var
|
|
744
|
+
var F = {
|
|
732
745
|
daySingle: {
|
|
733
746
|
anchor: "cursor",
|
|
734
747
|
span: 1,
|
|
@@ -754,22 +767,22 @@ var P = {
|
|
|
754
767
|
step: 7
|
|
755
768
|
}
|
|
756
769
|
};
|
|
757
|
-
function
|
|
758
|
-
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;
|
|
759
772
|
}
|
|
760
|
-
function
|
|
761
|
-
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 }));
|
|
762
775
|
return {
|
|
763
776
|
start: s,
|
|
764
777
|
spanDays: c,
|
|
765
778
|
days: n.filter === "workDays" ? l.filter((e) => o.includes(i(e.dayOfWeek))) : l,
|
|
766
|
-
stepDays:
|
|
779
|
+
stepDays: z(n, c)
|
|
767
780
|
};
|
|
768
781
|
}
|
|
769
|
-
function
|
|
782
|
+
function R(e, t) {
|
|
770
783
|
return e.span === "responsive" ? Math.max(1, Math.floor(t)) : Math.max(1, Math.floor(e.span));
|
|
771
784
|
}
|
|
772
|
-
function
|
|
785
|
+
function z(e, t) {
|
|
773
786
|
return e.step === "span" ? Math.max(1, t) : Math.max(1, Math.floor(e.step));
|
|
774
787
|
}
|
|
775
788
|
//#endregion
|
|
@@ -787,8 +800,8 @@ function be(n) {
|
|
|
787
800
|
case "day":
|
|
788
801
|
case "week":
|
|
789
802
|
case "workWeek": {
|
|
790
|
-
let e =
|
|
791
|
-
spec:
|
|
803
|
+
let e = L({
|
|
804
|
+
spec: I(r, {
|
|
792
805
|
dayMode: "multiDay",
|
|
793
806
|
explicit: r === "day" ? n.timeGridRange ?? null : null
|
|
794
807
|
}),
|
|
@@ -913,7 +926,7 @@ var Ee = {
|
|
|
913
926
|
day: "numeric",
|
|
914
927
|
year: "numeric",
|
|
915
928
|
timeZone: "UTC"
|
|
916
|
-
},
|
|
929
|
+
}, B = {
|
|
917
930
|
weekday: "long",
|
|
918
931
|
day: "numeric",
|
|
919
932
|
month: "long",
|
|
@@ -924,7 +937,7 @@ var Ee = {
|
|
|
924
937
|
month: "long",
|
|
925
938
|
timeZone: "UTC"
|
|
926
939
|
};
|
|
927
|
-
function
|
|
940
|
+
function V(e) {
|
|
928
941
|
return new Date(Date.UTC(e.year, e.month - 1, e.day));
|
|
929
942
|
}
|
|
930
943
|
function Oe(e) {
|
|
@@ -932,10 +945,10 @@ function Oe(e) {
|
|
|
932
945
|
dateStyle: e.dateStyle,
|
|
933
946
|
timeStyle: e.timeStyle,
|
|
934
947
|
hour12: e.hour12
|
|
935
|
-
}, o = u.PlainDate.from(n.start), s = u.PlainDate.from(n.end).subtract({ days: 1 }), l = () => new Intl.DateTimeFormat(i, c(Ee, a)).formatRange(
|
|
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));
|
|
936
949
|
switch (t) {
|
|
937
|
-
case "day": return o.until(s, { largestUnit: "day" }).days > 0 ? l() : d(
|
|
938
|
-
case "dayAgenda": return d(
|
|
950
|
+
case "day": return o.until(s, { largestUnit: "day" }).days > 0 ? l() : d(B);
|
|
951
|
+
case "dayAgenda": return d(B);
|
|
939
952
|
case "week":
|
|
940
953
|
case "workWeek": return l();
|
|
941
954
|
case "month":
|
|
@@ -1043,26 +1056,26 @@ function Fe(e, t = 100, n = 1.5, r = 18) {
|
|
|
1043
1056
|
}
|
|
1044
1057
|
return i;
|
|
1045
1058
|
}
|
|
1046
|
-
var
|
|
1047
|
-
function
|
|
1059
|
+
var H = "#ffffff", U = "#000000", Ie = "var(--coar-text-base, #1a1c1f)";
|
|
1060
|
+
function W(e, t = {}) {
|
|
1048
1061
|
let n = typeof t == "string" ? { fallback: t } : t, r = Be(e);
|
|
1049
1062
|
return r ? (n.policy ?? "wcag") === "apca" ? ze(r) : Re(r) : n.fallback ?? Ie;
|
|
1050
1063
|
}
|
|
1051
1064
|
function Le({ background: e, textColor: t, policy: n, fallback: r }) {
|
|
1052
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
1065
|
+
return typeof t == "string" && t.trim() !== "" ? t : W(e, {
|
|
1053
1066
|
policy: n,
|
|
1054
1067
|
fallback: r
|
|
1055
1068
|
});
|
|
1056
1069
|
}
|
|
1057
1070
|
function Re(e) {
|
|
1058
|
-
let t = .2126 *
|
|
1059
|
-
return 1.05 / (t + .05) >= (t + .05) / .05 ?
|
|
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;
|
|
1060
1073
|
}
|
|
1061
|
-
function
|
|
1074
|
+
function G(e) {
|
|
1062
1075
|
let t = e / 255;
|
|
1063
1076
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1064
1077
|
}
|
|
1065
|
-
var
|
|
1078
|
+
var K = {
|
|
1066
1079
|
exponent: 2.4,
|
|
1067
1080
|
blackThreshold: .022,
|
|
1068
1081
|
blackClamp: 1.414,
|
|
@@ -1074,29 +1087,29 @@ var G = {
|
|
|
1074
1087
|
loClip: .1,
|
|
1075
1088
|
loOffset: .027
|
|
1076
1089
|
};
|
|
1077
|
-
function
|
|
1078
|
-
let t = (e) => (e / 255) **
|
|
1079
|
-
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;
|
|
1080
1093
|
}
|
|
1081
|
-
function
|
|
1082
|
-
let n =
|
|
1094
|
+
function J(e, t) {
|
|
1095
|
+
let n = q(e), r = q(t);
|
|
1083
1096
|
if (r > n) {
|
|
1084
|
-
let e = (r **
|
|
1085
|
-
return e <
|
|
1097
|
+
let e = (r ** K.normBg - n ** K.normText) * K.scale;
|
|
1098
|
+
return e < K.loClip ? 0 : (e - K.loOffset) * 100;
|
|
1086
1099
|
}
|
|
1087
|
-
let i = (r **
|
|
1088
|
-
return i > -
|
|
1100
|
+
let i = (r ** K.revBg - n ** K.revText) * K.scale;
|
|
1101
|
+
return i > -K.loClip ? 0 : (i + K.loOffset) * 100;
|
|
1089
1102
|
}
|
|
1090
1103
|
function ze(e) {
|
|
1091
|
-
return Math.abs(
|
|
1104
|
+
return Math.abs(J([
|
|
1092
1105
|
255,
|
|
1093
1106
|
255,
|
|
1094
1107
|
255
|
|
1095
|
-
], e)) >= Math.abs(
|
|
1108
|
+
], e)) >= Math.abs(J([
|
|
1096
1109
|
0,
|
|
1097
1110
|
0,
|
|
1098
1111
|
0
|
|
1099
|
-
], e)) ?
|
|
1112
|
+
], e)) ? H : U;
|
|
1100
1113
|
}
|
|
1101
1114
|
function Be(e) {
|
|
1102
1115
|
let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
|
|
@@ -1110,14 +1123,14 @@ function Be(e) {
|
|
|
1110
1123
|
}
|
|
1111
1124
|
//#endregion
|
|
1112
1125
|
//#region src/core/timeSelection.ts
|
|
1113
|
-
var
|
|
1126
|
+
var Y = 1440, Ve = {
|
|
1114
1127
|
start: 0,
|
|
1115
|
-
end:
|
|
1128
|
+
end: Y
|
|
1116
1129
|
};
|
|
1117
|
-
function
|
|
1130
|
+
function X(e, t) {
|
|
1118
1131
|
return t <= 0 ? e : Math.round(e / t) * t;
|
|
1119
1132
|
}
|
|
1120
|
-
function
|
|
1133
|
+
function Z(e, t) {
|
|
1121
1134
|
return Math.min(t.end, Math.max(t.start, e));
|
|
1122
1135
|
}
|
|
1123
1136
|
function He(e, t, n) {
|
|
@@ -1131,8 +1144,8 @@ function He(e, t, n) {
|
|
|
1131
1144
|
event: e.event
|
|
1132
1145
|
})).sort((e, t) => e.start - t.start || e.end - t.end);
|
|
1133
1146
|
}
|
|
1134
|
-
function
|
|
1135
|
-
let r =
|
|
1147
|
+
function Q(e, t, n = Ve) {
|
|
1148
|
+
let r = Z(t, n), i = n.start, a = n.end;
|
|
1136
1149
|
for (let t of e) if (!(t.end <= t.start)) {
|
|
1137
1150
|
if (r >= t.start && r < t.end) return null;
|
|
1138
1151
|
t.end <= r ? i = Math.max(i, t.end) : a = Math.min(a, t.start);
|
|
@@ -1142,31 +1155,31 @@ function Z(e, t, n = Ve) {
|
|
|
1142
1155
|
end: a
|
|
1143
1156
|
} : null;
|
|
1144
1157
|
}
|
|
1145
|
-
function
|
|
1158
|
+
function Ue() {
|
|
1146
1159
|
return (e) => {
|
|
1147
1160
|
let t = e.slotDuration;
|
|
1148
1161
|
if (e.phase === "drag") {
|
|
1149
|
-
let n = X(
|
|
1162
|
+
let n = Z(X(e.anchorMinute ?? e.minute, t), e.bounds), r = Z(X(e.minute, t), e.bounds), i = {
|
|
1150
1163
|
start: Math.min(n, r),
|
|
1151
1164
|
end: Math.max(n, r)
|
|
1152
1165
|
};
|
|
1153
1166
|
return i.end > i.start ? i : null;
|
|
1154
1167
|
}
|
|
1155
|
-
let n =
|
|
1168
|
+
let n = Z(Math.floor(e.minute / t) * t, e.bounds), r = Math.min(e.bounds.end, n + t);
|
|
1156
1169
|
return r > n ? {
|
|
1157
1170
|
start: n,
|
|
1158
1171
|
end: r
|
|
1159
1172
|
} : null;
|
|
1160
1173
|
};
|
|
1161
1174
|
}
|
|
1162
|
-
function
|
|
1163
|
-
let t = Math.max(1, e.minutes), n =
|
|
1175
|
+
function We(e) {
|
|
1176
|
+
let t = Math.max(1, e.minutes), n = Ue();
|
|
1164
1177
|
return (r) => {
|
|
1165
1178
|
let i = r.slotDuration, a = r.bounds;
|
|
1166
1179
|
if (e.overlap) {
|
|
1167
1180
|
if (r.phase === "drag") return n(r);
|
|
1168
|
-
let e = X(
|
|
1169
|
-
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));
|
|
1170
1183
|
let o = Math.min(a.end, e + t);
|
|
1171
1184
|
return o > e ? {
|
|
1172
1185
|
start: e,
|
|
@@ -1174,19 +1187,19 @@ function Ue(e) {
|
|
|
1174
1187
|
} : null;
|
|
1175
1188
|
}
|
|
1176
1189
|
if (r.phase === "drag") {
|
|
1177
|
-
let e = r.anchorMinute ?? r.minute, t =
|
|
1190
|
+
let e = r.anchorMinute ?? r.minute, t = Q(r.busy, e, a);
|
|
1178
1191
|
if (!t) return null;
|
|
1179
|
-
let n = X(
|
|
1192
|
+
let n = Z(X(e, i), t), o = Z(X(r.minute, i), t), s = {
|
|
1180
1193
|
start: Math.min(n, o),
|
|
1181
1194
|
end: Math.max(n, o)
|
|
1182
1195
|
};
|
|
1183
1196
|
return s.end > s.start ? s : null;
|
|
1184
1197
|
}
|
|
1185
|
-
let o =
|
|
1198
|
+
let o = Q(r.busy, r.minute, a);
|
|
1186
1199
|
if (!o) return null;
|
|
1187
1200
|
let s = r.busy.some((e) => e.end === o.start), c = r.busy.some((e) => e.start === o.end);
|
|
1188
1201
|
if (s && c) return o;
|
|
1189
|
-
let l =
|
|
1202
|
+
let l = X(r.minute, i);
|
|
1190
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);
|
|
1191
1204
|
let u = Math.min(o.end, l + t);
|
|
1192
1205
|
return u > l ? {
|
|
@@ -1195,8 +1208,8 @@ function Ue(e) {
|
|
|
1195
1208
|
} : null;
|
|
1196
1209
|
};
|
|
1197
1210
|
}
|
|
1198
|
-
function
|
|
1199
|
-
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({
|
|
1200
1213
|
hour: Math.floor(s / 60),
|
|
1201
1214
|
minute: s % 60
|
|
1202
1215
|
}));
|
|
@@ -1208,7 +1221,7 @@ function We(e, t, n, r = "compatible") {
|
|
|
1208
1221
|
}
|
|
1209
1222
|
//#endregion
|
|
1210
1223
|
//#region src/core/agendaLayout.ts
|
|
1211
|
-
function
|
|
1224
|
+
function Ke(e, t) {
|
|
1212
1225
|
let { rangeStart: n, rangeEnd: i, timezone: s, showEmptyDays: c = !1 } = t, l = a.PlainDate.from(n), u = a.PlainDate.from(i);
|
|
1213
1226
|
if (a.PlainDate.compare(u, l) <= 0) return [];
|
|
1214
1227
|
let d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
|
|
@@ -1222,7 +1235,7 @@ function Ge(e, t) {
|
|
|
1222
1235
|
for (let t of e) {
|
|
1223
1236
|
if (f.has(t.id)) continue;
|
|
1224
1237
|
f.add(t.id);
|
|
1225
|
-
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;
|
|
1226
1239
|
if (a.PlainDate.compare(m, c) < 0) continue;
|
|
1227
1240
|
let h = c, g = !0;
|
|
1228
1241
|
for (; a.PlainDate.compare(h, m) <= 0;) {
|
|
@@ -1232,7 +1245,7 @@ function Ge(e, t) {
|
|
|
1232
1245
|
isContinuation: o
|
|
1233
1246
|
});
|
|
1234
1247
|
else {
|
|
1235
|
-
let e = o ? -Infinity :
|
|
1248
|
+
let e = o ? -Infinity : Je(t, s);
|
|
1236
1249
|
i.timed.push({
|
|
1237
1250
|
event: t,
|
|
1238
1251
|
startMs: e,
|
|
@@ -1272,7 +1285,7 @@ function Ge(e, t) {
|
|
|
1272
1285
|
}
|
|
1273
1286
|
return m;
|
|
1274
1287
|
}
|
|
1275
|
-
function
|
|
1288
|
+
function qe(e, t) {
|
|
1276
1289
|
if (o(e)) {
|
|
1277
1290
|
let t = e.start, n;
|
|
1278
1291
|
return e.end ? (n = e.end.subtract({ days: 1 }), a.PlainDate.compare(n, t) < 0 && (n = t)) : n = t, {
|
|
@@ -1290,15 +1303,15 @@ function Ke(e, t) {
|
|
|
1290
1303
|
lastDayInclusive: r
|
|
1291
1304
|
};
|
|
1292
1305
|
}
|
|
1293
|
-
function
|
|
1306
|
+
function Je(e, t) {
|
|
1294
1307
|
return o(e) ? e.start.toZonedDateTime({ timeZone: t }).epochMilliseconds : e.start.epochMilliseconds;
|
|
1295
1308
|
}
|
|
1296
1309
|
//#endregion
|
|
1297
1310
|
//#region src/core/timelineLayout.ts
|
|
1298
|
-
function
|
|
1311
|
+
function Ye(e, t) {
|
|
1299
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();
|
|
1300
1313
|
for (let t of e) {
|
|
1301
|
-
let e =
|
|
1314
|
+
let e = Ze(t), n = Xe(t) !== null, r = c.get(e);
|
|
1302
1315
|
r || (r = {
|
|
1303
1316
|
events: [],
|
|
1304
1317
|
isRecurring: n
|
|
@@ -1308,7 +1321,7 @@ function Je(e, t) {
|
|
|
1308
1321
|
for (let [e, t] of c) {
|
|
1309
1322
|
let a = [];
|
|
1310
1323
|
for (let e of t.events) {
|
|
1311
|
-
let { startDate: t, endDate: s } =
|
|
1324
|
+
let { startDate: t, endDate: s } = Qe(e, o);
|
|
1312
1325
|
if (u.PlainDate.compare(s, n) <= 0 || u.PlainDate.compare(t, r) >= 0) continue;
|
|
1313
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;
|
|
1314
1327
|
a.push({
|
|
@@ -1340,14 +1353,14 @@ function Je(e, t) {
|
|
|
1340
1353
|
totalHeight: d.length * a
|
|
1341
1354
|
};
|
|
1342
1355
|
}
|
|
1343
|
-
function
|
|
1356
|
+
function Xe(e) {
|
|
1344
1357
|
let t = e.meta?.__recurrence?.seriesId;
|
|
1345
1358
|
return typeof t == "string" ? t : null;
|
|
1346
1359
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return
|
|
1360
|
+
function Ze(e) {
|
|
1361
|
+
return Xe(e) ?? e.id;
|
|
1349
1362
|
}
|
|
1350
|
-
function
|
|
1363
|
+
function Qe(e, t) {
|
|
1351
1364
|
if (e.start instanceof u.PlainDate) {
|
|
1352
1365
|
let t = e.start;
|
|
1353
1366
|
return {
|
|
@@ -1363,7 +1376,7 @@ function Ze(e, t) {
|
|
|
1363
1376
|
}
|
|
1364
1377
|
//#endregion
|
|
1365
1378
|
//#region src/core/measurementCache.ts
|
|
1366
|
-
var
|
|
1379
|
+
var $e = class {
|
|
1367
1380
|
_itemCount;
|
|
1368
1381
|
_estimatedSize;
|
|
1369
1382
|
_measured;
|
|
@@ -1462,20 +1475,20 @@ function $(e, t, n, r = 3) {
|
|
|
1462
1475
|
totalSize: i
|
|
1463
1476
|
};
|
|
1464
1477
|
}
|
|
1465
|
-
function
|
|
1478
|
+
function et(e, t, n, r, i, a, o = 3, s = 3) {
|
|
1466
1479
|
return {
|
|
1467
1480
|
x: $(e, n, i, o),
|
|
1468
1481
|
y: $(t, r, a, s)
|
|
1469
1482
|
};
|
|
1470
1483
|
}
|
|
1471
|
-
function
|
|
1484
|
+
function tt(e, t, n) {
|
|
1472
1485
|
if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
|
|
1473
1486
|
let r = e.prefixSum(n);
|
|
1474
1487
|
return t.prefixSum(n) - r;
|
|
1475
1488
|
}
|
|
1476
1489
|
//#endregion
|
|
1477
1490
|
//#region src/core/dragHitTest.ts
|
|
1478
|
-
function
|
|
1491
|
+
function nt(e, t, n, r, i) {
|
|
1479
1492
|
if (r.itemCount === 0) return {
|
|
1480
1493
|
itemIndex: -1,
|
|
1481
1494
|
ratio: NaN,
|
|
@@ -1506,7 +1519,7 @@ function tt(e, t, n, r, i) {
|
|
|
1506
1519
|
pixelInItem: u
|
|
1507
1520
|
};
|
|
1508
1521
|
}
|
|
1509
|
-
function
|
|
1522
|
+
function rt(e, t, n, r = {}) {
|
|
1510
1523
|
let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
|
|
1511
1524
|
if (i <= 0 || a <= 0) return {
|
|
1512
1525
|
velocityX: 0,
|
|
@@ -1530,4 +1543,4 @@ function nt(e, t, n, r = {}) {
|
|
|
1530
1543
|
};
|
|
1531
1544
|
}
|
|
1532
1545
|
//#endregion
|
|
1533
|
-
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 };
|