@progress/kendo-angular-dateinputs 5.2.3 → 5.3.0-dev.202110290637

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 (50) hide show
  1. package/dist/cdn/js/kendo-angular-dateinputs.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/calendar/calendar.component.js +37 -2
  4. package/dist/es/calendar/header.component.js +3 -4
  5. package/dist/es/calendar/horizontal-view-list.component.js +3 -1
  6. package/dist/es/calendar/multiview-calendar.component.js +40 -3
  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/daterange/date-range-input.js +3 -3
  12. package/dist/es/daterange/date-range-popup.component.js +2 -2
  13. package/dist/es/daterange/date-range-selection.directive.js +1 -1
  14. package/dist/es/package-metadata.js +1 -1
  15. package/dist/es2015/calendar/calendar.component.d.ts +18 -0
  16. package/dist/es2015/calendar/calendar.component.js +38 -2
  17. package/dist/es2015/calendar/header.component.js +3 -4
  18. package/dist/es2015/calendar/horizontal-view-list.component.js +3 -1
  19. package/dist/es2015/calendar/models/view-service.interface.d.ts +1 -0
  20. package/dist/es2015/calendar/multiview-calendar.component.d.ts +20 -1
  21. package/dist/es2015/calendar/multiview-calendar.component.js +42 -5
  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/daterange/date-range-input.js +3 -3
  31. package/dist/es2015/daterange/date-range-popup.component.js +2 -2
  32. package/dist/es2015/daterange/date-range-selection.directive.js +1 -1
  33. package/dist/es2015/index.metadata.json +1 -1
  34. package/dist/es2015/package-metadata.js +1 -1
  35. package/dist/fesm2015/index.js +112 -20
  36. package/dist/fesm5/index.js +109 -18
  37. package/dist/npm/calendar/calendar.component.js +37 -2
  38. package/dist/npm/calendar/header.component.js +3 -4
  39. package/dist/npm/calendar/horizontal-view-list.component.js +3 -1
  40. package/dist/npm/calendar/multiview-calendar.component.js +40 -3
  41. package/dist/npm/calendar/services/century-view.service.js +6 -0
  42. package/dist/npm/calendar/services/decade-view.service.js +5 -0
  43. package/dist/npm/calendar/services/month-view.service.js +3 -0
  44. package/dist/npm/calendar/services/year-view.service.js +4 -0
  45. package/dist/npm/daterange/date-range-input.js +3 -3
  46. package/dist/npm/daterange/date-range-popup.component.js +2 -2
  47. package/dist/npm/daterange/date-range-selection.directive.js +1 -1
  48. package/dist/npm/package-metadata.js +1 -1
  49. package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
  50. package/package.json +5 -5
@@ -6,7 +6,7 @@ import { __decorate, __metadata, __param, __extends } from 'tslib';
6
6
  import { Injectable, Injector, EventEmitter, InjectionToken, Input, Output, HostBinding, Component, Inject, ElementRef, Renderer2, NgZone, TemplateRef, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef, isDevMode, Directive, forwardRef, ContentChild, Optional, ViewContainerRef, HostListener, ViewChildren, QueryList, ContentChildren, IterableDiffers, NgModule } from '@angular/core';
7
7
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
8
8
  import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages } from '@progress/kendo-angular-l10n';
9
- import { getDate, isEqual, cloneDate, addDays, addDecades, addCenturies, firstDecadeOfCentury, lastDecadeOfCentury, firstYearOfDecade, createDate, durationInCenturies, addYears, lastYearOfDecade, durationInDecades, addWeeks, addMonths, firstDayOfMonth, lastDayOfMonth, dayOfWeek, durationInMonths, firstMonthOfYear, lastMonthOfYear, durationInYears, weekInYear } from '@progress/kendo-date-math';
9
+ import { getDate, isEqual, cloneDate, addDays, addDecades, addCenturies, firstDecadeOfCentury, lastDecadeOfCentury, firstYearOfDecade, createDate, lastYearOfDecade, lastMonthOfYear, lastDayOfMonth, durationInCenturies, addYears, durationInDecades, addWeeks, addMonths, firstDayOfMonth, dayOfWeek, durationInMonths, firstMonthOfYear, durationInYears, weekInYear } from '@progress/kendo-date-math';
10
10
  import { isDocumentAvailable, KendoInput, hasObservers, Keys, guid, EventsModule, ResizeSensorModule } from '@progress/kendo-angular-common';
