@luckydye/calendar 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar.js +397 -395
- package/package.json +1 -1
- package/src/CalDAVConfig.ts +191 -116
- package/src/CalendarInternal.ts +12 -0
- package/src/CalendarStorage.ts +5 -0
- package/src/CalendarView.ts +83 -86
- package/src/IndexedDBStorage.ts +13 -0
- package/src/InhouseBookingSource.ts +30 -1
- package/src/app.css +17 -1
- package/src/app.ts +168 -183
package/dist/calendar.js
CHANGED
|
@@ -249,7 +249,7 @@ let Vt = class extends HTMLElement {
|
|
|
249
249
|
Vt.elementStyles = [], Vt.shadowRootOptions = { mode: "open" }, Vt[re("elementProperties")] = /* @__PURE__ */ new Map(), Vt[re("finalized")] = /* @__PURE__ */ new Map(), yn?.({ ReactiveElement: Vt }), (Ce.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
250
|
const Ke = globalThis, di = (n) => n, we = Ke.trustedTypes, ui = we ? we.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Bi = "$lit$", At = `lit$${Math.random().toFixed(9).slice(2)}$`, qi = "?" + At, bn = `<${qi}>`, Lt = document, le = () => Lt.createComment(""), ce = (n) => n === null || typeof n != "object" && typeof n != "function", Xe = Array.isArray, wn = (n) => Xe(n) || typeof n?.[Symbol.iterator] == "function", _e = `[
|
|
251
251
|
\f\r]`, ne = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, fi = /-->/g, gi = />/g, It = RegExp(`>|${_e}(?:([^\\s"'>=/]+)(${_e}*=${_e}*(?:[^
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), pi = /'/g, vi = /"/g, Vi = /^(?:script|style|textarea|title)$/i, En = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }),
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pi = /'/g, vi = /"/g, Vi = /^(?:script|style|textarea|title)$/i, En = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), O = En(1), Xt = /* @__PURE__ */ Symbol.for("lit-noChange"), G = /* @__PURE__ */ Symbol.for("lit-nothing"), mi = /* @__PURE__ */ new WeakMap(), Ut = Lt.createTreeWalker(Lt, 129);
|
|
253
253
|
function ji(n, t) {
|
|
254
254
|
if (!Xe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return ui !== void 0 ? ui.createHTML(t) : t;
|
|
@@ -1609,14 +1609,14 @@ function ds(n, t) {
|
|
|
1609
1609
|
;
|
|
1610
1610
|
}
|
|
1611
1611
|
if (d) {
|
|
1612
|
-
var
|
|
1612
|
+
var M = void 0;
|
|
1613
1613
|
if (F(t.byweekno, -1))
|
|
1614
|
-
|
|
1614
|
+
M = -1;
|
|
1615
1615
|
else {
|
|
1616
|
-
var H = Gt(Wt(n - 1, 1, 1)),
|
|
1617
|
-
|
|
1616
|
+
var H = Gt(Wt(n - 1, 1, 1)), $ = lt(7 - H.valueOf() + t.wkst, 7), w = oe(n - 1) ? 366 : 365, D = void 0;
|
|
1617
|
+
$ >= 4 ? ($ = 0, D = w + lt(H - t.wkst, 7)) : D = i - d, M = Math.floor(52 + lt(D, 7) / 4);
|
|
1618
1618
|
}
|
|
1619
|
-
if (F(t.byweekno,
|
|
1619
|
+
if (F(t.byweekno, M))
|
|
1620
1620
|
for (var p = 0; p < d; p++)
|
|
1621
1621
|
a.wnomask[p] = 1;
|
|
1622
1622
|
}
|
|
@@ -1826,25 +1826,25 @@ function nn(n, t) {
|
|
|
1826
1826
|
var h = c.getdayset(i)(l.year, l.month, l.day), u = h[0], f = h[1], v = h[2], g = ys(u, f, v, c, t);
|
|
1827
1827
|
if (Z(o))
|
|
1828
1828
|
for (var p = vs(o, d, f, v, c, u), y = 0; y < p.length; y++) {
|
|
1829
|
-
var
|
|
1830
|
-
if (r &&
|
|
1829
|
+
var M = p[y];
|
|
1830
|
+
if (r && M > r)
|
|
1831
1831
|
return xt(n);
|
|
1832
|
-
if (
|
|
1833
|
-
var H = Ci(
|
|
1832
|
+
if (M >= e) {
|
|
1833
|
+
var H = Ci(M, t);
|
|
1834
1834
|
if (!n.accept(H) || a && (--a, !a))
|
|
1835
1835
|
return xt(n);
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
1838
|
else
|
|
1839
1839
|
for (var y = f; y < v; y++) {
|
|
1840
|
-
var
|
|
1841
|
-
if (V(
|
|
1842
|
-
for (var
|
|
1843
|
-
var
|
|
1844
|
-
if (r &&
|
|
1840
|
+
var $ = u[y];
|
|
1841
|
+
if (V($))
|
|
1842
|
+
for (var w = Ji(c.yearordinal + $), D = 0; D < d.length; D++) {
|
|
1843
|
+
var E = d[D], M = Qi(w, E);
|
|
1844
|
+
if (r && M > r)
|
|
1845
1845
|
return xt(n);
|
|
1846
|
-
if (
|
|
1847
|
-
var H = Ci(
|
|
1846
|
+
if (M >= e) {
|
|
1847
|
+
var H = Ci(M, t);
|
|
1848
1848
|
if (!n.accept(H) || a && (--a, !a))
|
|
1849
1849
|
return xt(n);
|
|
1850
1850
|
}
|
|
@@ -2236,9 +2236,9 @@ const As = [
|
|
|
2236
2236
|
{ label: "2 hours before", value: 120 },
|
|
2237
2237
|
{ label: "1 day before", value: 1440 }
|
|
2238
2238
|
], Os = 12, _s = 12, Hs = 96;
|
|
2239
|
-
class
|
|
2239
|
+
class N {
|
|
2240
2240
|
constructor(t) {
|
|
2241
|
-
this.startDate = /* @__PURE__ */ new Date(), this.endDate =
|
|
2241
|
+
this.startDate = /* @__PURE__ */ new Date(), this.endDate = N.addDays(/* @__PURE__ */ new Date(), 182), this.weekStart = 0, this.filter = "", this.calendarEvents = /* @__PURE__ */ new Map(), this.selectedEvents = /* @__PURE__ */ new Set(), this.enabledCalendars = /* @__PURE__ */ new Set(), this.lockedCalendars = /* @__PURE__ */ new Set(), this.sync = (i, s, r) => {
|
|
2242
2242
|
const o = [];
|
|
2243
2243
|
for (const l of r) {
|
|
2244
2244
|
const c = {
|
|
@@ -2254,7 +2254,7 @@ class U {
|
|
|
2254
2254
|
return this.storage?.sync(o, a).catch((l) => {
|
|
2255
2255
|
console.error("Failed to persist events:", l);
|
|
2256
2256
|
}), o;
|
|
2257
|
-
}, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart ||
|
|
2257
|
+
}, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart || N.getWeekStartFromLocale(this.locale), this.startDate = this.getStartOfWeek(N.addDays(/* @__PURE__ */ new Date(), -182));
|
|
2258
2258
|
const e = {
|
|
2259
2259
|
start: (i) => {
|
|
2260
2260
|
this.controller = i;
|
|
@@ -2274,6 +2274,14 @@ class U {
|
|
|
2274
2274
|
this.calendarEvents.set(e.id, e);
|
|
2275
2275
|
return this.sendEvents(), t;
|
|
2276
2276
|
}
|
|
2277
|
+
applyEventOptimistically(t) {
|
|
2278
|
+
this.calendarEvents.set(t.id, t), this.storage?.putEvent(t).catch(() => {
|
|
2279
|
+
}), this.sendEvents();
|
|
2280
|
+
}
|
|
2281
|
+
removeEventOptimistically(t) {
|
|
2282
|
+
this.calendarEvents.delete(t), this.storage?.deleteEvent(t).catch(() => {
|
|
2283
|
+
}), this.sendEvents();
|
|
2284
|
+
}
|
|
2277
2285
|
setFilter(t) {
|
|
2278
2286
|
this.filter = t, this.sendEvents();
|
|
2279
2287
|
}
|
|
@@ -2421,10 +2429,10 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2421
2429
|
for (; s < e; ) {
|
|
2422
2430
|
const r = [];
|
|
2423
2431
|
for (let l = 0; l < 7; l++)
|
|
2424
|
-
r.push(new Date(s)), s =
|
|
2432
|
+
r.push(new Date(s)), s = N.addDays(s, 1);
|
|
2425
2433
|
const o = r[0], a = r[3];
|
|
2426
2434
|
o && a && i.push({
|
|
2427
|
-
weekNumber:
|
|
2435
|
+
weekNumber: N.getWeekNumber(o),
|
|
2428
2436
|
year: a.getFullYear(),
|
|
2429
2437
|
// Use Thursday for year
|
|
2430
2438
|
days: r,
|
|
@@ -2438,15 +2446,15 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2438
2446
|
extendRange(t) {
|
|
2439
2447
|
const e = _s, i = [];
|
|
2440
2448
|
if (t === "past") {
|
|
2441
|
-
const s =
|
|
2449
|
+
const s = N.addDays(this.startDate, -e * 7);
|
|
2442
2450
|
let r = new Date(s);
|
|
2443
2451
|
for (; r < this.startDate; ) {
|
|
2444
2452
|
const o = [];
|
|
2445
2453
|
for (let c = 0; c < 7; c++)
|
|
2446
|
-
o.push(new Date(r)), r =
|
|
2454
|
+
o.push(new Date(r)), r = N.addDays(r, 1);
|
|
2447
2455
|
const a = o[0], l = o[3];
|
|
2448
2456
|
a && l && i.push({
|
|
2449
|
-
weekNumber:
|
|
2457
|
+
weekNumber: N.getWeekNumber(a),
|
|
2450
2458
|
year: l.getFullYear(),
|
|
2451
2459
|
days: o,
|
|
2452
2460
|
yOffset: 0,
|
|
@@ -2455,15 +2463,15 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2455
2463
|
}
|
|
2456
2464
|
this.startDate = s;
|
|
2457
2465
|
} else {
|
|
2458
|
-
const s =
|
|
2466
|
+
const s = N.addDays(this.endDate, e * 7);
|
|
2459
2467
|
let r = new Date(this.endDate);
|
|
2460
2468
|
for (; r < s; ) {
|
|
2461
2469
|
const o = [];
|
|
2462
2470
|
for (let c = 0; c < 7; c++)
|
|
2463
|
-
o.push(new Date(r)), r =
|
|
2471
|
+
o.push(new Date(r)), r = N.addDays(r, 1);
|
|
2464
2472
|
const a = o[0], l = o[3];
|
|
2465
2473
|
a && l && i.push({
|
|
2466
|
-
weekNumber:
|
|
2474
|
+
weekNumber: N.getWeekNumber(a),
|
|
2467
2475
|
year: l.getFullYear(),
|
|
2468
2476
|
days: o,
|
|
2469
2477
|
yOffset: 0,
|
|
@@ -2481,12 +2489,12 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2481
2489
|
return Hs;
|
|
2482
2490
|
}
|
|
2483
2491
|
trimRange(t, e) {
|
|
2484
|
-
t === "past" ? this.startDate =
|
|
2492
|
+
t === "past" ? this.startDate = N.addDays(this.startDate, -e * 7) : this.endDate = N.addDays(this.endDate, -e * 7);
|
|
2485
2493
|
}
|
|
2486
2494
|
// Resets the range to be centered around the target date
|
|
2487
2495
|
resetRangeAroundDate(t) {
|
|
2488
2496
|
const e = new Date(t);
|
|
2489
|
-
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(
|
|
2497
|
+
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(N.addDays(e, -182)), this.endDate = N.addDays(e, 182), this.generateWeeks();
|
|
2490
2498
|
}
|
|
2491
2499
|
getWeekdayNames() {
|
|
2492
2500
|
const t = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), e = [];
|
|
@@ -2521,7 +2529,7 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2521
2529
|
}
|
|
2522
2530
|
// Returns timestamp for end of day using pure math (no Date object creation)
|
|
2523
2531
|
static endOfDayTime(t) {
|
|
2524
|
-
return t ?
|
|
2532
|
+
return t ? N.startOfDayTime(t) + 864e5 - 1 : 0;
|
|
2525
2533
|
}
|
|
2526
2534
|
static getWeekStartFromLocale(t) {
|
|
2527
2535
|
const e = ["en-US", "en-CA", "ja-JP", "ko-KR", "zh-TW"], i = t.split("-")[0];
|
|
@@ -2769,7 +2777,7 @@ const ke = class ke extends Kt {
|
|
|
2769
2777
|
}, 200));
|
|
2770
2778
|
}
|
|
2771
2779
|
render() {
|
|
2772
|
-
return !this.isShowing || !this.currentMessage ?
|
|
2780
|
+
return !this.isShowing || !this.currentMessage ? O`` : O`<div class="message">${this.currentMessage}</div>`;
|
|
2773
2781
|
}
|
|
2774
2782
|
};
|
|
2775
2783
|
ke.styles = zi`
|
|
@@ -3006,21 +3014,28 @@ class zs {
|
|
|
3006
3014
|
r.objectStore(this.storeName).put(this.serializeEvent(t)), r.oncomplete = () => i(), r.onerror = () => s(r.error);
|
|
3007
3015
|
});
|
|
3008
3016
|
}
|
|
3017
|
+
async deleteEvent(t) {
|
|
3018
|
+
const e = await this.open();
|
|
3019
|
+
return new Promise((i, s) => {
|
|
3020
|
+
const r = e.transaction(this.storeName, "readwrite");
|
|
3021
|
+
r.objectStore(this.storeName).delete(t), r.oncomplete = () => i(), r.onerror = () => s(r.error);
|
|
3022
|
+
});
|
|
3023
|
+
}
|
|
3009
3024
|
}
|
|
3010
3025
|
const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
3011
3026
|
constructor() {
|
|
3012
3027
|
super(), this._dayHeight = Nt, this._scrollTop = 0, this.viewportHeight = 0, this.currentTime = /* @__PURE__ */ new Date(), this.selection = null, this.canvas = null, this.ctx = null, this.overlayCanvas = null, this.overlayCtx = null, this.minimapBufferCanvas = null, this.minimapBufferCtx = null, this.stripePatternCanvas = null, this.scrollContainer = null, this.scrollContent = null, this.resizeObserver = null, this.totalHeight = 0, this.isDraggingZoom = !1, this.zoomDragStartY = 0, this.zoomDragStartHeight = 0, this.zoomOriginY = 0, this.zoomViewportY = 0, this.isPanning = !1, this.panStartX = 0, this.panStartY = 0, this.panStartScrollTop = 0, this.isSelecting = !1, this.selectionStartX = 0, this.selectionStartY = 0, this.potentialSelectionStart = null, this.selectionModifierKey = !1, this.cursorPosition = null, this.animationFrame = null, this.isDraggingMinimap = !1, this.isFiltered = !1, this.timeUpdateInterval = null, this.isExtendingRange = !1, this.isCreatingEvent = !1, this.eventCreationStart = null, this.eventCreationEnd = null, this.eventCreationShiftPressed = !1, this.eventCreationPreviousShiftPressed = !1, this.eventCreationInitialDuration = null, this.movingEvent = null, this.movingEventOrigin = null, this.movingEventEnd = null, this.isDraggingEvent = !1, this.movingEventDuplicateMode = !1, this.movingEventMouseEvent = null, this.isDraggingFile = !1, this.resizingEvent = null, this.resizingEdge = null, this.resizingOriginalStart = null, this.resizingOriginalEnd = null, this.isResizingEvent = !1, this._columnsPerRow = 7, this.historyStack = [], this.historyIndex = 0, this.saveHistoryTimeout = null, this.weeks = [], this.events = [], this.eventRects = [], this.hoveredEventId = null, this.selectedEventForDetail = null, this.selectedEventRect = null, this.isDescriptionExpanded = !1, this.notificationPopoverOpen = !1, this.scheduledNotifications = [], this.updateEventTimeout = null, this.currentUserEmails = /* @__PURE__ */ new Set(), this.currentTheme = Ls(), this.activeCalendarColor = null, this.scrollToToday = (t = !0) => {
|
|
3013
3028
|
const e = /* @__PURE__ */ new Date();
|
|
3014
3029
|
let i = this.weeks.findIndex(
|
|
3015
|
-
(r) => r.days.some((o) =>
|
|
3030
|
+
(r) => r.days.some((o) => N.isSameDay(o, e))
|
|
3016
3031
|
);
|
|
3017
3032
|
i < 0 && (this.weeks = this.internal.resetRangeAroundDate(e), i = this.weeks.findIndex(
|
|
3018
|
-
(r) => r.days.some((o) =>
|
|
3033
|
+
(r) => r.days.some((o) => N.isSameDay(o, e))
|
|
3019
3034
|
));
|
|
3020
3035
|
let s = 0.5;
|
|
3021
3036
|
if (i >= 0) {
|
|
3022
3037
|
const o = this.weeks[i].days.findIndex(
|
|
3023
|
-
(a) =>
|
|
3038
|
+
(a) => N.isSameDay(a, e)
|
|
3024
3039
|
);
|
|
3025
3040
|
if (o >= 0) {
|
|
3026
3041
|
const a = Math.floor(o / this._columnsPerRow), l = (e.getHours() + e.getMinutes() / 60) / 24;
|
|
@@ -3257,7 +3272,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3257
3272
|
if (a && l) {
|
|
3258
3273
|
const c = l.getTime() - a.getTime(), d = (f) => {
|
|
3259
3274
|
const v = f.getMinutes();
|
|
3260
|
-
return f.setMinutes(Math.
|
|
3275
|
+
return f.setMinutes(Math.round(v / 15) * 15, 0, 0), f;
|
|
3261
3276
|
}, h = d(
|
|
3262
3277
|
new Date(this.movingEvent.start.getTime() + c)
|
|
3263
3278
|
), u = d(
|
|
@@ -3355,7 +3370,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3355
3370
|
}
|
|
3356
3371
|
const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s, d = a * l - o;
|
|
3357
3372
|
this.setView(i, d);
|
|
3358
|
-
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new
|
|
3373
|
+
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new N({
|
|
3359
3374
|
locale: this.getAttribute("locale") || void 0,
|
|
3360
3375
|
weekStart: Number(this.getAttribute("week-start")),
|
|
3361
3376
|
storage: new zs()
|
|
@@ -3383,8 +3398,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3383
3398
|
if (!this.scrollAnimationFrame) return;
|
|
3384
3399
|
const y = Math.min((p - u) / h, 1);
|
|
3385
3400
|
this._dayHeight = r + (t - r) * f(y), this.updateWeekOffsets();
|
|
3386
|
-
const
|
|
3387
|
-
this._scrollTop = Math.max(0,
|
|
3401
|
+
const M = c + (d - c) * v(y);
|
|
3402
|
+
this._scrollTop = Math.max(0, M * this.totalHeight), this.scrollContainer && (this.scrollContent && this.scrollContainer.scrollHeight < this._scrollTop && (this.scrollContent.style.minHeight = this._scrollTop + window.innerHeight + "px"), this.scrollContainer.scrollTop = this._scrollTop), this.renderCanvas(), y < 1 ? this.scrollAnimationFrame = requestAnimationFrame(g) : (this._dayHeight = t, this._scrollTop = e, this.saveDayHeight(), this.saveScrollPosition(), this.scrollAnimationFrame = null, this.renderCanvas());
|
|
3388
3403
|
};
|
|
3389
3404
|
this.scrollAnimationFrame = requestAnimationFrame(g);
|
|
3390
3405
|
return;
|
|
@@ -3476,10 +3491,10 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3476
3491
|
scrollToDate(t, e = 0.5, i = !1, s = !1, r) {
|
|
3477
3492
|
const o = r ?? this._dayHeight;
|
|
3478
3493
|
let a = this.weeks.findIndex(
|
|
3479
|
-
(l) => l.days.some((c) =>
|
|
3494
|
+
(l) => l.days.some((c) => N.isSameDay(c, t)) || l.days[0] && l.days[6] && l.days[0] <= t && t <= l.days[6]
|
|
3480
3495
|
);
|
|
3481
3496
|
if (a < 0 && s && (this.weeks = this.internal.resetRangeAroundDate(t), a = this.weeks.findIndex(
|
|
3482
|
-
(l) => l.days.some((c) =>
|
|
3497
|
+
(l) => l.days.some((c) => N.isSameDay(c, t)) || l.days[0] && l.days[6] && l.days[0] <= t && t <= l.days[6]
|
|
3483
3498
|
)), a >= 0) {
|
|
3484
3499
|
const l = this._dayHeight;
|
|
3485
3500
|
this._dayHeight = o, this.updateWeekOffsets();
|
|
@@ -3559,8 +3574,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3559
3574
|
const e = this.dayHeight * this.rowsPerWeek;
|
|
3560
3575
|
if (this.filter) {
|
|
3561
3576
|
const s = this.events.map((r) => ({
|
|
3562
|
-
start:
|
|
3563
|
-
end:
|
|
3577
|
+
start: N.startOfDayTime(r.start),
|
|
3578
|
+
end: N.endOfDayTime(r.end)
|
|
3564
3579
|
}));
|
|
3565
3580
|
for (const r of this.weeks) {
|
|
3566
3581
|
r.yOffset = t;
|
|
@@ -3600,15 +3615,15 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3600
3615
|
), d = this.dayHeight >= 300;
|
|
3601
3616
|
for (const h of c) {
|
|
3602
3617
|
const u = h.days.findIndex(
|
|
3603
|
-
(f) =>
|
|
3618
|
+
(f) => N.isSameDay(f, l)
|
|
3604
3619
|
);
|
|
3605
3620
|
if (u >= 0) {
|
|
3606
3621
|
const { row: f, col: v } = this.getDayVisualPosition(u), g = z + v * a, p = h.yOffset + f * this.dayHeight - r, y = getComputedStyle(this).getPropertyValue("--bg-today").trim() || "rgba(255, 255, 255, 0.05)";
|
|
3607
3622
|
if (t.fillStyle = y, t.fillRect(g, p, a, this.dayHeight), d) {
|
|
3608
|
-
const
|
|
3609
|
-
if (
|
|
3610
|
-
const
|
|
3611
|
-
t.strokeStyle =
|
|
3623
|
+
const M = /* @__PURE__ */ new Date(), H = M.getHours() * 60 + M.getMinutes(), $ = p + H / 1440 * this.dayHeight;
|
|
3624
|
+
if ($ >= 0 && $ <= i) {
|
|
3625
|
+
const w = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
|
|
3626
|
+
t.strokeStyle = w, t.lineWidth = 1, t.beginPath(), t.moveTo(g, $), t.lineTo(g + a, $), t.stroke(), t.lineWidth = 1;
|
|
3612
3627
|
}
|
|
3613
3628
|
}
|
|
3614
3629
|
}
|
|
@@ -3623,21 +3638,21 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3623
3638
|
if (!u) continue;
|
|
3624
3639
|
const f = u.yOffset - r;
|
|
3625
3640
|
if (this.filter && h > 0) {
|
|
3626
|
-
const
|
|
3627
|
-
if (!
|
|
3628
|
-
const S = this.weeks.indexOf(
|
|
3629
|
-
if (
|
|
3630
|
-
const b = f,
|
|
3631
|
-
t.strokeStyle =
|
|
3641
|
+
const E = c[h - 1];
|
|
3642
|
+
if (!E) continue;
|
|
3643
|
+
const S = this.weeks.indexOf(E), _ = this.weeks.indexOf(u) - S - 1;
|
|
3644
|
+
if (_ > 0) {
|
|
3645
|
+
const b = f, x = getComputedStyle(this).getPropertyValue("--grid-color-strong").trim() || "rgba(255, 255, 255, 0.3)";
|
|
3646
|
+
t.strokeStyle = x, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(z, b), t.lineTo(e, b), t.stroke(), t.setLineDash([]);
|
|
3632
3647
|
const T = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3633
3648
|
t.fillStyle = T, t.textAlign = "center";
|
|
3634
|
-
const
|
|
3635
|
-
t.fillStyle = K, t.beginPath(), t.roundRect(P, B, R, W, 8), t.fill(), t.fillStyle = T, t.fillText(
|
|
3649
|
+
const C = `⋯ ${_} week${_ > 1 ? "s" : ""}`, U = t.measureText(C).width, L = 8, P = (z + e) / 2 - U / 2 - L, B = b - 8, R = U + L * 2, W = 16, K = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
|
|
3650
|
+
t.fillStyle = K, t.beginPath(), t.roundRect(P, B, R, W, 8), t.fill(), t.fillStyle = T, t.fillText(C, (z + e) / 2, b + 4);
|
|
3636
3651
|
}
|
|
3637
3652
|
}
|
|
3638
3653
|
t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.beginPath(), t.moveTo(z, f), t.lineTo(e, f), t.stroke();
|
|
3639
|
-
for (let
|
|
3640
|
-
const S = f +
|
|
3654
|
+
for (let E = 1; E < this.rowsPerWeek; E++) {
|
|
3655
|
+
const S = f + E * this.dayHeight;
|
|
3641
3656
|
S >= 0 && S <= i && (t.beginPath(), t.moveTo(z, S), t.lineTo(e, S), t.stroke());
|
|
3642
3657
|
}
|
|
3643
3658
|
const v = Math.max(
|
|
@@ -3653,73 +3668,73 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3653
3668
|
/[\d.]+\)$/,
|
|
3654
3669
|
`${0.4 * v})`
|
|
3655
3670
|
);
|
|
3656
|
-
for (let
|
|
3657
|
-
const S = f +
|
|
3658
|
-
for (let
|
|
3659
|
-
const
|
|
3660
|
-
if (
|
|
3661
|
-
const b = `${
|
|
3662
|
-
t.fillText(b, 48,
|
|
3671
|
+
for (let E = 0; E < this.rowsPerWeek; E++) {
|
|
3672
|
+
const S = f + E * this.dayHeight;
|
|
3673
|
+
for (let A = 0; A < 24; A++) {
|
|
3674
|
+
const _ = S + A / 24 * this.dayHeight;
|
|
3675
|
+
if (_ >= 0 && _ <= i && (t.beginPath(), t.moveTo(z, _), t.lineTo(e, _), t.stroke(), v > 0.1)) {
|
|
3676
|
+
const b = `${A.toString().padStart(2, "0")}:00`;
|
|
3677
|
+
t.fillText(b, 48, _ + 4);
|
|
3663
3678
|
}
|
|
3664
3679
|
}
|
|
3665
3680
|
}
|
|
3666
3681
|
if (v > 0.1) {
|
|
3667
|
-
const
|
|
3668
|
-
(
|
|
3682
|
+
const E = /* @__PURE__ */ new Date(), S = u.days.findIndex(
|
|
3683
|
+
(A) => N.isSameDay(A, E)
|
|
3669
3684
|
);
|
|
3670
3685
|
if (S >= 0) {
|
|
3671
|
-
const { row:
|
|
3686
|
+
const { row: A } = this.getDayVisualPosition(S), _ = E.getHours() * 60 + E.getMinutes(), b = f + A * this.dayHeight + _ / 1440 * this.dayHeight;
|
|
3672
3687
|
if (b >= 0 && b <= i) {
|
|
3673
|
-
const
|
|
3688
|
+
const x = E.getHours().toString().padStart(2, "0"), T = E.getMinutes().toString().padStart(2, "0"), C = `${x}:${T}`;
|
|
3674
3689
|
t.save(), t.textAlign = "right", t.textBaseline = "middle";
|
|
3675
|
-
const
|
|
3690
|
+
const U = t.measureText(C).width, L = 6, P = 48, B = b, R = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
|
|
3676
3691
|
t.fillStyle = R, t.beginPath(), t.roundRect(
|
|
3677
|
-
P -
|
|
3692
|
+
P - U - L,
|
|
3678
3693
|
B - 8,
|
|
3679
|
-
|
|
3694
|
+
U + L * 2,
|
|
3680
3695
|
16,
|
|
3681
3696
|
4
|
|
3682
|
-
), t.fill(), t.fillStyle = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 1)", t.fillText(
|
|
3697
|
+
), t.fill(), t.fillStyle = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 1)", t.fillText(C, P, B), t.restore();
|
|
3683
3698
|
}
|
|
3684
3699
|
}
|
|
3685
3700
|
}
|
|
3686
3701
|
const y = Math.max(
|
|
3687
3702
|
0,
|
|
3688
3703
|
Math.min(1, 1 - (this.dayHeight - 300) / 50)
|
|
3689
|
-
),
|
|
3690
|
-
t.fillStyle =
|
|
3704
|
+
), M = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3705
|
+
t.fillStyle = M.replace(
|
|
3691
3706
|
/[\d.]+\)$/,
|
|
3692
3707
|
`${0.4 * y})`
|
|
3693
3708
|
), t.textAlign = "center";
|
|
3694
|
-
const H = `W${u.weekNumber}`,
|
|
3709
|
+
const H = `W${u.weekNumber}`, $ = f, w = f + u.height, D = Math.max(
|
|
3695
3710
|
14,
|
|
3696
|
-
Math.min(
|
|
3711
|
+
Math.min($ + u.height / 2 + 4, w - 4)
|
|
3697
3712
|
);
|
|
3698
|
-
|
|
3713
|
+
D >= Math.max(0, $ + 4) && D <= Math.min(i, w) && y > 0.1 && t.fillText(H, 30, D);
|
|
3699
3714
|
}
|
|
3700
3715
|
this.renderEventsOnCanvas(t, r, i, a, c), this.renderDateLabels(), this.renderWeekdayLabels(t, a, c, r, i), this.isCreatingEvent && this.renderEventCreationPreview(), this.isDraggingEvent && this.renderEventMovePreview(), this.renderMinimap();
|
|
3701
3716
|
}
|
|
3702
3717
|
renderEventsOnCanvas(t, e, i, s, r) {
|
|
3703
3718
|
const o = this.events, a = getComputedStyle(this).fontFamily, l = e + i, c = this.dayHeight >= 300;
|
|
3704
3719
|
if (this.eventRects = [], r.length === 0) return;
|
|
3705
|
-
const d = r[0], h = r[r.length - 1], u = d.days[0], f = h.days[6], v = u.getTime(), g = f.getTime() + 864e5 - 1, p = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(),
|
|
3720
|
+
const d = r[0], h = r[r.length - 1], u = d.days[0], f = h.days[6], v = u.getTime(), g = f.getTime() + 864e5 - 1, p = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), M = [], H = [], $ = [];
|
|
3706
3721
|
for (const b of o) {
|
|
3707
|
-
const
|
|
3708
|
-
if (T < v ||
|
|
3722
|
+
const x = b.start.getTime(), T = b.end.getTime();
|
|
3723
|
+
if (T < v || x > g)
|
|
3709
3724
|
continue;
|
|
3710
|
-
const
|
|
3725
|
+
const C = [];
|
|
3711
3726
|
for (const P of r) {
|
|
3712
3727
|
const B = P.days[0], R = P.days[6];
|
|
3713
3728
|
if (!B || !R) continue;
|
|
3714
3729
|
const W = B.getTime(), K = R.getTime() + 86399999;
|
|
3715
|
-
if (T >= W &&
|
|
3730
|
+
if (T >= W && x <= K) {
|
|
3716
3731
|
const J = this.weeks.indexOf(P);
|
|
3717
|
-
|
|
3732
|
+
C.push({ weekIndex: J, week: P });
|
|
3718
3733
|
}
|
|
3719
3734
|
}
|
|
3720
|
-
const
|
|
3721
|
-
for (let P = 0; P <
|
|
3722
|
-
const { weekIndex: B, week: R } =
|
|
3735
|
+
const U = C.length, L = b.isAllDay === !0;
|
|
3736
|
+
for (let P = 0; P < C.length; P++) {
|
|
3737
|
+
const { weekIndex: B, week: R } = C[P], W = P === 0, K = P === C.length - 1;
|
|
3723
3738
|
let J = 0, wt = 6;
|
|
3724
3739
|
if (W && (J = Ui(R, b.start)), K) {
|
|
3725
3740
|
const ut = L ? new Date(b.end.getTime() - 1) : b.end;
|
|
@@ -3733,16 +3748,16 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3733
3748
|
endDayIndex: wt,
|
|
3734
3749
|
isStart: W,
|
|
3735
3750
|
isEnd: K,
|
|
3736
|
-
totalWeeks:
|
|
3751
|
+
totalWeeks: U
|
|
3737
3752
|
};
|
|
3738
|
-
L ? H.push(rt) :
|
|
3753
|
+
L ? H.push(rt) : $.push(rt);
|
|
3739
3754
|
}
|
|
3740
3755
|
}
|
|
3741
|
-
const
|
|
3756
|
+
const w = c ? $.flatMap((b) => {
|
|
3742
3757
|
if (b.startDayIndex === b.endDayIndex) return [b];
|
|
3743
|
-
const
|
|
3758
|
+
const x = [];
|
|
3744
3759
|
for (let T = b.startDayIndex; T <= b.endDayIndex; T++)
|
|
3745
|
-
|
|
3760
|
+
x.push({
|
|
3746
3761
|
...b,
|
|
3747
3762
|
startDayIndex: T,
|
|
3748
3763
|
endDayIndex: T,
|
|
@@ -3750,30 +3765,30 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3750
3765
|
isEnd: T === b.endDayIndex && b.isEnd,
|
|
3751
3766
|
totalWeeks: 1
|
|
3752
3767
|
});
|
|
3753
|
-
return
|
|
3754
|
-
}) :
|
|
3755
|
-
|
|
3756
|
-
const
|
|
3757
|
-
for (const b of
|
|
3758
|
-
const
|
|
3759
|
-
if (c && !
|
|
3768
|
+
return x;
|
|
3769
|
+
}) : $;
|
|
3770
|
+
M.push(...H, ...w);
|
|
3771
|
+
const D = /* @__PURE__ */ new Map();
|
|
3772
|
+
for (const b of M) {
|
|
3773
|
+
const x = b.event.isAllDay === !0;
|
|
3774
|
+
if (c && !x)
|
|
3760
3775
|
for (let T = b.startDayIndex; T <= b.endDayIndex; T++) {
|
|
3761
|
-
const
|
|
3762
|
-
|
|
3776
|
+
const C = `${b.weekIndex}-${T}`;
|
|
3777
|
+
D.has(C) || D.set(C, []), D.get(C).push(b);
|
|
3763
3778
|
}
|
|
3764
3779
|
}
|
|
3765
|
-
const
|
|
3766
|
-
for (const [b,
|
|
3767
|
-
const [T,
|
|
3768
|
-
for (const R of
|
|
3780
|
+
const E = /* @__PURE__ */ new Map();
|
|
3781
|
+
for (const [b, x] of D) {
|
|
3782
|
+
const [T, C] = b.split("-"), U = parseInt(C), L = parseInt(T), P = [];
|
|
3783
|
+
for (const R of x) {
|
|
3769
3784
|
const W = this.weeks[L];
|
|
3770
3785
|
if (!W) continue;
|
|
3771
|
-
const K = new Date(W.days[
|
|
3786
|
+
const K = new Date(W.days[U]).setHours(
|
|
3772
3787
|
0,
|
|
3773
3788
|
0,
|
|
3774
3789
|
0,
|
|
3775
3790
|
0
|
|
3776
|
-
), J = new Date(W.days[
|
|
3791
|
+
), J = new Date(W.days[U]).setHours(
|
|
3777
3792
|
23,
|
|
3778
3793
|
59,
|
|
3779
3794
|
59,
|
|
@@ -3788,32 +3803,32 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3788
3803
|
for (; W < B.length && !(B[W].endMinutes <= R.startMinutes); W++)
|
|
3789
3804
|
;
|
|
3790
3805
|
W === B.length ? B.push({ endMinutes: R.endMinutes }) : B[W].endMinutes = R.endMinutes;
|
|
3791
|
-
const K = `${R.segment.weekIndex}-${R.segment.event.id}-${
|
|
3792
|
-
|
|
3806
|
+
const K = `${R.segment.weekIndex}-${R.segment.event.id}-${U}`;
|
|
3807
|
+
E.set(K, {
|
|
3793
3808
|
column: W,
|
|
3794
3809
|
totalColumns: B.length
|
|
3795
3810
|
});
|
|
3796
3811
|
}
|
|
3797
3812
|
for (const R of P) {
|
|
3798
|
-
const W = `${R.segment.weekIndex}-${R.segment.event.id}-${
|
|
3813
|
+
const W = `${R.segment.weekIndex}-${R.segment.event.id}-${U}`, K = E.get(W);
|
|
3799
3814
|
K && (K.totalColumns = B.length);
|
|
3800
3815
|
}
|
|
3801
3816
|
}
|
|
3802
|
-
for (const b of
|
|
3817
|
+
for (const b of M) {
|
|
3803
3818
|
const {
|
|
3804
|
-
event:
|
|
3819
|
+
event: x,
|
|
3805
3820
|
week: T,
|
|
3806
|
-
weekIndex:
|
|
3807
|
-
startDayIndex:
|
|
3821
|
+
weekIndex: C,
|
|
3822
|
+
startDayIndex: U,
|
|
3808
3823
|
endDayIndex: L,
|
|
3809
3824
|
isStart: P,
|
|
3810
3825
|
isEnd: B,
|
|
3811
3826
|
totalWeeks: R
|
|
3812
|
-
} = b, W = T.yOffset, K =
|
|
3827
|
+
} = b, W = T.yOffset, K = x.isAllDay === !0, J = this.getDayVisualPosition(U), wt = this.getDayVisualPosition(L);
|
|
3813
3828
|
J.row, wt.row;
|
|
3814
3829
|
let rt, ut;
|
|
3815
3830
|
if (c && !K) {
|
|
3816
|
-
const nt = new Date(T.days[
|
|
3831
|
+
const nt = new Date(T.days[U]).setHours(
|
|
3817
3832
|
0,
|
|
3818
3833
|
0,
|
|
3819
3834
|
0,
|
|
@@ -3823,16 +3838,16 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3823
3838
|
59,
|
|
3824
3839
|
59,
|
|
3825
3840
|
999
|
|
3826
|
-
), Et =
|
|
3841
|
+
), Et = x.start.getTime(), gt = x.end.getTime() - 6e4, st = Math.max(Et, nt), j = Math.min(gt, q), pt = new Date(st), vt = new Date(j), Pt = pt.getHours() * 60 + pt.getMinutes(), Rt = vt.getHours() * 60 + vt.getMinutes(), $t = W + J.row * this.dayHeight;
|
|
3827
3842
|
rt = $t + Pt / 1440 * this.dayHeight, ut = $t + Rt / 1440 * this.dayHeight;
|
|
3828
3843
|
} else {
|
|
3829
|
-
const nt = `${
|
|
3844
|
+
const nt = `${C}-${x.id}`;
|
|
3830
3845
|
let q = y.get(nt);
|
|
3831
3846
|
if (q === void 0) {
|
|
3832
3847
|
for (q = 0; ; ) {
|
|
3833
3848
|
let st = !0;
|
|
3834
|
-
for (let j =
|
|
3835
|
-
const pt = `${
|
|
3849
|
+
for (let j = U; j <= L; j++) {
|
|
3850
|
+
const pt = `${C}-${j}`;
|
|
3836
3851
|
if (p.get(pt)?.has(q)) {
|
|
3837
3852
|
st = !1;
|
|
3838
3853
|
break;
|
|
@@ -3843,8 +3858,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3843
3858
|
}
|
|
3844
3859
|
y.set(nt, q);
|
|
3845
3860
|
}
|
|
3846
|
-
for (let st =
|
|
3847
|
-
const j = `${
|
|
3861
|
+
for (let st = U; st <= L; st++) {
|
|
3862
|
+
const j = `${C}-${st}`;
|
|
3848
3863
|
let pt = p.get(j);
|
|
3849
3864
|
pt || (pt = /* @__PURE__ */ new Set(), p.set(j, pt)), pt.add(q);
|
|
3850
3865
|
}
|
|
@@ -3859,7 +3874,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3859
3874
|
ut - rt
|
|
3860
3875
|
);
|
|
3861
3876
|
let X, Tt;
|
|
3862
|
-
const Qt = `${
|
|
3877
|
+
const Qt = `${C}-${x.id}-${U}`, kt = E.get(Qt);
|
|
3863
3878
|
if (c && !K && kt && kt.totalColumns > 1) {
|
|
3864
3879
|
const nt = s / kt.totalColumns;
|
|
3865
3880
|
X = z + J.col * s + kt.column * nt, Tt = nt;
|
|
@@ -3869,16 +3884,16 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3869
3884
|
}
|
|
3870
3885
|
const ft = rt - e;
|
|
3871
3886
|
if (ft + Q < 0 || ft > i) continue;
|
|
3872
|
-
const $e =
|
|
3887
|
+
const $e = x.color || "#888888", Ht = this.internal.isEventSelected(x), sn = this.hoveredEventId === x.id, ct = 2, Dt = Tt - ct * 2, te = 3, si = 6;
|
|
3873
3888
|
let Ct = 4, zt = 4, Mt = 4, Ft = 4;
|
|
3874
|
-
R > 1 && (P && !B ? (zt = 0, Ft = 0) : !P && B ? (Ct = 0, Mt = 0) : !P && !B && (Ct = 0, zt = 0, Mt = 0, Ft = 0)), t.save(),
|
|
3889
|
+
R > 1 && (P && !B ? (zt = 0, Ft = 0) : !P && B ? (Ct = 0, Mt = 0) : !P && !B && (Ct = 0, zt = 0, Mt = 0, Ft = 0)), t.save(), x.readOnly && (t.globalAlpha = 0.5);
|
|
3875
3890
|
const Bt = Ps(Re($e)), ri = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.9)", Ae = getComputedStyle(this).getPropertyValue("--text-inverse").trim() || "rgb(0, 0, 0)", rn = Ht ? $e : `hsla(${Bt[0]}, ${Math.min(Bt[1] * 0.9, 90)}%, ${Math.min(
|
|
3876
3891
|
Bt[2] + 15,
|
|
3877
3892
|
40
|
|
3878
3893
|
)}%, 0.45)`, on = Ht ? $e : `hsla(${Bt[0]}, ${Math.min(Bt[1] * 0.9, 90)}%, ${Math.min(
|
|
3879
3894
|
Bt[2] + 10,
|
|
3880
3895
|
70
|
|
3881
|
-
)}%, 1)`, an = this.shouldRenderEventWithStripes(
|
|
3896
|
+
)}%, 1)`, an = this.shouldRenderEventWithStripes(x);
|
|
3882
3897
|
if (t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3883
3898
|
Ct,
|
|
3884
3899
|
zt,
|
|
@@ -3926,13 +3941,13 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3926
3941
|
ft,
|
|
3927
3942
|
Dt - te,
|
|
3928
3943
|
Q
|
|
3929
|
-
), t.clip(),
|
|
3944
|
+
), t.clip(), x.rrule) {
|
|
3930
3945
|
t.font = `11px ${a}`;
|
|
3931
3946
|
const vt = "⟳", Pt = t.measureText(vt).width;
|
|
3932
3947
|
t.fillText(vt, q, Et), gt -= Pt + 4;
|
|
3933
3948
|
}
|
|
3934
|
-
const st = q + (
|
|
3935
|
-
let j =
|
|
3949
|
+
const st = q + (x.rrule ? t.measureText("⟳").width + 4 : 0);
|
|
3950
|
+
let j = x.title;
|
|
3936
3951
|
if (t.font = `11px ${a}`, t.measureText(j).width > gt) {
|
|
3937
3952
|
const Pt = t.measureText("…").width;
|
|
3938
3953
|
let Rt = 0, $t = j.length, fe = 0;
|
|
@@ -3946,7 +3961,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3946
3961
|
const vt = (ge) => {
|
|
3947
3962
|
const pe = ge.getHours(), ee = ge.getMinutes(), ie = pe >= 12 ? "PM" : "AM";
|
|
3948
3963
|
return `${pe % 12 || 12}:${ee.toString().padStart(2, "0")} ${ie}`;
|
|
3949
|
-
}, Pt = vt(
|
|
3964
|
+
}, Pt = vt(x.start), Rt = vt(x.end), $t = `${Pt} – ${Rt}`, fe = Ht ? Ae : ri;
|
|
3950
3965
|
t.fillStyle = fe, t.font = `10px ${a}`;
|
|
3951
3966
|
let ht = $t;
|
|
3952
3967
|
if (t.measureText(ht).width > gt) {
|
|
@@ -3963,7 +3978,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3963
3978
|
t.restore();
|
|
3964
3979
|
}
|
|
3965
3980
|
t.restore(), this.eventRects.push({
|
|
3966
|
-
event:
|
|
3981
|
+
event: x,
|
|
3967
3982
|
x: X + ct,
|
|
3968
3983
|
y: rt,
|
|
3969
3984
|
width: Dt,
|
|
@@ -3983,29 +3998,29 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3983
3998
|
"October",
|
|
3984
3999
|
"November",
|
|
3985
4000
|
"December"
|
|
3986
|
-
],
|
|
4001
|
+
], A = [], _ = /* @__PURE__ */ new Set();
|
|
3987
4002
|
for (const b of r) {
|
|
3988
|
-
const
|
|
3989
|
-
if (!
|
|
3990
|
-
const T =
|
|
3991
|
-
if (!
|
|
3992
|
-
|
|
4003
|
+
const x = b.days[0];
|
|
4004
|
+
if (!x) continue;
|
|
4005
|
+
const T = x.getMonth(), C = x.getFullYear(), U = `${T}-${C}`;
|
|
4006
|
+
if (!_.has(U)) {
|
|
4007
|
+
_.add(U);
|
|
3993
4008
|
const L = S[T];
|
|
3994
|
-
L &&
|
|
3995
|
-
monthKey:
|
|
4009
|
+
L && A.push({
|
|
4010
|
+
monthKey: U,
|
|
3996
4011
|
monthName: L,
|
|
3997
|
-
year:
|
|
4012
|
+
year: C,
|
|
3998
4013
|
yOffset: b.yOffset
|
|
3999
4014
|
});
|
|
4000
4015
|
}
|
|
4001
4016
|
}
|
|
4002
|
-
for (let b = 0; b <
|
|
4003
|
-
const
|
|
4004
|
-
if (
|
|
4005
|
-
if (
|
|
4006
|
-
const L = [12, 0, 0, 12], P = Math.max(0, e -
|
|
4017
|
+
for (let b = 0; b < A.length; b++) {
|
|
4018
|
+
const x = A[b], T = A[b + 1], C = x.yOffset, U = T ? T.yOffset : this.totalHeight;
|
|
4019
|
+
if (U < e) continue;
|
|
4020
|
+
if (C > l) break;
|
|
4021
|
+
const L = [12, 0, 0, 12], P = Math.max(0, e - C), B = U - C - 24, R = Math.min(P, B), K = C + R - e + 32;
|
|
4007
4022
|
t.save(), t.font = `bold 18px ${a}`, t.textAlign = "left", t.textBaseline = "top";
|
|
4008
|
-
const J = `${
|
|
4023
|
+
const J = `${x.monthName} ${x.year}`, wt = t.measureText(J).width, ut = 64 + L[3] + 8, Q = K + L[0], X = 8, Tt = 8, Qt = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
|
|
4009
4024
|
t.fillStyle = Qt, t.beginPath(), t.roundRect(
|
|
4010
4025
|
ut - X,
|
|
4011
4026
|
Q - 4,
|
|
@@ -4173,40 +4188,40 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4173
4188
|
for (let p = 0; p < 7; p++) {
|
|
4174
4189
|
const y = g.days[p];
|
|
4175
4190
|
if (!y) continue;
|
|
4176
|
-
const { row:
|
|
4191
|
+
const { row: M, col: H } = this.getDayVisualPosition(p);
|
|
4177
4192
|
if (H < l || H > c) continue;
|
|
4178
|
-
const
|
|
4179
|
-
if (s <
|
|
4180
|
-
const
|
|
4193
|
+
const $ = g.yOffset + M * this.dayHeight, w = $ + this.dayHeight;
|
|
4194
|
+
if (s < $ || i > w) continue;
|
|
4195
|
+
const D = Math.max(i, $), E = Math.min(s, w), S = D - $, A = Math.floor(
|
|
4181
4196
|
S / this.dayHeight * 24 * 60
|
|
4182
|
-
),
|
|
4183
|
-
|
|
4184
|
-
),
|
|
4185
|
-
L.setHours(
|
|
4197
|
+
), _ = Math.floor(A / 60), b = A % 60, x = E - $, T = Math.ceil(
|
|
4198
|
+
x / this.dayHeight * 24 * 60
|
|
4199
|
+
), C = Math.floor(T / 60), U = T % 60, L = new Date(y);
|
|
4200
|
+
L.setHours(_, b, 0, 0);
|
|
4186
4201
|
const P = new Date(y);
|
|
4187
|
-
P.setHours(
|
|
4202
|
+
P.setHours(C, U, 59, 999), h.push({ start: L, end: P });
|
|
4188
4203
|
}
|
|
4189
4204
|
else
|
|
4190
4205
|
for (const g of d)
|
|
4191
4206
|
for (let p = 0; p < 7; p++) {
|
|
4192
4207
|
const y = g.days[p];
|
|
4193
4208
|
if (!y) continue;
|
|
4194
|
-
const { row:
|
|
4209
|
+
const { row: M, col: H } = this.getDayVisualPosition(p);
|
|
4195
4210
|
if (H < l || H > c) continue;
|
|
4196
|
-
const
|
|
4197
|
-
if (s <
|
|
4198
|
-
const
|
|
4199
|
-
|
|
4200
|
-
const
|
|
4201
|
-
|
|
4211
|
+
const $ = g.yOffset + M * this.dayHeight, w = $ + this.dayHeight;
|
|
4212
|
+
if (s < $ || i > w) continue;
|
|
4213
|
+
const D = new Date(y);
|
|
4214
|
+
D.setHours(0, 0, 0, 0);
|
|
4215
|
+
const E = new Date(y);
|
|
4216
|
+
E.setHours(23, 59, 59, 999), h.push({ start: D, end: E });
|
|
4202
4217
|
}
|
|
4203
4218
|
const f = /* @__PURE__ */ new Set();
|
|
4204
4219
|
for (const g of this.events) {
|
|
4205
4220
|
if (g.isAllDay) continue;
|
|
4206
4221
|
const p = g.start.getTime(), y = g.end.getTime();
|
|
4207
|
-
for (const
|
|
4208
|
-
const H =
|
|
4209
|
-
if (!(y < H || p >
|
|
4222
|
+
for (const M of h) {
|
|
4223
|
+
const H = M.start.getTime(), $ = M.end.getTime();
|
|
4224
|
+
if (!(y < H || p > $)) {
|
|
4210
4225
|
f.add(g);
|
|
4211
4226
|
break;
|
|
4212
4227
|
}
|
|
@@ -4233,7 +4248,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4233
4248
|
), this.renderCanvas();
|
|
4234
4249
|
}
|
|
4235
4250
|
renderEvents() {
|
|
4236
|
-
return
|
|
4251
|
+
return O``;
|
|
4237
4252
|
}
|
|
4238
4253
|
checkAndExtendRange() {
|
|
4239
4254
|
if (this.isExtendingRange || this.filter) return;
|
|
@@ -4364,32 +4379,32 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4364
4379
|
this.movingEventEnd.y
|
|
4365
4380
|
);
|
|
4366
4381
|
if (!t || !e) return;
|
|
4367
|
-
const i = e.getTime() - t.getTime(), s = (
|
|
4382
|
+
const i = e.getTime() - t.getTime(), s = (c) => (c.setMinutes(Math.round(c.getMinutes() / 15) * 15, 0, 0), c), r = s(
|
|
4368
4383
|
new Date(this.movingEvent.start.getTime() + i)
|
|
4369
|
-
), o = s(new Date(this.movingEvent.end.getTime() + i));
|
|
4384
|
+
), o = s(new Date(this.movingEvent.end.getTime() + i)), a = (this.movingEvent.start.getTime() + this.movingEvent.end.getTime()) / 2, l = t.getTime() <= a;
|
|
4370
4385
|
if (this.movingEventDuplicateMode) {
|
|
4371
|
-
const
|
|
4386
|
+
const c = getComputedStyle(this).getPropertyValue("--accent-primary").trim() || "rgb(100, 150, 255)";
|
|
4372
4387
|
this.renderVirtualEvent(
|
|
4373
4388
|
r,
|
|
4374
4389
|
o,
|
|
4375
4390
|
{
|
|
4376
|
-
fill:
|
|
4377
|
-
stroke:
|
|
4391
|
+
fill: c.replace("rgb", "rgba").replace(")", ", 0.3)"),
|
|
4392
|
+
stroke: c.replace("rgb", "rgba").replace(")", ", 0.8)"),
|
|
4378
4393
|
text: "white"
|
|
4379
4394
|
},
|
|
4380
|
-
|
|
4395
|
+
l
|
|
4381
4396
|
);
|
|
4382
4397
|
} else {
|
|
4383
|
-
const
|
|
4398
|
+
const c = Re(this.movingEvent.color || "#888888");
|
|
4384
4399
|
this.renderVirtualEvent(
|
|
4385
4400
|
r,
|
|
4386
4401
|
o,
|
|
4387
4402
|
{
|
|
4388
|
-
fill: `rgba(${
|
|
4389
|
-
stroke: `rgba(${
|
|
4403
|
+
fill: `rgba(${c[0]}, ${c[1]}, ${c[2]}, 0.5)`,
|
|
4404
|
+
stroke: `rgba(${c[0]}, ${c[1]}, ${c[2]}, 0.5)`,
|
|
4390
4405
|
text: "rgba(255, 255, 255, 0.5)"
|
|
4391
4406
|
},
|
|
4392
|
-
|
|
4407
|
+
l
|
|
4393
4408
|
);
|
|
4394
4409
|
}
|
|
4395
4410
|
}
|
|
@@ -4405,104 +4420,91 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4405
4420
|
if (!t || !e) return;
|
|
4406
4421
|
let i, s;
|
|
4407
4422
|
if (this.eventCreationShiftPressed && this.eventCreationInitialDuration !== null) {
|
|
4408
|
-
const
|
|
4423
|
+
const l = this.convertPositionToDateTime(
|
|
4409
4424
|
this.eventCreationEnd.x,
|
|
4410
4425
|
this.eventCreationEnd.y
|
|
4411
4426
|
);
|
|
4412
|
-
if (!
|
|
4413
|
-
s = new Date(
|
|
4414
|
-
|
|
4427
|
+
if (!l) return;
|
|
4428
|
+
s = new Date(l), i = new Date(
|
|
4429
|
+
l.getTime() - this.eventCreationInitialDuration
|
|
4415
4430
|
);
|
|
4416
4431
|
} else
|
|
4417
4432
|
i = t < e ? t : e, s = t < e ? e : t;
|
|
4418
4433
|
i.setMinutes(Math.round(i.getMinutes() / 15) * 15, 0, 0), s.setMinutes(Math.round(s.getMinutes() / 15) * 15, 0, 0);
|
|
4419
4434
|
let r, o;
|
|
4420
4435
|
if (this.activeCalendarColor) {
|
|
4421
|
-
const
|
|
4422
|
-
r = `rgba(${
|
|
4436
|
+
const l = Re(this.activeCalendarColor);
|
|
4437
|
+
r = `rgba(${l[0]}, ${l[1]}, ${l[2]}, 0.3)`, o = `rgba(${l[0]}, ${l[1]}, ${l[2]}, 0.8)`;
|
|
4423
4438
|
} else {
|
|
4424
|
-
const
|
|
4425
|
-
r =
|
|
4426
|
-
}
|
|
4427
|
-
this.
|
|
4428
|
-
|
|
4429
|
-
s,
|
|
4430
|
-
{
|
|
4431
|
-
fill: r,
|
|
4432
|
-
stroke: o,
|
|
4433
|
-
text: "white"
|
|
4434
|
-
},
|
|
4435
|
-
this.eventCreationEnd.y
|
|
4436
|
-
);
|
|
4439
|
+
const l = getComputedStyle(this).getPropertyValue("--accent-primary").trim() || "rgb(100, 150, 255)";
|
|
4440
|
+
r = l.replace("rgb", "rgba").replace(")", ", 0.3)"), o = l.replace("rgb", "rgba").replace(")", ", 0.8)");
|
|
4441
|
+
}
|
|
4442
|
+
const a = this.eventCreationShiftPressed ? !1 : this.eventCreationEnd.y <= this.eventCreationStart.y;
|
|
4443
|
+
this.renderVirtualEvent(i, s, { fill: r, stroke: o, text: "white" }, a);
|
|
4437
4444
|
}
|
|
4438
|
-
renderVirtualEvent(t, e, i, s) {
|
|
4445
|
+
renderVirtualEvent(t, e, i, s = !0) {
|
|
4439
4446
|
if (!this.overlayCanvas || !this.overlayCtx || !this.scrollContainer)
|
|
4440
4447
|
return;
|
|
4441
|
-
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - z - Yi) / this._columnsPerRow, d = (S,
|
|
4448
|
+
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - z - Yi) / this._columnsPerRow, d = (S, A, _) => {
|
|
4442
4449
|
const b = this.weeks.find(
|
|
4443
4450
|
(L) => L.days.some((P) => P.toDateString() === S.toDateString())
|
|
4444
4451
|
);
|
|
4445
4452
|
if (!b) return null;
|
|
4446
|
-
const
|
|
4453
|
+
const x = b.days.findIndex(
|
|
4447
4454
|
(L) => L.toDateString() === S.toDateString()
|
|
4448
4455
|
);
|
|
4449
|
-
if (
|
|
4450
|
-
const { row: T } = this.getDayVisualPosition(
|
|
4451
|
-
return b.yOffset + T * this.dayHeight +
|
|
4456
|
+
if (x < 0) return null;
|
|
4457
|
+
const { row: T } = this.getDayVisualPosition(x), C = A * 60 + _;
|
|
4458
|
+
return b.yOffset + T * this.dayHeight + C / 1440 * this.dayHeight - this.scrollTop;
|
|
4452
4459
|
}, h = (S) => {
|
|
4453
|
-
const
|
|
4454
|
-
(
|
|
4460
|
+
const A = this.weeks.find(
|
|
4461
|
+
(x) => x.days.some((T) => T.toDateString() === S.toDateString())
|
|
4455
4462
|
);
|
|
4456
|
-
if (!
|
|
4457
|
-
const
|
|
4458
|
-
(
|
|
4463
|
+
if (!A) return null;
|
|
4464
|
+
const _ = A.days.findIndex(
|
|
4465
|
+
(x) => x.toDateString() === S.toDateString()
|
|
4459
4466
|
);
|
|
4460
|
-
if (
|
|
4461
|
-
const { col: b } = this.getDayVisualPosition(
|
|
4467
|
+
if (_ < 0) return null;
|
|
4468
|
+
const { col: b } = this.getDayVisualPosition(_);
|
|
4462
4469
|
return b * c;
|
|
4463
|
-
}, u = (S,
|
|
4464
|
-
const b = S + 2,
|
|
4465
|
-
r.fillStyle = i.fill, r.beginPath(), r.roundRect(b,
|
|
4470
|
+
}, u = (S, A, _) => {
|
|
4471
|
+
const b = S + 2, x = c - 4, T = Math.max(4, _ - A);
|
|
4472
|
+
r.fillStyle = i.fill, r.beginPath(), r.roundRect(b, A, x, T, 4), r.fill(), r.strokeStyle = i.stroke, r.lineWidth = 1, r.setLineDash([6, 3]), r.stroke(), r.setLineDash([]);
|
|
4466
4473
|
}, f = t.toDateString() === e.toDateString();
|
|
4467
4474
|
if (f) {
|
|
4468
|
-
const S = h(t),
|
|
4469
|
-
S != null &&
|
|
4475
|
+
const S = h(t), A = d(t, t.getHours(), t.getMinutes()), _ = d(e, e.getHours(), e.getMinutes());
|
|
4476
|
+
S != null && A != null && _ != null && u(S, A, _);
|
|
4470
4477
|
} else {
|
|
4471
4478
|
const S = new Date(t);
|
|
4472
4479
|
S.setHours(0, 0, 0, 0);
|
|
4473
|
-
const
|
|
4474
|
-
for (
|
|
4475
|
-
const
|
|
4476
|
-
if (
|
|
4477
|
-
const b = S.toDateString() === t.toDateString(),
|
|
4478
|
-
let T,
|
|
4479
|
-
b ? (T = d(S, t.getHours(), t.getMinutes()),
|
|
4480
|
+
const A = new Date(e);
|
|
4481
|
+
for (A.setHours(23, 59, 59, 999); S <= A; ) {
|
|
4482
|
+
const _ = h(S);
|
|
4483
|
+
if (_ != null) {
|
|
4484
|
+
const b = S.toDateString() === t.toDateString(), x = S.toDateString() === e.toDateString();
|
|
4485
|
+
let T, C;
|
|
4486
|
+
b ? (T = d(S, t.getHours(), t.getMinutes()), C = d(S, 23, 59)) : x ? (T = d(S, 0, 0), C = d(S, e.getHours(), e.getMinutes())) : (T = d(S, 0, 0), C = d(S, 23, 59)), T != null && C != null && u(_, T, C);
|
|
4480
4487
|
}
|
|
4481
4488
|
S.setDate(S.getDate() + 1);
|
|
4482
4489
|
}
|
|
4483
4490
|
}
|
|
4484
|
-
const v = (S) => `${S.getHours().toString().padStart(2, "0")}:${S.getMinutes().toString().padStart(2, "0")}`, g = (S) => `${S.getDate()}.${S.getMonth() + 1}`, p = f ? `${v(t)} – ${v(e)}` : `${g(t)} ${v(t)} – ${g(e)} ${v(e)}`, H = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15,
|
|
4485
|
-
if (
|
|
4491
|
+
const v = (S) => `${S.getHours().toString().padStart(2, "0")}:${S.getMinutes().toString().padStart(2, "0")}`, g = (S) => `${S.getDate()}.${S.getMonth() + 1}`, p = f ? `${v(t)} – ${v(e)}` : `${g(t)} ${v(t)} – ${g(e)} ${v(e)}`, H = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15, $ = h(t), w = h(e), D = d(t, t.getHours(), t.getMinutes()), E = d(e, e.getHours(), e.getMinutes());
|
|
4492
|
+
if ($ != null && w != null && D != null && E != null) {
|
|
4486
4493
|
r.font = `600 11px ${o}`, r.fillStyle = i.text, r.textAlign = "left";
|
|
4487
|
-
|
|
4488
|
-
if (s !== void 0) {
|
|
4489
|
-
const A = s - this.scrollTop, b = Math.abs(A - $), E = Math.abs(A - w);
|
|
4490
|
-
S = b < E;
|
|
4491
|
-
}
|
|
4492
|
-
const O = S ? M : x;
|
|
4494
|
+
const S = s ? $ : w;
|
|
4493
4495
|
if (H) {
|
|
4494
|
-
const A =
|
|
4495
|
-
r.fillStyle =
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4496
|
+
const A = s ? D : E, _ = A + 6, b = A + 10, x = r.measureText(p).width, T = 6, C = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.8)";
|
|
4497
|
+
r.fillStyle = C, r.beginPath(), r.roundRect(
|
|
4498
|
+
S + 4,
|
|
4499
|
+
_,
|
|
4500
|
+
x + T * 2,
|
|
4499
4501
|
16,
|
|
4500
4502
|
4
|
|
4501
|
-
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(p,
|
|
4503
|
+
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(p, S + 4 + T, b);
|
|
4502
4504
|
} else {
|
|
4503
4505
|
r.textBaseline = "top";
|
|
4504
|
-
const A =
|
|
4505
|
-
r.fillText(p,
|
|
4506
|
+
const A = s ? D + 4 : E - 18;
|
|
4507
|
+
r.fillText(p, S + 8, A);
|
|
4506
4508
|
}
|
|
4507
4509
|
}
|
|
4508
4510
|
}
|
|
@@ -4523,19 +4525,19 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4523
4525
|
if (!d) continue;
|
|
4524
4526
|
const { row: h, col: u } = this.getDayVisualPosition(c), f = u * s, v = l.yOffset + h * this.dayHeight - r, g = v + this.dayHeight;
|
|
4525
4527
|
if (c === 5 || c === 6) {
|
|
4526
|
-
const
|
|
4527
|
-
t.fillStyle =
|
|
4528
|
+
const w = getComputedStyle(this).getPropertyValue("--bg-weekend").trim() || "rgba(255, 255, 255, 0.03)";
|
|
4529
|
+
t.fillStyle = w, t.fillRect(f, v, s, this.dayHeight);
|
|
4528
4530
|
}
|
|
4529
4531
|
const p = this.dayHeight >= 300, y = /* @__PURE__ */ new Date();
|
|
4530
|
-
if (!p &&
|
|
4531
|
-
const
|
|
4532
|
-
t.strokeStyle =
|
|
4532
|
+
if (!p && N.isSameDay(d, y)) {
|
|
4533
|
+
const w = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
|
|
4534
|
+
t.strokeStyle = w, t.lineWidth = 1, t.strokeRect(f + 1, v + 1, s - 2, this.dayHeight - 2), t.lineWidth = 1;
|
|
4533
4535
|
}
|
|
4534
|
-
const
|
|
4535
|
-
g -
|
|
4536
|
-
i -
|
|
4536
|
+
const M = 12, $ = Math.min(
|
|
4537
|
+
g - M - 8,
|
|
4538
|
+
i - M - 64
|
|
4537
4539
|
);
|
|
4538
|
-
v < i && g > 0 &&
|
|
4540
|
+
v < i && g > 0 && $ > v && (t.fillStyle = a, t.fillText(d.getDate().toString(), f + s - 12, $));
|
|
4539
4541
|
}
|
|
4540
4542
|
}
|
|
4541
4543
|
}
|
|
@@ -4551,25 +4553,25 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4551
4553
|
const p = Math.min(h, g - d - 2);
|
|
4552
4554
|
if (!(p < 0))
|
|
4553
4555
|
for (let y = 0; y < this._columnsPerRow; y++) {
|
|
4554
|
-
const
|
|
4555
|
-
if (
|
|
4556
|
-
const H = o[
|
|
4556
|
+
const M = f * this._columnsPerRow + y;
|
|
4557
|
+
if (M >= 7) continue;
|
|
4558
|
+
const H = o[M];
|
|
4557
4559
|
if (!H) continue;
|
|
4558
|
-
const
|
|
4560
|
+
const $ = z + y * e + e / 2, w = t.measureText(H).width, D = 6, E = 2;
|
|
4559
4561
|
t.fillStyle = c, t.beginPath(), t.roundRect(
|
|
4560
|
-
|
|
4562
|
+
$ - w / 2 - D,
|
|
4561
4563
|
p,
|
|
4562
|
-
|
|
4564
|
+
w + D * 2,
|
|
4563
4565
|
d,
|
|
4564
4566
|
4
|
|
4565
|
-
), t.fill(), t.fillStyle = l, t.fillText(H,
|
|
4567
|
+
), t.fill(), t.fillStyle = l, t.fillText(H, $, p + E + 1);
|
|
4566
4568
|
}
|
|
4567
4569
|
}
|
|
4568
4570
|
}
|
|
4569
4571
|
renderSelection() {
|
|
4570
|
-
if (!this.selection) return
|
|
4572
|
+
if (!this.selection) return O``;
|
|
4571
4573
|
const t = Math.min(this.selection.startX, this.selection.endX), e = Math.max(this.selection.startX, this.selection.endX), i = Math.min(this.selection.startY, this.selection.endY), s = Math.max(this.selection.startY, this.selection.endY);
|
|
4572
|
-
return
|
|
4574
|
+
return O`
|
|
4573
4575
|
<div
|
|
4574
4576
|
class="selection"
|
|
4575
4577
|
style="
|
|
@@ -4595,20 +4597,20 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4595
4597
|
for (let p = v; p <= g; p++) {
|
|
4596
4598
|
const y = this.weeks[p];
|
|
4597
4599
|
if (!y || y.height === 0) continue;
|
|
4598
|
-
const
|
|
4599
|
-
if (!
|
|
4600
|
-
const
|
|
4601
|
-
|
|
4602
|
-
),
|
|
4603
|
-
|
|
4604
|
-
),
|
|
4605
|
-
i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2,
|
|
4600
|
+
const M = y.days[0], H = y.days[6];
|
|
4601
|
+
if (!M || !H) continue;
|
|
4602
|
+
const $ = M.getTime(), w = H.getTime() + a - 1, D = Math.max(d, $), E = Math.min(h, w), S = Math.floor(
|
|
4603
|
+
D % a / l
|
|
4604
|
+
), A = Math.floor(
|
|
4605
|
+
E % a / l
|
|
4606
|
+
), _ = y.yOffset / this.totalHeight * e + S / 1440 * (y.height / this.totalHeight * e), b = y.yOffset / this.totalHeight * e + A / 1440 * (y.height / this.totalHeight * e);
|
|
4607
|
+
i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2, _, t - 4, Math.max(b - _, 2));
|
|
4606
4608
|
}
|
|
4607
4609
|
}
|
|
4608
4610
|
}
|
|
4609
4611
|
renderMinimap() {
|
|
4610
|
-
if (this.totalHeight === 0 || this.weeks.length === 0) return
|
|
4611
|
-
if (!this.minimapBufferCanvas) return
|
|
4612
|
+
if (this.totalHeight === 0 || this.weeks.length === 0) return O``;
|
|
4613
|
+
if (!this.minimapBufferCanvas) return O``;
|
|
4612
4614
|
const t = 32, e = 2e3, i = this.viewportHeight / this.totalHeight, s = this.scrollTop / this.totalHeight * e, r = Math.max(i * e, 4), o = this.minimapCanvas, a = o.getContext("2d");
|
|
4613
4615
|
if (o.width = t, o.height = e, !a) throw new Error("Failed to get 2d context");
|
|
4614
4616
|
a.drawImage(this.minimapBufferCanvas, 0, 0), getComputedStyle(this).getPropertyValue("--grid-color").trim();
|
|
@@ -4750,7 +4752,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4750
4752
|
}
|
|
4751
4753
|
renderNotificationsList(t) {
|
|
4752
4754
|
return t.reminders?.length ? t.reminders.map(
|
|
4753
|
-
(e) =>
|
|
4755
|
+
(e) => O`
|
|
4754
4756
|
<div class="notification-item">
|
|
4755
4757
|
<select
|
|
4756
4758
|
class="notification-select"
|
|
@@ -4761,7 +4763,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4761
4763
|
}}
|
|
4762
4764
|
>
|
|
4763
4765
|
${As.map(
|
|
4764
|
-
(i) =>
|
|
4766
|
+
(i) => O`<option value="${i.value}" ?selected=${i.value === e.triggerOffset}>${i.label}</option>`
|
|
4765
4767
|
)}
|
|
4766
4768
|
</select>
|
|
4767
4769
|
<button
|
|
@@ -4770,7 +4772,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4770
4772
|
>×</button>
|
|
4771
4773
|
</div>
|
|
4772
4774
|
`
|
|
4773
|
-
) :
|
|
4775
|
+
) : O`<div class="notification-empty-state">No notifications set</div>`;
|
|
4774
4776
|
}
|
|
4775
4777
|
addNotification(t) {
|
|
4776
4778
|
const e = {
|
|
@@ -4828,64 +4830,64 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4828
4830
|
renderEventDetail() {
|
|
4829
4831
|
if (!this.selectedEventForDetail || !this.selectedEventRect)
|
|
4830
4832
|
return null;
|
|
4831
|
-
const t = this.selectedEventForDetail, e = (
|
|
4833
|
+
const t = this.selectedEventForDetail, e = (w) => new Intl.DateTimeFormat(this.locale, {
|
|
4832
4834
|
weekday: "short",
|
|
4833
4835
|
year: "numeric",
|
|
4834
4836
|
month: "short",
|
|
4835
4837
|
day: "numeric"
|
|
4836
|
-
}).format(
|
|
4838
|
+
}).format(w), i = (w) => new Intl.DateTimeFormat(this.locale, {
|
|
4837
4839
|
hour: "numeric",
|
|
4838
4840
|
minute: "2-digit"
|
|
4839
|
-
}).format(
|
|
4840
|
-
return
|
|
4841
|
-
<div class="event-detail-overlay" style="${
|
|
4841
|
+
}).format(w), s = N.isSameDay(t.start, t.end), r = 320, o = 550, a = 8, l = this.scrollContainer?.clientWidth || 800, c = this.scrollContainer?.clientHeight || 600, d = this.selectedEventRect.x + this.selectedEventRect.width + a, h = this.selectedEventRect.x - r - a, u = d + r <= l ? d : h, f = z + a, v = l - r - a, g = Math.max(f, Math.min(v, u)), p = this.selectedEventRect.y - this.scrollTop, y = a, M = c - o - a, H = Math.max(y, Math.min(M, p)), $ = `left: ${g}px; top: ${H}px; --calendar-color: ${t.color || "#888888"};`;
|
|
4842
|
+
return O`
|
|
4843
|
+
<div class="event-detail-overlay" style="${$}">
|
|
4842
4844
|
<div class="event-detail-content">
|
|
4843
4845
|
<div class="event-detail-header">
|
|
4844
4846
|
<div class="event-detail-header-content">
|
|
4845
|
-
${t.calendar ?
|
|
4847
|
+
${t.calendar ? O`
|
|
4846
4848
|
<div class="event-detail-section event-detail-calendar">
|
|
4847
4849
|
<div class="event-detail-value">${t.calendar}</div>
|
|
4848
4850
|
</div>
|
|
4849
4851
|
` : null}
|
|
4850
|
-
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ?
|
|
4851
|
-
<h3 class="event-detail-title">${t.rrule ?
|
|
4852
|
-
` :
|
|
4852
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? O`
|
|
4853
|
+
<h3 class="event-detail-title">${t.rrule ? O`<span style="opacity: 0.6">⟳</span> ` : ""}${t.title}</h3>
|
|
4854
|
+
` : O`
|
|
4853
4855
|
<textarea
|
|
4854
4856
|
class="event-detail-title-input"
|
|
4855
4857
|
.value=${t.title}
|
|
4856
4858
|
placeholder="Event title"
|
|
4857
|
-
@input=${(
|
|
4858
|
-
const
|
|
4859
|
-
|
|
4859
|
+
@input=${(w) => {
|
|
4860
|
+
const E = w.target.value;
|
|
4861
|
+
E !== t.title && (this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
4860
4862
|
this.dispatchEvent(
|
|
4861
4863
|
new CustomEvent("update-event", {
|
|
4862
|
-
detail: { event: t, updates: { title:
|
|
4864
|
+
detail: { event: t, updates: { title: E } },
|
|
4863
4865
|
bubbles: !0,
|
|
4864
4866
|
composed: !0
|
|
4865
4867
|
})
|
|
4866
4868
|
), this.updateEventTimeout = null;
|
|
4867
4869
|
}, 500));
|
|
4868
4870
|
}}
|
|
4869
|
-
@keydown=${(
|
|
4870
|
-
if (
|
|
4871
|
+
@keydown=${(w) => {
|
|
4872
|
+
if (w.key === "Enter") {
|
|
4871
4873
|
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null);
|
|
4872
|
-
const
|
|
4873
|
-
|
|
4874
|
+
const D = w.target, E = D.value;
|
|
4875
|
+
E !== t.title && this.dispatchEvent(
|
|
4874
4876
|
new CustomEvent("update-event", {
|
|
4875
|
-
detail: { event: t, updates: { title:
|
|
4877
|
+
detail: { event: t, updates: { title: E } },
|
|
4876
4878
|
bubbles: !0,
|
|
4877
4879
|
composed: !0
|
|
4878
4880
|
})
|
|
4879
|
-
),
|
|
4881
|
+
), D.blur();
|
|
4880
4882
|
}
|
|
4881
4883
|
}}
|
|
4882
4884
|
/>
|
|
4883
4885
|
`}
|
|
4884
4886
|
<div class="event-detail-time">
|
|
4885
|
-
${s ?
|
|
4887
|
+
${s ? O`
|
|
4886
4888
|
<div>${e(t.start)}</div>
|
|
4887
4889
|
<div>${i(t.start)} – ${i(t.end)}</div>
|
|
4888
|
-
` :
|
|
4890
|
+
` : O`
|
|
4889
4891
|
<div>${e(t.start)}, ${i(t.start)}</div>
|
|
4890
4892
|
<div>${e(t.end)}, ${i(t.end)}</div>
|
|
4891
4893
|
`}
|
|
@@ -4900,14 +4902,20 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4900
4902
|
</div>
|
|
4901
4903
|
|
|
4902
4904
|
<div class="event-detail-body">
|
|
4903
|
-
${
|
|
4905
|
+
${(() => {
|
|
4906
|
+
const w = t.description?.match(/https:\/\/teams\.microsoft\.com\/[^\s<>"]+/), D = w ? w[0] : null;
|
|
4907
|
+
return !t.location && !D ? null : O`
|
|
4904
4908
|
<div class="event-detail-section">
|
|
4905
4909
|
<div class="event-detail-label">Location</div>
|
|
4906
|
-
<div class="event-detail-value"
|
|
4910
|
+
<div class="event-detail-value">
|
|
4911
|
+
${t.location ? O`<div>${t.location}</div>` : null}
|
|
4912
|
+
${D ? O`<a href="${D}" class="event-detail-link" target="_blank" rel="noopener">Join Microsoft Teams Meeting</a>` : null}
|
|
4913
|
+
</div>
|
|
4907
4914
|
</div>
|
|
4908
|
-
|
|
4915
|
+
`;
|
|
4916
|
+
})()}
|
|
4909
4917
|
|
|
4910
|
-
${t.url ?
|
|
4918
|
+
${t.url ? O`
|
|
4911
4919
|
<div class="event-detail-section">
|
|
4912
4920
|
<div class="event-detail-label">URL</div>
|
|
4913
4921
|
<div class="event-detail-value">
|
|
@@ -4918,7 +4926,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4918
4926
|
</div>
|
|
4919
4927
|
` : null}
|
|
4920
4928
|
|
|
4921
|
-
${t.organizer ?
|
|
4929
|
+
${t.organizer ? O`
|
|
4922
4930
|
<div class="event-detail-section">
|
|
4923
4931
|
<div class="event-detail-label">Organizer</div>
|
|
4924
4932
|
<div class="event-detail-value">
|
|
@@ -4929,17 +4937,17 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4929
4937
|
|
|
4930
4938
|
${(() => {
|
|
4931
4939
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
4932
|
-
const
|
|
4933
|
-
return
|
|
4940
|
+
const w = this.findCurrentUserAttendee(t), D = w ? t.attendees.filter((E) => E !== w) : t.attendees;
|
|
4941
|
+
return D.length > 0 ? O`
|
|
4934
4942
|
<div class="event-detail-section">
|
|
4935
|
-
<div class="event-detail-label">Participants (${
|
|
4943
|
+
<div class="event-detail-label">Participants (${D.length})</div>
|
|
4936
4944
|
<div class="event-detail-value">
|
|
4937
|
-
${
|
|
4938
|
-
(
|
|
4945
|
+
${D.map(
|
|
4946
|
+
(E) => O`
|
|
4939
4947
|
<div style="margin-bottom: 4px">
|
|
4940
|
-
<span title=${
|
|
4941
|
-
${
|
|
4942
|
-
|
|
4948
|
+
<span title=${E.email}>${E.name || E.email}</span>
|
|
4949
|
+
${E.status ? O`<span style="opacity: 0.7"> - ${this.formatAttendeeStatus(
|
|
4950
|
+
E.status
|
|
4943
4951
|
)}</span>` : null}
|
|
4944
4952
|
</div>
|
|
4945
4953
|
`
|
|
@@ -4949,7 +4957,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4949
4957
|
` : null;
|
|
4950
4958
|
})()}
|
|
4951
4959
|
|
|
4952
|
-
${t.readOnly ? null :
|
|
4960
|
+
${t.readOnly ? null : O`
|
|
4953
4961
|
<div class="event-detail-section">
|
|
4954
4962
|
<div class="event-detail-label">
|
|
4955
4963
|
<span>Notifications</span>
|
|
@@ -4964,7 +4972,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4964
4972
|
</div>
|
|
4965
4973
|
`}
|
|
4966
4974
|
|
|
4967
|
-
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? t.description ?
|
|
4975
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? t.description ? O`
|
|
4968
4976
|
<div class="event-detail-section">
|
|
4969
4977
|
<div class="event-detail-label">Description</div>
|
|
4970
4978
|
<div class="event-detail-description ${this.isDescriptionExpanded ? "expanded" : ""}">
|
|
@@ -4975,7 +4983,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4975
4983
|
)}</pre>
|
|
4976
4984
|
</div>
|
|
4977
4985
|
${t.description.length > 300 || t.description.split(`
|
|
4978
|
-
`).length > 8 ?
|
|
4986
|
+
`).length > 8 ? O`
|
|
4979
4987
|
<button
|
|
4980
4988
|
class="description-see-more"
|
|
4981
4989
|
@click=${() => {
|
|
@@ -4986,7 +4994,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4986
4994
|
</button>
|
|
4987
4995
|
` : null}
|
|
4988
4996
|
</div>
|
|
4989
|
-
` : null :
|
|
4997
|
+
` : null : O`
|
|
4990
4998
|
<div class="event-detail-section">
|
|
4991
4999
|
<div class="event-detail-label">Description</div>
|
|
4992
5000
|
<textarea
|
|
@@ -4994,14 +5002,14 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4994
5002
|
.value=${t.description ?? ""}
|
|
4995
5003
|
placeholder="Add description..."
|
|
4996
5004
|
rows="3"
|
|
4997
|
-
@input=${(
|
|
4998
|
-
const
|
|
5005
|
+
@input=${(w) => {
|
|
5006
|
+
const E = w.target.value;
|
|
4999
5007
|
this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
5000
5008
|
this.dispatchEvent(
|
|
5001
5009
|
new CustomEvent("update-event", {
|
|
5002
5010
|
detail: {
|
|
5003
5011
|
event: t,
|
|
5004
|
-
updates: { description:
|
|
5012
|
+
updates: { description: E }
|
|
5005
5013
|
},
|
|
5006
5014
|
bubbles: !0,
|
|
5007
5015
|
composed: !0
|
|
@@ -5009,13 +5017,13 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5009
5017
|
), this.updateEventTimeout = null;
|
|
5010
5018
|
}, 500);
|
|
5011
5019
|
}}
|
|
5012
|
-
@blur=${(
|
|
5013
|
-
const
|
|
5014
|
-
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null),
|
|
5020
|
+
@blur=${(w) => {
|
|
5021
|
+
const E = w.target.value;
|
|
5022
|
+
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null), E !== (t.description ?? "") && this.dispatchEvent(
|
|
5015
5023
|
new CustomEvent("update-event", {
|
|
5016
5024
|
detail: {
|
|
5017
5025
|
event: t,
|
|
5018
|
-
updates: { description:
|
|
5026
|
+
updates: { description: E }
|
|
5019
5027
|
},
|
|
5020
5028
|
bubbles: !0,
|
|
5021
5029
|
composed: !0
|
|
@@ -5029,29 +5037,29 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5029
5037
|
|
|
5030
5038
|
${(() => {
|
|
5031
5039
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
5032
|
-
const
|
|
5033
|
-
return !
|
|
5040
|
+
const w = this.findCurrentUserAttendee(t);
|
|
5041
|
+
return !w || t.readOnly || t.organizer?.email === w.email ? null : O`
|
|
5034
5042
|
<div class="event-detail-footer">
|
|
5035
5043
|
<div class="invite-response-buttons">
|
|
5036
5044
|
<button
|
|
5037
|
-
class="invite-response-button ${
|
|
5038
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
5045
|
+
class="invite-response-button ${w.status === "ACCEPTED" ? "active" : ""}"
|
|
5046
|
+
@click=${() => this.updateAttendeeStatus(t, w, "ACCEPTED")}
|
|
5039
5047
|
>
|
|
5040
5048
|
Accept
|
|
5041
5049
|
</button>
|
|
5042
5050
|
<button
|
|
5043
|
-
class="invite-response-button ${
|
|
5051
|
+
class="invite-response-button ${w.status === "TENTATIVE" ? "active" : ""}"
|
|
5044
5052
|
@click=${() => this.updateAttendeeStatus(
|
|
5045
5053
|
t,
|
|
5046
|
-
|
|
5054
|
+
w,
|
|
5047
5055
|
"TENTATIVE"
|
|
5048
5056
|
)}
|
|
5049
5057
|
>
|
|
5050
5058
|
Maybe
|
|
5051
5059
|
</button>
|
|
5052
5060
|
<button
|
|
5053
|
-
class="invite-response-button ${
|
|
5054
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
5061
|
+
class="invite-response-button ${w.status === "DECLINED" ? "active" : ""}"
|
|
5062
|
+
@click=${() => this.updateAttendeeStatus(t, w, "DECLINED")}
|
|
5055
5063
|
>
|
|
5056
5064
|
Decline
|
|
5057
5065
|
</button>
|
|
@@ -5064,62 +5072,10 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5064
5072
|
`;
|
|
5065
5073
|
}
|
|
5066
5074
|
render() {
|
|
5067
|
-
return
|
|
5075
|
+
return O`
|
|
5068
5076
|
<div class="container ${this.isDraggingFile ? "dragging-file" : ""}">
|
|
5069
|
-
<div class="toolbar">
|
|
5070
|
-
<div class="toolbar-left">
|
|
5071
|
-
<slot name="toolbar-center"></slot>
|
|
5072
|
-
|
|
5073
|
-
<button class="toolbar-button" title="Month" @click=${this.scrollToMonth}>
|
|
5074
|
-
Month
|
|
5075
|
-
</button>
|
|
5076
|
-
<button class="toolbar-button" title="Today" @click=${this.scrollToToday}>
|
|
5077
|
-
Today
|
|
5078
|
-
</button>
|
|
5079
|
-
<button ?disabled=${this.historyStack.length === 0 || this.historyIndex >= this.historyStack.length - 1} class="toolbar-button" title="Back" @click=${this.goBack}>
|
|
5080
|
-
←
|
|
5081
|
-
</button>
|
|
5082
|
-
<button ?disabled=${this.historyStack.length === 0 || this.historyIndex === 0} class="toolbar-button" title="Forward" @click=${this.goForward}>
|
|
5083
|
-
→
|
|
5084
|
-
</button>
|
|
5085
|
-
<div class="toolbar-zoom">
|
|
5086
|
-
<input
|
|
5087
|
-
type="range"
|
|
5088
|
-
class="toolbar-zoom-slider"
|
|
5089
|
-
min="${Nt}"
|
|
5090
|
-
max="${me}"
|
|
5091
|
-
.value=${this.dayHeight}
|
|
5092
|
-
@input=${this.onZoomSliderChange}
|
|
5093
|
-
title="Adjust zoom level"
|
|
5094
|
-
/>
|
|
5095
|
-
</div>
|
|
5096
|
-
</div>
|
|
5097
|
-
|
|
5098
|
-
<div class="toolbar-right">
|
|
5099
|
-
<!--<select
|
|
5100
|
-
class="theme-selector"
|
|
5101
|
-
.value=${this.currentTheme}
|
|
5102
|
-
@change=${this.onThemeChange}
|
|
5103
|
-
title="Select theme"
|
|
5104
|
-
>
|
|
5105
|
-
${Ws.map(
|
|
5106
|
-
(t) => _`<option value="${t.name}">${t.label}</option>`
|
|
5107
|
-
)}
|
|
5108
|
-
</select>-->
|
|
5109
|
-
<div class="toolbar-search">
|
|
5110
|
-
<span class="toolbar-search-icon">🔍</span>
|
|
5111
|
-
<input
|
|
5112
|
-
class="toolbar-search-input"
|
|
5113
|
-
type="text"
|
|
5114
|
-
placeholder="Filter events..."
|
|
5115
|
-
.value=${this.filter}
|
|
5116
|
-
@input=${this.onFilterInput}
|
|
5117
|
-
/>
|
|
5118
|
-
</div>
|
|
5119
|
-
</div>
|
|
5120
|
-
</div>
|
|
5121
|
-
|
|
5122
5077
|
<div class="body">
|
|
5078
|
+
<slot name="sidebar"></slot>
|
|
5123
5079
|
<div class="calendar-area">
|
|
5124
5080
|
<div class="canvas-layer">
|
|
5125
5081
|
<canvas></canvas>
|
|
@@ -5139,6 +5095,57 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5139
5095
|
${this.minimapCanvas}
|
|
5140
5096
|
${this.renderEventDetail()}
|
|
5141
5097
|
${this.renderNotificationPopover()}
|
|
5098
|
+
|
|
5099
|
+
<div class="toolbar">
|
|
5100
|
+
<div class="toolbar-left">
|
|
5101
|
+
<button class="toolbar-button" title="Month" @click=${this.scrollToMonth}>
|
|
5102
|
+
Month
|
|
5103
|
+
</button>
|
|
5104
|
+
<button class="toolbar-button" title="Today" @click=${this.scrollToToday}>
|
|
5105
|
+
Today
|
|
5106
|
+
</button>
|
|
5107
|
+
<button ?disabled=${this.historyStack.length === 0 || this.historyIndex >= this.historyStack.length - 1} class="toolbar-button" title="Back" @click=${this.goBack}>
|
|
5108
|
+
←
|
|
5109
|
+
</button>
|
|
5110
|
+
<button ?disabled=${this.historyStack.length === 0 || this.historyIndex === 0} class="toolbar-button" title="Forward" @click=${this.goForward}>
|
|
5111
|
+
→
|
|
5112
|
+
</button>
|
|
5113
|
+
<div class="toolbar-zoom">
|
|
5114
|
+
<input
|
|
5115
|
+
type="range"
|
|
5116
|
+
class="toolbar-zoom-slider"
|
|
5117
|
+
min="${Nt}"
|
|
5118
|
+
max="${me}"
|
|
5119
|
+
.value=${this.dayHeight}
|
|
5120
|
+
@input=${this.onZoomSliderChange}
|
|
5121
|
+
title="Adjust zoom level"
|
|
5122
|
+
/>
|
|
5123
|
+
</div>
|
|
5124
|
+
</div>
|
|
5125
|
+
|
|
5126
|
+
<div class="toolbar-right">
|
|
5127
|
+
<!--<select
|
|
5128
|
+
class="theme-selector"
|
|
5129
|
+
.value=${this.currentTheme}
|
|
5130
|
+
@change=${this.onThemeChange}
|
|
5131
|
+
title="Select theme"
|
|
5132
|
+
>
|
|
5133
|
+
${Ws.map(
|
|
5134
|
+
(t) => O`<option value="${t.name}">${t.label}</option>`
|
|
5135
|
+
)}
|
|
5136
|
+
</select>-->
|
|
5137
|
+
<div class="toolbar-search">
|
|
5138
|
+
<span class="toolbar-search-icon">🔍</span>
|
|
5139
|
+
<input
|
|
5140
|
+
class="toolbar-search-input"
|
|
5141
|
+
type="text"
|
|
5142
|
+
placeholder="Filter events..."
|
|
5143
|
+
.value=${this.filter}
|
|
5144
|
+
@input=${this.onFilterInput}
|
|
5145
|
+
/>
|
|
5146
|
+
</div>
|
|
5147
|
+
</div>
|
|
5148
|
+
</div>
|
|
5142
5149
|
</div>
|
|
5143
5150
|
</div>
|
|
5144
5151
|
</div>
|
|
@@ -5155,7 +5162,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5155
5162
|
hour: "numeric",
|
|
5156
5163
|
minute: "2-digit"
|
|
5157
5164
|
});
|
|
5158
|
-
return
|
|
5165
|
+
return O`
|
|
5159
5166
|
<div class="notification-popover-overlay" @click=${this.onNotificationPopoverToggle}></div>
|
|
5160
5167
|
<div class="notification-popover">
|
|
5161
5168
|
<div class="notification-popover-header">
|
|
@@ -5163,8 +5170,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5163
5170
|
<button class="notification-popover-close" @click=${this.onNotificationPopoverToggle}>×</button>
|
|
5164
5171
|
</div>
|
|
5165
5172
|
<div class="notification-popover-content">
|
|
5166
|
-
${this.scheduledNotifications.length === 0 ?
|
|
5167
|
-
(i) =>
|
|
5173
|
+
${this.scheduledNotifications.length === 0 ? O`<div class="notification-popover-empty">No scheduled notifications</div>` : this.scheduledNotifications.map(
|
|
5174
|
+
(i) => O`
|
|
5168
5175
|
<div class="notification-popover-item">
|
|
5169
5176
|
<div class="notification-popover-item-header">
|
|
5170
5177
|
<div class="notification-popover-item-title">${i.eventTitle}</div>
|
|
@@ -5176,7 +5183,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5176
5183
|
<div class="notification-popover-item-event-time">📅 ${e(
|
|
5177
5184
|
i.eventStart
|
|
5178
5185
|
)}</div>
|
|
5179
|
-
${i.eventLocation ?
|
|
5186
|
+
${i.eventLocation ? O`<div class="notification-popover-item-location">📍 ${i.eventLocation}</div>` : null}
|
|
5180
5187
|
</div>
|
|
5181
5188
|
</div>
|
|
5182
5189
|
`
|
|
@@ -5214,31 +5221,24 @@ ni.styles = zi`
|
|
|
5214
5221
|
align-items: center;
|
|
5215
5222
|
justify-content: space-between;
|
|
5216
5223
|
padding: 8px 10px;
|
|
5217
|
-
background: var(--bg-
|
|
5218
|
-
border: 1px solid var(--grid-color, rgba(255, 255, 255, 0.1));
|
|
5224
|
+
background: var(--bg-primary, rgb(30, 30, 30));
|
|
5219
5225
|
flex-shrink: 0;
|
|
5220
5226
|
gap: 16px;
|
|
5221
5227
|
position: absolute;
|
|
5222
|
-
bottom:
|
|
5223
|
-
left:
|
|
5224
|
-
right: 0
|
|
5228
|
+
bottom: 0;
|
|
5229
|
+
left: 0;
|
|
5230
|
+
right: 0;
|
|
5225
5231
|
z-index: 100;
|
|
5226
|
-
border-radius: var(--border-radius-lg, 8px);
|
|
5227
|
-
overflow: hidden;
|
|
5228
|
-
|
|
5229
|
-
--backdrop-padding: 30px;
|
|
5230
|
-
--backdrop-size: 42px;
|
|
5231
5232
|
}
|
|
5232
5233
|
|
|
5233
5234
|
.toolbar::before {
|
|
5234
5235
|
content: '';
|
|
5235
|
-
width: 100%;
|
|
5236
5236
|
position: absolute;
|
|
5237
|
-
top: calc(var(--backdrop-padding) * -1);
|
|
5238
5237
|
left: 0;
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5238
|
+
right: 0;
|
|
5239
|
+
bottom: 100%;
|
|
5240
|
+
height: 48px;
|
|
5241
|
+
background: linear-gradient(to bottom, transparent, var(--bg-primary, rgb(30, 30, 30)));
|
|
5242
5242
|
pointer-events: none;
|
|
5243
5243
|
}
|
|
5244
5244
|
|
|
@@ -5554,6 +5554,7 @@ ni.styles = zi`
|
|
|
5554
5554
|
display: flex;
|
|
5555
5555
|
flex-direction: column;
|
|
5556
5556
|
gap: 16px;
|
|
5557
|
+
background: var(--bg-secondary, rgba(36, 36, 38, 0.5));
|
|
5557
5558
|
}
|
|
5558
5559
|
|
|
5559
5560
|
.event-detail-section {
|
|
@@ -5618,13 +5619,14 @@ ni.styles = zi`
|
|
|
5618
5619
|
flex-direction: column;
|
|
5619
5620
|
min-width: 0;
|
|
5620
5621
|
max-height: 550px;
|
|
5622
|
+
border-radius: var(--border-radius-lg, 8px);
|
|
5623
|
+
overflow: hidden;
|
|
5621
5624
|
}
|
|
5622
5625
|
|
|
5623
5626
|
.event-detail-footer {
|
|
5624
5627
|
border-top: 1px solid var(--grid-color, rgba(255, 255, 255, 0.1));
|
|
5625
5628
|
padding: 12px 16px;
|
|
5626
5629
|
background: var(--bg-elevated, rgba(20, 20, 20, 0.95));
|
|
5627
|
-
border-radius: 0 0 var(--border-radius-lg, 8px) 0;
|
|
5628
5630
|
}
|
|
5629
5631
|
|
|
5630
5632
|
.invite-response-buttons {
|
|
@@ -5949,7 +5951,7 @@ De.SYNC_INTERVAL_MS = 300 * 1e3;
|
|
|
5949
5951
|
let Li = De;
|
|
5950
5952
|
export {
|
|
5951
5953
|
Li as CalendarIntegration,
|
|
5952
|
-
|
|
5954
|
+
N as CalendarInternal,
|
|
5953
5955
|
Ni as CalendarViewElement,
|
|
5954
5956
|
Vs as InMemorySource,
|
|
5955
5957
|
As as NOTIFICATION_PRESETS
|