mn-angular-lib 1.0.12 → 1.0.14
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.
|
@@ -2558,7 +2558,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2558
2558
|
}] } });
|
|
2559
2559
|
|
|
2560
2560
|
const mnSelectVariants = tv({
|
|
2561
|
-
base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer',
|
|
2561
|
+
base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer hover:bg-base-200 transition-colors duration-300',
|
|
2562
2562
|
variants: {
|
|
2563
2563
|
shadow: {
|
|
2564
2564
|
true: 'shadow-lg',
|
|
@@ -7104,6 +7104,14 @@ class UpcomingEventsComponent {
|
|
|
7104
7104
|
this.title = DEFAULT_CALENDAR_CONFIG.upcomingEventsTitle;
|
|
7105
7105
|
this.noEventsMessage = DEFAULT_CALENDAR_CONFIG.noUpcomingEvents;
|
|
7106
7106
|
}
|
|
7107
|
+
/** Re-read labels when the config input changes (e.g. after a locale switch). */
|
|
7108
|
+
ngOnChanges(changes) {
|
|
7109
|
+
if (changes['config'] && this.config) {
|
|
7110
|
+
const resolved = resolveCalendarConfig(this.config);
|
|
7111
|
+
this.title = resolved.upcomingEventsTitle;
|
|
7112
|
+
this.noEventsMessage = resolved.noUpcomingEvents;
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7107
7115
|
ngOnInit() {
|
|
7108
7116
|
const resolved = this.config ? resolveCalendarConfig(this.config) : { ...DEFAULT_CALENDAR_CONFIG };
|
|
7109
7117
|
this.title = resolved.upcomingEventsTitle;
|
|
@@ -7127,7 +7135,7 @@ class UpcomingEventsComponent {
|
|
|
7127
7135
|
return event.id;
|
|
7128
7136
|
}
|
|
7129
7137
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: UpcomingEventsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7130
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: UpcomingEventsComponent, isStandalone: true, selector: "app-upcoming-events", inputs: { eventsChanged: "eventsChanged", config: "config" }, outputs: { eventClicked: "eventClicked" }, ngImport: i0, template: "<div class=\"upcoming-events\" role=\"complementary\" aria-label=\"Upcoming events\">\n <div class=\"upcoming-title\">{{ title }}</div>\n @for (event of upcomingEvents; track $index) {\n <app-upcoming-event-row\n [event]=\"event\"\n (eventClicked)=\"eventClicked.emit($event)\">\n </app-upcoming-event-row>\n }\n @if (upcomingEvents.length === 0) {\n <div class=\"no-events\">{{ noEventsMessage }}</div>\n }\n</div>\n", styles: [".upcoming-events{padding:16px}.upcoming-title{font-size:16px;font-weight:600;margin-bottom:12px}.no-events{color:var(--color-base-content, #9ca3af);opacity:.5;font-size:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: UpcomingEventRowComponent, selector: "app-upcoming-event-row", inputs: ["event"], outputs: ["eventClicked"] }] });
|
|
7138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: UpcomingEventsComponent, isStandalone: true, selector: "app-upcoming-events", inputs: { eventsChanged: "eventsChanged", config: "config" }, outputs: { eventClicked: "eventClicked" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"upcoming-events\" role=\"complementary\" aria-label=\"Upcoming events\">\n <div class=\"upcoming-title\">{{ title }}</div>\n @for (event of upcomingEvents; track $index) {\n <app-upcoming-event-row\n [event]=\"event\"\n (eventClicked)=\"eventClicked.emit($event)\">\n </app-upcoming-event-row>\n }\n @if (upcomingEvents.length === 0) {\n <div class=\"no-events\">{{ noEventsMessage }}</div>\n }\n</div>\n", styles: [".upcoming-events{padding:16px}.upcoming-title{font-size:16px;font-weight:600;margin-bottom:12px}.no-events{color:var(--color-base-content, #9ca3af);opacity:.5;font-size:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: UpcomingEventRowComponent, selector: "app-upcoming-event-row", inputs: ["event"], outputs: ["eventClicked"] }] });
|
|
7131
7139
|
}
|
|
7132
7140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: UpcomingEventsComponent, decorators: [{
|
|
7133
7141
|
type: Component,
|
|
@@ -7194,10 +7202,14 @@ class CalendarViewComponent {
|
|
|
7194
7202
|
destroy$ = new Subject();
|
|
7195
7203
|
formatter;
|
|
7196
7204
|
config;
|
|
7205
|
+
/** Reference to the injected mn-config object (mutated in-place on locale change). */
|
|
7206
|
+
mnConfigRef;
|
|
7197
7207
|
destroyRef = inject(DestroyRef);
|
|
7198
7208
|
lang = inject(MnLanguageService);
|
|
7199
7209
|
constructor(formatter, mnConfig, legacyConfig) {
|
|
7200
7210
|
this.formatter = formatter ?? new DefaultCalendarDateFormatter();
|
|
7211
|
+
// Keep a reference to the injected config so we can re-read it after locale changes.
|
|
7212
|
+
this.mnConfigRef = mnConfig;
|
|
7201
7213
|
// Priority: mn-config system > legacy CALENDAR_CONFIG > built-in defaults
|
|
7202
7214
|
const raw = mnConfig ?? legacyConfig ?? undefined;
|
|
7203
7215
|
this.config = resolveCalendarConfig(raw);
|
|
@@ -7291,6 +7303,10 @@ class CalendarViewComponent {
|
|
|
7291
7303
|
}
|
|
7292
7304
|
/** Rebuilds view options and labels from the current config. */
|
|
7293
7305
|
rebuildFromConfig() {
|
|
7306
|
+
// Re-resolve from the injected config reference which is mutated in-place by the provider on locale change.
|
|
7307
|
+
if (this.mnConfigRef) {
|
|
7308
|
+
this.config = resolveCalendarConfig(this.mnConfigRef);
|
|
7309
|
+
}
|
|
7294
7310
|
this.viewOptions = [
|
|
7295
7311
|
{ value: CalendarView.MONTH, label: this.config.viewLabels['MONTH'] ?? 'Month' },
|
|
7296
7312
|
{ value: CalendarView.WEEK, label: this.config.viewLabels['WEEK'] ?? 'Week' },
|