@progress/kendo-angular-dateinputs 5.2.4-dev.202110261444 → 5.3.1-dev.202112071202

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 (53) 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 +102 -46
  4. package/dist/es/calendar/horizontal-view-list.component.js +1 -1
  5. package/dist/es/calendar/multiview-calendar.component.js +76 -20
  6. package/dist/es/calendar/multiview-calendar.module.js +9 -1
  7. package/dist/es/calendar/services/century-view.service.js +7 -1
  8. package/dist/es/calendar/services/decade-view.service.js +6 -1
  9. package/dist/es/calendar/services/month-view.service.js +3 -0
  10. package/dist/es/calendar/services/year-view.service.js +5 -1
  11. package/dist/es/calendar/view-list.component.js +1 -1
  12. package/dist/es/datepicker/datepicker.component.js +5 -3
  13. package/dist/es/package-metadata.js +1 -1
  14. package/dist/es/util.js +15 -0
  15. package/dist/es2015/calendar/calendar.component.d.ts +34 -3
  16. package/dist/es2015/calendar/calendar.component.js +104 -41
  17. package/dist/es2015/calendar/horizontal-view-list.component.js +1 -0
  18. package/dist/es2015/calendar/models/view-service.interface.d.ts +1 -0
  19. package/dist/es2015/calendar/multiview-calendar.component.d.ts +34 -3
  20. package/dist/es2015/calendar/multiview-calendar.component.js +83 -19
  21. package/dist/es2015/calendar/multiview-calendar.module.js +9 -1
  22. package/dist/es2015/calendar/services/century-view.service.d.ts +1 -0
  23. package/dist/es2015/calendar/services/century-view.service.js +7 -1
  24. package/dist/es2015/calendar/services/decade-view.service.d.ts +1 -0
  25. package/dist/es2015/calendar/services/decade-view.service.js +6 -1
  26. package/dist/es2015/calendar/services/month-view.service.d.ts +1 -0
  27. package/dist/es2015/calendar/services/month-view.service.js +3 -0
  28. package/dist/es2015/calendar/services/year-view.service.d.ts +1 -0
  29. package/dist/es2015/calendar/services/year-view.service.js +5 -1
  30. package/dist/es2015/calendar/view-list.component.js +5 -1
  31. package/dist/es2015/dateinput/dateinput.component.d.ts +2 -0
  32. package/dist/es2015/datepicker/datepicker.component.d.ts +2 -0
  33. package/dist/es2015/datepicker/datepicker.component.js +5 -3
  34. package/dist/es2015/index.metadata.json +1 -1
  35. package/dist/es2015/package-metadata.js +1 -1
  36. package/dist/es2015/util.d.ts +7 -0
  37. package/dist/es2015/util.js +15 -0
  38. package/dist/fesm2015/index.js +7253 -7080
  39. package/dist/fesm5/index.js +6807 -6654
  40. package/dist/npm/calendar/calendar.component.js +102 -46
  41. package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
  42. package/dist/npm/calendar/multiview-calendar.component.js +76 -20
  43. package/dist/npm/calendar/multiview-calendar.module.js +9 -1
  44. package/dist/npm/calendar/services/century-view.service.js +6 -0
  45. package/dist/npm/calendar/services/decade-view.service.js +5 -0
  46. package/dist/npm/calendar/services/month-view.service.js +3 -0
  47. package/dist/npm/calendar/services/year-view.service.js +4 -0
  48. package/dist/npm/calendar/view-list.component.js +1 -1
  49. package/dist/npm/datepicker/datepicker.component.js +4 -2
  50. package/dist/npm/package-metadata.js +1 -1
  51. package/dist/npm/util.js +15 -0
  52. package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
  53. 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';
