@momentra/angular 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2128 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, InjectionToken, Provider, Signal, TemplateRef, Type } from "@angular/core";
3
+ import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator, ValidatorFn } from "@angular/forms";
4
+ import { ConnectedPosition } from "@angular/cdk/overlay";
5
+ /**
6
+ * # Date, time and time-zone semantics
7
+ *
8
+ * Momentra distinguishes four kinds of value. Which one you are holding decides how it must be
9
+ * stored and serialized:
10
+ *
11
+ * | Kind | Example | Representation |
12
+ * |------------------|----------------------------|-----------------------------------------------------|
13
+ * | `calendar-date` | birthday, due date | {@link CalendarDate} (`{year, month, day}`) or ISO `yyyy-MM-dd` |
14
+ * | `local-datetime` | appointment at 09:30 local | wall-clock fields, no zone |
15
+ * | `instant` | event timestamp | absolute point in time (UTC epoch) |
16
+ * | `zoned-datetime` | 09:30 in Europe/Madrid | instant + IANA zone (needs a zone-aware adapter) |
17
+ *
18
+ * A JavaScript `Date` is an *instant*; it has no date-only type. Momentra's components therefore
19
+ * treat the `Date` they emit for date-only pickers as **local midnight of the selected day** and
20
+ * they only ever read/write the local calendar fields (`getFullYear()`, `getMonth()`, `getDate()`).
21
+ * They never convert through UTC, so the selected day cannot shift by a time-zone offset.
22
+ *
23
+ * If you need to persist a calendar date (to JSON, a database `date` column, …), convert it with
24
+ * {@link toCalendarDate}/{@link formatIsoDate} instead of `Date.prototype.toISOString()`, which
25
+ * converts to UTC and can move the day.
26
+ */
27
+ export type MomentraValueKind = 'calendar-date' | 'local-datetime' | 'instant' | 'zoned-datetime';
28
+ /** A date without time or time zone. `month` is zero-based (0 = January), like `Date`. */
29
+ export interface CalendarDate {
30
+ readonly year: number;
31
+ readonly month: number;
32
+ readonly day: number;
33
+ }
34
+ /** Formats a calendar date as ISO 8601 `yyyy-MM-dd`. */
35
+ export declare function formatIsoDate(date: CalendarDate): string;
36
+ /**
37
+ * Parses an ISO `yyyy-MM-dd` string. Returns `null` for other shapes or for impossible dates
38
+ * such as `2023-02-30`.
39
+ */
40
+ export declare function parseIsoDate(text: string): CalendarDate | null;
41
+ /** Returns `true` when two calendar dates denote the same day. */
42
+ export declare function isSameCalendarDate(a: CalendarDate | null, b: CalendarDate | null): boolean;
43
+ /**
44
+ * A date range. While the user is selecting, either end may still be `null`
45
+ * (an *incomplete* range); a complete range has both ends set.
46
+ */
47
+ export interface DateRange<TDate = Date> {
48
+ readonly start: TDate | null;
49
+ readonly end: TDate | null;
50
+ }
51
+ /** A complete range: both ends are present. */
52
+ export interface CompleteDateRange<TDate = Date> {
53
+ readonly start: TDate;
54
+ readonly end: TDate;
55
+ }
56
+ /** A named shortcut shown by the range picker. `range` may be computed lazily (e.g. "last 7 days"). */
57
+ export interface DateRangePreset<TDate = Date> {
58
+ readonly label: string;
59
+ readonly range: CompleteDateRange<TDate> | (() => CompleteDateRange<TDate>);
60
+ }
61
+ /** Creates an empty range. */
62
+ export declare function emptyRange<TDate = Date>(): DateRange<TDate>;
63
+ /** Type guard: both ends are set. */
64
+ export declare function isCompleteRange<TDate>(range: DateRange<TDate> | null | undefined): range is CompleteDateRange<TDate>;
65
+ /**
66
+ * User-facing strings used by Momentra components. Every string rendered or announced by a
67
+ * component comes from here, so a locale fully controls the UI language.
68
+ */
69
+ export interface MomentraLabels {
70
+ readonly today: string;
71
+ readonly clear: string;
72
+ readonly done: string;
73
+ readonly now: string;
74
+ readonly openCalendar: string;
75
+ readonly closeCalendar: string;
76
+ readonly openTimePicker: string;
77
+ readonly previousMonth: string;
78
+ readonly nextMonth: string;
79
+ readonly previousYear: string;
80
+ readonly nextYear: string;
81
+ readonly previousDecade: string;
82
+ readonly nextDecade: string;
83
+ readonly previousCentury: string;
84
+ readonly nextCentury: string;
85
+ readonly chooseView: string;
86
+ readonly hours: string;
87
+ readonly minutes: string;
88
+ readonly seconds: string;
89
+ readonly meridiem: string;
90
+ readonly calendar: string;
91
+ readonly months: string;
92
+ readonly timeSelector: string;
93
+ readonly presets: string;
94
+ readonly startDate: string;
95
+ readonly endDate: string;
96
+ readonly dateRange: string;
97
+ readonly rangeSeparator: string;
98
+ readonly selectedRange: string;
99
+ readonly selectingEnd: string;
100
+ /** Length of a picked range in the range popup footer; `{n}` is the day count. */
101
+ readonly rangeDays: string;
102
+ readonly cancel: string;
103
+ readonly set: string;
104
+ readonly date: string;
105
+ readonly time: string;
106
+ readonly dateAndTime: string;
107
+ readonly increase: string;
108
+ readonly decrease: string;
109
+ }
110
+ /**
111
+ * Validation message templates keyed by Momentra error key. `{min}`, `{max}`, `{value}` style
112
+ * placeholders are replaced with the formatted error payload.
113
+ */
114
+ export interface MomentraValidationMessages {
115
+ readonly required: string;
116
+ readonly mtrInvalidDate: string;
117
+ readonly mtrMinDate: string;
118
+ readonly mtrMaxDate: string;
119
+ readonly mtrDisabledDate: string;
120
+ readonly mtrInvalidTime: string;
121
+ readonly mtrMinTime: string;
122
+ readonly mtrMaxTime: string;
123
+ readonly mtrRangeIncomplete: string;
124
+ readonly mtrRangeOrder: string;
125
+ readonly mtrMinRangeLength: string;
126
+ readonly mtrMaxRangeLength: string;
127
+ }
128
+ /** A complete locale definition: names, default formats, week configuration and UI strings. */
129
+ export interface MomentraLocale {
130
+ /** BCP-47 language tag, e.g. `en-US`. */
131
+ readonly code: string;
132
+ /** Full month names, January first. */
133
+ readonly monthNames: readonly string[];
134
+ /** Abbreviated month names, January first. */
135
+ readonly monthNamesShort: readonly string[];
136
+ /** Full weekday names, Sunday first. */
137
+ readonly weekdayNames: readonly string[];
138
+ /** Abbreviated weekday names, Sunday first. */
139
+ readonly weekdayNamesShort: readonly string[];
140
+ /** Narrow (1–2 letters) weekday names, Sunday first. */
141
+ readonly weekdayNamesNarrow: readonly string[];
142
+ readonly meridiem: {
143
+ readonly am: string;
144
+ readonly pm: string;
145
+ };
146
+ /** 0 = Sunday … 6 = Saturday. */
147
+ readonly firstDayOfWeek: number;
148
+ readonly dateFormat: string;
149
+ readonly timeFormat: string;
150
+ readonly dateTimeFormat: string;
151
+ readonly monthYearFormat: string;
152
+ /** Long, human-readable date announced by screen readers, e.g. `EEEE, MMMM d, yyyy`. */
153
+ readonly longDateFormat: string;
154
+ readonly labels: MomentraLabels;
155
+ readonly validationMessages: MomentraValidationMessages;
156
+ }
157
+ export declare const EN_LABELS: MomentraLabels;
158
+ export declare const EN_VALIDATION_MESSAGES: MomentraValidationMessages;
159
+ /** Spanish UI strings, provided as a reference for writing your own locale. */
160
+ export declare const ES_LABELS: MomentraLabels;
161
+ export declare const ES_VALIDATION_MESSAGES: MomentraValidationMessages;
162
+ /**
163
+ * Builds a locale from `Intl`: month/weekday names, default formats, meridiem and first day of
164
+ * week are derived from the platform. English UI strings are used unless `overrides` supplies others.
165
+ */
166
+ export declare function createLocale(code: string, overrides?: Partial<MomentraLocale>): MomentraLocale;
167
+ /** Built-in default locale. Static (not Intl-derived) so output is identical on every platform. */
168
+ export declare const EN_US_LOCALE: MomentraLocale;
169
+ /** Spanish (Spain) locale with Monday as the first day of the week. */
170
+ export declare const ES_ES_LOCALE: MomentraLocale;
171
+ /**
172
+ * Library-independent date/time parts. Months are zero-based (0 = January), matching `Date`.
173
+ * All adapters format and parse through these parts so behaviour is identical across adapters.
174
+ */
175
+ interface DateTimeParts {
176
+ year: number;
177
+ month: number;
178
+ day: number;
179
+ hours: number;
180
+ minutes: number;
181
+ seconds: number;
182
+ milliseconds: number;
183
+ }
184
+ /** Subset of {@link MomentraLocale} needed to format and parse patterns. */
185
+ type PatternLocale = Pick<MomentraLocale, 'monthNames' | 'monthNamesShort' | 'weekdayNames' | 'weekdayNamesShort' | 'meridiem'>;
186
+ /** Thrown when a format pattern contains an unsupported token. */
187
+ export declare class MomentraPatternError extends Error {
188
+ constructor(pattern: string, detail: string);
189
+ }
190
+ /** Formats parts using a Momentra pattern, e.g. `dd/MM/yyyy HH:mm`. */
191
+ export declare function formatParts(parts: DateTimeParts, pattern: string, locale: PatternLocale): string;
192
+ /** Result of {@link parseParts}: fields absent from the pattern are `undefined`. */
193
+ interface ParsedParts {
194
+ year?: number;
195
+ month?: number;
196
+ day?: number;
197
+ hours?: number;
198
+ minutes?: number;
199
+ seconds?: number;
200
+ milliseconds?: number;
201
+ }
202
+ /**
203
+ * Parses text strictly against a pattern. Returns `null` when the text does not match, a numeric
204
+ * field is out of range (month 13, hour 25, …) or the whole input is not consumed. Day-of-month
205
+ * validity against the month is checked by the adapter when it builds the date.
206
+ */
207
+ export declare function parseParts(text: string, pattern: string, locale: PatternLocale): ParsedParts | null;
208
+ /** Number of days in a month of the proleptic Gregorian calendar. `month` is zero-based. */
209
+ export declare function daysInMonthOf(year: number, month: number): number;
210
+ /**
211
+ * Abstraction over a date library. Momentra components never touch a concrete date type: every
212
+ * operation goes through the adapter, so any date representation (`Date`, date-fns, Luxon, …)
213
+ * can be used by supplying an adapter.
214
+ *
215
+ * Adapters implement a small set of **primitives** (the abstract members). Everything else
216
+ * (comparison helpers, boundaries, calendar weeks, formatting and parsing) is implemented once
217
+ * here on top of those primitives, so behaviour is identical for every adapter.
218
+ *
219
+ * Conventions: months are zero-based (0 = January); weekdays are 0 = Sunday … 6 = Saturday.
220
+ * Values handed out by the adapter are treated as immutable; operations return new objects.
221
+ */
222
+ export declare abstract class DateAdapter<TDate> {
223
+ /** The current instant. */
224
+ abstract now(): TDate;
225
+ /**
226
+ * Creates a date from local calendar fields. Returns an *invalid* date (see {@link isValid})
227
+ * when the fields are out of range, e.g. 30 February or month 12 — it never rolls over.
228
+ */
229
+ abstract create(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number): TDate;
230
+ /** Returns a copy of the date. */
231
+ abstract clone(date: TDate): TDate;
232
+ /** Returns an invalid date value. */
233
+ abstract invalid(): TDate;
234
+ /** `true` when `date` is a usable date of this adapter's type. */
235
+ abstract isValid(date: TDate | null | undefined): date is TDate;
236
+ /**
237
+ * Converts a supported external value (an adapter date, epoch milliseconds, an ISO string) to a
238
+ * date. ISO strings without a time part (`yyyy-MM-dd`) are interpreted as that **local calendar
239
+ * day**, never as UTC. Returns `null` for unsupported or invalid input.
240
+ */
241
+ abstract deserialize(value: unknown): TDate | null;
242
+ abstract getYear(date: TDate): number;
243
+ /** Zero-based month. */
244
+ abstract getMonth(date: TDate): number;
245
+ /** Day of the month, 1–31. */
246
+ abstract getDate(date: TDate): number;
247
+ /** 0 = Sunday … 6 = Saturday. */
248
+ abstract getDayOfWeek(date: TDate): number;
249
+ abstract getHours(date: TDate): number;
250
+ abstract getMinutes(date: TDate): number;
251
+ abstract getSeconds(date: TDate): number;
252
+ abstract getMilliseconds(date: TDate): number;
253
+ /** Epoch milliseconds of the instant. Used for ordering. */
254
+ abstract toTimestamp(date: TDate): number;
255
+ /** Adds (or, if negative, subtracts) calendar days, preserving wall-clock time. */
256
+ abstract addDays(date: TDate, amount: number): TDate;
257
+ /** Start of the current day. */
258
+ today(): TDate;
259
+ /** The local date fields of `date`, as plain numbers. */
260
+ toParts(date: TDate): DateTimeParts;
261
+ /** Formats `date` with a Momentra pattern (`yyyy MM dd HH hh mm ss a MMMM MMM EEEE EEE`). */
262
+ format(date: TDate, pattern: string, locale: PatternLocale): string;
263
+ /**
264
+ * Parses `text` strictly against `pattern`. Fields missing from the pattern come from `base`
265
+ * for date fields (today if omitted) and are zero for time fields. Returns `null` when the text
266
+ * does not match or denotes an impossible date.
267
+ */
268
+ parse(text: string, pattern: string, locale: PatternLocale, base?: TDate | null): TDate | null;
269
+ formatDate(date: TDate, locale: MomentraLocale, pattern?: string): string;
270
+ formatTime(date: TDate, locale: MomentraLocale, pattern?: string): string;
271
+ formatDateTime(date: TDate, locale: MomentraLocale, pattern?: string): string;
272
+ /** Label for a calendar header, e.g. `November 2026`. */
273
+ formatMonthYear(date: TDate, locale: MomentraLocale): string;
274
+ /** Name of the weekday of `date`. */
275
+ formatWeekday(date: TDate, locale: MomentraLocale, style?: 'long' | 'short' | 'narrow'): string;
276
+ subtractDays(date: TDate, amount: number): TDate;
277
+ /**
278
+ * Adds calendar months. When the target month is shorter the day is clamped to its last day
279
+ * (31 Jan + 1 month = 28/29 Feb), never rolled into the next month.
280
+ */
281
+ addMonths(date: TDate, amount: number): TDate;
282
+ subtractMonths(date: TDate, amount: number): TDate;
283
+ addYears(date: TDate, amount: number): TDate;
284
+ subtractYears(date: TDate, amount: number): TDate;
285
+ /** Negative when `a` is before `b`, positive when after, `0` when equal. */
286
+ compare(a: TDate, b: TDate): number;
287
+ /** Same instant. `null` equals only `null`. */
288
+ isEqual(a: TDate | null | undefined, b: TDate | null | undefined): boolean;
289
+ isSameDay(a: TDate | null | undefined, b: TDate | null | undefined): boolean;
290
+ isSameMonth(a: TDate | null | undefined, b: TDate | null | undefined): boolean;
291
+ isSameYear(a: TDate | null | undefined, b: TDate | null | undefined): boolean;
292
+ isBefore(a: TDate, b: TDate): boolean;
293
+ isAfter(a: TDate, b: TDate): boolean;
294
+ /** Whether `date` lies between `start` and `end`. Bounds are inclusive unless `inclusive` is false. */
295
+ isBetween(date: TDate, start: TDate, end: TDate, inclusive?: boolean): boolean;
296
+ /** Restricts `date` to `[min, max]`; either bound may be omitted. */
297
+ clamp(date: TDate, min?: TDate | null, max?: TDate | null): TDate;
298
+ /** Whole calendar days from `from` to `to` (negative if `to` is earlier); ignores time of day. */
299
+ differenceInDays(to: TDate, from: TDate): number;
300
+ startOfDay(date: TDate): TDate;
301
+ endOfDay(date: TDate): TDate;
302
+ startOfMonth(date: TDate): TDate;
303
+ endOfMonth(date: TDate): TDate;
304
+ startOfYear(date: TDate): TDate;
305
+ endOfYear(date: TDate): TDate;
306
+ /** First day of the week containing `date` (start of day). */
307
+ startOfWeek(date: TDate, firstDayOfWeek: number): TDate;
308
+ endOfWeek(date: TDate, firstDayOfWeek: number): TDate;
309
+ getDaysInMonth(date: TDate): number;
310
+ /** First day of the month (start of day). */
311
+ getFirstDayOfMonth(date: TDate): TDate;
312
+ /** Last day of the month (start of day). */
313
+ getLastDayOfMonth(date: TDate): TDate;
314
+ /** First day of the week, as a start-of-day date. Alias of {@link startOfWeek}. */
315
+ getFirstDayOfWeek(date: TDate, firstDayOfWeek: number): TDate;
316
+ /**
317
+ * The weeks needed to display the month of `date`, each an array of 7 start-of-day dates that
318
+ * includes the leading/trailing days of adjacent months. With `fixedWeeks` there are always 6 weeks.
319
+ */
320
+ getCalendarWeeks(date: TDate, firstDayOfWeek: number, fixedWeeks?: boolean): TDate[][];
321
+ /** Returns `date` with the given time of day (date unchanged). */
322
+ withTime(date: TDate, hours: number, minutes: number, seconds?: number, milliseconds?: number): TDate;
323
+ setHours(date: TDate, hours: number): TDate;
324
+ setMinutes(date: TDate, minutes: number): TDate;
325
+ setSeconds(date: TDate, seconds: number): TDate;
326
+ /** Copies the calendar day of `day` onto the time of day of `time`. */
327
+ combine(day: TDate, time: TDate): TDate;
328
+ /** Seconds since local midnight; ignores the date part. */
329
+ secondsOfDay(date: TDate): number;
330
+ }
331
+ /**
332
+ * Default adapter backed by the JavaScript `Date` object, operating in the **local** time zone.
333
+ *
334
+ * Date-only values are represented as local midnight and are only ever read through local
335
+ * getters, so a selected calendar day never shifts with the UTC offset.
336
+ */
337
+ export declare class NativeDateAdapter extends DateAdapter<Date> {
338
+ now(): Date;
339
+ create(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number): Date;
340
+ clone(date: Date): Date;
341
+ invalid(): Date;
342
+ isValid(date: Date | null | undefined): date is Date;
343
+ deserialize(value: unknown): Date | null;
344
+ getYear(date: Date): number;
345
+ getMonth(date: Date): number;
346
+ getDate(date: Date): number;
347
+ getDayOfWeek(date: Date): number;
348
+ getHours(date: Date): number;
349
+ getMinutes(date: Date): number;
350
+ getSeconds(date: Date): number;
351
+ getMilliseconds(date: Date): number;
352
+ toTimestamp(date: Date): number;
353
+ addDays(date: Date, amount: number): Date;
354
+ }
355
+ type MomentraTheme = 'light' | 'dark' | 'auto';
356
+ /** Global defaults. Every option can be overridden per component through its inputs. */
357
+ interface MomentraConfig {
358
+ /** A locale code (`'en-US'`, `'es-ES'`, any `Intl` tag or a code registered via `locales`) or a full locale object. */
359
+ locale: string | MomentraLocale;
360
+ /** Extra locales that may be referenced by code in `locale`. */
361
+ locales: readonly MomentraLocale[];
362
+ /** Overrides the locale's date pattern, e.g. `'yyyy-MM-dd'`. */
363
+ dateFormat?: string;
364
+ /** Overrides the locale's time pattern, e.g. `'HH:mm'`. */
365
+ timeFormat?: string;
366
+ /** Overrides the locale's date-time pattern. */
367
+ dateTimeFormat?: string;
368
+ /** 0 = Sunday … 6 = Saturday. Defaults to the locale's first day of the week. */
369
+ firstDayOfWeek?: number;
370
+ theme: MomentraTheme;
371
+ /** Placeholder used by text inputs that do not set their own. Defaults to the active pattern. */
372
+ placeholder?: string;
373
+ /** Adapter class used for all components. Defaults to the native `Date` adapter. */
374
+ dateAdapter?: Type<DateAdapter<unknown>>;
375
+ /** Show the *Today* button in calendars. */
376
+ showTodayButton: boolean;
377
+ /** Show *Clear* buttons. */
378
+ showClearButton: boolean;
379
+ /** Close popups right after a selection is made (date picker and range picker). */
380
+ closeOnSelect: boolean;
381
+ /** Always render 6 weeks in the day view so the popup height never changes. */
382
+ fixedWeeks: boolean;
383
+ /** Overrides validation message templates, on top of those of the active locale. */
384
+ validationMessages?: Partial<MomentraValidationMessages>;
385
+ }
386
+ export declare const DEFAULT_MOMENTRA_CONFIG: Readonly<MomentraConfig>;
387
+ /**
388
+ * Configures Momentra. Call once in the application providers:
389
+ *
390
+ * ```ts
391
+ * bootstrapApplication(App, {
392
+ * providers: [provideMomentra({ locale: 'es-ES', theme: 'auto' })],
393
+ * });
394
+ * ```
395
+ */
396
+ export declare function provideMomentra(config?: Partial<MomentraConfig>): EnvironmentProviders;
397
+ /**
398
+ * The date adapter used by all components. Defaults to {@link NativeDateAdapter}; override with
399
+ * `provideMomentra({ dateAdapter: ... })` or provide this token directly.
400
+ */
401
+ export declare const MOMENTRA_DATE_ADAPTER: InjectionToken<DateAdapter<unknown>>;
402
+ /** Resolved (fully populated) global configuration. Use {@link provideMomentra} to set it. */
403
+ export declare const MOMENTRA_CONFIG: InjectionToken<MomentraConfig>;
404
+ /** Additional locales that can be referenced by code from `MomentraConfig.locale`. */
405
+ export declare const MOMENTRA_LOCALES: InjectionToken<readonly MomentraLocale[]>;
406
+ /** Per-component overrides applied on top of the global configuration. */
407
+ interface LocaleOverrides {
408
+ locale?: string | MomentraLocale | null;
409
+ dateFormat?: string | null;
410
+ timeFormat?: string | null;
411
+ dateTimeFormat?: string | null;
412
+ firstDayOfWeek?: number | null;
413
+ }
414
+ /**
415
+ * Read-only access to the effective Momentra configuration. Resolves locales (registered,
416
+ * built-in or `Intl`-derived) and applies global and per-component overrides.
417
+ */
418
+ export declare class MomentraSettings {
419
+ readonly config: Readonly<MomentraConfig>;
420
+ /**
421
+ * The global theme, seeded from `config.theme`. Set it to re-theme every component that has no
422
+ * `theme` input of its own, e.g. from an app-level dark mode toggle.
423
+ */
424
+ readonly theme: import("@angular/core").WritableSignal<MomentraTheme>;
425
+ private readonly registered;
426
+ private readonly adapterToken;
427
+ private readonly cache;
428
+ /** The configured date adapter, typed for the caller's date type. */
429
+ adapter<TDate>(): DateAdapter<TDate>;
430
+ /** Resolves a locale spec to a complete locale with global overrides applied. */
431
+ resolveLocale(overrides?: LocaleOverrides): MomentraLocale;
432
+ private byCode;
433
+ static ɵfac: i0.ɵɵFactoryDeclaration<MomentraSettings, never>;
434
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
435
+ }
436
+ /**
437
+ * Framework-free validation rules. Components and the Angular `ValidatorFn` wrappers in
438
+ * `MomentraValidators` both call these functions, so rules are defined exactly once.
439
+ */
440
+ /** Which part of a date participates in min/max comparisons. */
441
+ type DateGranularity = 'day' | 'instant';
442
+ interface DateRules<TDate> {
443
+ min?: TDate | null;
444
+ max?: TDate | null;
445
+ /** Return `true` for dates that cannot be selected. */
446
+ isDisabled?: ((date: TDate) => boolean) | null;
447
+ /** `day` (default) ignores the time of day; `instant` compares exact values. */
448
+ granularity?: DateGranularity;
449
+ }
450
+ interface RangeRules<TDate> extends DateRules<TDate> {
451
+ /** Minimum number of days a range must span (inclusive: same-day range = 1). */
452
+ minLength?: number | null;
453
+ /** Maximum number of days a range may span (inclusive). */
454
+ maxLength?: number | null;
455
+ }
456
+ interface TimeRules<TDate> {
457
+ min?: TDate | null;
458
+ max?: TDate | null;
459
+ }
460
+ /** Number of days spanned by a complete range, counting both ends (a same-day range is 1). */
461
+ export declare function rangeLengthInDays<TDate>(adapter: DateAdapter<TDate>, start: TDate, end: TDate): number;
462
+ /**
463
+ * Validates a single date value. `null`/`undefined`/`''` count as empty and are valid unless
464
+ * `required`. An invalid date object yields `mtrInvalidDate`.
465
+ */
466
+ export declare function validateDate<TDate>(adapter: DateAdapter<TDate>, value: TDate | null | undefined, rules?: DateRules<TDate> & {
467
+ required?: boolean;
468
+ }): ValidationErrors | null;
469
+ /** Validates the time of day of a date value against `min`/`max` times (dates are ignored). */
470
+ export declare function validateTime<TDate>(adapter: DateAdapter<TDate>, value: TDate | null | undefined, rules?: TimeRules<TDate> & {
471
+ required?: boolean;
472
+ }): ValidationErrors | null;
473
+ /** Validates a (possibly incomplete) date range. */
474
+ export declare function validateRange<TDate>(adapter: DateAdapter<TDate>, value: DateRange<TDate> | null | undefined, rules?: RangeRules<TDate> & {
475
+ required?: boolean;
476
+ }): ValidationErrors | null;
477
+ /**
478
+ * Turns validation errors into human-readable messages. `formatValue` renders dates found in the
479
+ * error payloads (`min`, `max`, …); numbers are inserted as-is.
480
+ */
481
+ export declare function getErrorMessages(errors: ValidationErrors | null | undefined, templates: Partial<MomentraValidationMessages>, formatValue: (value: unknown) => string): string[];
482
+ /** A bound that is either fixed or computed on every validation (e.g. "today"). */
483
+ type Bound<TDate> = TDate | null | (() => TDate | null);
484
+ /**
485
+ * Angular `ValidatorFn` factories for Momentra values. They work with any form control holding a
486
+ * date (or a {@link DateRange}) and share their rules with the components' built-in validation.
487
+ *
488
+ * Pass the adapter you configured when you use something other than native `Date`.
489
+ *
490
+ * Error keys: `required`, `mtrInvalidDate`, `mtrMinDate`, `mtrMaxDate`, `mtrDisabledDate`,
491
+ * `mtrInvalidTime`, `mtrMinTime`, `mtrMaxTime`, `mtrRangeIncomplete`, `mtrRangeOrder`,
492
+ * `mtrMinRangeLength`, `mtrMaxRangeLength`.
493
+ */
494
+ export declare const MomentraValidators: {
495
+ /** The control must hold a date. */
496
+ readonly required: <TDate = Date>(adapter?: DateAdapter<TDate>) => ValidatorFn;
497
+ /** The value must be a valid date object (not `Invalid Date`). */
498
+ readonly validDate: <TDate = Date>(adapter?: DateAdapter<TDate>) => ValidatorFn;
499
+ readonly minDate: <TDate = Date>(min: Bound<TDate>, adapter?: DateAdapter<TDate>, granularity?: DateGranularity) => ValidatorFn;
500
+ readonly maxDate: <TDate = Date>(max: Bound<TDate>, adapter?: DateAdapter<TDate>, granularity?: DateGranularity) => ValidatorFn;
501
+ /** Rejects dates for which `isDisabled` returns `true` (weekends, holidays, …). */
502
+ readonly disabledDates: <TDate = Date>(isDisabled: (date: TDate) => boolean, adapter?: DateAdapter<TDate>) => ValidatorFn;
503
+ /** The value must be a valid date object whose time of day is meaningful. */
504
+ readonly validTime: <TDate = Date>(adapter?: DateAdapter<TDate>) => ValidatorFn;
505
+ /** Time of day must not be before the time of day of `min` (the date part is ignored). */
506
+ readonly minTime: <TDate = Date>(min: Bound<TDate>, adapter?: DateAdapter<TDate>) => ValidatorFn;
507
+ /** Time of day must not be after the time of day of `max` (the date part is ignored). */
508
+ readonly maxTime: <TDate = Date>(max: Bound<TDate>, adapter?: DateAdapter<TDate>) => ValidatorFn;
509
+ /** Validates a {@link DateRange}: completeness, ordering, bounds and length. */
510
+ readonly dateRange: <TDate = Date>(rules?: Omit<RangeRules<TDate>, "min" | "max"> & {
511
+ min?: Bound<TDate>;
512
+ max?: Bound<TDate>;
513
+ required?: boolean;
514
+ }, adapter?: DateAdapter<TDate>) => ValidatorFn;
515
+ /** Range must span at least `days` days (inclusive count). */
516
+ readonly minRangeLength: <TDate = Date>(days: number, adapter?: DateAdapter<TDate>) => ValidatorFn;
517
+ /** Range must span at most `days` days (inclusive count). */
518
+ readonly maxRangeLength: <TDate = Date>(days: number, adapter?: DateAdapter<TDate>) => ValidatorFn;
519
+ };
520
+ /**
521
+ * Pure calendar calculations shared by the calendar, month, year and decade pickers.
522
+ * Nothing in this file depends on Angular.
523
+ *
524
+ * Views, from most to least detailed:
525
+ * - `day` – the days of one month
526
+ * - `month` – the 12 months of one year
527
+ * - `year` – the 10 years of one decade (plus one year of padding on each side)
528
+ * - `decade` – the 10 decades of one century (plus one decade of padding on each side)
529
+ */
530
+ type CalendarView = 'day' | 'month' | 'year' | 'decade';
531
+ /** One selectable cell in a calendar grid. */
532
+ interface CalendarCell<TDate> {
533
+ /** Representative date: the day itself, or the first day of the month / year / decade. */
534
+ readonly date: TDate;
535
+ readonly label: string;
536
+ /** Full text announced by screen readers. */
537
+ readonly ariaLabel: string;
538
+ readonly disabled: boolean;
539
+ readonly selected: boolean;
540
+ /** Holds keyboard focus (the roving-tabindex cell). */
541
+ readonly active: boolean;
542
+ readonly today: boolean;
543
+ /** Belongs to a neighbouring period (e.g. a day of the previous month). */
544
+ readonly outside: boolean;
545
+ /** Inside the highlighted range (inclusive of the end points). */
546
+ readonly inRange: boolean;
547
+ readonly rangeStart: boolean;
548
+ readonly rangeEnd: boolean;
549
+ /** Stable identity within a view, used for DOM ids and tracking. */
550
+ readonly key: string;
551
+ }
552
+ interface CalendarWeekday {
553
+ readonly short: string;
554
+ readonly long: string;
555
+ }
556
+ interface CalendarViewModel<TDate> {
557
+ readonly view: CalendarView;
558
+ readonly title: string;
559
+ readonly columns: number;
560
+ readonly weekdays: readonly CalendarWeekday[];
561
+ readonly rows: readonly (readonly CalendarCell<TDate>[])[];
562
+ }
563
+ interface CalendarContext<TDate> {
564
+ readonly adapter: DateAdapter<TDate>;
565
+ readonly locale: MomentraLocale;
566
+ readonly firstDayOfWeek: number;
567
+ readonly rules: DateRules<TDate>;
568
+ readonly selected: TDate | null;
569
+ /** The keyboard-focused date; only the cell that contains it is `active`. */
570
+ readonly active?: TDate | null;
571
+ /** Highlighted range; either end may be `null` while selecting. */
572
+ readonly range?: {
573
+ readonly start: TDate | null;
574
+ readonly end: TDate | null;
575
+ } | null;
576
+ readonly fixedWeeks?: boolean;
577
+ }
578
+ export declare function buildView<TDate>(view: CalendarView, ctx: CalendarContext<TDate>, viewDate: TDate): CalendarViewModel<TDate>;
579
+ /** Moves the displayed period one page forward (`1`) or back (`-1`). */
580
+ export declare function shiftView<TDate>(adapter: DateAdapter<TDate>, view: CalendarView, date: TDate, direction: 1 | -1): TDate;
581
+ type NavigationKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'PageUp' | 'PageDown' | 'Home' | 'End';
582
+ /**
583
+ * Computes the date that receives focus after a navigation key press.
584
+ *
585
+ * - Arrows move by one cell horizontally and one row vertically.
586
+ * - `PageUp`/`PageDown` move by the next coarser unit (`Shift` moves by two units coarser in the day view).
587
+ * - `Home`/`End` jump to the start/end of the current week (day view) or of the enclosing period.
588
+ */
589
+ export declare function moveFocus<TDate>(adapter: DateAdapter<TDate>, view: CalendarView, date: TDate, key: NavigationKey, options: {
590
+ firstDayOfWeek: number;
591
+ shift?: boolean;
592
+ }): TDate;
593
+ /**
594
+ * Applies the effective theme (`light`, `dark` or `auto`) to a component host as
595
+ * `data-mtr-theme`, which the component stylesheets key off. Every Momentra component uses this as a
596
+ * host directive, so `theme` is available as an input on all of them.
597
+ */
598
+ export declare class MtrThemeDirective {
599
+ private readonly settings;
600
+ /** Overrides the globally configured theme for this component. */
601
+ readonly theme: import("@angular/core").InputSignal<MomentraTheme | null | undefined>;
602
+ /** The theme in effect: the input if set, otherwise the global theme. */
603
+ readonly resolved: import("@angular/core").Signal<MomentraTheme>;
604
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtrThemeDirective, never>;
605
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtrThemeDirective, "[mtrTheme]", never, {
606
+ "theme": {
607
+ "alias": "theme";
608
+ "required": false;
609
+ "isSignal": true;
610
+ };
611
+ }, {}, never, never, true, never>;
612
+ }
613
+ /**
614
+ * Registers a component as both `ControlValueAccessor` and `Validator`, so it works with
615
+ * `formControl`, `formControlName` and `ngModel`, and contributes its own validation errors.
616
+ */
617
+ export declare function provideMomentraControl(component: () => Type<unknown>): Provider[];
618
+ /**
619
+ * Shared forms integration for every Momentra input-like component. It owns:
620
+ *
621
+ * - `ControlValueAccessor` plumbing (value propagation, touched, disabled)
622
+ * - `Validator` plumbing (validation re-runs when rule inputs change)
623
+ * - common inputs: `disabled`, `readonly`, `required`, `locale`, `firstDayOfWeek`, `errorMessages`
624
+ * - resolved locale/labels and visible validation messages
625
+ *
626
+ * Subclasses supply the value type, how an external value is read, and the validation rules.
627
+ */
628
+ export declare abstract class MomentraFormControl<TDate, TValue> implements ControlValueAccessor, Validator {
629
+ protected readonly settings: MomentraSettings;
630
+ protected readonly adapter: DateAdapter<TDate>;
631
+ protected readonly themeDirective: MtrThemeDirective;
632
+ /** Disables the component. Also controlled by the forms API (`control.disable()`). */
633
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
634
+ /** Makes the value visible but not editable. */
635
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
636
+ /** Marks an empty value as invalid. Also set by the Angular `required` attribute/validator. */
637
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
638
+ /** Locale code (`'es-ES'`) or a full {@link MomentraLocale}. Defaults to the global locale. */
639
+ readonly locale: import("@angular/core").InputSignal<string | MomentraLocale | null | undefined>;
640
+ /** 0 = Sunday … 6 = Saturday. Defaults to the locale's first day of the week. */
641
+ readonly firstDayOfWeek: import("@angular/core").InputSignal<number | null | undefined>;
642
+ /** Overrides validation message templates, e.g. `{ mtrMinDate: 'Too early' }`. */
643
+ readonly errorMessages: import("@angular/core").InputSignal<Partial<MomentraValidationMessages> | null | undefined>;
644
+ /** Shows validation messages below the component once it was touched. */
645
+ readonly showErrors: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
646
+ /** Accessible name when there is no visible `<label>`. */
647
+ readonly ariaLabel: import("@angular/core").InputSignal<string | null | undefined>;
648
+ /** Id(s) of the element(s) that label the control, as an alternative to {@link ariaLabel}. */
649
+ readonly ariaLabelledby: import("@angular/core").InputSignal<string | null | undefined>;
650
+ /** Id for the inner text input, so an external `<label for="…">` can point at it. */
651
+ readonly inputId: import("@angular/core").InputSignal<string | null | undefined>;
652
+ /** Unique id prefix for ARIA relationships. */
653
+ protected readonly uid: string;
654
+ protected readonly formDisabled: import("@angular/core").WritableSignal<boolean>;
655
+ protected readonly touched: import("@angular/core").WritableSignal<boolean>;
656
+ protected readonly isDisabled: import("@angular/core").Signal<boolean>;
657
+ protected readonly isInteractive: import("@angular/core").Signal<boolean>;
658
+ /** Extra locale overrides contributed by the subclass (formats). */
659
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
660
+ /** The locale in effect. */
661
+ readonly effectiveLocale: import("@angular/core").Signal<MomentraLocale>;
662
+ protected readonly labels: import("@angular/core").Signal<MomentraLabels>;
663
+ protected readonly effectiveTheme: import("@angular/core").Signal<MomentraTheme>;
664
+ private onChange;
665
+ private onTouched;
666
+ private onValidatorChange;
667
+ constructor();
668
+ /** Converts the value written by the forms API into the component's value. Must not emit. */
669
+ protected abstract applyExternalValue(value: unknown): void;
670
+ /** Current validation errors, or `null`. Read the signals the rules depend on here. */
671
+ protected abstract computeErrors(): ValidationErrors | null;
672
+ /**
673
+ * Reads every signal that influences {@link computeErrors}; the framework re-validates when
674
+ * any of them change.
675
+ */
676
+ protected abstract validationDependencies(): unknown;
677
+ /** Formats a value found in an error payload for display in a message. */
678
+ protected abstract formatForMessage(value: unknown): string;
679
+ writeValue(value: unknown): void;
680
+ registerOnChange(fn: (value: unknown) => void): void;
681
+ registerOnTouched(fn: () => void): void;
682
+ setDisabledState(isDisabled: boolean): void;
683
+ validate(_control?: AbstractControl): ValidationErrors | null;
684
+ registerOnValidatorChange(fn: () => void): void;
685
+ /** Notifies the forms API about a user-initiated change. */
686
+ protected notifyChange(value: unknown): void;
687
+ /** Marks the control as touched (call on blur / popup close). */
688
+ protected markTouched(): void;
689
+ /** Errors that are currently relevant for display (own rules only). */
690
+ protected readonly currentErrors: import("@angular/core").Signal<ValidationErrors | null>;
691
+ /** Messages shown to the user: only after the control was touched. */
692
+ protected readonly errorMessageList: import("@angular/core").Signal<string[]>;
693
+ protected readonly invalid: import("@angular/core").Signal<boolean>;
694
+ static ɵfac: i0.ɵɵFactoryDeclaration<MomentraFormControl<any, any>, never>;
695
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MomentraFormControl<any, any>, never, never, {
696
+ "disabled": {
697
+ "alias": "disabled";
698
+ "required": false;
699
+ "isSignal": true;
700
+ };
701
+ "readonly": {
702
+ "alias": "readonly";
703
+ "required": false;
704
+ "isSignal": true;
705
+ };
706
+ "required": {
707
+ "alias": "required";
708
+ "required": false;
709
+ "isSignal": true;
710
+ };
711
+ "locale": {
712
+ "alias": "locale";
713
+ "required": false;
714
+ "isSignal": true;
715
+ };
716
+ "firstDayOfWeek": {
717
+ "alias": "firstDayOfWeek";
718
+ "required": false;
719
+ "isSignal": true;
720
+ };
721
+ "errorMessages": {
722
+ "alias": "errorMessages";
723
+ "required": false;
724
+ "isSignal": true;
725
+ };
726
+ "showErrors": {
727
+ "alias": "showErrors";
728
+ "required": false;
729
+ "isSignal": true;
730
+ };
731
+ "ariaLabel": {
732
+ "alias": "ariaLabel";
733
+ "required": false;
734
+ "isSignal": true;
735
+ };
736
+ "ariaLabelledby": {
737
+ "alias": "ariaLabelledby";
738
+ "required": false;
739
+ "isSignal": true;
740
+ };
741
+ "inputId": {
742
+ "alias": "inputId";
743
+ "required": false;
744
+ "isSignal": true;
745
+ };
746
+ }, {}, never, never, true, never>;
747
+ }
748
+ /** Dates that cannot be selected: a predicate, or an explicit list of days. */
749
+ type DisabledDates<TDate> = ((date: TDate) => boolean) | readonly TDate[];
750
+ /** Normalises {@link DisabledDates} into a predicate (`null` when nothing is disabled). */
751
+ export declare function createDisabledPredicate<TDate>(adapter: DateAdapter<TDate>, disabled: DisabledDates<TDate> | null | undefined): ((date: TDate) => boolean) | null;
752
+ /** Template context for custom day / month / year cells (`<ng-template let-cell>`). */
753
+ interface MtrCellContext<TDate> {
754
+ /** The cell being rendered. */
755
+ $implicit: CalendarCell<TDate>;
756
+ /** The view the cell belongs to. */
757
+ view: CalendarView;
758
+ }
759
+ /**
760
+ * A calendar with day, month, year and decade views.
761
+ *
762
+ * Standalone it selects a day; with `selectionView` it can select a month, year or decade instead
763
+ * (this is how `mtr-month-picker`, `mtr-year-picker` and `mtr-decade-picker` are built).
764
+ *
765
+ * Keyboard: arrows move, `PageUp`/`PageDown` change month (with `Shift`: year), `Home`/`End` jump to the
766
+ * start/end of the week, `Enter`/`Space` select, `Ctrl+↑` goes to a coarser view.
767
+ */
768
+ export declare class CalendarComponent<TDate = Date> extends MomentraFormControl<TDate, TDate | null> {
769
+ private readonly host;
770
+ private readonly injector;
771
+ /** The selected date (two-way bindable: `[(value)]`). */
772
+ readonly value: import("@angular/core").ModelSignal<TDate | null>;
773
+ /** The displayed view (two-way bindable: `[(view)]`). */
774
+ readonly view: import("@angular/core").ModelSignal<CalendarView>;
775
+ /** The view in which picking a cell *selects*; coarser views drill down instead. */
776
+ readonly selectionView: import("@angular/core").InputSignal<CalendarView>;
777
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
778
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
779
+ /** Dates that cannot be selected, as a predicate or a list of days. */
780
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
781
+ /** Highlighted range; either end may be `null`. Used by the range picker. */
782
+ readonly range: import("@angular/core").InputSignal<{
783
+ start: TDate | null;
784
+ end: TDate | null;
785
+ } | null | undefined>;
786
+ /** Custom content for day / month / year / decade cells. */
787
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
788
+ /** Date to show when nothing is selected. Defaults to today. */
789
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
790
+ /** Shows the *Today* button. Defaults to the global setting. */
791
+ readonly showToday: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
792
+ /** Always render six weeks in the day view. Defaults to the global setting. */
793
+ readonly fixedWeeks: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
794
+ /** Emits when the user picks a date in the selection view. */
795
+ readonly dateSelect: import("@angular/core").OutputEmitterRef<TDate>;
796
+ /** Emits the day under the pointer / focus in the day view, or `null` when it leaves the grid. */
797
+ readonly dateHover: import("@angular/core").OutputEmitterRef<TDate | null>;
798
+ /** Emits when keyboard focus moves to another date. */
799
+ readonly activeDateChange: import("@angular/core").OutputEmitterRef<TDate>;
800
+ /** The date that owns keyboard focus; it also decides which page is displayed. */
801
+ protected readonly activeDate: import("@angular/core").WritableSignal<TDate>;
802
+ protected readonly rules: import("@angular/core").Signal<DateRules<TDate>>;
803
+ protected readonly focusDate: import("@angular/core").Signal<TDate>;
804
+ protected readonly context: import("@angular/core").Signal<CalendarContext<TDate>>;
805
+ protected readonly viewModel: import("@angular/core").Signal<CalendarViewModel<TDate>>;
806
+ protected readonly showTodayButton: import("@angular/core").Signal<boolean>;
807
+ protected readonly todayTarget: import("@angular/core").Signal<TDate>;
808
+ protected readonly todayDisabled: import("@angular/core").Signal<boolean>;
809
+ protected readonly todayLabel: import("@angular/core").Signal<string>;
810
+ protected readonly canDrillUp: import("@angular/core").Signal<boolean>;
811
+ protected readonly prevLabel: import("@angular/core").Signal<string>;
812
+ protected readonly nextLabel: import("@angular/core").Signal<string>;
813
+ protected readonly prevDisabled: import("@angular/core").Signal<boolean>;
814
+ protected readonly nextDisabled: import("@angular/core").Signal<boolean>;
815
+ protected applyExternalValue(value: unknown): void;
816
+ protected validationDependencies(): unknown;
817
+ protected computeErrors(): ValidationErrors | null;
818
+ protected formatForMessage(value: unknown): string;
819
+ /** Moves keyboard focus to the active cell (used by popups when they open). */
820
+ focusActiveCell(): void;
821
+ protected pick(cell: CalendarCell<TDate>): void;
822
+ protected selectToday(): void;
823
+ private select;
824
+ protected shift(direction: 1 | -1): void;
825
+ protected drillUp(): void;
826
+ protected onGridKeydown(event: KeyboardEvent): void;
827
+ protected onCellEnter(cell: CalendarCell<TDate>): void;
828
+ protected onGridLeave(): void;
829
+ protected onCellFocus(cell: CalendarCell<TDate>): void;
830
+ protected cellAriaDisabled(cell: CalendarCell<TDate>): true | null;
831
+ protected gridLabel(): string;
832
+ protected columnsOfView(): number;
833
+ protected cellContext(cell: CalendarCell<TDate>): MtrCellContext<TDate>;
834
+ private focusAfterRender;
835
+ /** Keeps month/year/decade the user is navigating from when drilling down into a finer view. */
836
+ private drillTarget;
837
+ private navLabel;
838
+ /** `true` when every date of the previous/next page lies outside min/max. */
839
+ private pageOutOfBounds;
840
+ static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent<any>, never>;
841
+ static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent<any>, "mtr-calendar", never, {
842
+ "value": {
843
+ "alias": "value";
844
+ "required": false;
845
+ "isSignal": true;
846
+ };
847
+ "view": {
848
+ "alias": "view";
849
+ "required": false;
850
+ "isSignal": true;
851
+ };
852
+ "selectionView": {
853
+ "alias": "selectionView";
854
+ "required": false;
855
+ "isSignal": true;
856
+ };
857
+ "min": {
858
+ "alias": "min";
859
+ "required": false;
860
+ "isSignal": true;
861
+ };
862
+ "max": {
863
+ "alias": "max";
864
+ "required": false;
865
+ "isSignal": true;
866
+ };
867
+ "disabledDates": {
868
+ "alias": "disabledDates";
869
+ "required": false;
870
+ "isSignal": true;
871
+ };
872
+ "range": {
873
+ "alias": "range";
874
+ "required": false;
875
+ "isSignal": true;
876
+ };
877
+ "cellTemplate": {
878
+ "alias": "cellTemplate";
879
+ "required": false;
880
+ "isSignal": true;
881
+ };
882
+ "initialDate": {
883
+ "alias": "initialDate";
884
+ "required": false;
885
+ "isSignal": true;
886
+ };
887
+ "showToday": {
888
+ "alias": "showToday";
889
+ "required": false;
890
+ "isSignal": true;
891
+ };
892
+ "fixedWeeks": {
893
+ "alias": "fixedWeeks";
894
+ "required": false;
895
+ "isSignal": true;
896
+ };
897
+ }, {
898
+ "value": "valueChange";
899
+ "view": "viewChange";
900
+ "dateSelect": "dateSelect";
901
+ "dateHover": "dateHover";
902
+ "activeDateChange": "activeDateChange";
903
+ }, never, never, true, [{
904
+ directive: typeof MtrThemeDirective;
905
+ inputs: {
906
+ "theme": "theme";
907
+ };
908
+ outputs: {};
909
+ }]>;
910
+ }
911
+ /**
912
+ * A calendar whose months scroll continuously. The header follows the month in view.
913
+ * Styling: `--mtr-infinite-height` / `--mtr-infinite-width` size the scroll area; all `--mtr-*` tokens apply.
914
+ *
915
+ * @example
916
+ * ```html
917
+ * <mtr-infinite-calendar [(value)]="date" style="--mtr-infinite-height: 360px" />
918
+ * ```
919
+ */
920
+ export declare class InfiniteCalendarComponent<TDate = Date> extends MomentraFormControl<TDate, TDate | null> {
921
+ private readonly injector;
922
+ private readonly scroller;
923
+ readonly value: import("@angular/core").ModelSignal<TDate | null>;
924
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
925
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
926
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
927
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
928
+ /** Month to show first when nothing is selected. Defaults to today. */
929
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
930
+ /** Shows the column of months next to the calendar (click one to scroll there). */
931
+ readonly monthRail: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
932
+ readonly showToday: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
933
+ readonly dateSelect: import("@angular/core").OutputEmitterRef<TDate>;
934
+ /** Anchor month of the rendered window; `before`/`after` count months around it. */
935
+ private readonly origin;
936
+ private readonly before;
937
+ private readonly after;
938
+ protected readonly activeDate: import("@angular/core").WritableSignal<TDate>;
939
+ /** Index (relative to `origin`) of the month at the top of the scroll area. */
940
+ protected readonly topMonth: import("@angular/core").WritableSignal<number>;
941
+ private readonly rules;
942
+ private readonly focusDate;
943
+ private readonly context;
944
+ protected readonly months: import("@angular/core").Signal<{
945
+ index: number;
946
+ title: string;
947
+ rows: readonly (readonly CalendarCell<TDate>[])[];
948
+ }[]>;
949
+ protected readonly rail: import("@angular/core").Signal<{
950
+ index: number;
951
+ label: string;
952
+ year: boolean;
953
+ current: boolean;
954
+ aria: string;
955
+ }[]>;
956
+ protected readonly weekdays: import("@angular/core").Signal<readonly CalendarWeekday[]>;
957
+ protected readonly headerTitle: import("@angular/core").Signal<string>;
958
+ protected readonly showTodayButton: import("@angular/core").Signal<boolean>;
959
+ protected readonly todayDisabled: import("@angular/core").Signal<boolean>;
960
+ constructor();
961
+ protected applyExternalValue(value: unknown): void;
962
+ protected validationDependencies(): unknown;
963
+ protected computeErrors(): ValidationErrors | null;
964
+ protected formatForMessage(value: unknown): string;
965
+ protected pick(cell: CalendarCell<TDate>): void;
966
+ protected goToday(): void;
967
+ private select;
968
+ protected onScroll(): void;
969
+ protected onKeydown(event: KeyboardEvent): void;
970
+ protected goToMonth(index: number): void;
971
+ /** Renders the month of `date`, scrolls it into view and focuses its cell. */
972
+ private reveal;
973
+ private scrollToMonth;
974
+ protected cellContext(cell: CalendarCell<TDate>): MtrCellContext<TDate>;
975
+ static ɵfac: i0.ɵɵFactoryDeclaration<InfiniteCalendarComponent<any>, never>;
976
+ static ɵcmp: i0.ɵɵComponentDeclaration<InfiniteCalendarComponent<any>, "mtr-infinite-calendar", never, {
977
+ "value": {
978
+ "alias": "value";
979
+ "required": false;
980
+ "isSignal": true;
981
+ };
982
+ "min": {
983
+ "alias": "min";
984
+ "required": false;
985
+ "isSignal": true;
986
+ };
987
+ "max": {
988
+ "alias": "max";
989
+ "required": false;
990
+ "isSignal": true;
991
+ };
992
+ "disabledDates": {
993
+ "alias": "disabledDates";
994
+ "required": false;
995
+ "isSignal": true;
996
+ };
997
+ "cellTemplate": {
998
+ "alias": "cellTemplate";
999
+ "required": false;
1000
+ "isSignal": true;
1001
+ };
1002
+ "initialDate": {
1003
+ "alias": "initialDate";
1004
+ "required": false;
1005
+ "isSignal": true;
1006
+ };
1007
+ "monthRail": {
1008
+ "alias": "monthRail";
1009
+ "required": false;
1010
+ "isSignal": true;
1011
+ };
1012
+ "showToday": {
1013
+ "alias": "showToday";
1014
+ "required": false;
1015
+ "isSignal": true;
1016
+ };
1017
+ }, {
1018
+ "value": "valueChange";
1019
+ "dateSelect": "dateSelect";
1020
+ }, never, never, true, [{
1021
+ directive: typeof MtrThemeDirective;
1022
+ inputs: {
1023
+ "theme": "theme";
1024
+ };
1025
+ outputs: {};
1026
+ }]>;
1027
+ }
1028
+ type MtrMultiviewMode = 'single' | 'multiple' | 'range';
1029
+ /**
1030
+ * Several consecutive months side by side under one header.
1031
+ *
1032
+ * The value is always an array: `[date]` in `single` mode, any number of dates in `multiple` mode and
1033
+ * `[start, end]` (end optional while picking) in `range` mode.
1034
+ * Styling: `--mtr-multiview-gap` is the space between months; all `--mtr-*` tokens apply.
1035
+ *
1036
+ * @example
1037
+ * ```html
1038
+ * <mtr-multiview-calendar [views]="2" mode="range" [(value)]="range" />
1039
+ * ```
1040
+ */
1041
+ export declare class MultiviewCalendarComponent<TDate = Date> extends MomentraFormControl<TDate, TDate[]> {
1042
+ private readonly host;
1043
+ private readonly injector;
1044
+ readonly value: import("@angular/core").ModelSignal<TDate[]>;
1045
+ /** Number of months shown. */
1046
+ readonly views: import("@angular/core").InputSignalWithTransform<number, unknown>;
1047
+ readonly mode: import("@angular/core").InputSignal<MtrMultiviewMode>;
1048
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
1049
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
1050
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1051
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
1052
+ /** First month shown when nothing is selected. Defaults to today. */
1053
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
1054
+ /** Emits the date that was just clicked. */
1055
+ readonly dateSelect: import("@angular/core").OutputEmitterRef<TDate>;
1056
+ private readonly first;
1057
+ protected readonly activeDate: import("@angular/core").WritableSignal<TDate>;
1058
+ private readonly hovered;
1059
+ private readonly rules;
1060
+ private readonly focusDate;
1061
+ protected readonly panels: import("@angular/core").Signal<{
1062
+ title: string;
1063
+ weekdays: readonly CalendarWeekday[];
1064
+ rows: {
1065
+ selected: boolean;
1066
+ date: TDate;
1067
+ label: string;
1068
+ ariaLabel: string;
1069
+ disabled: boolean;
1070
+ active: boolean;
1071
+ today: boolean;
1072
+ outside: boolean;
1073
+ inRange: boolean;
1074
+ rangeStart: boolean;
1075
+ rangeEnd: boolean;
1076
+ key: string;
1077
+ }[][];
1078
+ key: number;
1079
+ }[]>;
1080
+ protected readonly headerTitle: import("@angular/core").Signal<string>;
1081
+ protected applyExternalValue(value: unknown): void;
1082
+ protected validationDependencies(): unknown;
1083
+ protected computeErrors(): ValidationErrors | null;
1084
+ protected formatForMessage(value: unknown): string;
1085
+ protected shift(direction: 1 | -1): void;
1086
+ protected goToday(): void;
1087
+ protected pick(cell: CalendarCell<TDate>): void;
1088
+ protected onHover(cell: CalendarCell<TDate> | null): void;
1089
+ protected onKeydown(event: KeyboardEvent): void;
1090
+ protected cellContext(cell: CalendarCell<TDate>): MtrCellContext<TDate>;
1091
+ static ɵfac: i0.ɵɵFactoryDeclaration<MultiviewCalendarComponent<any>, never>;
1092
+ static ɵcmp: i0.ɵɵComponentDeclaration<MultiviewCalendarComponent<any>, "mtr-multiview-calendar", never, {
1093
+ "value": {
1094
+ "alias": "value";
1095
+ "required": false;
1096
+ "isSignal": true;
1097
+ };
1098
+ "views": {
1099
+ "alias": "views";
1100
+ "required": false;
1101
+ "isSignal": true;
1102
+ };
1103
+ "mode": {
1104
+ "alias": "mode";
1105
+ "required": false;
1106
+ "isSignal": true;
1107
+ };
1108
+ "min": {
1109
+ "alias": "min";
1110
+ "required": false;
1111
+ "isSignal": true;
1112
+ };
1113
+ "max": {
1114
+ "alias": "max";
1115
+ "required": false;
1116
+ "isSignal": true;
1117
+ };
1118
+ "disabledDates": {
1119
+ "alias": "disabledDates";
1120
+ "required": false;
1121
+ "isSignal": true;
1122
+ };
1123
+ "cellTemplate": {
1124
+ "alias": "cellTemplate";
1125
+ "required": false;
1126
+ "isSignal": true;
1127
+ };
1128
+ "initialDate": {
1129
+ "alias": "initialDate";
1130
+ "required": false;
1131
+ "isSignal": true;
1132
+ };
1133
+ }, {
1134
+ "value": "valueChange";
1135
+ "dateSelect": "dateSelect";
1136
+ }, never, never, true, [{
1137
+ directive: typeof MtrThemeDirective;
1138
+ inputs: {
1139
+ "theme": "theme";
1140
+ };
1141
+ outputs: {};
1142
+ }]>;
1143
+ }
1144
+ /**
1145
+ * Shared behaviour of the month, year and decade pickers. The value is the first day of the
1146
+ * selected period (first of the month, 1 January, or 1 January of the decade's first year).
1147
+ */
1148
+ declare abstract class CalendarPickerBase<TDate> extends MomentraFormControl<TDate, TDate | null> {
1149
+ /** The selected period, as its first day (two-way bindable). */
1150
+ readonly value: import("@angular/core").ModelSignal<TDate | null>;
1151
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
1152
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
1153
+ /** Shows the *Today* button (selects the current period). */
1154
+ readonly showToday: import("@angular/core").InputSignal<boolean | null | undefined>;
1155
+ /** The calendar view that selects (and is displayed first). */
1156
+ protected abstract readonly selectionView: CalendarView;
1157
+ protected readonly rules: import("@angular/core").Signal<{
1158
+ min: TDate | null | undefined;
1159
+ max: TDate | null | undefined;
1160
+ }>;
1161
+ protected applyExternalValue(value: unknown): void;
1162
+ protected onSelect(date: TDate): void;
1163
+ protected validationDependencies(): unknown;
1164
+ protected computeErrors(): ValidationErrors | null;
1165
+ protected formatForMessage(value: unknown): string;
1166
+ static ɵfac: i0.ɵɵFactoryDeclaration<CalendarPickerBase<any>, never>;
1167
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CalendarPickerBase<any>, never, never, {
1168
+ "value": {
1169
+ "alias": "value";
1170
+ "required": false;
1171
+ "isSignal": true;
1172
+ };
1173
+ "min": {
1174
+ "alias": "min";
1175
+ "required": false;
1176
+ "isSignal": true;
1177
+ };
1178
+ "max": {
1179
+ "alias": "max";
1180
+ "required": false;
1181
+ "isSignal": true;
1182
+ };
1183
+ "showToday": {
1184
+ "alias": "showToday";
1185
+ "required": false;
1186
+ "isSignal": true;
1187
+ };
1188
+ }, {
1189
+ "value": "valueChange";
1190
+ }, never, never, true, never>;
1191
+ }
1192
+ /** Selects a month. The value is the first day of that month. */
1193
+ export declare class MonthPickerComponent<TDate = Date> extends CalendarPickerBase<TDate> {
1194
+ protected readonly selectionView: CalendarView;
1195
+ static ɵfac: i0.ɵɵFactoryDeclaration<MonthPickerComponent<any>, never>;
1196
+ static ɵcmp: i0.ɵɵComponentDeclaration<MonthPickerComponent<any>, "mtr-month-picker", never, {}, {}, never, never, true, [{
1197
+ directive: typeof MtrThemeDirective;
1198
+ inputs: {
1199
+ "theme": "theme";
1200
+ };
1201
+ outputs: {};
1202
+ }]>;
1203
+ }
1204
+ /** Selects a year. The value is 1 January of that year. */
1205
+ export declare class YearPickerComponent<TDate = Date> extends CalendarPickerBase<TDate> {
1206
+ protected readonly selectionView: CalendarView;
1207
+ static ɵfac: i0.ɵɵFactoryDeclaration<YearPickerComponent<any>, never>;
1208
+ static ɵcmp: i0.ɵɵComponentDeclaration<YearPickerComponent<any>, "mtr-year-picker", never, {}, {}, never, never, true, [{
1209
+ directive: typeof MtrThemeDirective;
1210
+ inputs: {
1211
+ "theme": "theme";
1212
+ };
1213
+ outputs: {};
1214
+ }]>;
1215
+ }
1216
+ /** Selects a decade (or drills into a year). The value is 1 January of the decade's first year. */
1217
+ export declare class DecadePickerComponent<TDate = Date> extends CalendarPickerBase<TDate> {
1218
+ protected readonly selectionView: CalendarView;
1219
+ static ɵfac: i0.ɵɵFactoryDeclaration<DecadePickerComponent<any>, never>;
1220
+ static ɵcmp: i0.ɵɵComponentDeclaration<DecadePickerComponent<any>, "mtr-decade-picker", never, {}, {}, never, never, true, [{
1221
+ directive: typeof MtrThemeDirective;
1222
+ inputs: {
1223
+ "theme": "theme";
1224
+ };
1225
+ outputs: {};
1226
+ }]>;
1227
+ }
1228
+ /**
1229
+ * Shared behaviour of the text-based controls (date input, date/time/time pickers): the text the
1230
+ * user types is parsed against a pattern, and the parsed date is the control's value.
1231
+ *
1232
+ * - While typing, a successfully parsed value is emitted immediately; unparsable text emits `null`
1233
+ * and the control reports a `mtrInvalidDate` (or `mtrInvalidTime`) error, so forms see it.
1234
+ * - On blur / `Enter` the text is reformatted to the canonical pattern.
1235
+ * - `ArrowUp`/`ArrowDown` step the segment under the caret (day, month, year, hour, minute...).
1236
+ */
1237
+ declare abstract class MomentraTextControl<TDate> extends MomentraFormControl<TDate, TDate | null> {
1238
+ /** The value (two-way bindable: `[(value)]`). */
1239
+ readonly value: import("@angular/core").ModelSignal<TDate | null>;
1240
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
1241
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
1242
+ /** Placeholder text. Defaults to the global placeholder, then to the active pattern. */
1243
+ readonly placeholder: import("@angular/core").InputSignal<string | null | undefined>;
1244
+ /** Shows the clear button. Defaults to the global setting. */
1245
+ readonly showClear: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1246
+ /** Shows increment / decrement buttons (the same step as `ArrowUp` / `ArrowDown`). */
1247
+ readonly spinners: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1248
+ /** The text shown in the input. */
1249
+ readonly text: import("@angular/core").WritableSignal<string>;
1250
+ protected readonly parseFailed: import("@angular/core").WritableSignal<boolean>;
1251
+ protected readonly fieldId: Signal<string>;
1252
+ protected readonly errorsId: string;
1253
+ /** The pattern used to format and parse the text. */
1254
+ protected abstract readonly pattern: Signal<string>;
1255
+ /** Used to fill date fields the pattern does not contain (time pickers). */
1256
+ protected parseBase(): TDate | null;
1257
+ /** Validates a parsed value against min/max and other rules. */
1258
+ protected abstract validateValue(value: TDate | null): ValidationErrors | null;
1259
+ /** Signals that influence {@link validateValue}, in addition to value/min/max. */
1260
+ protected extraValidationDependencies(): unknown;
1261
+ /** Name of the error reported when the text cannot be parsed. */
1262
+ protected readonly parseErrorKey: 'mtrInvalidDate' | 'mtrInvalidTime';
1263
+ private typing;
1264
+ private readonly textInjector;
1265
+ private readonly fieldEl;
1266
+ protected readonly placeholderText: Signal<string>;
1267
+ protected readonly clearVisible: Signal<boolean>;
1268
+ constructor();
1269
+ protected applyExternalValue(value: unknown): void;
1270
+ protected validationDependencies(): unknown;
1271
+ protected computeErrors(): ValidationErrors | null;
1272
+ protected formatForMessage(value: unknown): string;
1273
+ protected formatDate(date: TDate): string;
1274
+ protected syncText(): void;
1275
+ protected commit(date: TDate | null): void;
1276
+ /** Handles raw text typed by the user. */
1277
+ protected onInput(text: string): void;
1278
+ /** Reformats valid text to the canonical pattern; leaves unparsable text for the user to fix. */
1279
+ protected commitText(): void;
1280
+ protected onBlur(): void;
1281
+ protected clear(): void;
1282
+ /** Hook: runs after the value was cleared. */
1283
+ protected afterClear(): void;
1284
+ /** Sets the value from a non-text source (popup selection, stepping). */
1285
+ protected setFromUi(date: TDate | null): void;
1286
+ /** Computes the value after `ArrowUp`/`ArrowDown`. Date inputs step by day (Shift: month, Ctrl: year). */
1287
+ protected stepValue(direction: 1 | -1, event: KeyboardEvent): TDate;
1288
+ /** Increment for one step of a segment (`hour`, `minute`, `second`...). Time controls override it. */
1289
+ protected unitStep(_kind: string): number;
1290
+ /** The pattern's fields with their positions in the current text; null while the text is not canonical. */
1291
+ private segments;
1292
+ /** The segment under the caret, only while the input has focus. */
1293
+ private activeSegment;
1294
+ /** Moves the value by `seconds`, carrying into the day only when the pattern shows a date. */
1295
+ private shiftSeconds;
1296
+ private stepSegment;
1297
+ /** Steps the segment under the caret (and keeps it selected). Returns false when there is none. */
1298
+ private stepActiveSegment;
1299
+ /**
1300
+ * Spinner button handler. Steps the segment under the caret (day, month, year, hour, minute...);
1301
+ * with no caret in the input it steps like a plain `ArrowUp` / `ArrowDown`.
1302
+ */
1303
+ protected spin(direction: 1 | -1): void;
1304
+ protected onKeydown(event: KeyboardEvent): void;
1305
+ /** Keeps stepped values inside min/max. */
1306
+ protected clampToBounds(date: TDate): TDate;
1307
+ static ɵfac: i0.ɵɵFactoryDeclaration<MomentraTextControl<any>, never>;
1308
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MomentraTextControl<any>, never, never, {
1309
+ "value": {
1310
+ "alias": "value";
1311
+ "required": false;
1312
+ "isSignal": true;
1313
+ };
1314
+ "min": {
1315
+ "alias": "min";
1316
+ "required": false;
1317
+ "isSignal": true;
1318
+ };
1319
+ "max": {
1320
+ "alias": "max";
1321
+ "required": false;
1322
+ "isSignal": true;
1323
+ };
1324
+ "placeholder": {
1325
+ "alias": "placeholder";
1326
+ "required": false;
1327
+ "isSignal": true;
1328
+ };
1329
+ "showClear": {
1330
+ "alias": "showClear";
1331
+ "required": false;
1332
+ "isSignal": true;
1333
+ };
1334
+ "spinners": {
1335
+ "alias": "spinners";
1336
+ "required": false;
1337
+ "isSignal": true;
1338
+ };
1339
+ }, {
1340
+ "value": "valueChange";
1341
+ }, never, never, true, never>;
1342
+ }
1343
+ /**
1344
+ * A text input for a calendar date with parsing, formatting and validation.
1345
+ *
1346
+ * The value is the **local start of the typed day**. `ArrowUp`/`ArrowDown` change the day
1347
+ * (`Shift`: month, `Ctrl`: year).
1348
+ *
1349
+ * @example
1350
+ * ```html
1351
+ * <mtr-date-input formControlName="birthday" format="dd/MM/yyyy" />
1352
+ * ```
1353
+ */
1354
+ export declare class DateInputComponent<TDate = Date> extends MomentraTextControl<TDate> {
1355
+ /** Date pattern, e.g. `'dd/MM/yyyy'`. Defaults to the locale's date format. */
1356
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1357
+ /** Dates that cannot be entered: a predicate or a list of days. */
1358
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1359
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
1360
+ protected readonly pattern: import("@angular/core").Signal<string>;
1361
+ protected validateValue(value: TDate | null): ValidationErrors | null;
1362
+ protected extraValidationDependencies(): unknown;
1363
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateInputComponent<any>, never>;
1364
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateInputComponent<any>, "mtr-date-input", never, {
1365
+ "format": {
1366
+ "alias": "format";
1367
+ "required": false;
1368
+ "isSignal": true;
1369
+ };
1370
+ "disabledDates": {
1371
+ "alias": "disabledDates";
1372
+ "required": false;
1373
+ "isSignal": true;
1374
+ };
1375
+ }, {}, never, never, true, [{
1376
+ directive: typeof MtrThemeDirective;
1377
+ inputs: {
1378
+ "theme": "theme";
1379
+ };
1380
+ outputs: {};
1381
+ }]>;
1382
+ }
1383
+ /**
1384
+ * A text input for a local date-time (no popup). Set `spinners` for increment / decrement buttons.
1385
+ * `ArrowUp`/`ArrowDown` step minutes; `Shift` steps days, `Ctrl` steps hours.
1386
+ *
1387
+ * @example
1388
+ * ```html
1389
+ * <mtr-datetime-input [(value)]="start" format="yyyy-MM-dd HH:mm" spinners />
1390
+ * ```
1391
+ */
1392
+ export declare class DateTimeInputComponent<TDate = Date> extends MomentraTextControl<TDate> {
1393
+ /** Full date-time pattern. Overrides `dateFormat`, `timeFormat`, `hourFormat` and `showSeconds`. */
1394
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1395
+ readonly dateFormat: import("@angular/core").InputSignal<string | null | undefined>;
1396
+ readonly timeFormat: import("@angular/core").InputSignal<string | null | undefined>;
1397
+ /** `12` or `24`. Defaults to the time pattern's clock. */
1398
+ readonly hourFormat: import("@angular/core").InputSignal<12 | 24 | null | undefined>;
1399
+ readonly showSeconds: import("@angular/core").InputSignal<boolean | null | undefined>;
1400
+ readonly minuteStep: import("@angular/core").InputSignal<number>;
1401
+ readonly hourStep: import("@angular/core").InputSignal<number>;
1402
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1403
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
1404
+ protected readonly pattern: import("@angular/core").Signal<string>;
1405
+ protected validateValue(value: TDate | null): ValidationErrors | null;
1406
+ protected extraValidationDependencies(): unknown;
1407
+ protected unitStep(kind: string): number;
1408
+ protected stepValue(direction: 1 | -1, event: KeyboardEvent): TDate;
1409
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeInputComponent<any>, never>;
1410
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeInputComponent<any>, "mtr-datetime-input", never, {
1411
+ "format": {
1412
+ "alias": "format";
1413
+ "required": false;
1414
+ "isSignal": true;
1415
+ };
1416
+ "dateFormat": {
1417
+ "alias": "dateFormat";
1418
+ "required": false;
1419
+ "isSignal": true;
1420
+ };
1421
+ "timeFormat": {
1422
+ "alias": "timeFormat";
1423
+ "required": false;
1424
+ "isSignal": true;
1425
+ };
1426
+ "hourFormat": {
1427
+ "alias": "hourFormat";
1428
+ "required": false;
1429
+ "isSignal": true;
1430
+ };
1431
+ "showSeconds": {
1432
+ "alias": "showSeconds";
1433
+ "required": false;
1434
+ "isSignal": true;
1435
+ };
1436
+ "minuteStep": {
1437
+ "alias": "minuteStep";
1438
+ "required": false;
1439
+ "isSignal": true;
1440
+ };
1441
+ "hourStep": {
1442
+ "alias": "hourStep";
1443
+ "required": false;
1444
+ "isSignal": true;
1445
+ };
1446
+ "disabledDates": {
1447
+ "alias": "disabledDates";
1448
+ "required": false;
1449
+ "isSignal": true;
1450
+ };
1451
+ }, {}, never, never, true, [{
1452
+ directive: typeof MtrThemeDirective;
1453
+ inputs: {
1454
+ "theme": "theme";
1455
+ };
1456
+ outputs: {};
1457
+ }]>;
1458
+ }
1459
+ /**
1460
+ * The bordered box around a Momentra text input: focus ring, invalid/disabled states and the
1461
+ * optional clear and popup-toggle buttons. The `<input>` itself is projected by the host component.
1462
+ * Internal building block; not part of the public API.
1463
+ */
1464
+ declare class MtrFieldShell {
1465
+ /** The element the popup anchors to. */
1466
+ readonly element: HTMLElement;
1467
+ readonly theme: import("@angular/core").InputSignal<MomentraTheme | null | undefined>;
1468
+ readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1469
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1470
+ readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1471
+ readonly showClear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1472
+ readonly clearLabel: import("@angular/core").InputSignal<string>;
1473
+ readonly inputId: import("@angular/core").InputSignal<string | null>;
1474
+ readonly toggleIcon: import("@angular/core").InputSignal<"calendar" | "clock" | null>;
1475
+ readonly toggleLabel: import("@angular/core").InputSignal<string>;
1476
+ readonly expanded: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1477
+ readonly popupId: import("@angular/core").InputSignal<string | null>;
1478
+ readonly clear: import("@angular/core").OutputEmitterRef<void>;
1479
+ readonly toggle: import("@angular/core").OutputEmitterRef<void>;
1480
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtrFieldShell, never>;
1481
+ static ɵcmp: i0.ɵɵComponentDeclaration<MtrFieldShell, "mtr-field", never, {
1482
+ "theme": {
1483
+ "alias": "theme";
1484
+ "required": false;
1485
+ "isSignal": true;
1486
+ };
1487
+ "invalid": {
1488
+ "alias": "invalid";
1489
+ "required": false;
1490
+ "isSignal": true;
1491
+ };
1492
+ "disabled": {
1493
+ "alias": "disabled";
1494
+ "required": false;
1495
+ "isSignal": true;
1496
+ };
1497
+ "readonly": {
1498
+ "alias": "readonly";
1499
+ "required": false;
1500
+ "isSignal": true;
1501
+ };
1502
+ "showClear": {
1503
+ "alias": "showClear";
1504
+ "required": false;
1505
+ "isSignal": true;
1506
+ };
1507
+ "clearLabel": {
1508
+ "alias": "clearLabel";
1509
+ "required": false;
1510
+ "isSignal": true;
1511
+ };
1512
+ "inputId": {
1513
+ "alias": "inputId";
1514
+ "required": false;
1515
+ "isSignal": true;
1516
+ };
1517
+ "toggleIcon": {
1518
+ "alias": "toggleIcon";
1519
+ "required": false;
1520
+ "isSignal": true;
1521
+ };
1522
+ "toggleLabel": {
1523
+ "alias": "toggleLabel";
1524
+ "required": false;
1525
+ "isSignal": true;
1526
+ };
1527
+ "expanded": {
1528
+ "alias": "expanded";
1529
+ "required": false;
1530
+ "isSignal": true;
1531
+ };
1532
+ "popupId": {
1533
+ "alias": "popupId";
1534
+ "required": false;
1535
+ "isSignal": true;
1536
+ };
1537
+ }, {
1538
+ "clear": "clear";
1539
+ "toggle": "toggle";
1540
+ }, never, ["*"], true, never>;
1541
+ }
1542
+ /**
1543
+ * Adds an overlay popup to a text control: open/close state, outside-click and Escape handling,
1544
+ * and `Alt+ArrowDown` to open. The host template must contain one `<mtr-field>` (the anchor) and
1545
+ * render its popup with `cdkConnectedOverlay`.
1546
+ */
1547
+ declare abstract class MomentraPopupControl<TDate> extends MomentraTextControl<TDate> {
1548
+ /** Whether the popup is open (two-way bindable: `[(open)]`). */
1549
+ readonly open: import("@angular/core").ModelSignal<boolean>;
1550
+ /** Closes the popup right after a selection. Defaults to the global setting. */
1551
+ readonly closeOnSelect: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1552
+ /** Emits when the popup opens. */
1553
+ readonly opened: import("@angular/core").OutputEmitterRef<void>;
1554
+ /** Emits when the popup closes. */
1555
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
1556
+ protected readonly shell: import("@angular/core").Signal<MtrFieldShell>;
1557
+ protected readonly popupId: string;
1558
+ protected readonly positions: ConnectedPosition[];
1559
+ protected get shouldCloseOnSelect(): boolean;
1560
+ openPopup(): void;
1561
+ /** Closes the popup. `restoreFocus` returns focus to the input (use for Escape and selections). */
1562
+ closePopup(restoreFocus?: boolean): void;
1563
+ /** Moves focus to the text input. */
1564
+ focusInput(): void;
1565
+ protected togglePopup(): void;
1566
+ /** Called by the overlay when it detaches for any reason (e.g. scrolled away). */
1567
+ protected onDetach(): void;
1568
+ protected onOutsideClick(event: MouseEvent): void;
1569
+ protected onOverlayKeydown(event: KeyboardEvent): void;
1570
+ protected onKeydown(event: KeyboardEvent): void;
1571
+ /** Blur of the input: only counts as "touched" when the popup is not taking over focus. */
1572
+ protected onBlur(): void;
1573
+ protected afterClear(): void;
1574
+ static ɵfac: i0.ɵɵFactoryDeclaration<MomentraPopupControl<any>, never>;
1575
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MomentraPopupControl<any>, never, never, {
1576
+ "open": {
1577
+ "alias": "open";
1578
+ "required": false;
1579
+ "isSignal": true;
1580
+ };
1581
+ "closeOnSelect": {
1582
+ "alias": "closeOnSelect";
1583
+ "required": false;
1584
+ "isSignal": true;
1585
+ };
1586
+ }, {
1587
+ "open": "openChange";
1588
+ "opened": "opened";
1589
+ "closed": "closed";
1590
+ }, never, never, true, never>;
1591
+ }
1592
+ /**
1593
+ * A date input with a calendar popup.
1594
+ *
1595
+ * The value is the **local start of the selected day** (`Date` at 00:00 in the local zone), so the
1596
+ * calendar day never shifts with the time zone. Works with `formControl`, `formControlName` and
1597
+ * `ngModel`; it also accepts ISO `yyyy-MM-dd` strings written by the forms API.
1598
+ *
1599
+ * @example
1600
+ * ```html
1601
+ * <mtr-date-picker [(ngModel)]="date" [min]="today" placeholder="Choose a date" />
1602
+ * ```
1603
+ */
1604
+ export declare class DatePickerComponent<TDate = Date> extends MomentraPopupControl<TDate> {
1605
+ private readonly injector;
1606
+ /** Date pattern, e.g. `'dd/MM/yyyy'`. Defaults to the locale's date format. */
1607
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1608
+ /** Dates that cannot be selected: a predicate or a list of days. */
1609
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1610
+ /** Custom content for day cells in the calendar. */
1611
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
1612
+ /** Shows the *Today* button in the popup. Defaults to the global setting. */
1613
+ readonly showToday: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1614
+ /** Month to show when the popup opens with no value. Defaults to today. */
1615
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
1616
+ private readonly calendar;
1617
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
1618
+ protected readonly pattern: import("@angular/core").Signal<string>;
1619
+ protected readonly calendarStart: import("@angular/core").Signal<NonNullable<TDate> | null>;
1620
+ protected validateValue(value: TDate | null): ValidationErrors | null;
1621
+ protected extraValidationDependencies(): unknown;
1622
+ /** Moves focus into the calendar once the popup is attached. */
1623
+ protected onAttach(): void;
1624
+ protected onCalendarSelect(date: TDate): void;
1625
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent<any>, never>;
1626
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent<any>, "mtr-date-picker", never, {
1627
+ "format": {
1628
+ "alias": "format";
1629
+ "required": false;
1630
+ "isSignal": true;
1631
+ };
1632
+ "disabledDates": {
1633
+ "alias": "disabledDates";
1634
+ "required": false;
1635
+ "isSignal": true;
1636
+ };
1637
+ "cellTemplate": {
1638
+ "alias": "cellTemplate";
1639
+ "required": false;
1640
+ "isSignal": true;
1641
+ };
1642
+ "showToday": {
1643
+ "alias": "showToday";
1644
+ "required": false;
1645
+ "isSignal": true;
1646
+ };
1647
+ "initialDate": {
1648
+ "alias": "initialDate";
1649
+ "required": false;
1650
+ "isSignal": true;
1651
+ };
1652
+ }, {}, never, never, true, [{
1653
+ directive: typeof MtrThemeDirective;
1654
+ inputs: {
1655
+ "theme": "theme";
1656
+ };
1657
+ outputs: {};
1658
+ }]>;
1659
+ }
1660
+ /**
1661
+ * A time-of-day input with a popup of hour, minute, (second) and AM/PM lists.
1662
+ *
1663
+ * The value is a date whose **time of day** is the selected time; its date part is the date of the
1664
+ * previous value, or `baseDate` (default: today) when there was none. `min`/`max` limit the time of
1665
+ * day only.
1666
+ *
1667
+ * @example
1668
+ * ```html
1669
+ * <mtr-time-picker formControlName="start" hourFormat="24" [minuteStep]="15" />
1670
+ * ```
1671
+ */
1672
+ export declare class TimePickerComponent<TDate = Date> extends MomentraPopupControl<TDate> {
1673
+ private readonly injector;
1674
+ /** Explicit time pattern, e.g. `'HH:mm'` or `'h:mm a'`. Overrides `hourFormat` and `showSeconds`. */
1675
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1676
+ /** `12` or `24`. Defaults to the locale's clock. */
1677
+ readonly hourFormat: import("@angular/core").InputSignal<12 | 24 | null | undefined>;
1678
+ /** Shows seconds. Defaults to whatever the pattern shows. */
1679
+ readonly showSeconds: import("@angular/core").InputSignal<boolean | null | undefined>;
1680
+ /** Interval between selectable hours, e.g. `2`. */
1681
+ readonly hourStep: import("@angular/core").InputSignal<number>;
1682
+ /** Interval between selectable minutes, e.g. `15`. */
1683
+ readonly minuteStep: import("@angular/core").InputSignal<number>;
1684
+ /** Interval between selectable seconds. */
1685
+ readonly secondStep: import("@angular/core").InputSignal<number>;
1686
+ /** Date used for values created from scratch. Defaults to today. */
1687
+ readonly baseDate: import("@angular/core").InputSignal<TDate | null | undefined>;
1688
+ private readonly selector;
1689
+ protected readonly parseErrorKey: "mtrInvalidTime";
1690
+ protected readonly pattern: import("@angular/core").Signal<string>;
1691
+ protected readonly use12Hours: import("@angular/core").Signal<boolean>;
1692
+ protected readonly secondsVisible: import("@angular/core").Signal<boolean>;
1693
+ private readonly steps;
1694
+ protected readonly selectorBase: import("@angular/core").Signal<NonNullable<TDate> | null>;
1695
+ protected parseBase(): TDate | null;
1696
+ protected validateValue(value: TDate | null): ValidationErrors | null;
1697
+ private bounds;
1698
+ protected unitStep(kind: string): number;
1699
+ /** `ArrowUp`/`ArrowDown` step minutes (`Shift`: hours, `Ctrl`: seconds), wrapping within the day's bounds. */
1700
+ protected stepValue(direction: 1 | -1, event: KeyboardEvent): TDate;
1701
+ protected clampToBounds(date: TDate): TDate;
1702
+ protected onAttach(): void;
1703
+ protected onSelectorChange(date: TDate): void;
1704
+ /** Sets the current time of day, snapped to the configured steps and limits. */
1705
+ protected selectNow(): void;
1706
+ protected done(): void;
1707
+ static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerComponent<any>, never>;
1708
+ static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent<any>, "mtr-time-picker", never, {
1709
+ "format": {
1710
+ "alias": "format";
1711
+ "required": false;
1712
+ "isSignal": true;
1713
+ };
1714
+ "hourFormat": {
1715
+ "alias": "hourFormat";
1716
+ "required": false;
1717
+ "isSignal": true;
1718
+ };
1719
+ "showSeconds": {
1720
+ "alias": "showSeconds";
1721
+ "required": false;
1722
+ "isSignal": true;
1723
+ };
1724
+ "hourStep": {
1725
+ "alias": "hourStep";
1726
+ "required": false;
1727
+ "isSignal": true;
1728
+ };
1729
+ "minuteStep": {
1730
+ "alias": "minuteStep";
1731
+ "required": false;
1732
+ "isSignal": true;
1733
+ };
1734
+ "secondStep": {
1735
+ "alias": "secondStep";
1736
+ "required": false;
1737
+ "isSignal": true;
1738
+ };
1739
+ "baseDate": {
1740
+ "alias": "baseDate";
1741
+ "required": false;
1742
+ "isSignal": true;
1743
+ };
1744
+ }, {}, never, never, true, [{
1745
+ directive: typeof MtrThemeDirective;
1746
+ inputs: {
1747
+ "theme": "theme";
1748
+ };
1749
+ outputs: {};
1750
+ }]>;
1751
+ }
1752
+ /**
1753
+ * A combined date and time input. The popup shows a calendar next to hour/minute lists.
1754
+ *
1755
+ * The value is a **local date-time** (wall-clock fields in the local zone, no conversion to UTC).
1756
+ * `min`/`max` are compared as exact date-times; the time lists only restrict the time of day on
1757
+ * the boundary days.
1758
+ *
1759
+ * @example
1760
+ * ```html
1761
+ * <mtr-datetime-picker [(ngModel)]="appointment" dateFormat="yyyy-MM-dd" hourFormat="24" [minuteStep]="15" />
1762
+ * ```
1763
+ */
1764
+ export declare class DateTimePickerComponent<TDate = Date> extends MomentraPopupControl<TDate> {
1765
+ private readonly injector;
1766
+ /** Full date-time pattern. Overrides `dateFormat`, `timeFormat`, `hourFormat` and `showSeconds`. */
1767
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1768
+ /** Date part of the pattern, e.g. `'yyyy-MM-dd'`. Defaults to the locale's date format. */
1769
+ readonly dateFormat: import("@angular/core").InputSignal<string | null | undefined>;
1770
+ /** Time part of the pattern, e.g. `'HH:mm'`. Defaults to the locale's time format. */
1771
+ readonly timeFormat: import("@angular/core").InputSignal<string | null | undefined>;
1772
+ /** `12` or `24`. Defaults to the time pattern's clock. */
1773
+ readonly hourFormat: import("@angular/core").InputSignal<12 | 24 | null | undefined>;
1774
+ /** Shows seconds. Defaults to whatever the time pattern shows. */
1775
+ readonly showSeconds: import("@angular/core").InputSignal<boolean | null | undefined>;
1776
+ readonly hourStep: import("@angular/core").InputSignal<number>;
1777
+ readonly minuteStep: import("@angular/core").InputSignal<number>;
1778
+ readonly secondStep: import("@angular/core").InputSignal<number>;
1779
+ /** Dates that cannot be selected: a predicate or a list of days. */
1780
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1781
+ /** Custom content for day cells in the calendar. */
1782
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
1783
+ /** Shows the *Today* button in the calendar. Defaults to the global setting. */
1784
+ readonly showToday: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1785
+ /** Month to show when the popup opens with no value. Defaults to today. */
1786
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
1787
+ /**
1788
+ * `'split'`: calendar and time lists side by side. `'tabs'`: a Date tab and a Time tab with Cancel / Set
1789
+ * buttons (narrow popup; picking a date switches to the Time tab).
1790
+ */
1791
+ readonly layout: import("@angular/core").InputSignal<"split" | "tabs">;
1792
+ protected readonly tab: import("@angular/core").WritableSignal<"time" | "date">;
1793
+ /** Tabs layout: the value to restore on Cancel, and whether a time was chosen since opening. */
1794
+ private previous;
1795
+ protected readonly timeChosen: import("@angular/core").WritableSignal<boolean>;
1796
+ protected readonly canSet: import("@angular/core").Signal<boolean>;
1797
+ private readonly calendar;
1798
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
1799
+ private readonly timePattern;
1800
+ protected readonly pattern: import("@angular/core").Signal<string>;
1801
+ protected readonly use12Hours: import("@angular/core").Signal<boolean>;
1802
+ protected readonly secondsVisible: import("@angular/core").Signal<boolean>;
1803
+ protected readonly calendarStart: import("@angular/core").Signal<NonNullable<TDate> | null>;
1804
+ private readonly steps;
1805
+ /** The time-of-day limits that apply on the currently selected day (only the boundary days are limited). */
1806
+ protected readonly timeMin: import("@angular/core").Signal<TDate | null>;
1807
+ protected readonly timeMax: import("@angular/core").Signal<TDate | null>;
1808
+ private boundaryFor;
1809
+ protected validateValue(value: TDate | null): ValidationErrors | null;
1810
+ protected extraValidationDependencies(): unknown;
1811
+ protected clampToBounds(date: TDate): TDate;
1812
+ protected unitStep(kind: string): number;
1813
+ /** `ArrowUp`/`ArrowDown` step minutes; `Shift` steps days, `Ctrl` steps hours. */
1814
+ protected stepValue(direction: 1 | -1, event: KeyboardEvent): TDate;
1815
+ protected onAttach(): void;
1816
+ protected onCalendarSelect(day: TDate): void;
1817
+ protected cancel(): void;
1818
+ protected onTimeChange(date: TDate): void;
1819
+ /** Sets the current date and time, snapped to the configured steps and limits. */
1820
+ protected selectNow(): void;
1821
+ protected done(): void;
1822
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent<any>, never>;
1823
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent<any>, "mtr-datetime-picker", never, {
1824
+ "format": {
1825
+ "alias": "format";
1826
+ "required": false;
1827
+ "isSignal": true;
1828
+ };
1829
+ "dateFormat": {
1830
+ "alias": "dateFormat";
1831
+ "required": false;
1832
+ "isSignal": true;
1833
+ };
1834
+ "timeFormat": {
1835
+ "alias": "timeFormat";
1836
+ "required": false;
1837
+ "isSignal": true;
1838
+ };
1839
+ "hourFormat": {
1840
+ "alias": "hourFormat";
1841
+ "required": false;
1842
+ "isSignal": true;
1843
+ };
1844
+ "showSeconds": {
1845
+ "alias": "showSeconds";
1846
+ "required": false;
1847
+ "isSignal": true;
1848
+ };
1849
+ "hourStep": {
1850
+ "alias": "hourStep";
1851
+ "required": false;
1852
+ "isSignal": true;
1853
+ };
1854
+ "minuteStep": {
1855
+ "alias": "minuteStep";
1856
+ "required": false;
1857
+ "isSignal": true;
1858
+ };
1859
+ "secondStep": {
1860
+ "alias": "secondStep";
1861
+ "required": false;
1862
+ "isSignal": true;
1863
+ };
1864
+ "disabledDates": {
1865
+ "alias": "disabledDates";
1866
+ "required": false;
1867
+ "isSignal": true;
1868
+ };
1869
+ "cellTemplate": {
1870
+ "alias": "cellTemplate";
1871
+ "required": false;
1872
+ "isSignal": true;
1873
+ };
1874
+ "showToday": {
1875
+ "alias": "showToday";
1876
+ "required": false;
1877
+ "isSignal": true;
1878
+ };
1879
+ "initialDate": {
1880
+ "alias": "initialDate";
1881
+ "required": false;
1882
+ "isSignal": true;
1883
+ };
1884
+ "layout": {
1885
+ "alias": "layout";
1886
+ "required": false;
1887
+ "isSignal": true;
1888
+ };
1889
+ }, {}, never, never, true, [{
1890
+ directive: typeof MtrThemeDirective;
1891
+ inputs: {
1892
+ "theme": "theme";
1893
+ };
1894
+ outputs: {};
1895
+ }]>;
1896
+ }
1897
+ type Edge = 'start' | 'end';
1898
+ /**
1899
+ * Selects a start and an end date. Click (or press Enter on) a first day, then a second day; the
1900
+ * days in between are highlighted, previewing the range while the pointer or keyboard focus moves.
1901
+ *
1902
+ * The value is a {@link DateRange}. It can be **incomplete** (only `start`) while the user is still
1903
+ * choosing; an incomplete range is reported as a `mtrRangeIncomplete` validation error. Both ends are
1904
+ * local start-of-day dates.
1905
+ *
1906
+ * @example
1907
+ * ```html
1908
+ * <mtr-date-range-picker formControlName="stay" [minRangeLength]="2" [maxRangeLength]="14" [presets]="presets" />
1909
+ * ```
1910
+ */
1911
+ export declare class DateRangePickerComponent<TDate = Date> extends MomentraFormControl<TDate, DateRange<TDate> | null> {
1912
+ private readonly injector;
1913
+ /** The range (two-way bindable: `[(value)]`). Either end may be `null`. */
1914
+ readonly value: import("@angular/core").ModelSignal<DateRange<TDate>>;
1915
+ /** Whether the popup is open (two-way bindable: `[(open)]`). */
1916
+ readonly open: import("@angular/core").ModelSignal<boolean>;
1917
+ readonly min: import("@angular/core").InputSignal<TDate | null | undefined>;
1918
+ readonly max: import("@angular/core").InputSignal<TDate | null | undefined>;
1919
+ /** Minimum number of days a range must span (inclusive: one day counts as 1). */
1920
+ readonly minRangeLength: import("@angular/core").InputSignal<number | null | undefined>;
1921
+ /** Maximum number of days a range may span (inclusive). */
1922
+ readonly maxRangeLength: import("@angular/core").InputSignal<number | null | undefined>;
1923
+ /** Dates that cannot be part of a range: a predicate or a list of days. */
1924
+ readonly disabledDates: import("@angular/core").InputSignal<DisabledDates<TDate> | null | undefined>;
1925
+ /** Shortcut ranges shown next to the calendar. */
1926
+ readonly presets: import("@angular/core").InputSignal<readonly DateRangePreset<TDate>[] | null | undefined>;
1927
+ /** Date pattern for both inputs. Defaults to the locale's date format. */
1928
+ readonly format: import("@angular/core").InputSignal<string | null | undefined>;
1929
+ /** Placeholder for both inputs. Defaults to the pattern. */
1930
+ readonly placeholder: import("@angular/core").InputSignal<string | null | undefined>;
1931
+ /** Custom content for day cells. */
1932
+ readonly cellTemplate: import("@angular/core").InputSignal<TemplateRef<MtrCellContext<TDate>> | null | undefined>;
1933
+ readonly showToday: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1934
+ readonly showClear: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1935
+ /** Closes the popup once a complete range was picked. Defaults to the global setting. */
1936
+ readonly closeOnSelect: import("@angular/core").InputSignalWithTransform<boolean | null | undefined, unknown>;
1937
+ /** Month to show when the popup opens with no value. Defaults to today. */
1938
+ readonly initialDate: import("@angular/core").InputSignal<TDate | null | undefined>;
1939
+ /** Emits when the popup opens. */
1940
+ readonly opened: import("@angular/core").OutputEmitterRef<void>;
1941
+ /** Emits when the popup closes. */
1942
+ readonly closed: import("@angular/core").OutputEmitterRef<void>;
1943
+ protected readonly shell: import("@angular/core").Signal<MtrFieldShell>;
1944
+ private readonly calendar;
1945
+ protected readonly popupId: string;
1946
+ protected readonly startId: import("@angular/core").Signal<string>;
1947
+ protected readonly endId: string;
1948
+ protected readonly errorsId: string;
1949
+ protected readonly positions: import("@angular/cdk/overlay").ConnectedPosition[];
1950
+ protected readonly localeOverrides: import("@angular/core").Signal<LocaleOverrides>;
1951
+ protected readonly pattern: import("@angular/core").Signal<string>;
1952
+ protected readonly placeholderText: import("@angular/core").Signal<string>;
1953
+ protected readonly startText: import("@angular/core").WritableSignal<string>;
1954
+ protected readonly endText: import("@angular/core").WritableSignal<string>;
1955
+ protected readonly startFailed: import("@angular/core").WritableSignal<boolean>;
1956
+ protected readonly endFailed: import("@angular/core").WritableSignal<boolean>;
1957
+ private typing;
1958
+ /** The day under the pointer / focus while the end of the range is being chosen. */
1959
+ protected readonly hoverDate: import("@angular/core").WritableSignal<TDate | null>;
1960
+ protected readonly selectingEnd: import("@angular/core").Signal<boolean>;
1961
+ protected readonly clearVisible: import("@angular/core").Signal<boolean>;
1962
+ /** The range the calendar highlights: the value, or a live preview while choosing the end. */
1963
+ protected readonly highlight: import("@angular/core").Signal<DateRange<TDate>>;
1964
+ /** Disabled dates, plus — while choosing the end — days that would break the length limits. */
1965
+ protected readonly calendarDisabled: import("@angular/core").Signal<((date: TDate) => boolean) | null>;
1966
+ /** The month the left calendar shows; set when the popup opens, so picking an end date never jumps the view. */
1967
+ protected readonly popupAnchor: import("@angular/core").WritableSignal<TDate | null>;
1968
+ protected readonly leftMonth: import("@angular/core").Signal<TDate>;
1969
+ protected readonly rightMonth: import("@angular/core").Signal<TDate>;
1970
+ /** "Nov 18 – Dec 3, 2026 · 16 days" once both ends are picked. */
1971
+ protected readonly summary: import("@angular/core").Signal<string>;
1972
+ protected readonly presetList: import("@angular/core").Signal<{
1973
+ preset: DateRangePreset<TDate>;
1974
+ label: string;
1975
+ active: boolean;
1976
+ disabled: boolean;
1977
+ }[]>;
1978
+ protected readonly hint: import("@angular/core").Signal<string>;
1979
+ private readonly rangeRules;
1980
+ constructor();
1981
+ protected applyExternalValue(value: unknown): void;
1982
+ protected validationDependencies(): unknown;
1983
+ protected computeErrors(): ValidationErrors | null;
1984
+ protected formatForMessage(value: unknown): string;
1985
+ private formatDay;
1986
+ private syncText;
1987
+ private commit;
1988
+ protected onTextInput(edge: Edge, text: string): void;
1989
+ protected commitText(): void;
1990
+ protected onInputBlur(): void;
1991
+ protected onInputKeydown(event: KeyboardEvent): void;
1992
+ protected clear(): void;
1993
+ protected get shouldCloseOnSelect(): boolean;
1994
+ openPopup(): void;
1995
+ closePopup(restoreFocus?: boolean): void;
1996
+ /** Moves focus to the start input. */
1997
+ focusStart(): void;
1998
+ protected togglePopup(): void;
1999
+ protected onAttach(): void;
2000
+ protected onDetach(): void;
2001
+ protected onOutsideClick(event: MouseEvent): void;
2002
+ protected onOverlayKeydown(event: KeyboardEvent): void;
2003
+ protected onCalendarSelect(date: TDate): void;
2004
+ /**
2005
+ * Keeps the two calendars consecutive: when either one pages or keyboard focus leaves its month,
2006
+ * the other follows.
2007
+ * ponytail: crossing from the left month into the right one pages both by a month instead of
2008
+ * handing focus over; teach mtr-calendar an external focus API if that matters.
2009
+ */
2010
+ protected onMonthChange(date: TDate, panel: 0 | 1): void;
2011
+ protected onHover(date: TDate | null): void;
2012
+ protected applyPreset(preset: DateRangePreset<TDate>): void;
2013
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateRangePickerComponent<any>, never>;
2014
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateRangePickerComponent<any>, "mtr-date-range-picker", never, {
2015
+ "value": {
2016
+ "alias": "value";
2017
+ "required": false;
2018
+ "isSignal": true;
2019
+ };
2020
+ "open": {
2021
+ "alias": "open";
2022
+ "required": false;
2023
+ "isSignal": true;
2024
+ };
2025
+ "min": {
2026
+ "alias": "min";
2027
+ "required": false;
2028
+ "isSignal": true;
2029
+ };
2030
+ "max": {
2031
+ "alias": "max";
2032
+ "required": false;
2033
+ "isSignal": true;
2034
+ };
2035
+ "minRangeLength": {
2036
+ "alias": "minRangeLength";
2037
+ "required": false;
2038
+ "isSignal": true;
2039
+ };
2040
+ "maxRangeLength": {
2041
+ "alias": "maxRangeLength";
2042
+ "required": false;
2043
+ "isSignal": true;
2044
+ };
2045
+ "disabledDates": {
2046
+ "alias": "disabledDates";
2047
+ "required": false;
2048
+ "isSignal": true;
2049
+ };
2050
+ "presets": {
2051
+ "alias": "presets";
2052
+ "required": false;
2053
+ "isSignal": true;
2054
+ };
2055
+ "format": {
2056
+ "alias": "format";
2057
+ "required": false;
2058
+ "isSignal": true;
2059
+ };
2060
+ "placeholder": {
2061
+ "alias": "placeholder";
2062
+ "required": false;
2063
+ "isSignal": true;
2064
+ };
2065
+ "cellTemplate": {
2066
+ "alias": "cellTemplate";
2067
+ "required": false;
2068
+ "isSignal": true;
2069
+ };
2070
+ "showToday": {
2071
+ "alias": "showToday";
2072
+ "required": false;
2073
+ "isSignal": true;
2074
+ };
2075
+ "showClear": {
2076
+ "alias": "showClear";
2077
+ "required": false;
2078
+ "isSignal": true;
2079
+ };
2080
+ "closeOnSelect": {
2081
+ "alias": "closeOnSelect";
2082
+ "required": false;
2083
+ "isSignal": true;
2084
+ };
2085
+ "initialDate": {
2086
+ "alias": "initialDate";
2087
+ "required": false;
2088
+ "isSignal": true;
2089
+ };
2090
+ }, {
2091
+ "value": "valueChange";
2092
+ "open": "openChange";
2093
+ "opened": "opened";
2094
+ "closed": "closed";
2095
+ }, never, never, true, [{
2096
+ directive: typeof MtrThemeDirective;
2097
+ inputs: {
2098
+ "theme": "theme";
2099
+ };
2100
+ outputs: {};
2101
+ }]>;
2102
+ }
2103
+ /**
2104
+ * Range selection logic and preset helpers. Pure functions, no Angular.
2105
+ */
2106
+ /**
2107
+ * The range after the user picks `date` in the calendar:
2108
+ *
2109
+ * - empty or complete range → `date` starts a new range;
2110
+ * - only a start, and `date` is on/after it → the range is completed;
2111
+ * - only a start, and `date` is before it → `date` becomes the new start.
2112
+ */
2113
+ export declare function pickRangeDate<TDate>(adapter: DateAdapter<TDate>, current: DateRange<TDate>, date: TDate): DateRange<TDate>;
2114
+ /** Whether two ranges cover exactly the same days. */
2115
+ export declare function isSameRange<TDate>(adapter: DateAdapter<TDate>, a: DateRange<TDate> | null | undefined, b: DateRange<TDate> | null | undefined): boolean;
2116
+ /** The `days` days ending today (inclusive): `lastDays(adapter, 7)` is today and the 6 days before. */
2117
+ export declare function lastDaysRange<TDate>(adapter: DateAdapter<TDate>, days: number): CompleteDateRange<TDate>;
2118
+ /** From the first to the last day of the current month. */
2119
+ export declare function thisMonthRange<TDate>(adapter: DateAdapter<TDate>): CompleteDateRange<TDate>;
2120
+ /** From the first to the last day of the previous month. */
2121
+ export declare function lastMonthRange<TDate>(adapter: DateAdapter<TDate>): CompleteDateRange<TDate>;
2122
+ /** From the start to the end of the current week. */
2123
+ export declare function thisWeekRange<TDate>(adapter: DateAdapter<TDate>, firstDayOfWeek: number): CompleteDateRange<TDate>;
2124
+ /** Builds a preset whose range is computed when it is used, so "last 7 days" is never stale. */
2125
+ export declare function createPreset<TDate>(label: string, range: () => CompleteDateRange<TDate>): DateRangePreset<TDate>;
2126
+ /** Resolves a preset's (possibly lazy) range. */
2127
+ export declare function resolvePreset<TDate>(preset: DateRangePreset<TDate>): CompleteDateRange<TDate>;
2128
+ export type { Bound, CalendarCell, CalendarContext, CalendarView, CalendarViewModel, DateGranularity, DateRules, DateTimeParts, DisabledDates, LocaleOverrides, MomentraConfig, MomentraTheme, MtrCellContext, MtrMultiviewMode, ParsedParts, RangeRules, TimeRules };