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

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 (33) 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 +58 -45
  4. package/dist/es/calendar/horizontal-view-list.component.js +1 -1
  5. package/dist/es/calendar/multiview-calendar.component.js +27 -17
  6. package/dist/es/calendar/view-list.component.js +1 -1
  7. package/dist/es/datepicker/datepicker.component.js +5 -3
  8. package/dist/es/package-metadata.js +1 -1
  9. package/dist/es/util.js +15 -0
  10. package/dist/es2015/calendar/calendar.component.d.ts +10 -3
  11. package/dist/es2015/calendar/calendar.component.js +58 -39
  12. package/dist/es2015/calendar/horizontal-view-list.component.js +1 -0
  13. package/dist/es2015/calendar/multiview-calendar.component.d.ts +10 -2
  14. package/dist/es2015/calendar/multiview-calendar.component.js +27 -13
  15. package/dist/es2015/calendar/view-list.component.js +5 -1
  16. package/dist/es2015/dateinput/dateinput.component.d.ts +2 -0
  17. package/dist/es2015/datepicker/datepicker.component.d.ts +2 -0
  18. package/dist/es2015/datepicker/datepicker.component.js +5 -3
  19. package/dist/es2015/index.metadata.json +1 -1
  20. package/dist/es2015/package-metadata.js +1 -1
  21. package/dist/es2015/util.d.ts +7 -0
  22. package/dist/es2015/util.js +15 -0
  23. package/dist/fesm2015/index.js +6989 -6936
  24. package/dist/fesm5/index.js +6405 -6367
  25. package/dist/npm/calendar/calendar.component.js +58 -45
  26. package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
  27. package/dist/npm/calendar/multiview-calendar.component.js +27 -17
  28. package/dist/npm/calendar/view-list.component.js +1 -1
  29. package/dist/npm/datepicker/datepicker.component.js +4 -2
  30. package/dist/npm/package-metadata.js +1 -1
  31. package/dist/npm/util.js +15 -0
  32. package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
  33. 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
@@ -748,6 +748,39 @@ var CalendarComponent = /** @class */ (function () {
748
748
  });
749
749
  });
750
750
  };
