@progress/kendo-angular-dateinputs 15.4.0 → 15.5.0-develop.2

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.
@@ -90,7 +90,6 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
90
90
  title: string;
91
91
  /**
92
92
  * Sets or gets the `tabIndex` property of the DateInput.
93
- * .
94
93
  */
95
94
  tabindex: number;
96
95
  /**
@@ -106,6 +105,10 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
106
105
  */
107
106
  set tabIndex(tabIndex: number);
108
107
  get tabIndex(): number;
108
+ /**
109
+ * @hidden
110
+ */
111
+ isRequired: boolean;
109
112
  /**
110
113
  * Specifies the date format that is used to display the input value
111
114
  * ([see example]({% slug formats_dateinput %})).
@@ -322,6 +325,15 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
322
325
  */
323
326
  set fillMode(fillMode: DateInputFillMode);
324
327
  get fillMode(): DateInputFillMode;
328
+ /**
329
+ * Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.
330
+ */
331
+ set inputAttributes(attributes: {
332
+ [key: string]: string;
333
+ });
334
+ get inputAttributes(): {
335
+ [key: string]: string;
336
+ };
325
337
  /**
326
338
  * Fires each time the user selects a new value
327
339
  * ([see example](slug:events_dateinput)).
@@ -408,6 +420,10 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
408
420
  private _fillMode;
409
421
  private control;
410
422
  private subs;
423
+ private _inputAttributes;
424
+ private parsedAttributes;
425
+ private get defaultAttributes();
426
+ private get mutableAttributes();
411
427
  constructor(cdr: ChangeDetectorRef, intl: IntlService, renderer: Renderer2, wrapper: ElementRef, ngZone: NgZone, injector: Injector, localization: LocalizationService, pickerService?: PickerService);
412
428
  /**
413
429
  * @hidden
@@ -438,6 +454,10 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
438
454
  * @hidden
439
455
  */
440
456
  private setAriaInvalid;
457
+ /**
458
+ * @hidden
459
+ */
460
+ get isControlRequired(): boolean;
441
461
  /**
442
462
  * @hidden
443
463
  */
@@ -509,7 +529,8 @@ export declare class DateInputComponent implements OnInit, AfterViewInit, Contro
509
529
  private emitBlur;
510
530
  private setSpinnerFill;
511
531
  private setComponentClasses;
532
+ private setInputAttributes;
512
533
  static ɵfac: i0.ɵɵFactoryDeclaration<DateInputComponent, [null, null, null, null, null, null, null, { optional: true; }]>;
513
- 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>;
534
+ 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"; "isRequired": "isRequired"; "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"; "inputAttributes": "inputAttributes"; }, { "valueChange": "valueChange"; "valueUpdate": "valueUpdate"; "onFocus": "focus"; "onBlur": "blur"; }, never, never>;
514
535
  }
515
536
  export {};
@@ -68,6 +68,12 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
68
68
  * @hidden
69
69
  */
70
70
  set cellTemplateRef(template: CellTemplateDirective);
71
+ /**
72
+ * Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.
73
+ */
74
+ inputAttributes: {
75
+ [key: string]: string;
76
+ };
71
77
  /**
72
78
  * @hidden
73
79
  */
@@ -503,6 +509,10 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
503
509
  */
504
510
  xIcon: SVGIcon;
505
511
  private get inputElement();
512
+ /**
513
+ * @hidden
514
+ */
515
+ get isControlRequired(): boolean;
506
516
  private _popupSettings;
507
517
  private _show;
508
518
  private _value;
@@ -680,5 +690,5 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
680
690
  private handleDateCompletenessChange;
681
691
  private setComponentClasses;
682
692
  static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, [null, null, null, null, null, null, null, null, null, { optional: true; }]>;
