@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
@@ -13,6 +13,7 @@ var kendo_date_math_1 = require("@progress/kendo-date-math");
13
13
  var kendo_angular_common_1 = require("@progress/kendo-angular-common");
14
14
  var kendo_licensing_1 = require("@progress/kendo-licensing");
15
15
  var package_metadata_1 = require("../package-metadata");
16
+ var multiview_calendar_component_1 = require("./multiview-calendar.component");
16
17
  var navigation_component_1 = require("./navigation.component");
17
18
  var view_list_component_1 = require("./view-list.component");
18
19
  var dom_service_1 = require("./services/dom.service");
@@ -451,15 +452,9 @@ var CalendarComponent = /** @class */ (function () {
451
452
  enumerable: true,
452
453
  configurable: true
453
454
  });
454
- Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
455
- get: function () {
456
- return 'grid';
457
- },
458
- enumerable: true,
459
- configurable: true
460
- });
461
455
  Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
462
456
  get: function () {
457
+ // in Classic mode, the inner MultiViewCalendar is the focusable element
463
458
  return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
464
459
  },
465
460
  enumerable: true,
@@ -467,7 +462,8 @@ var CalendarComponent = /** @class */ (function () {
467
462
  });
468
463
  Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
469
464
  get: function () {
470
- return this.disabled;
465
+ // in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
466
+ return this.type === 'classic' ? undefined : this.disabled;
471
467
  },
472
468
  enumerable: true,
473
469
  configurable: true