@@ -168,6 +169,11 @@ var CalendarComponent = /** @class */ (function () {
168
169
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
169
170
  */
170
171
  this.activeViewChange = new EventEmitter();
172
+ /**
173
+ * Fires when navigating in the currently active view
174
+ * ([more information and example]({% slug events_calendar %})).
175
+ */
176
+ this.navigate = new EventEmitter();
171
177
  /**
172
178
  * Fires when the active view date is changed
173
179
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
@@ -213,6 +219,14 @@ var CalendarComponent = /** @class */ (function () {
213
219
  * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
214
220
  */
215
221
  set: function (focusedDate) {
222
+ if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
223
+ var service = this.bus.service(this.activeViewEnum);
224
+ var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
225
+ var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
226
+ if (!isFocusedDateInRange) {
227
+ this.emitNavigate(focusedDate);
228
+ }
229
+ }
216
230
  this._focusedDate = focusedDate || getToday();
217
231
  this.setAriaActivedescendant();
218
232
  },
@@ -435,23 +449,18 @@ var CalendarComponent = /** @class */ (function () {
435
449
  enumerable: true,
436
450
  configurable: true
437
451
  });
438
- Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
439
- get: function () {
440
- return 'grid';
441
- },
442
- enumerable: true,
443
- configurable: true
444
- });
445
452
  Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
446
453
  get: function () {
447
- return this.disabled ? undefined : this.tabIndex;
454
+ // in Classic mode, the inner MultiViewCalendar is the focusable element
455
+ return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
448
456
  },
449
457
  enumerable: true,
450
458
  configurable: true
451
459
  });
452
460
  Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
453
461
  get: function () {
454
- 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;
455
464
  },
456
465
  enumerable: true,
457
466
  configurable: true