751
+ /**
752
+ * @hidden
753
+ */
754
+ CalendarComponent.prototype.handleBlur = function (args) {
755
+ var _this = this;
756
+ if (this.element.nativeElement.contains(args.relatedTarget)) {
757
+ return;
758
+ }
759
+ this.isActive = false;
760
+ // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
761
+ // and enters the zone for no reason because the parent component is still untouched
762
+ if (!this.pickerService && utils_1.requiresZoneOnBlur(this.control)) {
763
+ this.ngZone.run(function () {
764
+ _this.onControlTouched();
765
+ _this.emitBlur(args);
766
+ _this.cdr.markForCheck();
767
+ });
768
+ }
769
+ else {
770
+ this.emitBlur(args);
771
+ this.detectChanges();
772
+ }
773
+ };
774
+ /**
775
+ * @hidden
776
+ */
777
+ CalendarComponent.prototype.handleFocus = function () {
778
+ this.isActive = true;
779
+ if (!core_1.NgZone.isInAngularZone()) {
780
+ this.detectChanges();
781
+ }
782
+ this.emitFocus();
783
+ };
751
784
  CalendarComponent.prototype.setClasses = function (element) {
752
785
  this.renderer.addClass(element, 'k-widget');
753
786
  this.renderer.addClass(element, 'k-calendar');
@@ -792,30 +825,6 @@ var CalendarComponent = /** @class */ (function () {
792
825
  this.pickerService.onFocus.emit();
793
826
  }
794
827
  };
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
828
  CalendarComponent.prototype.handleComponentClick = function () {
820
829
  if (!this.isActive) {
821
830
  if (this.type === 'infinite' && this.monthView.isScrolled()) {
@@ -852,7 +861,12 @@ var CalendarComponent = /** @class */ (function () {
852
861
  }
853
862
  };
854
863
  CalendarComponent.prototype.setAriaActivedescendant = function () {
855
- if (!utils_1.isPresent(this.element)) {
864
+ // in Classic mode, the inner MultiViewCalendar handles the activedescendant
865
+ if (!utils_1.isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
866
+ return;
867
+ }
868
+ if (this.type === 'classic') {
869
+ this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
856
870
  return;
857
871
  }
858
872
  var focusedCellId = this.cellUID + this.focusedDate.getTime();
@@ -1053,16 +1067,15 @@ var CalendarComponent = /** @class */ (function () {
1053
1067
  core_1.ViewChild(view_list_component_1.ViewListComponent, { static: false }),
1054
1068
  tslib_1.__metadata("design:type", view_list_component_1.ViewListComponent)
1055
1069
  ], CalendarComponent.prototype, "monthView", void 0);
1070
+ tslib_1.__decorate([
1071
+ core_1.ViewChild(multiview_calendar_component_1.MultiViewCalendarComponent, { static: false }),
1072
+ tslib_1.__metadata("design:type", multiview_calendar_component_1.MultiViewCalendarComponent)
1073
+ ], CalendarComponent.prototype, "multiViewCalendar", void 0);
1056
1074
  tslib_1.__decorate([
1057
1075
  core_1.HostBinding('attr.id'),
1058
1076
  tslib_1.__metadata("design:type", String),
1059
1077
  tslib_1.__metadata("design:paramtypes", [])
1060
1078
  ], 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
1079
  tslib_1.__decorate([
1067
1080
  core_1.HostBinding('attr.tabindex'),
1068
1081
  tslib_1.__metadata("design:type", Number),
@@ -1094,7 +1107,7 @@ var CalendarComponent = /** @class */ (function () {
1094
1107
  selection_service_1.SelectionService
1095
1108
  ],
1096
1109
  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 "
1110
+ 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 (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
1111
  }),
1099
1112
  tslib_1.__param(12, core_1.Optional()),
1100
1113
  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,
@@ -12,6 +12,7 @@ var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
12
12
  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 horizontal_view_list_component_1 = require("./horizontal-view-list.component");
15
+ var header_component_1 = require("./header.component");
15
16
  var bus_view_service_1 = require("./services/bus-view.service");
16
17
  var navigation_service_1 = require("./services/navigation.service");
17
18
  var selection_service_1 = require("./services/selection.service");
@@ -116,6 +117,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
116
117
  * @hidden
117
118
  */
118
119
  this.isActive = false;
120
+ /**
121
+ * @hidden
122
+ */
123
+ this.isHeaderActive = false;
119
124
  /**
120
125
  * Defines the active view that the Calendar initially renders
121
126
  * ([see example]({% slug activeview_multiviewcalendar %})).
@@ -180,6 +185,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
180
185
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
181
186
  */
182
187
  this.valueChange = new core_1.EventEmitter();
188
+ /**
189
+ * @hidden
190
+ */
191
+ this.blurEvent = new core_1.EventEmitter();
183
192
  this.cellUID = kendo_angular_common_1.guid();
184
193
  this.isHovered = false;
185
194
  this.isPrevDisabled = true;
@@ -415,13 +424,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
415
424
  enumerable: true,
416
425
  configurable: true
417
426
  });
418
- Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
419
- get: function () {
420
- return 'grid';
421
- },
422
- enumerable: true,
423
- configurable: true
424
- });
425
427
  Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
426
428
  get: function () {
427
429
  return this.disabled ? undefined : this.tabIndex;
@@ -446,10 +448,15 @@ var MultiViewCalendarComponent = /** @class */ (function () {
446
448
  /**
447
449
  * @hidden
448
450
  */
449
- MultiViewCalendarComponent.prototype.handleBlur = function () {
450
- this.onControlTouched();
451
+ MultiViewCalendarComponent.prototype.handleBlur = function (event) {
452
+ var target = event.target;
453
+ if (!this.element.nativeElement.contains(event.relatedTarget)) {
454
+ this.blurEvent.emit(event);
455
+ this.onControlTouched();
456
+ }
451
457
  this.isActive = false;
452
458
  this.isHovered = false; //ensure that hovered is also not active
459
+ this.isHeaderActive = this.headerElement.nativeElement.contains(target);
453
460
  };
454
461
  /**
455
462
  * @hidden
@@ -887,6 +894,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
887
894
  core_1.Output(),
888
895
  tslib_1.__metadata("design:type", core_1.EventEmitter)
889
896
  ], MultiViewCalendarComponent.prototype, "valueChange", void 0);
897
+ tslib_1.__decorate([
898
+ core_1.Output('blur'),
899
+ tslib_1.__metadata("design:type", core_1.EventEmitter)
900
+ ], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
890
901
  tslib_1.__decorate([
891
902
  core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: true }),
892
903
  tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
@@ -950,6 +961,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
950
961
  tslib_1.__metadata("design:type", header_title_template_directive_1.HeaderTitleTemplateDirective),
951
962
  tslib_1.__metadata("design:paramtypes", [header_title_template_directive_1.HeaderTitleTemplateDirective])
952
963
  ], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
964
+ tslib_1.__decorate([
965
+ core_1.ViewChild(header_component_1.HeaderComponent, { static: false, read: core_1.ElementRef }),
966
+ tslib_1.__metadata("design:type", core_1.ElementRef)
967
+ ], MultiViewCalendarComponent.prototype, "headerElement", void 0);
953
968
  tslib_1.__decorate([
954
969
  core_1.ViewChild(horizontal_view_list_component_1.HorizontalViewListComponent, { static: false }),
955
970
  tslib_1.__metadata("design:type", horizontal_view_list_component_1.HorizontalViewListComponent)
@@ -959,11 +974,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
959
974
  tslib_1.__metadata("design:type", String),
960
975
  tslib_1.__metadata("design:paramtypes", [])
961
976
  ], 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
977
  tslib_1.__decorate([
968
978
  core_1.HostBinding('attr.tabindex'),
969
979
  tslib_1.__metadata("design:type", Number),
@@ -981,9 +991,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
981
991
  tslib_1.__metadata("design:paramtypes", [])
982
992
  ], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
983
993
  tslib_1.__decorate([
984
- core_1.HostListener("blur"),
994
+ core_1.HostListener('focusout', ['$event']),
985
995
  tslib_1.__metadata("design:type", Function),
986
- tslib_1.__metadata("design:paramtypes", []),
996
+ tslib_1.__metadata("design:paramtypes", [FocusEvent]),
987
997
  tslib_1.__metadata("design:returntype", void 0)
988
998
  ], MultiViewCalendarComponent.prototype, "handleBlur", null);
989
999
  tslib_1.__decorate([
@@ -1040,7 +1050,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1040
1050
  selection_service_1.SelectionService
1041
1051
  ],
1042
1052
  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 "
1053
+ 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 && !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
1054
  }),
1045
1055
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
1046
1056
  core_1.ElementRef,
@@ -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,7 @@ 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.Tab && this.show && this.calendar.isActive && util_1.isTabExitingCalendar(this.calendarType, target, shiftKey)) {
734
736
  this.input.focus();
735
737
  this.show = false;
736
738
  }
@@ -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: 1638381906,
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
+ };