@@ -553,19 +549,23 @@ var CalendarComponent = /** @class */ (function () {
553
549
  * ```
554
550
  */
555
551
  CalendarComponent.prototype.focus = function () {
556
- if (!this.element) {
557
- return;
552
+ var focusTarget = this.type === 'infinite' ?
553
+ this.element && this.element.nativeElement :
554
+ this.multiViewCalendar;
555
+ if (utils_1.isPresent(focusTarget)) {
556
+ focusTarget.focus();
558
557
  }
559
- this.element.nativeElement.focus();
560
558
  };
561
559
  /**
562
560
  * Blurs the Calendar component.
563
561
  */
564
562
  CalendarComponent.prototype.blur = function () {
565
- if (!this.element) {
566
- return;
563
+ var blurTarget = this.type === 'infinite' ?
564
+ this.element && this.element.nativeElement :
565
+ this.multiViewCalendar;
566
+ if (utils_1.isPresent(blurTarget)) {
567
+ blurTarget.blur();
567
568
  }
568
- this.element.nativeElement.blur();
569
569
  };
570
570
  /**
571
571
  * @hidden
@@ -694,6 +694,14 @@ var CalendarComponent = /** @class */ (function () {
694
694
  return null;
695
695
  }
696
696
  };
697
+ /**
698
+ * @hidden
699
+ */
700
+ CalendarComponent.prototype.handleNavigate = function (event) {
701
+ this.focusedDate = event.focusedDate;
702
+ this.activeView = event.activeView;
703
+ this.emitNavigate(this.focusedDate);
704
+ };
697
705
  /**
698
706
  * @hidden
699
707
  */
@@ -748,6 +756,39 @@ var CalendarComponent = /** @class */ (function () {
748
756
  });
749
757
  });
750
758
  };
759
+ /**
760
+ * @hidden
761
+ */
762
+ CalendarComponent.prototype.handleBlur = function (args) {
763
+ var _this = this;
764
+ if (this.element.nativeElement.contains(args.relatedTarget)) {
765
+ return;
766
+ }
767
+ this.isActive = false;
768
+ // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
769
+ // and enters the zone for no reason because the parent component is still untouched
770
+ if (!this.pickerService && utils_1.requiresZoneOnBlur(this.control)) {
771
+ this.ngZone.run(function () {
772
+ _this.onControlTouched();
773
+ _this.emitBlur(args);
774
+ _this.cdr.markForCheck();
775
+ });
776
+ }
777
+ else {
778
+ this.emitBlur(args);
779
+ this.detectChanges();
780
+ }
781
+ };
782
+ /**
783
+ * @hidden
784
+ */
785
+ CalendarComponent.prototype.handleFocus = function () {
786
+ this.isActive = true;
787
+ if (!core_1.NgZone.isInAngularZone()) {
788
+ this.detectChanges();
789
+ }
790
+ this.emitFocus();
791
+ };
751
792
  CalendarComponent.prototype.setClasses = function (element) {
752
793
  this.renderer.addClass(element, 'k-widget');
753
794
  this.renderer.addClass(element, 'k-calendar');
@@ -792,30 +833,6 @@ var CalendarComponent = /** @class */ (function () {
792
833
  this.pickerService.onFocus.emit();
793
834
  }
794
835
  };
795
- CalendarComponent.prototype.handleBlur = function (args) {
796
- var _this = this;
797
- this.isActive = false;
798
- // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
799
- // and enters the zone for no reason because the parent component is still untouched
800
- if (!this.pickerService && utils_1.requiresZoneOnBlur(this.control)) {
801
- this.ngZone.run(function () {
802
- _this.onControlTouched();
803
- _this.emitBlur(args);
804
- _this.cdr.markForCheck();
805
- });
806
- }
807
- else {
808
- this.emitBlur(args);
809
- this.detectChanges();
810
- }
811
- };
812
- CalendarComponent.prototype.handleFocus = function () {
813
- this.isActive = true;
814
- if (!core_1.NgZone.isInAngularZone()) {
815
- this.detectChanges();
816
- }
817
- this.emitFocus();
818
- };
819
836
  CalendarComponent.prototype.handleComponentClick = function () {
820
837
  if (!this.isActive) {
821
838
  if (this.type === 'infinite' && this.monthView.isScrolled()) {
@@ -826,6 +843,10 @@ var CalendarComponent = /** @class */ (function () {
826
843
  }
827
844
  };
828
845
  CalendarComponent.prototype.handleKeydown = function (args) {
846
+ var headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
847
+ if (headerActive) {
848
+ return;
849
+ }
829
850
  // reserve the alt + arrow key commands for the picker
830
851
  var arrowKeyPressed = [kendo_angular_common_1.Keys.ArrowUp, kendo_angular_common_1.Keys.ArrowRight, kendo_angular_common_1.Keys.ArrowDown, kendo_angular_common_1.Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
831
852
  if (utils_1.isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
@@ -852,7 +873,12 @@ var CalendarComponent = /** @class */ (function () {
852
873
  }
853
874
  };
854
875
  CalendarComponent.prototype.setAriaActivedescendant = function () {
855
- if (!utils_1.isPresent(this.element)) {
876
+ // in Classic mode, the inner MultiViewCalendar handles the activedescendant
877
+ if (!utils_1.isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
878
+ return;
879
+ }
880
+ if (this.type === 'classic') {
881
+ this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
856
882
  return;
857
883
  }
858
884
  var focusedCellId = this.cellUID + this.focusedDate.getTime();
@@ -1053,16 +1079,15 @@ var CalendarComponent = /** @class */ (function () {
1053
1079
  core_1.ViewChild(view_list_component_1.ViewListComponent, { static: false }),
1054
1080
  tslib_1.__metadata("design:type", view_list_component_1.ViewListComponent)
1055
1081
  ], CalendarComponent.prototype, "monthView", void 0);
1082
+ tslib_1.__decorate([
1083
+ core_1.ViewChild(multiview_calendar_component_1.MultiViewCalendarComponent, { static: false }),
1084
+ tslib_1.__metadata("design:type", multiview_calendar_component_1.MultiViewCalendarComponent)
1085
+ ], CalendarComponent.prototype, "multiViewCalendar", void 0);
1056
1086
  tslib_1.__decorate([
1057
1087
  core_1.HostBinding('attr.id'),
1058
1088
  tslib_1.__metadata("design:type", String),
1059
1089
  tslib_1.__metadata("design:paramtypes", [])
1060
1090
  ], CalendarComponent.prototype, "widgetId", null);
1061
- tslib_1.__decorate([
1062
- core_1.HostBinding('attr.role'),
1063
- tslib_1.__metadata("design:type", String),
1064
- tslib_1.__metadata("design:paramtypes", [])
1065
- ], CalendarComponent.prototype, "widgetRole", null);
1066
1091
  tslib_1.__decorate([
1067
1092
  core_1.HostBinding('attr.tabindex'),
1068
1093
  tslib_1.__metadata("design:type", Number),
@@ -1094,7 +1119,7 @@ var CalendarComponent = /** @class */ (function () {
1094
1119
  selection_service_1.SelectionService
1095
1120
  ],
1096
1121
  selector: 'kendo-calendar',
1097
- 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 "
1122
+ 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 "
1098
1123
  }),
1099
1124
  tslib_1.__param(12, core_1.Optional()),
1100
1125
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
@@ -351,7 +351,7 @@ var HorizontalViewListComponent = /** @class */ (function () {
351
351
  core_1.Component({
352
352
  changeDetection: core_1.ChangeDetectionStrategy.OnPush,
353
353
  selector: 'kendo-calendar-horizontal',
354
- 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 "
354
+ 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 "
355
355
  }),
356
356
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
357
357
  kendo_angular_intl_1.IntlService,
@@ -5,13 +5,13 @@
5
5
  "use strict";
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var tslib_1 = require("tslib");
8
- /* tslint:disable:no-forward-ref */
9
8
  var core_1 = require("@angular/core");
10
9
  var forms_1 = require("@angular/forms");
11
10
  var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
12
11
  var kendo_date_math_1 = require("@progress/kendo-date-math");
13
12
  var kendo_angular_common_1 = require("@progress/kendo-angular-common");
14
13
  var horizontal_view_list_component_1 = require("./horizontal-view-list.component");
14
+ var header_component_1 = require("./header.component");
15
15
  var bus_view_service_1 = require("./services/bus-view.service");
16
16
  var navigation_service_1 = require("./services/navigation.service");
17
17
  var selection_service_1 = require("./services/selection.service");
@@ -32,6 +32,7 @@ var defaults_1 = require("../defaults");
32
32
  var util_1 = require("../util");
33
33
  var rxjs_1 = require("rxjs");
34
34
  var utils_1 = require("../common/utils");
35
+ var picker_service_1 = require("../common/picker.service");
35
36
  var BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';
36
37
  var TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';
37
38
  var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';
@@ -68,7 +69,7 @@ exports.RANGE_CALENDAR_RANGE_VALIDATORS = {
68
69
  * ```
69
70
  */
70
71
  var MultiViewCalendarComponent = /** @class */ (function () {
71
- function MultiViewCalendarComponent(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService) {
72
+ function MultiViewCalendarComponent(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService, pickerService) {
72
73
  this.bus = bus;
73
74
  this.element = element;
74
75
  this.navigator = navigator;
@@ -77,6 +78,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
77
78
  this.zone = zone;
78
79
  this.disabledDatesService = disabledDatesService;
79
80
  this.selectionService = selectionService;
81
+ this.pickerService = pickerService;
80
82
  /**
81
83
  * @hidden
82
84
  */
@@ -116,6 +118,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
116
118
  * @hidden
117
119
  */
118
120
  this.isActive = false;
121
+ /**
122
+ * @hidden
123
+ */
124
+ this.isHeaderActive = false;
119
125
  /**
120
126
  * Defines the active view that the Calendar initially renders
121
127
  * ([see example]({% slug activeview_multiviewcalendar %})).
@@ -180,6 +186,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
180
186
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
181
187
  */
182
188
  this.valueChange = new core_1.EventEmitter();
189
+ /**
190
+ * @hidden
191
+ */
192
+ this.blurEvent = new core_1.EventEmitter();
183
193
  this.cellUID = kendo_angular_common_1.guid();
184
194
  this.isHovered = false;
185
195
  this.isPrevDisabled = true;
@@ -415,13 +425,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
415
425
  enumerable: true,
416
426
  configurable: true
417
427
  });
418
- Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
419
- get: function () {
420
- return 'grid';
421
- },
422
- enumerable: true,
423
- configurable: true
424
- });
425
428
  Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
426
429
  get: function () {
427
430
  return this.disabled ? undefined : this.tabIndex;
@@ -446,16 +449,22 @@ var MultiViewCalendarComponent = /** @class */ (function () {
446
449
  /**
447
450
  * @hidden
448
451
  */
449
- MultiViewCalendarComponent.prototype.handleBlur = function () {
450
- this.onControlTouched();
452
+ MultiViewCalendarComponent.prototype.handleFocusout = function (event) {
453
+ var relatedTarget = event.relatedTarget;
454
+ if (!this.element.nativeElement.contains(relatedTarget)) {
455
+ this.blurEvent.emit(event);
456
+ this.onControlTouched();
457
+ }
451
458
  this.isActive = false;
452
459
  this.isHovered = false; //ensure that hovered is also not active
460
+ this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
453
461
  };
454
462
  /**
455
463
  * @hidden
456
464
  */
457
465
  MultiViewCalendarComponent.prototype.handleFocus = function () {
458
466
  this.isActive = true;
467
+ this.isHeaderActive = false;
459
468
  };
460
469
  /**
461
470
  * @hidden
@@ -488,7 +497,13 @@ var MultiViewCalendarComponent = /** @class */ (function () {
488
497
  * @hidden
489
498
  */
490
499
  MultiViewCalendarComponent.prototype.keydown = function (event) {
500
+ if (this.isHeaderActive) {
501
+ return;
502
+ }
491
503
  if (event.keyCode === kendo_angular_common_1.Keys.Enter) {
504
+ if (utils_1.isPresent(this.pickerService)) {
505
+ event.preventDefault(); // Don't submit form from Datepicker popup
506
+ }
492
507
  this.performSelection(this.focusedDate, event);
493
508
  }
494
509
  var candidate = util_1.dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
@@ -565,6 +580,12 @@ var MultiViewCalendarComponent = /** @class */ (function () {
565
580
  }
566
581
  this.element.nativeElement.blur();
567
582
  };
583
+ /**
584
+ * @hidden
585
+ */
586
+ MultiViewCalendarComponent.prototype.handleHeaderFocus = function () {
587
+ this.isHeaderActive = true;
588
+ };
568
589
  /**
569
590
  * @hidden
570
591
  */
@@ -887,6 +908,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
887
908
  core_1.Output(),
888
909
  tslib_1.__metadata("design:type", core_1.EventEmitter)
889
910
  ], MultiViewCalendarComponent.prototype, "valueChange", void 0);
911
+ tslib_1.__decorate([
912
+ core_1.Output('blur'),
913
+ tslib_1.__metadata("design:type", core_1.EventEmitter)
914
+ ], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
890
915
  tslib_1.__decorate([
891
916
  core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: true }),
892
917
  tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
@@ -950,6 +975,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
950
975
  tslib_1.__metadata("design:type", header_title_template_directive_1.HeaderTitleTemplateDirective),
951
976
  tslib_1.__metadata("design:paramtypes", [header_title_template_directive_1.HeaderTitleTemplateDirective])
952
977
  ], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
978
+ tslib_1.__decorate([
979
+ core_1.ViewChild(header_component_1.HeaderComponent, { static: false, read: core_1.ElementRef }),
980
+ tslib_1.__metadata("design:type", core_1.ElementRef)
981
+ ], MultiViewCalendarComponent.prototype, "headerElement", void 0);
953
982
  tslib_1.__decorate([
954
983
  core_1.ViewChild(horizontal_view_list_component_1.HorizontalViewListComponent, { static: false }),
955
984
  tslib_1.__metadata("design:type", horizontal_view_list_component_1.HorizontalViewListComponent)
@@ -959,11 +988,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
959
988
  tslib_1.__metadata("design:type", String),
960
989
  tslib_1.__metadata("design:paramtypes", [])
961
990
  ], MultiViewCalendarComponent.prototype, "widgetId", null);
962
- tslib_1.__decorate([
963
- core_1.HostBinding('attr.role'),
964
- tslib_1.__metadata("design:type", String),
965
- tslib_1.__metadata("design:paramtypes", [])
966
- ], MultiViewCalendarComponent.prototype, "widgetRole", null);
967
991
  tslib_1.__decorate([
968
992
  core_1.HostBinding('attr.tabindex'),
969
993
  tslib_1.__metadata("design:type", Number),
@@ -981,11 +1005,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
981
1005
  tslib_1.__metadata("design:paramtypes", [])
982
1006
  ], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
983
1007
  tslib_1.__decorate([
984
- core_1.HostListener("blur"),
1008
+ core_1.HostListener('focusout', ['$event']),
985
1009
  tslib_1.__metadata("design:type", Function),
986
- tslib_1.__metadata("design:paramtypes", []),
1010
+ tslib_1.__metadata("design:paramtypes", [Object]),
987
1011
  tslib_1.__metadata("design:returntype", void 0)
988
- ], MultiViewCalendarComponent.prototype, "handleBlur", null);
1012
+ ], MultiViewCalendarComponent.prototype, "handleFocusout", null);
989
1013
  tslib_1.__decorate([
990
1014
  core_1.HostListener("focus"),
991
1015
  tslib_1.__metadata("design:type", Function),
@@ -1040,8 +1064,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1040
1064
  selection_service_1.SelectionService
1041
1065
  ],
1042
1066
  selector: 'kendo-multiviewcalendar',
1043
- 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 "
1067
+ 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 "
1044
1068
  }),
1069
+ tslib_1.__param(8, core_1.Optional()),
1045
1070
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
1046
1071
  core_1.ElementRef,
1047
1072
  navigation_service_1.NavigationService,
@@ -1049,7 +1074,8 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1049
1074
  core_1.ChangeDetectorRef,
1050
1075
  core_1.NgZone,
1051
1076
  disabled_dates_service_1.DisabledDatesService,
1052
- selection_service_1.SelectionService])
1077
+ selection_service_1.SelectionService,
1078
+ picker_service_1.PickerService])
1053
1079
  ], MultiViewCalendarComponent);