@@ -537,19 +546,23 @@ var CalendarComponent = /** @class */ (function () {
537
546
  * ```
538
547
  */
539
548
  CalendarComponent.prototype.focus = function () {
540
- if (!this.element) {
541
- return;
549
+ var focusTarget = this.type === 'infinite' ?
550
+ this.element && this.element.nativeElement :
551
+ this.multiViewCalendar;
552
+ if (isPresent(focusTarget)) {
553
+ focusTarget.focus();
542
554
  }
543
- this.element.nativeElement.focus();
544
555
  };
545
556
  /**
546
557
  * Blurs the Calendar component.
547
558
  */
548
559
  CalendarComponent.prototype.blur = function () {
549
- if (!this.element) {
550
- return;
560
+ var blurTarget = this.type === 'infinite' ?
561
+ this.element && this.element.nativeElement :
562
+ this.multiViewCalendar;
563
+ if (isPresent(blurTarget)) {
564
+ blurTarget.blur();
551
565
  }
552
- this.element.nativeElement.blur();
553
566
  };
554
567
  /**
555
568
  * @hidden
@@ -678,6 +691,21 @@ var CalendarComponent = /** @class */ (function () {
678
691
  return null;
679
692
  }
680
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
+ };
702
+ /**
703
+ * @hidden
704
+ */
705
+ CalendarComponent.prototype.emitNavigate = function (focusedDate) {
706
+ var activeView = CalendarViewEnum[this.activeViewEnum];
707
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
708
+ };
681
709
  /**
682
710
  * @hidden
683
711
  */
@@ -688,6 +716,13 @@ var CalendarComponent = /** @class */ (function () {
688
716
  });
689
717
  }
690
718
  };
719
+ /**
720
+ * @hidden
721
+ */
722
+ CalendarComponent.prototype.handleActiveDateChange = function (date) {
723
+ this.activeViewDate = date;
724
+ this.emitEvent(this.activeViewDateChange, date);
725
+ };
691
726
  /**
692
727
  * @hidden
693
728
  */
@@ -718,6 +753,39 @@ var CalendarComponent = /** @class */ (function () {
718
753
  });
719
754
  });
720
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
+ };
721
789
  CalendarComponent.prototype.setClasses = function (element) {
722
790
  this.renderer.addClass(element, 'k-widget');
723
791
  this.renderer.addClass(element, 'k-calendar');
@@ -762,30 +830,6 @@ var CalendarComponent = /** @class */ (function () {
762
830
  this.pickerService.onFocus.emit();
763
831
  }
764
832
  };
765
- CalendarComponent.prototype.handleBlur = function (args) {
766
- var _this = this;
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 && 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
- CalendarComponent.prototype.handleFocus = function () {
783
- this.isActive = true;
784
- if (!NgZone.isInAngularZone()) {
785
- this.detectChanges();
786
- }
787
- this.emitFocus();
788
- };
789
833
  CalendarComponent.prototype.handleComponentClick = function () {
790
834
  if (!this.isActive) {
791
835
  if (this.type === 'infinite' && this.monthView.isScrolled()) {
@@ -796,6 +840,10 @@ var CalendarComponent = /** @class */ (function () {
796
840
  }
797
841
  };
798
842
  CalendarComponent.prototype.handleKeydown = function (args) {
843
+ var headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
844
+ if (headerActive) {
845
+ return;
846
+ }
799
847
  // reserve the alt + arrow key commands for the picker
800
848
  var arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
801
849
  if (isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
@@ -822,7 +870,12 @@ var CalendarComponent = /** @class */ (function () {
822
870
  }
823
871
  };
824
872
  CalendarComponent.prototype.setAriaActivedescendant = function () {
825
- 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');
826
879
  return;
827
880
  }
828
881
  var focusedCellId = this.cellUID + this.focusedDate.getTime();
@@ -931,6 +984,10 @@ var CalendarComponent = /** @class */ (function () {
931
984
  Output(),
932
985
  tslib_1.__metadata("design:type", EventEmitter)
933
986
  ], CalendarComponent.prototype, "activeViewChange", void 0);
987
+ tslib_1.__decorate([
988
+ Output(),
989
+ tslib_1.__metadata("design:type", EventEmitter)
990
+ ], CalendarComponent.prototype, "navigate", void 0);
934
991
  tslib_1.__decorate([
935
992
  Output(),
936
993
  tslib_1.__metadata("design:type", EventEmitter)
@@ -1019,16 +1076,15 @@ var CalendarComponent = /** @class */ (function () {
1019
1076
  ViewChild(ViewListComponent, { static: false }),
1020
1077
  tslib_1.__metadata("design:type", ViewListComponent)
1021
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);
1022
1083
  tslib_1.__decorate([
1023
1084
  HostBinding('attr.id'),
1024
1085
  tslib_1.__metadata("design:type", String),
1025
1086
  tslib_1.__metadata("design:paramtypes", [])
1026
1087
  ], CalendarComponent.prototype, "widgetId", null);
1027
- tslib_1.__decorate([
1028
- HostBinding('attr.role'),
1029
- tslib_1.__metadata("design:type", String),
1030
- tslib_1.__metadata("design:paramtypes", [])
1031
- ], CalendarComponent.prototype, "widgetRole", null);
1032
1088
  tslib_1.__decorate([
1033
1089
  HostBinding('attr.tabindex'),
1034
1090
  tslib_1.__metadata("design:type", Number),
@@ -1060,7 +1116,7 @@ var CalendarComponent = /** @class */ (function () {
1060
1116
  SelectionService
1061
1117
  ],
1062
1118
  selector: 'kendo-calendar',
1063
- 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)=\"emitEvent(activeViewDateChange, $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 (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 "
1064
1120
  }),
1065
1121
  tslib_1.__param(12, Optional()),
1066
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
6
  import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone } 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';
@@ -114,6 +114,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
114
114
  * @hidden
115
115
  */
116
116
  this.isActive = false;
117
+ /**
118
+ * @hidden
119
+ */
120
+ this.isHeaderActive = false;
117
121
  /**
118
122
  * Defines the active view that the Calendar initially renders
119
123
  * ([see example]({% slug activeview_multiviewcalendar %})).
@@ -158,6 +162,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
158
162
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
159
163
  */
160
164
  this.activeViewChange = new EventEmitter();
165
+ /**
166
+ * Fires when navigating in the currently active view
167
+ * ([more information and example]({% slug events_multiviewcalendar %})).
168
+ */
169
+ this.navigate = new EventEmitter();
161
170
  /**
162
171
  * Fires when a view cell is entered
163
172
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
@@ -173,6 +182,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
173
182
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
174
183
  */
175
184
  this.valueChange = new EventEmitter();
185
+ /**
186
+ * @hidden
187
+ */
188
+ this.blurEvent = new EventEmitter();
176
189
  this.cellUID = guid();
177
190
  this.isHovered = false;
178
191
  this.isPrevDisabled = true;
@@ -408,13 +421,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
408
421
  enumerable: true,
409
422
  configurable: true
410
423
  });
411
- Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
412
- get: function () {
413
- return 'grid';
414
- },
415
- enumerable: true,
416
- configurable: true
417
- });
418
424
  Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
419
425
  get: function () {
420
426
  return this.disabled ? undefined : this.tabIndex;
@@ -439,16 +445,22 @@ var MultiViewCalendarComponent = /** @class */ (function () {
439
445
  /**
440
446
  * @hidden
441
447
  */
442
- MultiViewCalendarComponent.prototype.handleBlur = function () {
443
- this.onControlTouched();
448
+ MultiViewCalendarComponent.prototype.handleFocusout = function (event) {
449
+ var relatedTarget = event.relatedTarget;
450
+ if (!this.element.nativeElement.contains(relatedTarget)) {
451
+ this.blurEvent.emit(event);
452
+ this.onControlTouched();
453
+ }
444
454
  this.isActive = false;
445
455
  this.isHovered = false; //ensure that hovered is also not active
456
+ this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
446
457
  };
447
458
  /**
448
459
  * @hidden
449
460
  */
450
461
  MultiViewCalendarComponent.prototype.handleFocus = function () {
451
462
  this.isActive = true;
463
+ this.isHeaderActive = false;
452
464
  };
453
465
  /**
454
466
  * @hidden
@@ -481,6 +493,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
481
493
  * @hidden
482
494
  */
483
495
  MultiViewCalendarComponent.prototype.keydown = function (event) {
496
+ if (this.isHeaderActive) {
497
+ return;
498
+ }
484
499
  if (event.keyCode === Keys.Enter) {
485
500
  this.performSelection(this.focusedDate, event);
486
501
  }
@@ -490,6 +505,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
490
505
  }
491
506
  this.focusedDate = candidate;
492
507
  event.preventDefault();
508
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
509
+ if (!isSameView) {
510
+ this.emitNavigate(this.focusedDate);
511
+ }
493
512
  };
494
513
  MultiViewCalendarComponent.prototype.ngOnInit = function () {
495
514
  var _this = this;
@@ -554,6 +573,12 @@ var MultiViewCalendarComponent = /** @class */ (function () {
554
573
  }
555
574
  this.element.nativeElement.blur();
556
575
  };
576
+ /**
577
+ * @hidden
578
+ */
579
+ MultiViewCalendarComponent.prototype.handleHeaderFocus = function () {
580
+ this.isHeaderActive = true;
581
+ };
557
582
  /**
558
583
  * @hidden
559
584
  */
@@ -578,6 +603,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
578
603
  this.onControlChange(this.parseSelectionToValue(availableDates));
579
604
  this.valueChange.emit(this.parseSelectionToValue(availableDates));
580
605
  };
606
+ /**
607
+ * @hidden
608
+ */
609
+ MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
610
+ var todayDate = args.focusedDate;
611
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
612
+ var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
613
+ if (!isSameView && isBottomView) {
614
+ this.emitNavigate(todayDate);
615
+ }
616
+ this.handleDateChange(args);
617
+ };
581
618
  /**
582
619
  * @hidden
583
620
  */
@@ -644,9 +681,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
644
681
  /**
645
682
  * @hidden
646
683
  */
647
- MultiViewCalendarComponent.prototype.navigate = function (action) {
684
+ MultiViewCalendarComponent.prototype.navigateView = function (action) {
648
685
  this.focusedDate = this.viewList.navigate(action);
649
686
  this.updateButtonState();
687
+ this.emitNavigate(this.focusedDate);
688
+ };
689
+ /**
690
+ * @hidden
691
+ */
692
+ MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
693
+ var activeView = CalendarViewEnum[this.activeViewEnum];
694
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
650
695
  };
651
696
  /**
652
697
  * @hidden
@@ -664,6 +709,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
664
709
  MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
665
710
  var date = _a.date, modifiers = _a.modifiers;
666
711
  this.performSelection(date, modifiers);
712
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
713
+ if (!isSameView) {
714
+ this.emitNavigate(this.focusedDate);
715
+ }
667
716
  };
668
717
  /**
669
718
  * @hidden
@@ -836,6 +885,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
836
885
  Output(),
837
886
  tslib_1.__metadata("design:type", EventEmitter)
838
887
  ], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
888
+ tslib_1.__decorate([
889
+ Output(),
890
+ tslib_1.__metadata("design:type", EventEmitter)
891
+ ], MultiViewCalendarComponent.prototype, "navigate", void 0);
839
892
  tslib_1.__decorate([
840
893
  Output(),
841
894
  tslib_1.__metadata("design:type", EventEmitter)
@@ -848,6 +901,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
848
901
  Output(),
849
902
  tslib_1.__metadata("design:type", EventEmitter)
850
903
  ], MultiViewCalendarComponent.prototype, "valueChange", void 0);
904
+ tslib_1.__decorate([
905
+ Output('blur'),
906
+ tslib_1.__metadata("design:type", EventEmitter)
907
+ ], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
851
908
  tslib_1.__decorate([
852
909
  ContentChild(CellTemplateDirective, { static: true }),
853
910
  tslib_1.__metadata("design:type", CellTemplateDirective)
@@ -911,6 +968,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
911
968
  tslib_1.__metadata("design:type", HeaderTitleTemplateDirective),
912
969
  tslib_1.__metadata("design:paramtypes", [HeaderTitleTemplateDirective])
913
970
  ], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
971
+ tslib_1.__decorate([
972
+ ViewChild(HeaderComponent, { static: false, read: ElementRef }),
973
+ tslib_1.__metadata("design:type", ElementRef)
974
+ ], MultiViewCalendarComponent.prototype, "headerElement", void 0);
914
975
  tslib_1.__decorate([
915
976
  ViewChild(HorizontalViewListComponent, { static: false }),
916
977
  tslib_1.__metadata("design:type", HorizontalViewListComponent)
@@ -920,11 +981,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
920
981
  tslib_1.__metadata("design:type", String),
921
982
  tslib_1.__metadata("design:paramtypes", [])
922
983
  ], MultiViewCalendarComponent.prototype, "widgetId", null);
923
- tslib_1.__decorate([
924
- HostBinding('attr.role'),
925
- tslib_1.__metadata("design:type", String),
926
- tslib_1.__metadata("design:paramtypes", [])
927
- ], MultiViewCalendarComponent.prototype, "widgetRole", null);
928
984
  tslib_1.__decorate([
929
985
  HostBinding('attr.tabindex'),
930
986
  tslib_1.__metadata("design:type", Number),
@@ -942,11 +998,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
942
998
  tslib_1.__metadata("design:paramtypes", [])
943
999
  ], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
944
1000
  tslib_1.__decorate([
945
- HostListener("blur"),
1001
+ HostListener('focusout', ['$event']),
946
1002
  tslib_1.__metadata("design:type", Function),
947
- tslib_1.__metadata("design:paramtypes", []),
1003
+ tslib_1.__metadata("design:paramtypes", [FocusEvent]),
948
1004
  tslib_1.__metadata("design:returntype", void 0)
949
- ], MultiViewCalendarComponent.prototype, "handleBlur", null);
1005
+ ], MultiViewCalendarComponent.prototype, "handleFocusout", null);
950
1006
  tslib_1.__decorate([
951
1007
  HostListener("focus"),
952
1008
  tslib_1.__metadata("design:type", Function),
@@ -1001,7 +1057,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1001
1057
  SelectionService
1002
1058
  ],
1003
1059
  selector: 'kendo-multiviewcalendar',
1004
- 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)=\"handleDateChange({ selectedDates: [$event], focusedDate: $event })\"\n (prevButtonClick)=\"navigate(prevView)\"\n (nextButtonClick)=\"navigate(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 "
1060
+ 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 "
1005
1061
  }),
1006
1062
  tslib_1.__metadata("design:paramtypes", [BusViewService,
1007
1063
  ElementRef,
@@ -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,
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
6
6
  var _a;
7
7
  /* tslint:disable:object-literal-sort-keys */
8
8
  import { Injectable } from '@angular/core';
9
- import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate } from '@progress/kendo-date-math';
9
+ import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate, lastYearOfDecade, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
10
10
  import { Action } from '../models/navigation-action.enum';
11
11
  import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
12
12
  import { getToday, isInSelectionRange, range } from '../../util';
@@ -114,6 +114,12 @@ var CenturyViewService = /** @class */ (function () {
114
114
  var firstYear = firstYearOfDecade(firstDecadeOfCentury(date));
115
115
  return createDate(firstYear.getFullYear(), 0, 1);
116
116
  };
117
+ CenturyViewService.prototype.lastDayOfPeriod = function (date) {
118
+ var decade = lastDecadeOfCentury(date);
119
+ var year = lastYearOfDecade(decade);
120
+ var month = lastMonthOfYear(year);
121
+ return lastDayOfMonth(month);
122
+ };
117
123
  CenturyViewService.prototype.isRangeStart = function (value) {
118
124
  return value.getFullYear() % 1000 === 0;
119
125
  };
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
6
6
  var _a;
7
7
  /* tslint:disable:object-literal-sort-keys */
8
8
  import { Injectable } from '@angular/core';
9
- import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate } from '@progress/kendo-date-math';
9
+ import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
10
10
  import { Action } from '../models/navigation-action.enum';
11
11
  import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
12
12
  import { getToday, isInSelectionRange, range } from '../../util';
@@ -114,6 +114,11 @@ var DecadeViewService = /** @class */ (function () {
114
114
  var firstYear = firstYearOfDecade(date);
115
115
  return createDate(firstYear.getFullYear(), 0, 1);
116
116
  };
117
+ DecadeViewService.prototype.lastDayOfPeriod = function (date) {
118
+ var year = lastYearOfDecade(date);
119
+ var month = lastMonthOfYear(year);
120
+ return lastDayOfMonth(month);
121
+ };
117
122
  DecadeViewService.prototype.isRangeStart = function (value) {
118
123
  return value.getFullYear() % 100 === 0;
119
124
  };
@@ -124,6 +124,9 @@ var MonthViewService = /** @class */ (function () {
124
124
  }
125
125
  return createDate(date.getFullYear(), date.getMonth(), 1);
126
126
  };
127
+ MonthViewService.prototype.lastDayOfPeriod = function (date) {
128
+ return lastDayOfMonth(date);
129
+ };
127
130
  MonthViewService.prototype.isRangeStart = function (value) {
128
131
  return !value.getMonth();
129
132
  };
@@ -7,7 +7,7 @@ var _a;
7
7
  /* tslint:disable:object-literal-sort-keys */
8
8
  import { Injectable } from '@angular/core';
9
9
  import { IntlService } from '@progress/kendo-angular-intl';
10
- import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastMonthOfYear } from '@progress/kendo-date-math';
10
+ import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastDayOfMonth, lastMonthOfYear } from '@progress/kendo-date-math';
11
11
  import { Action } from '../models/navigation-action.enum';
12
12
  import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
13
13
  import { getToday, isInSelectionRange, range } from '../../util';
@@ -138,6 +138,10 @@ var YearViewService = /** @class */ (function () {
138
138
  }
139
139
  return createDate(date.getFullYear(), 0, 1);
140
140
  };
141
+ YearViewService.prototype.lastDayOfPeriod = function (date) {
142
+ var month = lastMonthOfYear(date);
143
+ return lastDayOfMonth(month);
144
+ };
141
145
  YearViewService.prototype.isRangeStart = function (value) {
142
146
  return value.getFullYear() % 10 === 0;
143
147
  };