683
- 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"; "headerTemplateRef": "headerTemplate"; "footerTemplateRef": "footerTemplate"; "footer": "footer"; "navigationItemTemplateRef": "navigationItemTemplate"; "weekDaysFormat": "weekDaysFormat"; "showOtherMonthDays": "showOtherMonthDays"; "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", "headerTemplate", "footerTemplate", "navigationItemTemplate"], never>;
693
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "kendo-datepicker", ["kendo-datepicker"], { "focusableId": "focusableId"; "cellTemplateRef": "cellTemplate"; "inputAttributes": "inputAttributes"; "monthCellTemplateRef": "monthCellTemplate"; "yearCellTemplateRef": "yearCellTemplate"; "decadeCellTemplateRef": "decadeCellTemplate"; "centuryCellTemplateRef": "centuryCellTemplate"; "weekNumberTemplateRef": "weekNumberTemplate"; "headerTitleTemplateRef": "headerTitleTemplate"; "headerTemplateRef": "headerTemplate"; "footerTemplateRef": "footerTemplate"; "footer": "footer"; "navigationItemTemplateRef": "navigationItemTemplate"; "weekDaysFormat": "weekDaysFormat"; "showOtherMonthDays": "showOtherMonthDays"; "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", "headerTemplate", "footerTemplate", "navigationItemTemplate"], never>;
684
694
  }
@@ -2,8 +2,8 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { ElementRef, OnDestroy, ChangeDetectorRef, EventEmitter, NgZone, OnInit, SimpleChanges, OnChanges, Renderer2, AfterViewInit } from '@angular/core';
6
- import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
5
+ import { ElementRef, OnDestroy, ChangeDetectorRef, EventEmitter, NgZone, OnInit, SimpleChanges, OnChanges, Renderer2, AfterViewInit, Injector } from '@angular/core';
6
+ import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors, FormControl } from '@angular/forms';
7
7
  import { Day } from '@progress/kendo-date-math';
8
8
  import { PopupService } from '@progress/kendo-angular-popup';
9
9
  import { IntlService } from '@progress/kendo-angular-intl';
@@ -51,6 +51,7 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
51
51
  localization: LocalizationService;
52
52
  private disabledDatesService;
53
53
  private renderer;
54
+ private injector;
54
55
  /**
55
56
  * @hidden
56
57
  */
@@ -303,6 +304,12 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
303
304
  * Enables or disables the adaptive mode. By default the adaptive rendering is disabled.
304
305
  */
305
306
  adaptiveMode: AdaptiveMode;
307
+ /**
308
+ * Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.
309
+ */
310
+ inputAttributes: {
311
+ [key: string]: string;
312
+ };
306
313
  /**
307
314
  * Fires each time the user selects a new value
308
315
  * ([see example](slug:events_datetimepicker)).
@@ -507,6 +514,14 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
507
514
  private get acceptButton();
508
515
  private get cancelButtonElement();
509
516
  private get dateTabButton();
517
+ /**
518
+ * @hidden
519
+ */
520
+ get formControl(): FormControl;
521
+ /**
522
+ * @hidden
523
+ */
524
+ get isControlRequired(): boolean;
510
525
  private popupRef;
511
526
  private _popupSettings;
512
527
  private _value;
@@ -530,7 +545,7 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
530
545
  private _rounded;
531
546
  private _fillMode;
532
547
  private windowSize;
533
- constructor(popupService: PopupService, intl: IntlService, cdr: ChangeDetectorRef, pickerService: PickerService, ngZone: NgZone, wrapper: ElementRef<HTMLElement>, touchEnabled: boolean, localization: LocalizationService, disabledDatesService: DisabledDatesService, renderer: Renderer2);
548
+ constructor(popupService: PopupService, intl: IntlService, cdr: ChangeDetectorRef, pickerService: PickerService, ngZone: NgZone, wrapper: ElementRef<HTMLElement>, touchEnabled: boolean, localization: LocalizationService, disabledDatesService: DisabledDatesService, renderer: Renderer2, injector: Injector);
534
549
  ngOnInit(): void;
535
550
  ngAfterViewInit(): void;
536
551
  ngOnChanges(changes: SimpleChanges): void;
@@ -704,5 +719,5 @@ export declare class DateTimePickerComponent implements OnInit, OnChanges, After
704
719
  private handleDateCompletenessChange;
705
720
  private setComponentClasses;
