@progress/kendo-angular-dateinputs 5.3.0 → 5.3.1-dev.202201070925

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.
Files changed (36) hide show
  1. package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/calendar/calendar.component.js +70 -45
  4. package/dist/es/calendar/horizontal-view-list.component.js +1 -1
  5. package/dist/es/calendar/multiview-calendar.component.js +48 -22
  6. package/dist/es/calendar/multiview-calendar.module.js +9 -1
  7. package/dist/es/calendar/view-list.component.js +1 -1
  8. package/dist/es/datepicker/datepicker.component.js +8 -3
  9. package/dist/es/package-metadata.js +1 -1
  10. package/dist/es/util.js +15 -0
  11. package/dist/es2015/calendar/calendar.component.d.ts +17 -3
  12. package/dist/es2015/calendar/calendar.component.js +71 -40
  13. package/dist/es2015/calendar/horizontal-view-list.component.js +1 -0
  14. package/dist/es2015/calendar/multiview-calendar.component.d.ts +17 -3
  15. package/dist/es2015/calendar/multiview-calendar.component.js +52 -18
  16. package/dist/es2015/calendar/multiview-calendar.module.js +9 -1
  17. package/dist/es2015/calendar/view-list.component.js +5 -1
  18. package/dist/es2015/dateinput/dateinput.component.d.ts +2 -0
  19. package/dist/es2015/datepicker/datepicker.component.d.ts +2 -0
  20. package/dist/es2015/datepicker/datepicker.component.js +8 -3
  21. package/dist/es2015/index.metadata.json +1 -1
  22. package/dist/es2015/package-metadata.js +1 -1
  23. package/dist/es2015/util.d.ts +7 -0
  24. package/dist/es2015/util.js +15 -0
  25. package/dist/fesm2015/index.js +7193 -7098
  26. package/dist/fesm5/index.js +6550 -6474
  27. package/dist/npm/calendar/calendar.component.js +70 -45
  28. package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
  29. package/dist/npm/calendar/multiview-calendar.component.js +47 -21
  30. package/dist/npm/calendar/multiview-calendar.module.js +9 -1
  31. package/dist/npm/calendar/view-list.component.js +1 -1
  32. package/dist/npm/datepicker/datepicker.component.js +7 -2
  33. package/dist/npm/package-metadata.js +1 -1
  34. package/dist/npm/util.js +15 -0
  35. package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
  36. package/package.json +1 -1
@@ -11,6 +11,7 @@ import { cloneDate, isEqual } from '@progress/kendo-date-math';
11
11
  import { hasObservers, KendoInput, guid, Keys } from '@progress/kendo-angular-common';
12
12
  import { validatePackage } from '@progress/kendo-licensing';
13
13
  import { packageMetadata } from '../package-metadata';
14
+ import { MultiViewCalendarComponent } from './multiview-calendar.component';
14
15
  import { NavigationComponent } from './navigation.component';
15
16
  import { ViewListComponent } from './view-list.component';
16
17
  import { CalendarDOMService } from './services/dom.service';
@@ -448,15 +449,9 @@ var CalendarComponent = /** @class */ (function () {
448
449
  enumerable: true,
449
450
  configurable: true
450
451
  });
451
- Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
452
- get: function () {
453
- return 'grid';
454
- },
455
- enumerable: true,
456
- configurable: true
457
- });
458
452
  Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
459
453
  get: function () {
454
+ // in Classic mode, the inner MultiViewCalendar is the focusable element
460
455
  return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
461
456
  },
462
457
  enumerable: true,
@@ -464,7 +459,8 @@ var CalendarComponent = /** @class */ (function () {
464
459
  });
465
460
  Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
466
461
  get: function () {
467
- return this.disabled;
462
+ // in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
463
+ return this.type === 'classic' ? undefined : this.disabled;
468
464
  },
469
465
  enumerable: true,
470
466
  configurable: true
