@cocoar/vue-calendar 3.2.0-beta.11 → 3.2.0-beta.46
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-config.d.ts +46 -2
- package/dist/builders/calendar-builder-config.d.ts.map +1 -1
- package/dist/builders/calendar-builder-handlers.d.ts +26 -1
- package/dist/builders/calendar-builder-handlers.d.ts.map +1 -1
- package/dist/builders/calendar-builder-state.d.ts +40 -2
- package/dist/builders/calendar-builder-state.d.ts.map +1 -1
- package/dist/builders/calendar-builder.d.ts.map +1 -1
- package/dist/builders/internal/navigation.d.ts +3 -2
- package/dist/builders/internal/navigation.d.ts.map +1 -1
- package/dist/builders/internal/series-pipeline.d.ts.map +1 -1
- package/dist/builders/types.d.ts +77 -1
- 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 +13 -1
- package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
- package/dist/components/CoarContinuousMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarDayView.vue.d.ts +13 -0
- package/dist/components/CoarDayView.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthListView.vue.d.ts.map +1 -1
- package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
- package/dist/components/CoarTimeGrid.vue.d.ts +13 -0
- package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
- package/dist/components/CoarWeekView.vue.d.ts +13 -0
- package/dist/components/CoarWeekView.vue.d.ts.map +1 -1
- package/dist/components/CoarWorkWeekView.vue.d.ts +13 -0
- package/dist/components/CoarWorkWeekView.vue.d.ts.map +1 -1
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts +7 -0
- package/dist/components/internal/month/CoarMonthCell.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarCalendarBands.vue.d.ts +16 -0
- package/dist/components/internal/time-grid/CoarCalendarBands.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeAxisMarker.vue.d.ts +8 -0
- package/dist/components/internal/time-grid/CoarTimeAxisMarker.vue.d.ts.map +1 -0
- package/dist/components/internal/time-grid/CoarTimeGridNowMarker.vue.d.ts +15 -8
- package/dist/components/internal/time-grid/CoarTimeGridNowMarker.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts +13 -0
- package/dist/components/internal/time-grid/CoarTimeGridSurface.vue.d.ts.map +1 -1
- package/dist/components/internal/time-grid/CoarTimeSelectionLayer.vue.d.ts +37 -0
- package/dist/components/internal/time-grid/CoarTimeSelectionLayer.vue.d.ts.map +1 -0
- package/dist/components/internal/time-rows/CoarTimeRows.vue.d.ts +67 -0
- package/dist/components/internal/time-rows/CoarTimeRows.vue.d.ts.map +1 -0
- package/dist/components/internal/time-rows/CoarTimeRowsEvent.vue.d.ts +61 -0
- package/dist/components/internal/time-rows/CoarTimeRowsEvent.vue.d.ts.map +1 -0
- package/dist/composables/surfaceTap.d.ts +38 -0
- package/dist/composables/surfaceTap.d.ts.map +1 -0
- package/dist/composables/useCalendarDnd.d.ts +50 -0
- package/dist/composables/useCalendarDnd.d.ts.map +1 -1
- package/dist/composables/useTimeGridDnd.d.ts +9 -1
- package/dist/composables/useTimeGridDnd.d.ts.map +1 -1
- package/dist/composables/useTimeGridOverlays.d.ts +74 -0
- package/dist/composables/useTimeGridOverlays.d.ts.map +1 -0
- package/dist/composables/useTimeGridPresentation.d.ts +215 -0
- package/dist/composables/useTimeGridPresentation.d.ts.map +1 -0
- package/dist/composables/useTimeGridSwipe.d.ts +5 -0
- package/dist/composables/useTimeGridSwipe.d.ts.map +1 -1
- package/dist/composables/useTimeSelection.d.ts +38 -0
- package/dist/composables/useTimeSelection.d.ts.map +1 -0
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/monthGridLayout.d.ts.map +1 -1
- package/dist/core/timeRowsLayout.d.ts +57 -0
- package/dist/core/timeRowsLayout.d.ts.map +1 -0
- package/dist/core/timeSelection.d.ts +92 -0
- package/dist/core/timeSelection.d.ts.map +1 -0
- package/dist/core/types.d.ts +8 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/{core-DNwsMOSU.js → core-C3yGErWV.js} +230 -108
- package/dist/core.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3412 -1845
- package/dist/vue-calendar.css +1 -1
- package/package.json +3 -3
|
@@ -81,13 +81,13 @@ function b(e) {
|
|
|
81
81
|
function x(e, t) {
|
|
82
82
|
return e instanceof r.PlainDate ? e : e.withTimeZone(t).toPlainDate();
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function S(e) {
|
|
85
85
|
return r.Now.plainDateISO(e);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function ee(e) {
|
|
88
88
|
return r.Now.zonedDateTimeISO(e);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function te(e) {
|
|
91
91
|
let { local: t, timeZoneId: n, dstPolicy: i = "compatible" } = e, a;
|
|
92
92
|
try {
|
|
93
93
|
a = r.PlainDateTime.from(t);
|
|
@@ -103,14 +103,14 @@ function C(e) {
|
|
|
103
103
|
}
|
|
104
104
|
return o;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ne(e) {
|
|
107
107
|
try {
|
|
108
108
|
return r.PlainDate.from(e);
|
|
109
109
|
} catch (t) {
|
|
110
110
|
throw RangeError(`[parsePlainDate] iso='${e}' is not a parseable ISO-8601 date (${t.message}). Expected format: 'YYYY-MM-DD'.`, { cause: t });
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function C(e) {
|
|
114
114
|
return {
|
|
115
115
|
local: e.toPlainDateTime().toString(),
|
|
116
116
|
timeZoneId: e.timeZoneId
|
|
@@ -118,7 +118,7 @@ function T(e) {
|
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/core/timeGridRange.ts
|
|
121
|
-
var
|
|
121
|
+
var w = {
|
|
122
122
|
daySingle: {
|
|
123
123
|
anchor: "cursor",
|
|
124
124
|
span: 1,
|
|
@@ -144,41 +144,41 @@ var E = {
|
|
|
144
144
|
step: 7
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
function
|
|
148
|
-
return e === "week" ?
|
|
147
|
+
function T(e, t = {}) {
|
|
148
|
+
return e === "week" ? w.week : e === "workWeek" ? w.workWeek : t.explicit ? t.explicit : t.dayMode === "multiDay" ? w.dayMulti : w.daySingle;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
let { spec: t, cursor: n, firstDayOfWeek: r, workDays: a } = e, o = t.anchor === "weekStart" ? d(n, r) : n, s =
|
|
150
|
+
function E(e) {
|
|
151
|
+
let { spec: t, cursor: n, firstDayOfWeek: r, workDays: a } = e, o = t.anchor === "weekStart" ? d(n, r) : n, s = D(t, e.responsiveColumns), c = Array.from({ length: s }, (e, t) => o.add({ days: t }));
|
|
152
152
|
return {
|
|
153
153
|
start: o,
|
|
154
154
|
spanDays: s,
|
|
155
155
|
days: t.filter === "workDays" ? c.filter((e) => a.includes(i(e.dayOfWeek))) : c,
|
|
156
|
-
stepDays:
|
|
156
|
+
stepDays: O(t, s)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function D(e, t) {
|
|
160
160
|
return e.span === "responsive" ? Math.max(1, Math.floor(t)) : Math.max(1, Math.floor(e.span));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function O(e, t) {
|
|
163
163
|
return e.step === "span" ? Math.max(1, t) : Math.max(1, Math.floor(e.step));
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/core/viewWindow.ts
|
|
167
|
-
var
|
|
167
|
+
var re = [
|
|
168
168
|
1,
|
|
169
169
|
2,
|
|
170
170
|
3,
|
|
171
171
|
4,
|
|
172
172
|
5
|
|
173
173
|
];
|
|
174
|
-
function
|
|
174
|
+
function ie(e) {
|
|
175
175
|
let { view: t, cursor: r, firstDayOfWeek: i, timezone: a } = e;
|
|
176
176
|
switch (t) {
|
|
177
177
|
case "day":
|
|
178
178
|
case "week":
|
|
179
179
|
case "workWeek": {
|
|
180
|
-
let n =
|
|
181
|
-
spec:
|
|
180
|
+
let n = E({
|
|
181
|
+
spec: T(t, {
|
|
182
182
|
dayMode: "multiDay",
|
|
183
183
|
explicit: t === "day" ? e.timeGridRange ?? null : null
|
|
184
184
|
}),
|
|
@@ -261,19 +261,19 @@ function ne(e) {
|
|
|
261
261
|
default: throw Error(`Unsupported view: ${String(t)}`);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
function*
|
|
264
|
+
function* ae(e) {
|
|
265
265
|
let t = n.PlainDate.from(e.start), r = n.PlainDate.from(e.end);
|
|
266
266
|
for (; n.PlainDate.compare(t, r) < 0;) yield t, t = t.add({ days: 1 });
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function oe(e) {
|
|
269
269
|
let t = n.PlainDate.from(e.start);
|
|
270
270
|
return n.PlainDate.from(e.end).since(t, { largestUnit: "days" }).days;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function k(e, t) {
|
|
273
273
|
let r = n.PlainDate.from(e.start), i = n.PlainDate.from(e.end);
|
|
274
274
|
return n.PlainDate.compare(t, r) >= 0 && n.PlainDate.compare(t, i) < 0;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function A(e, t, n, r = 30, i = 60, a = 1) {
|
|
277
277
|
let o = n === "next" ? 1 : -1;
|
|
278
278
|
switch (e) {
|
|
279
279
|
case "day": return t.add({ days: Math.max(1, a) * o });
|
|
@@ -317,7 +317,7 @@ var ce = {
|
|
|
317
317
|
function M(e) {
|
|
318
318
|
return new Date(Date.UTC(e.year, e.month - 1, e.day));
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function ue(e) {
|
|
321
321
|
let { view: t, window: r, cursor: i, locale: a } = e, o = {
|
|
322
322
|
dateStyle: e.dateStyle,
|
|
323
323
|
timeStyle: e.timeStyle,
|
|
@@ -338,15 +338,15 @@ function N(e) {
|
|
|
338
338
|
}
|
|
339
339
|
//#endregion
|
|
340
340
|
//#region src/core/timedCardAnatomy.ts
|
|
341
|
-
var
|
|
341
|
+
var de = 112, fe = Object.freeze({
|
|
342
342
|
compact: !0,
|
|
343
343
|
titleLines: 1,
|
|
344
344
|
showLocation: !1,
|
|
345
345
|
showTime: !1
|
|
346
346
|
});
|
|
347
|
-
function
|
|
347
|
+
function pe(e) {
|
|
348
348
|
let { durationMinutes: t, visibleWidthPx: n, detailMinWidth: r, overlapped: i, hasLocation: a } = e;
|
|
349
|
-
return i && r > 0 && n !== null && n < r ?
|
|
349
|
+
return i && r > 0 && n !== null && n < r ? fe : {
|
|
350
350
|
compact: !1,
|
|
351
351
|
titleLines: t >= 70 ? 2 : 1,
|
|
352
352
|
showLocation: a && t >= 34,
|
|
@@ -355,8 +355,8 @@ function I(e) {
|
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region src/core/allDayBandCap.ts
|
|
358
|
-
var
|
|
359
|
-
function
|
|
358
|
+
var me = 3;
|
|
359
|
+
function he(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
|
|
360
360
|
let i = e.length === 0 ? 0 : e[0].laneCount, a = t === null ? null : Math.max(1, Math.floor(t)), o = a !== null && i > a;
|
|
361
361
|
if (!o || n) return {
|
|
362
362
|
bars: [...e],
|
|
@@ -385,7 +385,7 @@ function R(e, { maxVisibleLanes: t, expanded: n, columnCount: r }) {
|
|
|
385
385
|
exceedsCap: o
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function ge(e, t, n) {
|
|
389
389
|
switch (t) {
|
|
390
390
|
case "alwaysOneLane": return Math.max(1, e);
|
|
391
391
|
case "reservesCap": return Math.max(n ?? 0, e);
|
|
@@ -394,7 +394,7 @@ function z(e, t, n) {
|
|
|
394
394
|
}
|
|
395
395
|
//#endregion
|
|
396
396
|
//#region src/core/cascadeLayout.ts
|
|
397
|
-
function
|
|
397
|
+
function N(e, t = 100, n = 1.5, r = 18) {
|
|
398
398
|
let i = /* @__PURE__ */ new Map();
|
|
399
399
|
if (!Number.isFinite(t) || t <= 0 || e.length === 0) return i;
|
|
400
400
|
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) => ({
|
|
@@ -433,26 +433,26 @@ function B(e, t = 100, n = 1.5, r = 18) {
|
|
|
433
433
|
}
|
|
434
434
|
return i;
|
|
435
435
|
}
|
|
436
|
-
var
|
|
437
|
-
function
|
|
438
|
-
let n = typeof t == "string" ? { fallback: t } : t, r =
|
|
439
|
-
return r ? (n.policy ?? "wcag") === "apca" ?
|
|
436
|
+
var P = "#ffffff", F = "#000000", I = "var(--coar-text-base, #1a1c1f)";
|
|
437
|
+
function L(e, t = {}) {
|
|
438
|
+
let n = typeof t == "string" ? { fallback: t } : t, r = be(e);
|
|
439
|
+
return r ? (n.policy ?? "wcag") === "apca" ? ye(r) : ve(r) : n.fallback ?? I;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
441
|
+
function _e({ background: e, textColor: t, policy: n, fallback: r }) {
|
|
442
|
+
return typeof t == "string" && t.trim() !== "" ? t : L(e, {
|
|
443
443
|
policy: n,
|
|
444
444
|
fallback: r
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
let t = .2126 *
|
|
449
|
-
return 1.05 / (t + .05) >= (t + .05) / .05 ?
|
|
447
|
+
function ve(e) {
|
|
448
|
+
let t = .2126 * R(e[0]) + .7152 * R(e[1]) + .0722 * R(e[2]);
|
|
449
|
+
return 1.05 / (t + .05) >= (t + .05) / .05 ? P : F;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function R(e) {
|
|
452
452
|
let t = e / 255;
|
|
453
453
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
454
454
|
}
|
|
455
|
-
var
|
|
455
|
+
var z = {
|
|
456
456
|
exponent: 2.4,
|
|
457
457
|
blackThreshold: .022,
|
|
458
458
|
blackClamp: 1.414,
|
|
@@ -464,31 +464,31 @@ var K = {
|
|
|
464
464
|
loClip: .1,
|
|
465
465
|
loOffset: .027
|
|
466
466
|
};
|
|
467
|
-
function
|
|
468
|
-
let t = (e) => (e / 255) **
|
|
469
|
-
return n <
|
|
467
|
+
function B(e) {
|
|
468
|
+
let t = (e) => (e / 255) ** z.exponent, n = .2126729 * t(e[0]) + .7151522 * t(e[1]) + .072175 * t(e[2]);
|
|
469
|
+
return n < z.blackThreshold ? n + (z.blackThreshold - n) ** z.blackClamp : n;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
472
|
-
let n =
|
|
471
|
+
function V(e, t) {
|
|
472
|
+
let n = B(e), r = B(t);
|
|
473
473
|
if (r > n) {
|
|
474
|
-
let e = (r **
|
|
475
|
-
return e <
|
|
474
|
+
let e = (r ** z.normBg - n ** z.normText) * z.scale;
|
|
475
|
+
return e < z.loClip ? 0 : (e - z.loOffset) * 100;
|
|
476
476
|
}
|
|
477
|
-
let i = (r **
|
|
478
|
-
return i > -
|
|
477
|
+
let i = (r ** z.revBg - n ** z.revText) * z.scale;
|
|
478
|
+
return i > -z.loClip ? 0 : (i + z.loOffset) * 100;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return Math.abs(
|
|
480
|
+
function ye(e) {
|
|
481
|
+
return Math.abs(V([
|
|
482
482
|
255,
|
|
483
483
|
255,
|
|
484
484
|
255
|
|
485
|
-
], e)) >= Math.abs(
|
|
485
|
+
], e)) >= Math.abs(V([
|
|
486
486
|
0,
|
|
487
487
|
0,
|
|
488
488
|
0
|
|
489
|
-
], e)) ?
|
|
489
|
+
], e)) ? P : F;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function be(e) {
|
|
492
492
|
let t = e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i);
|
|
493
493
|
if (!t) return null;
|
|
494
494
|
let n = t[1].length === 3 ? [...t[1]].map((e) => e + e).join("") : t[1];
|
|
@@ -500,7 +500,7 @@ function pe(e) {
|
|
|
500
500
|
}
|
|
501
501
|
//#endregion
|
|
502
502
|
//#region src/core/overlapLayout.ts
|
|
503
|
-
function
|
|
503
|
+
function xe(e, t) {
|
|
504
504
|
e.push(t);
|
|
505
505
|
let n = e.length - 1;
|
|
506
506
|
for (; n > 0;) {
|
|
@@ -509,7 +509,7 @@ function me(e, t) {
|
|
|
509
509
|
[e[t], e[n]] = [e[n], e[t]], n = t;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Se(e) {
|
|
513
513
|
let t = e[0], n = e.pop();
|
|
514
514
|
if (e.length > 0) {
|
|
515
515
|
e[0] = n;
|
|
@@ -522,7 +522,7 @@ function he(e) {
|
|
|
522
522
|
}
|
|
523
523
|
return t;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Ce(e, t, n, r) {
|
|
526
526
|
e.push(n), t.push(r);
|
|
527
527
|
let i = e.length - 1;
|
|
528
528
|
for (; i > 0;) {
|
|
@@ -531,10 +531,10 @@ function ge(e, t, n, r) {
|
|
|
531
531
|
[e[n], e[i]] = [e[i], e[n]], [t[n], t[i]] = [t[i], t[n]], i = n;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function we(e) {
|
|
535
535
|
return e.length > 0 ? e[0] : Infinity;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Te(e, t) {
|
|
538
538
|
let n = {
|
|
539
539
|
end: e[0],
|
|
540
540
|
lane: t[0]
|
|
@@ -550,7 +550,7 @@ function ve(e, t) {
|
|
|
550
550
|
}
|
|
551
551
|
return n;
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function H(e) {
|
|
554
554
|
let t = e.length;
|
|
555
555
|
if (t === 0) return {
|
|
556
556
|
bars: [],
|
|
@@ -566,12 +566,12 @@ function Y(e) {
|
|
|
566
566
|
let r = [], i = [], a = [], o = 0, s = Array(t);
|
|
567
567
|
for (let e = 0; e < t; e++) {
|
|
568
568
|
let t = n[e];
|
|
569
|
-
for (;
|
|
570
|
-
let { lane: e } =
|
|
571
|
-
|
|
569
|
+
for (; we(r) < t.start;) {
|
|
570
|
+
let { lane: e } = Te(r, i);
|
|
571
|
+
xe(a, e);
|
|
572
572
|
}
|
|
573
573
|
let c;
|
|
574
|
-
c = a.length > 0 ?
|
|
574
|
+
c = a.length > 0 ? Se(a) : o++, Ce(r, i, t.end, c), s[e] = {
|
|
575
575
|
id: t.id,
|
|
576
576
|
lane: c,
|
|
577
577
|
start: t.start,
|
|
@@ -585,14 +585,14 @@ function Y(e) {
|
|
|
585
585
|
}
|
|
586
586
|
//#endregion
|
|
587
587
|
//#region src/core/timeGridLayout.ts
|
|
588
|
-
function
|
|
588
|
+
function U(e, n) {
|
|
589
589
|
let { day: r, timeRange: i, timezone: a } = n, [o, s] = i, c = o * 60, l = s * 60;
|
|
590
590
|
if (l - c <= 0) return [];
|
|
591
591
|
let u = [], d = /* @__PURE__ */ new Set();
|
|
592
592
|
for (let n of e) {
|
|
593
593
|
if (d.has(n.id) || (d.add(n.id), !t(n))) continue;
|
|
594
|
-
let e =
|
|
595
|
-
if (n.end) i =
|
|
594
|
+
let e = W(n.start, r, a), i;
|
|
595
|
+
if (n.end) i = W(n.end, r, a);
|
|
596
596
|
else {
|
|
597
597
|
if (e < 0) continue;
|
|
598
598
|
i = e + 30;
|
|
@@ -615,7 +615,7 @@ function ye(e, n) {
|
|
|
615
615
|
m.length > 0 && p.push(m);
|
|
616
616
|
let g = /* @__PURE__ */ new Map();
|
|
617
617
|
for (let e of p) {
|
|
618
|
-
let t =
|
|
618
|
+
let t = H(e.map((e) => ({
|
|
619
619
|
id: e.event.id,
|
|
620
620
|
start: e.startMinutes,
|
|
621
621
|
end: Math.max(e.startMinutes, e.endMinutes - 1)
|
|
@@ -651,7 +651,7 @@ function ye(e, n) {
|
|
|
651
651
|
};
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Ee(t, n) {
|
|
655
655
|
let { days: i } = n;
|
|
656
656
|
if (n.timezone, i.length === 0) return [];
|
|
657
657
|
let a = /* @__PURE__ */ new Map();
|
|
@@ -674,7 +674,7 @@ function be(t, n) {
|
|
|
674
674
|
});
|
|
675
675
|
}
|
|
676
676
|
if (o.length === 0) return [];
|
|
677
|
-
let c =
|
|
677
|
+
let c = H(o.map((e) => ({
|
|
678
678
|
id: e.event.id,
|
|
679
679
|
start: e.startCol,
|
|
680
680
|
end: e.endCol
|
|
@@ -690,7 +690,7 @@ function be(t, n) {
|
|
|
690
690
|
clippedEnd: e.clippedEnd
|
|
691
691
|
}));
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function W(e, t, n) {
|
|
694
694
|
let i = e.withTimeZone(n), a = r.PlainDateTime.from({
|
|
695
695
|
year: t.year,
|
|
696
696
|
month: t.month,
|
|
@@ -701,16 +701,114 @@ function X(e, t, n) {
|
|
|
701
701
|
return r.ZonedDateTime.compare(i, a) < 0 ? -1 : r.ZonedDateTime.compare(i, o) >= 0 ? 1441 : i.hour * 60 + i.minute + i.second / 60;
|
|
702
702
|
}
|
|
703
703
|
//#endregion
|
|
704
|
+
//#region src/core/timeSelection.ts
|
|
705
|
+
var G = 1440, De = {
|
|
706
|
+
start: 0,
|
|
707
|
+
end: G
|
|
708
|
+
};
|
|
709
|
+
function K(e, t) {
|
|
710
|
+
return t <= 0 ? e : Math.round(e / t) * t;
|
|
711
|
+
}
|
|
712
|
+
function q(e, t) {
|
|
713
|
+
return Math.min(t.end, Math.max(t.start, e));
|
|
714
|
+
}
|
|
715
|
+
function Oe(e, t, n) {
|
|
716
|
+
return U(e, {
|
|
717
|
+
day: t,
|
|
718
|
+
timeRange: [0, 24],
|
|
719
|
+
timezone: n
|
|
720
|
+
}).map((e) => ({
|
|
721
|
+
start: e.startMinutes,
|
|
722
|
+
end: e.endMinutes,
|
|
723
|
+
event: e.event
|
|
724
|
+
})).sort((e, t) => e.start - t.start || e.end - t.end);
|
|
725
|
+
}
|
|
726
|
+
function J(e, t, n = De) {
|
|
727
|
+
let r = q(t, n), i = n.start, a = n.end;
|
|
728
|
+
for (let t of e) if (!(t.end <= t.start)) {
|
|
729
|
+
if (r >= t.start && r < t.end) return null;
|
|
730
|
+
t.end <= r ? i = Math.max(i, t.end) : a = Math.min(a, t.start);
|
|
731
|
+
}
|
|
732
|
+
return a > i ? {
|
|
733
|
+
start: i,
|
|
734
|
+
end: a
|
|
735
|
+
} : null;
|
|
736
|
+
}
|
|
737
|
+
function Y() {
|
|
738
|
+
return (e) => {
|
|
739
|
+
let t = e.slotDuration;
|
|
740
|
+
if (e.phase === "drag") {
|
|
741
|
+
let n = q(K(e.anchorMinute ?? e.minute, t), e.bounds), r = q(K(e.minute, t), e.bounds), i = {
|
|
742
|
+
start: Math.min(n, r),
|
|
743
|
+
end: Math.max(n, r)
|
|
744
|
+
};
|
|
745
|
+
return i.end > i.start ? i : null;
|
|
746
|
+
}
|
|
747
|
+
let n = q(Math.floor(e.minute / t) * t, e.bounds), r = Math.min(e.bounds.end, n + t);
|
|
748
|
+
return r > n ? {
|
|
749
|
+
start: n,
|
|
750
|
+
end: r
|
|
751
|
+
} : null;
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function ke(e) {
|
|
755
|
+
let t = Math.max(1, e.minutes), n = Y();
|
|
756
|
+
return (r) => {
|
|
757
|
+
let i = r.slotDuration, a = r.bounds;
|
|
758
|
+
if (e.overlap) {
|
|
759
|
+
if (r.phase === "drag") return n(r);
|
|
760
|
+
let e = q(K(r.minute, i), a);
|
|
761
|
+
e >= a.end && (e = q(Math.floor(r.minute / i) * i, a));
|
|
762
|
+
let o = Math.min(a.end, e + t);
|
|
763
|
+
return o > e ? {
|
|
764
|
+
start: e,
|
|
765
|
+
end: o
|
|
766
|
+
} : null;
|
|
767
|
+
}
|
|
768
|
+
if (r.phase === "drag") {
|
|
769
|
+
let e = r.anchorMinute ?? r.minute, t = J(r.busy, e, a);
|
|
770
|
+
if (!t) return null;
|
|
771
|
+
let n = q(K(e, i), t), o = q(K(r.minute, i), t), s = {
|
|
772
|
+
start: Math.min(n, o),
|
|
773
|
+
end: Math.max(n, o)
|
|
774
|
+
};
|
|
775
|
+
return s.end > s.start ? s : null;
|
|
776
|
+
}
|
|
777
|
+
let o = J(r.busy, r.minute, a);
|
|
778
|
+
if (!o) return null;
|
|
779
|
+
let s = r.busy.some((e) => e.end === o.start), c = r.busy.some((e) => e.start === o.end);
|
|
780
|
+
if (s && c) return o;
|
|
781
|
+
let l = K(r.minute, i);
|
|
782
|
+
l >= o.end && (l = Math.floor(r.minute / i) * i), l = Math.max(o.start, l), s && l - o.start < i && (l = o.start);
|
|
783
|
+
let u = Math.min(o.end, l + t);
|
|
784
|
+
return u > l ? {
|
|
785
|
+
start: l,
|
|
786
|
+
end: u
|
|
787
|
+
} : null;
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
function Ae(e, t, n, i = "compatible") {
|
|
791
|
+
let a = Math.round(t), o = a >= G ? e.add({ days: Math.floor(a / G) }) : e, s = a >= G ? a % G : Math.max(0, a), c = o.toPlainDateTime(r.PlainTime.from({
|
|
792
|
+
hour: Math.floor(s / 60),
|
|
793
|
+
minute: s % 60
|
|
794
|
+
}));
|
|
795
|
+
try {
|
|
796
|
+
return c.toZonedDateTime(n, { disambiguation: i });
|
|
797
|
+
} catch {
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
//#endregion
|
|
704
802
|
//#region src/core/monthGridLayout.ts
|
|
705
|
-
var
|
|
706
|
-
function
|
|
803
|
+
var je = 2, Me = 6;
|
|
804
|
+
function Ne(e, t) {
|
|
707
805
|
switch (e) {
|
|
708
806
|
case "compact": return 6;
|
|
709
807
|
case "stacked": return 2;
|
|
710
808
|
default: return t;
|
|
711
809
|
}
|
|
712
810
|
}
|
|
713
|
-
function
|
|
811
|
+
function Pe(e, t) {
|
|
714
812
|
if (!Number.isFinite(t) || t < 0) return {
|
|
715
813
|
visible: e,
|
|
716
814
|
hidden: 0
|
|
@@ -724,8 +822,8 @@ function we(e, t) {
|
|
|
724
822
|
hidden: e.length - n
|
|
725
823
|
};
|
|
726
824
|
}
|
|
727
|
-
var
|
|
728
|
-
function
|
|
825
|
+
var Fe = 2;
|
|
826
|
+
function Ie(e, t) {
|
|
729
827
|
let n = e.length ? e[0].laneCount : 0, r = t === null || !Number.isFinite(t) || t < 0 ? n : Math.floor(t);
|
|
730
828
|
if (n <= r) return {
|
|
731
829
|
visible: e,
|
|
@@ -765,7 +863,7 @@ function Ee(e, t) {
|
|
|
765
863
|
laneCount: r
|
|
766
864
|
};
|
|
767
865
|
}
|
|
768
|
-
function
|
|
866
|
+
function Le(e, t) {
|
|
769
867
|
let { gridDates: n, timezone: i } = t;
|
|
770
868
|
if (n.length < 7 || n.length % 7 != 0) throw RangeError(`gridDates must contain complete seven-day rows (got ${n.length})`);
|
|
771
869
|
let a = [];
|
|
@@ -780,22 +878,24 @@ function De(e, t) {
|
|
|
780
878
|
weekEnd: t[6]
|
|
781
879
|
});
|
|
782
880
|
}
|
|
783
|
-
let o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map();
|
|
784
|
-
for (let
|
|
785
|
-
if (o.has(
|
|
786
|
-
o.add(
|
|
787
|
-
let
|
|
788
|
-
if (l)
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
881
|
+
let o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = X(n[0]), u = X(n[n.length - 1]), d = t.visibleStart ? X(t.visibleStart) : -Infinity, f = t.visibleEnd ? X(t.visibleEnd) : Infinity;
|
|
882
|
+
for (let t of e) {
|
|
883
|
+
if (o.has(t.id)) continue;
|
|
884
|
+
o.add(t.id);
|
|
885
|
+
let e = Re(t, i);
|
|
886
|
+
if (e.lastOrd < l || e.firstOrd > u) continue;
|
|
887
|
+
let { firstDay: n, lastDayInclusive: r, isMultiDay: a } = e;
|
|
888
|
+
if (a) s.push({
|
|
889
|
+
event: t,
|
|
890
|
+
firstDay: n,
|
|
891
|
+
lastDayInclusive: r
|
|
792
892
|
});
|
|
793
|
-
else if (
|
|
794
|
-
let
|
|
795
|
-
event:
|
|
893
|
+
else if (e.firstOrd >= d && e.firstOrd <= f) {
|
|
894
|
+
let n = e.firstKey, r = c.get(n), i = {
|
|
895
|
+
event: t,
|
|
796
896
|
order: r ? r.length : 0
|
|
797
897
|
};
|
|
798
|
-
r ? r.push(i) : c.set(
|
|
898
|
+
r ? r.push(i) : c.set(n, [i]);
|
|
799
899
|
}
|
|
800
900
|
}
|
|
801
901
|
return { weekRows: a.map((e) => {
|
|
@@ -823,7 +923,7 @@ function De(e, t) {
|
|
|
823
923
|
}
|
|
824
924
|
let i = [];
|
|
825
925
|
if (n.length > 0) {
|
|
826
|
-
let e =
|
|
926
|
+
let e = H(n.map((e) => ({
|
|
827
927
|
id: e.event.id,
|
|
828
928
|
start: e.startCol,
|
|
829
929
|
end: e.endCol
|
|
@@ -854,7 +954,29 @@ function De(e, t) {
|
|
|
854
954
|
};
|
|
855
955
|
}) };
|
|
856
956
|
}
|
|
857
|
-
function
|
|
957
|
+
function X(e) {
|
|
958
|
+
return e.year * 1e4 + e.month * 100 + e.day;
|
|
959
|
+
}
|
|
960
|
+
var Z = /* @__PURE__ */ new WeakMap();
|
|
961
|
+
function Re(e, t) {
|
|
962
|
+
let n = Z.get(e);
|
|
963
|
+
if (n && n.start === e.start && n.end === e.end && n.timezone === t) return n.bounds;
|
|
964
|
+
let { firstDay: r, lastDayInclusive: i, isMultiDay: a } = ze(e, t), o = {
|
|
965
|
+
firstDay: r,
|
|
966
|
+
lastDayInclusive: i,
|
|
967
|
+
isMultiDay: a,
|
|
968
|
+
firstOrd: X(r),
|
|
969
|
+
lastOrd: X(i),
|
|
970
|
+
firstKey: b(r)
|
|
971
|
+
};
|
|
972
|
+
return Z.set(e, {
|
|
973
|
+
start: e.start,
|
|
974
|
+
end: e.end,
|
|
975
|
+
timezone: t,
|
|
976
|
+
bounds: o
|
|
977
|
+
}), o;
|
|
978
|
+
}
|
|
979
|
+
function ze(t, n) {
|
|
858
980
|
if (e(t)) {
|
|
859
981
|
let e = t.start, n;
|
|
860
982
|
return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
|
|
@@ -872,7 +994,7 @@ function Oe(t, n) {
|
|
|
872
994
|
}
|
|
873
995
|
//#endregion
|
|
874
996
|
//#region src/core/agendaLayout.ts
|
|
875
|
-
function
|
|
997
|
+
function Be(t, n) {
|
|
876
998
|
let { rangeStart: i, rangeEnd: a, timezone: o, showEmptyDays: s = !1 } = n, c = r.PlainDate.from(i), l = r.PlainDate.from(a);
|
|
877
999
|
if (r.PlainDate.compare(l, c) <= 0) return [];
|
|
878
1000
|
let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
|
|
@@ -886,7 +1008,7 @@ function ke(t, n) {
|
|
|
886
1008
|
for (let n of t) {
|
|
887
1009
|
if (d.has(n.id)) continue;
|
|
888
1010
|
d.add(n.id);
|
|
889
|
-
let t = e(n), { firstDay: i, lastDayInclusive: a } =
|
|
1011
|
+
let t = e(n), { firstDay: i, lastDayInclusive: a } = Ve(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;
|
|
890
1012
|
if (r.PlainDate.compare(p, s) < 0) continue;
|
|
891
1013
|
let m = s, h = !0;
|
|
892
1014
|
for (; r.PlainDate.compare(m, p) <= 0;) {
|
|
@@ -896,7 +1018,7 @@ function ke(t, n) {
|
|
|
896
1018
|
isContinuation: a
|
|
897
1019
|
});
|
|
898
1020
|
else {
|
|
899
|
-
let t = a ? -Infinity :
|
|
1021
|
+
let t = a ? -Infinity : He(n, o);
|
|
900
1022
|
e.timed.push({
|
|
901
1023
|
event: n,
|
|
902
1024
|
startMs: t,
|
|
@@ -936,7 +1058,7 @@ function ke(t, n) {
|
|
|
936
1058
|
}
|
|
937
1059
|
return p;
|
|
938
1060
|
}
|
|
939
|
-
function
|
|
1061
|
+
function Ve(t, n) {
|
|
940
1062
|
if (e(t)) {
|
|
941
1063
|
let e = t.start, n;
|
|
942
1064
|
return t.end ? (n = t.end.subtract({ days: 1 }), r.PlainDate.compare(n, e) < 0 && (n = e)) : n = e, {
|
|
@@ -954,15 +1076,15 @@ function Z(t, n) {
|
|
|
954
1076
|
lastDayInclusive: a
|
|
955
1077
|
};
|
|
956
1078
|
}
|
|
957
|
-
function
|
|
1079
|
+
function He(t, n) {
|
|
958
1080
|
return e(t) ? t.start.toZonedDateTime({ timeZone: n }).epochMilliseconds : t.start.epochMilliseconds;
|
|
959
1081
|
}
|
|
960
1082
|
//#endregion
|
|
961
1083
|
//#region src/core/timelineLayout.ts
|
|
962
|
-
function
|
|
1084
|
+
function Ue(e, t) {
|
|
963
1085
|
let { windowStart: r, windowEnd: i, pixelsPerDay: a, rowHeight: o, displayZone: s } = t, c = r.until(i, { largestUnit: "days" }).days * a, l = /* @__PURE__ */ new Map();
|
|
964
1086
|
for (let t of e) {
|
|
965
|
-
let e =
|
|
1087
|
+
let e = We(t), n = Q(t) !== null, r = l.get(e);
|
|
966
1088
|
r || (r = {
|
|
967
1089
|
events: [],
|
|
968
1090
|
isRecurring: n
|
|
@@ -972,7 +1094,7 @@ function je(e, t) {
|
|
|
972
1094
|
for (let [e, t] of l) {
|
|
973
1095
|
let o = [];
|
|
974
1096
|
for (let e of t.events) {
|
|
975
|
-
let { startDate: t, endDate: c } =
|
|
1097
|
+
let { startDate: t, endDate: c } = Ge(e, s);
|
|
976
1098
|
if (n.PlainDate.compare(c, r) <= 0 || n.PlainDate.compare(t, i) >= 0) continue;
|
|
977
1099
|
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;
|
|
978
1100
|
o.push({
|
|
@@ -1008,10 +1130,10 @@ function Q(e) {
|
|
|
1008
1130
|
let t = e.meta?.__recurrence?.seriesId;
|
|
1009
1131
|
return typeof t == "string" ? t : null;
|
|
1010
1132
|
}
|
|
1011
|
-
function
|
|
1133
|
+
function We(e) {
|
|
1012
1134
|
return Q(e) ?? e.id;
|
|
1013
1135
|
}
|
|
1014
|
-
function
|
|
1136
|
+
function Ge(e, t) {
|
|
1015
1137
|
if (e.start instanceof n.PlainDate) {
|
|
1016
1138
|
let t = e.start;
|
|
1017
1139
|
return {
|
|
@@ -1027,7 +1149,7 @@ function Ne(e, t) {
|
|
|
1027
1149
|
}
|
|
1028
1150
|
//#endregion
|
|
1029
1151
|
//#region src/core/measurementCache.ts
|
|
1030
|
-
var
|
|
1152
|
+
var Ke = class {
|
|
1031
1153
|
_itemCount;
|
|
1032
1154
|
_estimatedSize;
|
|
1033
1155
|
_measured;
|
|
@@ -1126,20 +1248,20 @@ function $(e, t, n, r = 3) {
|
|
|
1126
1248
|
totalSize: i
|
|
1127
1249
|
};
|
|
1128
1250
|
}
|
|
1129
|
-
function
|
|
1251
|
+
function qe(e, t, n, r, i, a, o = 3, s = 3) {
|
|
1130
1252
|
return {
|
|
1131
1253
|
x: $(e, n, i, o),
|
|
1132
1254
|
y: $(t, r, a, s)
|
|
1133
1255
|
};
|
|
1134
1256
|
}
|
|
1135
|
-
function
|
|
1257
|
+
function Je(e, t, n) {
|
|
1136
1258
|
if (n < 0) throw RangeError(`anchorIndex must be non-negative, got ${n}`);
|
|
1137
1259
|
let r = e.prefixSum(n);
|
|
1138
1260
|
return t.prefixSum(n) - r;
|
|
1139
1261
|
}
|
|
1140
1262
|
//#endregion
|
|
1141
1263
|
//#region src/core/dragHitTest.ts
|
|
1142
|
-
function
|
|
1264
|
+
function Ye(e, t, n, r, i) {
|
|
1143
1265
|
if (r.itemCount === 0) return {
|
|
1144
1266
|
itemIndex: -1,
|
|
1145
1267
|
ratio: NaN,
|
|
@@ -1170,7 +1292,7 @@ function Le(e, t, n, r, i) {
|
|
|
1170
1292
|
pixelInItem: u
|
|
1171
1293
|
};
|
|
1172
1294
|
}
|
|
1173
|
-
function
|
|
1295
|
+
function Xe(e, t, n, r = {}) {
|
|
1174
1296
|
let i = r.hotZone ?? 30, a = r.maxVelocity ?? 24, o = r.curve ?? "linear";
|
|
1175
1297
|
if (i <= 0 || a <= 0) return {
|
|
1176
1298
|
velocityX: 0,
|
|
@@ -1194,4 +1316,4 @@ function Re(e, t, n, r = {}) {
|
|
|
1194
1316
|
};
|
|
1195
1317
|
}
|
|
1196
1318
|
//#endregion
|
|
1197
|
-
export {
|
|
1319
|
+
export { f as $, he as A, oe as B, U as C, N as D, L as E, re as F, O as G, D as H, ie as I, b as J, r as K, ae as L, pe as M, ue as N, me as O, se as P, m as Q, A as R, Ee as S, _e as T, E as U, w as V, T as W, o as X, l as Y, s as Z, Y as _, qe as a, ee as at, Ae as b, Be as c, p as ct, je as d, g as dt, x as et, Pe as f, _ as ft, Oe as g, Ne as h, $ as i, v as it, de as j, ge as k, Me as l, d as lt, Le as m, Ye as n, h as nt, Ke as o, ne as ot, Ie as p, u as q, Je as r, y as rt, Ue as s, te as st, Xe as t, C as tt, Fe as u, S as ut, J as v, H as w, K as x, ke as y, k as z };
|