ngxsmk-datepicker 2.2.2 → 2.2.6

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.
@@ -1,2412 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, ElementRef, AfterViewInit, OnDestroy, TemplateRef, InjectionToken, EffectRef, Signal, OnInit, OnChanges, SimpleChanges } from '@angular/core';
3
- import { ControlValueAccessor, NgControl } from '@angular/forms';
4
- import { Subject } from 'rxjs';
5
-
6
- declare function getStartOfDay(d: Date): Date;
7
- declare function getEndOfDay(d: Date): Date;
8
- declare function addMonths(d: Date, months: number): Date;
9
- declare function subtractDays(d: Date, days: number): Date;
10
- declare function getStartOfMonth(d: Date): Date;
11
- declare function getEndOfMonth(d: Date): Date;
12
- declare function isSameDay(d1: Date | null, d2: Date | null): boolean;
13
- declare function normalizeDate(date: DateInput | null): Date | null;
14
- type DateInput = Date | string | {
15
- toDate: () => Date;
16
- _isAMomentObject?: boolean;
17
- $d?: Date;
18
- };
19
-
20
- interface HolidayProvider {
21
- isHoliday(date: Date): boolean;
22
- getHolidayLabel?(date: Date): string | null;
23
- }
24
- interface DateRange {
25
- [key: string]: [DateInput, DateInput];
26
- }
27
- type DatepickerValue = Date | {
28
- start: Date | null;
29
- end: Date | null;
30
- } | Date[] | null;
31
- declare function generateMonthOptions(locale: string, year: number): {
32
- label: string;
33
- value: number;
34
- }[];
35
- /**
36
- * Format a number using locale-aware number formatting.
37
- * Uses Intl.NumberFormat for proper localization of numeric separators and decimals.
38
- *
39
- * @param value - The number to format
40
- * @param locale - The locale to use for formatting (e.g., 'en-US', 'de-DE', 'fr-FR')
41
- * @param options - Optional Intl.NumberFormatOptions for customization
42
- * @returns Formatted number string
43
- */
44
- declare function formatLocaleNumber(value: number, locale: string, options?: Intl.NumberFormatOptions): string;
45
- declare function generateYearOptions(currentYear: number, range?: number): {
46
- label: string;
47
- value: number;
48
- }[];
49
- declare function generateTimeOptions(minuteInterval?: number, secondInterval?: number, includeSeconds?: boolean, use24Hour?: boolean): {
50
- hourOptions: {
51
- label: string;
52
- value: number;
53
- }[];
54
- minuteOptions: {
55
- label: string;
56
- value: number;
57
- }[];
58
- secondOptions?: {
59
- label: string;
60
- value: number;
61
- }[];
62
- };
63
- declare function generateWeekDays(locale: string, firstDayOfWeek?: number): string[];
64
- declare function getFirstDayOfWeek(locale: string): number;
65
- declare function get24Hour(displayHour: number, isPm: boolean): number;
66
- declare function update12HourState(fullHour: number): {
67
- isPm: boolean;
68
- displayHour: number;
69
- };
70
- declare function processDateRanges(ranges: DateRange | null): {
71
- [key: string]: [Date, Date];
72
- } | null;
73
- declare function generateYearGrid(currentYear: number): number[];
74
- declare function generateDecadeGrid(currentDecade: number): number[];
75
-
76
- interface DatepickerClasses {
77
- wrapper?: string;
78
- inputGroup?: string;
79
- input?: string;
80
- clearBtn?: string;
81
- calendarBtn?: string;
82
- popover?: string;
83
- container?: string;
84
- calendar?: string;
85
- header?: string;
86
- navPrev?: string;
87
- navNext?: string;
88
- dayCell?: string;
89
- footer?: string;
90
- closeBtn?: string;
91
- }
92
-
93
- declare class NgxsmkDatepickerInputComponent {
94
- isNative: boolean;
95
- disabled: boolean;
96
- classes: DatepickerClasses | undefined;
97
- nativeInputType: string;
98
- formattedValue: string;
99
- placeholder: string;
100
- id: string;
101
- name: string;
102
- autocomplete: string;
103
- required: boolean;
104
- minDateNative: string | null;
105
- maxDateNative: string | null;
106
- ariaLabel: string;
107
- ariaDescribedBy: string;
108
- errorState: boolean;
109
- clearAriaLabel: string;
110
- clearLabel: string;
111
- isCalendarOpen: boolean;
112
- allowTyping: boolean;
113
- typedInputValue: string;
114
- displayValue: string;
115
- showCalendarButton: boolean;
116
- calendarAriaLabel: string;
117
- validationErrorMessage: string | null;
118
- nativeInputChange: EventEmitter<Event>;
119
- inputBlur: EventEmitter<FocusEvent>;
120
- clearValue: EventEmitter<MouseEvent>;
121
- toggleCalendar: EventEmitter<Event>;
122
- pointerDown: EventEmitter<PointerEvent>;
123
- pointerUp: EventEmitter<PointerEvent>;
124
- inputGroupFocus: EventEmitter<void>;
125
- inputKeyDown: EventEmitter<Event>;
126
- inputChange: EventEmitter<Event>;
127
- inputFocus: EventEmitter<FocusEvent>;
128
- nativeInput?: ElementRef<HTMLInputElement>;
129
- customInput?: ElementRef<HTMLInputElement>;
130
- focus(): void;
131
- onNativeInputChange(event: Event): void;
132
- onInputBlur(event: FocusEvent): void;
133
- onClearValue(event: MouseEvent): void;
134
- onToggleCalendar(event: Event): void;
135
- onPointerDown(event: PointerEvent): void;
136
- onPointerUp(event: PointerEvent): void;
137
- onInputGroupFocus(): void;
138
- onInputKeyDown(event: Event): void;
139
- onInputChange(event: Event): void;
140
- onInputFocus(event: FocusEvent): void;
141
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkDatepickerInputComponent, never>;
142
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxsmkDatepickerInputComponent, "ngxsmk-datepicker-input", never, { "isNative": { "alias": "isNative"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; "nativeInputType": { "alias": "nativeInputType"; "required": false; }; "formattedValue": { "alias": "formattedValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "required": { "alias": "required"; "required": false; }; "minDateNative": { "alias": "minDateNative"; "required": false; }; "maxDateNative": { "alias": "maxDateNative"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; "errorState": { "alias": "errorState"; "required": false; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; }; "clearLabel": { "alias": "clearLabel"; "required": false; }; "isCalendarOpen": { "alias": "isCalendarOpen"; "required": false; }; "allowTyping": { "alias": "allowTyping"; "required": false; }; "typedInputValue": { "alias": "typedInputValue"; "required": false; }; "displayValue": { "alias": "displayValue"; "required": false; }; "showCalendarButton": { "alias": "showCalendarButton"; "required": false; }; "calendarAriaLabel": { "alias": "calendarAriaLabel"; "required": false; }; "validationErrorMessage": { "alias": "validationErrorMessage"; "required": false; }; }, { "nativeInputChange": "nativeInputChange"; "inputBlur": "inputBlur"; "clearValue": "clearValue"; "toggleCalendar": "toggleCalendar"; "pointerDown": "pointerDown"; "pointerUp": "pointerUp"; "inputGroupFocus": "inputGroupFocus"; "inputKeyDown": "inputKeyDown"; "inputChange": "inputChange"; "inputFocus": "inputFocus"; }, never, never, true, never>;
143
- }
144
-
145
- declare class CustomSelectComponent implements AfterViewInit, OnDestroy {
146
- options: {
147
- label: string;
148
- value: unknown;
149
- }[];
150
- value: unknown;
151
- disabled: boolean;
152
- valueChange: EventEmitter<unknown>;
153
- container: ElementRef<HTMLDivElement>;
154
- button: ElementRef<HTMLButtonElement>;
155
- panel: ElementRef<HTMLDivElement>;
156
- isOpen: boolean;
157
- private readonly elementRef;
158
- private readonly platformId;
159
- private readonly document;
160
- private readonly isBrowser;
161
- private resizeObserver;
162
- private scrollListener;
163
- ngAfterViewInit(): void;
164
- ngOnDestroy(): void;
165
- private setupResizeObserver;
166
- private setupScrollListener;
167
- private updatePanelPosition;
168
- onDocumentClick(event: MouseEvent | TouchEvent): void;
169
- onDocumentTouchStart(event: TouchEvent): void;
170
- get displayValue(): string;
171
- toggleDropdown(): void;
172
- private scrollToSelected;
173
- selectOption(option: {
174
- label: string;
175
- value: unknown;
176
- }): void;
177
- static ɵfac: i0.ɵɵFactoryDeclaration<CustomSelectComponent, never>;
178
- static ɵcmp: i0.ɵɵComponentDeclaration<CustomSelectComponent, "ngxsmk-custom-select", never, { "options": { "alias": "options"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
179
- }
180
-
181
- declare class CalendarHeaderComponent {
182
- monthSelect?: CustomSelectComponent;
183
- yearSelect?: CustomSelectComponent;
184
- monthOptions: {
185
- label: string;
186
- value: number;
187
- }[];
188
- yearOptions: {
189
- label: string;
190
- value: number;
191
- }[];
192
- currentMonth: number;
193
- currentYear: number;
194
- disabled: boolean;
195
- isBackArrowDisabled: boolean;
196
- prevMonthAriaLabel: string;
197
- nextMonthAriaLabel: string;
198
- headerClass?: string;
199
- navPrevClass?: string;
200
- navNextClass?: string;
201
- currentYearChange: EventEmitter<number>;
202
- currentMonthChange: EventEmitter<number>;
203
- previousMonth: EventEmitter<void>;
204
- nextMonth: EventEmitter<void>;
205
- onMonthSelect(value: unknown): void;
206
- onYearSelect(value: unknown): void;
207
- static ɵfac: i0.ɵɵFactoryDeclaration<CalendarHeaderComponent, never>;
208
- static ɵcmp: i0.ɵɵComponentDeclaration<CalendarHeaderComponent, "ngxsmk-calendar-header", never, { "monthOptions": { "alias": "monthOptions"; "required": false; }; "yearOptions": { "alias": "yearOptions"; "required": false; }; "currentMonth": { "alias": "currentMonth"; "required": false; }; "currentYear": { "alias": "currentYear"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isBackArrowDisabled": { "alias": "isBackArrowDisabled"; "required": false; }; "prevMonthAriaLabel": { "alias": "prevMonthAriaLabel"; "required": false; }; "nextMonthAriaLabel": { "alias": "nextMonthAriaLabel"; "required": false; }; "headerClass": { "alias": "headerClass"; "required": false; }; "navPrevClass": { "alias": "navPrevClass"; "required": false; }; "navNextClass": { "alias": "navNextClass"; "required": false; }; }, { "currentYearChange": "currentYearChange"; "currentMonthChange": "currentMonthChange"; "previousMonth": "previousMonth"; "nextMonth": "nextMonth"; }, never, never, true, never>;
209
- }
210
-
211
- /**
212
- * Complete translations interface for the datepicker component
213
- */
214
- interface DatepickerTranslations {
215
- selectDate: string;
216
- selectTime: string;
217
- clear: string;
218
- close: string;
219
- today: string;
220
- selectEndDate: string;
221
- day: string;
222
- days: string;
223
- previousMonth: string;
224
- nextMonth: string;
225
- previousYear: string;
226
- nextYear: string;
227
- previousYears: string;
228
- nextYears: string;
229
- previousDecade: string;
230
- nextDecade: string;
231
- clearSelection: string;
232
- closeCalendar: string;
233
- closeCalendarOverlay: string;
234
- calendarFor: string;
235
- selectYear: string;
236
- selectDecade: string;
237
- datesSelected: string;
238
- timesSelected: string;
239
- time: string;
240
- startTime: string;
241
- endTime: string;
242
- from: string;
243
- to: string;
244
- holiday: string;
245
- month: string;
246
- year: string;
247
- decade: string;
248
- timeline: string;
249
- timeSlider: string;
250
- calendarOpened: string;
251
- calendarClosed: string;
252
- dateSelected: string;
253
- rangeSelected: string;
254
- monthChanged: string;
255
- yearChanged: string;
256
- calendarLoading: string;
257
- calendarReady: string;
258
- keyboardShortcuts: string;
259
- invalidDateFormat: string;
260
- dateBeforeMin: string;
261
- dateAfterMax: string;
262
- invalidDate: string;
263
- }
264
- /**
265
- * Partial translations - allows overriding only specific keys
266
- */
267
- type PartialDatepickerTranslations = Partial<DatepickerTranslations>;
268
-
269
- declare class NgxsmkDatepickerContentComponent {
270
- isCalendarVisible: boolean;
271
- isCalendarOpen: boolean;
272
- isInlineMode: boolean;
273
- shouldAppendToBody: boolean;
274
- theme: string;
275
- popoverId: string;
276
- classes: DatepickerClasses | undefined;
277
- timeOnly: boolean;
278
- showTime: boolean;
279
- isMobile: boolean;
280
- mobileModalStyle: string;
281
- align: string;
282
- ariaLabel: string;
283
- isCalendarOpening: boolean;
284
- loadingMessage: string;
285
- showRanges: boolean;
286
- rangesArray: {
287
- key: string;
288
- value: [Date, Date];
289
- }[];
290
- mode: 'single' | 'range' | 'multiple' | 'week' | 'month' | 'quarter' | 'year' | 'timeRange';
291
- disabled: boolean;
292
- calendarCount: number;
293
- calendarLayout: string;
294
- syncScrollEnabled: boolean;
295
- calendarMonths: {
296
- month: number;
297
- year: number;
298
- days: (Date | null)[];
299
- }[];
300
- weekDays: string[];
301
- selectedDate: Date | null;
302
- startDate: Date | null;
303
- endDate: Date | null;
304
- focusedDate: Date | null;
305
- today: Date;
306
- dateTemplate: TemplateRef<unknown> | null;
307
- calendarViewMode: string;
308
- monthOptions: {
309
- label: string;
310
- value: number;
311
- }[];
312
- currentMonth: number;
313
- yearOptions: {
314
- label: string;
315
- value: number;
316
- }[];
317
- currentYear: number;
318
- isBackArrowDisabled: boolean;
319
- prevMonthAriaLabel: string;
320
- nextMonthAriaLabel: string;
321
- yearGrid: number[];
322
- currentDecade: number;
323
- decadeGrid: number[];
324
- timelineStartDate: Date | null;
325
- timelineEndDate: Date | null;
326
- timelineMonths: Date[];
327
- minuteInterval: number;
328
- startTimeSlider: number;
329
- endTimeSlider: number;
330
- timeRangeMode: boolean;
331
- hourOptions: {
332
- label: string;
333
- value: number;
334
- }[];
335
- minuteOptions: {
336
- label: string;
337
- value: number;
338
- }[];
339
- secondOptions: {
340
- label: string;
341
- value: number;
342
- }[];
343
- ampmOptions: {
344
- label: string;
345
- value: boolean;
346
- }[];
347
- currentDisplayHour: number;
348
- currentMinute: number;
349
- currentSecond: number;
350
- isPm: boolean;
351
- showSeconds: boolean;
352
- use24Hour: boolean;
353
- startDisplayHour: number;
354
- startMinute: number;
355
- startSecond: number;
356
- startIsPm: boolean;
357
- endDisplayHour: number;
358
- endMinute: number;
359
- endSecond: number;
360
- endIsPm: boolean;
361
- clearAriaLabel: string;
362
- clearLabel: string;
363
- closeAriaLabel: string;
364
- closeLabel: string;
365
- translations: DatepickerTranslations | null;
366
- boundIsDateDisabled: (date: Date | null) => boolean;
367
- boundIsSameDay: (date1: Date | null, date2: Date | null) => boolean;
368
- boundIsHoliday: (date: Date | null) => boolean;
369
- boundIsMultipleSelected: (date: Date | null) => boolean;
370
- boundIsInRange: (date: Date | null) => boolean;
371
- boundIsPreviewInRange: (date: Date | null) => boolean;
372
- boundGetAriaLabel: (date: Date | null) => string;
373
- boundGetDayCellCustomClasses: (date: Date | null) => string | string[] | Set<string> | {
374
- [klass: string]: unknown;
375
- };
376
- boundGetDayCellTooltip: (date: Date | null) => string | null;
377
- boundFormatDayNumber: (date: Date | null) => string;
378
- getMonthYearLabel: (month: number, year: number) => string;
379
- getCalendarAriaLabelForMonth: (month: number, year: number) => string;
380
- isTimelineMonthSelected: (date: Date) => boolean;
381
- formatTimeSliderValue: (value: number) => string;
382
- backdropClick: EventEmitter<Event>;
383
- touchStartContainer: EventEmitter<TouchEvent>;
384
- touchMoveContainer: EventEmitter<TouchEvent>;
385
- touchEndContainer: EventEmitter<TouchEvent>;
386
- rangeSelect: EventEmitter<[Date, Date]>;
387
- previousMonth: EventEmitter<void>;
388
- nextMonth: EventEmitter<void>;
389
- currentMonthChange: EventEmitter<number>;
390
- currentYearChange: EventEmitter<number>;
391
- dateClick: EventEmitter<Date>;
392
- dateHover: EventEmitter<Date | null>;
393
- dateFocus: EventEmitter<Date>;
394
- swipeStart: EventEmitter<TouchEvent>;
395
- swipeMove: EventEmitter<TouchEvent>;
396
- swipeEnd: EventEmitter<TouchEvent>;
397
- touchStart: EventEmitter<{
398
- event: TouchEvent;
399
- day: Date | null;
400
- }>;
401
- touchMove: EventEmitter<TouchEvent>;
402
- touchEnd: EventEmitter<{
403
- event: TouchEvent;
404
- day: Date | null;
405
- }>;
406
- viewModeChange: EventEmitter<"year" | "month" | "decade" | "timeline" | "time-slider">;
407
- changeYear: EventEmitter<number>;
408
- yearClick: EventEmitter<number>;
409
- changeDecade: EventEmitter<number>;
410
- decadeClick: EventEmitter<number>;
411
- timelineZoomOut: EventEmitter<void>;
412
- timelineZoomIn: EventEmitter<void>;
413
- timelineMonthClick: EventEmitter<Date>;
414
- startTimeSliderChange: EventEmitter<number>;
415
- endTimeSliderChange: EventEmitter<number>;
416
- currentDisplayHourChange: EventEmitter<number>;
417
- currentMinuteChange: EventEmitter<number>;
418
- currentSecondChange: EventEmitter<number>;
419
- isPmChange: EventEmitter<boolean>;
420
- timeChange: EventEmitter<void>;
421
- startDisplayHourChange: EventEmitter<number>;
422
- startMinuteChange: EventEmitter<number>;
423
- startSecondChange: EventEmitter<number>;
424
- startIsPmChange: EventEmitter<boolean>;
425
- endDisplayHourChange: EventEmitter<number>;
426
- endMinuteChange: EventEmitter<number>;
427
- endSecondChange: EventEmitter<number>;
428
- endIsPmChange: EventEmitter<boolean>;
429
- timeRangeChange: EventEmitter<void>;
430
- clearValue: EventEmitter<MouseEvent>;
431
- closeCalendar: EventEmitter<void>;
432
- header?: CalendarHeaderComponent;
433
- popoverContainer?: ElementRef<HTMLElement>;
434
- timelineContainer?: ElementRef<HTMLElement>;
435
- closeAllSelects(): void;
436
- onTimelineMonthClick(month: Date, event: MouseEvent): void;
437
- onTimelineMonthSpace(month: Date, event: Event): void;
438
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkDatepickerContentComponent, never>;
439
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxsmkDatepickerContentComponent, "ngxsmk-datepicker-content", never, { "isCalendarVisible": { "alias": "isCalendarVisible"; "required": false; }; "isCalendarOpen": { "alias": "isCalendarOpen"; "required": false; }; "isInlineMode": { "alias": "isInlineMode"; "required": false; }; "shouldAppendToBody": { "alias": "shouldAppendToBody"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "popoverId": { "alias": "popoverId"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; "timeOnly": { "alias": "timeOnly"; "required": false; }; "showTime": { "alias": "showTime"; "required": false; }; "isMobile": { "alias": "isMobile"; "required": false; }; "mobileModalStyle": { "alias": "mobileModalStyle"; "required": false; }; "align": { "alias": "align"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "isCalendarOpening": { "alias": "isCalendarOpening"; "required": false; }; "loadingMessage": { "alias": "loadingMessage"; "required": false; }; "showRanges": { "alias": "showRanges"; "required": false; }; "rangesArray": { "alias": "rangesArray"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "calendarCount": { "alias": "calendarCount"; "required": false; }; "calendarLayout": { "alias": "calendarLayout"; "required": false; }; "syncScrollEnabled": { "alias": "syncScrollEnabled"; "required": false; }; "calendarMonths": { "alias": "calendarMonths"; "required": false; }; "weekDays": { "alias": "weekDays"; "required": false; }; "selectedDate": { "alias": "selectedDate"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "endDate": { "alias": "endDate"; "required": false; }; "focusedDate": { "alias": "focusedDate"; "required": false; }; "today": { "alias": "today"; "required": false; }; "dateTemplate": { "alias": "dateTemplate"; "required": false; }; "calendarViewMode": { "alias": "calendarViewMode"; "required": false; }; "monthOptions": { "alias": "monthOptions"; "required": false; }; "currentMonth": { "alias": "currentMonth"; "required": false; }; "yearOptions": { "alias": "yearOptions"; "required": false; }; "currentYear": { "alias": "currentYear"; "required": false; }; "isBackArrowDisabled": { "alias": "isBackArrowDisabled"; "required": false; }; "prevMonthAriaLabel": { "alias": "prevMonthAriaLabel"; "required": false; }; "nextMonthAriaLabel": { "alias": "nextMonthAriaLabel"; "required": false; }; "yearGrid": { "alias": "yearGrid"; "required": false; }; "currentDecade": { "alias": "currentDecade"; "required": false; }; "decadeGrid": { "alias": "decadeGrid"; "required": false; }; "timelineStartDate": { "alias": "timelineStartDate"; "required": false; }; "timelineEndDate": { "alias": "timelineEndDate"; "required": false; }; "timelineMonths": { "alias": "timelineMonths"; "required": false; }; "minuteInterval": { "alias": "minuteInterval"; "required": false; }; "startTimeSlider": { "alias": "startTimeSlider"; "required": false; }; "endTimeSlider": { "alias": "endTimeSlider"; "required": false; }; "timeRangeMode": { "alias": "timeRangeMode"; "required": false; }; "hourOptions": { "alias": "hourOptions"; "required": false; }; "minuteOptions": { "alias": "minuteOptions"; "required": false; }; "secondOptions": { "alias": "secondOptions"; "required": false; }; "ampmOptions": { "alias": "ampmOptions"; "required": false; }; "currentDisplayHour": { "alias": "currentDisplayHour"; "required": false; }; "currentMinute": { "alias": "currentMinute"; "required": false; }; "currentSecond": { "alias": "currentSecond"; "required": false; }; "isPm": { "alias": "isPm"; "required": false; }; "showSeconds": { "alias": "showSeconds"; "required": false; }; "use24Hour": { "alias": "use24Hour"; "required": false; }; "startDisplayHour": { "alias": "startDisplayHour"; "required": false; }; "startMinute": { "alias": "startMinute"; "required": false; }; "startSecond": { "alias": "startSecond"; "required": false; }; "startIsPm": { "alias": "startIsPm"; "required": false; }; "endDisplayHour": { "alias": "endDisplayHour"; "required": false; }; "endMinute": { "alias": "endMinute"; "required": false; }; "endSecond": { "alias": "endSecond"; "required": false; }; "endIsPm": { "alias": "endIsPm"; "required": false; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; }; "clearLabel": { "alias": "clearLabel"; "required": false; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "translations": { "alias": "translations"; "required": false; }; "boundIsDateDisabled": { "alias": "boundIsDateDisabled"; "required": false; }; "boundIsSameDay": { "alias": "boundIsSameDay"; "required": false; }; "boundIsHoliday": { "alias": "boundIsHoliday"; "required": false; }; "boundIsMultipleSelected": { "alias": "boundIsMultipleSelected"; "required": false; }; "boundIsInRange": { "alias": "boundIsInRange"; "required": false; }; "boundIsPreviewInRange": { "alias": "boundIsPreviewInRange"; "required": false; }; "boundGetAriaLabel": { "alias": "boundGetAriaLabel"; "required": false; }; "boundGetDayCellCustomClasses": { "alias": "boundGetDayCellCustomClasses"; "required": false; }; "boundGetDayCellTooltip": { "alias": "boundGetDayCellTooltip"; "required": false; }; "boundFormatDayNumber": { "alias": "boundFormatDayNumber"; "required": false; }; "getMonthYearLabel": { "alias": "getMonthYearLabel"; "required": false; }; "getCalendarAriaLabelForMonth": { "alias": "getCalendarAriaLabelForMonth"; "required": false; }; "isTimelineMonthSelected": { "alias": "isTimelineMonthSelected"; "required": false; }; "formatTimeSliderValue": { "alias": "formatTimeSliderValue"; "required": false; }; }, { "backdropClick": "backdropClick"; "touchStartContainer": "touchStartContainer"; "touchMoveContainer": "touchMoveContainer"; "touchEndContainer": "touchEndContainer"; "rangeSelect": "rangeSelect"; "previousMonth": "previousMonth"; "nextMonth": "nextMonth"; "currentMonthChange": "currentMonthChange"; "currentYearChange": "currentYearChange"; "dateClick": "dateClick"; "dateHover": "dateHover"; "dateFocus": "dateFocus"; "swipeStart": "swipeStart"; "swipeMove": "swipeMove"; "swipeEnd": "swipeEnd"; "touchStart": "touchStart"; "touchMove": "touchMove"; "touchEnd": "touchEnd"; "viewModeChange": "viewModeChange"; "changeYear": "changeYear"; "yearClick": "yearClick"; "changeDecade": "changeDecade"; "decadeClick": "decadeClick"; "timelineZoomOut": "timelineZoomOut"; "timelineZoomIn": "timelineZoomIn"; "timelineMonthClick": "timelineMonthClick"; "startTimeSliderChange": "startTimeSliderChange"; "endTimeSliderChange": "endTimeSliderChange"; "currentDisplayHourChange": "currentDisplayHourChange"; "currentMinuteChange": "currentMinuteChange"; "currentSecondChange": "currentSecondChange"; "isPmChange": "isPmChange"; "timeChange": "timeChange"; "startDisplayHourChange": "startDisplayHourChange"; "startMinuteChange": "startMinuteChange"; "startSecondChange": "startSecondChange"; "startIsPmChange": "startIsPmChange"; "endDisplayHourChange": "endDisplayHourChange"; "endMinuteChange": "endMinuteChange"; "endSecondChange": "endSecondChange"; "endIsPmChange": "endIsPmChange"; "timeRangeChange": "timeRangeChange"; "clearValue": "clearValue"; "closeCalendar": "closeCalendar"; }, never, never, true, never>;
440
- }
441
-
442
- interface DayCellRenderHook {
443
- getDayCellClasses?(date: Date, isSelected: boolean, isDisabled: boolean, isToday: boolean, isHoliday: boolean): string[];
444
- getDayCellTooltip?(date: Date, holidayLabel: string | null): string | null;
445
- formatDayNumber?(date: Date): string;
446
- }
447
- interface ValidationHook {
448
- validateDate?(date: Date, currentValue: DatepickerValue, mode: 'single' | 'range' | 'multiple' | 'week' | 'month' | 'quarter' | 'year' | 'timeRange'): boolean;
449
- validateRange?(startDate: Date, endDate: Date): boolean;
450
- getValidationError?(date: Date): string | null;
451
- }
452
- interface KeyboardShortcutHook {
453
- handleShortcut?(event: KeyboardEvent, context: KeyboardShortcutContext): boolean;
454
- getShortcutHelp?(): KeyboardShortcutHelp[];
455
- }
456
- interface KeyboardShortcutContext {
457
- currentDate: Date;
458
- selectedDate: Date | null;
459
- startDate: Date | null;
460
- endDate: Date | null;
461
- selectedDates: Date[];
462
- mode: 'single' | 'range' | 'multiple' | 'week' | 'month' | 'quarter' | 'year' | 'timeRange';
463
- focusedDate: Date | null;
464
- isCalendarOpen: boolean;
465
- }
466
- interface KeyboardShortcutHelp {
467
- key: string;
468
- description: string;
469
- modifiers?: string[];
470
- }
471
- interface DateFormatHook {
472
- formatDisplayValue?(value: DatepickerValue, mode: 'single' | 'range' | 'multiple' | 'week' | 'month' | 'quarter' | 'year' | 'timeRange'): string;
473
- formatAriaLabel?(date: Date): string;
474
- }
475
- interface EventHook {
476
- beforeDateSelect?(date: Date, currentValue: DatepickerValue): boolean;
477
- afterDateSelect?(date: Date, newValue: DatepickerValue): void;
478
- onCalendarOpen?(): void;
479
- onCalendarClose?(): void;
480
- }
481
- interface DatepickerHooks extends DayCellRenderHook, ValidationHook, KeyboardShortcutHook, DateFormatHook, EventHook {
482
- }
483
-
484
- /**
485
- * Date Adapter Interface
486
- *
487
- * Allows consumers to swap formatting/parsing logic with external date libraries
488
- * like date-fns, dayjs, or Luxon.
489
- */
490
- interface DateAdapter {
491
- /**
492
- * Parse a date from a string or value
493
- * @param value - The value to parse (string, Date, or library-specific type)
494
- * @param onError - Optional callback for error handling. Called when parsing fails.
495
- * @returns A Date object or null if parsing fails
496
- */
497
- parse(value: string | Date | number | unknown, onError?: (error: Error) => void): Date | null;
498
- /**
499
- * Format a date to a string
500
- * @param date - The date to format
501
- * @param format - Format string (library-specific)
502
- * @param locale - Locale string (e.g., 'en-US')
503
- * @returns Formatted date string
504
- */
505
- format(date: Date, format?: string, locale?: string): string;
506
- /**
507
- * Check if a value is a valid date
508
- * @param value - The value to check
509
- * @returns True if the value is a valid date
510
- */
511
- isValid(value: string | Date | number | unknown): boolean;
512
- /**
513
- * Get the start of day for a date
514
- * @param date - The date
515
- * @returns Date at start of day
516
- */
517
- startOfDay(date: Date): Date;
518
- /**
519
- * Get the end of day for a date
520
- * @param date - The date
521
- * @returns Date at end of day
522
- */
523
- endOfDay(date: Date): Date;
524
- /**
525
- * Add months to a date
526
- * @param date - The date
527
- * @param months - Number of months to add
528
- * @returns New date with months added
529
- */
530
- addMonths(date: Date, months: number): Date;
531
- /**
532
- * Add days to a date
533
- * @param date - The date
534
- * @param days - Number of days to add
535
- * @returns New date with days added
536
- */
537
- addDays(date: Date, days: number): Date;
538
- /**
539
- * Check if two dates are the same day
540
- * @param date1 - First date
541
- * @param date2 - Second date
542
- * @returns True if dates are the same day
543
- */
544
- isSameDay(date1: Date | null, date2: Date | null): boolean;
545
- }
546
- /**
547
- * Default Date Adapter using native JavaScript Date
548
- */
549
- declare class NativeDateAdapter implements DateAdapter {
550
- parse(value: string | Date | number | unknown, onError?: (error: Error) => void): Date | null;
551
- format(date: Date, _format?: string, locale?: string): string;
552
- isValid(value: string | Date | number | unknown): boolean;
553
- startOfDay(date: Date): Date;
554
- endOfDay(date: Date): Date;
555
- addMonths(date: Date, months: number): Date;
556
- addDays(date: Date, days: number): Date;
557
- isSameDay(date1: Date | null, date2: Date | null): boolean;
558
- }
559
-
560
- interface DatepickerConfig {
561
- weekStart?: number | null;
562
- minuteInterval?: number;
563
- holidayProvider?: HolidayProvider | null;
564
- yearRange?: number;
565
- locale?: string;
566
- timezone?: string;
567
- minDate?: Date | string | null;
568
- maxDate?: Date | string | null;
569
- dateAdapter?: DateAdapter;
570
- animations?: AnimationConfig;
571
- autoDetectMobile?: boolean;
572
- mobileModalStyle?: 'bottom-sheet' | 'center' | 'fullscreen';
573
- }
574
- interface AnimationConfig {
575
- enabled?: boolean;
576
- duration?: number;
577
- easing?: string;
578
- property?: string;
579
- respectReducedMotion?: boolean;
580
- }
581
- declare const DEFAULT_ANIMATION_CONFIG: Required<AnimationConfig>;
582
- declare const DATEPICKER_CONFIG: InjectionToken<DatepickerConfig>;
583
- declare const DEFAULT_DATEPICKER_CONFIG: DatepickerConfig;
584
- declare function provideDatepickerConfig(config: DatepickerConfig): {
585
- provide: InjectionToken<DatepickerConfig>;
586
- useValue: {
587
- weekStart?: number | null;
588
- minuteInterval?: number;
589
- holidayProvider?: HolidayProvider | null;
590
- yearRange?: number;
591
- locale?: string;
592
- timezone?: string;
593
- minDate?: Date | string | null;
594
- maxDate?: Date | string | null;
595
- dateAdapter?: DateAdapter;
596
- animations?: AnimationConfig;
597
- autoDetectMobile?: boolean;
598
- mobileModalStyle?: "bottom-sheet" | "center" | "fullscreen";
599
- };
600
- };
601
-
602
- interface ValidationError {
603
- kind: string;
604
- message?: string;
605
- }
606
- type SignalFormFieldConfig = {
607
- value?: DatepickerValue | string | (() => DatepickerValue | string) | {
608
- (): DatepickerValue | string;
609
- } | Signal<DatepickerValue | string>;
610
- disabled?: boolean | (() => boolean) | {
611
- (): boolean;
612
- } | Signal<boolean>;
613
- required?: boolean | (() => boolean) | {
614
- (): boolean;
615
- } | Signal<boolean>;
616
- errors?: ValidationError[] | (() => ValidationError[]) | {
617
- (): ValidationError[];
618
- } | Signal<ValidationError[]>;
619
- valid?: boolean | (() => boolean) | {
620
- (): boolean;
621
- } | Signal<boolean>;
622
- invalid?: boolean | (() => boolean) | {
623
- (): boolean;
624
- } | Signal<boolean>;
625
- touched?: boolean | (() => boolean) | {
626
- (): boolean;
627
- } | Signal<boolean>;
628
- setValue?: (value: DatepickerValue | string) => void;
629
- updateValue?: (updater: () => DatepickerValue | string) => void;
630
- markAsDirty?: () => void;
631
- markAsTouched?: () => void;
632
- };
633
- type SignalFormField = unknown;
634
- interface FieldSyncCallbacks {
635
- onValueChanged: (value: DatepickerValue) => void;
636
- onDisabledChanged: (disabled: boolean) => void;
637
- onRequiredChanged?: (required: boolean) => void;
638
- onErrorStateChanged?: (hasError: boolean) => void;
639
- onSyncError: (error: unknown) => void;
640
- normalizeValue: (value: unknown) => DatepickerValue;
641
- isValueEqual: (val1: DatepickerValue, val2: DatepickerValue) => boolean;
642
- onCalendarGenerated?: () => void;
643
- onStateChanged?: () => void;
644
- }
645
- declare class FieldSyncService {
646
- private _fieldEffectRef;
647
- private _lastKnownFieldValue;
648
- private _isUpdatingFromInternal;
649
- private readonly injector;
650
- private readFieldValue;
651
- private readDisabledState;
652
- private readFieldErrors;
653
- private readRequiredState;
654
- private hasValidationErrors;
655
- private resolveField;
656
- setupFieldSync(fieldInput: SignalFormField, callbacks: FieldSyncCallbacks): EffectRef | null;
657
- syncFieldValue(fieldInput: SignalFormField | Signal<SignalFormField> | (() => unknown) | unknown, callbacks: FieldSyncCallbacks): boolean;
658
- updateFieldFromInternal(value: DatepickerValue, fieldInput: SignalFormField | Signal<SignalFormField> | (() => unknown) | unknown): void;
659
- getLastKnownValue(): DatepickerValue | undefined;
660
- markAsTouched(fieldInput: SignalFormField | Signal<SignalFormField> | (() => unknown) | unknown): void;
661
- cleanup(): void;
662
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldSyncService, never>;
663
- static ɵprov: i0.ɵɵInjectableDeclaration<FieldSyncService>;
664
- }
665
-
666
- interface TranslationService {
667
- translate(key: string, params?: Record<string, string | number>): string;
668
- getCurrentLocale(): string;
669
- }
670
- declare class DefaultTranslationService implements TranslationService {
671
- private translations;
672
- private locale;
673
- private readonly translationRegistry;
674
- constructor();
675
- initialize(translations: DatepickerTranslations, locale?: string): void;
676
- initializeFromLocale(locale: string): void;
677
- translate(key: string, params?: Record<string, string | number>): string;
678
- getCurrentLocale(): string;
679
- static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTranslationService, never>;
680
- static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTranslationService>;
681
- }
682
-
683
- interface TouchGestureState {
684
- touchStartTime: number;
685
- touchStartElement: EventTarget | null;
686
- dateCellTouchStartTime: number;
687
- dateCellTouchStartDate: Date | null;
688
- dateCellTouchStartX: number;
689
- dateCellTouchStartY: number;
690
- isDateCellTouching: boolean;
691
- lastDateCellTouchDate: Date | null;
692
- dateCellTouchHandled: boolean;
693
- calendarSwipeStartX: number;
694
- calendarSwipeStartY: number;
695
- calendarSwipeStartTime: number;
696
- isCalendarSwiping: boolean;
697
- hoveredDate: Date | null;
698
- }
699
-
700
- /** Recurring date pattern configuration for disabled dates. */
701
- type RecurringPatternInput = {
702
- pattern: 'daily' | 'weekly' | 'monthly' | 'yearly' | 'weekdays' | 'weekends';
703
- startDate: Date;
704
- endDate?: Date;
705
- dayOfWeek?: number;
706
- dayOfMonth?: number;
707
- interval?: number;
708
- } | null;
709
- /**
710
- * Interface for Angular Material Form Field Control compatibility.
711
- * We define it here to avoid a direct dependency on @angular/material.
712
- */
713
- interface MatFormFieldControlMock<T> {
714
- value: T | null;
715
- stateChanges: Subject<void>;
716
- id: string;
717
- placeholder: string;
718
- ngControl: NgControl | null;
719
- focused: boolean;
720
- empty: boolean;
721
- shouldLabelFloat: boolean;
722
- required: boolean;
723
- disabled: boolean;
724
- errorState: boolean;
725
- controlType?: string;
726
- autofilled?: boolean;
727
- userAriaDescribedBy?: string;
728
- setDescribedByIds(ids: string[]): void;
729
- onContainerClick(event: MouseEvent): void;
730
- }
731
- declare class NgxsmkDatepickerComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit, ControlValueAccessor, MatFormFieldControlMock<DatepickerValue> {
732
- private static _idCounter;
733
- private static _allInstances;
734
- private static _materialSupportRegistered;
735
- static withMaterialSupport(matFormFieldControlToken: any): void;
736
- _uniqueId: string;
737
- mode: 'single' | 'range' | 'multiple' | 'week' | 'month' | 'quarter' | 'year' | 'timeRange';
738
- calendarViewMode: 'month' | 'year' | 'decade' | 'timeline' | 'time-slider';
739
- isInvalidDate: (date: Date) => boolean;
740
- showRanges: boolean;
741
- showTime: boolean;
742
- timeOnly: boolean;
743
- timeRangeMode: boolean;
744
- showCalendarButton: boolean;
745
- minuteInterval: number;
746
- use24Hour: boolean;
747
- secondInterval: number;
748
- showSeconds: boolean;
749
- holidayProvider: HolidayProvider | null;
750
- disableHolidays: boolean;
751
- disabledDates: (string | Date)[];
752
- disabledRanges: Array<{
753
- start: Date | string;
754
- end: Date | string;
755
- }>;
756
- recurringPattern?: RecurringPatternInput;
757
- dateTemplate: TemplateRef<unknown> | null;
758
- private _placeholder;
759
- set placeholder(value: string | null);
760
- get placeholder(): string;
761
- inline: boolean | 'always' | 'auto';
762
- private _inputId;
763
- set inputId(value: string);
764
- get inputId(): string;
765
- private _name;
766
- set name(value: string);
767
- get name(): string;
768
- private _autocomplete;
769
- set autocomplete(value: string);
770
- get autocomplete(): string;
771
- translations?: PartialDatepickerTranslations;
772
- translationService?: TranslationService;
773
- clearLabel: string;
774
- closeLabel: string;
775
- prevMonthAriaLabel: string;
776
- nextMonthAriaLabel: string;
777
- clearAriaLabel: string;
778
- closeAriaLabel: string;
779
- get _clearLabel(): string;
780
- get _closeLabel(): string;
781
- get _prevMonthAriaLabel(): string;
782
- get _nextMonthAriaLabel(): string;
783
- get _clearAriaLabel(): string;
784
- get _closeAriaLabel(): string;
785
- weekStart: number | null;
786
- private _yearRange;
787
- set yearRange(value: number);
788
- get yearRange(): number;
789
- timezone?: string;
790
- hooks: DatepickerHooks | null;
791
- enableKeyboardShortcuts: boolean;
792
- customShortcuts: {
793
- [key: string]: (context: KeyboardShortcutContext) => boolean;
794
- } | null;
795
- autoApplyClose: boolean;
796
- displayFormat?: string;
797
- allowTyping: boolean;
798
- private _calendarCount;
799
- set calendarCount(value: number);
800
- get calendarCount(): number;
801
- calendarLayout: 'horizontal' | 'vertical' | 'auto';
802
- defaultMonthOffset: number;
803
- /**
804
- * Configuration for synchronous scrolling in multi-calendar mode.
805
- * Keeps calendars in sync by enforcing consistent month offsets across visible calendars.
806
- *
807
- * @example
808
- * ```typescript
809
- * // Keep calendars exactly 1 month apart
810
- * <ngxsmk-datepicker
811
- * [calendarCount]="2"
812
- * [syncScroll]="{ enabled: true, monthGap: 1 }">
813
- * </ngxsmk-datepicker>
814
- *
815
- * // Disable sync scroll (independent navigation)
816
- * <ngxsmk-datepicker
817
- * [calendarCount]="3"
818
- * [syncScroll]="{ enabled: false }">
819
- * </ngxsmk-datepicker>
820
- * ```
821
- */
822
- syncScroll: {
823
- enabled?: boolean;
824
- monthGap?: number;
825
- };
826
- align: 'left' | 'right' | 'center';
827
- useNativePicker: boolean;
828
- enableHapticFeedback: boolean;
829
- mobileModalStyle: 'bottom-sheet' | 'center' | 'fullscreen';
830
- mobileTimePickerStyle: 'wheel' | 'slider' | 'native';
831
- enablePullToRefresh: boolean;
832
- mobileTheme: 'compact' | 'comfortable' | 'spacious';
833
- enableVoiceInput: boolean;
834
- autoDetectMobile: boolean;
835
- disableFocusTrap: boolean;
836
- appendToBody: boolean;
837
- private appRef;
838
- private document;
839
- portalTemplate: TemplateRef<unknown>;
840
- private portalViewRef;
841
- get _shouldAppendToBody(): boolean;
842
- /**
843
- * Detects if the datepicker is rendered inside a modal/dialog so the calendar
844
- * can be appended to body and positioned above the modal.
845
- */
846
- private isInsideModal;
847
- private _isCalendarOpen;
848
- get isCalendarOpen(): boolean;
849
- set isCalendarOpen(value: boolean);
850
- private isOpeningCalendar;
851
- /** Public getter for template: true while calendar is opening/generating (loading state). */
852
- get isCalendarOpening(): boolean;
853
- /** Returns translated "Loading calendar..." for template and ARIA. */
854
- getCalendarLoadingMessage(): string;
855
- private openCalendarTimeoutId;
856
- private lastToggleTime;
857
- private touchStartTime;
858
- private touchStartElement;
859
- private pointerDownTime;
860
- private isPointerEvent;
861
- private previousFocusElement;
862
- private _value;
863
- set value(val: DatepickerValue);
864
- get value(): DatepickerValue;
865
- private _field;
866
- private _fieldEffectRef;
867
- set field(field: SignalFormField);
868
- get field(): SignalFormField;
869
- private syncFieldValue;
870
- private _startAtDate;
871
- set startAt(value: DateInput | null);
872
- private _locale;
873
- set locale(value: string);
874
- get locale(): string;
875
- theme: 'light' | 'dark';
876
- get isDarkMode(): boolean;
877
- private _dateFormatPattern;
878
- private customDateFormatService;
879
- set dateFormatPattern(value: string | null);
880
- get dateFormatPattern(): string | null;
881
- private _animationConfig;
882
- /**
883
- * Animation configuration allowing customization of animation duration, easing, and reduction.
884
- * Supports prefers-reduced-motion accessibility preference automatically.
885
- *
886
- * @example
887
- * ```typescript
888
- * // Disable all animations
889
- * <ngxsmk-datepicker [animationConfig]="{ enabled: false }"></ngxsmk-datepicker>
890
- *
891
- * // Custom animation duration and easing
892
- * <ngxsmk-datepicker [animationConfig]="{ duration: 300, easing: 'cubic-bezier(0.34, 1.56, 0.64, 1)' }"></ngxsmk-datepicker>
893
- *
894
- * // Disable specific animation properties
895
- * <ngxsmk-datepicker [animationConfig]="{ property: 'opacity' }"></ngxsmk-datepicker>
896
- * ```
897
- */
898
- set animationConfig(value: AnimationConfig | null);
899
- get animationConfig(): AnimationConfig | null;
900
- private _rtl;
901
- set rtl(value: boolean | null);
902
- get rtl(): boolean | null;
903
- get isRtl(): boolean;
904
- get rtlClass(): boolean;
905
- classes?: DatepickerClasses | undefined;
906
- private onChange;
907
- private onTouched;
908
- disabled: boolean;
909
- set disabledState(isDisabled: boolean);
910
- /**
911
- * Subject used for Material Form Field integration.
912
- * Emits when the component's state changes (disabled, required, error state, etc.)
913
- *
914
- * @remarks
915
- * This Subject is required for Angular Material's form field control interface.
916
- * It allows Material form fields to track state changes and update their appearance
917
- * accordingly (e.g., showing error states, floating labels, etc.).
918
- *
919
- * The Subject is properly cleaned up in ngOnDestroy() to prevent memory leaks.
920
- * It's marked as readonly to prevent external code from reassigning it.
921
- */
922
- readonly stateChanges: Subject<void>;
923
- private _focused;
924
- private _required;
925
- private _errorState;
926
- get focused(): boolean;
927
- get empty(): boolean;
928
- get shouldLabelFloat(): boolean;
929
- get required(): boolean;
930
- set required(value: boolean);
931
- get errorState(): boolean;
932
- set errorState(value: boolean);
933
- get controlType(): string;
934
- get autofilled(): boolean;
935
- get id(): string;
936
- get describedBy(): string;
937
- /**
938
- * Aria describedby ID provided by the user or the parent form field.
939
- * Required for Angular Material form field control interface.
940
- */
941
- userAriaDescribedBy: string;
942
- setDescribedByIds(ids: string[]): void;
943
- onContainerClick(_event: MouseEvent): void;
944
- valueChange: EventEmitter<DatepickerValue>;
945
- action: EventEmitter<{
946
- type: string;
947
- payload?: unknown;
948
- }>;
949
- /** Emitted when validation fails (e.g. invalid typed date, date before min, after max). Message is translated. */
950
- validationError: EventEmitter<{
951
- code: string;
952
- message: string;
953
- }>;
954
- private _validationErrorMessage;
955
- /** User-facing validation error message when set (e.g. from typed input or min/max). */
956
- get validationErrorMessage(): string | null;
957
- private setValidationError;
958
- private clearValidationError;
959
- private _minDate;
960
- set minDate(value: DateInput | null);
961
- get minDate(): DateInput | null;
962
- private _maxDate;
963
- set maxDate(value: DateInput | null);
964
- get maxDate(): DateInput | null;
965
- private _ranges;
966
- set ranges(value: DateRange | null);
967
- currentDate: Date;
968
- daysInMonth: (Date | null)[];
969
- multiCalendarMonths: Array<{
970
- month: number;
971
- year: number;
972
- days: (Date | null)[];
973
- }>;
974
- /**
975
- * LRU (Least Recently Used) cache for calendar month generation.
976
- * Caches generated month arrays to avoid recalculating the same months.
977
- *
978
- * @remarks
979
- * Performance characteristics:
980
- * - Calendar generation: O(1) per month when cached
981
- * - Cache lookup: O(1) average case
982
- * - Cache eviction: O(n) where n = cache size (only when cache is full)
983
- *
984
- * The cache automatically evicts the least recently used entry when it reaches
985
- * MAX_CACHE_SIZE to prevent unbounded memory growth. This is especially important
986
- * for applications with many datepicker instances or long-running sessions.
987
- */
988
- /**
989
- * Maximum number of months to cache before evicting LRU entries.
990
- * Now managed by CalendarGenerationService.
991
- */
992
- weekDays: string[];
993
- readonly today: Date;
994
- selectedDate: Date | null;
995
- selectedDates: Date[];
996
- startDate: Date | null;
997
- endDate: Date | null;
998
- hoveredDate: Date | null;
999
- rangesArray: {
1000
- key: string;
1001
- value: [Date, Date];
1002
- }[];
1003
- protected touchState: TouchGestureState;
1004
- private dateCellTouchHandledTime;
1005
- private touchHandledTimeout;
1006
- private activeTimeouts;
1007
- private activeAnimationFrames;
1008
- private fieldSyncTimeoutId;
1009
- private touchListenersSetup;
1010
- private touchListenersAttached;
1011
- private bottomSheetSwipeStartY;
1012
- private bottomSheetSwipeCurrentY;
1013
- private isBottomSheetSwiping;
1014
- private bottomSheetSwipeThreshold;
1015
- private readonly SWIPE_THRESHOLD;
1016
- private readonly SWIPE_TIME_THRESHOLD;
1017
- private _currentMonth;
1018
- _currentYear: number;
1019
- _currentDecade: number;
1020
- monthOptions: i0.Signal<{
1021
- label: string;
1022
- value: number;
1023
- }[]>;
1024
- yearOptions: i0.Signal<{
1025
- label: string;
1026
- value: number;
1027
- }[]>;
1028
- decadeOptions: {
1029
- label: string;
1030
- value: number;
1031
- }[];
1032
- yearGrid: number[];
1033
- hourOptions: {
1034
- label: string;
1035
- value: number;
1036
- }[];
1037
- minuteOptions: {
1038
- label: string;
1039
- value: number;
1040
- }[];
1041
- secondOptions: {
1042
- label: string;
1043
- value: number;
1044
- }[];
1045
- decadeGrid: number[];
1046
- private firstDayOfWeek;
1047
- currentHour: number;
1048
- currentMinute: number;
1049
- currentSecond: number;
1050
- currentDisplayHour: number;
1051
- isPm: boolean;
1052
- startHour: number;
1053
- startMinute: number;
1054
- startSecond: number;
1055
- startDisplayHour: number;
1056
- startIsPm: boolean;
1057
- endHour: number;
1058
- endMinute: number;
1059
- endSecond: number;
1060
- endDisplayHour: number;
1061
- endIsPm: boolean;
1062
- ampmOptions: {
1063
- label: string;
1064
- value: boolean;
1065
- }[];
1066
- timelineMonths: Date[];
1067
- timelineStartDate: Date;
1068
- timelineEndDate: Date;
1069
- private timelineZoomLevel;
1070
- startTimeSlider: number;
1071
- endTimeSlider: number;
1072
- private readonly elementRef;
1073
- private readonly cdr;
1074
- private readonly platformId;
1075
- private readonly globalConfig;
1076
- private readonly fieldSyncService;
1077
- private readonly localeRegistry;
1078
- private readonly translationRegistry;
1079
- private readonly focusTrapService;
1080
- private readonly ariaLiveService;
1081
- private readonly hapticFeedbackService;
1082
- private readonly calendarGenerationService;
1083
- private readonly parsingService;
1084
- private readonly touchService;
1085
- private readonly popoverPositioningService;
1086
- readonly ngControl: NgControl | null;
1087
- private readonly isBrowser;
1088
- private readonly dateComparator;
1089
- constructor();
1090
- typedInputValue: string;
1091
- private isTyping;
1092
- popoverContainer?: ElementRef<HTMLElement>;
1093
- readonly popoverId: string;
1094
- datepickerInput?: NgxsmkDatepickerInputComponent;
1095
- datepickerContent?: NgxsmkDatepickerContentComponent;
1096
- private focusTrapCleanup;
1097
- _translations: DatepickerTranslations | null;
1098
- private _translationService;
1099
- private _changeDetectionScheduled;
1100
- /**
1101
- * Schedules change detection to run in the next microtask.
1102
- * Prevents multiple change detection cycles from being scheduled simultaneously.
1103
- *
1104
- * @remarks
1105
- * This method is essential for zoneless compatibility. When Zone.js is not present,
1106
- * Angular's automatic change detection doesn't run, so components using OnPush
1107
- * strategy must manually trigger change detection when state changes.
1108
- *
1109
- * The debouncing mechanism prevents excessive change detection cycles when multiple
1110
- * state changes occur in rapid succession (e.g., during user interactions or async
1111
- * operations). Only one change detection cycle is scheduled per microtask queue.
1112
- *
1113
- * This pattern is compatible with both Zone.js and zoneless Angular applications.
1114
- */
1115
- private scheduleChangeDetection;
1116
- /**
1117
- * Creates a tracked setTimeout that is automatically cleaned up on component destroy.
1118
- * All timeouts created through this method are stored in activeTimeouts for proper cleanup.
1119
- *
1120
- * @param callback - Function to execute after delay
1121
- * @param delay - Delay in milliseconds
1122
- * @returns Timeout ID that can be used with clearTimeout
1123
- */
1124
- private trackedSetTimeout;
1125
- /**
1126
- * Creates a tracked requestAnimationFrame that is automatically cancelled on component destroy.
1127
- * All animation frames created through this method are stored in activeAnimationFrames for proper cleanup.
1128
- *
1129
- * @param callback - Function to execute on next animation frame
1130
- * @returns Animation frame ID that can be used with cancelAnimationFrame
1131
- */
1132
- private trackedRequestAnimationFrame;
1133
- /**
1134
- * Executes a callback after two animation frames, ensuring DOM updates are complete.
1135
- * Useful for operations that need to run after Angular's change detection and browser rendering.
1136
- *
1137
- * @param callback - Function to execute after double animation frame
1138
- */
1139
- private trackedDoubleRequestAnimationFrame;
1140
- /**
1141
- * Clears all active timeouts. Used when locale or weekStart changes
1142
- * to cancel any pending operations that might be invalidated by the change.
1143
- */
1144
- private clearActiveTimeouts;
1145
- /**
1146
- * Debounces field synchronization to prevent race conditions from rapid updates.
1147
- * Cancels any pending sync operation before scheduling a new one.
1148
- *
1149
- * @param delay - Debounce delay in milliseconds (default: 100ms)
1150
- */
1151
- private debouncedFieldSync;
1152
- private _currentMonthSignal;
1153
- private _currentYearSignal;
1154
- private _localeSignal;
1155
- private _holidayProviderSignal;
1156
- private _disabledStateSignal;
1157
- /**
1158
- * Effect that automatically triggers change detection when key signals change.
1159
- * This reduces the need for manual markForCheck() calls throughout the codebase.
1160
- */
1161
- private _changeDetectionEffect;
1162
- /**
1163
- * Signal tracking which calendar month indices are currently visible in the viewport.
1164
- * Used for lazy rendering of multi-calendar layouts to improve performance.
1165
- */
1166
- private _visibleCalendarIndicesSignal;
1167
- /**
1168
- * Computed signal for rendered calendars - only includes visible calendars + buffer.
1169
- * This dramatically reduces DOM nodes for multi-calendar layouts.
1170
- */
1171
- renderedCalendars: i0.Signal<{
1172
- month: number;
1173
- year: number;
1174
- days: (Date | null)[];
1175
- }[]>;
1176
- private _cachedIsCurrentMonthMemo;
1177
- private _cachedIsDateDisabledMemo;
1178
- private _cachedIsSameDayMemo;
1179
- private _cachedIsHolidayMemo;
1180
- private _cachedGetHolidayLabelMemo;
1181
- private _memoDependencies;
1182
- private _updateMemoSignals;
1183
- private passiveTouchListeners;
1184
- get isInlineMode(): boolean;
1185
- private clearTouchHandledFlag;
1186
- private closeMonthYearDropdowns;
1187
- private setTouchHandledFlag;
1188
- isMobileDevice(): boolean;
1189
- shouldUseNativePicker(): boolean;
1190
- getNativeInputType(): string;
1191
- formatValueForNativeInput(value: DatepickerValue): string;
1192
- formatDateForNativeInput(date: Date): string;
1193
- getMinDateForNativeInput(): string | null;
1194
- getMaxDateForNativeInput(): string | null;
1195
- parseNativeInputValue(value: string): DatepickerValue;
1196
- onNativeInputChange(event: Event): void;
1197
- onBottomSheetTouchStart(event: TouchEvent): void;
1198
- onBottomSheetTouchMove(event: TouchEvent): void;
1199
- onBottomSheetTouchEnd(event: TouchEvent): void;
1200
- readonly boundIsDateDisabled: (d: Date | null) => boolean;
1201
- readonly boundIsSameDay: (d1: Date | null, d2: Date | null) => boolean;
1202
- readonly boundIsHoliday: (d: Date | null) => boolean;
1203
- readonly boundIsMultipleSelected: (d: Date | null) => boolean;
1204
- readonly boundIsInRange: (d: Date | null) => boolean;
1205
- readonly boundIsPreviewInRange: (d: Date | null) => boolean;
1206
- readonly boundGetAriaLabel: (d: Date | null) => string;
1207
- readonly boundGetDayCellCustomClasses: (d: Date | null) => string[];
1208
- readonly boundGetDayCellTooltip: (d: Date | null) => string | null;
1209
- readonly boundFormatDayNumber: (d: Date | null) => string;
1210
- readonly boundGetMonthYearLabel: (m: number, y: number) => string;
1211
- readonly boundGetCalendarAriaLabelForMonth: (m: number, y: number) => string;
1212
- readonly boundIsTimelineMonthSelected: (d: Date) => boolean;
1213
- readonly boundFormatTimeSliderValue: (v: number) => string;
1214
- get isCalendarVisible(): boolean;
1215
- get displayValue(): string;
1216
- private syncTypedInputIfNotTyping;
1217
- private getDisplayValueTimeOnly;
1218
- private getDisplayValueDateDefault;
1219
- private formatWithCustomFormat;
1220
- private formatWithAdapter;
1221
- private formatWithParsingServiceFallback;
1222
- /**
1223
- * Format dates using a custom date format pattern
1224
- * Supports YYYY, MM, DD, HH, mm, ss, etc.
1225
- */
1226
- private formatWithCustomPattern;
1227
- get isBackArrowDisabled(): boolean;
1228
- private _invalidateMemoCache;
1229
- get isCurrentMonthMemo(): (day: Date | null) => boolean;
1230
- /**
1231
- * Memoized function for checking if a date is disabled.
1232
- * Returns a cached function that checks date constraints efficiently.
1233
- *
1234
- * @returns A function that checks if a date is disabled
1235
- *
1236
- * @remarks
1237
- * This getter implements memoization to avoid recreating the validation function
1238
- * on every calendar render. The function is regenerated only when:
1239
- * - Disabled state constraints change (minDate, maxDate, disabledDates, disabledRanges)
1240
- * - Current month/year changes
1241
- *
1242
- * Performance: O(1) to get the memoized function, O(n) to execute where n = constraints
1243
- * The memoization significantly improves performance when rendering calendar grids
1244
- * with many date cells (e.g., multiple calendar months).
1245
- */
1246
- get isDateDisabledMemo(): (day: Date | null) => boolean;
1247
- /**
1248
- * Memoized function for comparing if two dates are the same day.
1249
- * Uses an optimized date comparator for efficient day-level comparisons.
1250
- *
1251
- * @returns A function that compares two dates for same-day equality
1252
- *
1253
- * @remarks
1254
- * The date comparator normalizes times to start of day before comparison,
1255
- * ensuring accurate day-level equality checks regardless of time components.
1256
- *
1257
- * Performance: O(1) - Simple date field comparisons after normalization
1258
- */
1259
- get isSameDayMemo(): (d1: Date | null, d2: Date | null) => boolean;
1260
- /**
1261
- * Memoized function for checking if a date is a holiday.
1262
- * Returns a cached function that uses the current holiday provider.
1263
- *
1264
- * @returns A function that checks if a date is a holiday
1265
- *
1266
- * @remarks
1267
- * The function is regenerated when the holidayProvider changes.
1268
- * This ensures the memoized function always uses the current provider
1269
- * while avoiding recreation on every calendar render.
1270
- *
1271
- * Performance: O(1) to get memoized function, O(1) to execute (depends on provider implementation)
1272
- */
1273
- get isHolidayMemo(): (day: Date | null) => boolean;
1274
- get getHolidayLabelMemo(): (day: Date | null) => string | null;
1275
- /**
1276
- * TrackBy function for calendar day cells in *ngFor loops.
1277
- * Provides stable identity for Angular's change detection optimization.
1278
- *
1279
- * @param index - Array index of the day
1280
- * @param day - The date object (or null for empty cells)
1281
- * @returns Unique identifier for the day cell
1282
- *
1283
- * @remarks
1284
- * Using timestamp ensures stable identity even when Date objects are recreated.
1285
- * This significantly improves *ngFor performance by allowing Angular to track
1286
- * which items have changed, moved, or been removed.
1287
- */
1288
- trackByDay(index: number, day: Date | null): string;
1289
- /**
1290
- * TrackBy function for calendar month containers in multi-calendar views.
1291
- * Provides stable identity for efficient change detection.
1292
- *
1293
- * @param _index - Array index (unused, using year-month for identity)
1294
- * @param calendarMonth - The calendar month object
1295
- * @returns Unique identifier combining year and month
1296
- */
1297
- /**
1298
- * Checks if a DOM node is contained within this datepicker instance,
1299
- * including its input group and any portaled popover content.
1300
- *
1301
- * @param target - The node to check
1302
- * @returns True if the node is inside this datepicker's DOM tree
1303
- */
1304
- containsNode(target: Node | null): boolean;
1305
- /** Shared logic for closing calendar when user interacts outside (click or touch). */
1306
- private tryCloseCalendarOnOutsideInteraction;
1307
- onDocumentClick(event: MouseEvent | TouchEvent): void;
1308
- onDocumentTouchStart(event: TouchEvent): void;
1309
- private handleDocumentOutsideInteraction;
1310
- onTouchStart(event: TouchEvent): void;
1311
- onInputGroupFocus(): void;
1312
- private focusInput;
1313
- onTouchEnd(event: TouchEvent): void;
1314
- private closeOtherCalendarInstances;
1315
- private applyCalendarOpenStateFromTouch;
1316
- onPointerDown(event: PointerEvent): void;
1317
- onPointerUp(event: PointerEvent): void;
1318
- private clearPointerTouchState;
1319
- private applyCalendarCloseState;
1320
- private applyCalendarOpenStateFromPointer;
1321
- onKeyDown(event: KeyboardEvent): void;
1322
- private handleKeyboardNavigation;
1323
- private tryCustomShortcuts;
1324
- private tryHooksHandleShortcut;
1325
- private handleShortcutKey;
1326
- private handleShortcutNavigationKeys;
1327
- private handleShortcutArrowKeys;
1328
- private handleShortcutPageHomeEndKeys;
1329
- private handleShortcutLetterAndSpecialKeys;
1330
- isKeyboardHelpOpen: boolean;
1331
- toggleKeyboardHelp(): void;
1332
- private getShortcutKey;
1333
- focusedDate: Date | null;
1334
- private navigateDate;
1335
- private navigateToFirstDay;
1336
- private navigateToLastDay;
1337
- private selectToday;
1338
- private selectYesterday;
1339
- private selectTomorrow;
1340
- private selectNextWeek;
1341
- onDateFocus(day: Date | null): void;
1342
- private isDateValid;
1343
- getDayCellCustomClasses(day: Date | null): string[];
1344
- getDayCellTooltip(day: Date | null): string | null;
1345
- formatDayNumber(day: Date | null): string;
1346
- /**
1347
- * Generates an accessible label for a date cell.
1348
- * Provides screen readers with a descriptive label for each selectable date.
1349
- *
1350
- * @param day - The date to generate a label for
1351
- * @returns Localized date label (e.g., "Monday, January 15, 2024")
1352
- *
1353
- * @remarks
1354
- * The label includes weekday, month, day, and year for full context.
1355
- * Custom formatting can be provided via the formatAriaLabel hook.
1356
- * This ensures screen reader users have complete information about each date.
1357
- */
1358
- getAriaLabel(day: Date | null): string;
1359
- /**
1360
- * ControlValueAccessor implementation: Writes a new value to the form control.
1361
- * Called by Angular Forms when the form control value changes programmatically.
1362
- *
1363
- * @param val - The new value from the form control
1364
- *
1365
- * @remarks
1366
- * This method:
1367
- * - Normalizes the incoming value to ensure consistent format
1368
- * - Initializes component state from the value
1369
- * - Updates memoized signals for change detection
1370
- * - Regenerates calendar to reflect the new value
1371
- * - Notifies Material Form Field of state changes
1372
- * - Syncs with Signal Form field if field input is used
1373
- *
1374
- * This is part of the ControlValueAccessor interface, enabling two-way binding
1375
- * with both Reactive Forms and Template-driven Forms.
1376
- */
1377
- writeValue(val: DatepickerValue): void;
1378
- /**
1379
- * ControlValueAccessor implementation: Registers a callback for value changes.
1380
- * Called by Angular Forms to receive notifications when the user changes the value.
1381
- *
1382
- * @param fn - Callback function to call when value changes
1383
- */
1384
- registerOnChange(fn: (value: DatepickerValue) => void): void;
1385
- /**
1386
- * ControlValueAccessor implementation: Registers a callback for touched state.
1387
- * Called by Angular Forms to receive notifications when the user interacts with the control.
1388
- *
1389
- * @param fn - Callback function to call when control is touched
1390
- */
1391
- registerOnTouched(fn: () => void): void;
1392
- setDisabledState(isDisabled: boolean): void;
1393
- /**
1394
- * Emits a value change event and updates the internal state.
1395
- * Handles normalization, form field synchronization, and calendar auto-close behavior.
1396
- *
1397
- * @param val - The new datepicker value (Date, Date range, or array of dates)
1398
- *
1399
- * @remarks
1400
- * This method is the central point for value updates and ensures:
1401
- * - Value normalization for consistent internal representation
1402
- * - Signal Form field synchronization (if field input is used)
1403
- * - Event emission for two-way binding
1404
- * - Touch state tracking for form validation
1405
- * - Automatic calendar closing for single date and complete range selections
1406
- *
1407
- * The calendar auto-closes when:
1408
- * - Single date mode: After any date selection
1409
- * - Range mode: After both start and end dates are selected
1410
- * - Not in inline mode
1411
- * - Not in time-only mode
1412
- */
1413
- private emitValue;
1414
- /**
1415
- * Toggles the calendar popover open/closed state.
1416
- * Handles focus management, accessibility announcements, and prevents rapid toggling.
1417
- *
1418
- * @param event - Optional event that triggered the toggle (used to prevent toggle on clear button clicks)
1419
- *
1420
- * @remarks
1421
- * This method implements several important behaviors:
1422
- * - Debouncing: Prevents rapid toggling within 300ms
1423
- * - Focus management: Stores previous focus element for restoration
1424
- * - Accessibility: Announces calendar state changes to screen readers
1425
- * - Touch optimization: Sets up passive touch listeners for mobile devices
1426
- *
1427
- * When opening:
1428
- * - Stores the currently focused element for restoration
1429
- * - Sets up focus trap for keyboard navigation
1430
- * - Announces calendar opening with current month/year
1431
- *
1432
- * When closing:
1433
- * - Removes focus trap
1434
- * - Restores focus to previous element
1435
- * - Announces calendar closing
1436
- */
1437
- toggleCalendar(event?: Event): void;
1438
- private applyToggleWithNoEvent;
1439
- private shouldSkipClickToggle;
1440
- private applyDefaultMonthForOpen;
1441
- private applySmartViewModeForOpen;
1442
- private announceAfterToggle;
1443
- private announceCalendarOpened;
1444
- private announceCalendarClosed;
1445
- onBackdropInteract(event: Event): void;
1446
- private scrollDebounceTimer;
1447
- private readonly updatePositionOnScroll;
1448
- private updateOpeningState;
1449
- private _startOpeningState;
1450
- private _startClosingState;
1451
- private renderInBody;
1452
- /** Hides the body-appended popover so loading/calendar are not visible at wrong position. */
1453
- private hideBodyPopoverUntilPositioned;
1454
- /** Shows the body-appended popover after positioning has been applied. */
1455
- private revealBodyPopover;
1456
- private destroyBodyView;
1457
- private closeCalendar;
1458
- private shouldAutoClose;
1459
- /**
1460
- * Clears the selected date value(s) and resets the component state.
1461
- * Emits null value and closes calendar if open.
1462
- *
1463
- * @param event - Optional event that triggered the clear action
1464
- *
1465
- * @remarks
1466
- * This method:
1467
- * - Clears all selected dates (single, range, multiple modes)
1468
- * - Emits null value to form controls
1469
- * - Closes calendar if open
1470
- * - Provides haptic feedback on mobile if enabled
1471
- * - Resets touch gesture state
1472
- * - Announces clearing to screen readers
1473
- *
1474
- * Used by the clear button and can be called programmatically.
1475
- */
1476
- clearValue(event?: MouseEvent | TouchEvent): void;
1477
- get currentMonth(): number;
1478
- set currentMonth(month: number);
1479
- get currentYear(): number;
1480
- set currentYear(year: number);
1481
- ngOnInit(): void;
1482
- private initializeTimeFromNowIfNeeded;
1483
- private resolveInitialValue;
1484
- private resolveInitialValueFromField;
1485
- ngAfterViewInit(): void;
1486
- private setupInputGroupPassiveListeners;
1487
- private _touchListenersSetupTimeout;
1488
- /**
1489
- * Sets up passive touch event listeners on calendar day cells for improved mobile performance.
1490
- * Implements retry logic to handle cases where DOM elements aren't immediately available.
1491
- * All listeners are tracked for proper cleanup on component destroy.
1492
- */
1493
- private setupPassiveTouchListeners;
1494
- private attachTouchListenersToCells;
1495
- ngOnChanges(changes: SimpleChanges): void;
1496
- private handleChangesShowTimeInlineAndLayout;
1497
- private handleChangesLocaleRtl;
1498
- private handleChangesWeekStartAndRelated;
1499
- private applyChangesMinuteAnd24Hour;
1500
- private handleChangesField;
1501
- private handleChangesValue;
1502
- private handleChangesStartAt;
1503
- private handleChangesMinDate;
1504
- private handleChangesCalendarViewMode;
1505
- /**
1506
- * Validates component inputs for conflicts and invalid combinations.
1507
- * Logs warnings in development mode when invalid configurations are detected.
1508
- *
1509
- * @param changes - The SimpleChanges object from ngOnChanges
1510
- */
1511
- private validateInputs;
1512
- private validateInputsMinMaxDate;
1513
- private validateInputsTimeOnly;
1514
- private validateInputsIntervals;
1515
- private validateInputsYearRange;
1516
- private initializeTimeSliders;
1517
- private get24Hour;
1518
- private update12HourState;
1519
- private applyCurrentTime;
1520
- private applyTimeIfNeeded;
1521
- /**
1522
- * Initializes the component's internal state from a DatepickerValue.
1523
- * Sets up selected dates, calendar view position, and time values based on the provided value.
1524
- *
1525
- * @param value - The datepicker value to initialize from (Date, range, array, or null)
1526
- *
1527
- * @remarks
1528
- * This method handles initialization for all selection modes:
1529
- * - Single mode: Sets selectedDate
1530
- * - Range mode: Sets startDate and endDate
1531
- * - Multiple mode: Sets selectedDates array
1532
- *
1533
- * The method also:
1534
- * - Determines the calendar view center date (uses value, startAt, or minDate as fallback)
1535
- * - Extracts and sets time values if the date includes time information
1536
- * - Normalizes all dates to ensure consistent internal representation
1537
- *
1538
- * Performance: O(1) for single/range, O(n) for multiple mode where n = array length
1539
- */
1540
- private initializeValue;
1541
- private applyValueToSelection;
1542
- private resolveViewCenterDate;
1543
- private _normalizeDate;
1544
- /**
1545
- * Normalizes various date input formats into a consistent DatepickerValue type.
1546
- * Handles Date objects, Moment.js objects, date ranges, arrays, and strings.
1547
- *
1548
- * @param val - The value to normalize (can be Date, Moment, range object, array, or string)
1549
- * @returns Normalized DatepickerValue (Date, range object, array, or null)
1550
- *
1551
- * @remarks
1552
- * This method provides flexible input handling to support:
1553
- * - Native JavaScript Date objects
1554
- * - Moment.js objects (with timezone preservation)
1555
- * - Date range objects: { start: Date, end: Date }
1556
- * - Arrays of dates for multiple selection mode
1557
- * - String dates with custom format parsing
1558
- *
1559
- * Invalid or unparseable values are normalized to null.
1560
- * This ensures type safety and consistent internal state representation.
1561
- */
1562
- private _normalizeValue;
1563
- private _normalizeRangeValue;
1564
- private _normalizeArrayValue;
1565
- /**
1566
- * Check if the provided value is a Moment.js object
1567
- */
1568
- private isMomentObject;
1569
- /**
1570
- * Convert a Moment.js object to a Date, preserving timezone offset
1571
- */
1572
- private momentToDate;
1573
- /**
1574
- * Compares two DatepickerValue objects for equality.
1575
- * Handles Date objects, range objects, and arrays with proper date comparison.
1576
- *
1577
- * @param val1 - First value to compare
1578
- * @param val2 - Second value to compare
1579
- * @returns true if values represent the same date(s), false otherwise
1580
- *
1581
- * @remarks
1582
- * This method performs deep equality checks:
1583
- * - For Date objects: Compares using date comparator (handles time normalization)
1584
- * - For range objects: Compares both start and end dates
1585
- * - For arrays: Compares lengths and all elements
1586
- * - Handles null/undefined values correctly
1587
- *
1588
- * Uses the dateComparator utility for efficient date comparisons that
1589
- * normalize times to start of day for accurate day-level equality.
1590
- */
1591
- private isValueEqual;
1592
- /**
1593
- * Parses a date string, optionally using the configured date adapter with error callback.
1594
- * Falls back to native Date parsing if no adapter is configured.
1595
- *
1596
- * @param dateString - The date string to parse
1597
- * @returns Parsed Date object or null if parsing fails
1598
- *
1599
- * @remarks
1600
- * If a date adapter is configured via globalConfig, it will be used for parsing
1601
- * with error callbacks. Otherwise, native Date parsing is used.
1602
- * Error callbacks allow consumers to handle parsing failures gracefully.
1603
- */
1604
- onInputFocus(event: FocusEvent): void;
1605
- /**
1606
- * Sanitizes user input to prevent XSS attacks.
1607
- * Removes potentially dangerous characters while preserving valid date/time input.
1608
- *
1609
- * @param input - Raw user input string
1610
- * @returns Sanitized string safe for template interpolation
1611
- *
1612
- * @remarks
1613
- * This method provides basic XSS protection by removing:
1614
- * - HTML tag delimiters (< and >)
1615
- * - Script event handlers (onerror, onclick, etc.)
1616
- * - JavaScript protocol (javascript:)
1617
- * - Data URIs that could contain scripts
1618
- *
1619
- * Note: Angular's template interpolation provides additional protection,
1620
- * but this sanitization adds an extra layer of defense for user-provided strings.
1621
- * For comprehensive sanitization, Angular's DomSanitizer should be used for
1622
- * any HTML content, but for date/time strings, this level of sanitization is sufficient.
1623
- */
1624
- private sanitizeInput;
1625
- onInputChange(event: Event): void;
1626
- onInputBlur(event: FocusEvent): void;
1627
- private applyValidationErrorForBlur;
1628
- onInputKeyDown(event: Event): void;
1629
- private applyInputMask;
1630
- private isValidDate;
1631
- private applyTypedDate;
1632
- private generateTimeOptions;
1633
- private generateLocaleData;
1634
- private updateRangesArray;
1635
- selectRange(range: [Date, Date]): void;
1636
- isHoliday(date: Date | null): boolean;
1637
- getHolidayLabel(date: Date | null): string | null;
1638
- /**
1639
- * Checks if a date is disabled based on all configured constraints.
1640
- *
1641
- * @param date - The date to check
1642
- * @returns true if the date is disabled, false if it can be selected
1643
- *
1644
- * @remarks
1645
- * A date is considered disabled if it matches any of these conditions:
1646
- * - Falls before minDate
1647
- * - Falls after maxDate
1648
- * - Is in the disabledDates array
1649
- * - Falls within a disabledRanges entry
1650
- * - Fails the isInvalidDate custom validation function
1651
- * - Is a holiday and disableHolidays is true
1652
- *
1653
- * Performance: O(n) where n = disabledDates.length + disabledRanges.length
1654
- * For large constraint lists (>1000), consider optimizing with Set or DateRange tree.
1655
- */
1656
- isDateDisabled(date: Date | null): boolean;
1657
- private _isInDisabledDates;
1658
- private _isInDisabledRanges;
1659
- private _isOutOfMinMaxBounds;
1660
- /**
1661
- * Checks if a date is selected in multiple selection mode.
1662
- *
1663
- * @param d - The date to check
1664
- * @returns true if the date is in the selectedDates array
1665
- *
1666
- * @remarks
1667
- * Performance: O(n) where n = selectedDates.length
1668
- * Uses day-level comparison (ignores time) for accurate matching.
1669
- */
1670
- isMultipleSelected(d: Date | null): boolean;
1671
- /**
1672
- * Handles time value changes from time selection controls.
1673
- * Updates the selected date(s) with the new time values.
1674
- *
1675
- * @remarks
1676
- * This method:
1677
- * - Applies time changes to selected dates based on current mode
1678
- * - Emits value changes for form integration
1679
- * - Handles time-only mode by creating a date with current time
1680
- * - Updates all selected dates in multiple mode
1681
- * - Ensures startDate <= endDate in range mode
1682
- */
1683
- timeChange(): void;
1684
- /**
1685
- * Handles time range changes in timeRangeMode.
1686
- * Updates the internal time range state and emits the time range to listeners.
1687
- * Only creates/updates time-only dates (no calendar dates).
1688
- */
1689
- timeRangeChange(): void;
1690
- /**
1691
- * Handles date cell click/tap events.
1692
- * Processes date selection based on the current mode (single, range, multiple, etc.)
1693
- * and handles touch gesture debouncing to prevent accidental double selections.
1694
- *
1695
- * @param day - The date that was clicked (null for empty cells)
1696
- *
1697
- * @remarks
1698
- * This method implements several important behaviors:
1699
- * - Touch gesture handling: Debounces rapid touch events to prevent double-clicks
1700
- * - Date validation: Checks if the date is disabled before processing
1701
- * - Hook integration: Calls beforeDateSelect hook if provided
1702
- * - Mode-specific logic: Handles single, range, multiple, week, month, quarter, and year modes
1703
- * - Calendar navigation: Automatically navigates to different month if date is outside current view
1704
- * - Accessibility: Announces date selection to screen readers
1705
- * - Auto-close: Closes calendar after selection in single mode or complete range
1706
- *
1707
- * Performance considerations:
1708
- * - Touch debouncing prevents excessive event processing
1709
- * - Date normalization happens once per selection
1710
- * - Calendar regeneration is optimized with caching
1711
- */
1712
- onDateClick(day: Date | null): void;
1713
- /**
1714
- * Returns true (and cleans up touch state) when the click event should be
1715
- * ignored because it was already handled by the touch handler within the
1716
- * deduplication window (250 ms).
1717
- */
1718
- private _shouldSkipDueToTouchGuard;
1719
- private _navigateToMonthOfDay;
1720
- private _handleSingleModeClick;
1721
- private _handleRangeModeClick;
1722
- private _handleRangeEndSelection;
1723
- private _handlePeriodModeClick;
1724
- private _handleMultipleModeClick;
1725
- private _applyRecurringPattern;
1726
- private _syncTimeAfterDateClick;
1727
- onDateHover(day: Date | null): void;
1728
- onDateCellTouchStart(event: TouchEvent, day: Date | null): void;
1729
- onDateCellTouchMove(event: TouchEvent): void;
1730
- onDateCellTouchEnd(event: TouchEvent, day: Date | null): void;
1731
- isPreviewInRange(day: Date | null): boolean;
1732
- private buildCalendarMonths;
1733
- /**
1734
- * Generates the calendar view for the current month(s).
1735
- * Uses LRU caching to optimize performance for frequently accessed months.
1736
- *
1737
- * @remarks
1738
- * Performance characteristics:
1739
- * - First generation: O(n) where n = number of days in month(s)
1740
- * - Cached generation: O(1) lookup + O(1) cache access update
1741
- * - Cache eviction: O(m) where m = cache size (only when cache is full)
1742
- *
1743
- * This method:
1744
- * 1. Generates dropdown options for month/year selection
1745
- * 2. Generates calendar days for each month in calendarCount
1746
- * 3. Uses LRU cache to avoid regenerating recently accessed months
1747
- * 4. Handles month/year rollover when displaying multiple calendars
1748
- * 5. Updates memoized dependencies for change detection optimization
1749
- * 6. Supports synchronous scrolling to keep calendars in sync (when enabled)
1750
- *
1751
- * The cache key format is `${year}-${month}` to ensure unique identification
1752
- * of calendar months across different years.
1753
- *
1754
- * When syncScroll is enabled, calendars are kept synchronized:
1755
- * - Calendar 0: currentDate month + (0 * monthGap)
1756
- * - Calendar 1: currentDate month + (1 * monthGap)
1757
- * - Calendar 2: currentDate month + (2 * monthGap)
1758
- */
1759
- generateCalendar(): void;
1760
- /**
1761
- * Preloads adjacent months (previous and next) into the cache for smoother navigation.
1762
- * Implements lazy loading optimization to improve performance when users navigate between months.
1763
- *
1764
- * @param currentYear - Current calendar year
1765
- * @param currentMonth - Current calendar month (0-11)
1766
- */
1767
- private preloadAdjacentMonths;
1768
- private generateDropdownOptions;
1769
- private generateYearGrid;
1770
- private generateDecadeGrid;
1771
- onYearClick(year: number): void;
1772
- onDecadeClick(decade: number): void;
1773
- /**
1774
- * Changes the displayed decade by the specified delta.
1775
- * Used in decade view mode for navigating between decades.
1776
- *
1777
- * @param delta - Number of decades to change (positive for future, negative for past)
1778
- *
1779
- * @remarks
1780
- * Each delta unit represents 10 years. The method updates the decade grid
1781
- * to show the new range of decades available for selection.
1782
- */
1783
- changeDecade(delta: number): void;
1784
- /**
1785
- * Changes the displayed calendar year by the specified delta.
1786
- * Updates year grid and calendar view, and announces the change to screen readers.
1787
- *
1788
- * @param delta - Number of years to change (positive for future, negative for past)
1789
- *
1790
- * @remarks
1791
- * This method:
1792
- * - Updates currentYear and currentDate
1793
- * - Regenerates year grid and calendar view
1794
- * - Announces year change to screen readers for accessibility
1795
- * - Handles touch listener setup for mobile devices
1796
- *
1797
- * Performance: O(1) for year change, O(n) for grid/calendar generation
1798
- */
1799
- changeYear(delta: number): void;
1800
- onYearSelectChange(year: number | unknown): void;
1801
- private generateTimeline;
1802
- timelineZoomIn(): void;
1803
- timelineZoomOut(): void;
1804
- isTimelineMonthSelected(month: Date): boolean;
1805
- onTimelineMonthClick(month: Date): void;
1806
- formatTimeSliderValue(minutes: number): string;
1807
- onStartTimeSliderChange(minutes: number): void;
1808
- onEndTimeSliderChange(minutes: number): void;
1809
- onCalendarSwipeStart(event: TouchEvent): void;
1810
- onCalendarSwipeMove(event: TouchEvent): void;
1811
- onCalendarSwipeEnd(event: TouchEvent): void;
1812
- changeMonth(delta: number): void;
1813
- isSameDay(d1: Date | null, d2: Date | null): boolean;
1814
- isCurrentMonth(day: Date | null): boolean;
1815
- isInRange(d: Date | null): boolean;
1816
- private applyGlobalConfig;
1817
- private applyGlobalConfigDefaults;
1818
- private applyGlobalConfigLocaleAndDates;
1819
- private applyGlobalConfigMobile;
1820
- /**
1821
- * Apply animation configuration from global config
1822
- */
1823
- private applyAnimationConfig;
1824
- /**
1825
- * Initialize translations from service or registry
1826
- */
1827
- private initializeTranslations;
1828
- /**
1829
- * Generates an accessible label for the calendar dialog.
1830
- * Provides screen readers with context about which month/year is being displayed.
1831
- *
1832
- * @returns Localized calendar label (e.g., "Calendar for January 2024")
1833
- */
1834
- getCalendarAriaLabel(): string;
1835
- /**
1836
- * Generates an accessible label for a specific calendar month in multi-calendar views.
1837
- *
1838
- * @param month - Month index (0-11)
1839
- * @param year - Year number
1840
- * @returns Localized calendar label for the specified month/year
1841
- */
1842
- getCalendarAriaLabelForMonth(month: number, year: number): string;
1843
- /**
1844
- * Sets up IntersectionObserver for lazy loading multi-calendar months.
1845
- * Only initializes if multi-calendar is enabled (calendarCount > 1).
1846
- *
1847
- * @remarks
1848
- * Uses IntersectionObserver to track which calendar month elements are visible
1849
- * in the viewport. Updates the visible indices signal to enable/disable rendering.
1850
- */
1851
- private setupLazyLoadingObserver;
1852
- /**
1853
- * Formats a month and year into a display label.
1854
- *
1855
- * @param month - Month index (0-11)
1856
- * @param year - Year number
1857
- * @returns Formatted string like "January 2024"
1858
- */
1859
- getMonthYearLabel(month: number, year: number): string;
1860
- isCurrentMonthForCalendar(day: Date | null, targetMonth: number, targetYear: number): boolean;
1861
- getTranslation(key: keyof DatepickerTranslations, fallbackKey?: keyof DatepickerTranslations, params?: Record<string, string | number>): string;
1862
- /**
1863
- * Closes the calendar and restores focus to the previously focused element.
1864
- * This improves accessibility by returning focus to the trigger element.
1865
- */
1866
- closeCalendarWithFocusRestore(): void;
1867
- private updateRtlState;
1868
- /**
1869
- * Component lifecycle hook: Cleanup all resources, subscriptions, and event listeners.
1870
- * Ensures no memory leaks by:
1871
- * - Removing instance from static registry
1872
- * - Cleaning up field sync service
1873
- * - Completing stateChanges subject
1874
- * - Clearing all tracked timeouts and animation frames
1875
- * - Removing touch event listeners
1876
- * - Invalidating month cache
1877
- */
1878
- ngOnDestroy(): void;
1879
- private getActualPopoverContainer;
1880
- private setupFocusTrap;
1881
- /**
1882
- * Positions the popover relative to the input element dynamically.
1883
- * - Prioritizes layout below the input.
1884
- * - Falls back to positioning above if required.
1885
- * - Defaults to CSS-centered positioning if space is insufficient.
1886
- *
1887
- * @remarks
1888
- * This logic primarily targets mobile/tablet viewports; desktop layout (≥1024px)
1889
- * is handled via CSS absolute positioning.
1890
- */
1891
- private positionPopoverRelativeToInput;
1892
- /**
1893
- * Determines if the component is operating within an Ionic environment.
1894
- * This detection disables features that may conflict with Ionic's overlay system.
1895
- */
1896
- private isIonicEnvironment;
1897
- private removeFocusTrap;
1898
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkDatepickerComponent, never>;
1899
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxsmkDatepickerComponent, "ngxsmk-datepicker", never, { "mode": { "alias": "mode"; "required": false; }; "calendarViewMode": { "alias": "calendarViewMode"; "required": false; }; "isInvalidDate": { "alias": "isInvalidDate"; "required": false; }; "showRanges": { "alias": "showRanges"; "required": false; }; "showTime": { "alias": "showTime"; "required": false; }; "timeOnly": { "alias": "timeOnly"; "required": false; }; "timeRangeMode": { "alias": "timeRangeMode"; "required": false; }; "showCalendarButton": { "alias": "showCalendarButton"; "required": false; }; "minuteInterval": { "alias": "minuteInterval"; "required": false; }; "use24Hour": { "alias": "use24Hour"; "required": false; }; "secondInterval": { "alias": "secondInterval"; "required": false; }; "showSeconds": { "alias": "showSeconds"; "required": false; }; "holidayProvider": { "alias": "holidayProvider"; "required": false; }; "disableHolidays": { "alias": "disableHolidays"; "required": false; }; "disabledDates": { "alias": "disabledDates"; "required": false; }; "disabledRanges": { "alias": "disabledRanges"; "required": false; }; "recurringPattern": { "alias": "recurringPattern"; "required": false; }; "dateTemplate": { "alias": "dateTemplate"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "name": { "alias": "name"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "translations": { "alias": "translations"; "required": false; }; "translationService": { "alias": "translationService"; "required": false; }; "clearLabel": { "alias": "clearLabel"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "prevMonthAriaLabel": { "alias": "prevMonthAriaLabel"; "required": false; }; "nextMonthAriaLabel": { "alias": "nextMonthAriaLabel"; "required": false; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; }; "weekStart": { "alias": "weekStart"; "required": false; }; "yearRange": { "alias": "yearRange"; "required": false; }; "timezone": { "alias": "timezone"; "required": false; }; "hooks": { "alias": "hooks"; "required": false; }; "enableKeyboardShortcuts": { "alias": "enableKeyboardShortcuts"; "required": false; }; "customShortcuts": { "alias": "customShortcuts"; "required": false; }; "autoApplyClose": { "alias": "autoApplyClose"; "required": false; }; "displayFormat": { "alias": "displayFormat"; "required": false; }; "allowTyping": { "alias": "allowTyping"; "required": false; }; "calendarCount": { "alias": "calendarCount"; "required": false; }; "calendarLayout": { "alias": "calendarLayout"; "required": false; }; "defaultMonthOffset": { "alias": "defaultMonthOffset"; "required": false; }; "syncScroll": { "alias": "syncScroll"; "required": false; }; "align": { "alias": "align"; "required": false; }; "useNativePicker": { "alias": "useNativePicker"; "required": false; }; "enableHapticFeedback": { "alias": "enableHapticFeedback"; "required": false; }; "mobileModalStyle": { "alias": "mobileModalStyle"; "required": false; }; "mobileTimePickerStyle": { "alias": "mobileTimePickerStyle"; "required": false; }; "enablePullToRefresh": { "alias": "enablePullToRefresh"; "required": false; }; "mobileTheme": { "alias": "mobileTheme"; "required": false; }; "enableVoiceInput": { "alias": "enableVoiceInput"; "required": false; }; "autoDetectMobile": { "alias": "autoDetectMobile"; "required": false; }; "disableFocusTrap": { "alias": "disableFocusTrap"; "required": false; }; "appendToBody": { "alias": "appendToBody"; "required": false; }; "value": { "alias": "value"; "required": false; }; "field": { "alias": "field"; "required": false; }; "startAt": { "alias": "startAt"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "dateFormatPattern": { "alias": "dateFormatPattern"; "required": false; }; "animationConfig": { "alias": "animationConfig"; "required": false; }; "rtl": { "alias": "rtl"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; "disabledState": { "alias": "disabledState"; "required": false; }; "required": { "alias": "required"; "required": false; }; "errorState": { "alias": "errorState"; "required": false; }; "userAriaDescribedBy": { "alias": "userAriaDescribedBy"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "ranges": { "alias": "ranges"; "required": false; }; }, { "valueChange": "valueChange"; "action": "action"; "validationError": "validationError"; }, never, never, true, never>;
1900
- }
1901
-
1902
- /**
1903
- * Wrapper NgModule for the standalone datepicker component.
1904
- * Use this in your `imports` array if you see NG1010 ("imports must be an array...
1905
- * Value could not be determined statically") when using the Angular compiler plugin
1906
- * or in strict AOT builds.
1907
- *
1908
- * @example
1909
- * ```typescript
1910
- * import { NgxsmkDatepickerModule } from 'ngxsmk-datepicker';
1911
- *
1912
- * @Component({
1913
- * standalone: true,
1914
- * imports: [NgxsmkDatepickerModule], // single static reference
1915
- * template: '<ngxsmk-datepicker></ngxsmk-datepicker>'
1916
- * })
1917
- * export class MyComponent {}
1918
- * ```
1919
- *
1920
- * For NgModule-based apps:
1921
- * ```typescript
1922
- * @NgModule({
1923
- * imports: [NgxsmkDatepickerModule],
1924
- * exports: [NgxsmkDatepickerModule]
1925
- * })
1926
- * export class MyFeatureModule {}
1927
- * ```
1928
- */
1929
- declare class NgxsmkDatepickerModule {
1930
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkDatepickerModule, never>;
1931
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsmkDatepickerModule, never, [typeof NgxsmkDatepickerComponent], [typeof NgxsmkDatepickerComponent]>;
1932
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxsmkDatepickerModule>;
1933
- }
1934
-
1935
- interface ExportOptions {
1936
- includeTime?: boolean;
1937
- dateFormat?: string;
1938
- timezone?: string;
1939
- csvHeaders?: string[];
1940
- }
1941
- declare function exportToJson(value: DatepickerValue, options?: ExportOptions): string;
1942
- declare function importFromJson(jsonString: string): DatepickerValue;
1943
- declare function exportToCsv(value: DatepickerValue, options?: ExportOptions): string;
1944
- declare function importFromCsv(csvString: string): DatepickerValue;
1945
- declare function exportToIcs(value: DatepickerValue, options?: ExportOptions & {
1946
- summary?: string;
1947
- description?: string;
1948
- location?: string;
1949
- }): string;
1950
- declare function importFromIcs(icsString: string): DatepickerValue;
1951
-
1952
- /**
1953
- * Format a date with timezone support
1954
- * @param date The date to format
1955
- * @param locale The locale for formatting
1956
- * @param options Intl.DateTimeFormatOptions
1957
- * @param timezone Optional timezone (IANA timezone name, e.g., 'America/New_York', 'UTC', 'Europe/London')
1958
- * @returns Formatted date string
1959
- */
1960
- declare function formatDateWithTimezone(date: Date, locale: string, options: Intl.DateTimeFormatOptions, timezone?: string): string;
1961
- /**
1962
- * Parse a date string with timezone awareness
1963
- * @param dateString The date string to parse
1964
- * @param timezone Optional timezone for parsing (IANA timezone name)
1965
- * @returns Date object (always in UTC internally)
1966
- */
1967
- declare function parseDateWithTimezone(dateString: string, timezone?: string): Date | null;
1968
- /**
1969
- * Convert a date from one timezone to another
1970
- * @param date The date to convert
1971
- * @param fromTimezone Source timezone (IANA name)
1972
- * @param _toTimezone Target timezone (IANA name) - currently unused in simplified implementation
1973
- * @returns New Date object (still UTC internally, but represents the time in target timezone)
1974
- */
1975
- declare function convertTimezone(date: Date, fromTimezone: string, _toTimezone: string): Date;
1976
- /**
1977
- * Get the current timezone offset in minutes for a given timezone
1978
- * @param timezone IANA timezone name
1979
- * @param date Optional date to check offset for (defaults to now)
1980
- * @returns Offset in minutes from UTC
1981
- */
1982
- declare function getTimezoneOffset(timezone: string, date?: Date): number;
1983
- /**
1984
- * Check if a timezone string is valid
1985
- * @param timezone IANA timezone name
1986
- * @returns true if valid, false otherwise
1987
- */
1988
- declare function isValidTimezone(timezone: string): boolean;
1989
-
1990
- /**
1991
- * Calendar system types supported by the datepicker
1992
- */
1993
- type CalendarSystem = 'gregorian' | 'islamic' | 'buddhist' | 'japanese' | 'hebrew' | 'persian';
1994
- /**
1995
- * Locale data structure for datepicker localization
1996
- */
1997
- interface LocaleData {
1998
- /** Calendar system used by this locale */
1999
- calendar: CalendarSystem;
2000
- /** First day of the week (0 = Sunday, 1 = Monday, etc.) */
2001
- firstDayOfWeek: number;
2002
- /** Default date format string (e.g., 'MM/DD/YYYY', 'DD/MM/YYYY') */
2003
- dateFormat: string;
2004
- /** Full month names (12 elements) */
2005
- monthNames: string[];
2006
- /** Short month names (12 elements) */
2007
- monthNamesShort: string[];
2008
- /** Full weekday names (7 elements, starting with Sunday) */
2009
- weekdayNames: string[];
2010
- /** Short weekday names (7 elements, starting with Sunday) */
2011
- weekdayNamesShort: string[];
2012
- /** Whether this locale uses RTL (right-to-left) text direction */
2013
- isRtl: boolean;
2014
- /** Fallback locale if this one is not fully supported */
2015
- fallbackLocale?: string;
2016
- /** Locale-specific date format options */
2017
- dateFormatOptions?: {
2018
- year?: 'numeric' | '2-digit';
2019
- month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';
2020
- day?: 'numeric' | '2-digit';
2021
- hour?: 'numeric' | '2-digit';
2022
- minute?: 'numeric' | '2-digit';
2023
- hour12?: boolean;
2024
- };
2025
- }
2026
- /**
2027
- * Service for managing locale data and providing fallback mechanisms
2028
- * Supports multiple calendar systems and provides locale-specific formatting
2029
- */
2030
- declare class LocaleRegistryService {
2031
- private localeData;
2032
- private readonly defaultLocale;
2033
- constructor();
2034
- /**
2035
- * Register locale data for a specific locale
2036
- */
2037
- register(locale: string, data: LocaleData): void;
2038
- /**
2039
- * Get locale data for a specific locale, with fallback support
2040
- */
2041
- getLocaleData(locale: string): LocaleData;
2042
- /**
2043
- * Get fallback locale for an unsupported locale
2044
- */
2045
- getFallbackLocale(unsupportedLocale: string): string | null;
2046
- /**
2047
- * Check if a locale is RTL
2048
- */
2049
- isRtlLocale(locale: string): boolean;
2050
- /**
2051
- * Get calendar system for a locale
2052
- */
2053
- getCalendarSystem(locale: string): CalendarSystem;
2054
- /**
2055
- * Register default locale data for common locales
2056
- */
2057
- private registerDefaultLocales;
2058
- /**
2059
- * Get default locale data (English US)
2060
- */
2061
- private getDefaultLocaleData;
2062
- static ɵfac: i0.ɵɵFactoryDeclaration<LocaleRegistryService, never>;
2063
- static ɵprov: i0.ɵɵInjectableDeclaration<LocaleRegistryService>;
2064
- }
2065
-
2066
- /**
2067
- * Service for managing datepicker translations
2068
- * Provides default translations for major languages
2069
- */
2070
- declare class TranslationRegistryService {
2071
- private translations;
2072
- constructor();
2073
- /**
2074
- * Register translations for a locale
2075
- */
2076
- register(locale: string, translations: DatepickerTranslations): void;
2077
- /**
2078
- * Get translations for a locale with fallback support
2079
- */
2080
- getTranslations(locale: string): DatepickerTranslations;
2081
- /**
2082
- * Register default translations for major languages
2083
- */
2084
- private registerDefaultTranslations;
2085
- /**
2086
- * Get English translations (default)
2087
- */
2088
- private getEnglishTranslations;
2089
- static ɵfac: i0.ɵɵFactoryDeclaration<TranslationRegistryService, never>;
2090
- static ɵprov: i0.ɵɵInjectableDeclaration<TranslationRegistryService>;
2091
- }
2092
-
2093
- /**
2094
- * Service for custom date formatting patterns.
2095
- * Supports custom patterns beyond standard Angular DatePipe formats.
2096
- *
2097
- * @remarks
2098
- * Supports the following pattern tokens:
2099
- * - YYYY: 4-digit year (e.g., 2025)
2100
- * - YY: 2-digit year (e.g., 25)
2101
- * - MMMM: Full month name (e.g., January)
2102
- * - MMM: Abbreviated month name (e.g., Jan)
2103
- * - MM: 2-digit month (e.g., 01)
2104
- * - M: 1 or 2-digit month (e.g., 1)
2105
- * - DDDD: Full weekday name (e.g., Monday)
2106
- * - DDD: Abbreviated weekday name (e.g., Mon)
2107
- * - DD: 2-digit day (e.g., 05)
2108
- * - D: 1 or 2-digit day (e.g., 5)
2109
- * - HH: 2-digit hour (24-hour format, e.g., 14)
2110
- * - H: 1 or 2-digit hour (24-hour format, e.g., 14)
2111
- * - hh: 2-digit hour (12-hour format, e.g., 02)
2112
- * - h: 1 or 2-digit hour (12-hour format, e.g., 2)
2113
- * - mm: 2-digit minutes (e.g., 05)
2114
- * - m: 1 or 2-digit minutes (e.g., 5)
2115
- * - ss: 2-digit seconds (e.g., 09)
2116
- * - s: 1 or 2-digit seconds (e.g., 9)
2117
- * - A/a: AM/PM or am/pm
2118
- */
2119
- declare class CustomDateFormatService {
2120
- private locale;
2121
- private readonly monthNames;
2122
- private readonly weekdayNames;
2123
- constructor(locale?: string);
2124
- /**
2125
- * Set the locale for formatting
2126
- */
2127
- setLocale(locale: string): void;
2128
- /**
2129
- * Format a date using a custom pattern
2130
- *
2131
- * @param date - The date to format
2132
- * @param pattern - The custom format pattern
2133
- * @returns Formatted date string
2134
- */
2135
- format(date: Date, pattern: string): string;
2136
- /**
2137
- * Parse a formatted date string back to a Date object
2138
- * Note: This is a best-effort implementation and may not work for all patterns
2139
- *
2140
- * @param dateString - The date string to parse
2141
- * @param pattern - The format pattern used
2142
- * @returns Parsed Date object, or null if parsing fails
2143
- */
2144
- parse(dateString: string, _pattern: string): Date | null;
2145
- private getMonthNames;
2146
- private initializeLocaleData;
2147
- private getWeekdayNames;
2148
- }
2149
-
2150
- /**
2151
- * Theme builder service for generating CSS-in-JS styles and managing themes
2152
- */
2153
- declare class ThemeBuilderService implements OnDestroy {
2154
- private readonly platformId;
2155
- private styleElement;
2156
- private scopedStyleElements;
2157
- /**
2158
- * Map theme color keys to actual CSS variable names
2159
- */
2160
- private mapColorKey;
2161
- /**
2162
- * Map typography keys to actual CSS variable names
2163
- */
2164
- private mapTypographyKey;
2165
- /**
2166
- * Generate CSS variables from a theme object
2167
- */
2168
- generateTheme(theme: DatepickerTheme): string;
2169
- /**
2170
- * Apply theme to a specific element or globally
2171
- * @param theme The theme to apply
2172
- * @param targetElement Optional specific element to apply theme to. If not provided, applies globally.
2173
- */
2174
- applyTheme(theme: DatepickerTheme, targetElement?: HTMLElement): void;
2175
- /**
2176
- * Apply theme variables directly to all datepicker elements (for global theme)
2177
- * Optimized version with batch DOM operations
2178
- */
2179
- private applyToElements;
2180
- /**
2181
- * Generate CSS-in-JS style object (for styled-components, emotion, etc.)
2182
- */
2183
- generateStyleObject(theme: DatepickerTheme): Record<string, string>;
2184
- /**
2185
- * Remove applied theme
2186
- * @param targetElement Optional specific element to remove theme from. If not provided, removes from all.
2187
- */
2188
- removeTheme(targetElement?: HTMLElement): void;
2189
- /**
2190
- * Get current theme from CSS variables
2191
- */
2192
- getCurrentTheme(selector?: string): Partial<DatepickerTheme>;
2193
- /**
2194
- * Clean up all themes and resources when service is destroyed
2195
- */
2196
- cleanupAllThemes(): void;
2197
- ngOnDestroy(): void;
2198
- static ɵfac: i0.ɵɵFactoryDeclaration<ThemeBuilderService, never>;
2199
- static ɵprov: i0.ɵɵInjectableDeclaration<ThemeBuilderService>;
2200
- }
2201
- /**
2202
- * Datepicker theme interface
2203
- */
2204
- interface DatepickerTheme {
2205
- colors?: {
2206
- primary?: string;
2207
- secondary?: string;
2208
- background?: string;
2209
- surface?: string;
2210
- text?: string;
2211
- textSecondary?: string;
2212
- border?: string;
2213
- hover?: string;
2214
- active?: string;
2215
- disabled?: string;
2216
- error?: string;
2217
- [key: string]: string | undefined;
2218
- };
2219
- spacing?: {
2220
- xs?: string;
2221
- sm?: string;
2222
- md?: string;
2223
- lg?: string;
2224
- xl?: string;
2225
- [key: string]: string | undefined;
2226
- };
2227
- typography?: {
2228
- fontFamily?: string;
2229
- fontSize?: string;
2230
- fontWeight?: string;
2231
- lineHeight?: string;
2232
- [key: string]: string | undefined;
2233
- };
2234
- borderRadius?: {
2235
- sm?: string;
2236
- md?: string;
2237
- lg?: string;
2238
- full?: string;
2239
- [key: string]: string | undefined;
2240
- };
2241
- shadows?: {
2242
- sm?: string;
2243
- md?: string;
2244
- lg?: string;
2245
- /** Focus ring (e.g. input focus). Use a color-mix or rgba for 15% opacity. Example: 0 0 0 3px color-mix(in srgb, var(--datepicker-primary-color) 15%, transparent) */
2246
- focus?: string;
2247
- [key: string]: string | undefined;
2248
- };
2249
- }
2250
-
2251
- /**
2252
- * Date preset interface
2253
- */
2254
- interface DatePreset {
2255
- id: string;
2256
- name: string;
2257
- value: DatepickerValue;
2258
- createdAt: Date;
2259
- updatedAt: Date;
2260
- category?: string;
2261
- description?: string;
2262
- }
2263
- /**
2264
- * Service for managing date presets with localStorage persistence
2265
- */
2266
- declare class DatePresetsService {
2267
- private readonly platformId;
2268
- private readonly storageKey;
2269
- private presets;
2270
- constructor();
2271
- /**
2272
- * Save a date preset
2273
- */
2274
- savePreset(preset: Omit<DatePreset, 'id' | 'createdAt' | 'updatedAt'>): DatePreset;
2275
- /**
2276
- * Update an existing preset
2277
- */
2278
- updatePreset(id: string, updates: Partial<Omit<DatePreset, 'id' | 'createdAt'>>): DatePreset | null;
2279
- /**
2280
- * Get a preset by ID
2281
- */
2282
- getPreset(id: string): DatePreset | null;
2283
- /**
2284
- * Get all presets
2285
- */
2286
- getAllPresets(): DatePreset[];
2287
- /**
2288
- * Get presets by category
2289
- */
2290
- getPresetsByCategory(category: string): DatePreset[];
2291
- /**
2292
- * Get all categories
2293
- */
2294
- getCategories(): string[];
2295
- /**
2296
- * Delete a preset
2297
- */
2298
- deletePreset(id: string): boolean;
2299
- /**
2300
- * Clear all presets
2301
- */
2302
- clearPresets(): void;
2303
- /**
2304
- * Apply a preset value (returns the value, not the preset object)
2305
- */
2306
- applyPreset(id: string): DatepickerValue | null;
2307
- /**
2308
- * Check if a preset exists
2309
- */
2310
- hasPreset(id: string): boolean;
2311
- /**
2312
- * Get preset count
2313
- */
2314
- getPresetCount(): number;
2315
- /**
2316
- * Export presets to JSON
2317
- */
2318
- exportPresets(): string;
2319
- /**
2320
- * Import presets from JSON
2321
- */
2322
- importPresets(jsonString: string, merge?: boolean): {
2323
- imported: number;
2324
- errors: number;
2325
- };
2326
- private loadPresets;
2327
- private persistPresets;
2328
- private generateId;
2329
- private cloneValue;
2330
- private deserializeValue;
2331
- static ɵfac: i0.ɵɵFactoryDeclaration<DatePresetsService, never>;
2332
- static ɵprov: i0.ɵɵInjectableDeclaration<DatePresetsService>;
2333
- }
2334
-
2335
- declare class AriaLiveService implements OnDestroy {
2336
- private readonly platformId;
2337
- private readonly isBrowser;
2338
- private politeRegion;
2339
- private assertiveRegion;
2340
- private politeClearTimeoutId;
2341
- private assertiveClearTimeoutId;
2342
- private debounceTimeoutId;
2343
- private announcementQueue;
2344
- private readonly DEBOUNCE_DELAY;
2345
- private readonly CLEAR_DELAY;
2346
- constructor();
2347
- /**
2348
- * Announce a message to screen readers with improved timing and queue management
2349
- */
2350
- announce(message: string, priority?: 'polite' | 'assertive'): void;
2351
- /**
2352
- * Process queued announcements, keeping only the most recent for each priority
2353
- */
2354
- private processAnnouncementQueue;
2355
- /**
2356
- * Announce to a specific live region
2357
- */
2358
- private announceToRegion;
2359
- /**
2360
- * Set announcement text and schedule cleanup
2361
- */
2362
- private setAnnouncement;
2363
- /**
2364
- * Create a live region for announcements
2365
- */
2366
- private createLiveRegion;
2367
- ngOnDestroy(): void;
2368
- destroy(): void;
2369
- static ɵfac: i0.ɵɵFactoryDeclaration<AriaLiveService, never>;
2370
- static ɵprov: i0.ɵɵInjectableDeclaration<AriaLiveService>;
2371
- }
2372
-
2373
- declare class FocusTrapService implements OnDestroy {
2374
- private activeTraps;
2375
- private focusableSelectors;
2376
- /**
2377
- * Trap focus within an element and restore focus on cleanup
2378
- */
2379
- trapFocus(elementRef: ElementRef<HTMLElement>): () => void;
2380
- /**
2381
- * Remove focus trap and restore previous focus
2382
- */
2383
- private removeFocusTrap;
2384
- private getFirstFocusable;
2385
- private getLastFocusable;
2386
- ngOnDestroy(): void;
2387
- static ɵfac: i0.ɵɵFactoryDeclaration<FocusTrapService, never>;
2388
- static ɵprov: i0.ɵɵInjectableDeclaration<FocusTrapService>;
2389
- }
2390
-
2391
- declare class HapticFeedbackService {
2392
- private readonly platformId;
2393
- private readonly isBrowser;
2394
- private readonly isSupported;
2395
- /**
2396
- * Trigger light haptic feedback (short vibration)
2397
- */
2398
- light(): void;
2399
- selection(): void;
2400
- medium(): void;
2401
- heavy(): void;
2402
- /**
2403
- * Trigger custom vibration pattern
2404
- * @param pattern Vibration pattern in milliseconds
2405
- */
2406
- custom(pattern: number | number[]): void;
2407
- static ɵfac: i0.ɵɵFactoryDeclaration<HapticFeedbackService, never>;
2408
- static ɵprov: i0.ɵɵInjectableDeclaration<HapticFeedbackService>;
2409
- }
2410
-
2411
- export { AriaLiveService, CustomDateFormatService, CustomSelectComponent, DATEPICKER_CONFIG, DEFAULT_ANIMATION_CONFIG, DEFAULT_DATEPICKER_CONFIG, DatePresetsService, DefaultTranslationService, FieldSyncService, FocusTrapService, HapticFeedbackService, LocaleRegistryService, NativeDateAdapter, NgxsmkDatepickerComponent, NgxsmkDatepickerModule, ThemeBuilderService, TranslationRegistryService, addMonths, convertTimezone, exportToCsv, exportToIcs, exportToJson, formatDateWithTimezone, formatLocaleNumber, generateDecadeGrid, generateMonthOptions, generateTimeOptions, generateWeekDays, generateYearGrid, generateYearOptions, get24Hour, getEndOfDay, getEndOfMonth, getFirstDayOfWeek, getStartOfDay, getStartOfMonth, getTimezoneOffset, importFromCsv, importFromIcs, importFromJson, isSameDay, isValidTimezone, normalizeDate, parseDateWithTimezone, processDateRanges, provideDatepickerConfig, subtractDays, update12HourState };
2412
- export type { AnimationConfig, CalendarSystem, DateAdapter, DateFormatHook, DateInput, DatePreset, DateRange, DatepickerConfig, DatepickerHooks, DatepickerTheme, DatepickerTranslations, DatepickerValue, DayCellRenderHook, EventHook, ExportOptions, HolidayProvider, KeyboardShortcutContext, KeyboardShortcutHelp, KeyboardShortcutHook, LocaleData, PartialDatepickerTranslations, SignalFormField, SignalFormFieldConfig, TranslationService, ValidationHook };