11
11
  import { validatePackage } from '@progress/kendo-licensing';
12
12
  import { IntlService, IntlModule } from '@progress/kendo-angular-intl';
@@ -23,7 +23,7 @@ var packageMetadata = {
23
23
  name: '@progress/kendo-angular-dateinputs',
24
24
  productName: 'Kendo UI for Angular',
25
25
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
26
- publishDate: 1631623618,
26
+ publishDate: 1635489253,
27
27
  version: '',
28
28
  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'
29
29
  };
@@ -539,6 +539,12 @@ var CenturyViewService = /** @class */ (function () {
539
539
  var firstYear = firstYearOfDecade(firstDecadeOfCentury(date));
540
540
  return createDate(firstYear.getFullYear(), 0, 1);
541
541
  };
542
+ CenturyViewService.prototype.lastDayOfPeriod = function (date) {
543
+ var decade = lastDecadeOfCentury(date);
544
+ var year = lastYearOfDecade(decade);
545
+ var month = lastMonthOfYear(year);
546
+ return lastDayOfMonth(month);
547
+ };
542
548
  CenturyViewService.prototype.isRangeStart = function (value) {
543
549
  return value.getFullYear() % 1000 === 0;
544
550
  };
@@ -701,6 +707,11 @@ var DecadeViewService = /** @class */ (function () {
701
707
  var firstYear = firstYearOfDecade(date);
702
708
  return createDate(firstYear.getFullYear(), 0, 1);
703
709
  };
710
+ DecadeViewService.prototype.lastDayOfPeriod = function (date) {
711
+ var year = lastYearOfDecade(date);
712
+ var month = lastMonthOfYear(year);
713
+ return lastDayOfMonth(month);
714
+ };
704
715
  DecadeViewService.prototype.isRangeStart = function (value) {
705
716
  return value.getFullYear() % 100 === 0;
706
717
  };
@@ -872,6 +883,9 @@ var MonthViewService = /** @class */ (function () {
872
883
  }
873
884
  return createDate(date.getFullYear(), date.getMonth(), 1);
874
885
  };
886
+ MonthViewService.prototype.lastDayOfPeriod = function (date) {
887
+ return lastDayOfMonth(date);
888
+ };
875
889
  MonthViewService.prototype.isRangeStart = function (value) {
876
890
  return !value.getMonth();
877
891
  };
@@ -1071,6 +1085,10 @@ var YearViewService = /** @class */ (function () {
1071
1085
  }
1072
1086
  return createDate(date.getFullYear(), 0, 1);
1073
1087
  };
1088
+ YearViewService.prototype.lastDayOfPeriod = function (date) {
1089
+ var month = lastMonthOfYear(date);
1090
+ return lastDayOfMonth(month);
1091
+ };
1074
1092
  YearViewService.prototype.isRangeStart = function (value) {
1075
1093
  return value.getFullYear() % 10 === 0;
1076
1094
  };
@@ -3055,6 +3073,11 @@ var CalendarComponent = /** @class */ (function () {
3055
3073
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
3056
3074
  */
3057
3075
  this.activeViewChange = new EventEmitter();
3076
+ /**
3077
+ * Fires when navigating in the currently active view
3078
+ * ([more information and example]({% slug events_calendar %})).
3079
+ */
3080
+ this.navigate = new EventEmitter();
3058
3081
  /**
3059
3082
  * Fires when the active view date is changed
3060
3083
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
@@ -3100,6 +3123,14 @@ var CalendarComponent = /** @class */ (function () {
3100
3123
  * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
3101
3124
  */
3102
3125
  set: function (focusedDate) {
3126
+ if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
3127
+ var service = this.bus.service(this.activeViewEnum);
3128
+ var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
3129
+ var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
3130
+ if (!isFocusedDateInRange) {
3131
+ this.emitNavigate(focusedDate);
3132
+ }
3133
+ }
3103
3134
  this._focusedDate = focusedDate || getToday();
3104
3135
  this.setAriaActivedescendant();
3105
3136
  },
@@ -3179,12 +3210,16 @@ var CalendarComponent = /** @class */ (function () {
3179
3210
  configurable: true
3180
3211
  });
3181
3212
  Object.defineProperty(CalendarComponent.prototype, "disabledDates", {
3213
+ get: function () {
3214
+ return this._disabledDates;
3215
+ },
3182
3216
  /**
3183
3217
  * Sets the dates of the Calendar that will be disabled
3184
3218
  * ([see example]({% slug disabled_dates_calendar %})).
3185
3219
  */
3186
3220
  set: function (value) {
3187
3221
  this.disabledDatesService.initialize(value);
3222
+ this._disabledDates = value;
3188
3223
  },
3189
3224
  enumerable: true,
3190
3225
  configurable: true
@@ -3327,7 +3362,7 @@ var CalendarComponent = /** @class */ (function () {
3327
3362
  });
3328
3363
  Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
3329
3364
  get: function () {
3330
- return this.disabled ? undefined : this.tabIndex;
3365
+ return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
3331
3366
  },
3332
3367
  enumerable: true,
3333
3368
  configurable: true
@@ -3561,6 +3596,13 @@ var CalendarComponent = /** @class */ (function () {
3561
3596
  return null;
3562
3597
  }
3563
3598
  };
3599
+ /**
3600
+ * @hidden
3601
+ */
3602
+ CalendarComponent.prototype.emitNavigate = function (focusedDate) {
3603
+ var activeView = CalendarViewEnum[this.activeViewEnum];
3604
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
3605
+ };
3564
3606
  /**
3565
3607
  * @hidden
3566
3608
  */
@@ -3571,6 +3613,13 @@ var CalendarComponent = /** @class */ (function () {
3571
3613
  });
3572
3614
  }
3573
3615
  };
3616
+ /**
3617
+ * @hidden
3618
+ */
3619
+ CalendarComponent.prototype.handleActiveDateChange = function (date) {
3620
+ this.activeViewDate = date;
3621
+ this.emitEvent(this.activeViewDateChange, date);
3622
+ };
3574
3623
  /**
3575
3624
  * @hidden
3576
3625
  */
@@ -3814,6 +3863,10 @@ var CalendarComponent = /** @class */ (function () {
3814
3863
  Output(),
3815
3864
  __metadata("design:type", EventEmitter)
3816
3865
  ], CalendarComponent.prototype, "activeViewChange", void 0);
3866
+ __decorate([
3867
+ Output(),
3868
+ __metadata("design:type", EventEmitter)
3869
+ ], CalendarComponent.prototype, "navigate", void 0);
3817
3870
  __decorate([
3818
3871
  Output(),
3819
3872
  __metadata("design:type", EventEmitter)
@@ -3943,7 +3996,7 @@ var CalendarComponent = /** @class */ (function () {
3943
3996
  SelectionService
3944
3997
  ],
3945
3998
  selector: 'kendo-calendar',
3946
- 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 "
3999
+ 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 "
3947
4000
  }),
3948
4001
  __param(12, Optional()),
3949
4002
  __metadata("design:paramtypes", [BusViewService,
@@ -8997,7 +9050,9 @@ var HorizontalViewListComponent = /** @class */ (function () {
8997
9050
  ], HorizontalViewListComponent.prototype, "activeDateChange", void 0);
8998
9051
  __decorate([
8999
9052
  HostBinding("class.k-calendar-view"),
9000
- HostBinding("class.k-justify-align-start"),
9053
+ HostBinding("class.k-hstack"),
9054
+ HostBinding("class.k-align-items-start"),
9055
+ HostBinding("class.k-justify-content-center"),
9001
9056
  __metadata("design:type", Boolean)
9002
9057
  ], HorizontalViewListComponent.prototype, "getComponentClass", void 0);
9003
9058
  __decorate([
@@ -9185,6 +9240,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9185
9240
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
9186
9241
  */
9187
9242
  this.activeViewChange = new EventEmitter();
9243
+ /**
9244
+ * Fires when navigating in the currently active view
9245
+ * ([more information and example]({% slug events_multiviewcalendar %})).
9246
+ */
9247
+ this.navigate = new EventEmitter();
9188
9248
  /**
9189
9249
  * Fires when a view cell is entered
9190
9250
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
@@ -9217,7 +9277,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9217
9277
  this.minValidateFn = noop;
9218
9278
  this.maxValidateFn = noop;
9219
9279
  this.disabledDatesRangeValidateFn = noop;
9220
- this.subscriptions = new Subscription(function () { });
9280
+ this.subscriptions = new Subscription();
9221
9281
  this.setClasses(element.nativeElement);
9222
9282
  }
9223
9283
  Object.defineProperty(MultiViewCalendarComponent.prototype, "focusedDate", {
@@ -9517,6 +9577,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9517
9577
  }
9518
9578
  this.focusedDate = candidate;
9519
9579
  event.preventDefault();
9580
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
9581
+ if (!isSameView) {
9582
+ this.emitNavigate(this.focusedDate);
9583
+ }
9520
9584
  };
9521
9585
  MultiViewCalendarComponent.prototype.ngOnInit = function () {
9522
9586
  var _this = this;
@@ -9605,6 +9669,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9605
9669
  this.onControlChange(this.parseSelectionToValue(availableDates));
9606
9670
  this.valueChange.emit(this.parseSelectionToValue(availableDates));
9607
9671
  };
9672
+ /**
9673
+ * @hidden
9674
+ */
9675
+ MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
9676
+ var todayDate = args.focusedDate;
9677
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
9678
+ var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
9679
+ if (!isSameView && isBottomView) {
9680
+ this.emitNavigate(todayDate);
9681
+ }
9682
+ this.handleDateChange(args);
9683
+ };
9608
9684
  /**
9609
9685
  * @hidden
9610
9686
  */
@@ -9671,9 +9747,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9671
9747
  /**
9672
9748
  * @hidden
9673
9749
  */
9674
- MultiViewCalendarComponent.prototype.navigate = function (action) {
9750
+ MultiViewCalendarComponent.prototype.navigateView = function (action) {
9675
9751
  this.focusedDate = this.viewList.navigate(action);
9676
9752
  this.updateButtonState();
9753
+ this.emitNavigate(this.focusedDate);
9754
+ };
9755
+ /**
9756
+ * @hidden
9757
+ */
9758
+ MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
9759
+ var activeView = CalendarViewEnum[this.activeViewEnum];
9760
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
9677
9761
  };
9678
9762
  /**
9679
9763
  * @hidden
@@ -9691,6 +9775,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9691
9775
  MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
9692
9776
  var date = _a.date, modifiers = _a.modifiers;
9693
9777
  this.performSelection(date, modifiers);
9778
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
9779
+ if (!isSameView) {
9780
+ this.emitNavigate(this.focusedDate);
9781
+ }
9694
9782
  };
9695
9783
  /**
9696
9784
  * @hidden
@@ -9863,6 +9951,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
9863
9951
  Output(),
9864
9952
  __metadata("design:type", EventEmitter)
9865
9953
  ], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
9954
+ __decorate([
9955
+ Output(),
9956
+ __metadata("design:type", EventEmitter)
9957
+ ], MultiViewCalendarComponent.prototype, "navigate", void 0);
9866
9958
  __decorate([
9867
9959
  Output(),
9868
9960
  __metadata("design:type", EventEmitter)
@@ -10028,7 +10120,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
10028
10120
  SelectionService
10029
10121
  ],
10030
10122
  selector: 'kendo-multiviewcalendar',
10031
- 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 "
10123
+ 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 "
10032
10124
  }),
10033
10125
  __metadata("design:paramtypes", [BusViewService,
10034
10126
  ElementRef,
@@ -10324,8 +10416,8 @@ var DateRangePopupComponent = /** @class */ (function () {
10324
10416
  * @hidden
10325
10417
  */
10326
10418
  this.popupUID = guid();
10327
- this.calendarSubscriptions = new Subscription(function () { });
10328
- this.popupSubscriptions = new Subscription(function () { });
10419
+ this.calendarSubscriptions = new Subscription();
10420
+ this.popupSubscriptions = new Subscription();
10329
10421
  this.resolvedPromise = Promise.resolve();
10330
10422
  }
10331
10423
  Object.defineProperty(DateRangePopupComponent.prototype, "calendar", {
@@ -10714,8 +10806,8 @@ var DateRangeInput = /** @class */ (function () {
10714
10806
  this.renderer = renderer;
10715
10807
  this.zone = zone;
10716
10808
  this.navigateCalendarOnFocus = false;
10717
- this.popupSubscriptions = new Subscription(function () { });
10718
- this.subscriptions = new Subscription(function () { });
10809
+ this.popupSubscriptions = new Subscription();
10810
+ this.subscriptions = new Subscription();
10719
10811
  }
10720
10812
  Object.defineProperty(DateRangeInput.prototype, "isActiveEnd", {
10721
10813
  get: function () {
@@ -10774,7 +10866,7 @@ var DateRangeInput = /** @class */ (function () {
10774
10866
  };
10775
10867
  DateRangeInput.prototype.unsubscribePopup = function () {
10776
10868
  this.popupSubscriptions.unsubscribe();
10777
- this.popupSubscriptions = new Subscription(function () { });
10869
+ this.popupSubscriptions = new Subscription();
10778
10870
  };
10779
10871
  DateRangeInput.prototype.activate = function () {
10780
10872
  this.dateRangeService.setActiveRangeEnd(this.activeRangeEnd);
@@ -11021,7 +11113,7 @@ var DateRangeSelectionDirective = /** @class */ (function () {
11021
11113
  * the section on [events]({% slug overview_multiviewcalendar %}#toc-events).
11022
11114
  */
11023
11115
  this.selectionRangeChange = new EventEmitter();
11024
- this.calendarSubscriptions = new Subscription(function () { });
11116
+ this.calendarSubscriptions = new Subscription();
11025
11117
  this.dateRangeService = this.dateRangeService || new DateRangeService();
11026
11118
  renderer.setAttribute(element.nativeElement, 'aria-multiselectable', 'true');
11027
11119
  }
@@ -11363,10 +11455,9 @@ var HeaderComponent = /** @class */ (function () {
11363
11455
  this.subscriptions = new Subscription();
11364
11456
  }
11365
11457
  HeaderComponent.prototype.ngOnInit = function () {
11366
- this.subscriptions
11367
- .add(this.intl.changes.subscribe(this.intlChange.bind(this)))
11368
- .add(this.localization.changes.subscribe(this.l10nChange.bind(this)))
11369
- .add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
11458
+ this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
11459
+ this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
11460
+ this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
11370
11461
  };
11371
11462
  HeaderComponent.prototype.ngOnChanges = function (_) {
11372
11463
  var service = this.bus.service(this.activeView);
@@ -171,6 +171,11 @@ var CalendarComponent = /** @class */ (function () {
171
171
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
172
172
  */
173
173
  this.activeViewChange = new core_1.EventEmitter();
174
+ /**
175
+ * Fires when navigating in the currently active view
176
+ * ([more information and example]({% slug events_calendar %})).
177
+ */
178
+ this.navigate = new core_1.EventEmitter();
174
179
  /**
175
180
  * Fires when the active view date is changed
176
181
  * ([more information and example]({% slug overview_calendar %}#toc-events)).
@@ -216,6 +221,14 @@ var CalendarComponent = /** @class */ (function () {
216
221
  * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
217
222
  */
218
223
  set: function (focusedDate) {
224
+ if (this.activeViewDate && !kendo_date_math_1.isEqual(this._focusedDate, focusedDate)) {
225
+ var service = this.bus.service(this.activeViewEnum);
226
+ var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
227
+ var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
228
+ if (!isFocusedDateInRange) {
229
+ this.emitNavigate(focusedDate);
230
+ }
231
+ }
219
232
  this._focusedDate = focusedDate || util_1.getToday();
220
233
  this.setAriaActivedescendant();
221
234
  },
@@ -295,12 +308,16 @@ var CalendarComponent = /** @class */ (function () {
295
308
  configurable: true
296
309
  });
297
310
  Object.defineProperty(CalendarComponent.prototype, "disabledDates", {
311
+ get: function () {
312
+ return this._disabledDates;
313
+ },
298
314
  /**
299
315
  * Sets the dates of the Calendar that will be disabled
300
316
  * ([see example]({% slug disabled_dates_calendar %})).
301
317
  */
302
318
  set: function (value) {
303
319
  this.disabledDatesService.initialize(value);
320
+ this._disabledDates = value;
304
321
  },
305
322
  enumerable: true,
306
323
  configurable: true
@@ -443,7 +460,7 @@ var CalendarComponent = /** @class */ (function () {
443
460
  });
444
461
  Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
445
462
  get: function () {
446
- return this.disabled ? undefined : this.tabIndex;
463
+ return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
447
464
  },
448
465
  enumerable: true,
449
466
  configurable: true
@@ -677,6 +694,13 @@ var CalendarComponent = /** @class */ (function () {
677
694
  return null;
678
695
  }
679
696
  };
697
+ /**
698
+ * @hidden
699
+ */
700
+ CalendarComponent.prototype.emitNavigate = function (focusedDate) {
701
+ var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
702
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
703
+ };
680
704
  /**
681
705
  * @hidden
682
706
  */
@@ -687,6 +711,13 @@ var CalendarComponent = /** @class */ (function () {
687
711
  });
688
712
  }
689
713
  };
714
+ /**
715
+ * @hidden
716
+ */
717
+ CalendarComponent.prototype.handleActiveDateChange = function (date) {
718
+ this.activeViewDate = date;
719
+ this.emitEvent(this.activeViewDateChange, date);
720
+ };
690
721
  /**
691
722
  * @hidden
692
723
  */
@@ -930,6 +961,10 @@ var CalendarComponent = /** @class */ (function () {
930
961
  core_1.Output(),
931
962
  tslib_1.__metadata("design:type", core_1.EventEmitter)
932
963
  ], CalendarComponent.prototype, "activeViewChange", void 0);
964
+ tslib_1.__decorate([
965
+ core_1.Output(),
966
+ tslib_1.__metadata("design:type", core_1.EventEmitter)
967
+ ], CalendarComponent.prototype, "navigate", void 0);
933
968
  tslib_1.__decorate([
934
969
  core_1.Output(),
935
970
  tslib_1.__metadata("design:type", core_1.EventEmitter)
@@ -1059,7 +1094,7 @@ var CalendarComponent = /** @class */ (function () {
1059
1094
  selection_service_1.SelectionService
1060
1095
  ],
1061
1096
  selector: 'kendo-calendar',
1062
- 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 "
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 "
1063
1098
  }),
1064
1099
  tslib_1.__param(12, core_1.Optional()),
1065
1100
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
@@ -40,10 +40,9 @@ var HeaderComponent = /** @class */ (function () {
40
40
  this.subscriptions = new rxjs_1.Subscription();
41
41
  }
42
42
  HeaderComponent.prototype.ngOnInit = function () {
43
- this.subscriptions
44
- .add(this.intl.changes.subscribe(this.intlChange.bind(this)))
45
- .add(this.localization.changes.subscribe(this.l10nChange.bind(this)))
46
- .add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
43
+ this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
44
+ this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
45
+ this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
47
46
  };
48
47
  HeaderComponent.prototype.ngOnChanges = function (_) {
49
48
  var service = this.bus.service(this.activeView);
@@ -322,7 +322,9 @@ var HorizontalViewListComponent = /** @class */ (function () {
322
322
  ], HorizontalViewListComponent.prototype, "activeDateChange", void 0);
323
323
  tslib_1.__decorate([
324
324
  core_1.HostBinding("class.k-calendar-view"),
325
- core_1.HostBinding("class.k-justify-align-start"),
325
+ core_1.HostBinding("class.k-hstack"),
326
+ core_1.HostBinding("class.k-align-items-start"),
327
+ core_1.HostBinding("class.k-justify-content-center"),
326
328
  tslib_1.__metadata("design:type", Boolean)
327
329
  ], HorizontalViewListComponent.prototype, "getComponentClass", void 0);
328
330
  tslib_1.__decorate([
@@ -160,6 +160,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
160
160
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
161
161
  */
162
162
  this.activeViewChange = new core_1.EventEmitter();
163
+ /**
164
+ * Fires when navigating in the currently active view
165
+ * ([more information and example]({% slug events_multiviewcalendar %})).
166
+ */
167
+ this.navigate = new core_1.EventEmitter();
163
168
  /**
164
169
  * Fires when a view cell is entered
165
170
  * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
@@ -192,7 +197,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
192
197
  this.minValidateFn = util_1.noop;
193
198
  this.maxValidateFn = util_1.noop;
194
199
  this.disabledDatesRangeValidateFn = util_1.noop;
195
- this.subscriptions = new rxjs_1.Subscription(function () { });
200
+ this.subscriptions = new rxjs_1.Subscription();
196
201
  this.setClasses(element.nativeElement);
197
202
  }
198
203
  Object.defineProperty(MultiViewCalendarComponent.prototype, "focusedDate", {
@@ -492,6 +497,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
492
497
  }
493
498
  this.focusedDate = candidate;
494
499
  event.preventDefault();
500
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
501
+ if (!isSameView) {
502
+ this.emitNavigate(this.focusedDate);
503
+ }
495
504
  };
496
505
  MultiViewCalendarComponent.prototype.ngOnInit = function () {
497
506
  var _this = this;
@@ -580,6 +589,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
580
589
  this.onControlChange(this.parseSelectionToValue(availableDates));
581
590
  this.valueChange.emit(this.parseSelectionToValue(availableDates));
582
591
  };
592
+ /**
593
+ * @hidden
594
+ */
595
+ MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
596
+ var todayDate = args.focusedDate;
597
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
598
+ var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
599
+ if (!isSameView && isBottomView) {
600
+ this.emitNavigate(todayDate);
601
+ }
602
+ this.handleDateChange(args);
603
+ };
583
604
  /**
584
605
  * @hidden
585
606
  */
@@ -646,9 +667,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
646
667
  /**
647
668
  * @hidden
648
669
  */
649
- MultiViewCalendarComponent.prototype.navigate = function (action) {
670
+ MultiViewCalendarComponent.prototype.navigateView = function (action) {
650
671
  this.focusedDate = this.viewList.navigate(action);
651
672
  this.updateButtonState();
673
+ this.emitNavigate(this.focusedDate);
674
+ };
675
+ /**
676
+ * @hidden
677
+ */
678
+ MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
679
+ var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
680
+ this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
652
681
  };
653
682
  /**
654
683
  * @hidden
@@ -666,6 +695,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
666
695
  MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
667
696
  var date = _a.date, modifiers = _a.modifiers;
668
697
  this.performSelection(date, modifiers);
698
+ var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
699
+ if (!isSameView) {
700
+ this.emitNavigate(this.focusedDate);
701
+ }
669
702
  };
670
703
  /**
671
704
  * @hidden
@@ -838,6 +871,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
838
871
  core_1.Output(),
839
872
  tslib_1.__metadata("design:type", core_1.EventEmitter)
840
873
  ], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
874
+ tslib_1.__decorate([
875
+ core_1.Output(),
876
+ tslib_1.__metadata("design:type", core_1.EventEmitter)
877
+ ], MultiViewCalendarComponent.prototype, "navigate", void 0);
841
878
  tslib_1.__decorate([
842
879
  core_1.Output(),
843
880
  tslib_1.__metadata("design:type", core_1.EventEmitter)
@@ -1003,7 +1040,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
1003
1040
  selection_service_1.SelectionService
1004
1041
  ],
1005
1042
  selector: 'kendo-multiviewcalendar',
1006
- 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 "
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 "
1007
1044
  }),
1008
1045
  tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
1009
1046
  core_1.ElementRef,
@@ -116,6 +116,12 @@ var CenturyViewService = /** @class */ (function () {
116
116
  var firstYear = kendo_date_math_1.firstYearOfDecade(kendo_date_math_1.firstDecadeOfCentury(date));
117
117
  return kendo_date_math_1.createDate(firstYear.getFullYear(), 0, 1);
118
118
  };
119
+ CenturyViewService.prototype.lastDayOfPeriod = function (date) {
120
+ var decade = kendo_date_math_1.lastDecadeOfCentury(date);
121
+ var year = kendo_date_math_1.lastYearOfDecade(decade);
122
+ var month = kendo_date_math_1.lastMonthOfYear(year);
123
+ return kendo_date_math_1.lastDayOfMonth(month);
124
+ };
119
125
  CenturyViewService.prototype.isRangeStart = function (value) {
120
126
  return value.getFullYear() % 1000 === 0;
121
127
  };
@@ -116,6 +116,11 @@ var DecadeViewService = /** @class */ (function () {
116
116
  var firstYear = kendo_date_math_1.firstYearOfDecade(date);
117
117
  return kendo_date_math_1.createDate(firstYear.getFullYear(), 0, 1);
118
118
  };
119
+ DecadeViewService.prototype.lastDayOfPeriod = function (date) {
120
+ var year = kendo_date_math_1.lastYearOfDecade(date);
121
+ var month = kendo_date_math_1.lastMonthOfYear(year);
122
+ return kendo_date_math_1.lastDayOfMonth(month);
123
+ };
119
124
  DecadeViewService.prototype.isRangeStart = function (value) {
120
125
  return value.getFullYear() % 100 === 0;
121
126
  };
@@ -126,6 +126,9 @@ var MonthViewService = /** @class */ (function () {
126
126
  }
127
127
  return kendo_date_math_1.createDate(date.getFullYear(), date.getMonth(), 1);
128
128
  };
129
+ MonthViewService.prototype.lastDayOfPeriod = function (date) {
130
+ return kendo_date_math_1.lastDayOfMonth(date);
131
+ };
129
132
  MonthViewService.prototype.isRangeStart = function (value) {
130
133
  return !value.getMonth();
131
134
  };
@@ -142,6 +142,10 @@ var YearViewService = /** @class */ (function () {
142
142
  }
143
143
  return kendo_date_math_1.createDate(date.getFullYear(), 0, 1);
144
144
  };
145
+ YearViewService.prototype.lastDayOfPeriod = function (date) {
146
+ var month = kendo_date_math_1.lastMonthOfYear(date);
147
+ return kendo_date_math_1.lastDayOfMonth(month);
148
+ };
145
149
  YearViewService.prototype.isRangeStart = function (value) {
146
150
  return value.getFullYear() % 10 === 0;
147
151
  };