mn-angular-lib 2.0.34 → 2.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mn-angular-lib-alert.mjs +515 -527
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +264 -357
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-button.mjs +819 -382
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar-core.mjs +240 -365
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +1691 -1545
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +2367 -2796
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +693 -1241
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-display.mjs +679 -712
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +3671 -4647
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-keyboard.mjs +221 -190
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs +711 -896
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2089 -2035
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal.mjs +76 -121
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +289 -277
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-segmented.mjs +189 -241
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +409 -642
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/fesm2022/mn-angular-lib.mjs +16 -29
- package/package.json +1 -1
- package/types/mn-angular-lib-alert.d.ts +239 -241
- package/types/mn-angular-lib-bottom-sheet.d.ts +190 -150
- package/types/mn-angular-lib-button.d.ts +319 -317
- package/types/mn-angular-lib-calendar-core.d.ts +199 -209
- package/types/mn-angular-lib-calendar.d.ts +656 -511
- package/types/mn-angular-lib-collection.d.ts +1649 -1585
- package/types/mn-angular-lib-core.d.ts +524 -535
- package/types/mn-angular-lib-display.d.ts +946 -886
- package/types/mn-angular-lib-forms.d.ts +3012 -3013
- package/types/mn-angular-lib-keyboard.d.ts +125 -85
- package/types/mn-angular-lib-modal-core.d.ts +978 -994
- package/types/mn-angular-lib-modal-ui.d.ts +541 -493
- package/types/mn-angular-lib-modal.d.ts +24 -27
- package/types/mn-angular-lib-rich-text-editor.d.ts +131 -98
- package/types/mn-angular-lib-segmented.d.ts +354 -341
- package/types/mn-angular-lib-tab.d.ts +345 -336
- package/types/mn-angular-lib.d.ts +16 -16
- package/fesm2022/mn-angular-lib.mjs.map +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { CalendarButton, CalendarEventData, CalendarEvent, CalendarView, CalendarConfig, ColumnDay, HourRow, MonthItem } from 'mn-angular-lib/calendar-core';
|
|
6
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, Type, ViewContainerRef } from "@angular/core";
|
|
3
|
+
import { BehaviorSubject, Observable, Subject } from "rxjs";
|
|
4
|
+
import { CalendarButton, CalendarConfig, CalendarEvent, CalendarEventData, CalendarView, ColumnDay, HourRow, MonthItem } from "mn-angular-lib/calendar-core";
|
|
7
5
|
/**
|
|
8
6
|
* Main calendar orchestrator component.
|
|
9
7
|
*
|
|
@@ -28,105 +26,129 @@ import { CalendarButton, CalendarEventData, CalendarEvent, CalendarView, Calenda
|
|
|
28
26
|
* </mn-calendar-view>
|
|
29
27
|
* ```
|
|
30
28
|
*/
|
|
31
|
-
declare class CalendarViewComponent implements OnInit, OnDestroy {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
29
|
+
export declare class CalendarViewComponent implements OnInit, OnDestroy {
|
|
30
|
+
/** Lucide icons the template renders. */
|
|
31
|
+
protected readonly icons: Record<"ChevronLeft" | "ChevronRight", import("@lucide/angular").LucideIconData>;
|
|
32
|
+
/**
|
|
33
|
+
* Accessible name for this control. Resolved through the conventional
|
|
34
|
+
* `mnCalendar.calendarView` key so an app can translate it, falling back to English when the
|
|
35
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
36
|
+
*/
|
|
37
|
+
get calendarViewLabel(): string;
|
|
38
|
+
/** Whether to show the action button in the toolbar. */
|
|
39
|
+
showButton: boolean;
|
|
40
|
+
/** Label text for the action button. */
|
|
41
|
+
buttonTitle: string;
|
|
42
|
+
/** Array of buttons to display in the toolbar's top-right area. */
|
|
43
|
+
buttons: CalendarButton[];
|
|
44
|
+
/** Custom event renderer component type. */
|
|
45
|
+
CalendarEventComponent?: Type<CalendarEventData>;
|
|
46
|
+
/** Observable or EventEmitter that pushes new event arrays into the calendar. */
|
|
47
|
+
NewCalendarItemsEvent?: EventEmitter<CalendarEvent[]>;
|
|
48
|
+
/** Emits when the calendar needs fresh event data (e.g. after navigation). */
|
|
49
|
+
RequestNewCalendarItemsEvent: EventEmitter<Date>;
|
|
50
|
+
/** Emits when a calendar event is clicked. */
|
|
51
|
+
CalendarItemClickedEvent: EventEmitter<CalendarEvent>;
|
|
52
|
+
/** Emits when the action button is clicked. */
|
|
53
|
+
ButtonClickedEvent: EventEmitter<void>;
|
|
54
|
+
readonly CalendarView: typeof CalendarView;
|
|
55
|
+
/** Ties the view tabs to the panel they control, uniquely per calendar. */
|
|
56
|
+
readonly panelId: string;
|
|
57
|
+
currentView: CalendarView;
|
|
58
|
+
focusDay: Date;
|
|
59
|
+
viewOptions: {
|
|
60
|
+
value: CalendarView;
|
|
61
|
+
label: string;
|
|
62
|
+
}[];
|
|
63
|
+
isMobileView: boolean;
|
|
64
|
+
/** BehaviorSubject so late-subscribing child views receive the last emitted events. */
|
|
65
|
+
internalEventsChanged: BehaviorSubject<CalendarEvent[]>;
|
|
66
|
+
/** Subject for broadcasting focus-day changes to child views. */
|
|
67
|
+
internalFocusDayChanged: Subject<Date>;
|
|
68
|
+
private destroy$;
|
|
69
|
+
protected config: CalendarConfig;
|
|
70
|
+
/** Reference to the injected mn-config object (mutated in-place on locale change). */
|
|
71
|
+
private readonly mnConfigRef;
|
|
72
|
+
private readonly destroyRef;
|
|
73
|
+
private readonly lang;
|
|
74
|
+
private readonly cdr;
|
|
75
|
+
constructor();
|
|
76
|
+
onResize(): void;
|
|
77
|
+
ngOnInit(): void;
|
|
78
|
+
ngOnDestroy(): void;
|
|
79
|
+
/** Switches the active view. On mobile, forces day view. */
|
|
80
|
+
switchView(view: CalendarView): void;
|
|
81
|
+
/**
|
|
82
|
+
* Names the stretch of time on screen — the day, the week, or the month. It is
|
|
83
|
+
* the toolbar's orientation: without it, navigating leaves you somewhere with
|
|
84
|
+
* no label. Announced politely, so stepping through says where you landed.
|
|
85
|
+
*/
|
|
86
|
+
get periodLabel(): string;
|
|
87
|
+
/** The focus day as YYYY-MM-DD, for the toolbar's date picker. */
|
|
88
|
+
get focusDayString(): string;
|
|
89
|
+
/**
|
|
90
|
+
* Steps the calendar by one unit of whatever is on screen: a day in day view,
|
|
91
|
+
* a week in week view, a month in month view. Navigating by the visible unit is
|
|
92
|
+
* what makes one pair of arrows serve all three.
|
|
93
|
+
*/
|
|
94
|
+
navigate(step: number): void;
|
|
95
|
+
/** Returns the calendar to today. */
|
|
96
|
+
goToToday(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Handles the toolbar date picker.
|
|
99
|
+
* @param value The date string in YYYY-MM-DD format.
|
|
100
|
+
*/
|
|
101
|
+
onPickDate(value: string): void;
|
|
102
|
+
/** Handles a day click from the month view — switches to day view. */
|
|
103
|
+
onMonthDayClick(date: Date): void;
|
|
104
|
+
/** Forwards a child event click to the parent output. */
|
|
105
|
+
onEventClick(event: CalendarEvent): void;
|
|
106
|
+
/** trackBy for view option buttons. */
|
|
107
|
+
trackByView(_index: number, item: {
|
|
108
|
+
value: CalendarView;
|
|
109
|
+
}): string;
|
|
110
|
+
/** Rebuilds view options and labels from the current config. */
|
|
111
|
+
private rebuildFromConfig;
|
|
112
|
+
private checkMobileView;
|
|
113
|
+
/**
|
|
114
|
+
* Adds months without the end-of-month overflow `setMonth` alone produces —
|
|
115
|
+
* 31 January plus one month is 28 February, not 3 March.
|
|
116
|
+
*/
|
|
117
|
+
private addMonths;
|
|
118
|
+
/** Monday of the week containing `date`, matching the grid the views draw. */
|
|
119
|
+
private startOfWeek;
|
|
120
|
+
private setFocusDay;
|
|
121
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarViewComponent, never>;
|
|
122
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarViewComponent, "mn-calendar-view", never, {
|
|
123
|
+
"showButton": {
|
|
124
|
+
"alias": "showButton";
|
|
125
|
+
"required": false;
|
|
126
|
+
};
|
|
127
|
+
"buttonTitle": {
|
|
128
|
+
"alias": "buttonTitle";
|
|
129
|
+
"required": false;
|
|
130
|
+
};
|
|
131
|
+
"buttons": {
|
|
132
|
+
"alias": "buttons";
|
|
133
|
+
"required": false;
|
|
134
|
+
};
|
|
135
|
+
"CalendarEventComponent": {
|
|
136
|
+
"alias": "CalendarEventComponent";
|
|
137
|
+
"required": false;
|
|
138
|
+
};
|
|
139
|
+
"NewCalendarItemsEvent": {
|
|
140
|
+
"alias": "NewCalendarItemsEvent";
|
|
141
|
+
"required": false;
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
"RequestNewCalendarItemsEvent": "RequestNewCalendarItemsEvent";
|
|
145
|
+
"CalendarItemClickedEvent": "CalendarItemClickedEvent";
|
|
146
|
+
"ButtonClickedEvent": "ButtonClickedEvent";
|
|
147
|
+
}, never, never, true, never>;
|
|
125
148
|
}
|
|
126
|
-
|
|
127
149
|
/** Extended hour row with a pre-resolved display label. */
|
|
128
150
|
type DisplayHourRow$1 = {
|
|
129
|
-
|
|
151
|
+
hourLabel: string;
|
|
130
152
|
} & HourRow;
|
|
131
153
|
/**
|
|
132
154
|
* Week grid view showing 7 day columns with half-hour time slots.
|
|
@@ -134,76 +156,98 @@ type DisplayHourRow$1 = {
|
|
|
134
156
|
* Overlapping events within the same day are laid out in sub-columns
|
|
135
157
|
* so they appear side-by-side rather than stacked.
|
|
136
158
|
*/
|
|
137
|
-
declare class CalendarWeekComponent implements OnInit, OnDestroy {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
159
|
+
export declare class CalendarWeekComponent implements OnInit, OnDestroy {
|
|
160
|
+
private readonly lang;
|
|
161
|
+
/**
|
|
162
|
+
* Accessible name for this control. Resolved through the conventional
|
|
163
|
+
* `mnCalendar.weekView` key so an app can translate it, falling back to English when the
|
|
164
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
165
|
+
*/
|
|
166
|
+
get weekViewLabel(): string;
|
|
167
|
+
private layoutService;
|
|
168
|
+
private cdr;
|
|
169
|
+
/** The date around which the week is centred. */
|
|
170
|
+
focusDay: Date;
|
|
171
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
172
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
173
|
+
/** Observable that emits when the focus day changes. */
|
|
174
|
+
focusDayChanged: Observable<Date>;
|
|
175
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
176
|
+
config?: CalendarConfig;
|
|
177
|
+
/** Optional custom event renderer component. */
|
|
178
|
+
calendarEventComponent?: Type<CalendarEventData>;
|
|
179
|
+
/** Emits when a calendar event is clicked. */
|
|
180
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
181
|
+
columns: ColumnDay[];
|
|
182
|
+
hourRows: DisplayHourRow$1[];
|
|
183
|
+
displayEvents: CalendarEvent[];
|
|
184
|
+
totalRows: number;
|
|
185
|
+
currentTimeRow: number;
|
|
186
|
+
currentTimeCol: string;
|
|
187
|
+
/** The current time, formatted for the label riding the now-line. */
|
|
188
|
+
currentTimeLabel: string;
|
|
189
|
+
gridTemplateColumns: string;
|
|
190
|
+
private dayColumnMap;
|
|
191
|
+
private events;
|
|
192
|
+
private destroy$;
|
|
193
|
+
private formatter;
|
|
194
|
+
private resolvedConfig;
|
|
195
|
+
private currentTimeInterval?;
|
|
196
|
+
constructor();
|
|
197
|
+
ngOnInit(): void;
|
|
198
|
+
ngOnDestroy(): void;
|
|
199
|
+
/** Returns the CSS `grid-row` value for an event based on its start/end times. */
|
|
200
|
+
getEventRow(event: CalendarEvent): string;
|
|
201
|
+
/** Returns the CSS `grid-column` span for a day header, accounting for sub-columns. */
|
|
202
|
+
getHeaderColumn(dayIndex: number): string;
|
|
203
|
+
/** Returns the CSS `grid-column` value for an event within its day's sub-columns. */
|
|
204
|
+
getEventColumn(event: CalendarEvent): string;
|
|
205
|
+
/** Forwards event click to parent. */
|
|
206
|
+
onEventClick(event: CalendarEvent): void;
|
|
207
|
+
/** trackBy for hour rows. */
|
|
208
|
+
trackByHour(_index: number, row: DisplayHourRow$1): number;
|
|
209
|
+
/** trackBy for day columns. */
|
|
210
|
+
trackByColumn(_index: number, col: ColumnDay): number;
|
|
211
|
+
/** trackBy for events. */
|
|
212
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
213
|
+
private buildHourRows;
|
|
214
|
+
/** Builds the 7 day columns for the current week (Monday–Sunday). */
|
|
215
|
+
private buildColumns;
|
|
216
|
+
/** Filters, splits, and lays out events for the current week. */
|
|
217
|
+
private refreshEvents;
|
|
218
|
+
/** Computes the CSS grid-template-columns string based on per-day sub-column counts. */
|
|
219
|
+
private buildGridColumns;
|
|
220
|
+
/** Updates the current-time red line position. */
|
|
221
|
+
private updateCurrentTime;
|
|
222
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarWeekComponent, never>;
|
|
223
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarWeekComponent, "mn-calendar-week", never, {
|
|
224
|
+
"focusDay": {
|
|
225
|
+
"alias": "focusDay";
|
|
226
|
+
"required": false;
|
|
227
|
+
};
|
|
228
|
+
"eventsChanged": {
|
|
229
|
+
"alias": "eventsChanged";
|
|
230
|
+
"required": false;
|
|
231
|
+
};
|
|
232
|
+
"focusDayChanged": {
|
|
233
|
+
"alias": "focusDayChanged";
|
|
234
|
+
"required": false;
|
|
235
|
+
};
|
|
236
|
+
"config": {
|
|
237
|
+
"alias": "config";
|
|
238
|
+
"required": false;
|
|
239
|
+
};
|
|
240
|
+
"calendarEventComponent": {
|
|
241
|
+
"alias": "calendarEventComponent";
|
|
242
|
+
"required": false;
|
|
243
|
+
};
|
|
244
|
+
}, {
|
|
245
|
+
"eventClicked": "eventClicked";
|
|
246
|
+
}, never, never, true, never>;
|
|
202
247
|
}
|
|
203
|
-
|
|
204
248
|
/** Extended hour row with a pre-resolved display label. */
|
|
205
249
|
type DisplayHourRow = {
|
|
206
|
-
|
|
250
|
+
hourLabel: string;
|
|
207
251
|
} & HourRow;
|
|
208
252
|
/**
|
|
209
253
|
* Day grid view showing a single day with half-hour time slots.
|
|
@@ -211,117 +255,157 @@ type DisplayHourRow = {
|
|
|
211
255
|
* Shares the same layout algorithm as the week view via
|
|
212
256
|
* {@link CalendarEventLayoutService}.
|
|
213
257
|
*/
|
|
214
|
-
declare class CalendarDayComponent implements OnInit, OnDestroy {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
258
|
+
export declare class CalendarDayComponent implements OnInit, OnDestroy {
|
|
259
|
+
private readonly lang;
|
|
260
|
+
/**
|
|
261
|
+
* Accessible name for this control. Resolved through the conventional
|
|
262
|
+
* `mnCalendar.dayView` key so an app can translate it, falling back to English when the
|
|
263
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
264
|
+
*/
|
|
265
|
+
get dayViewLabel(): string;
|
|
266
|
+
private layoutService;
|
|
267
|
+
private cdr;
|
|
268
|
+
/** The date to display. */
|
|
269
|
+
focusDay: Date;
|
|
270
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
271
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
272
|
+
/** Observable that emits when the focus day changes. */
|
|
273
|
+
focusDayChanged: Observable<Date>;
|
|
274
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
275
|
+
config?: CalendarConfig;
|
|
276
|
+
/** Optional custom event renderer component. */
|
|
277
|
+
calendarEventComponent?: Type<CalendarEventData>;
|
|
278
|
+
/** Emits when a calendar event is clicked. */
|
|
279
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
280
|
+
hourRows: DisplayHourRow[];
|
|
281
|
+
displayEvents: CalendarEvent[];
|
|
282
|
+
totalRows: number;
|
|
283
|
+
totalColumns: number;
|
|
284
|
+
currentTimeRow: number;
|
|
285
|
+
/** The current time, formatted for the label riding the now-line. */
|
|
286
|
+
currentTimeLabel: string;
|
|
287
|
+
isToday: boolean;
|
|
288
|
+
dayName: string;
|
|
289
|
+
private events;
|
|
290
|
+
private destroy$;
|
|
291
|
+
private formatter;
|
|
292
|
+
private resolvedConfig;
|
|
293
|
+
private currentTimeInterval?;
|
|
294
|
+
constructor();
|
|
295
|
+
ngOnInit(): void;
|
|
296
|
+
ngOnDestroy(): void;
|
|
297
|
+
/** Returns the CSS `grid-row` value for an event. */
|
|
298
|
+
getEventRow(event: CalendarEvent): string;
|
|
299
|
+
/** Returns the CSS `grid-column` value for an event within its sub-columns. */
|
|
300
|
+
getEventColumn(event: CalendarEvent): string;
|
|
301
|
+
/** Forwards event click to parent. */
|
|
302
|
+
onEventClick(event: CalendarEvent): void;
|
|
303
|
+
/** trackBy for hour rows. */
|
|
304
|
+
trackByHour(_index: number, row: DisplayHourRow): number;
|
|
305
|
+
/** trackBy for events. */
|
|
306
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
307
|
+
private buildHourRows;
|
|
308
|
+
/** Updates the day name and isToday flag. */
|
|
309
|
+
private updateDayInfo;
|
|
310
|
+
/** Filters, splits, and lays out events for the focus day. */
|
|
311
|
+
private refreshEvents;
|
|
312
|
+
/** Updates the current-time red line position. */
|
|
313
|
+
private updateCurrentTime;
|
|
314
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarDayComponent, never>;
|
|
315
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarDayComponent, "mn-calendar-day", never, {
|
|
316
|
+
"focusDay": {
|
|
317
|
+
"alias": "focusDay";
|
|
318
|
+
"required": false;
|
|
319
|
+
};
|
|
320
|
+
"eventsChanged": {
|
|
321
|
+
"alias": "eventsChanged";
|
|
322
|
+
"required": false;
|
|
323
|
+
};
|
|
324
|
+
"focusDayChanged": {
|
|
325
|
+
"alias": "focusDayChanged";
|
|
326
|
+
"required": false;
|
|
327
|
+
};
|
|
328
|
+
"config": {
|
|
329
|
+
"alias": "config";
|
|
330
|
+
"required": false;
|
|
331
|
+
};
|
|
332
|
+
"calendarEventComponent": {
|
|
333
|
+
"alias": "calendarEventComponent";
|
|
334
|
+
"required": false;
|
|
335
|
+
};
|
|
336
|
+
}, {
|
|
337
|
+
"eventClicked": "eventClicked";
|
|
338
|
+
}, never, never, true, never>;
|
|
272
339
|
}
|
|
273
|
-
|
|
274
340
|
/**
|
|
275
341
|
* Month grid view showing a 7×6 grid of day cells.
|
|
276
342
|
*
|
|
277
343
|
* Each cell displays the day number and up to 3 coloured dots representing
|
|
278
344
|
* events on that day. Clicking a cell emits `dayClicked`.
|
|
279
345
|
*/
|
|
280
|
-
declare class CalendarMonthComponent implements OnInit, OnDestroy {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
346
|
+
export declare class CalendarMonthComponent implements OnInit, OnDestroy {
|
|
347
|
+
private readonly lang;
|
|
348
|
+
private readonly cdr;
|
|
349
|
+
/**
|
|
350
|
+
* Accessible name for this control. Resolved through the conventional
|
|
351
|
+
* `mnCalendar.monthView` key so an app can translate it, falling back to English when the
|
|
352
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
353
|
+
*/
|
|
354
|
+
get monthViewLabel(): string;
|
|
355
|
+
/** The date whose month is displayed. */
|
|
356
|
+
focusDay: Date;
|
|
357
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
358
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
359
|
+
/** Observable that emits when the focus day changes. */
|
|
360
|
+
focusDayChanged: Observable<Date>;
|
|
361
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
362
|
+
config?: CalendarConfig;
|
|
363
|
+
/** Emits the date of a clicked day cell. */
|
|
364
|
+
dayClicked: EventEmitter<Date>;
|
|
365
|
+
monthItems: MonthItem[];
|
|
366
|
+
/** Short weekday column headers (e.g. "Mon"), kept compact for the narrow columns. */
|
|
367
|
+
weekdayLabels: string[];
|
|
368
|
+
/** Word shown after the "+N" overflow count (e.g. "more"), from config. */
|
|
369
|
+
moreEventsLabel: string;
|
|
370
|
+
private events;
|
|
371
|
+
private destroy$;
|
|
372
|
+
private formatter;
|
|
373
|
+
constructor();
|
|
374
|
+
ngOnInit(): void;
|
|
375
|
+
ngOnDestroy(): void;
|
|
376
|
+
/** Emits the clicked day's date. */
|
|
377
|
+
onDayClick(date: Date): void;
|
|
378
|
+
/** trackBy for day name headers. */
|
|
379
|
+
trackByDayName(index: number): number;
|
|
380
|
+
/** trackBy for month grid cells. */
|
|
381
|
+
trackByMonthItem(_index: number, item: MonthItem): number;
|
|
382
|
+
/** trackBy for event dots. */
|
|
383
|
+
trackByEventDot(_index: number, event: CalendarEvent): string;
|
|
384
|
+
/** Builds the 42-cell month grid (6 rows × 7 columns). */
|
|
385
|
+
private buildMonth;
|
|
386
|
+
private createMonthItem;
|
|
387
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarMonthComponent, never>;
|
|
388
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarMonthComponent, "mn-calendar-month", never, {
|
|
389
|
+
"focusDay": {
|
|
390
|
+
"alias": "focusDay";
|
|
391
|
+
"required": false;
|
|
392
|
+
};
|
|
393
|
+
"eventsChanged": {
|
|
394
|
+
"alias": "eventsChanged";
|
|
395
|
+
"required": false;
|
|
396
|
+
};
|
|
397
|
+
"focusDayChanged": {
|
|
398
|
+
"alias": "focusDayChanged";
|
|
399
|
+
"required": false;
|
|
400
|
+
};
|
|
401
|
+
"config": {
|
|
402
|
+
"alias": "config";
|
|
403
|
+
"required": false;
|
|
404
|
+
};
|
|
405
|
+
}, {
|
|
406
|
+
"dayClicked": "dayClicked";
|
|
407
|
+
}, never, never, true, never>;
|
|
323
408
|
}
|
|
324
|
-
|
|
325
409
|
/**
|
|
326
410
|
* Dynamic event renderer that injects a custom or default event component
|
|
327
411
|
* into its view container.
|
|
@@ -331,96 +415,121 @@ declare class CalendarMonthComponent implements OnInit, OnDestroy {
|
|
|
331
415
|
* 2. `event.component` (per-event override)
|
|
332
416
|
* 3. {@link CalendarEventDefaultComponent} (library default)
|
|
333
417
|
*/
|
|
334
|
-
declare class CalendarEventComponent implements AfterViewInit, OnChanges {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
418
|
+
export declare class CalendarEventComponent implements AfterViewInit, OnChanges {
|
|
419
|
+
/** The event data to render. */
|
|
420
|
+
event: CalendarEvent;
|
|
421
|
+
/** Optional custom component type that overrides the default renderer. */
|
|
422
|
+
customComponent?: Type<CalendarEventData>;
|
|
423
|
+
/** Emits when the rendered event is clicked. */
|
|
424
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
425
|
+
eventContainer: ViewContainerRef;
|
|
426
|
+
private rendered;
|
|
427
|
+
ngAfterViewInit(): void;
|
|
428
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
429
|
+
/** Emits the event click. */
|
|
430
|
+
onEventClick(): void;
|
|
431
|
+
/** Creates the event component dynamically and sets its `event` property. */
|
|
432
|
+
private renderComponent;
|
|
433
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventComponent, never>;
|
|
434
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarEventComponent, "mn-calendar-event", never, {
|
|
435
|
+
"event": {
|
|
436
|
+
"alias": "event";
|
|
437
|
+
"required": false;
|
|
438
|
+
};
|
|
439
|
+
"customComponent": {
|
|
440
|
+
"alias": "customComponent";
|
|
441
|
+
"required": false;
|
|
442
|
+
};
|
|
443
|
+
}, {
|
|
444
|
+
"eventClicked": "eventClicked";
|
|
445
|
+
}, never, never, true, never>;
|
|
351
446
|
}
|
|
352
|
-
|
|
353
447
|
/**
|
|
354
448
|
* Default event renderer used when no custom component is provided.
|
|
355
449
|
*
|
|
356
450
|
* Displays the event title, formatted time range, and optional description
|
|
357
451
|
* with the event's colour scheme applied as background and left-border accent.
|
|
358
452
|
*/
|
|
359
|
-
declare class CalendarEventDefaultComponent implements CalendarEventData, OnInit {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
453
|
+
export declare class CalendarEventDefaultComponent implements CalendarEventData, OnInit {
|
|
454
|
+
private cdr;
|
|
455
|
+
/** The event to render. Set by {@link CalendarEventComponent} after creation. */
|
|
456
|
+
event: CalendarEvent;
|
|
457
|
+
formattedTime: string;
|
|
458
|
+
private formatter;
|
|
459
|
+
constructor();
|
|
460
|
+
ngOnInit(): Promise<void>;
|
|
461
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventDefaultComponent, never>;
|
|
462
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarEventDefaultComponent, "mn-calendar-event-default", never, {}, {}, never, never, true, never>;
|
|
369
463
|
}
|
|
370
|
-
|
|
371
464
|
/**
|
|
372
465
|
* Sidebar component that lists the next 10 upcoming events
|
|
373
466
|
* (events whose end time is in the future), sorted by start time.
|
|
374
467
|
*/
|
|
375
|
-
declare class UpcomingEventsComponent implements OnInit, OnChanges, OnDestroy {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
468
|
+
export declare class UpcomingEventsComponent implements OnInit, OnChanges, OnDestroy {
|
|
469
|
+
private readonly lang;
|
|
470
|
+
private readonly cdr;
|
|
471
|
+
/**
|
|
472
|
+
* Accessible name for this control. Resolved through the conventional
|
|
473
|
+
* `mnCalendar.upcomingEvents` key so an app can translate it, falling back to English when the
|
|
474
|
+
* key is not defined rather than leaking the raw key into the UI.
|
|
475
|
+
*/
|
|
476
|
+
get upcomingEventsLabel(): string;
|
|
477
|
+
/** Observable that emits the full event list whenever it changes. */
|
|
478
|
+
eventsChanged: Observable<CalendarEvent[]>;
|
|
479
|
+
/** Resolved calendar configuration passed from the parent view. */
|
|
480
|
+
config?: CalendarConfig;
|
|
481
|
+
/** Emits when an upcoming event row is clicked. */
|
|
482
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
483
|
+
upcomingEvents: CalendarEvent[];
|
|
484
|
+
title: string;
|
|
485
|
+
noEventsMessage: string;
|
|
486
|
+
private destroy$;
|
|
487
|
+
constructor();
|
|
488
|
+
/** Re-read labels when the config input changes (e.g. after a locale switch). */
|
|
489
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
490
|
+
ngOnInit(): void;
|
|
491
|
+
ngOnDestroy(): void;
|
|
492
|
+
/** trackBy for upcoming event rows. */
|
|
493
|
+
trackByEvent(_index: number, event: CalendarEvent): string;
|
|
494
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UpcomingEventsComponent, never>;
|
|
495
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UpcomingEventsComponent, "mn-upcoming-events", never, {
|
|
496
|
+
"eventsChanged": {
|
|
497
|
+
"alias": "eventsChanged";
|
|
498
|
+
"required": false;
|
|
499
|
+
};
|
|
500
|
+
"config": {
|
|
501
|
+
"alias": "config";
|
|
502
|
+
"required": false;
|
|
503
|
+
};
|
|
504
|
+
}, {
|
|
505
|
+
"eventClicked": "eventClicked";
|
|
506
|
+
}, never, never, true, never>;
|
|
403
507
|
}
|
|
404
|
-
|
|
405
508
|
/**
|
|
406
509
|
* Renders a single row in the upcoming-events sidebar.
|
|
407
510
|
* Shows the event title, formatted date/time, and optional description.
|
|
408
511
|
*/
|
|
409
|
-
declare class UpcomingEventRowComponent implements OnInit {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
512
|
+
export declare class UpcomingEventRowComponent implements OnInit {
|
|
513
|
+
/** The event to display. */
|
|
514
|
+
event: CalendarEvent;
|
|
515
|
+
/** Emits the event when this row is clicked. */
|
|
516
|
+
eventClicked: EventEmitter<CalendarEvent>;
|
|
517
|
+
formattedDate: string;
|
|
518
|
+
private formatter;
|
|
519
|
+
/** Marks the view when the awaited time string lands (see {@link ngOnInit}). */
|
|
520
|
+
private readonly cdr;
|
|
521
|
+
constructor();
|
|
522
|
+
ngOnInit(): Promise<void>;
|
|
523
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UpcomingEventRowComponent, never>;
|
|
524
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UpcomingEventRowComponent, "mn-upcoming-event-row", never, {
|
|
525
|
+
"event": {
|
|
526
|
+
"alias": "event";
|
|
527
|
+
"required": false;
|
|
528
|
+
};
|
|
529
|
+
}, {
|
|
530
|
+
"eventClicked": "eventClicked";
|
|
531
|
+
}, never, never, true, never>;
|
|
422
532
|
}
|
|
423
|
-
|
|
424
533
|
/**
|
|
425
534
|
* How the bar arranges itself at its current width.
|
|
426
535
|
*
|
|
@@ -433,29 +542,29 @@ declare class UpcomingEventRowComponent implements OnInit {
|
|
|
433
542
|
* Resolved from the bar's own width — not the viewport — so a bar in a narrow
|
|
434
543
|
* sidebar lays itself out like a phone even on a wide screen.
|
|
435
544
|
*/
|
|
436
|
-
type DateSelectorBarLayout = 'compact' | 'inline';
|
|
545
|
+
export type DateSelectorBarLayout = 'compact' | 'inline';
|
|
437
546
|
/** Represents a single day tile in the date selector. */
|
|
438
|
-
type DayTile = {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
547
|
+
export type DayTile = {
|
|
548
|
+
/** The full date object (at midnight). */
|
|
549
|
+
date: Date;
|
|
550
|
+
/** Short day name (e.g. 'ma', 'Mon'). */
|
|
551
|
+
dayName: string;
|
|
552
|
+
/** Day-of-month number. */
|
|
553
|
+
dayNumber: number;
|
|
554
|
+
/** Short month name (e.g. 'mei', 'Jun'). */
|
|
555
|
+
monthName: string;
|
|
556
|
+
/**
|
|
557
|
+
* Whether this tile is the first day of a month within the visible strip. The
|
|
558
|
+
* days either side of it move apart, so the break is visible without a label —
|
|
559
|
+
* the month header above the strip names both months.
|
|
560
|
+
*/
|
|
561
|
+
startsNewMonth: boolean;
|
|
562
|
+
/** Whether this tile is the currently selected date. */
|
|
563
|
+
isSelected: boolean;
|
|
564
|
+
/** Whether this tile represents today. */
|
|
565
|
+
isToday: boolean;
|
|
566
|
+
/** Full, locale-formatted date used as the tile's accessible name. */
|
|
567
|
+
accessibleLabel: string;
|
|
459
568
|
};
|
|
460
569
|
/**
|
|
461
570
|
* Reusable, responsive date selector bar.
|
|
@@ -490,149 +599,185 @@ type DayTile = {
|
|
|
490
599
|
* </mn-date-selector-bar>
|
|
491
600
|
* ```
|
|
492
601
|
*/
|
|
493
|
-
declare class MnDateSelectorBar implements OnInit {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
602
|
+
export declare class MnDateSelectorBar implements OnInit {
|
|
603
|
+
/** Lucide icons the template renders. */
|
|
604
|
+
protected readonly icons: Record<"ChevronLeft" | "ChevronRight", import("@lucide/angular").LucideIconData>;
|
|
605
|
+
/** The currently selected date, provided by the parent. */
|
|
606
|
+
readonly selectedDate: import("@angular/core").InputSignal<Date>;
|
|
607
|
+
/** Label for the "Today" button. */
|
|
608
|
+
readonly todayLabel: import("@angular/core").InputSignal<string>;
|
|
609
|
+
/** Placeholder for the date picker shown in place of a too-cramped week strip. */
|
|
610
|
+
readonly pickDateLabel: import("@angular/core").InputSignal<string>;
|
|
611
|
+
/** Accessible name for the previous-week arrow. */
|
|
612
|
+
readonly previousLabel: import("@angular/core").InputSignal<string>;
|
|
613
|
+
/** Accessible name for the next-week arrow. */
|
|
614
|
+
readonly nextLabel: import("@angular/core").InputSignal<string>;
|
|
615
|
+
/** Accessible name for the day strip as a whole. */
|
|
616
|
+
readonly dayStripLabel: import("@angular/core").InputSignal<string>;
|
|
617
|
+
/**
|
|
618
|
+
* BCP 47 locale used to format day/month names. When empty, the active
|
|
619
|
+
* {@link MnLanguageService} locale is used.
|
|
620
|
+
*/
|
|
621
|
+
readonly locale: import("@angular/core").InputSignal<string>;
|
|
622
|
+
/** Emits when the user selects a new date. */
|
|
623
|
+
readonly dateSelected: import("@angular/core").OutputEmitterRef<Date>;
|
|
624
|
+
/** Unique id for this instance's date picker, so several bars can coexist. */
|
|
625
|
+
readonly pickerId: string;
|
|
626
|
+
private readonly destroyRef;
|
|
627
|
+
private readonly injector;
|
|
628
|
+
private readonly host;
|
|
629
|
+
private readonly lang;
|
|
630
|
+
private readonly tileButtons;
|
|
631
|
+
/** The bar's own width in px, tracked so the layout follows its container. */
|
|
632
|
+
private readonly containerWidth;
|
|
633
|
+
/** Bumped whenever the active language changes so name formatting re-runs. */
|
|
634
|
+
private readonly localeTick;
|
|
635
|
+
/** How the bar is arranged at the current width. */
|
|
636
|
+
readonly layout: import("@angular/core").Signal<DateSelectorBarLayout>;
|
|
637
|
+
/** Whether the day strip is shown, or the picker has taken its place. */
|
|
638
|
+
readonly showDayStrip: import("@angular/core").Signal<boolean>;
|
|
639
|
+
/**
|
|
640
|
+
* Days in the visible strip: a full week where there's room, fewer as the bar
|
|
641
|
+
* narrows. The bar drops days rather than adding a second row, so it stays one
|
|
642
|
+
* line at every width it can.
|
|
643
|
+
*/
|
|
644
|
+
readonly tileCount: import("@angular/core").Signal<number>;
|
|
645
|
+
/** Effective locale: explicit input, else the active app locale. */
|
|
646
|
+
private readonly effectiveLocale;
|
|
647
|
+
/**
|
|
648
|
+
* First day of the visible strip — the week's Monday when a whole week is on
|
|
649
|
+
* show, otherwise whatever start keeps the selection in view.
|
|
650
|
+
*
|
|
651
|
+
* The strip holds still while the selection stays on screen; a selection
|
|
652
|
+
* outside it moves to where that day is. The arrows write here directly to page
|
|
653
|
+
* away from the selection.
|
|
654
|
+
*/
|
|
655
|
+
private readonly windowStart;
|
|
656
|
+
/**
|
|
657
|
+
* Index of the tile that is currently keyboard-reachable (roving tabindex).
|
|
658
|
+
* Tracks the selection so Tab lands on the selected day, falling back to Monday
|
|
659
|
+
* when the selection has been paged out of sight.
|
|
660
|
+
*/
|
|
661
|
+
private readonly focusedIndex;
|
|
662
|
+
/** The visible days, derived from the window start and the current selection. */
|
|
663
|
+
readonly dayTiles: import("@angular/core").Signal<DayTile[]>;
|
|
664
|
+
/**
|
|
665
|
+
* The month the strip is currently in, spelled out for the header that titles
|
|
666
|
+
* the bar — so the days below are never just loose numbers. Reads as a range
|
|
667
|
+
* when the strip straddles two months, and carries both years when it straddles
|
|
668
|
+
* two of those.
|
|
669
|
+
*/
|
|
670
|
+
readonly monthCaption: import("@angular/core").Signal<string>;
|
|
671
|
+
/** The selected date formatted as YYYY-MM-DD for the date-picker input. */
|
|
672
|
+
readonly selectedDateString: import("@angular/core").Signal<string>;
|
|
673
|
+
/**
|
|
674
|
+
* Props for the compact-layout date picker. Sized to match the Today button it
|
|
675
|
+
* sits beside, and filling the rest of the row so it stays an easy tap target.
|
|
676
|
+
*/
|
|
677
|
+
readonly pickerProps: import("@angular/core").Signal<{
|
|
678
|
+
id: string;
|
|
679
|
+
mode: "date";
|
|
680
|
+
placeholder: string;
|
|
681
|
+
size: "md";
|
|
682
|
+
borderRadius: "lg";
|
|
683
|
+
hover: boolean;
|
|
684
|
+
fullWidth: boolean;
|
|
685
|
+
}>;
|
|
686
|
+
ngOnInit(): void;
|
|
687
|
+
/** Shows the days before the visible ones, without changing the selection. */
|
|
688
|
+
navigatePrevious(): void;
|
|
689
|
+
/** Shows the days after the visible ones, without changing the selection. */
|
|
690
|
+
navigateNext(): void;
|
|
691
|
+
/** Returns to today: brings today into the strip and selects it. */
|
|
692
|
+
goToToday(): void;
|
|
693
|
+
/** Selects a date and emits it, unless it is already the selected day. */
|
|
694
|
+
selectDate(date: Date): void;
|
|
695
|
+
/**
|
|
696
|
+
* Handles the date-picker model change: shows the picked day's week and emits
|
|
697
|
+
* it (unless it is already the selected day).
|
|
698
|
+
* @param value The date string in YYYY-MM-DD format.
|
|
699
|
+
*/
|
|
700
|
+
onDateModelChanged(value: string): void;
|
|
701
|
+
/** Whether the tile at `index` is the one reachable with Tab. */
|
|
702
|
+
isTabbable(index: number): boolean;
|
|
703
|
+
/** Remembers which tile last held focus, so Tab returns to it. */
|
|
704
|
+
onTileFocus(index: number): void;
|
|
705
|
+
/**
|
|
706
|
+
* Moves focus across the week with the arrow keys. Running off either end turns
|
|
707
|
+
* the page to the neighbouring week and lands on the day that continues the run,
|
|
708
|
+
* so the weeks read as one continuous calendar.
|
|
709
|
+
*/
|
|
710
|
+
onTileKeydown(event: KeyboardEvent, index: number): void;
|
|
711
|
+
/** trackBy key for day tiles. */
|
|
712
|
+
trackByTile(_index: number, tile: DayTile): number;
|
|
713
|
+
/**
|
|
714
|
+
* Moves the strip by `pages` of whatever it is currently showing. Paging by the
|
|
715
|
+
* visible count is what keeps a full week Monday-aligned — seven days forward
|
|
716
|
+
* from a Monday is the next Monday.
|
|
717
|
+
*/
|
|
718
|
+
private shiftWindow;
|
|
719
|
+
/** Focuses the tile at `index` once the week has rendered. */
|
|
720
|
+
private moveFocusTo;
|
|
721
|
+
/** Index of the selected day within the visible week, or -1 when off-week. */
|
|
722
|
+
private indexOfSelected;
|
|
723
|
+
/**
|
|
724
|
+
* Where the strip should start to show `date` among `count` days: the week's
|
|
725
|
+
* Monday when a whole week is on show, otherwise centred on the day, since a
|
|
726
|
+
* partial strip has no week to align to.
|
|
727
|
+
*/
|
|
728
|
+
private anchorFor;
|
|
729
|
+
/**
|
|
730
|
+
* Returns the Monday of the week containing `date`. `getDay()` counts from
|
|
731
|
+
* Sunday, so the shift maps Sunday to the end of the week rather than the start.
|
|
732
|
+
*/
|
|
733
|
+
private startOfWeek;
|
|
734
|
+
/** Whole calendar days from `from` to `to`, ignoring time of day and DST. */
|
|
735
|
+
private daysBetween;
|
|
736
|
+
/** Tracks the bar's own width so the layout responds to its container. */
|
|
737
|
+
private observeOwnWidth;
|
|
738
|
+
/** Returns a Date object for today at midnight. */
|
|
739
|
+
private getToday;
|
|
740
|
+
/** Checks whether two dates fall on the same calendar day. */
|
|
741
|
+
private isSameDay;
|
|
742
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnDateSelectorBar, never>;
|
|
743
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnDateSelectorBar, "mn-date-selector-bar", never, {
|
|
744
|
+
"selectedDate": {
|
|
745
|
+
"alias": "selectedDate";
|
|
746
|
+
"required": false;
|
|
747
|
+
"isSignal": true;
|
|
748
|
+
};
|
|
749
|
+
"todayLabel": {
|
|
750
|
+
"alias": "todayLabel";
|
|
751
|
+
"required": false;
|
|
752
|
+
"isSignal": true;
|
|
753
|
+
};
|
|
754
|
+
"pickDateLabel": {
|
|
755
|
+
"alias": "pickDateLabel";
|
|
756
|
+
"required": false;
|
|
757
|
+
"isSignal": true;
|
|
758
|
+
};
|
|
759
|
+
"previousLabel": {
|
|
760
|
+
"alias": "previousLabel";
|
|
761
|
+
"required": false;
|
|
762
|
+
"isSignal": true;
|
|
763
|
+
};
|
|
764
|
+
"nextLabel": {
|
|
765
|
+
"alias": "nextLabel";
|
|
766
|
+
"required": false;
|
|
767
|
+
"isSignal": true;
|
|
768
|
+
};
|
|
769
|
+
"dayStripLabel": {
|
|
770
|
+
"alias": "dayStripLabel";
|
|
771
|
+
"required": false;
|
|
772
|
+
"isSignal": true;
|
|
773
|
+
};
|
|
774
|
+
"locale": {
|
|
775
|
+
"alias": "locale";
|
|
776
|
+
"required": false;
|
|
777
|
+
"isSignal": true;
|
|
778
|
+
};
|
|
779
|
+
}, {
|
|
780
|
+
"dateSelected": "dateSelected";
|
|
781
|
+
}, never, never, true, never>;
|
|
635
782
|
}
|
|
636
|
-
|
|
637
|
-
export { CalendarDayComponent, CalendarEventComponent, CalendarEventDefaultComponent, CalendarMonthComponent, CalendarViewComponent, CalendarWeekComponent, MnDateSelectorBar, UpcomingEventRowComponent, UpcomingEventsComponent };
|
|
638
|
-
export type { DateSelectorBarLayout, DayTile };
|
|
783
|
+
export {};
|