@@ -550,19 +546,23 @@ var CalendarComponent = /** @class */ (function () {
550
546
  * ```
551
547
  */
552
548
  CalendarComponent.prototype.focus = function () {
553
- if (!this.element) {
554
- return;
549
+ var focusTarget = this.type === 'infinite' ?
550
+ this.element && this.element.nativeElement :
551
+ this.multiViewCalendar;
552
+ if (isPresent(focusTarget)) {
553
+ focusTarget.focus();
555
554
  }
556
- this.element.nativeElement.focus();
557
555
  };
558
556
  /**
559
557
  * Blurs the Calendar component.
560
558
  */
561
559
  CalendarComponent.prototype.blur = function () {
562
- if (!this.element) {
563
- return;
560
+ var blurTarget = this.type === 'infinite' ?
561
+ this.element && this.element.nativeElement :
562
+ this.multiViewCalendar;
563
+ if (isPresent(blurTarget)) {
564
+ blurTarget.blur();
564
565
  }
565
- this.element.nativeElement.blur();
566
566
  };
567
567
  /**
568
568
  * @hidden
@@ -691,6 +691,14 @@ var CalendarComponent = /** @class */ (function () {
691
691
  return null;
692
692
  }
693
693
  };
694
+ /**
695
+ * @hidden
696
+ */
697
+ CalendarComponent.prototype.handleNavigate = function (event) {
698
+ this.focusedDate = event.focusedDate;
699
+ this.activeView = event.activeView;
700
+ this.emitNavigate(this.focusedDate);
701
+ };
694
702
  /**
695
703
  * @hidden
696
704
  */
@@ -745,6 +753,39 @@ var CalendarComponent = /** @class */ (function () {
745
753
  });
746
754
  });
747
755
  };
756
+ /**
757
+ * @hidden
758
+ */
759
+ CalendarComponent.prototype.handleBlur = function (args) {
760
+ var _this = this;
761
+ if (this.element.nativeElement.contains(args.relatedTarget)) {
762
+ return;
763
+ }
764
+ this.isActive = false;
765
+ // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
766
+ // and enters the zone for no reason because the parent component is still untouched
767
+ if (!this.pickerService && requiresZoneOnBlur(this.control)) {
768
+ this.ngZone.run(function () {
769
+ _this.onControlTouched();
770
+ _this.emitBlur(args);
771
+ _this.cdr.markForCheck();
772
+ });
773
+ }
774
+ else {
775
+ this.emitBlur(args);
776
+ this.detectChanges();
777
+ }
778
+ };
779
+ /**
780
+ * @hidden
781
+ */
782
+ CalendarComponent.prototype.handleFocus = function () {
783
+ this.isActive = true;
784
+ if (!NgZone.isInAngularZone()) {
785
+ this.detectChanges();
786
+ }
787
+ this.emitFocus();
788
+ };
748
789
  CalendarComponent.prototype.setClasses = function (element) {
749
790
  this.renderer.addClass(element, 'k-widget');
750
791
  this.renderer.addClass(element, 'k-calendar');
@@ -789,30 +830,6 @@ var CalendarComponent = /** @class */ (function () {
789
830
  this.pickerService.onFocus.emit();
790
831
  }
791
832
  };
792
- CalendarComponent.prototype.handleBlur = function (args) {
793
- var _this = this;
794
- this.isActive = false;
795
- // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
796
- // and enters the zone for no reason because the parent component is still untouched
797
- if (!this.pickerService && requiresZoneOnBlur(this.control)) {
798
- this.ngZone.run(function () {
799
- _this.onControlTouched();
800
- _this.emitBlur(args);
801
- _this.cdr.markForCheck();
802
- });
803
- }
804
- else {
805
- this.emitBlur(args);
806
- this.detectChanges();
807
- }
808
- };
809
- CalendarComponent.prototype.handleFocus = function () {
810
- this.isActive = true;
811
- if (!NgZone.isInAngularZone()) {
812
- this.detectChanges();
813
- }
814
- this.emitFocus();
815
- };
816
833
  CalendarComponent.prototype.handleComponentClick = function () {
817
834
  if (!this.isActive) {
818
835
  if (this.type === 'infinite' && this.monthView.isScrolled()) {
@@ -823,6 +840,10 @@ var CalendarComponent = /** @class */ (function () {
823
840
  }
824
841
  };
825
842
  CalendarComponent.prototype.handleKeydown = function (args) {
843
+ var headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
844
+ if (headerActive) {
845
+ return;
846
+ }
826
847
  // reserve the alt + arrow key commands for the picker
827
848
  var arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
828
849
  if (isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
@@ -849,7 +870,12 @@ var CalendarComponent = /** @class */ (function () {
849
870
  }
850
871
  };
851
872
  CalendarComponent.prototype.setAriaActivedescendant = function () {
852
- if (!isPresent(this.element)) {
873
+ // in Classic mode, the inner MultiViewCalendar handles the activedescendant
874
+ if (!isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
875
+ return;
876
+ }
877
+ if (this.type === 'classic') {
878
+ this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
853
879
  return;
854
880
  }
855
881
  var focusedCellId = this.cellUID + this.focusedDate.getTime();
@@ -1050,16 +1076,15 @@ var CalendarComponent = /** @class */ (function () {
1050
1076
  ViewChild(ViewListComponent, { static: false }),
1051
1077
  tslib_1.__metadata("design:type", ViewListComponent)
1052
1078
  ], CalendarComponent.prototype, "monthView", void 0);
1079
+ tslib_1.__decorate([
1080
+ ViewChild(MultiViewCalendarComponent, { static: false }),
1081
+ tslib_1.__metadata("design:type", MultiViewCalendarComponent)
1082
+ ], CalendarComponent.prototype, "multiViewCalendar", void 0);
1053
1083
  tslib_1.__decorate([
1054
1084
  HostBinding('attr.id'),
1055
1085
  tslib_1.__metadata("design:type", String),
1056
1086
  tslib_1.__metadata("design:paramtypes", [])
1057
1087
  ], CalendarComponent.prototype, "widgetId", null);
1058
- tslib_1.__decorate([
1059
- HostBinding('attr.role'),
1060
- tslib_1.__metadata("design:type", String),
1061
- tslib_1.__metadata("design:paramtypes", [])
1062
- ], CalendarComponent.prototype, "widgetRole", null);
1063
1088
  tslib_1.__decorate([
1064
1089
  HostBinding('attr.tabindex'),
1065
1090
  tslib_1.__metadata("design:type", Number),
@@ -1091,7 +1116,7 @@ var CalendarComponent = /** @class */ (function () {
1091
1116
  SelectionService
1092
1117
  ],
1093
1118
  selector: 'kendo-calendar',
1094
- template: "\n <ng-container kendoCalendarLocalizedMessages\n i18n-today=\"kendo.calendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.calendar.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <ng-container *ngIf=\"type === 'infinite'\">\n <kendo-calendar-navigation\n *ngIf=\"navigation\"\n [activeView]=\"activeViewEnum\"\n [focusedDate]=\"focusedDate\"\n [min]=\"min\"\n [max]=\"max\"\n [templateRef]=\"navigationItemTemplate?.templateRef\"\n (valueChange)=\"handleNavigation($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-navigation>\n <kendo-calendar-viewlist\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [headerTitleTemplateRef]=\"headerTitleTemplate?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [selectedDates]=\"selectedDates\"\n (todayButtonClick)=\"handleDateChange({\n selectedDates: [$event],\n focusedDate: $event\n })\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (activeDateChange)=\"handleActiveDateChange($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-viewlist>\n <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n </ng-container>\n <ng-container *ngIf=\"type === 'classic'\">\n <kendo-multiviewcalendar\n #multiviewcalendar\n [views]=\"1\"\n [min]=\"min\"\n [max]=\"max\"\n [isActive]=\"isActive\"\n [activeView]=\"activeView\"\n [bottomView]=\"bottomView\"\n [topView]=\"topView\"\n [weekNumber]=\"weekNumber\"\n [animateNavigation]=\"animateNavigation\"\n [cellTemplate]=\"activeCellTemplate()\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [focusedDate]=\"focusedDate\"\n [selection]=\"selection\"\n [value]=\"value\"\n [disabledDates]=\"disabledDates\"\n (activeViewChange)=\"handleActiveViewChange($event)\"\n (navigate)=\"navigate.emit($event)\"\n (valueChange)=\"handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)\"\n >\n <kendo-multiviewcalendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-multiviewcalendar-messages>\n </kendo-multiviewcalendar>\n </ng-container>\n "
1119
+ template: "\n <ng-container kendoCalendarLocalizedMessages\n i18n-today=\"kendo.calendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.calendar.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <ng-container *ngIf=\"type === 'infinite'\">\n <kendo-calendar-navigation\n *ngIf=\"navigation\"\n [activeView]=\"activeViewEnum\"\n [focusedDate]=\"focusedDate\"\n [min]=\"min\"\n [max]=\"max\"\n [templateRef]=\"navigationItemTemplate?.templateRef\"\n (valueChange)=\"handleNavigation($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-navigation>\n <kendo-calendar-viewlist\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [headerTitleTemplateRef]=\"headerTitleTemplate?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [selectedDates]=\"selectedDates\"\n (todayButtonClick)=\"handleDateChange({\n selectedDates: [$event],\n focusedDate: $event\n })\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (activeDateChange)=\"handleActiveDateChange($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-viewlist>\n <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n </ng-container>\n <ng-container *ngIf=\"type === 'classic'\">\n <kendo-multiviewcalendar\n #multiviewcalendar\n [views]=\"1\"\n [min]=\"min\"\n [max]=\"max\"\n [isActive]=\"isActive\"\n [activeView]=\"activeView\"\n [bottomView]=\"bottomView\"\n [topView]=\"topView\"\n [weekNumber]=\"weekNumber\"\n [animateNavigation]=\"animateNavigation\"\n [cellTemplate]=\"activeCellTemplate()\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [focusedDate]=\"focusedDate\"\n [selection]=\"selection\"\n [value]=\"value\"\n [disabledDates]=\"disabledDates\"\n (activeViewChange)=\"handleActiveViewChange($event)\"\n (navigate)=\"handleNavigate($event)\"\n (valueChange)=\"handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)\"\n (focus)=\"handleFocus()\"\n (blur)=\"handleBlur($event)\"\n >\n <kendo-multiviewcalendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-multiviewcalendar-messages>\n </kendo-multiviewcalendar>\n </ng-container>\n "
1095
1120
  }),
1096
1121
  tslib_1.__param(12, Optional()),
1097
1122
  tslib_1.__metadata("design:paramtypes", [BusViewService,
@@ -349,7 +349,7 @@ var HorizontalViewListComponent = /** @class */ (function () {
349
349
  Component({
350
350
  changeDetection: ChangeDetectionStrategy.OnPush,
351
351
  selector: 'kendo-calendar-horizontal',
352
- template: "\n <ng-template #tableTemplate let-date=\"date\" let-class=\"className\">\n <table\n class=\"k-content k-calendar-content k-calendar-table\"\n [ngClass]=\"class\"\n >\n <caption *ngIf=\"showViewHeader\" [ngClass]=\"getCaptionClass()\">{{ getCaptionTitle(date) }}</caption>\n <thead *ngIf=\"isMonthView()\" class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\" role=\"row\">\n <th *ngFor=\"let name of weekNames\" class=\"k-calendar-th\">{{name}}</th>\n </tr>\n </thead>\n <tbody\n class=\"k-calendar-tbody\"\n kendoCalendarView\n role=\"rowgroup\"\n direction=\"horizontal\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\"\n [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [selectionRange]=\"selectionRange\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n (cellEnter)=\"cellEnter.emit($event)\"\n (cellLeave)=\"cellLeave.emit($event)\"\n >\n </tbody>\n </table>\n </ng-template>\n\n <!-- When Next is clicked a placeholder table is rendered before the Main Table -->\n <ng-template\n *ngIf=\"nextAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: nextAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n\n <ng-template\n *kFor=\"let date of dates\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: date\n }\"\n >\n </ng-template>\n\n <!-- When Prev is clicked a placeholder table is rendered after the Main Table -->\n <ng-template\n *ngIf=\"prevAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: prevAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n "
352
+ template: "\n <ng-template #tableTemplate let-date=\"date\" let-class=\"className\">\n <table\n role=\"grid\"\n class=\"k-content k-calendar-content k-calendar-table\"\n [ngClass]=\"class\"\n >\n <caption *ngIf=\"showViewHeader\" [ngClass]=\"getCaptionClass()\">{{ getCaptionTitle(date) }}</caption>\n <thead *ngIf=\"isMonthView()\" class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\" role=\"row\">\n <th *ngFor=\"let name of weekNames\" class=\"k-calendar-th\">{{name}}</th>\n </tr>\n </thead>\n <tbody\n class=\"k-calendar-tbody\"\n kendoCalendarView\n role=\"rowgroup\"\n direction=\"horizontal\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\"\n [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [selectionRange]=\"selectionRange\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n (cellEnter)=\"cellEnter.emit($event)\"\n (cellLeave)=\"cellLeave.emit($event)\"\n >\n </tbody>\n </table>\n </ng-template>\n\n <!-- When Next is clicked a placeholder table is rendered before the Main Table -->\n <ng-template\n *ngIf=\"nextAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: nextAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n\n <ng-template\n *kFor=\"let date of dates\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: date\n }\"\n >\n </ng-template>\n\n <!-- When Prev is clicked a placeholder table is rendered after the Main Table -->\n <ng-template\n *ngIf=\"prevAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: prevAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n "
353
353
  }),
354
354
  tslib_1.__metadata("design:paramtypes", [BusViewService,
355
355
  IntlService,
@@ -3,13 +3,13 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- /* tslint:disable:no-forward-ref */
7
- import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone } from '@angular/core';
6
+ import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone, Optional } from '@angular/core';
8
7
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
9
8
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
10
9
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
11
10
  import { hasObservers, guid, Keys } from '@progress/kendo-angular-common';
12
11
  import { HorizontalViewListComponent } from './horizontal-view-list.component';
12
+ import { HeaderComponent } from './header.component';
13
13
  import { BusViewService } from './services/bus-view.service';
14
14
  import { NavigationService } from './services/navigation.service';
15
15
  import { SelectionService } from './services/selection.service';
@@ -30,6 +30,7 @@ import { MIN_DATE, MAX_DATE } from '../defaults';
30
30
  import { areDatesEqual, dateInRange, getToday, hasExistingValue, last, noop } from '../util';
31
31
  import { Subscription } from 'rxjs';
32
32
  import { isPresent } from '../common/utils';
33
+ import { PickerService } from '../common/picker.service';
33
34
  var BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';
34
35
  var TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';
35
36
  var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';
@@ -66,7 +67,7 @@ export var RANGE_CALENDAR_RANGE_VALIDATORS = {
66
67
  * ```
67
68
  */
68
69
  var MultiViewCalendarComponent = /** @class */ (function () {
69
- function MultiViewCalendarComponent(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService) {
70
+ function MultiViewCalendarComponent(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService, pickerService) {
70
71
  this.bus = bus;
71
72
  this.element = element;
72
73
  this.navigator = navigator;
@@ -75,6 +76,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
75
76
  this.zone = zone;
76
77
  this.disabledDatesService = disabledDatesService;
77
78
  this.selectionService = selectionService;
79
+ this.pickerService = pickerService;
78
80
  /**
79
81
  * @hidden
80
82
  */
@@ -114,6 +116,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
114
116
  * @hidden
115
117
  */
116
118
  this.isActive = false;
119
+ /**
120
+ * @hidden
121
+ */
122
+ this.isHeaderActive = false;
117
123
  /**
118
124
  * Defines the active view that the Calendar initially renders
119
125
  * ([see example]({% slug activeview_multiviewcalendar %})).
@@ -178,6 +184,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
178
184
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
179
185
  */
180
186
  this.valueChange = new EventEmitter();
187
+ /**
188
+ * @hidden
189
+ */
190
+ this.blurEvent = new EventEmitter();
181
191
  this.cellUID = guid();
182
192
  this.isHovered = false;
183
193
  this.isPrevDisabled = true;
@@ -413,13 +423,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
413
423
  enumerable: true,
414
424
  configurable: true
415
425
  });
416
- Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
417
- get: function () {
418
- return 'grid';
419
- },
420
- enumerable: true,
421
- configurable: true
422
- });
423
426
  Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
424
427
  get: function () {
425
428
  return this.disabled ? undefined : this.tabIndex;
@@ -444,16 +447,22 @@ var MultiViewCalendarComponent = /** @class */ (function () {
444
447
  /**
445
448
  * @hidden
446
449
  */
447
- MultiViewCalendarComponent.prototype.handleBlur = function () {
448
- this.onControlTouched();
450
+ MultiViewCalendarComponent.prototype.handleFocusout = function (event) {
451
+ var relatedTarget = event.relatedTarget;
452
+ if (!this.element.nativeElement.contains(relatedTarget)) {
453
+ this.blurEvent.emit(event);
454
+ this.onControlTouched();
455
+ }
449
456
  this.isActive = false;
450
457
  this.isHovered = false; //ensure that hovered is also not active
458
+ this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
451
459
  };
452
460
  /**
453
461
  * @hidden
454
462
  */
455
463
  MultiViewCalendarComponent.prototype.handleFocus = function () {
456
464
  this.isActive = true;
465
+ this.isHeaderActive = false;
457
466
  };
458
467
  /**
459
468
  * @hidden
@@ -486,7 +495,13 @@ var MultiViewCalendarComponent = /** @class */ (function () {
486
495
  * @hidden
487
496
  */
488
497
  MultiViewCalendarComponent.prototype.keydown = function (event) {
498
+ if (this.isHeaderActive) {
499
+ return;
500
+ }
489
501
  if (event.keyCode === Keys.Enter) {
502
+ if (isPresent(this.pickerService)) {
503
+ event.preventDefault(); // Don't submit form from Datepicker popup
504
+ }
490
505
  this.performSelection(this.focusedDate, event);
491
506
  }
492
507
  var candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
@@ -563,6 +578,12 @@ var MultiViewCalendarComponent = /** @class */ (function () {
563
578
  }
564
579
  this.element.nativeElement.blur();
565
580
  };
581
+ /**
582
+ * @hidden
583
+ */
584
+ MultiViewCalendarComponent.prototype.handleHeaderFocus = function () {
585
+ this.isHeaderActive = true;
586
+ };
566
587
  /**
567
588
  * @hidden
568
589
  */
@@ -885,6 +906,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
885
906
  Output(),
886
907
  tslib_1.__metadata("design:type", EventEmitter)
887
908
  ], MultiViewCalendarComponent.prototype, "valueChange", void 0);
909
+ tslib_1.__decorate([
910
+ Output('blur'),
911
+ tslib_1.__metadata("design:type", EventEmitter)
912
+ ], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
888
913
  tslib_1.__decorate([
889
914
  ContentChild(CellTemplateDirective, { static: true }),
890
915
  tslib_1.__metadata("design:type", CellTemplateDirective)
@@ -948,6 +973,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
948
973
  tslib_1.__metadata("design:type", HeaderTitleTemplateDirective),
949
974
  tslib_1.__metadata("design:paramtypes", [HeaderTitleTemplateDirective])
950
975
  ], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
976
+ tslib_1.__decorate([
977
+ ViewChild(HeaderComponent, { static: false, read: ElementRef }),
978
+ tslib_1.__metadata("design:type", ElementRef)
979
+ ], MultiViewCalendarComponent.prototype, "headerElement", void 0);
951
980
  tslib_1.__decorate([
952
981
  ViewChild(HorizontalViewListComponent, { static: false }),
953
982
  tslib_1.__metadata("design:type", HorizontalViewListComponent)
@@ -957,11 +986,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
957
986
  tslib_1.__metadata("design:type", String),
958
987
  tslib_1.__metadata("design:paramtypes", [])
959
988
  ], MultiViewCalendarComponent.prototype, "widgetId", null);
960
- tslib_1.__decorate([
961
- HostBinding('attr.role'),
962
- tslib_1.__metadata("design:type", String),
963
- tslib_1.__metadata("design:paramtypes", [])
964
- ], MultiViewCalendarComponent.prototype, "widgetRole", null);
965
989
  tslib_1.__decorate([
966
990
  HostBinding('attr.tabindex'),
967
991
  tslib_1.__metadata("design:type", Number),
@@ -979,11 +1003,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
979
1003
  tslib_1.__metadata("design:paramtypes", [])
980
1004
  ], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
981
1005
  tslib_1.__decorate([
982
- HostListener("blur"),
1006
+ HostListener('focusout', ['$event']),
983
1007
  tslib_1.__metadata("design:type", Function),
984
- tslib_1.__metadata("design:paramtypes", []),
1008
+ tslib_1.__metadata("design:paramtypes", [Object]),
985
1009
  tslib_1.__metadata("design:returntype", void 0)
986
- ], MultiViewCalendarComponent.prototype, "handleBlur", null);
1010
+ ], MultiViewCalendarComponent.prototype, "handleFocusout", null);
987
1011
  tslib_1.__decorate([
988
1012
  HostListener("focus"),
989
1013
  tslib_1.__metadata("design:type", Function),
@@ -1038,8 +1062,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1038
1062
  SelectionService
1039
1063
  ],
1040
1064
  selector: 'kendo-multiviewcalendar',
1041
- template: "\n <ng-container kendoMultiViewCalendarLocalizedMessages\n i18n-today=\"kendo.multiviewcalendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.multiviewcalendar.prevButtonTitle|The label for the previous button in the Multiview calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-calendar-header\n [activeView]=\"activeViewEnum\"\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [rangeLength]=\"views\"\n [templateRef]=\"headerTitleTemplate?.templateRef\"\n [isPrevDisabled]=\"isPrevDisabled\"\n [isNextDisabled]=\"isNextDisabled\"\n [showNavigationButtons]=\"true\"\n (todayButtonClick)=\"handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })\"\n (prevButtonClick)=\"navigateView(prevView)\"\n (nextButtonClick)=\"navigateView(nextView)\"\n >\n </kendo-calendar-header>\n <kendo-calendar-horizontal\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive || isHovered\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [views]=\"views\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [animateNavigation]=\"animateNavigation\"\n [showViewHeader]=\"showViewHeader\"\n [weekNumber]=\"weekNumber\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [selectionRange]=\"selectionRange\"\n [selectedDates]=\"selectedDates\"\n (valueChange)=\"handleDateChange($event)\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (cellEnter)=\"emitCellEvent(cellEnter, $event)\"\n (cellLeave)=\"emitCellEvent(cellLeave, $event)\"\n (activeDateChange)=\"setActiveDate($event)\"\n >\n </kendo-calendar-horizontal>\n "
1065
+ template: "\n <ng-container kendoMultiViewCalendarLocalizedMessages\n i18n-today=\"kendo.multiviewcalendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.multiviewcalendar.prevButtonTitle|The label for the previous button in the Multiview calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-calendar-header\n [activeView]=\"activeViewEnum\"\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [rangeLength]=\"views\"\n [templateRef]=\"headerTitleTemplate?.templateRef\"\n [isPrevDisabled]=\"isPrevDisabled\"\n [isNextDisabled]=\"isNextDisabled\"\n [showNavigationButtons]=\"true\"\n (todayButtonClick)=\"handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })\"\n (prevButtonClick)=\"navigateView(prevView)\"\n (nextButtonClick)=\"navigateView(nextView)\"\n [kendoEventsOutsideAngular]=\"{\n focusin: handleHeaderFocus\n }\"\n [scope]=\"this\"\n >\n </kendo-calendar-header>\n <kendo-calendar-horizontal\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive || (isHovered && !isHeaderActive)\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [views]=\"views\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [animateNavigation]=\"animateNavigation\"\n [showViewHeader]=\"showViewHeader\"\n [weekNumber]=\"weekNumber\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [selectionRange]=\"selectionRange\"\n [selectedDates]=\"selectedDates\"\n (valueChange)=\"handleDateChange($event)\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (cellEnter)=\"emitCellEvent(cellEnter, $event)\"\n (cellLeave)=\"emitCellEvent(cellLeave, $event)\"\n (activeDateChange)=\"setActiveDate($event)\"\n >\n </kendo-calendar-horizontal>\n "
1042
1066
  }),
1067
+ tslib_1.__param(8, Optional()),
1043
1068
  tslib_1.__metadata("design:paramtypes", [BusViewService,
1044
1069
  ElementRef,
1045
1070
  NavigationService,
@@ -1047,7 +1072,8 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1047
1072
  ChangeDetectorRef,
1048
1073
  NgZone,
1049
1074
  DisabledDatesService,
1050
- SelectionService])
1075
+ SelectionService,
1076
+ PickerService])
1051
1077
  ], MultiViewCalendarComponent);
1052
1078
  return MultiViewCalendarComponent;
1053
1079
  }());
@@ -7,6 +7,7 @@ import { NgModule } from '@angular/core';
7
7
  import { CommonModule } from '@angular/common';
8
8
  import { IntlModule } from '@progress/kendo-angular-intl';
9
9
  import { PopupModule } from '@progress/kendo-angular-popup';
10
+ import { EventsModule } from '@progress/kendo-angular-common';
10
11
  import { CalendarCommonModule } from './calendar-common.module';
11
12
  import { TemplatesModule } from './templates.module';
12
13
  import { HorizontalViewListComponent } from './horizontal-view-list.component';
@@ -73,7 +74,14 @@ var MultiViewCalendarModule = /** @class */ (function () {
73
74
  CalendarCommonModule,
74
75
  TemplatesModule
75
76
  ],
76
- imports: [CommonModule, CalendarCommonModule, IntlModule, TemplatesModule, PopupModule],
77
+ imports: [
78
+ CommonModule,
79
+ CalendarCommonModule,
80
+ IntlModule,
81
+ TemplatesModule,
82
+ PopupModule,
83
+ EventsModule
84
+ ],
77
85
  providers: [
78
86
  NavigationService,
79
87
  CenturyViewService,
@@ -287,7 +287,7 @@ var ViewListComponent = /** @class */ (function () {
287
287
  Component({
288
288
  changeDetection: ChangeDetectionStrategy.OnPush,
289
289
  selector: 'kendo-calendar-viewlist',
290
- template: "\n <kendo-calendar-header\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [activeView]=\"activeView\"\n [templateRef]=\"headerTitleTemplateRef\"\n (todayButtonClick)=\"todayButtonClick.emit($event)\"\n >\n </kendo-calendar-header>\n <table class=\"k-calendar-weekdays k-calendar-table\" style=\"table-layout: auto;\" *ngIf=\"isMonthView()\">\n <thead class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\">\n <th class=\"k-calendar-th\" *ngFor=\"let name of weekNames\" [style.width.%]=\"colWidth\">{{name}}</th>\n </tr>\n </thead>\n </table>\n <kendo-virtualization\n [tabindex]=\"-1\"\n [skip]=\"skip\"\n [take]=\"take\"\n [total]=\"total\"\n [itemHeight]=\"viewHeight\"\n [topOffset]=\"viewOffset\"\n [bottomOffset]=\"bottomOffset\"\n [scrollOffsetSize]=\"viewOffset\"\n [maxScrollDifference]=\"viewHeight\"\n (pageChange)=\"onPageChange($event)\"\n (scrollChange)=\"scrollChange($event)\"\n (activeIndexChange)=\"setActiveDate($event)\"\n >\n <table class=\"k-calendar-table\" #list>\n <colgroup><col *ngFor=\"let _ of cols\" /></colgroup>\n\n <tbody class=\"k-calendar-tbody\"\n *kFor=\"let date of dates\"\n kendoCalendarView\n role=\"rowgroup\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\" [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n ></tbody>\n </table>\n </kendo-virtualization>\n "
290
+ template: "\n <kendo-calendar-header\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [activeView]=\"activeView\"\n [templateRef]=\"headerTitleTemplateRef\"\n (todayButtonClick)=\"todayButtonClick.emit($event)\"\n >\n </kendo-calendar-header>\n <table class=\"k-calendar-weekdays k-calendar-table\" style=\"table-layout: auto;\" *ngIf=\"isMonthView()\">\n <thead class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\">\n <th class=\"k-calendar-th\" *ngFor=\"let name of weekNames\" [style.width.%]=\"colWidth\">{{name}}</th>\n </tr>\n </thead>\n </table>\n <kendo-virtualization\n [tabindex]=\"-1\"\n [skip]=\"skip\"\n [take]=\"take\"\n [total]=\"total\"\n [itemHeight]=\"viewHeight\"\n [topOffset]=\"viewOffset\"\n [bottomOffset]=\"bottomOffset\"\n [scrollOffsetSize]=\"viewOffset\"\n [maxScrollDifference]=\"viewHeight\"\n (pageChange)=\"onPageChange($event)\"\n (scrollChange)=\"scrollChange($event)\"\n (activeIndexChange)=\"setActiveDate($event)\"\n >\n <table\n #list\n role=\"grid\"\n class=\"k-calendar-table\"\n >\n <colgroup><col *ngFor=\"let _ of cols\" /></colgroup>\n\n <tbody class=\"k-calendar-tbody\"\n *kFor=\"let date of dates\"\n kendoCalendarView\n role=\"rowgroup\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\" [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n ></tbody>\n </table>\n </kendo-virtualization>\n "
291
291
  }),
292
292
  tslib_1.__metadata("design:paramtypes", [BusViewService,
293
293
  ChangeDetectorRef,
@@ -27,7 +27,7 @@ import { HeaderTitleTemplateDirective } from '../calendar/templates/header-title
27
27
  import { NavigationItemTemplateDirective } from '../calendar/templates/navigation-item-template.directive';
28
28
  import { PickerService } from '../common/picker.service';
29
29
  import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
30
- import { noop, isValidRange, setTime, isWindowAvailable } from '../util';
30
+ import { noop, isValidRange, setTime, isWindowAvailable, isTabExitingCalendar } from '../util';
31
31
  import { TOUCH_ENABLED } from '../touch-enabled';
32
32
  import { requiresZoneOnBlur, currentFocusTarget } from '../common/utils';
33
33
  import { fromEvent } from 'rxjs';
@@ -120,11 +120,13 @@ var DatePickerComponent = /** @class */ (function () {
120
120
  /**
121
121
  * Specifies the smallest valid date
122
122
  * ([see example]({% slug dateranges_datepicker %})).
123
+ * By default, the `min` value is `1900-1-1`.
123
124
  */
124
125
  this.min = cloneDate(MIN_DATE);
125
126
  /**
126
127
  * Specifies the biggest valid date
127
128
  * ([see example]({% slug dateranges_datepicker %})).
129
+ * By default, the `max` value is `2099-12-31`.
128
130
  */
129
131
  this.max = cloneDate(MAX_DATE);
130
132
  /**
@@ -716,7 +718,7 @@ var DatePickerComponent = /** @class */ (function () {
716
718
  * @hidden
717
719
  */
718
720
  DatePickerComponent.prototype.handleKeydown = function (e) {
719
- var altKey = e.altKey, keyCode = e.keyCode;
721
+ var altKey = e.altKey, shiftKey = e.shiftKey, keyCode = e.keyCode, target = e.target;
720
722
  if (keyCode === Keys.Escape) {
721
723
  this.show = false;
722
724
  }
@@ -728,7 +730,10 @@ var DatePickerComponent = /** @class */ (function () {
728
730
  this.show = false;
729
731
  }
730
732
  }
731
- if (keyCode === Keys.Tab && this.show && this.calendar.isActive) {
733
+ if (keyCode === Keys.Enter && target.classList.contains('k-calendar')) {
734
+ e.preventDefault(); // Don't submit form on date selection in popup
735
+ }
736
+ if (keyCode === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
732
737
  this.input.focus();
733
738
  this.show = false;
734
739
  }
@@ -9,7 +9,7 @@ export var packageMetadata = {
9
9
  name: '@progress/kendo-angular-dateinputs',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1635945725,
12
+ publishDate: 1641547209,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
package/dist/es/util.js CHANGED
@@ -340,4 +340,19 @@ export var millisecondDigitsInFormat = function (format) {
340
340
  export var millisecondStepFor = function (digits) {
341
341
  return Math.pow(10, 3 - digits);
342
342
  };
343
+ /**
344
+ * @hidden
345
+ *
346
+ * Checks if a tab keydown would would move the focus outside of the calendar.
347
+ */
348
+ export var isTabExitingCalendar = function (calendarType, focusedElement, shiftKey) {
349
+ if (!isPresent(focusedElement)) {
350
+ return false;
351
+ }
352
+ return calendarType === 'infinite' || ( // infinte calendar is always exited on first tab keydown
353
+ calendarType === 'classic' &&
354
+ (shiftKey && focusedElement.classList.contains('k-calendar')) || // exited on main calendar element focused and back-tab
355
+ (!shiftKey && focusedElement.classList.contains('k-next-view')) // exited on next button focused and regular tab
356
+ );
357
+ };
343
358
  export { ɵ0, ɵ1, ɵ2 };
@@ -6,6 +6,7 @@ import { ChangeDetectorRef, EventEmitter, ElementRef, Renderer2, AfterViewChecke
6
6
  import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms';
7
7
  import { LocalizationService } from '@progress/kendo-angular-l10n';
8
8
  import { Day } from '@progress/kendo-date-math';
9
+ import { MultiViewCalendarComponent } from './multiview-calendar.component';
9
10
  import { NavigationComponent } from './navigation.component';
10
11
  import { ViewListComponent } from './view-list.component';
11
12
  import { CalendarDOMService } from './services/dom.service';
@@ -273,6 +274,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
273
274
  navigationItemTemplateRef: NavigationItemTemplateDirective;
274
275
  navigationView: NavigationComponent;
275
276
  monthView: ViewListComponent;
277
+ multiViewCalendar: MultiViewCalendarComponent;
276
278
  isActive: boolean;
277
279
  cellUID: string;
278
280
  selectedDates: Date[];
@@ -294,7 +296,6 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
294
296
  readonly bottomViewEnum: CalendarViewEnum;
295
297
  readonly topViewEnum: CalendarViewEnum;
296
298
  readonly widgetId: string;
297
- readonly widgetRole: string;
298
299
  readonly calendarTabIndex: number;
299
300
  readonly ariaDisabled: boolean;
300
301
  private domEvents;
@@ -387,6 +388,13 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
387
388
  * @hidden
388
389
  */
389
390
  activeCellTemplate(): any;
391
+ /**
392
+ * @hidden
393
+ */
394
+ handleNavigate(event: {
395
+ focusedDate: Date;
396
+ activeView: CalendarView;
397
+ }): void;
390
398
  /**
391
399
  * @hidden
392
400
  */
@@ -408,14 +416,20 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
408
416
  * @hidden
409
417
  */
410
418
  handleWeekNumberClick(dates: Date[]): void;
419
+ /**
420
+ * @hidden
421
+ */
422
+ handleBlur(args: any): void;
423
+ /**
424
+ * @hidden
425
+ */
426
+ handleFocus(): void;
411
427
  private setClasses;
412
428
  private verifyChanges;
413
429
  private verifyValue;
414
430
  private bindEvents;
415
431
  private emitBlur;
416
432
  private emitFocus;
417
- private handleBlur;
418
- private handleFocus;
419
433
  private handleComponentClick;
420
434
  private handleKeydown;
421
435
  private detectChanges;