@anglr/datetime 2.0.0 → 3.0.0-beta.20220315103241

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/datetime.d.ts DELETED
@@ -1,1915 +0,0 @@
1
- import { AbstractControl } from '@angular/forms';
2
- import { AnimationTriggerMetadata } from '@angular/animations';
3
- import { ChangeDetectorRef } from '@angular/core';
4
- import { ControlValueAccessor } from '@angular/forms';
5
- import { Dictionary } from '@jscrpt/common';
6
- import { ElementRef } from '@angular/core';
7
- import { EventEmitter } from '@angular/core';
8
- import * as i0 from '@angular/core';
9
- import * as i7 from '@angular/common';
10
- import * as i8 from '@anglr/common';
11
- import { InjectionToken } from '@angular/core';
12
- import { Injector } from '@angular/core';
13
- import { Observable } from 'rxjs';
14
- import { OnChanges } from '@angular/core';
15
- import { OnDestroy } from '@angular/core';
16
- import { OnInit } from '@angular/core';
17
- import { PipeTransform } from '@angular/core';
18
- import { SimpleChanges } from '@angular/core';
19
- import { Subject } from 'rxjs';
20
- import { Subscription } from 'rxjs';
21
- import { Type } from '@angular/core';
22
- import { ValidationErrors } from '@angular/forms';
23
- import { Validator } from '@angular/forms';
24
- import { ValidatorFn } from '@angular/forms';
25
-
26
- /**
27
- * Transforms type to required from nullable or undefined type
28
- */
29
- declare class AsRequiredTypePipe implements PipeTransform {
30
- /**
31
- * Transforms type to required from nullable or undefined type
32
- * @param value - Value to be transformed
33
- * @param defaultValue - Default value to be used if undefined or null
34
- */
35
- transform(value: NgClassType, defaultValue?: string): Exclude<NgClassType, undefined | null>;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<AsRequiredTypePipe, never>;
37
- static ɵpipe: i0.ɵɵPipeDeclaration<AsRequiredTypePipe, "asRequiredType">;
38
- }
39
-
40
- /**
41
- * Shared css classes for all pickers
42
- */
43
- export declare interface CommonPickerCssClasses {
44
- /**
45
- * Period selection element wrapping displayed period and previous, next buttons
46
- */
47
- periodSelection?: string;
48
- /**
49
- * Element used for switching period to previous one
50
- */
51
- previousPeriod?: string;
52
- /**
53
- * Element used for switching period to next one
54
- */
55
- nextPeriod?: string;
56
- /**
57
- * Element representing currently displayed period
58
- */
59
- periodValue?: string;
60
- /**
61
- * Element wrapping displayed period data
62
- */
63
- periodData?: string;
64
- /**
65
- * Element representing single datum for period item
66
- */
67
- periodDatum?: string;
68
- }
69
-
70
- /**
71
- * Injection token used for obtaining DateApi implementation
72
- */
73
- export declare const DATE_API: InjectionToken<DateApi>;
74
-
75
- /**
76
- * Injection token used for obtaining datetime picker configuration
77
- */
78
- export declare const DATE_TIME_PICKER_CONFIGURATION: InjectionToken<DateTimePickerOptions<any>>;
79
-
80
- /**
81
- * Injection token used for obtaining datetime selector configuration
82
- */
83
- export declare const DATE_TIME_SELECTOR_CONFIGURATION: InjectionToken<DateTimeSelectorOptions<any>>;
84
-
85
- /**
86
- * Date api abstraction, used for obtaining DateApi wrapper object
87
- */
88
- export declare interface DateApi<TDate = any> {
89
- /**
90
- * Gets wrapping object used for manipulation
91
- * @param value - Value to be converted (parsed) and used for manipulation
92
- * @param format - Format string used for parsing string value
93
- */
94
- getValue(value: DateValue | TDate, format?: string): DateApiObject<TDate>;
95
- /**
96
- * Gets wrapping object used for manipulation instantiated to current date and time
97
- */
98
- now(): DateApiObject<TDate>;
99
- /**
100
- * Gets format string using pseudo format
101
- * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string
102
- */
103
- getFormat(pseudoFormat: string): string;
104
- /**
105
- * Gets information
106
- */
107
- weekStartsOnMonday(): boolean;
108
- /**
109
- * Gets array of weekday names in short format, order of days is dependent on locale
110
- */
111
- weekdaysShort(): string[];
112
- }
113
-
114
- /**
115
- * Instance of object wrapping TDate, allowing manipulation with it
116
- */
117
- export declare interface DateApiObject<TDate = any> {
118
- /**
119
- * Original value that is not changed unless 'updateOriginal' is called
120
- */
121
- readonly originalValue: TDate;
122
- /**
123
- * Instance of date
124
- */
125
- readonly value: TDate;
126
- /**
127
- * Gets indication whether provided instance of date is valid
128
- */
129
- isValid(): boolean;
130
- /**
131
- * Gets indication whether provided instance of date is weekend day
132
- */
133
- isWeekend(): boolean;
134
- /**
135
- * Formats date value
136
- * @param format - Format token used for creating formatted string
137
- */
138
- format(format: string): string;
139
- /**
140
- * Updates value to start date and time of current decade
141
- * @returns Itself for fluent API
142
- */
143
- startOfDecade(): DateApiObject<TDate>;
144
- /**
145
- * Updates value to end date and time of current decade
146
- * @returns Itself for fluent API
147
- */
148
- endOfDecade(): DateApiObject<TDate>;
149
- /**
150
- * Updates value to start date and time of current year
151
- * @returns Itself for fluent API
152
- */
153
- startOfYear(): DateApiObject<TDate>;
154
- /**
155
- * Updates value to end date and time of current year
156
- * @returns Itself for fluent API
157
- */
158
- endOfYear(): DateApiObject<TDate>;
159
- /**
160
- * Add years, if count not specified adds 1 year
161
- * @param count - Number of years count
162
- * @returns Itself for fluent API
163
- */
164
- addYears(count?: number): DateApiObject<TDate>;
165
- /**
166
- * Subtract years, if count not specified subtract 1 year
167
- * @param count - Number of years count
168
- * @returns Itself for fluent API
169
- */
170
- subtractYears(count?: number): DateApiObject<TDate>;
171
- /**
172
- * Updates value to start date and time of current month
173
- * @returns Itself for fluent API
174
- */
175
- startOfMonth(): DateApiObject<TDate>;
176
- /**
177
- * Updates value to end date and time of current month
178
- * @returns Itself for fluent API
179
- */
180
- endOfMonth(): DateApiObject<TDate>;
181
- /**
182
- * Add months, if count not specified adds 1 month
183
- * @param count - Number of months count
184
- * @returns Itself for fluent API
185
- */
186
- addMonths(count?: number): DateApiObject<TDate>;
187
- /**
188
- * Subtract months, if count not specified subtract 1 month
189
- * @param count - Number of months count
190
- * @returns Itself for fluent API
191
- */
192
- subtractMonths(count?: number): DateApiObject<TDate>;
193
- /**
194
- * Updates value to start date and time of current week
195
- * @returns Itself for fluent API
196
- */
197
- startOfWeek(): DateApiObject<TDate>;
198
- /**
199
- * Updates value to end date and time of current week
200
- * @returns Itself for fluent API
201
- */
202
- endOfWeek(): DateApiObject<TDate>;
203
- /**
204
- * Add weeks, if count not specified adds 1 week
205
- * @param count - Number of weeks count
206
- * @returns Itself for fluent API
207
- */
208
- addWeeks(count?: number): DateApiObject<TDate>;
209
- /**
210
- * Subtract weeks, if count not specified subtract 1 week
211
- * @param count - Number of weeks count
212
- * @returns Itself for fluent API
213
- */
214
- subtractWeeks(count?: number): DateApiObject<TDate>;
215
- /**
216
- * Updates value to start date and time of current day
217
- * @returns Itself for fluent API
218
- */
219
- startOfDay(): DateApiObject<TDate>;
220
- /**
221
- * Updates value to end date and time of current day
222
- * @returns Itself for fluent API
223
- */
224
- endOfDay(): DateApiObject<TDate>;
225
- /**
226
- * Add days, if count not specified adds 1 day
227
- * @param count - Number of days count
228
- * @returns Itself for fluent API
229
- */
230
- addDays(count?: number): DateApiObject<TDate>;
231
- /**
232
- * Subtract days, if count not specified subtract 1 day
233
- * @param count - Number of days count
234
- * @returns Itself for fluent API
235
- */
236
- subtractDays(count?: number): DateApiObject<TDate>;
237
- /**
238
- * Gets number of days in month
239
- */
240
- daysInMonth(): number;
241
- /**
242
- * Gets year
243
- */
244
- year(): number;
245
- /**
246
- * Sets year
247
- * @param year - Year to be set
248
- */
249
- year(year: number): DateApiObject<TDate>;
250
- /**
251
- * Gets or sets year
252
- * @param year - If specified, sets year
253
- */
254
- year(year?: number): DateApiObject<TDate> | number;
255
- /**
256
- * Gets month
257
- */
258
- month(): number;
259
- /**
260
- * Sets month
261
- * @param month - Month to be set
262
- */
263
- month(month: number): DateApiObject<TDate>;
264
- /**
265
- * Gets or sets month
266
- * @param month - If specified, sets month
267
- */
268
- month(month?: number): DateApiObject<TDate> | number;
269
- /**
270
- * Gets day of month one based
271
- */
272
- dayOfMonth(): number;
273
- /**
274
- * Sets day of month one based
275
- * @param day - Day of month to be set
276
- */
277
- dayOfMonth(day: number): DateApiObject<TDate>;
278
- /**
279
- * Gets or sets day of month one based
280
- * @param day - If specified, sets day of month
281
- */
282
- dayOfMonth(day?: number): DateApiObject<TDate> | number;
283
- /**
284
- * Gets day of week zero based, first is monday
285
- */
286
- dayOfWeek(): number;
287
- /**
288
- * Sets day of week zero based, first is monday
289
- * @param day - Day of week to be set
290
- */
291
- dayOfWeek(day: number): DateApiObject<TDate>;
292
- /**
293
- * Gets or sets day of week zero based, first is monday
294
- * @param day - If specified, sets day of week
295
- */
296
- dayOfWeek(day?: number): number | DateApiObject<TDate>;
297
- /**
298
- * Gets indication whether current value is before 'date'
299
- * @param date - Date which is this date compared to
300
- */
301
- isBefore(date: TDate): boolean;
302
- /**
303
- * Gets indication whether current value is after 'date'
304
- * @param date - Date which is this date compared to
305
- */
306
- isAfter(date: TDate): boolean;
307
- /**
308
- * Gets number of days between this and provided date
309
- * @param date - Date which is used for computation of diff against
310
- */
311
- diffDays(date: TDate): number;
312
- /**
313
- * Compares whether this date is same week as provided date
314
- * @param date - Date which is used for comparison of same week
315
- */
316
- isSameWeek(date: TDate): boolean;
317
- /**
318
- * Compares whether this date is same decade as provided date
319
- * @param date - Date which is used for comparison of same decade
320
- */
321
- isSameDecade(date: TDate): boolean;
322
- /**
323
- * Compares whether this date is same year as provided date
324
- * @param date - Date which is used for comparison of same year
325
- */
326
- isSameYear(date: TDate): boolean;
327
- /**
328
- * Compares whether this date is same month as provided date
329
- * @param date - Date which is used for comparison of same month
330
- */
331
- isSameMonth(date: TDate): boolean;
332
- /**
333
- * Compares whether this date is same day as provided date
334
- * @param date - Date which is used for comparison of same day
335
- */
336
- isSameDay(date: TDate): boolean;
337
- /**
338
- * Creates clone of this instance, value and originalValue have same value and are cloned from value
339
- */
340
- clone(): DateApiObject<TDate>;
341
- /**
342
- * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue
343
- */
344
- cloneOriginal(): DateApiObject<TDate>;
345
- /**
346
- * Updates originalValue, if value is not provided originalValue is set to value
347
- * @param value - Value to be set as original, or null (value will be used as value)
348
- * @returns Itself for fluent API
349
- */
350
- updateOriginal(value?: TDate): DateApiObject<TDate>;
351
- /**
352
- * Changes value to same value as originalValue
353
- * @returns Itself for fluent API
354
- */
355
- resetOriginal(): DateApiObject<TDate>;
356
- }
357
-
358
- /**
359
- * Pipe that is used for converting date
360
- */
361
- export declare class DateConvertPipe<TDate = any> implements PipeTransform {
362
- private _dateApi;
363
- constructor(_dateApi: DateApi<TDate>);
364
- /**
365
- * Transforms value into date object
366
- * @param value - value to be transformed
367
- * @param parseFormat - format used for parsing string date
368
- */
369
- transform(value: TDate | DateValue, parseFormat?: string): TDate | null;
370
- static ɵfac: i0.ɵɵFactoryDeclaration<DateConvertPipe<any>, never>;
371
- static ɵpipe: i0.ɵɵPipeDeclaration<DateConvertPipe<any>, "dateConvert">;
372
- }
373
-
374
- /**
375
- * Pipe that is used for formatting date
376
- */
377
- export declare class DateFormatPipe<TDate = any> implements PipeTransform {
378
- private _formatProvider;
379
- private _dateApi;
380
- constructor(_formatProvider: FormatProvider, _dateApi: DateApi<TDate>);
381
- /**
382
- * Formats provided date into formatted string
383
- * @param value - value to be transformed
384
- * @param format - Format that is used for formatting, can be also 'FormatProvider' key
385
- * @param parseFormat - format used for parsing string date
386
- */
387
- transform(value: TDate | DateValue, format?: string | keyof FormatProvider, parseFormat?: string): string;
388
- static ɵfac: i0.ɵɵFactoryDeclaration<DateFormatPipe<any>, never>;
389
- static ɵpipe: i0.ɵɵPipeDeclaration<DateFormatPipe<any>, "dateFormat">;
390
- }
391
-
392
- /**
393
- * Module used for exporting date pipes
394
- */
395
- export declare class DatePipesModule {
396
- static ɵfac: i0.ɵɵFactoryDeclaration<DatePipesModule, never>;
397
- static ɵmod: i0.ɵɵNgModuleDeclaration<DatePipesModule, [typeof i1_4.AsRequiredTypePipe, typeof i2_3.DateFormatPipe, typeof i3_3.DateConvertPipe], never, [typeof i1_4.AsRequiredTypePipe, typeof i2_3.DateFormatPipe, typeof i3_3.DateConvertPipe]>;
398
- static ɵinj: i0.ɵɵInjectorDeclaration<DatePipesModule>;
399
- }
400
-
401
- /**
402
- * Parser used for parsing date using provided format and returning positions and selected date part
403
- */
404
- export declare interface DatePositionParser {
405
- /**
406
- * Parse date as string and returns information about positions and selected part of date
407
- * @param date - String date to be parsed
408
- * @param cursorPosition - Current cursor position
409
- */
410
- parse(date: string, cursorPosition: number): DatePositionParserResult;
411
- /**
412
- * Parse date as string and returns information about position and selected part of date, while moving it to next part, if it was last part returns null
413
- * @param date - String date to be parsed
414
- * @param cursorPosition - Current cursor position
415
- */
416
- next(date: string, cursorPosition: number): null | DatePositionParserResult;
417
- /**
418
- * Parse date as string and returns information about position and selected part of date, while moving it to previous part, if it was first part returns null
419
- * @param date - String date to be parsed
420
- * @param cursorPosition - Current cursor position
421
- */
422
- previous(date: string, cursorPosition: number): null | DatePositionParserResult;
423
- }
424
-
425
- /**
426
- * Result of date position parsing
427
- */
428
- export declare interface DatePositionParserResult {
429
- /**
430
- * Index of charater where returned part of date starts
431
- */
432
- positionFrom: number;
433
- /**
434
- * Index of charater where returned part of date ends
435
- */
436
- positionTo: number;
437
- /**
438
- * Type of part that is selected
439
- */
440
- part: string;
441
- }
442
-
443
- /**
444
- * Service used for parsing date
445
- */
446
- export declare class DatePositionParserService {
447
- /**
448
- * Creates parser instance for specified format
449
- * @param format - Format to be used for parsing date string
450
- */
451
- createParser(format: string): DatePositionParser;
452
- static ɵfac: i0.ɵɵFactoryDeclaration<DatePositionParserService, never>;
453
- static ɵprov: i0.ɵɵInjectableDeclaration<DatePositionParserService>;
454
- }
455
-
456
- /**
457
- * Angular module for date time basic input selector component
458
- */
459
- export declare class DateTimeBasicSelectorModule {
460
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeBasicSelectorModule, never>;
461
- static ɵmod: i0.ɵɵNgModuleDeclaration<DateTimeBasicSelectorModule, [typeof i1.SimpleInputDateTimeSelectorComponent], never, never>;
462
- static ɵinj: i0.ɵɵInjectorDeclaration<DateTimeBasicSelectorModule>;
463
- }
464
-
465
- /**
466
- * Component used for displaying day picker
467
- */
468
- export declare class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses> {
469
- /**
470
- * Stored this picker month data
471
- */
472
- protected _thisMonthData: DayData<TDate>[];
473
-
474
- constructor(dateApi: DateApi<TDate>, changeDetector: ChangeDetectorRef);
475
-
476
-
477
-
478
- /**
479
- * Set displays date to be displayed
480
- * @param value - Value that identifies period that is going to be displayed
481
- */
482
- display(value: DateApiObject<TDate>): void;
483
- /**
484
- * Obtains end of period
485
- * @param period - Period for which should be end obtained
486
- */
487
- protected _endOfPeriod(period: PeriodData<TDate>): TDate;
488
- /**
489
- * Tests whether provided value is in same period as displayed picker
490
- * @param val - Tested value for same period as displayed picker
491
- */
492
- protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean;
493
- /**
494
- * Tests whether provided value is in same period target value
495
- * @param val - Tested value
496
- * @param target - Target value to be tested against
497
- */
498
- protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean;
499
- /**
500
- * Gets period data for specified value
501
- * @param val - Value for which is period data obtained
502
- */
503
- protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>;
504
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeDayPickerComponent<any>, never>;
505
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeDayPickerComponent<any>, "date-time-day-picker", never, {}, {}, never, never>;
506
- }
507
-
508
- /**
509
- * Directive injecting datetime max validator, validating max datetime value
510
- */
511
- export declare class DatetimeMaxValidatorDirective<TDate = any> implements Validator {
512
- /**
513
- * Function used for validations
514
- */
515
- private _validator;
516
- constructor(datetimeSelector: DateTimeSelectorComponent<TDate>, dateApi: DateApi<TDate>);
517
- /**
518
- * Validates input and returns validation result
519
- * @param control - Control that is being validated
520
- * @returns validation results
521
- */
522
- validate(control: AbstractControl): ValidationErrors | null;
523
- static ɵfac: i0.ɵɵFactoryDeclaration<DatetimeMaxValidatorDirective<any>, never>;
524
- static ɵdir: i0.ɵɵDirectiveDeclaration<DatetimeMaxValidatorDirective<any>, "date-time-selector[validate][maxValue][formControlName]:not([range]),date-time-selector[validate][maxValue][formControl]:not([range]),date-time-selector[validate][maxValue][ngModel]:not([range])", never, {}, {}, never>;
525
- }
526
-
527
- /**
528
- * Directive injecting datetime min validator, validating min datetime value
529
- */
530
- export declare class DatetimeMinValidatorDirective<TDate = any> implements Validator {
531
- /**
532
- * Function used for validations
533
- */
534
- private _validator;
535
- constructor(datetimeSelector: DateTimeSelectorComponent<TDate>, dateApi: DateApi<TDate>);
536
- /**
537
- * Validates input and returns validation result
538
- * @param control - Control that is being validated
539
- * @returns validation results
540
- */
541
- validate(control: AbstractControl): ValidationErrors | null;
542
- static ɵfac: i0.ɵɵFactoryDeclaration<DatetimeMinValidatorDirective<any>, never>;
543
- static ɵdir: i0.ɵɵDirectiveDeclaration<DatetimeMinValidatorDirective<any>, "date-time-selector[validate][minValue][formControlName]:not([range]),date-time-selector[validate][minValue][formControl]:not([range]),date-time-selector[validate][minValue][ngModel]:not([range])", never, {}, {}, never>;
544
- }
545
-
546
- /**
547
- * Component used for displaying month picker
548
- */
549
- export declare class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements DateTimePicker<TDate, MonthPickerCssClasses> {
550
- constructor(dateApi: DateApi<TDate>, changeDetector: ChangeDetectorRef);
551
-
552
-
553
- /**
554
- * Set displays date to be displayed
555
- * @param value - Value that identifies period that is going to be displayed
556
- */
557
- display(value: DateApiObject<TDate>): void;
558
- /**
559
- * Obtains end of period
560
- * @param period - Period for which should be end obtained
561
- */
562
- protected _endOfPeriod(period: PeriodData<TDate>): TDate;
563
- /**
564
- * Tests whether provided value is in same period as displayed picker
565
- * @param val - Tested value for same period as displayed picker
566
- */
567
- protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean;
568
- /**
569
- * Tests whether provided value is in same period target value
570
- * @param val - Tested value
571
- * @param target - Target value to be tested against
572
- */
573
- protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean;
574
- /**
575
- * Gets period data for specified value
576
- * @param val - Value for which is period data obtained
577
- */
578
- protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>;
579
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeMonthPickerComponent<any>, never>;
580
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeMonthPickerComponent<any>, "date-time-month-picker", never, {}, {}, never, never>;
581
- }
582
-
583
- /**
584
- * Describes datetime picker component used for displaying and selecting value
585
- */
586
- export declare interface DateTimePicker<TDate = any, TCssClasses = object> {
587
- /**
588
- * Gets current value of datetime
589
- */
590
- readonly value: DateTimeValue<TDate> | null;
591
- /**
592
- * Occurs when value changes
593
- */
594
- readonly valueChange: Observable<void>;
595
- /**
596
- * Occurs when user scales up
597
- */
598
- readonly scaleUp: Observable<TDate>;
599
- /**
600
- * Occurs when user scales down
601
- */
602
- readonly scaleDown: Observable<TDate>;
603
- /**
604
- * Sets css classes for picker, allowing to override defaults
605
- * @param cssClasses - Css classes to be set for picker
606
- */
607
- setCssClasses(cssClasses: TCssClasses): void;
608
- /**
609
- * Sets minimal possible value for picker, that can be picked
610
- * @param value - Minimal possible value that can be picked
611
- */
612
- setMinValue(value: TDate | null): void;
613
- /**
614
- * Sets maximal possible value for picker, that can be picked
615
- * @param value - Maximal possible value that can be picked
616
- */
617
- setMaxValue(value: TDate | null): void;
618
- /**
619
- * Sets value of datetime picker
620
- * @param value - Value to be set to this picker
621
- */
622
- setValue(value: DateTimeValue<TDate> | null): void;
623
- /**
624
- * Set displays date to be displayed
625
- * @param value - Value that identifies period that is going to be displayed
626
- */
627
- display(value: DateApiObject<TDate>): void;
628
- /**
629
- * Sets indication whether can go down
630
- * @param value - Indication whether can go down in period
631
- */
632
- setCanGoDown(value: boolean): void;
633
- /**
634
- * Sets indication whether can go up
635
- * @param value - Indication whether can go up in period
636
- */
637
- setCanGoUp(value: boolean): void;
638
- /**
639
- * Explicitly runs invalidation of content (change detection)
640
- */
641
- invalidateVisuals(): void;
642
- }
643
-
644
- /**
645
- * Component used for displaying date time picker
646
- */
647
- export declare class DateTimePickerComponent<TDate = any> implements OnInit, OnDestroy {
648
- protected _dateApi: DateApi<TDate>;
649
- protected _changeDetector: ChangeDetectorRef;
650
- /**
651
- * Instance of active date time picker
652
- */
653
- protected _activePicker?: DateTimePicker<TDate>;
654
- /**
655
- * Name, id of displayed picker
656
- */
657
- protected _activePickerName: string;
658
- /**
659
- * Array of available picker names
660
- */
661
- protected _pickerNames: string[];
662
- /**
663
- * Current selected value
664
- */
665
- protected _value: DateTimeValue<TDate> | null;
666
- /**
667
- * All subscriptions for active picker
668
- */
669
- protected _activePickerSubscriptions: Subscription;
670
- /**
671
- * Date that should be displayed in picker, used when moving up or down in periods
672
- */
673
- protected _display?: TDate;
674
- /**
675
- * Minimal possible value that can be picked
676
- */
677
- protected _minValue: TDate | null;
678
- /**
679
- * Maximal possible value that can be picked
680
- */
681
- protected _maxValue: TDate | null;
682
- /**
683
- * Current options used by picker
684
- */
685
- protected _options: DateTimePickerOptions<DateTimePicker<TDate>>;
686
-
687
-
688
- /**
689
- * Current options used by picker
690
- */
691
- get options(): DateTimePickerOptions<DateTimePicker<TDate>>;
692
- set options(value: DateTimePickerOptions<DateTimePicker<TDate>>);
693
- /**
694
- * Current selected value
695
- */
696
- get value(): DateTimeValue<TDate> | null;
697
- set value(value: DateTimeValue<TDate> | null);
698
- /**
699
- * Gets or sets minimal possible value for picker, that can be picked
700
- */
701
- get minValue(): TDate | null;
702
- set minValue(value: TDate | null);
703
- /**
704
- * Gets or sets maximal possible value for picker, that can be picked
705
- */
706
- get maxValue(): TDate | null;
707
- set maxValue(value: TDate | null);
708
- /**
709
- * Occurs when value changes
710
- */
711
- valueChange: EventEmitter<DateTimeValue<TDate>>;
712
- constructor(configuration: DateTimePickerOptions<DateTimePicker<TDate>>, _dateApi: DateApi<TDate>, _changeDetector: ChangeDetectorRef);
713
- /**
714
- * Initialize component
715
- */
716
- ngOnInit(): void;
717
- /**
718
- * Called when component is destroyed
719
- */
720
- ngOnDestroy(): void;
721
-
722
- /**
723
- * Sets picker css classes
724
- */
725
- protected _setPickerCssClasses(): void;
726
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent<any>, [{ optional: true; }, null, null]>;
727
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent<any>, "date-time-picker", never, { "options": "options"; "value": "value"; "minValue": "minValue"; "maxValue": "maxValue"; }, { "valueChange": "valueChange"; }, never, never>;
728
- }
729
-
730
- /**
731
- * Css classes applied to datetime picker
732
- */
733
- export declare interface DateTimePickerCssClasses {
734
- /**
735
- * Shared css classes for all pickers
736
- */
737
- pickerShared?: CommonPickerCssClasses;
738
- /**
739
- * Custom css classes specific for each picker type
740
- */
741
- pickerCustom?: Dictionary<object>;
742
- }
743
-
744
- /**
745
- * Angular module for date time picker components
746
- */
747
- export declare class DateTimePickerModule {
748
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerModule, never>;
749
- static ɵmod: i0.ɵɵNgModuleDeclaration<DateTimePickerModule, [typeof i1_3.DateTimePickerComponent, typeof i2_2.DateTimeDayPickerComponent, typeof i3_2.DateTimeMonthPickerComponent, typeof i4_2.DateTimeYearPickerComponent], [typeof i7.CommonModule, typeof i8.CommonDynamicModule, typeof i7_2.DatePipesModule], [typeof i1_3.DateTimePickerComponent]>;
750
- static ɵinj: i0.ɵɵInjectorDeclaration<DateTimePickerModule>;
751
- }
752
-
753
- /**
754
- * Defintion of datetime picker component options
755
- */
756
- export declare interface DateTimePickerOptions<TPicker = any> {
757
- /**
758
- * Order of pickers, it's possible use less pickers as is defined in pickerPeriodsDefinition for example 'month,year'
759
- */
760
- pickerPeriodsOrder?: string[] | string;
761
- /**
762
- * Definition of types for each period type for picker
763
- */
764
- pickerPeriodsDefinition?: Dictionary<Type<TPicker>>;
765
- /**
766
- * Name of default period for picker that is displayed
767
- */
768
- defaultPeriod?: string;
769
- /**
770
- * Css classes for date time picker
771
- */
772
- cssClasses?: DateTimePickerCssClasses;
773
- }
774
-
775
- /**
776
- * Service used for parsing relative date time strings
777
- */
778
- export declare class DateTimeRelativeParser<TDate = any> {
779
- protected _injector: Injector;
780
- /**
781
- * Date api for handling
782
- */
783
- protected _dateApi?: DateApi<TDate>;
784
- constructor(_injector: Injector);
785
- /**
786
- * Tries to parse relative value and returns parsed TDate, otherwise returns input value
787
- * @param value - Value to be parsed
788
- */
789
- parse(value: TDate | DateValue): TDate | DateValue;
790
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeRelativeParser<any>, never>;
791
- static ɵprov: i0.ɵɵInjectableDeclaration<DateTimeRelativeParser<any>>;
792
- }
793
-
794
- /**
795
- * Describes datetime selector component used for displaying and selecting value
796
- */
797
- export declare interface DateTimeSelector<TDate = any> {
798
- /**
799
- * Currently used format for displaying data
800
- */
801
- format: string;
802
- /**
803
- * Placeholder that is displayed when there is no value selected
804
- */
805
- placeholder?: string;
806
- /**
807
- * Gets current value of datetime
808
- */
809
- readonly value: DateTimeValue<TDate> | null;
810
- /**
811
- * Gets formatted value
812
- */
813
- readonly formattedValue: string | null;
814
- /**
815
- * Gets indication whether is current value valid
816
- */
817
- readonly valid: boolean;
818
- /**
819
- * Occurs when value changes
820
- */
821
- readonly valueChange: Observable<void>;
822
- /**
823
- * Occurs when selector is touched by user
824
- */
825
- readonly touched: Observable<void>;
826
- /**
827
- * Occurs when selector requires picker to be displayed or hidden
828
- */
829
- readonly pickerRequest: Observable<boolean>;
830
- /**
831
- * Sets minimal possible value for picker, that can be picked
832
- * @param value - Minimal possible value that can be picked
833
- */
834
- setMinValue(value: TDate | null): void;
835
- /**
836
- * Sets maximal possible value for picker, that can be picked
837
- * @param value - Maximal possible value that can be picked
838
- */
839
- setMaxValue(value: TDate | null): void;
840
- /**
841
- * Sets value of datetime selector
842
- * @param value - Value to be set to this selector
843
- */
844
- setValue(value: DateTimeValue<TDate> | null): void;
845
- /**
846
- * Sets as 'control' disabled
847
- * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
848
- */
849
- setDisabled(disabled?: boolean): void;
850
- /**
851
- * Explicitly runs invalidation of content (change detection)
852
- */
853
- invalidateVisuals(): void;
854
- }
855
-
856
- /**
857
- * Component used for displaying and selecting date time
858
- */
859
- export declare class DateTimeSelectorComponent<TDate = any> implements OnInit, OnChanges, OnDestroy {
860
- protected _valueProvider: DateValueProvider<TDate>;
861
- protected _changeDetector: ChangeDetectorRef;
862
- protected _dateApi: DateApi<TDate>;
863
- /**
864
- * Current value of datetime
865
- */
866
- protected _value: DateTimeValue<TDate> | null;
867
- /**
868
- * Occurs when selector is touched by user
869
- */
870
- protected _touched: Subject<void>;
871
- /**
872
- * Occurs when value changes
873
- */
874
- protected _valueChange: Subject<void>;
875
- /**
876
- * Indication whether is control disabled
877
- */
878
- protected _disabled: boolean;
879
- /**
880
- * Instance of active date time selector
881
- */
882
- protected _activeSelector?: DateTimeSelector<TDate>;
883
- /**
884
- * All subscriptions for active selector
885
- */
886
- protected _activeSelectorSubscriptions: Subscription;
887
- /**
888
- * Subscription for changes of min value selector
889
- */
890
- protected _minValueChangeSubscription: Subscription | null;
891
- /**
892
- * Subscription for changes of max value selector
893
- */
894
- protected _maxValueChangeSubscription: Subscription | null;
895
- /**
896
- * Current options used by selector
897
- */
898
- protected _options: DateTimeSelectorOptions<DateTimeSelector<TDate>>;
899
- /**
900
- * Placeholder that is displayed when there is no value selected
901
- */
902
- protected _placeholder?: string;
903
- /**
904
- * Gets or sets current value of datetime
905
- */
906
- get value(): DateTimeValue<TDate> | null;
907
- set value(value: DateTimeValue<TDate> | null);
908
- /**
909
- * Gets indication whether is current value valid
910
- */
911
- get valid(): boolean;
912
- /**
913
- * Gets or sets formatted value
914
- */
915
- get formattedValue(): string | null;
916
- set formattedValue(value: string | null);
917
- /**
918
- * Occurs when selector is touched by user
919
- */
920
- get touched(): Observable<void>;
921
- /**
922
- * Occurs when value changes
923
- */
924
- get valueChange(): Observable<void>;
925
-
926
-
927
- /**
928
- * Gets or sets minimal possible value for picker, that can be picked
929
- */
930
- min: TDate | null;
931
- /**
932
- * Gets or sets maximal possible value for picker, that can be picked
933
- */
934
- max: TDate | null;
935
- /**
936
- * Format of displayed
937
- */
938
- format: string;
939
- /**
940
- * Gets or sets placeholder that is displayed when there is no value selected
941
- */
942
- get placeholder(): string | undefined;
943
- set placeholder(value: string | undefined);
944
- /**
945
- * Current options used by selector
946
- */
947
- get options(): DateTimeSelectorOptions<DateTimeSelector<TDate>>;
948
- set options(value: DateTimeSelectorOptions<DateTimeSelector<TDate>>);
949
- /**
950
- * Gets or sets minimal possible value for picker, that can be picked
951
- */
952
- get minValue(): TDate | string | null | DateTimeSelectorComponent<TDate>;
953
- set minValue(value: TDate | string | null | DateTimeSelectorComponent<TDate>);
954
- /**
955
- * Gets or sets maximal possible value for picker, that can be picked
956
- */
957
- get maxValue(): TDate | string | null | DateTimeSelectorComponent<TDate>;
958
- set maxValue(value: TDate | string | null | DateTimeSelectorComponent<TDate>);
959
- constructor(configuration: DateTimeSelectorOptions<DateTimeSelector<TDate>>, _valueProvider: DateValueProvider<TDate>, _changeDetector: ChangeDetectorRef, _dateApi: DateApi<TDate>, formatProvider: FormatProvider);
960
- /**
961
- * Initialize component
962
- */
963
- ngOnInit(): void;
964
- /**
965
- * Called when input value changes
966
- */
967
- ngOnChanges(changes: SimpleChanges): void;
968
- /**
969
- * Called when component is destroyed
970
- */
971
- ngOnDestroy(): void;
972
-
973
-
974
- /**
975
- * Sets as 'control' disabled
976
- * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
977
- */
978
- setDisabled(disabled?: boolean): void;
979
- /**
980
- * Gets simple value of selector
981
- */
982
- valueOf(): TDate | null;
983
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeSelectorComponent<any>, [{ optional: true; }, null, null, null, null]>;
984
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeSelectorComponent<any>, "date-time-selector", never, { "format": "format"; "placeholder": "placeholder"; "options": "options"; "minValue": "minValue"; "maxValue": "maxValue"; }, {}, never, never>;
985
- }
986
-
987
- /**
988
- * Value accessor for getting and setting values for date time selector
989
- */
990
- export declare class DateTimeSelectorControlValueAccessor<TDate> implements ControlValueAccessor, OnDestroy {
991
- protected _selector: DateTimeSelectorComponent<TDate>;
992
- /**
993
- * Subscriptions that are destroyed on directive destruction
994
- */
995
- protected _subscriptions: Subscription;
996
- /**
997
- * Indication whether value for selector is represented as range from, to
998
- */
999
- range: boolean;
1000
- /**
1001
- * Indication whether value for selector is represented as formatted string value, if both 'formatted' and 'range' are set, 'range' takes precedence
1002
- */
1003
- formatted: boolean;
1004
- constructor(_selector: DateTimeSelectorComponent<TDate>);
1005
- /**
1006
- * Called when component is destroyed
1007
- */
1008
- ngOnDestroy(): void;
1009
- /**
1010
- * Sets value to datetime selector
1011
- */
1012
- writeValue(value: string | DateTimeValue<TDate> | TDate | null): void;
1013
- /**
1014
- * Registers callback that is called when value of datetime selector value changes
1015
- */
1016
- registerOnChange(fn: (data: string | DateTimeValue<TDate> | TDate | null) => any): void;
1017
- /**
1018
- * Registers callback that is called when datetime selector was touched by user
1019
- */
1020
- registerOnTouched(fn: () => any): void;
1021
- /**
1022
- * Used for setting control as disabled
1023
- * @param isDisabled - disabled status to set on the element
1024
- */
1025
- setDisabledState(isDisabled: boolean): void;
1026
- /**
1027
- * Used for emitting value that was changed
1028
- * @param fn - Function that is used for emitting changed value
1029
- */
1030
- protected _emitValue(fn: (value: string | DateTimeValue<TDate> | TDate | null) => any): void;
1031
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeSelectorControlValueAccessor<any>, never>;
1032
- static ɵdir: i0.ɵɵDirectiveDeclaration<DateTimeSelectorControlValueAccessor<any>, "date-time-selector[formControlName],date-time-selector[formControl],date-time-selector[ngModel]", never, { "range": "range"; "formatted": "formatted"; }, {}, never>;
1033
- }
1034
-
1035
- /**
1036
- * Angular module for date time selector components
1037
- */
1038
- export declare class DateTimeSelectorModule {
1039
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeSelectorModule, never>;
1040
- static ɵmod: i0.ɵɵNgModuleDeclaration<DateTimeSelectorModule, [typeof i1_2.DateTimeSelectorComponent, typeof i2.InputDateTimeSelectorComponent, typeof i3.DateTimeSelectorControlValueAccessor, typeof i4.DatetimeValidatorDirective, typeof i5.DatetimeMinValidatorDirective, typeof i6.DatetimeMaxValidatorDirective], [typeof i7.CommonModule, typeof i8.CommonDynamicModule, typeof i9.DateTimePickerModule], [typeof i1_2.DateTimeSelectorComponent, typeof i3.DateTimeSelectorControlValueAccessor, typeof i4.DatetimeValidatorDirective, typeof i5.DatetimeMinValidatorDirective, typeof i6.DatetimeMaxValidatorDirective]>;
1041
- static ɵinj: i0.ɵɵInjectorDeclaration<DateTimeSelectorModule>;
1042
- }
1043
-
1044
- /**
1045
- * Defintion of datetime selector component options
1046
- */
1047
- export declare interface DateTimeSelectorOptions<TSelector = any, TPicker = any> extends DateTimePickerOptions<TPicker> {
1048
- /**
1049
- * Definition of type that is used for selector
1050
- */
1051
- selectorComponent: Type<TSelector>;
1052
- /**
1053
- * Indication whether close picker on value selection
1054
- */
1055
- pickerCloseOnValueSelect?: boolean;
1056
- /**
1057
- * Indication whether picker is disabled
1058
- */
1059
- pickerDisabled?: boolean;
1060
- }
1061
-
1062
- /**
1063
- * Directive injecting datetime validator, validating datetime
1064
- */
1065
- export declare class DatetimeValidatorDirective<TDate = any> implements Validator {
1066
- /**
1067
- * Function used for validations
1068
- */
1069
- private _validator;
1070
- constructor(datetimeSelector: DateTimeSelectorComponent<TDate>);
1071
- /**
1072
- * Validates input and returns validation result
1073
- * @param control - Control that is being validated
1074
- * @returns validation results
1075
- */
1076
- validate(control: AbstractControl): ValidationErrors | null;
1077
- static ɵfac: i0.ɵɵFactoryDeclaration<DatetimeValidatorDirective<any>, never>;
1078
- static ɵdir: i0.ɵɵDirectiveDeclaration<DatetimeValidatorDirective<any>, "date-time-selector[validate][formControlName]:not([range]),date-time-selector[validate][formControl]:not([range]),date-time-selector[validate][ngModel]:not([range])", never, {}, {}, never>;
1079
- }
1080
-
1081
- /**
1082
- * Represents datetime value as period
1083
- */
1084
- export declare interface DateTimeValue<TDate = any> {
1085
- /**
1086
- * Starting date and time of period
1087
- */
1088
- from: TDate;
1089
- /**
1090
- * Ending date and time of period
1091
- */
1092
- to: TDate;
1093
- }
1094
-
1095
- /**
1096
- * Represents object that holds data for indentification of validity of date time
1097
- */
1098
- export declare interface DateTimeValueObject<TDate = any> {
1099
- /**
1100
- * Current value of datetime
1101
- */
1102
- readonly value: DateTimeValue<TDate> | null;
1103
- /**
1104
- * Indicaiton whether is current value valid, empty value is valid
1105
- */
1106
- readonly valid: boolean;
1107
- /**
1108
- * Minimal possible value, that can be
1109
- */
1110
- readonly minValue: TDate | null;
1111
- /**
1112
- * Maximal possible value, that can be
1113
- */
1114
- readonly maxValue: TDate | null;
1115
- }
1116
-
1117
- /**
1118
- * Component used for displaying year picker
1119
- */
1120
- export declare class DateTimeYearPickerComponent<TDate = any> extends PickerBaseComponent<TDate, YearData<TDate>, YearPickerCssClasses> implements DateTimePicker<TDate, YearPickerCssClasses> {
1121
-
1122
- constructor(dateApi: DateApi<TDate>, changeDetector: ChangeDetectorRef);
1123
-
1124
-
1125
- /**
1126
- * Set displays date to be displayed
1127
- * @param value - Value that identifies period that is going to be displayed
1128
- */
1129
- display(value: DateApiObject<TDate>): void;
1130
- /**
1131
- * Obtains end of period
1132
- * @param period - Period for which should be end obtained
1133
- */
1134
- protected _endOfPeriod(period: PeriodData<TDate>): TDate;
1135
- /**
1136
- * Tests whether provided value is in same period as displayed picker
1137
- * @param val - Tested value for same period as displayed picker
1138
- */
1139
- protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean;
1140
- /**
1141
- * Tests whether provided value is in same period target value
1142
- * @param val - Tested value
1143
- * @param target - Target value to be tested against
1144
- */
1145
- protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean;
1146
- /**
1147
- * Gets period data for specified value
1148
- * @param val - Value for which is period data obtained
1149
- */
1150
- protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>;
1151
- static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeYearPickerComponent<any>, never>;
1152
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeYearPickerComponent<any>, "date-time-year-picker", never, {}, {}, never, never>;
1153
- }
1154
-
1155
- /**
1156
- * Date can be represented as formatted string, timestamp or javascript Date object
1157
- */
1158
- export declare type DateValue = Date | string | number;
1159
-
1160
- /**
1161
- * Class used for obtaining DateTimeValue for various formats
1162
- */
1163
- export declare class DateValueProvider<TDate = any> {
1164
- protected _dateApi: DateApi<TDate>;
1165
- constructor(_dateApi: DateApi<TDate>);
1166
- /**
1167
- * Gets DateTimeValue from single value based on format
1168
- * @param value - Current value to be converted to ranged value
1169
- * @param format - Format that is requested to be displayed, it tells what range should be created
1170
- */
1171
- getValue(value: TDate, format: string): DateTimeValue<TDate>;
1172
- static ɵfac: i0.ɵɵFactoryDeclaration<DateValueProvider<any>, never>;
1173
- static ɵprov: i0.ɵɵInjectableDeclaration<DateValueProvider<any>>;
1174
- }
1175
-
1176
- /**
1177
- * Represents day component of datetime
1178
- */
1179
- export declare const DAY = "day";
1180
-
1181
- /**
1182
- * Data that represents day in date picker
1183
- */
1184
- export declare interface DayData<TDate = any> extends PeriodData<TDate> {
1185
- /**
1186
- * Indication that range is selected and this day is between selected dates
1187
- */
1188
- betweenActive: boolean;
1189
- /**
1190
- * Indication that this day is out of currently selected month
1191
- */
1192
- otherMonth: boolean;
1193
- /**
1194
- * Indication that this day is today
1195
- */
1196
- today: boolean;
1197
- /**
1198
- * Indication that this day is weekend day
1199
- */
1200
- weekend: boolean;
1201
- /**
1202
- * Day number of month
1203
- */
1204
- day: number;
1205
- }
1206
-
1207
- /**
1208
- * Specific css classes for day picker
1209
- */
1210
- export declare interface DayPickerCssClasses extends CommonPickerCssClasses {
1211
- /**
1212
- * Element displaying weekday name
1213
- */
1214
- weekdayName?: string;
1215
- }
1216
-
1217
- /**
1218
- * Represents decade component of datetime
1219
- */
1220
- export declare const DECADE = "decade";
1221
-
1222
- /**
1223
- * Default implementation of DatePositionParser
1224
- */
1225
- export declare class DefaultDatePositionParser implements DatePositionParser {
1226
- protected _format: string;
1227
- /**
1228
- * Indication whether format contains separators
1229
- */
1230
- protected _hasSeparator: boolean;
1231
- /**
1232
- * Array of date parts of parsed date format
1233
- */
1234
- protected _datePartsIndexes: string[];
1235
- /**
1236
- * Object storing indexes for strict date parts of parsed date format
1237
- */
1238
- protected _strictDatePartsIndexes: {
1239
- [index: number]: {
1240
- part: string;
1241
- length: number;
1242
- };
1243
- };
1244
- constructor(_format: string);
1245
- /**
1246
- * Parse date as string and returns information about position and selected part of date, while moving it to next part, if it was last part returns null
1247
- * @param date - String date to be parsed
1248
- * @param cursorPosition - Current cursor position
1249
- */
1250
- next(date: string, cursorPosition: number): null | DatePositionParserResult;
1251
- /**
1252
- * Parse date as string and returns information about position and selected part of date, while moving it to previous part, if it was first part returns null
1253
- * @param date - String date to be parsed
1254
- * @param cursorPosition - Current cursor position
1255
- */
1256
- previous(date: string, cursorPosition: number): null | DatePositionParserResult;
1257
- /**
1258
- * Parse date as string and returns information about positions and selected part of date
1259
- * @param date - String date to be parsed
1260
- * @param cursorPosition - Current cursor position
1261
- */
1262
- parse(date: string, cursorPosition: number): DatePositionParserResult;
1263
- /**
1264
- * Initialize parser, process format
1265
- */
1266
- protected _initialize(): void;
1267
- }
1268
-
1269
- /**
1270
- * Animation trigger for animating children on enter leave
1271
- */
1272
- export declare const enterLeaveAnimateChildTrigger: AnimationTriggerMetadata;
1273
-
1274
- /**
1275
- * Injection token used for obtaining FormatProvider implementation
1276
- */
1277
- export declare const FORMAT_PROVIDER: InjectionToken<FormatProvider>;
1278
-
1279
- /**
1280
- * Format provider used for obtaining some special formats 'placeholders'
1281
- */
1282
- export declare interface FormatProvider {
1283
- /**
1284
- * Format placeholder for displaying date
1285
- */
1286
- readonly date: string;
1287
- /**
1288
- * Format placeholder for displaying date and time
1289
- */
1290
- readonly dateTime: string;
1291
- /**
1292
- * Format placeholder for displaying time
1293
- */
1294
- readonly time: string;
1295
- }
1296
-
1297
- /**
1298
- * Represents hour component of datetime
1299
- */
1300
- export declare const HOUR = "hour";
1301
-
1302
- declare namespace i1 {
1303
- export {
1304
- SimpleInputDateTimeSelectorComponent
1305
- }
1306
- }
1307
-
1308
- declare namespace i1_2 {
1309
- export {
1310
- DateTimeSelectorComponent
1311
- }
1312
- }
1313
-
1314
- declare namespace i1_3 {
1315
- export {
1316
- DateTimePickerComponent
1317
- }
1318
- }
1319
-
1320
- declare namespace i1_4 {
1321
- export {
1322
- NgClassType,
1323
- AsRequiredTypePipe
1324
- }
1325
- }
1326
-
1327
- declare namespace i2 {
1328
- export {
1329
- InputDateTimeSelectorComponent
1330
- }
1331
- }
1332
-
1333
- declare namespace i2_2 {
1334
- export {
1335
- DateTimeDayPickerComponent
1336
- }
1337
- }
1338
-
1339
- declare namespace i2_3 {
1340
- export {
1341
- DateFormatPipe
1342
- }
1343
- }
1344
-
1345
- declare namespace i3 {
1346
- export {
1347
- DateTimeSelectorControlValueAccessor
1348
- }
1349
- }
1350
-
1351
- declare namespace i3_2 {
1352
- export {
1353
- DateTimeMonthPickerComponent
1354
- }
1355
- }
1356
-
1357
- declare namespace i3_3 {
1358
- export {
1359
- DateConvertPipe
1360
- }
1361
- }
1362
-
1363
- declare namespace i4 {
1364
- export {
1365
- DatetimeValidatorDirective
1366
- }
1367
- }
1368
-
1369
- declare namespace i4_2 {
1370
- export {
1371
- DateTimeYearPickerComponent
1372
- }
1373
- }
1374
-
1375
- declare namespace i5 {
1376
- export {
1377
- DatetimeMinValidatorDirective
1378
- }
1379
- }
1380
-
1381
- declare namespace i6 {
1382
- export {
1383
- DatetimeMaxValidatorDirective
1384
- }
1385
- }
1386
-
1387
- declare namespace i7_2 {
1388
- export {
1389
- DatePipesModule
1390
- }
1391
- }
1392
-
1393
- declare namespace i9 {
1394
- export {
1395
- DateTimePickerModule
1396
- }
1397
- }
1398
-
1399
- /**
1400
- * Component used as datetime selector with input
1401
- */
1402
- export declare class InputDateTimeSelectorComponent<TDate = any> implements DateTimeSelector<TDate> {
1403
- protected _dateApi: DateApi<TDate>;
1404
- protected _parserSvc: DatePositionParserService;
1405
- protected _valueProvider: DateValueProvider<TDate>;
1406
- protected _changeDetector: ChangeDetectorRef;
1407
- /**
1408
- * Occurs when value changes
1409
- */
1410
- protected _valueChange: Subject<void>;
1411
- /**
1412
- * Occurs when selector is touched by user
1413
- */
1414
- protected _touched: Subject<void>;
1415
- /**
1416
- * Occurs when selector requires picker to be displayed or hidden
1417
- */
1418
- protected _pickerRequest: Subject<boolean>;
1419
- /**
1420
- * Instance of parser created for specific format
1421
- */
1422
- protected _parser: DatePositionParser | null;
1423
- /**
1424
- * Currently used format for displaying data
1425
- */
1426
- protected _format: string;
1427
- /**
1428
- * Current value representation as date api wrapper
1429
- */
1430
- protected _dateApiValue: null | DateApiObject<TDate>;
1431
- /**
1432
- * Indication whether is current value valid value
1433
- */
1434
- protected _isValid: boolean;
1435
- /**
1436
- * Minimal possible value that can be picked
1437
- */
1438
- protected _minValue: TDate | null;
1439
- /**
1440
- * Maximal possible value that can be picked
1441
- */
1442
- protected _maxValue: TDate | null;
1443
- /**
1444
- * Gets or sets currently used format for displaying data
1445
- */
1446
- get format(): string;
1447
- set format(value: string);
1448
- /**
1449
- * Gets or sets placeholder that is displayed when there is no value selected
1450
- */
1451
- placeholder: string | undefined;
1452
- /**
1453
- * Gets current value of datetime
1454
- */
1455
- get value(): DateTimeValue<TDate> | null;
1456
- /**
1457
- * Gets formatted value
1458
- */
1459
- get formattedValue(): string | null;
1460
- /**
1461
- * Gets indication whether is current value valid
1462
- */
1463
- get valid(): boolean;
1464
- /**
1465
- * Occurs when value changes
1466
- */
1467
- get valueChange(): Observable<void>;
1468
- /**
1469
- * Occurs when selector is touched by user
1470
- */
1471
- get touched(): Observable<void>;
1472
- /**
1473
- * Occurs when selector requires picker to be displayed
1474
- */
1475
- get pickerRequest(): Observable<boolean>;
1476
-
1477
-
1478
- /**
1479
- * Gets or sets string representation current of value
1480
- */
1481
- protected get currentValue(): string | null;
1482
- protected set currentValue(value: string | null);
1483
- /**
1484
- * Gets input element used for handling date time value
1485
- */
1486
- protected get input(): HTMLInputElement;
1487
- constructor(_dateApi: DateApi<TDate>, _parserSvc: DatePositionParserService, _valueProvider: DateValueProvider<TDate>, _changeDetector: ChangeDetectorRef);
1488
- /**
1489
- * Sets minimal possible value for picker, that can be picked
1490
- * @param value - Minimal possible value that can be picked
1491
- */
1492
- setMinValue(value: TDate | null): void;
1493
- /**
1494
- * Sets maximal possible value for picker, that can be picked
1495
- * @param value - Maximal possible value that can be picked
1496
- */
1497
- setMaxValue(value: TDate | null): void;
1498
- /**
1499
- * Sets value of datetime selector
1500
- * @param value - Value to be set to this selector
1501
- */
1502
- setValue(value: DateTimeValue<TDate> | null): void;
1503
- /**
1504
- * Sets as 'control' disabled
1505
- * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
1506
- */
1507
- setDisabled(disabled?: boolean): void;
1508
- /**
1509
- * Explicitly runs invalidation of content (change detection)
1510
- */
1511
- invalidateVisuals(): void;
1512
-
1513
-
1514
-
1515
-
1516
-
1517
-
1518
- /**
1519
- * Shows current value in input
1520
- */
1521
- protected _show(): void;
1522
- /**
1523
- * Tests whether are min or max constraint broken, returns true if constraint is broken
1524
- */
1525
- protected _minMaxConstraintTest(): boolean;
1526
- /**
1527
- * Runs code with check whether min max constrains was broken
1528
- * @param code - Code that should be executed which can change current value
1529
- */
1530
- protected _withMinMaxConstraint(code: () => void): void;
1531
- /**
1532
- * Clears current value
1533
- */
1534
- protected _clearValue(): void;
1535
- /**
1536
- * Changes current value of date for for specified part by single step
1537
- * @param part - Part of date that should be changed
1538
- * @param increment - Indication whether value should be incremented or decremented
1539
- */
1540
- protected _stepChangeValue(part: string, increment: boolean): void;
1541
- static ɵfac: i0.ɵɵFactoryDeclaration<InputDateTimeSelectorComponent<any>, never>;
1542
- static ɵcmp: i0.ɵɵComponentDeclaration<InputDateTimeSelectorComponent<any>, "input-date-time-selector", never, {}, {}, never, never>;
1543
- }
1544
-
1545
- /**
1546
- * Represents minute component of datetime
1547
- */
1548
- export declare const MINUTE = "minute";
1549
-
1550
- /**
1551
- * Represents month component of datetime
1552
- */
1553
- export declare const MONTH = "month";
1554
-
1555
- /**
1556
- * Data that represents month in date picker
1557
- */
1558
- export declare interface MonthData<TDate = any> extends PeriodData<TDate> {
1559
- /**
1560
- * Name of month
1561
- */
1562
- name: string;
1563
- }
1564
-
1565
- /**
1566
- * Specific css classes for month picker
1567
- */
1568
- export declare interface MonthPickerCssClasses extends CommonPickerCssClasses {
1569
- }
1570
-
1571
- /**
1572
- * Type that represents ngClass
1573
- */
1574
- declare type NgClassType = string | string[] | Set<string> | Dictionary<any> | undefined | null;
1575
-
1576
- /**
1577
- * Data that represents data for any picker type
1578
- */
1579
- export declare interface PeriodData<TDate = any> {
1580
- /**
1581
- * Indication that this period item is active and selected
1582
- */
1583
- active: boolean;
1584
- /**
1585
- * Indication that this period item is disabled
1586
- */
1587
- disabled: boolean;
1588
- /**
1589
- * Date for this period item
1590
- */
1591
- date: TDate;
1592
- }
1593
-
1594
- /**
1595
- * Base class used as base for picker
1596
- */
1597
- export declare abstract class PickerBaseComponent<TDate = any, TDateData extends PeriodData<TDate> = any, TCssClasses = object> implements DateTimePicker<TDate, TCssClasses> {
1598
- protected _dateApi: DateApi<TDate>;
1599
- protected _changeDetector: ChangeDetectorRef;
1600
- /**
1601
- * Current value of datetime
1602
- */
1603
- protected _value: DateTimeValue<TDate> | null;
1604
- /**
1605
- * Occurs when value changes
1606
- */
1607
- protected _valueChange: Subject<void>;
1608
- /**
1609
- * Occurs when user scales up
1610
- */
1611
- protected _scaleUp: Subject<TDate>;
1612
- /**
1613
- * Occurs when user scales down
1614
- */
1615
- protected _scaleDown: Subject<TDate>;
1616
- /**
1617
- * Minimal possible value that can be picked
1618
- */
1619
- protected _minValue: TDate | null;
1620
- /**
1621
- * Maximal possible value that can be picked
1622
- */
1623
- protected _maxValue: TDate | null;
1624
- /**
1625
- * Gets current value of datetime
1626
- */
1627
- get value(): DateTimeValue<TDate> | null;
1628
- /**
1629
- * Occurs when value changes
1630
- */
1631
- get valueChange(): Observable<void>;
1632
- /**
1633
- * Occurs when user scales up
1634
- */
1635
- get scaleUp(): Observable<TDate>;
1636
- /**
1637
- * Occurs when user scales down
1638
- */
1639
- get scaleDown(): Observable<TDate>;
1640
-
1641
-
1642
-
1643
-
1644
-
1645
- constructor(_dateApi: DateApi<TDate>, _changeDetector: ChangeDetectorRef);
1646
-
1647
-
1648
- /**
1649
- * Sets css classes for picker, allowing to override defaults
1650
- * @param cssClasses - Css classes to be set for picker
1651
- */
1652
- setCssClasses(cssClasses: TCssClasses): void;
1653
- /**
1654
- * Sets minimal possible value for picker, that can be picked
1655
- * @param value - Minimal possible value that can be picked
1656
- */
1657
- setMinValue(value: TDate | null): void;
1658
- /**
1659
- * Sets maximal possible value for picker, that can be picked
1660
- * @param value - Maximal possible value that can be picked
1661
- */
1662
- setMaxValue(value: TDate | null): void;
1663
- /**
1664
- * Sets value of datetime picker
1665
- * @param value - Value to be set to this picker
1666
- */
1667
- setValue(value: DateTimeValue<TDate> | null): void;
1668
- /**
1669
- * Set displays date to be displayed
1670
- * @param value - Value that identifies period that is going to be displayed
1671
- */
1672
- abstract display(value: DateApiObject<TDate>): void;
1673
- /**
1674
- * Sets indication whether can go down
1675
- * @param value - Indication whether can go down in period
1676
- */
1677
- setCanGoDown(value: boolean): void;
1678
- /**
1679
- * Sets indication whether can go up
1680
- * @param value - Indication whether can go up in period
1681
- */
1682
- setCanGoUp(value: boolean): void;
1683
- /**
1684
- * Explicitly runs invalidation of content (change detection)
1685
- */
1686
- invalidateVisuals(): void;
1687
-
1688
- /**
1689
- * Sets period as active
1690
- * @param period - Period to be set as active
1691
- */
1692
- protected _setPeriod(period: PeriodData<TDate>): void;
1693
- /**
1694
- * Updates minimal and maximal value for picker
1695
- */
1696
- protected _updateMinMax(): void;
1697
- /**
1698
- * Obtains end of period
1699
- * @param period - Period for which should be end obtained
1700
- */
1701
- protected abstract _endOfPeriod(period: PeriodData<TDate>): TDate;
1702
- /**
1703
- * Tests whether provided value is in same period as displayed picker
1704
- * @param val - Tested value for same period as displayed picker
1705
- */
1706
- protected abstract _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean;
1707
- /**
1708
- * Tests whether provided value is in same period target value
1709
- * @param val - Tested value
1710
- * @param target - Target value to be tested against
1711
- */
1712
- protected abstract _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean;
1713
- /**
1714
- * Gets period data for specified value
1715
- * @param val - Value for which is period data obtained
1716
- */
1717
- protected abstract _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>;
1718
- static ɵfac: i0.ɵɵFactoryDeclaration<PickerBaseComponent<any, any, any>, never>;
1719
- static ɵdir: i0.ɵɵDirectiveDeclaration<PickerBaseComponent<any, any, any>, never, never, {}, {}, never>;
1720
- }
1721
-
1722
- /**
1723
- * Represents quarter component of datetime
1724
- */
1725
- export declare const QUARTER = "quarter";
1726
-
1727
- /**
1728
- * Animation trigger for animating scale up and scale down picker
1729
- */
1730
- export declare const scaleUpDownTrigger: AnimationTriggerMetadata;
1731
-
1732
- /**
1733
- * Component used as datetime selector with simple input
1734
- */
1735
- export declare class SimpleInputDateTimeSelectorComponent<TDate = any> implements DateTimeSelector<TDate> {
1736
- protected _dateApi: DateApi<TDate>;
1737
- protected _valueProvider: DateValueProvider<TDate>;
1738
- protected _changeDetector: ChangeDetectorRef;
1739
- /**
1740
- * Occurs when value changes
1741
- */
1742
- protected _valueChange: Subject<void>;
1743
- /**
1744
- * Occurs when selector is touched by user
1745
- */
1746
- protected _touched: Subject<void>;
1747
- /**
1748
- * Occurs when selector requires picker to be displayed or hidden
1749
- */
1750
- protected _pickerRequest: Subject<boolean>;
1751
- /**
1752
- * Currently used format for displaying data
1753
- */
1754
- protected _format: string;
1755
- /**
1756
- * Current value representation as date api wrapper
1757
- */
1758
- protected _dateApiValue: null | DateApiObject<TDate>;
1759
- /**
1760
- * Indication whether is current value valid value
1761
- */
1762
- protected _isValid: boolean;
1763
- /**
1764
- * Minimal possible value that can be picked
1765
- */
1766
- protected _minValue: TDate | null;
1767
- /**
1768
- * Maximal possible value that can be picked
1769
- */
1770
- protected _maxValue: TDate | null;
1771
- /**
1772
- * Gets or sets currently used format for displaying data
1773
- */
1774
- get format(): string;
1775
- set format(value: string);
1776
- /**
1777
- * Gets or sets placeholder that is displayed when there is no value selected
1778
- */
1779
- placeholder: string | undefined;
1780
- /**
1781
- * Gets current value of datetime
1782
- */
1783
- get value(): DateTimeValue<TDate> | null;
1784
- /**
1785
- * Gets formatted value
1786
- */
1787
- get formattedValue(): string | null;
1788
- /**
1789
- * Gets indication whether is current value valid
1790
- */
1791
- get valid(): boolean;
1792
- /**
1793
- * Occurs when value changes
1794
- */
1795
- get valueChange(): Observable<void>;
1796
- /**
1797
- * Occurs when selector is touched by user
1798
- */
1799
- get touched(): Observable<void>;
1800
- /**
1801
- * Occurs when selector requires picker to be displayed
1802
- */
1803
- get pickerRequest(): Observable<boolean>;
1804
-
1805
-
1806
- /**
1807
- * Gets or sets string representation current of value
1808
- */
1809
- protected get currentValue(): string | null;
1810
- protected set currentValue(value: string | null);
1811
- /**
1812
- * Gets input element used for handling date time value
1813
- */
1814
- protected get input(): HTMLInputElement;
1815
- constructor(_dateApi: DateApi<TDate>, _valueProvider: DateValueProvider<TDate>, _changeDetector: ChangeDetectorRef);
1816
- /**
1817
- * Sets minimal possible value for picker, that can be picked
1818
- * @param value - Minimal possible value that can be picked
1819
- */
1820
- setMinValue(value: TDate | null): void;
1821
- /**
1822
- * Sets maximal possible value for picker, that can be picked
1823
- * @param value - Maximal possible value that can be picked
1824
- */
1825
- setMaxValue(value: TDate | null): void;
1826
- /**
1827
- * Sets value of datetime selector
1828
- * @param value - Value to be set to this selector
1829
- */
1830
- setValue(value: DateTimeValue<TDate> | null): void;
1831
- /**
1832
- * Sets as 'control' disabled
1833
- * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
1834
- */
1835
- setDisabled(disabled?: boolean): void;
1836
- /**
1837
- * Explicitly runs invalidation of content (change detection)
1838
- */
1839
- invalidateVisuals(): void;
1840
-
1841
-
1842
-
1843
-
1844
-
1845
- /**
1846
- * Clears current value
1847
- */
1848
- protected _clearValue(): void;
1849
- /**
1850
- * Tests whether are min or max constraint broken, returns true if constraint is broken
1851
- */
1852
- protected _minMaxConstraintTest(): boolean;
1853
- /**
1854
- * Runs code with check whether min max constrains was broken
1855
- * @param code - Code that should be executed which can change current value
1856
- */
1857
- protected _withMinMaxConstraint(code: () => void): void;
1858
- /**
1859
- * Shows current value in input
1860
- */
1861
- protected _show(): void;
1862
- static ɵfac: i0.ɵɵFactoryDeclaration<SimpleInputDateTimeSelectorComponent<any>, never>;
1863
- static ɵcmp: i0.ɵɵComponentDeclaration<SimpleInputDateTimeSelectorComponent<any>, "simple-input-date-time-selector", never, {}, {}, never, never>;
1864
- }
1865
-
1866
- /**
1867
- * Validations functions for datetime
1868
- */
1869
- export declare class Validators {
1870
- /**
1871
- * Creates validator function that validates control if its value is valid datetime value
1872
- * @param datetime - Object storing information about datetime value
1873
- */
1874
- static datetime<TDate = any>(datetime: DateTimeValueObject<TDate>): ValidatorFn;
1875
- /**
1876
- * Creates validator function that validates control if its value is withing range of minimal datetime value
1877
- * @param datetime - Object storing information about datetime value
1878
- * @param dateApi - Date api object
1879
- */
1880
- static minDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn;
1881
- /**
1882
- * Creates validator function that validates control if its value is withing range of maximal datetime value
1883
- * @param datetime - Object storing information about datetime value
1884
- * @param dateApi - Date api object
1885
- */
1886
- static maxDatetime<TDate = any>(datetime: DateTimeValueObject<TDate>, dateApi: DateApi<TDate>): ValidatorFn;
1887
- }
1888
-
1889
- /**
1890
- * Represents week component of datetime
1891
- */
1892
- export declare const WEEK = "week";
1893
-
1894
- /**
1895
- * Represents year component of datetime
1896
- */
1897
- export declare const YEAR = "year";
1898
-
1899
- /**
1900
- * Data that represents year in date picker
1901
- */
1902
- export declare interface YearData<TDate = any> extends PeriodData<TDate> {
1903
- /**
1904
- * Value of year
1905
- */
1906
- value: number;
1907
- }
1908
-
1909
- /**
1910
- * Specific css classes for year picker
1911
- */
1912
- export declare interface YearPickerCssClasses extends CommonPickerCssClasses {
1913
- }
1914
-
1915
- export { }