@progress/kendo-angular-dateinputs 14.0.0-develop.8 → 14.0.0-develop.9

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.
@@ -15,8 +15,32 @@ import { DateInputSize } from '../common/models/size';
15
15
  import { DateInputRounded } from '../common/models/rounded';
16
16
  import { DateInputFillMode } from '../common/models/fillmode';
17
17
  import { SVGIcon } from '@progress/kendo-svg-icons';
18
+ import { DateFieldNameOptions, DateFormatOptions, DateFormatPart, DayRange, NumberFormatOptions } from '@progress/kendo-intl';
18
19
  import * as i0 from "@angular/core";
19
20
  declare type DatePickerType = 'daterangestart' | 'daterangeend' | 'datepicker' | 'datetimepicker' | 'timepicker';
21
+ /**
22
+ * @hidden
23
+ * Need to overrite `dateFormatNames` parameters order and provide `cldr` object
24
+ * required by the kendo-dateinputs-common package
25
+ */
26
+ export declare class DateInputIntl {
27
+ private service;
28
+ format: (format: string, ...values: any[]) => string;
29
+ toString: (value: any, format: any, localeId?: string) => string;
30
+ formatDate: (value: Date, format?: string | DateFormatOptions, localeId?: string) => string;
31
+ parseDate: (value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[], localeId?: string) => Date;
32
+ parseNumber: (value: string, format?: string | NumberFormatOptions, localeId?: string) => number;
33
+ formatNumber: (value: number, format: string | NumberFormatOptions, localeId?: string) => string;
34
+ splitDateFormat: (format: string | DateFormatOptions, localeId?: string) => DateFormatPart[];
35
+ numberSymbols: (localeId?: string) => void;
36
+ firstDay: (localeId?: string) => number;
37
+ weekendRange: (localeId?: string) => DayRange;
38
+ dateFieldName: (options: DateFieldNameOptions, localeId?: string) => string;
39
+ dateFormatNames: (localeId: any, options: any) => any;
40
+ cldr: {};
41
+ localeId: string;
42
+ constructor(service: IntlService);
43
+ }
20
44
  /**
21
45
  * Represents the [Kendo UI DateInput component for Angular]({% slug overview_dateinput %}#toc-basic-usage).
22
46
  */
@@ -134,7 +158,8 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
134
158
  * export class AppComponent { }