706
721
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent, never>;
707
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "kendo-datetimepicker", ["kendo-datetimepicker"], { "focusableId": "focusableId"; "weekDaysFormat": "weekDaysFormat"; "showOtherMonthDays": "showOtherMonthDays"; "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"; "headerTemplateRef": "headerTemplate"; "footerTemplateRef": "footerTemplate"; "footer": "footer"; }, { "valueChange": "valueChange"; "open": "open"; "close": "close"; "onFocus": "focus"; "onBlur": "blur"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate"], never>;
722
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "kendo-datetimepicker", ["kendo-datetimepicker"], { "focusableId": "focusableId"; "weekDaysFormat": "weekDaysFormat"; "showOtherMonthDays": "showOtherMonthDays"; "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"; "inputAttributes": "inputAttributes"; "defaultTab": "defaultTab"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "headerTemplateRef": "headerTemplate"; "footerTemplateRef": "footerTemplate"; "footer": "footer"; }, { "valueChange": "valueChange"; "open": "open"; "close": "close"; "onFocus": "focus"; "onBlur": "blur"; }, ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate"], never>;
708
723
  }
@@ -12,7 +12,7 @@ import { IntlService, localeData } from '@progress/kendo-angular-intl';
12
12
  import { validatePackage } from '@progress/kendo-licensing';
13
13
  import { packageMetadata } from '../package-metadata';
14
14
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
15
- import { hasObservers, KendoInput } from '@progress/kendo-angular-common';
15
+ import { hasObservers, isControlRequired, KendoInput, setHTMLAttributes, removeHTMLAttributes, isObjectPresent, parseAttributes } from '@progress/kendo-angular-common';
16
16
  import { Arrow } from './arrow.enum';
17
17
  import { noop, isValidRange, getSizeClass, getRoundedClass, getFillModeClass, DEFAULT_FILL_MODE, DEFAULT_ROUNDED, DEFAULT_SIZE } from '../util';
18
18
  import { PickerService } from '../common/picker.service';
@@ -107,7 +107,6 @@ export class DateInputComponent {
107
107
  this.title = "";
108
108
  /**
109
109
  * Sets or gets the `tabIndex` property of the DateInput.
110
- * .
111
110
  */
112
111
  this.tabindex = 0;
113
112
  /**
@@ -118,6 +117,10 @@ export class DateInputComponent {
118
117
  * @hidden
119
118
  */
120
119
  this.ariaReadOnly = false;
120
+ /**
121
+ * @hidden
122
+ */
123
+ this.isRequired = false;
121
124
  /**
122
125
  * Specifies the date format that is used to display the input value
123
126
  * ([see example]({% slug formats_dateinput %})).
@@ -278,6 +281,7 @@ export class DateInputComponent {
278
281
  this._rounded = DEFAULT_ROUNDED;
279
282
  this._fillMode = DEFAULT_FILL_MODE;
280
283
  this.subs = new Subscription();
284
+ this.parsedAttributes = {};
281
285
  validatePackage(packageMetadata);
282
286
  if (this.pickerService) {
283
287
  this.pickerService.input = this;
@@ -448,6 +452,22 @@ export class DateInputComponent {
448
452
  get fillMode() {
449
453
  return this._fillMode;
450
454
  }
455
+ /**
456
+ * Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.
457
+ */
458
+ set inputAttributes(attributes) {
459
+ if (isObjectPresent(this.parsedAttributes)) {
460
+ removeHTMLAttributes(this.parsedAttributes, this.renderer, this.dateInput.nativeElement);
461
+ }
462
+ this._inputAttributes = attributes;
463
+ this.parsedAttributes = this.inputAttributes ?
464
+ parseAttributes(this.inputAttributes, this.defaultAttributes) :
465
+ this.inputAttributes;
466
+ this.setInputAttributes();
467
+ }
468
+ get inputAttributes() {
469
+ return this._inputAttributes;
470
+ }
451
471
  get wrapperClass() {
452
472
  return true;
453
473
  }
@@ -505,6 +525,30 @@ export class DateInputComponent {
505
525
  intlService: new DateInputIntl(this.intl)
506
526
  };
507
527
  }
