@nanahoshi/mona-ui 0.24.11 → 0.25.1
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 +9 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -10
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +37 -20
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +239 -47
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +183 -30
- package/fesm2022/nanahoshi-mona-ui-button.mjs +45 -9
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +17 -13
- package/fesm2022/nanahoshi-mona-ui-card.mjs +54 -30
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +5 -0
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +112 -31
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +130 -88
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +59 -19
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +118 -41
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +243 -212
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +155 -86
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +161 -131
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +12 -11
- package/fesm2022/nanahoshi-mona-ui-common.mjs +18 -1
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +25 -24
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +202 -33
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +31 -10
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs → nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs → nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs} +7 -7
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs} +27 -29
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -4
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +183 -47
- package/fesm2022/nanahoshi-mona-ui-label.mjs +111 -15
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +14 -13
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +13 -12
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +192 -56
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +3 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +60 -29
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +334 -37
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +84 -30
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +281 -111
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +126 -36
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +595 -170
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +323 -166
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +167 -82
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +273 -165
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +219 -132
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +84 -32
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +337 -116
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +10 -12
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +21 -8
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +472 -84
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +15 -14
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +17 -3
- package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
- package/i18n/catalogs/en-US.messages.json +33 -4
- package/locales/ar-sa/ar-sa.messages.json +33 -4
- package/locales/de-de/de-de.messages.json +33 -4
- package/locales/es-es/es-es.messages.json +33 -4
- package/locales/fr-fr/fr-fr.messages.json +33 -4
- package/locales/id-id/id-id.messages.json +33 -4
- package/locales/it-it/it-it.messages.json +33 -4
- package/locales/ja-jp/ja-jp.messages.json +33 -4
- package/locales/ko-kr/ko-kr.messages.json +33 -4
- package/locales/pt-br/pt-br.messages.json +33 -4
- package/locales/ru-ru/ru-ru.messages.json +33 -4
- package/locales/tr-tr/tr-tr.messages.json +33 -4
- package/locales/zh-cn/zh-cn.messages.json +33 -4
- package/locales/zh-tw/zh-tw.messages.json +33 -4
- package/package.json +2 -1
- package/styles.css +166 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +18 -11
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +62 -14
- package/types/nanahoshi-mona-ui-button-group.d.ts +86 -16
- package/types/nanahoshi-mona-ui-button.d.ts +26 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
- package/types/nanahoshi-mona-ui-card.d.ts +22 -6
- package/types/nanahoshi-mona-ui-check-box.d.ts +54 -13
- package/types/nanahoshi-mona-ui-chip.d.ts +31 -18
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +21 -5
- package/types/nanahoshi-mona-ui-collapsible.d.ts +20 -11
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +62 -36
- package/types/nanahoshi-mona-ui-color-palette.d.ts +65 -27
- package/types/nanahoshi-mona-ui-color-picker.d.ts +64 -23
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-common.d.ts +28 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +1 -0
- package/types/nanahoshi-mona-ui-editor.d.ts +1 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +51 -7
- package/types/nanahoshi-mona-ui-fieldset.d.ts +18 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +0 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +38 -3
- package/types/nanahoshi-mona-ui-internal.d.ts +95 -14
- package/types/nanahoshi-mona-ui-label.d.ts +17 -2
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +1 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-otp-input.d.ts +49 -12
- package/types/nanahoshi-mona-ui-placeholder.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +21 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +165 -20
- package/types/nanahoshi-mona-ui-rating.d.ts +21 -6
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +59 -27
- package/types/nanahoshi-mona-ui-segmented.d.ts +52 -24
- package/types/nanahoshi-mona-ui-sidebar.d.ts +104 -41
- package/types/nanahoshi-mona-ui-skeleton.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +99 -35
- package/types/nanahoshi-mona-ui-spinner.d.ts +9 -5
- package/types/nanahoshi-mona-ui-splitter.d.ts +31 -10
- package/types/nanahoshi-mona-ui-stepper.d.ts +58 -12
- package/types/nanahoshi-mona-ui-switch.d.ts +32 -10
- package/types/nanahoshi-mona-ui-tabs.d.ts +75 -20
- package/types/nanahoshi-mona-ui-text-area.d.ts +7 -7
- package/types/nanahoshi-mona-ui-text-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +392 -15
- package/types/nanahoshi-mona-ui-time-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-time-selector.d.ts +1 -0
- package/types/nanahoshi-mona-ui-tooltip.d.ts +7 -1
|
@@ -7,7 +7,7 @@ import { Dictionary, lastOrDefault, range, index, select } from '@mirei/ts-colle
|
|
|
7
7
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
8
8
|
import { PreventableEvent, TakeFirstPipe } from '@nanahoshi/mona-ui/common';
|
|
9
9
|
import { CalendarService } from '@nanahoshi/mona-ui/date-input';
|
|
10
|
-
import { themeRaisedBackdropClasses, createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
10
|
+
import { themeRaisedBackdropClasses, injectEffectiveDisabled, createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
11
11
|
import { DateTime } from 'luxon';
|
|
12
12
|
import { skip, fromEvent } from 'rxjs';
|
|
13
13
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -121,7 +121,7 @@ const calendarMonthViewDayThemeVariants = cva(`
|
|
|
121
121
|
true: "pointer-events-none cursor-not-allowed text-disabled-foreground"
|
|
122
122
|
},
|
|
123
123
|
focused: {
|
|
124
|
-
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
124
|
+
true: "bg-hover outline-none focus-visible:outline-hidden ring-2 ring-inset ring-focus-indicator/35"
|
|
125
125
|
},
|
|
126
126
|
outside: {
|
|
127
127
|
true: "text-muted-foreground"
|
|
@@ -137,7 +137,7 @@ const calendarMonthViewDayThemeVariants = cva(`
|
|
|
137
137
|
full: "rounded-full"
|
|
138
138
|
},
|
|
139
139
|
selected: {
|
|
140
|
-
true: "bg-primary text-primary-foreground hover:bg-primary-hover"
|
|
140
|
+
true: "bg-primary text-primary-foreground hover:bg-primary-hover forced-color-adjust-none forced-colors:bg-[Highlight]! forced-colors:text-[HighlightText]"
|
|
141
141
|
},
|
|
142
142
|
today: {
|
|
143
143
|
true: "font-bold text-foreground"
|
|
@@ -178,7 +178,7 @@ const calendarYearViewCellThemeVariants = cva(`
|
|
|
178
178
|
`, {
|
|
179
179
|
variants: {
|
|
180
180
|
focused: {
|
|
181
|
-
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
181
|
+
true: "bg-hover outline-none focus-visible:outline-hidden ring-2 ring-inset ring-focus-indicator/35"
|
|
182
182
|
},
|
|
183
183
|
rounded: {
|
|
184
184
|
none: "rounded-none",
|
|
@@ -200,7 +200,7 @@ const calendarDecadeViewCellThemeVariants = cva(`
|
|
|
200
200
|
`, {
|
|
201
201
|
variants: {
|
|
202
202
|
focused: {
|
|
203
|
-
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
203
|
+
true: "bg-hover outline-none focus-visible:outline-hidden ring-2 ring-inset ring-focus-indicator/35"
|
|
204
204
|
},
|
|
205
205
|
rounded: {
|
|
206
206
|
none: "rounded-none",
|
|
@@ -582,7 +582,7 @@ class CalendarComponent {
|
|
|
582
582
|
}, /* @ts-ignore */
|
|
583
583
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
584
584
|
this.baseClass = computed(() => {
|
|
585
|
-
const disabled = this.
|
|
585
|
+
const disabled = this.effectiveDisabled();
|
|
586
586
|
const readonly = this.readonly();
|
|
587
587
|
const rounded = this.rounded() === "full" ? "large" : this.rounded();
|
|
588
588
|
const variantClass = calendarBaseThemeVariants({ disabled, readonly, rounded });
|
|
@@ -617,6 +617,7 @@ class CalendarComponent {
|
|
|
617
617
|
.toArray();
|
|
618
618
|
}, /* @ts-ignore */
|
|
619
619
|
...(ngDevMode ? [{ debugName: "decadeYears" }] : /* istanbul ignore next */ []));
|
|
620
|
+
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
620
621
|
this.effectiveFirstDay = computed(() => {
|
|
621
622
|
return this.firstDay() ?? getLocaleFirstDayOfWeek(this.#i18n.localeId());
|
|
622
623
|
}, /* @ts-ignore */
|
|
@@ -967,7 +968,7 @@ class CalendarComponent {
|
|
|
967
968
|
}
|
|
968
969
|
onDayClick(date, event) {
|
|
969
970
|
event.preventDefault();
|
|
970
|
-
if (this.
|
|
971
|
+
if (this.effectiveDisabled() || this.readonly()) {
|
|
971
972
|
return;
|
|
972
973
|
}
|
|
973
974
|
const selection = this.selection();
|
|
@@ -990,7 +991,10 @@ class CalendarComponent {
|
|
|
990
991
|
this.commitUserSelection();
|
|
991
992
|
}
|
|
992
993
|
onDayPointerEnter(date) {
|
|
993
|
-
if (this.
|
|
994
|
+
if (this.effectiveDisabled() ||
|
|
995
|
+
this.readonly() ||
|
|
996
|
+
this.selection() !== "range" ||
|
|
997
|
+
this.pendingRangeStart() == null) {
|
|
994
998
|
return;
|
|
995
999
|
}
|
|
996
1000
|
this.rangePreviewDate.set(date);
|
|
@@ -1032,7 +1036,7 @@ class CalendarComponent {
|
|
|
1032
1036
|
}
|
|
1033
1037
|
onTodayButtonClick() {
|
|
1034
1038
|
this.refreshToday();
|
|
1035
|
-
if (this.
|
|
1039
|
+
if (this.effectiveDisabled() || this.readonly() || this.todayUnavailable()) {
|
|
1036
1040
|
return;
|
|
1037
1041
|
}
|
|
1038
1042
|
// Today is picked as a click on its day would pick it, so the same rules apply.
|
|
@@ -1123,7 +1127,7 @@ class CalendarComponent {
|
|
|
1123
1127
|
.toArray();
|
|
1124
1128
|
}
|
|
1125
1129
|
handleKeydown(event) {
|
|
1126
|
-
if (this.
|
|
1130
|
+
if (this.effectiveDisabled()) {
|
|
1127
1131
|
return;
|
|
1128
1132
|
}
|
|
1129
1133
|
const preventableEvent = new PreventableEvent("calendarKeydown", event);
|
|
@@ -1593,7 +1597,7 @@ class CalendarComponent {
|
|
|
1593
1597
|
}
|
|
1594
1598
|
}
|
|
1595
1599
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1596
|
-
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 }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", 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 }, required: { classPropertyName: "required", publicName: "required", 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 }, 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: { touch: "touch", value: "valueChange" }, host: { listeners: { "focusin": "refreshToday()", "focusout": "onFocusOut($event)" }, properties: { "attr.aria-label": "null", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-required": "required() || null", "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 [disabled]=\"disabled() || todayUnavailable()\"\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 [disabled]=\"disabled()\"\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 [disabled]=\"disabled()\"\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 <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"text-primary inline-flex h-9 items-center px-4 text-sm font-semibold\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"disabled()\"\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 [disabled]=\"disabled()\"\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\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div role=\"row\" [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (row of monthDictChunked(); track $index) {\n <div role=\"row\" [class]=\"monthGridClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = getWeekNumber(firstEntry.key);\n <div aria-hidden=\"true\">{{ formatInteger(week) }}</div>\n }\n }\n <!-- Track by time: the month is rebuilt with new Date objects on every navigation. -->\n @for (entry of row; track entry.key.getTime()) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"disabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\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>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!disabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"disabled()\"\n [month]=\"monthItem[0]\"\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 </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!disabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"disabled()\"\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>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "type", "class"], outputs: ["lookChange", "selectedChange"] }, { kind: "directive", type: MonthDayDirective, selector: "[monaMonthDay]", inputs: ["disabled", "entry", "isDayUnavailable", "monthBounds", "navigatedDate", "rangePreviewKeys", "rounded", "selectedKeys", "today"], outputs: ["dayPointerEnter", "daySelect"] }, { kind: "directive", type: DecadeYearDirective, selector: "[monaDecadeYear]", inputs: ["disabled", "navigatedDate", "rounded", "selectedDate", "year"] }, { kind: "directive", type: YearMonthDirective, selector: "[monaYearMonth]", inputs: ["disabled", "month", "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" }] }); }
|
|
1600
|
+
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 }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", 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 }, required: { classPropertyName: "required", publicName: "required", 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 }, 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: { touch: "touch", value: "valueChange" }, host: { listeners: { "focusin": "refreshToday()", "focusout": "onFocusOut($event)" }, properties: { "attr.aria-label": "null", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-required": "required() || null", "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 [disabled]=\"effectiveDisabled() || todayUnavailable()\"\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 [disabled]=\"effectiveDisabled()\"\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 [disabled]=\"effectiveDisabled()\"\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 <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"text-primary inline-flex h-9 items-center px-4 text-sm font-semibold\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\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 [disabled]=\"effectiveDisabled()\"\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\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div role=\"row\" [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (row of monthDictChunked(); track $index) {\n <div role=\"row\" [class]=\"monthGridClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = getWeekNumber(firstEntry.key);\n <div aria-hidden=\"true\">{{ formatInteger(week) }}</div>\n }\n }\n <!-- Track by time: the month is rebuilt with new Date objects on every navigation. -->\n @for (entry of row; track entry.key.getTime()) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\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>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\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 </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\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>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "type", "class", "value"], outputs: ["lookChange", "selectedChange"] }, { kind: "directive", type: MonthDayDirective, selector: "[monaMonthDay]", inputs: ["disabled", "entry", "isDayUnavailable", "monthBounds", "navigatedDate", "rangePreviewKeys", "rounded", "selectedKeys", "today"], outputs: ["dayPointerEnter", "daySelect"] }, { kind: "directive", type: DecadeYearDirective, selector: "[monaDecadeYear]", inputs: ["disabled", "navigatedDate", "rounded", "selectedDate", "year"] }, { kind: "directive", type: YearMonthDirective, selector: "[monaYearMonth]", inputs: ["disabled", "month", "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" }] }); }
|
|
1597
1601
|
}
|
|
1598
1602
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1599
1603
|
type: Component,
|
|
@@ -1610,13 +1614,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1610
1614
|
// The host is a plain container: the grid inside it is the widget, and focus moves through its cells. A
|
|
1611
1615
|
// static aria-label written on <mona-calendar> would otherwise stay on the role-less host.
|
|
1612
1616
|
"[attr.aria-label]": "null",
|
|
1613
|
-
"[attr.data-disabled]": "
|
|
1617
|
+
"[attr.data-disabled]": "effectiveDisabled() || null",
|
|
1614
1618
|
"[attr.data-invalid]": "invalidState() || null",
|
|
1615
1619
|
"[attr.data-required]": "required() || null",
|
|
1616
1620
|
"[class]": "baseClass()",
|
|
1617
1621
|
"(focusin)": "refreshToday()",
|
|
1618
1622
|
"(focusout)": "onFocusOut($event)"
|
|
1619
|
-
}, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"
|
|
1623
|
+
}, template: "<div [class]=\"headerClass()\">\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled() || todayUnavailable()\"\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 [disabled]=\"effectiveDisabled()\"\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 [disabled]=\"effectiveDisabled()\"\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 <!-- The decade is the top view, so its heading isn't a button. It names the grid with the locale's\n wording of the range, and shows the digits. -->\n <span\n class=\"text-primary inline-flex h-9 items-center px-4 text-sm font-semibold\"\n [id]=\"gridId + '-heading'\"\n ><span aria-hidden=\"true\">{{ formatInteger(decadeStart()) }} - {{ formatInteger(decadeEnd()) }}</span\n ><span class=\"sr-only\">{{ viewSwitchButtonLabel() }}</span></span\n >\n }\n }\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [disabled]=\"effectiveDisabled()\"\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 [disabled]=\"effectiveDisabled()\"\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\n role=\"grid\"\n class=\"flex flex-col gap-0.5\"\n [attr.aria-labelledby]=\"gridId + '-heading'\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n (pointerleave)=\"onMonthGridPointerLeave()\">\n <div role=\"row\" [class]=\"monthGridHeaderClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n <!-- Week numbers are visual only: every day is already named by its full date. -->\n <div aria-hidden=\"true\"></div>\n }\n @for (day of weekdays(); track day.full) {\n <div role=\"columnheader\">\n <span aria-hidden=\"true\">{{ day.display }}</span>\n <span class=\"sr-only\">{{ day.full }}</span>\n </div>\n }\n </div>\n @for (row of monthDictChunked(); track $index) {\n <div role=\"row\" [class]=\"monthGridClass()\" [style.grid-template-columns]=\"`repeat(${columnCount}, 32px)`\">\n @if (weekNumber()) {\n @let firstEntry = row | monaTakeFirst;\n @if (firstEntry) {\n @let week = getWeekNumber(firstEntry.key);\n <div aria-hidden=\"true\">{{ formatInteger(week) }}</div>\n }\n }\n <!-- Track by time: the month is rebuilt with new Date objects on every navigation. -->\n @for (entry of row; track entry.key.getTime()) {\n <div\n (dayPointerEnter)=\"onDayPointerEnter($event)\"\n (daySelect)=\"onDayClick($event.date, $event.event)\"\n monaMonthDay\n [disabled]=\"effectiveDisabled()\"\n [isDayUnavailable]=\"isDayUnavailable()\"\n [monthBounds]=\"[monthBounds().start, monthBounds().end]\"\n [navigatedDate]=\"navigatedDate()\"\n [rangePreviewKeys]=\"rangePreviewKeys()\"\n [rounded]=\"rounded()\"\n [selectedKeys]=\"selectedKeys()\"\n [today]=\"today()\"\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>{{ formatInteger(entry.value) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else if (calendarView() === \"year\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of months(); track $index) {\n <div role=\"row\" [class]=\"yearGridClass()\">\n @for (monthItem of row; track monthItem) {\n <div\n (click)=\"!effectiveDisabled() && onMonthClick(monthItem[0])\"\n monaYearMonth\n [disabled]=\"effectiveDisabled()\"\n [month]=\"monthItem[0]\"\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 </div>\n }\n </div>\n} @else if (calendarView() === \"decade\") {\n <div role=\"grid\" class=\"flex flex-col gap-0.5\" [attr.aria-labelledby]=\"gridId + '-heading'\">\n @for (row of decadeYears(); track $index) {\n <div role=\"row\" [class]=\"decadeGridClass()\">\n @for (year of row; track year) {\n <div\n (click)=\"!effectiveDisabled() && onYearClick(year)\"\n monaDecadeYear\n [disabled]=\"effectiveDisabled()\"\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>{{ formatInteger(year) }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n" }]
|
|
1620
1624
|
}], 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 }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], firstDay: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDay", required: false }] }], focusOnMount: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnMount", 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 }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", 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"] }], 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 }] }] } });
|
|
1621
1625
|
|
|
1622
1626
|
/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, TemplateRef, Directive, signal, Service, computed, contentChild, input, Component, viewChild,
|
|
3
|
+
import { inject, TemplateRef, Directive, signal, Service, computed, contentChild, input, Component, viewChild, effect, DestroyRef, contentChildren } from '@angular/core';
|
|
4
4
|
import { classInputToClass } from '@nanahoshi/mona-ui/common';
|
|
5
5
|
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -12,12 +12,12 @@ class CardContentDirective {
|
|
|
12
12
|
this.templateRef = inject(TemplateRef);
|
|
13
13
|
}
|
|
14
14
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
15
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardContentDirective, isStandalone: true, selector: "[monaCardContent]", ngImport: i0 }); }
|
|
15
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardContentDirective, isStandalone: true, selector: "ng-template[monaCardContent]", ngImport: i0 }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardContentDirective, decorators: [{
|
|
18
18
|
type: Directive,
|
|
19
19
|
args: [{
|
|
20
|
-
selector: "[monaCardContent]"
|
|
20
|
+
selector: "ng-template[monaCardContent]"
|
|
21
21
|
}]
|
|
22
22
|
}] });
|
|
23
23
|
|
|
@@ -112,7 +112,7 @@ const cardFooterThemeVariants = cva(`
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
const cardHeaderThemeVariants = cva(`
|
|
115
|
-
grid grid-cols-[1fr_auto] grid-rows-
|
|
115
|
+
grid grid-cols-[1fr_auto] grid-rows-[auto_auto]
|
|
116
116
|
p-4 pb-0
|
|
117
117
|
`, {
|
|
118
118
|
variants: {
|
|
@@ -141,6 +141,12 @@ class CardComponent {
|
|
|
141
141
|
this.contentDirective = contentChild(CardContentDirective, /* @ts-ignore */
|
|
142
142
|
...(ngDevMode ? [{ debugName: "contentDirective" }] : /* istanbul ignore next */ []));
|
|
143
143
|
this.descriptionCellClass = cardHeaderDescriptionThemeVariants();
|
|
144
|
+
/** Its own id on the library's wrapper: the template's `let id` may already be on the consumer's element. */
|
|
145
|
+
this.descriptionCellId = computed(() => {
|
|
146
|
+
const id = this.descriptionId();
|
|
147
|
+
return id ? `${id}-cell` : null;
|
|
148
|
+
}, /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "descriptionCellId" }] : /* istanbul ignore next */ []));
|
|
144
150
|
this.descriptionId = this.#cardService.descriptionId.asReadonly();
|
|
145
151
|
this.descriptionTemplate = this.#cardService.descriptionTemplate.asReadonly();
|
|
146
152
|
this.footerClass = computed(() => {
|
|
@@ -161,8 +167,20 @@ class CardComponent {
|
|
|
161
167
|
this.headerTemplate = this.#cardService.headerTemplate.asReadonly();
|
|
162
168
|
this.messages = this.#i18n.componentMessages("card", CARD_DEFAULT_MESSAGES);
|
|
163
169
|
this.titleCellClass = cardHeaderTitleThemeVariants();
|
|
170
|
+
this.titleCellId = computed(() => {
|
|
171
|
+
const id = this.titleId();
|
|
172
|
+
return id ? `${id}-cell` : null;
|
|
173
|
+
}, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "titleCellId" }] : /* istanbul ignore next */ []));
|
|
164
175
|
this.titleId = this.#cardService.titleId.asReadonly();
|
|
165
176
|
this.titleTemplate = this.#cardService.titleTemplate.asReadonly();
|
|
177
|
+
/**
|
|
178
|
+
* @description The role the card takes when it has a title, which then names it. Use `article` for self-contained
|
|
179
|
+
* content or `region` for a landmark.
|
|
180
|
+
* @default "group"
|
|
181
|
+
*/
|
|
182
|
+
this.role = input("group", /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
166
184
|
/**
|
|
167
185
|
* @description Controls the border radius applied to the card and its header/footer regions.
|
|
168
186
|
* @default "medium"
|
|
@@ -178,16 +196,18 @@ class CardComponent {
|
|
|
178
196
|
#cardService;
|
|
179
197
|
#i18n;
|
|
180
198
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
181
|
-
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-
|
|
199
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CardComponent, isStandalone: true, selector: "mona-card", inputs: { role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, 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-describedby": "titleId() ? descriptionCellId() : null", "attr.aria-labelledby": "titleCellId()", "attr.role": "titleId() ? role() : null" } }, 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\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\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"] }] }); }
|
|
182
200
|
}
|
|
183
201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, decorators: [{
|
|
184
202
|
type: Component,
|
|
185
203
|
args: [{ selector: "mona-card", imports: [NgTemplateOutlet], host: {
|
|
186
204
|
"[class]": "baseClass()",
|
|
187
|
-
"[attr.aria-
|
|
188
|
-
"[attr.aria-
|
|
189
|
-
|
|
190
|
-
|
|
205
|
+
"[attr.aria-describedby]": "titleId() ? descriptionCellId() : null",
|
|
206
|
+
"[attr.aria-labelledby]": "titleCellId()",
|
|
207
|
+
// A name only counts on an element with a role, and a card with no title has no name to give it.
|
|
208
|
+
"[attr.role]": "titleId() ? role() : null"
|
|
209
|
+
}, providers: [CardService], template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\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" }]
|
|
210
|
+
}], propDecorators: { contentDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CardContentDirective), { isSignal: true }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
191
211
|
|
|
192
212
|
class CardFooterComponent {
|
|
193
213
|
#cardService;
|
|
@@ -200,11 +220,10 @@ class CardFooterComponent {
|
|
|
200
220
|
* @default ""
|
|
201
221
|
*/
|
|
202
222
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
223
|
+
// A plain effect, because it runs on the server and in the first pass, so the footer isn't missing from either.
|
|
224
|
+
effect(() => {
|
|
225
|
+
this.#cardService.footerTemplate.set(this.footerTemplate());
|
|
226
|
+
this.#cardService.footerClass.set(this.userClass());
|
|
208
227
|
});
|
|
209
228
|
inject(DestroyRef).onDestroy(() => {
|
|
210
229
|
this.#cardService.footerTemplate.set(null);
|
|
@@ -224,12 +243,12 @@ class CardActionDirective {
|
|
|
224
243
|
this.templateRef = inject(TemplateRef);
|
|
225
244
|
}
|
|
226
245
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
227
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardActionDirective, isStandalone: true, selector: "[monaCardAction]", ngImport: i0 }); }
|
|
246
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardActionDirective, isStandalone: true, selector: "ng-template[monaCardAction]", ngImport: i0 }); }
|
|
228
247
|
}
|
|
229
248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardActionDirective, decorators: [{
|
|
230
249
|
type: Directive,
|
|
231
250
|
args: [{
|
|
232
|
-
selector: "[monaCardAction]"
|
|
251
|
+
selector: "ng-template[monaCardAction]"
|
|
233
252
|
}]
|
|
234
253
|
}] });
|
|
235
254
|
|
|
@@ -238,13 +257,16 @@ class CardDescriptionDirective {
|
|
|
238
257
|
this.id = createElementControlId();
|
|
239
258
|
this.templateRef = inject(TemplateRef);
|
|
240
259
|
}
|
|
260
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
241
263
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
242
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardDescriptionDirective, isStandalone: true, selector: "[monaCardDescription]", ngImport: i0 }); }
|
|
264
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardDescriptionDirective, isStandalone: true, selector: "ng-template[monaCardDescription]", ngImport: i0 }); }
|
|
243
265
|
}
|
|
244
266
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardDescriptionDirective, decorators: [{
|
|
245
267
|
type: Directive,
|
|
246
268
|
args: [{
|
|
247
|
-
selector: "[monaCardDescription]"
|
|
269
|
+
selector: "ng-template[monaCardDescription]"
|
|
248
270
|
}]
|
|
249
271
|
}] });
|
|
250
272
|
|
|
@@ -253,13 +275,16 @@ class CardTitleDirective {
|
|
|
253
275
|
this.id = createElementControlId();
|
|
254
276
|
this.templateRef = inject(TemplateRef);
|
|
255
277
|
}
|
|
278
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
256
281
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
257
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardTitleDirective, isStandalone: true, selector: "[monaCardTitle]", ngImport: i0 }); }
|
|
282
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardTitleDirective, isStandalone: true, selector: "ng-template[monaCardTitle]", ngImport: i0 }); }
|
|
258
283
|
}
|
|
259
284
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardTitleDirective, decorators: [{
|
|
260
285
|
type: Directive,
|
|
261
286
|
args: [{
|
|
262
|
-
selector: "[monaCardTitle]"
|
|
287
|
+
selector: "ng-template[monaCardTitle]"
|
|
263
288
|
}]
|
|
264
289
|
}] });
|
|
265
290
|
|
|
@@ -280,16 +305,15 @@ class CardHeaderComponent {
|
|
|
280
305
|
* @default ""
|
|
281
306
|
*/
|
|
282
307
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
308
|
+
// A plain effect, because it runs on the server and in the first pass, so the header isn't missing from either.
|
|
309
|
+
effect(() => {
|
|
310
|
+
this.#cardService.actionTemplate.set(this.actionDirective().map(directive => directive.templateRef));
|
|
311
|
+
this.#cardService.descriptionId.set(this.descriptionDirective()?.id ?? null);
|
|
312
|
+
this.#cardService.descriptionTemplate.set(this.descriptionDirective()?.templateRef ?? null);
|
|
313
|
+
this.#cardService.headerTemplate.set(this.headerTemplate());
|
|
314
|
+
this.#cardService.headerClass.set(this.userClass());
|
|
315
|
+
this.#cardService.titleId.set(this.titleDirective()?.id ?? null);
|
|
316
|
+
this.#cardService.titleTemplate.set(this.titleDirective()?.templateRef ?? null);
|
|
293
317
|
});
|
|
294
318
|
inject(DestroyRef).onDestroy(() => {
|
|
295
319
|
this.#cardService.actionTemplate.set([]);
|
|
@@ -55326,6 +55326,11 @@ class ChartComponent {
|
|
|
55326
55326
|
attributes: true
|
|
55327
55327
|
});
|
|
55328
55328
|
}
|
|
55329
|
+
// A theme applied to part of the page isn't on either of those.
|
|
55330
|
+
const themeRoot = plotEl.closest("[data-mona-theme]");
|
|
55331
|
+
if (themeRoot && themeRoot !== document.documentElement && themeRoot !== document.body) {
|
|
55332
|
+
this.#themeObserver.observe(themeRoot, { attributeFilter: ["style"], attributes: true });
|
|
55333
|
+
}
|
|
55329
55334
|
}
|
|
55330
55335
|
}
|
|
55331
55336
|
// Initial layout pass
|