1054
1080
  return MultiViewCalendarComponent;
1055
1081
  }());
@@ -9,6 +9,7 @@ var core_1 = require("@angular/core");
9
9
  var common_1 = require("@angular/common");
10
10
  var kendo_angular_intl_1 = require("@progress/kendo-angular-intl");
11
11
  var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
12
+ var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
13
  var calendar_common_module_1 = require("./calendar-common.module");
13
14
  var templates_module_1 = require("./templates.module");
14
15
  var horizontal_view_list_component_1 = require("./horizontal-view-list.component");
@@ -75,7 +76,14 @@ var MultiViewCalendarModule = /** @class */ (function () {
75
76
  calendar_common_module_1.CalendarCommonModule,
76
77
  templates_module_1.TemplatesModule
77
78
  ],
78
- imports: [common_1.CommonModule, calendar_common_module_1.CalendarCommonModule, kendo_angular_intl_1.IntlModule, templates_module_1.TemplatesModule, kendo_angular_popup_1.PopupModule],
79
+ imports: [
80
+ common_1.CommonModule,
81
+ calendar_common_module_1.CalendarCommonModule,
82
+ kendo_angular_intl_1.IntlModule,
83
+ templates_module_1.TemplatesModule,
84
+ kendo_angular_popup_1.PopupModule,
85
+ kendo_angular_common_1.EventsModule
86
+ ],
79
87
  providers: [
80
88
  navigation_service_1.NavigationService,
81
89
  century_view_service_1.CenturyViewService,
@@ -290,7 +290,7 @@ var ViewListComponent = /** @class */ (function () {
290
290
  core_1.Component({
291
291
  changeDetection: core_1.ChangeDetectionStrategy.OnPush,
292
292
  selector: 'kendo-calendar-viewlist',
293
- 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 "
293
+ 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 "
294
294
  }),
295
295
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
296
296
  core_1.ChangeDetectorRef,
@@ -122,11 +122,13 @@ var DatePickerComponent = /** @class */ (function () {
122
122
  /**
123
123
  * Specifies the smallest valid date
124
124
  * ([see example]({% slug dateranges_datepicker %})).
125
+ * By default, the `min` value is `1900-1-1`.
125
126
  */
126
127
  this.min = kendo_date_math_1.cloneDate(defaults_1.MIN_DATE);
127
128
  /**
128
129
  * Specifies the biggest valid date
129
130
  * ([see example]({% slug dateranges_datepicker %})).
131
+ * By default, the `max` value is `2099-12-31`.
130
132
  */
131
133
  this.max = kendo_date_math_1.cloneDate(defaults_1.MAX_DATE);
132
134
  /**
@@ -718,7 +720,7 @@ var DatePickerComponent = /** @class */ (function () {
718
720
  * @hidden
719
721
  */
720
722
  DatePickerComponent.prototype.handleKeydown = function (e) {
721
- var altKey = e.altKey, keyCode = e.keyCode;
723
+ var altKey = e.altKey, shiftKey = e.shiftKey, keyCode = e.keyCode, target = e.target;
722
724
  if (keyCode === kendo_angular_common_1.Keys.Escape) {
723
725
  this.show = false;
724
726
  }
@@ -730,7 +732,10 @@ var DatePickerComponent = /** @class */ (function () {
730
732
  this.show = false;
731
733
  }
732
734
  }
733
- if (keyCode === kendo_angular_common_1.Keys.Tab && this.show && this.calendar.isActive) {
735
+ if (keyCode === kendo_angular_common_1.Keys.Enter && target.classList.contains('k-calendar')) {
736
+ e.preventDefault(); // Don't submit form on date selection in popup
737
+ }
738
+ if (keyCode === kendo_angular_common_1.Keys.Tab && this.show && this.calendar.isActive && util_1.isTabExitingCalendar(this.calendarType, target, shiftKey)) {
734
739
  this.input.focus();
735
740
  this.show = false;
736
741
  }
@@ -11,7 +11,7 @@ exports.packageMetadata = {
11
11
  name: '@progress/kendo-angular-dateinputs',
12
12
  productName: 'Kendo UI for Angular',
13
13
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1635945725,
14
+ publishDate: 1641547209,
15
15
  version: '',
16
16
  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'
17
17
  };
package/dist/npm/util.js CHANGED
@@ -345,3 +345,18 @@ exports.millisecondDigitsInFormat = function (format) {
345
345
  exports.millisecondStepFor = function (digits) {
346
346
  return Math.pow(10, 3 - digits);
347
347
  };
348
+ /**
349
+ * @hidden
350
+ *
351
+ * Checks if a tab keydown would would move the focus outside of the calendar.
352
+ */
353
+ exports.isTabExitingCalendar = function (calendarType, focusedElement, shiftKey) {
354
+ if (!utils_1.isPresent(focusedElement)) {
355
+ return false;
356
+ }
357
+ return calendarType === 'infinite' || ( // infinte calendar is always exited on first tab keydown
358
+ calendarType === 'classic' &&
359
+ (shiftKey && focusedElement.classList.contains('k-calendar')) || // exited on main calendar element focused and back-tab
360
+ (!shiftKey && focusedElement.classList.contains('k-next-view')) // exited on next button focused and regular tab
361
+ );
362
+ };