135
159
  * ```
136
160
  */
137
- formatPlaceholder: DateInputFormatPlaceholder;
161
+ set formatPlaceholder(format: DateInputFormatPlaceholder);
162
+ get formatPlaceholder(): DateInputFormatPlaceholder;
138
163
  /**
139
164
  * Specifies the hint the DateInput displays when its value is `null`.
140
165
  * For more information, refer to the article on
@@ -189,9 +214,35 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
189
214
  rangeValidation: boolean;
190
215
  /**
191
216
  * @hidden
192
- * Based on the min and max values, specifies whether the value will be auto-corrected while typing.
217
+ *
218
+ * Determines whether to auto correct invalid segments automatically.
219
+ * TODO: To be fixed in common package before enabling: https://github.com/telerik/kendo-dateinputs-common/issues/24
220
+ *
221
+ * @default true
222
+ */
223
+ autoCorrectParts: boolean;
224
+ /**
225
+ * Determines whether to automatically move to the next segment after the user completes the current one.
226
+ *
227
+ * @default true
228
+ */
229
+ autoSwitchParts: boolean;
230
+ /**
231
+ * A string array representing custom keys, which will move the focus to the next date format segment.
193
232
  */
194
- autoCorrect: boolean;
233
+ autoSwitchKeys: string[];
234
+ /**
235
+ * Determines if the users should see a blinking caret inside the Date Input when possible.
236
+ *
237
+ * @default false
238
+ */
239
+ allowCaretMode: boolean;
240
+ /**
241
+ * When enabled, the DateInput will autofill the rest of the date to the current date when the component loses focus.
242
+ *
243
+ * @default false
244
+ */
245
+ autoFill: boolean;
195
246
  /**
196
247
  * Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
197
248
  */
@@ -204,6 +255,12 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
204
255
  * will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.
205
256
  */
206
257
  twoDigitYearMax: number;
258
+ /**
259
+ * Indicates whether the mouse scroll can be used to increase/decrease the time segments values.
260
+ *
261
+ * @default true
262
+ */
263
+ enableMouseWheel: boolean;
207
264
  /**
208
265
  * Specifies the value of the DateInput component.
209
266
  *
@@ -337,6 +394,24 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
337
394
  * @hidden
338
395
  */
339
396
  get formControl(): FormControl;
397
+ get options(): {
398
+ format: string | FormatSettings;
399
+ steps: DateInputIncrementalSteps;
400
+ readonly: boolean;
401
+ formatPlaceholder: DateInputFormatPlaceholder;
402
+ placeholder: string;
403
+ autoCorrectParts: boolean;
404
+ autoSwitchParts: boolean;
405
+ selectPreviousSegmentOnBackspace: boolean;
406
+ autoSwitchKeys: string[];
407
+ twoDigitYearMax: number;
408
+ enableMouseWheel: boolean;
409
+ selectNearestSegmentOnFocus: boolean;
410
+ allowCaretMode: boolean;
411
+ autoFill: boolean;
412
+ value: Date;
413
+ intlService: DateInputIntl;
414
+ };
340
415
  arrow: any;
341
416
  arrowDirection: Arrow;
342
417
  formatSections: {
@@ -348,23 +423,18 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
348
423
  * @hidden
349
424
  */
350
425
  isDateIncomplete: boolean;
351
- protected currentValue: string;
352
426
  protected currentFormat: string;
353
427
  private spinup;
354
428
  private spindown;
355
- private backspace;
356
- private resetSegmentValue;
357
- private symbolsMap;
358
- private get inputFormat();
359
- private get displayFormat();
360
429
  private minValidator;
361
430
  private maxValidator;
362
431
  private incompleteValidator;
363
432
  private _value;
364
433
  private _active;
365
434
  private _focusableId;
435
+ private _formatPlaceholder;
366
436
  private kendoDate;
367
- private paste;
437
+ private kendoDateObject;
368
438
  private domEvents;
369
439
  private ngControl;
370
440
  private onControlChange;
@@ -381,6 +451,10 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
381
451
  * Used by the TextBoxContainer to determine if the component is empty
382
452
  */
383
453
  isEmpty(): boolean;
454
+ /**
455
+ * @hidden
456
+ */
457
+ handleDragAndDrop(args: any): void;
384
458
  /**
385
459
  * @hidden
386
460
  */
@@ -393,6 +467,8 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
393
467
  * @hidden
394
468
  */
395
469
  ngOnChanges(changes: SimpleChanges): void;
470
+ private updateFormatSections;
471
+ private updateIncompleteValidationStatus;
396
472
  ngAfterViewInit(): void;
397
473
  ngOnDestroy(): void;
398
474
  /**
@@ -457,60 +533,20 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
457
533
  * @hidden
458
534
  */
459
535
  handleButtonClick(offset: number): void;
460
- /**
461
- * @hidden
462
- */
463
- modifyDateSegmentValue(offset: number): void;
464
- /**
465
- * @hidden
466
- */
467
- protected switchDateSegment(offset: number): boolean;
468
- /**
469
- * @hidden
470
- */
471
- protected selectDateSegment(symbol: string): void;
472
- /**
473
- * @hidden
474
- */
475
- handleClick(): void;
476
- /**
477
- * @hidden
478
- */
479
- handleDragAndDrop(args: any): void;
480
- /**
481
- * @hidden
482
- */
483
- handleMousedown(): void;
484
- /**
485
- * @hidden
486
- */
487
- handleFocus(args: any): void;
488
- /**
489
- * @hidden
490
- */
491
- handleBlur(args: any): void;
492
- private getKendoDate;
493
- private dateSymbolMap;
494
- private updateElementValue;
495
- private caret;
496
- private selectNearestSegment;
536
+ private initKendoDate;
537
+ private onWidgetValueChange;
538
+ private onWidgetKeyDown;
539
+ private onWidgetInputEnd;
540
+ private onWidgetFocus;
541
+ private onWidgetBlur;
497
542
  private verifyRange;
498
543
  private verifyValue;
499
- private putDateInRange;
500
- private updateFormatSections;
501
544
  private intlChange;
502
- private updateOnPaste;
503
- private bindEvents;
504
- private handleMouseWheel;
505
- private handlePaste;
506
- private handleKeydown;
507
- private handleInput;
508
545
  private emitFocus;
509
546
  private emitBlur;
510
- private updateIncompleteValidationStatus;
511
547
  private setSpinnerFill;
512
548
  private setComponentClasses;
513
549
  static ɵfac: i0.ɵɵFactoryDeclaration<DateInputComponent, [null, null, null, null, null, null, null, { optional: true; }]>;
514
- static ɵcmp: i0.ɵɵComponentDeclaration<DateInputComponent, "kendo-dateinput", ["kendo-dateinput"], { "focusableId": "focusableId"; "pickerType": "pickerType"; "disabled": "disabled"; "readonly": "readonly"; "title": "title"; "tabindex": "tabindex"; "role": "role"; "ariaReadOnly": "ariaReadOnly"; "tabIndex": "tabIndex"; "format": "format"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "steps": "steps"; "max": "max"; "min": "min"; "rangeValidation": "rangeValidation"; "autoCorrect": "autoCorrect"; "incompleteDateValidation": "incompleteDateValidation"; "twoDigitYearMax": "twoDigitYearMax"; "value": "value"; "spinners": "spinners"; "isPopupOpen": "isPopupOpen"; "hasPopup": "hasPopup"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; }, { "valueChange": "valueChange"; "valueUpdate": "valueUpdate"; "onFocus": "focus"; "onBlur": "blur"; }, never, never>;
550
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateInputComponent, "kendo-dateinput", ["kendo-dateinput"], { "focusableId": "focusableId"; "pickerType": "pickerType"; "disabled": "disabled"; "readonly": "readonly"; "title": "title"; "tabindex": "tabindex"; "role": "role"; "ariaReadOnly": "ariaReadOnly"; "tabIndex": "tabIndex"; "format": "format"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "steps": "steps"; "max": "max"; "min": "min"; "rangeValidation": "rangeValidation"; "autoCorrectParts": "autoCorrectParts"; "autoSwitchParts": "autoSwitchParts"; "autoSwitchKeys": "autoSwitchKeys"; "allowCaretMode": "allowCaretMode"; "autoFill": "autoFill"; "incompleteDateValidation": "incompleteDateValidation"; "twoDigitYearMax": "twoDigitYearMax"; "enableMouseWheel": "enableMouseWheel"; "value": "value"; "spinners": "spinners"; "isPopupOpen": "isPopupOpen"; "hasPopup": "hasPopup"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; }, { "valueChange": "valueChange"; "valueUpdate": "valueUpdate"; "onFocus": "focus"; "onBlur": "blur"; }, never, never>;
515
551
  }
516
552
  export {};
@@ -209,6 +209,43 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
209
209
  * Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
210
210
  */
211
211
  incompleteDateValidation: boolean;
212
+ /**
213
+ * @hidden
214
+ *
215
+ * Determines whether to auto correct invalid segments automatically.
216
+ * TODO: To be fixed in common package before enabling: https://github.com/telerik/kendo-dateinputs-common/issues/24
217
+ *
218
+ * @default true
219
+ */
220
+ autoCorrectParts: boolean;
221
+ /**
222
+ * Determines whether to automatically move to the next segment after the user completes the current one.
223
+ *
224
+ * @default true
225
+ */
226
+ autoSwitchParts: boolean;
227
+ /**
228
+ * A string array representing custom keys, which will move the focus to the next date format segment.
229
+ */
230
+ autoSwitchKeys: string[];
231
+ /**
232
+ * Indicates whether the mouse scroll can be used to increase/decrease the time segments values.
233
+ *
234
+ * @default true
235
+ */
236
+ enableMouseWheel: boolean;
237
+ /**
238
+ * Determines if the users should see a blinking caret inside the Date Input when possible.
239
+ *
240
+ * @default false
241
+ */
242
+ allowCaretMode: boolean;
243
+ /**
244
+ * When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus.
245
+ *
246
+ * @default false
247
+ */
248
+ autoFill: boolean;
212
249
  /**
213
250
  * Specifies the focused date of the Calendar component
214
251
  * ([see example]({% slug calendar_type_datepicker %}#toc-focused-dates)).
@@ -638,5 +675,5 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
638
675
  private handleDateCompletenessChange;
639
676
  private setComponentClasses;
640
677
  static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, [null, null, null, null, null, null, null, null, null, { optional: true; }]>;
641
- static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "kendo-datepicker", ["kendo-datepicker"], { "focusableId": "focusableId"; "cellTemplateRef": "cellTemplate"; "monthCellTemplateRef": "monthCellTemplate"; "yearCellTemplateRef": "yearCellTemplate"; "decadeCellTemplateRef": "decadeCellTemplate"; "centuryCellTemplateRef": "centuryCellTemplate"; "weekNumberTemplateRef": "weekNumberTemplate"; "headerTitleTemplateRef": "headerTitleTemplate"; "navigationItemTemplateRef": "navigationItemTemplate"; "activeView": "activeView"; "bottomView": "bottomView"; "topView": "topView"; "calendarType": "calendarType"; "animateCalendarNavigation": "animateCalendarNavigation"; "disabled": "disabled"; "readonly": "readonly"; "readOnlyInput": "readOnlyInput"; "popupSettings": "popupSettings"; "navigation": "navigation"; "min": "min"; "max": "max"; "incompleteDateValidation": "incompleteDateValidation"; "focusedDate": "focusedDate"; "value": "value"; "format": "format"; "twoDigitYearMax": "twoDigitYearMax"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "tabindex": "tabindex"; "tabIndex": "tabIndex"; "disabledDates": "disabledDates"; "title": "title"; "subtitle": "subtitle"; "rangeValidation": "rangeValidation"; "disabledDatesValidation": "disabledDatesValidation"; "weekNumber": "weekNumber"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "adaptiveMode": "adaptiveMode"; }, { "valueChange": "valueChange"; "onFocus": "focus"; "onBlur": "blur"; "open": "open"; "close": "close"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate"], never>;
678
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "kendo-datepicker", ["kendo-datepicker"], { "focusableId": "focusableId"; "cellTemplateRef": "cellTemplate"; "monthCellTemplateRef": "monthCellTemplate"; "yearCellTemplateRef": "yearCellTemplate"; "decadeCellTemplateRef": "decadeCellTemplate"; "centuryCellTemplateRef": "centuryCellTemplate"; "weekNumberTemplateRef": "weekNumberTemplate"; "headerTitleTemplateRef": "headerTitleTemplate"; "navigationItemTemplateRef": "navigationItemTemplate"; "activeView": "activeView"; "bottomView": "bottomView"; "topView": "topView"; "calendarType": "calendarType"; "animateCalendarNavigation": "animateCalendarNavigation"; "disabled": "disabled"; "readonly": "readonly"; "readOnlyInput": "readOnlyInput"; "popupSettings": "popupSettings"; "navigation": "navigation"; "min": "min"; "max": "max"; "incompleteDateValidation": "incompleteDateValidation"; "autoCorrectParts": "autoCorrectParts"; "autoSwitchParts": "autoSwitchParts"; "autoSwitchKeys": "autoSwitchKeys"; "enableMouseWheel": "enableMouseWheel"; "allowCaretMode": "allowCaretMode"; "autoFill": "autoFill"; "focusedDate": "focusedDate"; "value": "value"; "format": "format"; "twoDigitYearMax": "twoDigitYearMax"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "tabindex": "tabindex"; "tabIndex": "tabIndex"; "disabledDates": "disabledDates"; "title": "title"; "subtitle": "subtitle"; "rangeValidation": "rangeValidation"; "disabledDatesValidation": "disabledDatesValidation"; "weekNumber": "weekNumber"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "adaptiveMode": "adaptiveMode"; }, { "valueChange": "valueChange"; "onFocus": "focus"; "onBlur": "blur"; "open": "open"; "close": "close"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate"], never>;
642
679
  }
@@ -244,6 +244,43 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
244
244
  * Determines whether the built-in validation for incomplete dates is to be enforced when a form is being validated.
245
245
  */
246
246
  incompleteDateValidation: boolean;
247
+ /**
248
+ * @hidden
249
+ *
250
+ * Determines whether to auto correct invalid segments automatically.
251
+ * TODO: To be fixed in common package before enabling: https://github.com/telerik/kendo-dateinputs-common/issues/24
252
+ *
253
+ * @default true
254
+ */
255
+ autoCorrectParts: boolean;
256
+ /**
257
+ * Determines whether to automatically move to the next segment after the user completes the current one.
258
+ *
259
+ * @default true
260
+ */
261
+ autoSwitchParts: boolean;
262
+ /**
263
+ * A string array representing custom keys, which will move the focus to the next date format segment.
264
+ */
265
+ autoSwitchKeys: string[];
266
+ /**
267
+ * Indicates whether the mouse scroll can be used to increase/decrease the time segments values.
268
+ *
269
+ * @default true
270
+ */
271
+ enableMouseWheel: boolean;
272
+ /**
273
+ * Determines if the users should see a blinking caret inside the Date Input when possible.
274
+ *
275
+ * @default false
276
+ */
277
+ allowCaretMode: boolean;
278
+ /**
279
+ * When enabled, the DateTimePicker will autofill the rest of the date to the current date when the component loses focus.
280
+ *
281
+ * @default false
282
+ */
283
+ autoFill: boolean;
247
284
  /**
248
285
  * Enables or disables the adaptive mode. By default the adaptive rendering is disabled.
249
286
  */
@@ -628,5 +665,5 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
628
665
  private handleDateCompletenessChange;
629
666
  private setComponentClasses;
630
667
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent, never>;
631
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "kendo-datetimepicker", ["kendo-datetimepicker"], { "focusableId": "focusableId"; "value": "value"; "format": "format"; "twoDigitYearMax": "twoDigitYearMax"; "tabindex": "tabindex"; "disabledDates": "disabledDates"; "popupSettings": "popupSettings"; "title": "title"; "subtitle": "subtitle"; "disabled": "disabled"; "readonly": "readonly"; "readOnlyInput": "readOnlyInput"; "cancelButton": "cancelButton"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "steps": "steps"; "focusedDate": "focusedDate"; "calendarType": "calendarType"; "animateCalendarNavigation": "animateCalendarNavigation"; "weekNumber": "weekNumber"; "min": "min"; "max": "max"; "rangeValidation": "rangeValidation"; "disabledDatesValidation": "disabledDatesValidation"; "incompleteDateValidation": "incompleteDateValidation"; "adaptiveMode": "adaptiveMode"; "defaultTab": "defaultTab"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; }, { "valueChange": "valueChange"; "open": "open"; "close": "close"; "onFocus": "focus"; "onBlur": "blur"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], never>;
668
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "kendo-datetimepicker", ["kendo-datetimepicker"], { "focusableId": "focusableId"; "value": "value"; "format": "format"; "twoDigitYearMax": "twoDigitYearMax"; "tabindex": "tabindex"; "disabledDates": "disabledDates"; "popupSettings": "popupSettings"; "title": "title"; "subtitle": "subtitle"; "disabled": "disabled"; "readonly": "readonly"; "readOnlyInput": "readOnlyInput"; "cancelButton": "cancelButton"; "formatPlaceholder": "formatPlaceholder"; "placeholder": "placeholder"; "steps": "steps"; "focusedDate": "focusedDate"; "calendarType": "calendarType"; "animateCalendarNavigation": "animateCalendarNavigation"; "weekNumber": "weekNumber"; "min": "min"; "max": "max"; "rangeValidation": "rangeValidation"; "disabledDatesValidation": "disabledDatesValidation"; "incompleteDateValidation": "incompleteDateValidation"; "autoCorrectParts": "autoCorrectParts"; "autoSwitchParts": "autoSwitchParts"; "autoSwitchKeys": "autoSwitchKeys"; "enableMouseWheel": "enableMouseWheel"; "allowCaretMode": "allowCaretMode"; "autoFill": "autoFill"; "adaptiveMode": "adaptiveMode"; "defaultTab": "defaultTab"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; }, { "valueChange": "valueChange"; "open": "open"; "close": "close"; "onFocus": "focus"; "onBlur": "blur"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], never>;
632
669
  }