528
+ get defaultAttributes() {
529
+ return {
530
+ 'aria-readonly': this.ariaReadOnly,
531
+ id: this.focusableId,
532
+ title: this.title,
533
+ tabindex: this.tabindex,
534
+ disabled: this.disabled ? '' : null,
535
+ readonly: this.readonly ? '' : null,
536
+ placeholder: this.placeholder,
537
+ 'aria-expanded': this.isPopupOpen,
538
+ 'aria-haspopup': this.hasPopup,
539
+ required: this.isControlRequired ? '' : null
540
+ };
541
+ }
542
+ get mutableAttributes() {
543
+ return {
544
+ autocomplete: 'off',
545
+ autocorrect: 'off',
546
+ autocapitalize: 'off',
547
+ spellcheck: 'false',
548
+ role: this.role
549
+ };
550
+ }
551
+ ;
508
552
  /**
509
553
  * @hidden
510
554
  * Used by the TextBoxContainer to determine if the component is empty
@@ -620,6 +664,12 @@ export class DateInputComponent {
620
664
  this.renderer.setAttribute(this.inputElement, attributeNames.ariaInvalid, 'false');
621
665
  }
622
666
  }
667
+ /**
668
+ * @hidden
669
+ */
670
+ get isControlRequired() {
671
+ return isControlRequired(this.formControl) || this.isRequired;
672
+ }
623
673
  /**
624
674
  * @hidden
625
675
  */
@@ -817,9 +867,13 @@ export class DateInputComponent {
817
867
  this.setSpinnerFill(this.spindown.nativeElement, this.fillMode);
818
868
  }
819
869
  }
870
+ setInputAttributes() {
871
+ const attributesToRender = Object.assign({}, this.mutableAttributes, this.parsedAttributes);
872
+ setHTMLAttributes(attributesToRender, this.renderer, this.dateInput.nativeElement);
873
+ }
820
874
  }
821
875
  DateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.IntlService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i2.LocalizationService }, { token: i3.PickerService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
822
- DateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DateInputComponent, selector: "kendo-dateinput", inputs: { 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" }, outputs: { valueChange: "valueChange", valueUpdate: "valueUpdate", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-input": "this.wrapperClass", "class.k-dateinput": "this.wrapperClass", "class.k-disabled": "this.disabledClass" } }, providers: [
876
+ DateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DateInputComponent, selector: "kendo-dateinput", inputs: { focusableId: "focusableId", pickerType: "pickerType", disabled: "disabled", readonly: "readonly", title: "title", tabindex: "tabindex", role: "role", ariaReadOnly: "ariaReadOnly", tabIndex: "tabIndex", isRequired: "isRequired", 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", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", valueUpdate: "valueUpdate", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-input": "this.wrapperClass", "class.k-dateinput": "this.wrapperClass", "class.k-disabled": "this.disabledClass" } }, providers: [
823
877
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateInputComponent), multi: true },
824
878
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateInputComponent), multi: true },
825
879
  { provide: L10N_PREFIX, useValue: 'kendo.dateinput' },
@@ -834,13 +888,13 @@ DateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
834
888
  decrement="Decrease value"
835
889
  >
836
890
  </ng-container>
837
- <input
838
- #dateInput
891
+ <input #dateInput
892
+ class="k-input-inner"
893
+ [attr.required]="isControlRequired ? '' : null"
839
894
  autocomplete="off"
840
895
  autocorrect="off"
841
896
  autocapitalize="off"
842
897
  spellcheck="false"
843
- class="k-input-inner"
844
898
  [attr.role]="role"
845
899
  [attr.aria-readonly]="ariaReadOnly"
846
900
  [id]="focusableId"
@@ -918,13 +972,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
918
972
  decrement="Decrease value"
919
973
  >
920
974
  </ng-container>
921
- <input
922
- #dateInput
975
+ <input #dateInput
976
+ class="k-input-inner"
977
+ [attr.required]="isControlRequired ? '' : null"
923
978
  autocomplete="off"
924
979
  autocorrect="off"
925
980
  autocapitalize="off"
926
981
  spellcheck="false"
927
- class="k-input-inner"
928
982
  [attr.role]="role"
929
983
  [attr.aria-readonly]="ariaReadOnly"
930
984
  [id]="focusableId"
@@ -1004,6 +1058,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1004
1058
  type: Input
