@nanahoshi/mona-ui 0.18.5 → 0.19.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/README.md +71 -13
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +122 -48
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +199 -77
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +28 -16
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +74 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs} +21 -17
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs} +90 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +1168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +46 -19
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +32 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +33 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +13 -3
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +14 -5
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +33 -8
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +38 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +633 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +19 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +9 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgTemplateOutlet
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, TemplateRef, Directive, computed, input, output, DestroyRef, ElementRef, signal, contentChild, linkedSignal, model, afterNextRender, effect, untracked, Component } from '@angular/core';
|
|
4
4
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -11,8 +11,27 @@ import { themeRaisedBackdropClasses, createElementControlId, rxTimeout } from '@
|
|
|
11
11
|
import { DateTime } from 'luxon';
|
|
12
12
|
import { skip, fromEvent } from 'rxjs';
|
|
13
13
|
import { twMerge } from 'tailwind-merge';
|
|
14
|
+
import { MonaI18nService, injectComponentDirection, gregorianDateTime, formatGregorianDateToLocaleString, gregorianDateTimeFromObject } from '@nanahoshi/mona-ui/i18n';
|
|
14
15
|
import { cva } from 'class-variance-authority';
|
|
15
16
|
|
|
17
|
+
const CALENDAR_DEFAULT_MESSAGES = {
|
|
18
|
+
calendarLabel: (formattedMonthAndYear) => `Calendar, ${formattedMonthAndYear}`,
|
|
19
|
+
yearViewLabel: (year) => `Year view, ${year}`,
|
|
20
|
+
decadeViewLabel: (start, end) => `Decade view, ${start} - ${end}`,
|
|
21
|
+
nextMonth: "Next month",
|
|
22
|
+
nextYear: "Next year",
|
|
23
|
+
nextDecade: "Next decade",
|
|
24
|
+
previousMonth: "Previous month",
|
|
25
|
+
previousYear: "Previous year",
|
|
26
|
+
previousDecade: "Previous decade",
|
|
27
|
+
today: "Today",
|
|
28
|
+
goToToday: (formattedDate) => `Go to today, ${formattedDate}`,
|
|
29
|
+
switchToYearView: (currentMonthAndYear) => `Switch to year view, currently ${currentMonthAndYear}`,
|
|
30
|
+
switchToDecadeView: (currentYear) => `Switch to decade view, currently ${currentYear}`,
|
|
31
|
+
decadeRange: (start, end) => `${start} to ${end}`,
|
|
32
|
+
yearCellLabel: (year) => `Year ${year}`
|
|
33
|
+
};
|
|
34
|
+
|
|
16
35
|
class CalendarDecadeCellTemplateDirective {
|
|
17
36
|
constructor() {
|
|
18
37
|
this.templateRef = inject(TemplateRef);
|
|
@@ -191,7 +210,9 @@ const calendarDecadeViewCellThemeVariants = cva(`
|
|
|
191
210
|
|
|
192
211
|
class DecadeYearDirective {
|
|
193
212
|
constructor() {
|
|
194
|
-
this
|
|
213
|
+
this.#i18n = inject(MonaI18nService);
|
|
214
|
+
this.messages = this.#i18n.componentMessages("calendar", CALENDAR_DEFAULT_MESSAGES);
|
|
215
|
+
this.ariaLabel = computed(() => this.messages().yearCellLabel(this.year()), /* @ts-ignore */
|
|
195
216
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
196
217
|
this.baseClass = computed(() => {
|
|
197
218
|
const focused = this.focused();
|
|
@@ -225,6 +246,7 @@ class DecadeYearDirective {
|
|
|
225
246
|
this.year = input.required(/* @ts-ignore */
|
|
226
247
|
...(ngDevMode ? [{ debugName: "year" }] : /* istanbul ignore next */ []));
|
|
227
248
|
}
|
|
249
|
+
#i18n;
|
|
228
250
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DecadeYearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
229
251
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: DecadeYearDirective, isStandalone: true, selector: "[monaDecadeYear]", inputs: { navigatedDate: { classPropertyName: "navigatedDate", publicName: "navigatedDate", isSignal: true, isRequired: true, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, year: { classPropertyName: "year", publicName: "year", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "gridcell" }, properties: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-current": "isCurrent() ? 'true' : null", "attr.aria-label": "ariaLabel()", "attr.aria-selected": "selected() ? 'true' : null", "class": "baseClass()" } }, ngImport: i0 }); }
|
|
230
252
|
}
|
|
@@ -477,17 +499,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
477
499
|
class CalendarComponent {
|
|
478
500
|
#calendarService;
|
|
479
501
|
#destroyRef;
|
|
502
|
+
#direction;
|
|
480
503
|
#hostElementRef;
|
|
504
|
+
#i18n;
|
|
481
505
|
#monthDict;
|
|
482
506
|
#outputValue;
|
|
483
507
|
constructor() {
|
|
484
508
|
this.#calendarService = inject(CalendarService, { optional: true });
|
|
485
509
|
this.#destroyRef = inject(DestroyRef);
|
|
510
|
+
this.#direction = injectComponentDirection();
|
|
486
511
|
this.#hostElementRef = inject(ElementRef);
|
|
512
|
+
this.#i18n = inject(MonaI18nService);
|
|
513
|
+
this.messages = this.#i18n.componentMessages("calendar", CALENDAR_DEFAULT_MESSAGES);
|
|
487
514
|
this.#monthDict = computed(() => {
|
|
488
515
|
const day = this.navigatedDate();
|
|
489
|
-
const firstDayOfMonth =
|
|
490
|
-
const lastDayOfMonth =
|
|
516
|
+
const firstDayOfMonth = gregorianDateTime(day, this.#i18n.localeId()).startOf("month");
|
|
517
|
+
const lastDayOfMonth = gregorianDateTime(day, this.#i18n.localeId()).endOf("month");
|
|
491
518
|
const firstDayOfWeek = this.firstDay() === "monday" ? 1 : 0;
|
|
492
519
|
let firstDayOfCalendar;
|
|
493
520
|
const monthStartWeekday = firstDayOfMonth.weekday;
|
|
@@ -511,11 +538,6 @@ class CalendarComponent {
|
|
|
511
538
|
for (let i = firstDayOfCalendar; i <= lastDayOfCalendar; i = i.plus({ days: 1 })) {
|
|
512
539
|
dictionary.add(i.toJSDate(), i.day);
|
|
513
540
|
}
|
|
514
|
-
if (monthEndWeekday === 7) {
|
|
515
|
-
for (let i = 0; i < 7; i++) {
|
|
516
|
-
dictionary.add(lastDayOfMonth.plus({ days: i + 1 }).toJSDate(), lastDayOfMonth.plus({ days: i + 1 }).day);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
541
|
return dictionary.toImmutableDictionary(e => e.key, e => e.value);
|
|
520
542
|
}, /* @ts-ignore */
|
|
521
543
|
...(ngDevMode ? [{ debugName: "#monthDict" }] : /* istanbul ignore next */ []));
|
|
@@ -543,14 +565,15 @@ class CalendarComponent {
|
|
|
543
565
|
this.ariaLabel = computed(() => {
|
|
544
566
|
const view = this.calendarView();
|
|
545
567
|
const navigatedDate = this.navigatedDate();
|
|
546
|
-
const
|
|
568
|
+
const locale = this.#i18n.localeId();
|
|
569
|
+
const messages = this.messages();
|
|
547
570
|
switch (view) {
|
|
548
571
|
case "month":
|
|
549
|
-
return
|
|
572
|
+
return messages.calendarLabel(formatGregorianDateToLocaleString(navigatedDate, locale, { year: "numeric", month: "long" }));
|
|
550
573
|
case "year":
|
|
551
|
-
return
|
|
574
|
+
return messages.yearViewLabel(formatGregorianDateToLocaleString(navigatedDate, locale, { year: "numeric" }));
|
|
552
575
|
case "decade":
|
|
553
|
-
return
|
|
576
|
+
return messages.decadeViewLabel(this.decadeStart(), this.decadeEnd());
|
|
554
577
|
}
|
|
555
578
|
}, /* @ts-ignore */
|
|
556
579
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -577,7 +600,7 @@ class CalendarComponent {
|
|
|
577
600
|
...(ngDevMode ? [{ debugName: "decadeGridClass" }] : /* istanbul ignore next */ []));
|
|
578
601
|
this.decadeStart = computed(() => {
|
|
579
602
|
const navigatedDate = this.navigatedDate();
|
|
580
|
-
const date =
|
|
603
|
+
const date = gregorianDateTime(navigatedDate, this.#i18n.localeId());
|
|
581
604
|
const year = date.year;
|
|
582
605
|
return year - (year % 10);
|
|
583
606
|
}, /* @ts-ignore */
|
|
@@ -599,8 +622,8 @@ class CalendarComponent {
|
|
|
599
622
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
600
623
|
this.monthBounds = computed(() => {
|
|
601
624
|
const navigatedDate = this.navigatedDate();
|
|
602
|
-
const firstDayOfMonth =
|
|
603
|
-
const lastDayOfMonth =
|
|
625
|
+
const firstDayOfMonth = gregorianDateTime(navigatedDate, this.#i18n.localeId()).startOf("month");
|
|
626
|
+
const lastDayOfMonth = gregorianDateTime(navigatedDate, this.#i18n.localeId()).endOf("month");
|
|
604
627
|
return { start: firstDayOfMonth.toJSDate(), end: lastDayOfMonth.toJSDate() };
|
|
605
628
|
}, /* @ts-ignore */
|
|
606
629
|
...(ngDevMode ? [{ debugName: "monthBounds" }] : /* istanbul ignore next */ []));
|
|
@@ -622,8 +645,26 @@ class CalendarComponent {
|
|
|
622
645
|
return calendarMonthViewGridHeaderThemeVariants();
|
|
623
646
|
}, /* @ts-ignore */
|
|
624
647
|
...(ngDevMode ? [{ debugName: "monthGridHeaderClass" }] : /* istanbul ignore next */ []));
|
|
648
|
+
this.headerMonthYear = computed(() => {
|
|
649
|
+
const locale = this.#i18n.localeId();
|
|
650
|
+
return formatGregorianDateToLocaleString(this.navigatedDate(), locale, {
|
|
651
|
+
year: "numeric",
|
|
652
|
+
month: "long"
|
|
653
|
+
});
|
|
654
|
+
}, /* @ts-ignore */
|
|
655
|
+
...(ngDevMode ? [{ debugName: "headerMonthYear" }] : /* istanbul ignore next */ []));
|
|
656
|
+
this.headerYear = computed(() => {
|
|
657
|
+
const locale = this.#i18n.localeId();
|
|
658
|
+
return formatGregorianDateToLocaleString(this.navigatedDate(), locale, {
|
|
659
|
+
year: "numeric"
|
|
660
|
+
});
|
|
661
|
+
}, /* @ts-ignore */
|
|
662
|
+
...(ngDevMode ? [{ debugName: "headerYear" }] : /* istanbul ignore next */ []));
|
|
625
663
|
this.months = computed(() => {
|
|
626
|
-
const
|
|
664
|
+
const locale = this.#i18n.localeId();
|
|
665
|
+
const names = range(1, 12)
|
|
666
|
+
.select(m => gregorianDateTimeFromObject({ year: 2024, month: m, day: 1 }, locale).toFormat("LLL"))
|
|
667
|
+
.toArray();
|
|
627
668
|
return index(names)
|
|
628
669
|
.chunk(3)
|
|
629
670
|
.select(e => e.select(m => [m[0] + 1, m[1]]).toImmutableSet())
|
|
@@ -634,25 +675,27 @@ class CalendarComponent {
|
|
|
634
675
|
...(ngDevMode ? [{ debugName: "navigatedDate" }] : /* istanbul ignore next */ []));
|
|
635
676
|
this.nextButtonLabel = computed(() => {
|
|
636
677
|
const view = this.calendarView();
|
|
678
|
+
const messages = this.messages();
|
|
637
679
|
switch (view) {
|
|
638
680
|
case "month":
|
|
639
|
-
return
|
|
681
|
+
return messages.nextMonth;
|
|
640
682
|
case "year":
|
|
641
|
-
return
|
|
683
|
+
return messages.nextYear;
|
|
642
684
|
case "decade":
|
|
643
|
-
return
|
|
685
|
+
return messages.nextDecade;
|
|
644
686
|
}
|
|
645
687
|
}, /* @ts-ignore */
|
|
646
688
|
...(ngDevMode ? [{ debugName: "nextButtonLabel" }] : /* istanbul ignore next */ []));
|
|
647
689
|
this.prevButtonLabel = computed(() => {
|
|
648
690
|
const view = this.calendarView();
|
|
691
|
+
const messages = this.messages();
|
|
649
692
|
switch (view) {
|
|
650
693
|
case "month":
|
|
651
|
-
return
|
|
694
|
+
return messages.previousMonth;
|
|
652
695
|
case "year":
|
|
653
|
-
return
|
|
696
|
+
return messages.previousYear;
|
|
654
697
|
case "decade":
|
|
655
|
-
return
|
|
698
|
+
return messages.previousDecade;
|
|
656
699
|
}
|
|
657
700
|
}, /* @ts-ignore */
|
|
658
701
|
...(ngDevMode ? [{ debugName: "prevButtonLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -692,34 +735,43 @@ class CalendarComponent {
|
|
|
692
735
|
...(ngDevMode ? [{ debugName: "selectedDates" }] : /* istanbul ignore next */ []));
|
|
693
736
|
this.timezone = DateTime.local().zoneName ?? undefined;
|
|
694
737
|
this.todayButtonLabel = computed(() => {
|
|
695
|
-
const
|
|
696
|
-
|
|
738
|
+
const locale = this.#i18n.localeId();
|
|
739
|
+
const todayStr = formatGregorianDateToLocaleString(new Date(), locale, {
|
|
740
|
+
year: "numeric",
|
|
741
|
+
month: "long",
|
|
742
|
+
day: "numeric"
|
|
743
|
+
});
|
|
744
|
+
return this.messages().goToToday(todayStr);
|
|
697
745
|
}, /* @ts-ignore */
|
|
698
746
|
...(ngDevMode ? [{ debugName: "todayButtonLabel" }] : /* istanbul ignore next */ []));
|
|
699
747
|
this.viewSwitchButtonLabel = computed(() => {
|
|
700
748
|
const view = this.calendarView();
|
|
701
|
-
const
|
|
749
|
+
const locale = this.#i18n.localeId();
|
|
750
|
+
const navigatedDate = this.navigatedDate();
|
|
751
|
+
const messages = this.messages();
|
|
702
752
|
switch (view) {
|
|
703
753
|
case "month":
|
|
704
|
-
return
|
|
754
|
+
return messages.switchToYearView(formatGregorianDateToLocaleString(navigatedDate, locale, { year: "numeric", month: "long" }));
|
|
705
755
|
case "year":
|
|
706
|
-
return
|
|
756
|
+
return messages.switchToDecadeView(formatGregorianDateToLocaleString(navigatedDate, locale, { year: "numeric" }));
|
|
707
757
|
case "decade":
|
|
708
|
-
return
|
|
758
|
+
return messages.decadeRange(this.decadeStart(), this.decadeEnd());
|
|
709
759
|
}
|
|
710
760
|
}, /* @ts-ignore */
|
|
711
761
|
...(ngDevMode ? [{ debugName: "viewSwitchButtonLabel" }] : /* istanbul ignore next */ []));
|
|
712
762
|
this.weekdays = computed(() => {
|
|
713
763
|
const firstDayOfWeek = this.firstDay();
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
{
|
|
719
|
-
{
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
764
|
+
const locale = this.#i18n.localeId();
|
|
765
|
+
// 2024-01-07 was a Sunday
|
|
766
|
+
const days = range(0, 7)
|
|
767
|
+
.select(i => {
|
|
768
|
+
const dt = gregorianDateTimeFromObject({ year: 2024, month: 1, day: 7 + i }, locale);
|
|
769
|
+
return {
|
|
770
|
+
short: dt.toFormat("ccc"),
|
|
771
|
+
full: dt.toFormat("cccc")
|
|
772
|
+
};
|
|
773
|
+
})
|
|
774
|
+
.toArray();
|
|
723
775
|
return firstDayOfWeek === "monday" ? [...days.slice(1), days[0]] : days;
|
|
724
776
|
}, /* @ts-ignore */
|
|
725
777
|
...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
@@ -903,6 +955,15 @@ class CalendarComponent {
|
|
|
903
955
|
}
|
|
904
956
|
this.navigatedDate.set(direction === "prev" ? date.minus(unit).toJSDate() : date.plus(unit).toJSDate());
|
|
905
957
|
}
|
|
958
|
+
getWeekNumber(date) {
|
|
959
|
+
let dt = gregorianDateTime(date, this.#i18n.localeId());
|
|
960
|
+
if (this.firstDay() === "sunday") {
|
|
961
|
+
// In Sunday-first calendar, date is Sunday (day 0 of [Sun..Sat] row).
|
|
962
|
+
// Thursday (day 4 of row) represents the majority of the row and defines its ISO 8601 week number.
|
|
963
|
+
dt = dt.plus({ days: 4 });
|
|
964
|
+
}
|
|
965
|
+
return dt.weekNumber;
|
|
966
|
+
}
|
|
906
967
|
onTodayButtonClick() {
|
|
907
968
|
if (this.disabled() || this.readonly()) {
|
|
908
969
|
return;
|
|
@@ -1030,20 +1091,20 @@ class CalendarComponent {
|
|
|
1030
1091
|
case "ArrowLeft":
|
|
1031
1092
|
event.preventDefault();
|
|
1032
1093
|
if (isCtrlOrCmd) {
|
|
1033
|
-
this.navigatePeriodKeyboard("
|
|
1094
|
+
this.navigatePeriodKeyboard(this.horizontalPeriodDirection("ArrowLeft"));
|
|
1034
1095
|
}
|
|
1035
1096
|
else {
|
|
1036
|
-
this.navigateByDaysOrCells(
|
|
1097
|
+
this.navigateByDaysOrCells(this.horizontalCellDelta("ArrowLeft"), view);
|
|
1037
1098
|
}
|
|
1038
1099
|
shouldFocusCell = true;
|
|
1039
1100
|
break;
|
|
1040
1101
|
case "ArrowRight":
|
|
1041
1102
|
event.preventDefault();
|
|
1042
1103
|
if (isCtrlOrCmd) {
|
|
1043
|
-
this.navigatePeriodKeyboard("
|
|
1104
|
+
this.navigatePeriodKeyboard(this.horizontalPeriodDirection("ArrowRight"));
|
|
1044
1105
|
}
|
|
1045
1106
|
else {
|
|
1046
|
-
this.navigateByDaysOrCells(
|
|
1107
|
+
this.navigateByDaysOrCells(this.horizontalCellDelta("ArrowRight"), view);
|
|
1047
1108
|
}
|
|
1048
1109
|
shouldFocusCell = true;
|
|
1049
1110
|
break;
|
|
@@ -1148,11 +1209,11 @@ class CalendarComponent {
|
|
|
1148
1209
|
switch (event.key) {
|
|
1149
1210
|
case "ArrowLeft":
|
|
1150
1211
|
event.preventDefault();
|
|
1151
|
-
this.extendSelection(
|
|
1212
|
+
this.extendSelection(this.horizontalCellDelta("ArrowLeft"));
|
|
1152
1213
|
return true;
|
|
1153
1214
|
case "ArrowRight":
|
|
1154
1215
|
event.preventDefault();
|
|
1155
|
-
this.extendSelection(
|
|
1216
|
+
this.extendSelection(this.horizontalCellDelta("ArrowRight"));
|
|
1156
1217
|
return true;
|
|
1157
1218
|
case "ArrowUp":
|
|
1158
1219
|
event.preventDefault();
|
|
@@ -1212,6 +1273,20 @@ class CalendarComponent {
|
|
|
1212
1273
|
const value = this.value();
|
|
1213
1274
|
return value == null || (Array.isArray(value) && value.length === 0);
|
|
1214
1275
|
}
|
|
1276
|
+
horizontalCellDelta(key) {
|
|
1277
|
+
const isRtl = this.#direction() === "rtl";
|
|
1278
|
+
if (key === "ArrowLeft") {
|
|
1279
|
+
return isRtl ? 1 : -1;
|
|
1280
|
+
}
|
|
1281
|
+
return isRtl ? -1 : 1;
|
|
1282
|
+
}
|
|
1283
|
+
horizontalPeriodDirection(key) {
|
|
1284
|
+
const isRtl = this.#direction() === "rtl";
|
|
1285
|
+
if (key === "ArrowLeft") {
|
|
1286
|
+
return isRtl ? "next" : "prev";
|
|
1287
|
+
}
|
|
1288
|
+
return isRtl ? "prev" : "next";
|
|
1289
|
+
}
|
|
1215
1290
|
navigateByDaysOrCells(offset, view) {
|
|
1216
1291
|
const currentDate = this.navigatedDate();
|
|
1217
1292
|
const dateTime = DateTime.fromJSDate(currentDate);
|
|
@@ -1436,13 +1511,12 @@ class CalendarComponent {
|
|
|
1436
1511
|
}
|
|
1437
1512
|
}
|
|
1438
1513
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1439
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CalendarComponent, isStandalone: true, selector: "mona-calendar", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, firstDay: { classPropertyName: "firstDay", publicName: "firstDay", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, weekNumber: { classPropertyName: "weekNumber", publicName: "weekNumber", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", touch: "touch", value: "valueChange" }, host: { attributes: { "role": "application" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.data-invalid": "invalidState() || null", "attr.data-required": "required() || null", "attr.tabindex": "disabled() ? -1 : 0", "class": "baseClass()" } }, queries: [{ propertyName: "decadeCellTemplate", first: true, predicate: CalendarDecadeCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthCellTemplate", first: true, predicate: CalendarMonthCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "yearCellTemplate", first: true, predicate: CalendarYearCellTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>Today</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n navigatedDate() | date: \"MMMM yyyy\" : timezone\n }}</span>\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n navigatedDate() | date: \"yyyy\" : timezone\n }}</span>\n </button>\n }\n @case (\"decade\") {\n <button monaButton look=\"ghost\" [rounded]=\"rounded()\" [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\"\n >{{ decadeStart() }} - {{ decadeEnd() }}</span\n >\n </button>\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n <div [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <div></div>\n }\n @for (day of weekdays(); track day.short) {\n <div>{{ day.short }}</div>\n }\n </div>\n <div\n [class]=\"monthGridClass()\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n (pointerleave)=\"onMonthGridPointerLeave()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @for (row of monthDictChunked(); track $index) {\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = firstEntry.key | date: \"w\";\n <div>{{ week }}</div>\n }\n }\n @for (entry of row; track entry.key) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"disabled()\"\n [disabledDates]=\"disabledDates()\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreview]=\"rangePreviewDates()\"\n [rounded]=\"rounded()\"\n [value]=\"selectedDates()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.value, date: entry.key }\"></ng-container>\n } @else {\n <span>{{ entry.value }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div [class]=\"yearGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"onMonthClick(monthItem[0])\"\n monaYearMonth\n [month]=\"monthItem[0]\"\n [monthName]=\"monthItem[1]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div [class]=\"decadeGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n @for (year of row; track year) {\n <div\n (click)=\"onYearClick(year)\"\n monaDecadeYear\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ year }}</span>\n }\n </div>\n }\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: MonthDayDirective, selector: "[monaMonthDay]", inputs: ["disabled", "disabledDates", "entry", "max", "min", "monthBounds", "navigatedDate", "rangePreview", "rounded", "value"], outputs: ["dayPointerEnter", "daySelect"] }, { kind: "directive", type: DecadeYearDirective, selector: "[monaDecadeYear]", inputs: ["navigatedDate", "rounded", "selectedDate", "year"] }, { kind: "directive", type: YearMonthDirective, selector: "[monaYearMonth]", inputs: ["month", "monthName", "navigatedDate", "rounded", "selectedDate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideChevronLeft, selector: "svg[lucideChevronLeft]" }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: TakeFirstPipe, name: "monaTakeFirst" }] }); }
|
|
1514
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CalendarComponent, isStandalone: true, selector: "mona-calendar", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, firstDay: { classPropertyName: "firstDay", publicName: "firstDay", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, weekNumber: { classPropertyName: "weekNumber", publicName: "weekNumber", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", touch: "touch", value: "valueChange" }, host: { attributes: { "role": "application" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.data-invalid": "invalidState() || null", "attr.data-required": "required() || null", "attr.tabindex": "disabled() ? -1 : 0", "class": "baseClass()" } }, queries: [{ propertyName: "decadeCellTemplate", first: true, predicate: CalendarDecadeCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthCellTemplate", first: true, predicate: CalendarMonthCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "yearCellTemplate", first: true, predicate: CalendarYearCellTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n headerMonthYear()\n }}</span>\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n headerYear()\n }}</span>\n </button>\n }\n @case (\"decade\") {\n <button monaButton look=\"ghost\" [rounded]=\"rounded()\" [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\"\n >{{ decadeStart() }} - {{ decadeEnd() }}</span\n >\n </button>\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n <div [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <div></div>\n }\n @for (day of weekdays(); track day.short) {\n <div>{{ day.short }}</div>\n }\n </div>\n <div\n [class]=\"monthGridClass()\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n (pointerleave)=\"onMonthGridPointerLeave()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @for (row of monthDictChunked(); track $index) {\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = getWeekNumber(firstEntry.key);\n <div>{{ week }}</div>\n }\n }\n @for (entry of row; track entry.key) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"disabled()\"\n [disabledDates]=\"disabledDates()\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreview]=\"rangePreviewDates()\"\n [rounded]=\"rounded()\"\n [value]=\"selectedDates()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.value, date: entry.key }\"></ng-container>\n } @else {\n <span>{{ entry.value }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div [class]=\"yearGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"onMonthClick(monthItem[0])\"\n monaYearMonth\n [month]=\"monthItem[0]\"\n [monthName]=\"monthItem[1]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div [class]=\"decadeGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n @for (year of row; track year) {\n <div\n (click)=\"onYearClick(year)\"\n monaDecadeYear\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ year }}</span>\n }\n </div>\n }\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: MonthDayDirective, selector: "[monaMonthDay]", inputs: ["disabled", "disabledDates", "entry", "max", "min", "monthBounds", "navigatedDate", "rangePreview", "rounded", "value"], outputs: ["dayPointerEnter", "daySelect"] }, { kind: "directive", type: DecadeYearDirective, selector: "[monaDecadeYear]", inputs: ["navigatedDate", "rounded", "selectedDate", "year"] }, { kind: "directive", type: YearMonthDirective, selector: "[monaYearMonth]", inputs: ["month", "monthName", "navigatedDate", "rounded", "selectedDate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideChevronLeft, selector: "svg[lucideChevronLeft]" }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "pipe", type: TakeFirstPipe, name: "monaTakeFirst" }] }); }
|
|
1440
1515
|
}
|
|
1441
1516
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1442
1517
|
type: Component,
|
|
1443
1518
|
args: [{ selector: "mona-calendar", imports: [
|
|
1444
1519
|
ButtonDirective,
|
|
1445
|
-
DatePipe,
|
|
1446
1520
|
MonthDayDirective,
|
|
1447
1521
|
DecadeYearDirective,
|
|
1448
1522
|
YearMonthDirective,
|
|
@@ -1458,7 +1532,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1458
1532
|
"[attr.data-required]": "required() || null",
|
|
1459
1533
|
"[attr.tabindex]": "disabled() ? -1 : 0",
|
|
1460
1534
|
"[class]": "baseClass()"
|
|
1461
|
-
}, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>
|
|
1535
|
+
}, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onTodayButtonClick()\"\n [attr.aria-label]=\"todayButtonLabel()\">\n <span>{{ messages().today }}</span>\n </button>\n @switch (calendarView()) {\n @case (\"month\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('year')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n headerMonthYear()\n }}</span>\n </button>\n }\n @case (\"year\") {\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n (click)=\"onViewChangeClick('decade')\"\n [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\">{{\n headerYear()\n }}</span>\n </button>\n }\n @case (\"decade\") {\n <button monaButton look=\"ghost\" [rounded]=\"rounded()\" [attr.aria-label]=\"viewSwitchButtonLabel()\">\n <span class=\"text-primary font-semibold\" [id]=\"gridId + '-heading'\"\n >{{ decadeStart() }} - {{ decadeEnd() }}</span\n >\n </button>\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('prev')\"\n [attr.aria-label]=\"prevButtonLabel()\">\n <svg lucideChevronLeft class=\"rtl:rotate-180\"></svg>\n </button>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n (click)=\"onNavigationClick('next')\"\n [attr.aria-label]=\"nextButtonLabel()\">\n <svg lucideChevronRight class=\"rtl:rotate-180\"></svg>\n </button>\n</div>\n\n<div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">{{ ariaLabel() }}</div>\n\n@if (calendarView() === \"month\") {\n @let columnCount = weekNumber() ? 8 : 7;\n <div [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <div></div>\n }\n @for (day of weekdays(); track day.short) {\n <div>{{ day.short }}</div>\n }\n </div>\n <div\n [class]=\"monthGridClass()\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n (pointerleave)=\"onMonthGridPointerLeave()\"\n [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @for (row of monthDictChunked(); track $index) {\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = getWeekNumber(firstEntry.key);\n <div>{{ week }}</div>\n }\n }\n @for (entry of row; track entry.key) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"disabled()\"\n [disabledDates]=\"disabledDates()\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreview]=\"rangePreviewDates()\"\n [rounded]=\"rounded()\"\n [value]=\"selectedDates()\"\n [entry]=\"entry\">\n @if (monthCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.value, date: entry.key }\"></ng-container>\n } @else {\n <span>{{ entry.value }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div [class]=\"yearGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"onMonthClick(monthItem[0])\"\n monaYearMonth\n [month]=\"monthItem[0]\"\n [monthName]=\"monthItem[1]\"\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (yearCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: monthItem[0], text: monthItem[1] }\">\n </ng-container>\n } @else {\n <span>{{ monthItem[1] }}</span>\n }\n </div>\n }\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div [class]=\"decadeGridClass()\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n @for (year of row; track year) {\n <div\n (click)=\"onYearClick(year)\"\n monaDecadeYear\n [navigatedDate]=\"navigatedDate()\"\n [rounded]=\"rounded()\"\n [year]=\"year\"\n [selectedDate]=\"selectedDates()[0]\">\n @if (decadeCellTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\">\n </ng-container>\n } @else {\n <span>{{ year }}</span>\n }\n </div>\n }\n }\n </div>\n}\n" }]
|
|
1462
1536
|
}], ctorParameters: () => [], propDecorators: { decadeCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarDecadeCellTemplateDirective), { isSignal: true }] }], monthCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarMonthCellTemplateDirective), { isSignal: true }] }], yearCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarYearCellTemplateDirective), { isSignal: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], firstDay: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDay", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], weekNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekNumber", required: false }] }] } });
|
|
1463
1537
|
|
|
1464
1538
|
/*
|
|
@@ -1469,5 +1543,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1469
1543
|
* Generated bundle index. Do not edit.
|
|
1470
1544
|
*/
|
|
1471
1545
|
|
|
1472
|
-
export { CalendarComponent, CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective };
|
|
1546
|
+
export { CALENDAR_DEFAULT_MESSAGES, CalendarComponent, CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective };
|
|
1473
1547
|
//# sourceMappingURL=nanahoshi-mona-ui-calendar.mjs.map
|
|
@@ -2,6 +2,7 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, TemplateRef, Directive, signal, Service, computed, contentChild, input, Component, viewChild, afterRenderEffect, DestroyRef, contentChildren } from '@angular/core';
|
|
4
4
|
import { classInputToClass } from '@nanahoshi/mona-ui/common';
|
|
5
|
+
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
5
6
|
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
import { themeRaisedBackdropClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
7
8
|
import { cva } from 'class-variance-authority';
|
|
@@ -20,6 +21,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
20
21
|
}]
|
|
21
22
|
}] });
|
|
22
23
|
|
|
24
|
+
const CARD_DEFAULT_MESSAGES = {
|
|
25
|
+
actionsLabel: "Card actions"
|
|
26
|
+
};
|
|
27
|
+
|
|
23
28
|
class CardService {
|
|
24
29
|
constructor() {
|
|
25
30
|
this.actionTemplate = signal([], /* @ts-ignore */
|
|
@@ -50,19 +55,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
50
55
|
}] });
|
|
51
56
|
|
|
52
57
|
const roundedTopVariants = {
|
|
53
|
-
small: "rounded-
|
|
54
|
-
medium: "rounded-
|
|
55
|
-
large: "rounded-
|
|
56
|
-
xlarge: "rounded-
|
|
57
|
-
xxlarge: "rounded-
|
|
58
|
+
small: "rounded-t-sm",
|
|
59
|
+
medium: "rounded-t-md",
|
|
60
|
+
large: "rounded-t-lg",
|
|
61
|
+
xlarge: "rounded-t-xl",
|
|
62
|
+
xxlarge: "rounded-t-2xl",
|
|
58
63
|
none: "rounded-none"
|
|
59
64
|
};
|
|
60
65
|
const roundedBottomVariants = {
|
|
61
|
-
small: "rounded-
|
|
62
|
-
medium: "rounded-
|
|
63
|
-
large: "rounded-
|
|
64
|
-
xlarge: "rounded-
|
|
65
|
-
xxlarge: "rounded-
|
|
66
|
+
small: "rounded-b-sm",
|
|
67
|
+
medium: "rounded-b-md",
|
|
68
|
+
large: "rounded-b-lg",
|
|
69
|
+
xlarge: "rounded-b-xl",
|
|
70
|
+
xxlarge: "rounded-b-2xl",
|
|
66
71
|
none: "rounded-none"
|
|
67
72
|
};
|
|
68
73
|
const roundedAllVariants = {
|
|
@@ -119,8 +124,9 @@ const cardHeaderActionsThemeVariants = cva(`col-start-2 row-start-1 row-span-2 s
|
|
|
119
124
|
class CardComponent {
|
|
120
125
|
constructor() {
|
|
121
126
|
this.#cardService = inject(CardService);
|
|
122
|
-
this
|
|
127
|
+
this.#i18n = inject(MonaI18nService);
|
|
123
128
|
this.actionTemplate = this.#cardService.actionTemplate.asReadonly();
|
|
129
|
+
this.actionsCellClass = cardHeaderActionsThemeVariants();
|
|
124
130
|
this.baseClass = computed(() => {
|
|
125
131
|
const rounded = this.rounded();
|
|
126
132
|
const hasHeader = !!this.headerTemplate();
|
|
@@ -151,6 +157,7 @@ class CardComponent {
|
|
|
151
157
|
}, /* @ts-ignore */
|
|
152
158
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
153
159
|
this.headerTemplate = this.#cardService.headerTemplate.asReadonly();
|
|
160
|
+
this.messages = this.#i18n.componentMessages("card", CARD_DEFAULT_MESSAGES);
|
|
154
161
|
this.titleCellClass = cardHeaderTitleThemeVariants();
|
|
155
162
|
this.titleId = this.#cardService.titleId.asReadonly();
|
|
156
163
|
this.titleTemplate = this.#cardService.titleTemplate.asReadonly();
|
|
@@ -167,8 +174,9 @@ class CardComponent {
|
|
|
167
174
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
168
175
|
}
|
|
169
176
|
#cardService;
|
|
177
|
+
#i18n;
|
|
170
178
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CardComponent, isStandalone: true, selector: "mona-card", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "attr.aria-labelledby": "titleId()", "attr.aria-describedby": "descriptionId()" } }, providers: [CardService], queries: [{ propertyName: "contentDirective", first: true, predicate: CardContentDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" aria-label=\"
|
|
179
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CardComponent, isStandalone: true, selector: "mona-card", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "attr.aria-labelledby": "titleId()", "attr.aria-describedby": "descriptionId()" } }, providers: [CardService], queries: [{ propertyName: "contentDirective", first: true, predicate: CardContentDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
172
180
|
}
|
|
173
181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, decorators: [{
|
|
174
182
|
type: Component,
|
|
@@ -176,7 +184,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
176
184
|
"[class]": "baseClass()",
|
|
177
185
|
"[attr.aria-labelledby]": "titleId()",
|
|
178
186
|
"[attr.aria-describedby]": "descriptionId()"
|
|
179
|
-
}, providers: [CardService], template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" aria-label=\"
|
|
187
|
+
}, providers: [CardService], template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n" }]
|
|
180
188
|
}], propDecorators: { contentDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CardContentDirective), { isSignal: true }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
181
189
|
|
|
182
190
|
class CardFooterComponent {
|
|
@@ -303,5 +311,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
303
311
|
* Generated bundle index. Do not edit.
|
|
304
312
|
*/
|
|
305
313
|
|
|
306
|
-
export { CardActionDirective, CardComponent, CardContentDirective, CardDescriptionDirective, CardFooterComponent, CardHeaderComponent, CardTitleDirective };
|
|
314
|
+
export { CARD_DEFAULT_MESSAGES, CardActionDirective, CardComponent, CardContentDirective, CardDescriptionDirective, CardFooterComponent, CardHeaderComponent, CardTitleDirective };
|
|
307
315
|
//# sourceMappingURL=nanahoshi-mona-ui-card.mjs.map
|