mn-angular-lib 2.0.59 → 2.0.61
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/fesm2022/mn-angular-lib-calendar.mjs +114 -6
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tour.mjs +765 -0
- package/fesm2022/mn-angular-lib-tour.mjs.map +1 -0
- package/fesm2022/mn-angular-lib.mjs +1 -0
- package/package.json +5 -1
- package/tour/src/mn-tour/mn-tour-overlay.css +198 -0
- package/types/mn-angular-lib-calendar.d.ts +45 -3
- package/types/mn-angular-lib-tour.d.ts +320 -0
- package/types/mn-angular-lib.d.ts +1 -0
|
@@ -294,12 +294,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
var CalendarWeekComponent = class CalendarWeekComponent {
|
|
297
|
+
static ROW_HEIGHT_PX = 24;
|
|
297
298
|
lang = inject(MnLanguageService);
|
|
298
299
|
get weekViewLabel() {
|
|
299
300
|
return this.lang.translateIfPresent("mnCalendar.weekView") ?? "Week view";
|
|
300
301
|
}
|
|
301
302
|
layoutService = inject(CalendarEventLayoutService);
|
|
302
303
|
cdr = inject(ChangeDetectorRef);
|
|
304
|
+
bodyScroller;
|
|
305
|
+
pendingInitialScroll = true;
|
|
306
|
+
onUserScrollIntent() {
|
|
307
|
+
this.pendingInitialScroll = false;
|
|
308
|
+
}
|
|
303
309
|
focusDay;
|
|
304
310
|
eventsChanged;
|
|
305
311
|
focusDayChanged;
|
|
@@ -331,16 +337,31 @@ var CalendarWeekComponent = class CalendarWeekComponent {
|
|
|
331
337
|
if (this.eventsChanged) this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe((events) => {
|
|
332
338
|
this.events = events;
|
|
333
339
|
this.refreshEvents();
|
|
340
|
+
if (this.pendingInitialScroll && events.length > 0) {
|
|
341
|
+
this.pendingInitialScroll = false;
|
|
342
|
+
this.scrollToInitialRow();
|
|
343
|
+
}
|
|
334
344
|
this.cdr.markForCheck();
|
|
335
345
|
});
|
|
336
346
|
if (this.focusDayChanged) this.focusDayChanged.pipe(takeUntil(this.destroy$)).subscribe((date) => {
|
|
347
|
+
const dateChanged = date.toDateString() !== this.focusDay?.toDateString();
|
|
337
348
|
this.focusDay = date;
|
|
338
349
|
this.buildColumns();
|
|
339
350
|
this.refreshEvents();
|
|
340
351
|
this.updateCurrentTime();
|
|
352
|
+
if (dateChanged) {
|
|
353
|
+
this.pendingInitialScroll = true;
|
|
354
|
+
this.scrollToInitialRow();
|
|
355
|
+
}
|
|
356
|
+
this.cdr.markForCheck();
|
|
357
|
+
});
|
|
358
|
+
this.buildHourRows().then(() => {
|
|
341
359
|
this.cdr.markForCheck();
|
|
360
|
+
this.scrollToInitialRow();
|
|
342
361
|
});
|
|
343
|
-
|
|
362
|
+
}
|
|
363
|
+
ngAfterViewInit() {
|
|
364
|
+
this.scrollToInitialRow();
|
|
344
365
|
}
|
|
345
366
|
ngOnDestroy() {
|
|
346
367
|
this.destroy$.next();
|
|
@@ -430,6 +451,27 @@ var CalendarWeekComponent = class CalendarWeekComponent {
|
|
|
430
451
|
this.buildGridColumns();
|
|
431
452
|
this.updateCurrentTime();
|
|
432
453
|
}
|
|
454
|
+
scrollToInitialRow() {
|
|
455
|
+
const el = this.bodyScroller?.nativeElement;
|
|
456
|
+
if (!el || this.totalRows <= 0) return;
|
|
457
|
+
const targetRow = this.resolveInitialScrollRow();
|
|
458
|
+
if (targetRow <= 1) {
|
|
459
|
+
el.scrollTop = 0;
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const rowPx = CalendarWeekComponent.ROW_HEIGHT_PX;
|
|
463
|
+
const offset = (targetRow - 1) * rowPx - el.clientHeight / 3;
|
|
464
|
+
el.scrollTop = Math.max(0, offset);
|
|
465
|
+
}
|
|
466
|
+
resolveInitialScrollRow() {
|
|
467
|
+
if (this.currentTimeRow > 0) return this.currentTimeRow;
|
|
468
|
+
let earliest = Number.POSITIVE_INFINITY;
|
|
469
|
+
for (const event of this.displayEvents) {
|
|
470
|
+
const row = CalendarUtility.getCorrectRow(event.startTime.getHours(), event.startTime.getMinutes(), this.resolvedConfig.startHour);
|
|
471
|
+
if (row > 0 && row < earliest) earliest = row;
|
|
472
|
+
}
|
|
473
|
+
return Number.isFinite(earliest) ? earliest : 1;
|
|
474
|
+
}
|
|
433
475
|
buildGridColumns() {
|
|
434
476
|
this.dayColumnMap = [];
|
|
435
477
|
let currentCol = 1;
|
|
@@ -490,9 +532,16 @@ var CalendarWeekComponent = class CalendarWeekComponent {
|
|
|
490
532
|
calendarEventComponent: "calendarEventComponent"
|
|
491
533
|
},
|
|
492
534
|
outputs: { eventClicked: "eventClicked" },
|
|
535
|
+
host: { classAttribute: "flex h-full min-h-0 flex-col overflow-hidden" },
|
|
493
536
|
providers: [CalendarEventLayoutService],
|
|
537
|
+
viewQueries: [{
|
|
538
|
+
propertyName: "bodyScroller",
|
|
539
|
+
first: true,
|
|
540
|
+
predicate: ["bodyScroller"],
|
|
541
|
+
descendants: true
|
|
542
|
+
}],
|
|
494
543
|
ngImport: i0,
|
|
495
|
-
template: "<!-- Week grid. Hour rules are quiet hairlines; today's column header is a tinted\n number (no fill); the current time is a line carrying a small time bubble.\n Dynamic row/column placement stays inline — the layout maths lives in TS. -->\n<div [attr.aria-label]=\"weekViewLabel\"
|
|
544
|
+
template: "<!-- Week grid. Hour rules are quiet hairlines; today's column header is a tinted\n number (no fill); the current time is a line carrying a small time bubble.\n Dynamic row/column placement stays inline — the layout maths lives in TS.\n R7QVk8rz (SuperBottie option 1): body scrolls vertically with fixed readable\n rows so the full startHour–endHour range stays reachable. -->\n<div [attr.aria-label]=\"weekViewLabel\"\n role=\"grid\"\n style=\"display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden\">\n <div class=\"grid\" [style.grid-template-columns]=\"'60px ' + gridTemplateColumns\">\n <div></div>\n @for (col of columns; track col.dayName; let i = $index) {\n <div class=\"py-2 px-1 text-center\"\n [style.grid-column]=\"getHeaderColumn(i)\"\n role=\"columnheader\">\n <span class=\"block text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ col.dayName }}</span>\n <span class=\"text-lg font-bold tabular-nums\" [class.text-primary]=\"col.isToday\">{{ col.dayNumber }}</span>\n </div>\n }\n </div>\n <div #bodyScroller\n (wheel)=\"onUserScrollIntent()\" (touchstart)=\"onUserScrollIntent()\" (pointerdown)=\"onUserScrollIntent()\"\n style=\"display: grid; grid-template-columns: 60px 1fr; align-items: start; flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto\">\n <div class=\"grid\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.grid-template-columns]=\"gridTemplateColumns\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && currentTimeCol) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"currentTimeCol\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n",
|
|
496
545
|
dependencies: [{
|
|
497
546
|
kind: "ngmodule",
|
|
498
547
|
type: CommonModule
|
|
@@ -517,11 +566,16 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
517
566
|
standalone: true,
|
|
518
567
|
imports: [CommonModule, CalendarEventComponent],
|
|
519
568
|
providers: [CalendarEventLayoutService],
|
|
520
|
-
|
|
569
|
+
host: { class: "flex h-full min-h-0 flex-col overflow-hidden" },
|
|
570
|
+
template: "<!-- Week grid. Hour rules are quiet hairlines; today's column header is a tinted\n number (no fill); the current time is a line carrying a small time bubble.\n Dynamic row/column placement stays inline — the layout maths lives in TS.\n R7QVk8rz (SuperBottie option 1): body scrolls vertically with fixed readable\n rows so the full startHour–endHour range stays reachable. -->\n<div [attr.aria-label]=\"weekViewLabel\"\n role=\"grid\"\n style=\"display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden\">\n <div class=\"grid\" [style.grid-template-columns]=\"'60px ' + gridTemplateColumns\">\n <div></div>\n @for (col of columns; track col.dayName; let i = $index) {\n <div class=\"py-2 px-1 text-center\"\n [style.grid-column]=\"getHeaderColumn(i)\"\n role=\"columnheader\">\n <span class=\"block text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ col.dayName }}</span>\n <span class=\"text-lg font-bold tabular-nums\" [class.text-primary]=\"col.isToday\">{{ col.dayNumber }}</span>\n </div>\n }\n </div>\n <div #bodyScroller\n (wheel)=\"onUserScrollIntent()\" (touchstart)=\"onUserScrollIntent()\" (pointerdown)=\"onUserScrollIntent()\"\n style=\"display: grid; grid-template-columns: 60px 1fr; align-items: start; flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto\">\n <div class=\"grid\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.grid-template-columns]=\"gridTemplateColumns\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && currentTimeCol) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"currentTimeCol\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n"
|
|
521
571
|
}]
|
|
522
572
|
}],
|
|
523
573
|
ctorParameters: () => [],
|
|
524
574
|
propDecorators: {
|
|
575
|
+
bodyScroller: [{
|
|
576
|
+
type: ViewChild,
|
|
577
|
+
args: ["bodyScroller"]
|
|
578
|
+
}],
|
|
525
579
|
focusDay: [{ type: Input }],
|
|
526
580
|
eventsChanged: [{ type: Input }],
|
|
527
581
|
focusDayChanged: [{ type: Input }],
|
|
@@ -531,12 +585,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
531
585
|
}
|
|
532
586
|
});
|
|
533
587
|
var CalendarDayComponent = class CalendarDayComponent {
|
|
588
|
+
static ROW_HEIGHT_PX = 24;
|
|
534
589
|
lang = inject(MnLanguageService);
|
|
535
590
|
get dayViewLabel() {
|
|
536
591
|
return this.lang.translateIfPresent("mnCalendar.dayView") ?? "Day view";
|
|
537
592
|
}
|
|
538
593
|
layoutService = inject(CalendarEventLayoutService);
|
|
539
594
|
cdr = inject(ChangeDetectorRef);
|
|
595
|
+
bodyScroller;
|
|
596
|
+
pendingInitialScroll = true;
|
|
597
|
+
onUserScrollIntent() {
|
|
598
|
+
this.pendingInitialScroll = false;
|
|
599
|
+
}
|
|
540
600
|
focusDay;
|
|
541
601
|
eventsChanged;
|
|
542
602
|
focusDayChanged;
|
|
@@ -567,16 +627,31 @@ var CalendarDayComponent = class CalendarDayComponent {
|
|
|
567
627
|
if (this.eventsChanged) this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe((events) => {
|
|
568
628
|
this.events = events;
|
|
569
629
|
this.refreshEvents();
|
|
630
|
+
if (this.pendingInitialScroll && events.length > 0) {
|
|
631
|
+
this.pendingInitialScroll = false;
|
|
632
|
+
this.scrollToInitialRow();
|
|
633
|
+
}
|
|
570
634
|
this.cdr.markForCheck();
|
|
571
635
|
});
|
|
572
636
|
if (this.focusDayChanged) this.focusDayChanged.pipe(takeUntil(this.destroy$)).subscribe((date) => {
|
|
637
|
+
const dateChanged = date.toDateString() !== this.focusDay?.toDateString();
|
|
573
638
|
this.focusDay = date;
|
|
574
639
|
this.updateDayInfo();
|
|
575
640
|
this.refreshEvents();
|
|
576
641
|
this.updateCurrentTime();
|
|
642
|
+
if (dateChanged) {
|
|
643
|
+
this.pendingInitialScroll = true;
|
|
644
|
+
this.scrollToInitialRow();
|
|
645
|
+
}
|
|
646
|
+
this.cdr.markForCheck();
|
|
647
|
+
});
|
|
648
|
+
this.buildHourRows().then(() => {
|
|
577
649
|
this.cdr.markForCheck();
|
|
650
|
+
this.scrollToInitialRow();
|
|
578
651
|
});
|
|
579
|
-
|
|
652
|
+
}
|
|
653
|
+
ngAfterViewInit() {
|
|
654
|
+
this.scrollToInitialRow();
|
|
580
655
|
}
|
|
581
656
|
ngOnDestroy() {
|
|
582
657
|
this.destroy$.next();
|
|
@@ -637,6 +712,27 @@ var CalendarDayComponent = class CalendarDayComponent {
|
|
|
637
712
|
this.layoutService.assignWidthsToEvents(this.displayEvents, rangeStart, rangeEnd);
|
|
638
713
|
this.totalColumns = this.displayEvents.reduce((max, e) => Math.max(max, (e.column ?? 0) + (e.width ?? 1)), 1);
|
|
639
714
|
}
|
|
715
|
+
scrollToInitialRow() {
|
|
716
|
+
const el = this.bodyScroller?.nativeElement;
|
|
717
|
+
if (!el || this.totalRows <= 0) return;
|
|
718
|
+
const targetRow = this.resolveInitialScrollRow();
|
|
719
|
+
if (targetRow <= 1) {
|
|
720
|
+
el.scrollTop = 0;
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const rowPx = CalendarDayComponent.ROW_HEIGHT_PX;
|
|
724
|
+
const offset = (targetRow - 1) * rowPx - el.clientHeight / 3;
|
|
725
|
+
el.scrollTop = Math.max(0, offset);
|
|
726
|
+
}
|
|
727
|
+
resolveInitialScrollRow() {
|
|
728
|
+
if (this.isToday && this.currentTimeRow > 0) return this.currentTimeRow;
|
|
729
|
+
let earliest = Number.POSITIVE_INFINITY;
|
|
730
|
+
for (const event of this.displayEvents) {
|
|
731
|
+
const row = CalendarUtility.getCorrectRow(event.startTime.getHours(), event.startTime.getMinutes(), this.resolvedConfig.startHour);
|
|
732
|
+
if (row > 0 && row < earliest) earliest = row;
|
|
733
|
+
}
|
|
734
|
+
return Number.isFinite(earliest) ? earliest : 1;
|
|
735
|
+
}
|
|
640
736
|
updateCurrentTime() {
|
|
641
737
|
const now = /* @__PURE__ */ new Date();
|
|
642
738
|
if (this.focusDay && this.formatter.isSameDay(this.focusDay, now)) {
|
|
@@ -675,9 +771,16 @@ var CalendarDayComponent = class CalendarDayComponent {
|
|
|
675
771
|
calendarEventComponent: "calendarEventComponent"
|
|
676
772
|
},
|
|
677
773
|
outputs: { eventClicked: "eventClicked" },
|
|
774
|
+
host: { classAttribute: "flex h-full min-h-0 flex-col overflow-hidden" },
|
|
678
775
|
providers: [CalendarEventLayoutService],
|
|
776
|
+
viewQueries: [{
|
|
777
|
+
propertyName: "bodyScroller",
|
|
778
|
+
first: true,
|
|
779
|
+
predicate: ["bodyScroller"],
|
|
780
|
+
descendants: true
|
|
781
|
+
}],
|
|
679
782
|
ngImport: i0,
|
|
680
|
-
template: "<!-- Day grid. One column, its header centered over that column (the toolbar\n already names the date). Today's number is tinted, not filled; the now-line\n carries a time bubble that overhangs into the gutter. -->\n<div [attr.aria-label]=\"dayViewLabel\"
|
|
783
|
+
template: "<!-- Day grid. One column, its header centered over that column (the toolbar\n already names the date). Today's number is tinted, not filled; the now-line\n carries a time bubble that overhangs into the gutter.\n R7QVk8rz / G6pB4jWN (SuperBottie option 1): body scrolls vertically with a\n fixed readable row height so the full startHour–endHour range stays reachable. -->\n<div [attr.aria-label]=\"dayViewLabel\"\n role=\"grid\"\n style=\"display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden\">\n <div style=\"display: grid; grid-template-columns: 60px 1fr\">\n <div></div>\n <div class=\"flex items-center justify-center gap-2 py-2 px-1\" role=\"columnheader\">\n <span class=\"text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ dayName }}</span>\n <span class=\"text-base font-bold tabular-nums\" [class.text-primary]=\"isToday\">{{ focusDay.getDate() }}</span>\n </div>\n </div>\n <div #bodyScroller\n (wheel)=\"onUserScrollIntent()\" (touchstart)=\"onUserScrollIntent()\" (pointerdown)=\"onUserScrollIntent()\"\n style=\"display: grid; grid-template-columns: 60px 1fr; align-items: start; flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto\">\n <div class=\"grid\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.grid-template-columns]=\"'repeat(' + totalColumns + ', 1fr)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && isToday) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"'1 / -1'\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n",
|
|
681
784
|
dependencies: [{
|
|
682
785
|
kind: "ngmodule",
|
|
683
786
|
type: CommonModule
|
|
@@ -702,11 +805,16 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
702
805
|
standalone: true,
|
|
703
806
|
imports: [CommonModule, CalendarEventComponent],
|
|
704
807
|
providers: [CalendarEventLayoutService],
|
|
705
|
-
|
|
808
|
+
host: { class: "flex h-full min-h-0 flex-col overflow-hidden" },
|
|
809
|
+
template: "<!-- Day grid. One column, its header centered over that column (the toolbar\n already names the date). Today's number is tinted, not filled; the now-line\n carries a time bubble that overhangs into the gutter.\n R7QVk8rz / G6pB4jWN (SuperBottie option 1): body scrolls vertically with a\n fixed readable row height so the full startHour–endHour range stays reachable. -->\n<div [attr.aria-label]=\"dayViewLabel\"\n role=\"grid\"\n style=\"display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden\">\n <div style=\"display: grid; grid-template-columns: 60px 1fr\">\n <div></div>\n <div class=\"flex items-center justify-center gap-2 py-2 px-1\" role=\"columnheader\">\n <span class=\"text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ dayName }}</span>\n <span class=\"text-base font-bold tabular-nums\" [class.text-primary]=\"isToday\">{{ focusDay.getDate() }}</span>\n </div>\n </div>\n <div #bodyScroller\n (wheel)=\"onUserScrollIntent()\" (touchstart)=\"onUserScrollIntent()\" (pointerdown)=\"onUserScrollIntent()\"\n style=\"display: grid; grid-template-columns: 60px 1fr; align-items: start; flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto\">\n <div class=\"grid\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', 1.5rem)'\"\n [style.grid-template-columns]=\"'repeat(' + totalColumns + ', 1fr)'\"\n [style.min-height.px]=\"totalRows * 24\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && isToday) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"'1 / -1'\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n"
|
|
706
810
|
}]
|
|
707
811
|
}],
|
|
708
812
|
ctorParameters: () => [],
|
|
709
813
|
propDecorators: {
|
|
814
|
+
bodyScroller: [{
|
|
815
|
+
type: ViewChild,
|
|
816
|
+
args: ["bodyScroller"]
|
|
817
|
+
}],
|
|
710
818
|
focusDay: [{ type: Input }],
|
|
711
819
|
eventsChanged: [{ type: Input }],
|
|
712
820
|
focusDayChanged: [{ type: Input }],
|