1005
1059
  }], tabIndex: [{
1006
1060
  type: Input
1061
+ }], isRequired: [{
1062
+ type: Input
1007
1063
  }], format: [{
1008
1064
  type: Input
1009
1065
  }], formatPlaceholder: [{
@@ -1048,6 +1104,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1048
1104
  type: Input
1049
1105
  }], fillMode: [{
1050
1106
  type: Input
1107
+ }], inputAttributes: [{
1108
+ type: Input
1051
1109
  }], valueChange: [{
1052
1110
  type: Output
1053
1111
  }], valueUpdate: [{
@@ -7,7 +7,7 @@ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { PopupService } from '@progress/kendo-angular-popup';
9
9
  import { cloneDate } from '@progress/kendo-date-math';
10
- import { hasObservers, isDocumentAvailable, KendoInput, Keys } from '@progress/kendo-angular-common';
10
+ import { hasObservers, isControlRequired, isDocumentAvailable, KendoInput, Keys } from '@progress/kendo-angular-common';
11
11
  import { validatePackage } from '@progress/kendo-licensing';
12
12
  import { packageMetadata } from '../package-metadata';
13
13
  import { MIN_DATE, MAX_DATE } from '../defaults';
@@ -575,6 +575,12 @@ export class DatePickerComponent {
575
575
  get inputElement() {
576
576
  return this.wrapper.nativeElement.querySelector('input');
577
577
  }
578
+ /**
579
+ * @hidden
580
+ */
581
+ get isControlRequired() {
582
+ return isControlRequired(this.control);
583
+ }
578
584
  /**
579
585
  * @hidden
580
586
  * Used by the TextBoxContainer to determine if the component is empty.
@@ -1071,7 +1077,7 @@ export class DatePickerComponent {
1071
1077
  }
1072
1078
  }
1073
1079
  DatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DatePickerComponent, deps: [{ token: i0.NgZone }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i3.PickerService }, { token: i4.DisabledDatesService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1074
- DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DatePickerComponent, selector: "kendo-datepicker", inputs: { focusableId: "focusableId", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer", navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", 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" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-datepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
1080
+ DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DatePickerComponent, selector: "kendo-datepicker", inputs: { focusableId: "focusableId", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], inputAttributes: "inputAttributes", monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer", navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", 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" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { properties: { "class.k-readonly": "this.readonly", "class.k-datepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
1075
1081
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1076
1082
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
1077
1083
  { provide: KendoInput, useExisting: forwardRef(() => DatePickerComponent) },
@@ -1110,6 +1116,7 @@ DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
1110
1116
  [readonly]="readonly || readOnlyInput"
1111
1117
  [ariaReadOnly]="readonly"
1112
1118
  [tabindex]="tabindex"
1119
+ [isRequired]="isControlRequired"
1113
1120
  [title]="title"
1114
1121
  [focusableId]="focusableId"
1115
1122
  [format]="format"
@@ -1128,6 +1135,7 @@ DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
1128
1135
  fillMode="none"
1129
1136
  rounded="none"
1130
1137
  size="none"
1138
+ [inputAttributes]="inputAttributes"
1131
1139
  [value]="value"
1132
1140
  (valueChange)="handleInputChange($event)"
1133
1141
  (click)="handleDateInputClick()"
@@ -1244,7 +1252,7 @@ DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
1244
1252
  </kendo-calendar-messages>
1245
1253
  </kendo-calendar>
1246
1254
  </ng-template>
1247
- `, isInline: true, components: [{ type: i5.DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i7.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: i8.ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["title", "subtitle", "items", "cssClass", "animation", "expanded", "titleId"], outputs: ["expandedChange", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { type: i9.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i10.CalendarComponent, selector: "kendo-calendar", inputs: ["showOtherMonthDays", "id", "focusedDate", "min", "max", "rangeValidation", "weekDaysFormat", "footer", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "navigationItemTemplate", "size"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "blur", "focus", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i11.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }], directives: [{ type: i12.DatePickerLocalizedMessagesDirective, selector: "[kendoDatePickerLocalizedMessages]" }, { type: i7.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1255
+ `, isInline: true, components: [{ type: i5.DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "isRequired", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { type: i6.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i7.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: i8.ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["title", "subtitle", "items", "cssClass", "animation", "expanded", "titleId"], outputs: ["expandedChange", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { type: i9.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i10.CalendarComponent, selector: "kendo-calendar", inputs: ["showOtherMonthDays", "id", "focusedDate", "min", "max", "rangeValidation", "weekDaysFormat", "footer", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "navigationItemTemplate", "size"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "blur", "focus", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i11.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }], directives: [{ type: i12.DatePickerLocalizedMessagesDirective, selector: "[kendoDatePickerLocalizedMessages]" }, { type: i7.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1248
1256
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DatePickerComponent, decorators: [{
1249
1257
  type: Component,
1250
1258
  args: [{
@@ -1291,6 +1299,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1291
1299
  [readonly]="readonly || readOnlyInput"
1292
1300
  [ariaReadOnly]="readonly"
1293
1301
  [tabindex]="tabindex"
1302
+ [isRequired]="isControlRequired"
1294
1303
  [title]="title"
1295
1304
  [focusableId]="focusableId"
1296
1305
  [format]="format"
@@ -1309,6 +1318,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1309
1318
  fillMode="none"
1310
1319
  rounded="none"
1311
1320
  size="none"
1321
+ [inputAttributes]="inputAttributes"
1312
1322
  [value]="value"
1313
1323
  (valueChange)="handleInputChange($event)"
1314
1324
  (click)="handleDateInputClick()"
@@ -1452,6 +1462,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1452
1462
  }], cellTemplateRef: [{
1453
1463
  type: Input,
1454
1464
  args: ['cellTemplate']
1465
+ }], inputAttributes: [{
1466
+ type: Input
1455
1467
  }], monthCellTemplate: [{
1456
1468
  type: ContentChild,
1457
1469
  args: [MonthCellTemplateDirective, { static: false }]
@@ -2,14 +2,14 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { Component, HostBinding, ViewChild, ElementRef, Input, isDevMode, TemplateRef, ChangeDetectorRef, Output, EventEmitter, NgZone, ViewContainerRef, forwardRef, ContentChild, Inject, ChangeDetectionStrategy, Renderer2, } from '@angular/core';
6
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
5
+ import { Component, HostBinding, ViewChild, ElementRef, Input, isDevMode, TemplateRef, ChangeDetectorRef, Output, EventEmitter, NgZone, ViewContainerRef, forwardRef, ContentChild, Inject, ChangeDetectionStrategy, Renderer2, Injector, } from '@angular/core';
6
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
7
7
  import { Subscription, fromEvent } from 'rxjs';
8
8
  import { tap } from 'rxjs/operators';
9
9
  import { cloneDate, isEqual, getDate } from '@progress/kendo-date-math';
10
10
  import { PopupService } from '@progress/kendo-angular-popup';
11
11
  import { IntlService } from '@progress/kendo-angular-intl';
12
- import { hasObservers, isDocumentAvailable, KendoInput, Keys } from '@progress/kendo-angular-common';
12
+ import { hasObservers, isControlRequired, isDocumentAvailable, KendoInput, Keys } from '@progress/kendo-angular-common';
13
13
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
14
14
  import { validatePackage } from '@progress/kendo-licensing';
15
15
  import { packageMetadata } from '../package-metadata';
@@ -67,7 +67,7 @@ const DATE_TAB_BUTTON_SELECTOR = '.k-button.k-date-tab';
67
67
  * Represents the [Kendo UI DateTimePicker component for Angular]({% slug overview_datetimepicker %}).
68
68
  */
69
69
  export class DateTimePickerComponent {
70
- constructor(popupService, intl, cdr, pickerService, ngZone, wrapper, touchEnabled, localization, disabledDatesService, renderer) {
70
+ constructor(popupService, intl, cdr, pickerService, ngZone, wrapper, touchEnabled, localization, disabledDatesService, renderer, injector) {
71
71
  this.popupService = popupService;
72
72
  this.intl = intl;
73
73
  this.cdr = cdr;
@@ -78,6 +78,7 @@ export class DateTimePickerComponent {
78
78
  this.localization = localization;
79
79
  this.disabledDatesService = disabledDatesService;
80
80
  this.renderer = renderer;
81
+ this.injector = injector;
81
82
  /**
82
83
  * @hidden
83
84
  */
@@ -663,6 +664,19 @@ export class DateTimePickerComponent {
663
664
  return this.popupRef?.popup.instance.container.nativeElement.querySelector(DATE_TAB_BUTTON_SELECTOR);
664
665
  }
665
666
  ;
667
+ /**
668
+ * @hidden
669
+ */
670
+ get formControl() {
671
+ const ngControl = this.injector.get(NgControl, null);
672
+ return ngControl?.control || null;
673
+ }
674
+ /**
675
+ * @hidden
676
+ */
677
+ get isControlRequired() {
678
+ return isControlRequired(this.formControl);
679
+ }
666
680
  ngOnInit() {
667
681
  this.subscriptions.add(this.pickerService.onFocus
668
682
  // detect popup changes to disable the inactive view mark-up when the popup is open
@@ -1312,8 +1326,8 @@ export class DateTimePickerComponent {
1312
1326
  }
1313
1327
  }
1314
1328
  }
1315
- DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i1.PopupService }, { token: i2.IntlService }, { token: i0.ChangeDetectorRef }, { token: i3.PickerService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: TOUCH_ENABLED }, { token: i4.LocalizationService }, { token: i5.DisabledDatesService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1316
- DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DateTimePickerComponent, selector: "kendo-datetimepicker", inputs: { focusableId: "focusableId", weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", 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", headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-datetimepicker": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.disabledClass", "class.k-readonly": "this.readonly" } }, providers: [
1329
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i1.PopupService }, { token: i2.IntlService }, { token: i0.ChangeDetectorRef }, { token: i3.PickerService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: TOUCH_ENABLED }, { token: i4.LocalizationService }, { token: i5.DisabledDatesService }, { token: i0.Renderer2 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1330
+ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: DateTimePickerComponent, selector: "kendo-datetimepicker", inputs: { focusableId: "focusableId", weekDaysFormat: "weekDaysFormat", showOtherMonthDays: "showOtherMonthDays", 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", inputAttributes: "inputAttributes", defaultTab: "defaultTab", size: "size", rounded: "rounded", fillMode: "fillMode", headerTemplateRef: ["headerTemplate", "headerTemplateRef"], footerTemplateRef: ["footerTemplate", "footerTemplateRef"], footer: "footer" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-datetimepicker": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.disabledClass", "class.k-readonly": "this.readonly" } }, providers: [
1317
1331
  PickerService,
1318
1332
  LocalizationService,
1319
1333
  DisabledDatesService,
@@ -1409,9 +1423,11 @@ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
1409
1423
  [ariaReadOnly]="readonly"
1410
1424
  [steps]="steps"
1411
1425
  [tabindex]="tabindex"
1426
+ [isRequired]="isControlRequired"
1412
1427
  [title]="title"
1413
1428
  pickerType="datetimepicker"
1414
1429
  hasPopup="dialog"
1430
+ [inputAttributes]="inputAttributes"
1415
1431
  [isPopupOpen]="isOpen"
1416
1432
  (valueChange)="handleInputValueChange($event)"
1417
1433
  [kendoEventsOutsideAngular]="{
@@ -1691,7 +1707,7 @@ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
1691
1707
  </div>
1692
1708
  </div>
1693
1709
  </ng-template>
1694
- `, isInline: true, components: [{ type: i6.DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { type: i7.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i8.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: i9.ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["title", "subtitle", "items", "cssClass", "animation", "expanded", "titleId"], outputs: ["expandedChange", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { type: i10.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i11.CalendarComponent, selector: "kendo-calendar", inputs: ["showOtherMonthDays", "id", "focusedDate", "min", "max", "rangeValidation", "weekDaysFormat", "footer", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "navigationItemTemplate", "size"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "blur", "focus", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i12.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }, { type: i13.TimeSelectorComponent, selector: "kendo-timeselector", inputs: ["format", "min", "max", "cancelButton", "setButton", "nowButton", "disabled", "isAdaptiveEnabled", "isDateTimePicker", "steps", "value"], outputs: ["valueChange", "valueReject", "tabOutLastPart"], exportAs: ["kendo-timeselector"] }, { type: i14.TimeSelectorCustomMessagesComponent, selector: "kendo-timeselector-messages" }], directives: [{ type: i15.LocalizedMessagesDirective, selector: "[kendoDateTimePickerLocalizedMessages]" }, { type: i8.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i16.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i16.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i9.ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { type: i16.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1710
+ `, isInline: true, components: [{ type: i6.DateInputComponent, selector: "kendo-dateinput", inputs: ["focusableId", "pickerType", "disabled", "readonly", "title", "tabindex", "role", "ariaReadOnly", "tabIndex", "isRequired", "format", "formatPlaceholder", "placeholder", "steps", "max", "min", "rangeValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "allowCaretMode", "autoFill", "incompleteDateValidation", "twoDigitYearMax", "enableMouseWheel", "value", "spinners", "isPopupOpen", "hasPopup", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "valueUpdate", "focus", "blur"], exportAs: ["kendo-dateinput"] }, { type: i7.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i8.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: i9.ActionSheetComponent, selector: "kendo-actionsheet", inputs: ["title", "subtitle", "items", "cssClass", "animation", "expanded", "titleId"], outputs: ["expandedChange", "expand", "collapse", "itemClick", "overlayClick"], exportAs: ["kendoActionSheet"] }, { type: i10.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i11.CalendarComponent, selector: "kendo-calendar", inputs: ["showOtherMonthDays", "id", "focusedDate", "min", "max", "rangeValidation", "weekDaysFormat", "footer", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "headerTemplate", "footerTemplate", "navigationItemTemplate", "size"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "blur", "focus", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i12.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }, { type: i13.TimeSelectorComponent, selector: "kendo-timeselector", inputs: ["format", "min", "max", "cancelButton", "setButton", "nowButton", "disabled", "isAdaptiveEnabled", "isDateTimePicker", "steps", "value"], outputs: ["valueChange", "valueReject", "tabOutLastPart"], exportAs: ["kendo-timeselector"] }, { type: i14.TimeSelectorCustomMessagesComponent, selector: "kendo-timeselector-messages" }], directives: [{ type: i15.LocalizedMessagesDirective, selector: "[kendoDateTimePickerLocalizedMessages]" }, { type: i8.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i16.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i16.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i9.ActionSheetTemplateDirective, selector: "[kendoActionSheetTemplate]" }, { type: i16.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1695
1711
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DateTimePickerComponent, decorators: [{
1696
1712
  type: Component,
1697
1713
  args: [{
@@ -1795,9 +1811,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
1795
1811
  [ariaReadOnly]="readonly"
1796
1812
  [steps]="steps"
1797
1813
  [tabindex]="tabindex"
1814
+ [isRequired]="isControlRequired"
1798
1815
  [title]="title"
1799
1816
  pickerType="datetimepicker"
1800
1817
  hasPopup="dialog"
1818
+ [inputAttributes]="inputAttributes"
1801
1819
  [isPopupOpen]="isOpen"
1802
1820
  (valueChange)="handleInputValueChange($event)"
1803
1821
  [kendoEventsOutsideAngular]="{
@@ -2082,7 +2100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2082
2100
  }], ctorParameters: function () { return [{ type: i1.PopupService }, { type: i2.IntlService }, { type: i0.ChangeDetectorRef }, { type: i3.PickerService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: undefined, decorators: [{
2083
2101
  type: Inject,
2084
2102
  args: [TOUCH_ENABLED]
2085
- }] }, { type: i4.LocalizationService }, { type: i5.DisabledDatesService }, { type: i0.Renderer2 }]; }, propDecorators: { hostClasses: [{
2103
+ }] }, { type: i4.LocalizationService }, { type: i5.DisabledDatesService }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: { hostClasses: [{
2086
2104
  type: HostBinding,
2087
2105
  args: ['class.k-datetimepicker']
2088
2106
  }, {
@@ -2165,6 +2183,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
2165
2183
  type: Input
2166
2184
  }], adaptiveMode: [{
2167
2185
  type: Input
2186
+ }], inputAttributes: [{
2187
+ type: Input
2168
2188
  }], valueChange: [{
2169
2189
  type: Output
2170
2190
  }], open: [{
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-dateinputs',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1712142428,
13
- version: '15.4.0',
12
+ publishDate: 1712566608,
13
+ version: '15.5.0-develop.2',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };