@progress/kendo-angular-dateinputs 7.1.2 → 7.1.3-dev.202210211241

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 (54) hide show
  1. package/bundles/kendo-angular-dateinputs.umd.js +1 -1
  2. package/calendar/calendar.component.d.ts +7 -2
  3. package/calendar/header.component.d.ts +4 -1
  4. package/calendar/horizontal-view-list.component.d.ts +17 -1
  5. package/calendar/localization/calendar-messages.d.ts +5 -1
  6. package/calendar/localization/multiview-calendar-messages.d.ts +5 -1
  7. package/calendar/multiview-calendar.component.d.ts +21 -11
  8. package/calendar/services/bus-view.service.d.ts +1 -0
  9. package/calendar/services/selection.service.d.ts +2 -0
  10. package/calendar/services/weeknames.service.d.ts +1 -1
  11. package/calendar/view-list.component.d.ts +9 -1
  12. package/calendar/view.component.d.ts +3 -1
  13. package/common/utils.d.ts +33 -0
  14. package/dateinput/dateinput.component.d.ts +16 -6
  15. package/datepicker/datepicker.component.d.ts +1 -5
  16. package/daterange/date-range-end-input.directive.d.ts +1 -0
  17. package/daterange/date-range-input.d.ts +4 -1
  18. package/daterange/date-range-start-input.directive.d.ts +2 -0
  19. package/daterange/date-range.component.d.ts +7 -1
  20. package/daterange/date-range.service.d.ts +6 -2
  21. package/datetimepicker/datetimepicker.component.d.ts +5 -4
  22. package/esm2015/calendar/calendar.component.js +85 -48
  23. package/esm2015/calendar/header.component.js +30 -3
  24. package/esm2015/calendar/horizontal-view-list.component.js +83 -11
  25. package/esm2015/calendar/localization/calendar-messages.js +3 -1
  26. package/esm2015/calendar/localization/multiview-calendar-messages.js +3 -1
  27. package/esm2015/calendar/multiview-calendar.component.js +87 -45
  28. package/esm2015/calendar/services/bus-view.service.js +2 -0
  29. package/esm2015/calendar/services/month-view.service.js +1 -1
  30. package/esm2015/calendar/services/selection.service.js +4 -0
  31. package/esm2015/calendar/services/weeknames.service.js +2 -2
  32. package/esm2015/calendar/view-list.component.js +45 -9
  33. package/esm2015/calendar/view.component.js +16 -3
  34. package/esm2015/common/utils.js +34 -0
  35. package/esm2015/dateinput/dateinput.component.js +52 -23
  36. package/esm2015/datepicker/datepicker.component.js +25 -11
  37. package/esm2015/daterange/date-range-end-input.directive.js +5 -1
  38. package/esm2015/daterange/date-range-input.js +10 -0
  39. package/esm2015/daterange/date-range-popup.component.js +4 -4
  40. package/esm2015/daterange/date-range-selection.directive.js +1 -1
  41. package/esm2015/daterange/date-range-start-input.directive.js +7 -0
  42. package/esm2015/daterange/date-range.component.js +29 -11
  43. package/esm2015/daterange/date-range.service.js +28 -4
  44. package/esm2015/datetimepicker/datetimepicker.component.js +36 -11
  45. package/esm2015/package-metadata.js +1 -1
  46. package/esm2015/timepicker/localization/messages.js +11 -1
  47. package/esm2015/timepicker/timelist.component.js +57 -10
  48. package/esm2015/timepicker/timepicker.component.js +71 -24
  49. package/esm2015/util.js +2 -2
  50. package/fesm2015/kendo-angular-dateinputs.js +773 -280
  51. package/package.json +1 -1
  52. package/timepicker/localization/messages.d.ts +21 -1
  53. package/timepicker/timelist.component.d.ts +10 -1
  54. package/timepicker/timepicker.component.d.ts +5 -7
@@ -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 i0 from '@angular/core';
6
- import { Injectable, EventEmitter, isDevMode, Directive, Input, Component, Output, ChangeDetectionStrategy, HostBinding, forwardRef, ElementRef, ContentChild, ViewChild, HostListener, InjectionToken, Inject, NgZone, Optional, ViewContainerRef, ViewChildren, TemplateRef, ContentChildren, NgModule } from '@angular/core';
6
+ import { Injectable, EventEmitter, isDevMode, Directive, Input, Component, Output, ChangeDetectionStrategy, HostListener, HostBinding, forwardRef, ElementRef, ContentChild, ViewChild, InjectionToken, Inject, NgZone, Optional, ViewContainerRef, ViewChildren, TemplateRef, ContentChildren, NgModule } from '@angular/core';
7
7
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
8
8
  import * as i1$1 from '@progress/kendo-angular-l10n';
9
9
  import { ComponentMessages, LocalizationService, L10N_PREFIX, RTL } from '@progress/kendo-angular-l10n';
10
10
  import { cloneDate, addDays, getDate, isEqual, 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';
11
11
  import * as i5 from '@progress/kendo-angular-common';
12
- import { isDocumentAvailable, guid, Keys, hasObservers, KendoInput, EventsModule, ResizeSensorModule } from '@progress/kendo-angular-common';
12
+ import { isDocumentAvailable, guid, Keys as Keys$1, hasObservers, KendoInput, EventsModule, ResizeSensorModule } from '@progress/kendo-angular-common';
13
13
  import { validatePackage } from '@progress/kendo-licensing';
14
14
  import * as i1 from '@progress/kendo-angular-intl';
15
15
  import { IntlModule } from '@progress/kendo-angular-intl';
@@ -17,7 +17,7 @@ import { Subject, Subscription, ReplaySubject, Observable, combineLatest, of, in
17
17
  import * as i7 from '@angular/common';
18
18
  import { CommonModule } from '@angular/common';
19
19
  import { map, scan, takeWhile, debounceTime, tap, filter } from 'rxjs/operators';
20
- import * as i2 from '@progress/kendo-angular-popup';
20
+ import * as i1$2 from '@progress/kendo-angular-popup';
21
21
  import { PopupModule } from '@progress/kendo-angular-popup';
22
22
  import { touchEnabled } from '@progress/kendo-common';
23
23
 
@@ -28,7 +28,7 @@ const packageMetadata = {
28
28
  name: '@progress/kendo-angular-dateinputs',
29
29
  productName: 'Kendo UI for Angular',
30
30
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
31
- publishDate: 1663071420,
31
+ publishDate: 1666356015,
32
32
  version: '',
33
33
  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'
34
34
  };
@@ -120,6 +120,40 @@ const isNumberArray = (value) => Array.isArray(value) && value.length > 0 && val
120
120
  * and all items in the array are dates, returns `true`.
121
121
  */
122
122
  const isDateArray = (value) => Array.isArray(value) && value.length > 0 && value.every(item => item instanceof Date);
123
+ /**
124
+ * @hidden
125
+ */
126
+ const isArrowWithShiftPressed = (args) => args.shiftKey && (args.keyCode === Keys.ArrowRight || args.keyCode === Keys.ArrowLeft || args.keyCode === Keys.ArrowDown || args.keyCode === Keys.ArrowUp);
127
+ /**
128
+ * @hidden
129
+ * Enum with key codes.
130
+ */
131
+ var Keys;
132
+ (function (Keys) {
133
+ Keys[Keys["ArrowDown"] = 40] = "ArrowDown";
134
+ Keys[Keys["ArrowLeft"] = 37] = "ArrowLeft";
135
+ Keys[Keys["ArrowRight"] = 39] = "ArrowRight";
136
+ Keys[Keys["ArrowUp"] = 38] = "ArrowUp";
137
+ })(Keys || (Keys = {}));
138
+ /**
139
+ * @hidden
140
+ */
141
+ const selectors = {
142
+ infiniteCalendarTable: '.k-content .k-calendar-table',
143
+ multiViewCalendarTable: '.k-content.k-calendar-table'
144
+ };
145
+ /**
146
+ * @hidden
147
+ */
148
+ const attributeNames = {
149
+ ariaActiveDescendant: 'aria-activedescendant',
150
+ ariaControls: 'aria-controls',
151
+ ariaExpanded: 'aria-expanded',
152
+ ariaHasPopup: 'aria-haspopup',
153
+ valueNow: 'valuenow',
154
+ valuetext: 'valuetext',
155
+ ariaInvalid: 'aria-invalid'
156
+ };
123
157
 
124
158
  const isSet = (value) => value !== null && value !== undefined;
125
159
  const setter = (method) => (date, value) => {
@@ -456,8 +490,8 @@ const isTabExitingCalendar = (calendarType, focusedElement, shiftKey) => {
456
490
  }
457
491
  return calendarType === 'infinite' || ( // infinte calendar is always exited on first tab keydown
458
492
  calendarType === 'classic' &&
459
- (shiftKey && focusedElement.classList.contains('k-calendar')) || // exited on main calendar element focused and back-tab
460
- (!shiftKey && focusedElement.classList.contains('k-calendar-nav-next')) // exited on next button focused and regular tab
493
+ (shiftKey && focusedElement.classList.contains('k-calendar-table')) || // exited on main calendar element focused and back-tab
494
+ (!shiftKey && focusedElement.classList.contains('k-calendar-table')) // exited on next button focused and regular tab
461
495
  );
462
496
  };
463
497
  /**
@@ -908,7 +942,7 @@ class MonthViewService {
908
942
  const isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);
909
943
  return {
910
944
  formattedValue: this.value(cellDate),
911
- id: `${cellUID}${cellDate.getTime()}`,
945
+ id: `${cellUID}${otherMonth ? cellDate.getTime() + '1' : cellDate.getTime()}`,
912
946
  isFocused: this.isEqual(cellDate, focusedDate),
913
947
  isSelected: isActiveView && selectedDates.some(date => this.isEqual(cellDate, date)),
914
948
  isWeekend: this.isWeekend(cellDate),
@@ -1222,6 +1256,7 @@ const viewOffset = (view, offset) => {
1222
1256
  const candidate = CalendarViewEnum[CalendarViewEnum[view + offset]];
1223
1257
  return candidate !== undefined ? candidate : view;
1224
1258
  };
1259
+ let nextCalendarId = 0;
1225
1260
  /**
1226
1261
  * @hidden
1227
1262
  */
@@ -1231,6 +1266,7 @@ class BusViewService {
1231
1266
  this.viewChanged = new EventEmitter();
1232
1267
  this.bottom = CalendarViewEnum.month;
1233
1268
  this.top = CalendarViewEnum.century;
1269
+ this.calendarId = nextCalendarId++;
1234
1270
  }
1235
1271
  configure(bottom, top) {
1236
1272
  this.bottom = bottom;
@@ -1288,8 +1324,8 @@ class WeekNamesService {
1288
1324
  constructor(intl) {
1289
1325
  this.intl = intl;
1290
1326
  }
1291
- getWeekNames(includeWeekNumber = false) {
1292
- const weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
1327
+ getWeekNames(includeWeekNumber = false, nameType) {
1328
+ const weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: nameType, type: 'days' }), this.intl.firstDay());
1293
1329
  return includeWeekNumber ? [''].concat(weekNames) : weekNames;
1294
1330
  }
1295
1331
  }
@@ -1497,6 +1533,7 @@ class ViewComponent {
1497
1533
  this.weekNumberCellClick = new EventEmitter();
1498
1534
  this.cellEnter = new EventEmitter();
1499
1535
  this.cellLeave = new EventEmitter();
1536
+ this.focusedCellId = new EventEmitter();
1500
1537
  this.colSpan = 0;
1501
1538
  this.subscriptions = new Subscription();
1502
1539
  this.domEvents = [];
@@ -1568,6 +1605,9 @@ class ViewComponent {
1568
1605
  };
1569
1606
  }
1570
1607
  getStyles(context) {
1608
+ if (!context.isOtherMonth && this.isActive && context.isFocused) {
1609
+ this.focusedCellId.emit(context.id);
1610
+ }
1571
1611
  const { isRangeEnd, isRangeStart } = context;
1572
1612
  const isEndActive = this.activeRangeEnd === 'end' && isRangeEnd;
1573
1613
  const isStartActive = this.activeRangeEnd === 'start' && isRangeStart;
@@ -1593,6 +1633,9 @@ class ViewComponent {
1593
1633
  const availableDates = week.map(item => item.value).filter(date => !this.disabledDatesService.isDateDisabled(date));
1594
1634
  this.weekNumberCellClick.emit(availableDates);
1595
1635
  }
1636
+ getMonthLabel(date) {
1637
+ return this.activeView === 1 ? this.intl.formatDate(date, 'MMMM') : null;
1638
+ }
1596
1639
  firstWeekDateContext(rowCtx) {
1597
1640
  if (!this.weekNumber) {
1598
1641
  return null;
@@ -1684,13 +1727,14 @@ class ViewComponent {
1684
1727
  }
1685
1728
  }
1686
1729
  ViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewComponent, deps: [{ token: BusViewService }, { token: i1.IntlService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: DisabledDatesService }], target: i0.ɵɵFactoryTarget.Component });
1687
- ViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ViewComponent, selector: "[kendoCalendarView]", inputs: { direction: "direction", isActive: "isActive", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", viewDate: "viewDate", activeRangeEnd: "activeRangeEnd", selectionRange: "selectionRange", min: "min", max: "max", selectedDates: "selectedDates", weekNumber: "weekNumber", viewIndex: "viewIndex", templateRef: "templateRef", weekNumberTemplateRef: "weekNumberTemplateRef" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave" }, usesOnChanges: true, ngImport: i0, template: `
1688
- <ng-template #emptyCell><td class="k-empty k-calendar-td">&nbsp;</td></ng-template>
1730
+ ViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ViewComponent, selector: "[kendoCalendarView]", inputs: { direction: "direction", isActive: "isActive", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", viewDate: "viewDate", activeRangeEnd: "activeRangeEnd", selectionRange: "selectionRange", min: "min", max: "max", selectedDates: "selectedDates", weekNumber: "weekNumber", viewIndex: "viewIndex", templateRef: "templateRef", weekNumberTemplateRef: "weekNumberTemplateRef" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave", focusedCellId: "focusedCellId" }, usesOnChanges: true, ngImport: i0, template: `
1731
+ <ng-template #emptyCell><td class="k-empty k-calendar-td" role="gridcell">&nbsp;</td></ng-template>
1689
1732
  <tr *ngIf="!isHorizontal()" class="k-calendar-tr" role="row"><th class="k-calendar-caption" scope="col" [colSpan]="colSpan">{{title}}</th></tr>
1690
1733
  <tr *kFor="let row of data; let rowIndex = index" class="k-calendar-tr" role="row">
1691
1734
  <ng-template [ngIf]="weekNumber">
1692
1735
  <td
1693
1736
  class="k-alt k-calendar-td"
1737
+ role="gridcell"
1694
1738
  *ngIf="firstDate(row); else emptyCell"
1695
1739
  [kendoEventsOutsideAngular]="{
1696
1740
  click: handleWeekNumberClick.bind(this, row)
@@ -1717,6 +1761,7 @@ ViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
1717
1761
  [attr.data-cell-index]="tableCellIndex(rowIndex, cellIndex)"
1718
1762
  [attr.aria-selected]="cell.isSelected || cell.isRangeStart || cell.isRangeMid || cell.isRangeEnd"
1719
1763
  [attr.aria-disabled]="cell.isDisabled"
1764
+ [attr.aria-label]="getMonthLabel(cell.value)"
1720
1765
  [ngClass]="getStyles(cell)"
1721
1766
  [title]="cell.title"
1722
1767
  >
@@ -1738,12 +1783,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1738
1783
  // eslint-disable-next-line
1739
1784
  selector: '[kendoCalendarView]',
1740
1785
  template: `
1741
- <ng-template #emptyCell><td class="k-empty k-calendar-td">&nbsp;</td></ng-template>
1786
+ <ng-template #emptyCell><td class="k-empty k-calendar-td" role="gridcell">&nbsp;</td></ng-template>
1742
1787
  <tr *ngIf="!isHorizontal()" class="k-calendar-tr" role="row"><th class="k-calendar-caption" scope="col" [colSpan]="colSpan">{{title}}</th></tr>
1743
1788
  <tr *kFor="let row of data; let rowIndex = index" class="k-calendar-tr" role="row">
1744
1789
  <ng-template [ngIf]="weekNumber">
1745
1790
  <td
1746
1791
  class="k-alt k-calendar-td"
1792
+ role="gridcell"
1747
1793
  *ngIf="firstDate(row); else emptyCell"
1748
1794
  [kendoEventsOutsideAngular]="{
1749
1795
  click: handleWeekNumberClick.bind(this, row)
@@ -1770,6 +1816,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1770
1816
  [attr.data-cell-index]="tableCellIndex(rowIndex, cellIndex)"
1771
1817
  [attr.aria-selected]="cell.isSelected || cell.isRangeStart || cell.isRangeMid || cell.isRangeEnd"
1772
1818
  [attr.aria-disabled]="cell.isDisabled"
1819
+ [attr.aria-label]="getMonthLabel(cell.value)"
1773
1820
  [ngClass]="getStyles(cell)"
1774
1821
  [title]="cell.title"
1775
1822
  >
@@ -1824,6 +1871,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1824
1871
  type: Output
1825
1872
  }], cellLeave: [{
1826
1873
  type: Output
1874
+ }], focusedCellId: [{
1875
+ type: Output
1827
1876
  }] } });
1828
1877
 
1829
1878
  /* eslint-disable @angular-eslint/component-selector */
@@ -1848,16 +1897,28 @@ class HorizontalViewListComponent {
1848
1897
  this.showViewHeader = false;
1849
1898
  this.animateNavigation = false;
1850
1899
  this.orientation = 'horizontal';
1900
+ this.tabIndex = 0;
1901
+ this.disabled = false;
1851
1902
  this.cellClick = new EventEmitter();
1852
1903
  this.weekNumberCellClick = new EventEmitter();
1853
1904
  this.cellEnter = new EventEmitter();
1854
1905
  this.cellLeave = new EventEmitter();
1855
1906
  this.activeDateChange = new EventEmitter();
1907
+ this.focusCalendar = new EventEmitter();
1908
+ this.blurCalendar = new EventEmitter();
1909
+ this.focusedCellChange = new EventEmitter();
1856
1910
  this.getComponentClass = true;
1857
1911
  this.weekNames = [];
1912
+ this.wideWeekNames = [];
1858
1913
  this.dates = [];
1859
1914
  this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));
1860
1915
  }
1916
+ /**
1917
+ * @hidden
1918
+ */
1919
+ handleFocus() {
1920
+ this.focusCalendar.emit();
1921
+ }
1861
1922
  get weekNumber() {
1862
1923
  return this.showWeekNumbers && this.isMonthView();
1863
1924
  }
@@ -1882,10 +1943,17 @@ class HorizontalViewListComponent {
1882
1943
  get getComponentCenturyClass() {
1883
1944
  return this.activeView === CalendarViewEnum.century;
1884
1945
  }
1946
+ get getActiveDescendant() {
1947
+ return this.views === 1 ? this.activeDescendant : null;
1948
+ }
1949
+ get getTabIndex() {
1950
+ return this.disabled || this.views === 2 ? null : this.tabIndex;
1951
+ }
1885
1952
  ngOnChanges(changes) {
1886
1953
  this.initService();
1887
1954
  if (this.weekNames.length === 0 || changes.weekNumber) {
1888
- this.weekNames = this.weekService.getWeekNames(this.weekNumber);
1955
+ this.weekNames = this.getWeekNames('short');
1956
+ this.wideWeekNames = this.getWeekNames('wide');
1889
1957
  }
1890
1958
  if (!this.service) {
1891
1959
  return;
@@ -1902,6 +1970,11 @@ class HorizontalViewListComponent {
1902
1970
  this.activeDate = cloneDate(this.dates[0]);
1903
1971
  this.activeDateChange.emit(this.activeDate);
1904
1972
  }
1973
+ this.setAriaActivedescendant();
1974
+ //set tabindex for MultiViewCalendar
1975
+ if (this.views === 2) {
1976
+ this.renderer.setAttribute(this.element.nativeElement, 'tabindex', this.tabIndex.toString());
1977
+ }
1905
1978
  }
1906
1979
  ngAfterViewInit() {
1907
1980
  // make the calendar look the same in the different browsers
@@ -2006,6 +2079,9 @@ class HorizontalViewListComponent {
2006
2079
  }
2007
2080
  return this.isListInRange(this.service.datesList(this.move(action), this.getTake(this.skip)));
2008
2081
  }
2082
+ getWeekNames(type) {
2083
+ return this.weekService.getWeekNames(this.weekNumber, type);
2084
+ }
2009
2085
  setTableMinWidth() {
2010
2086
  const container = this.element.nativeElement;
2011
2087
  const table = container.querySelector('table');
@@ -2015,7 +2091,8 @@ class HorizontalViewListComponent {
2015
2091
  }
2016
2092
  }
2017
2093
  intlChange() {
2018
- this.weekNames = this.weekService.getWeekNames(this.weekNumber);
2094
+ this.weekNames = this.getWeekNames('short');
2095
+ this.wideWeekNames = this.getWeekNames('wide');
2019
2096
  this.cdr.markForCheck();
2020
2097
  }
2021
2098
  clampDate(value) {
@@ -2035,19 +2112,34 @@ class HorizontalViewListComponent {
2035
2112
  getTake(skip) {
2036
2113
  return Math.min(this.total - skip, this.views);
2037
2114
  }
2115
+ setAriaActivedescendant() {
2116
+ if (this.views === 2) {
2117
+ this.renderer.setAttribute(this.element.nativeElement, attributeNames.ariaActiveDescendant, this.activeDescendant);
2118
+ }
2119
+ }
2038
2120
  }
2039
2121
  HorizontalViewListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HorizontalViewListComponent, deps: [{ token: BusViewService }, { token: i1.IntlService }, { token: WeekNamesService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2040
- HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: { cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", activeRangeEnd: "activeRangeEnd", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectionRange: "selectionRange", selectedDates: "selectedDates", views: "views", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", orientation: "orientation", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave", activeDateChange: "activeDateChange" }, host: { properties: { "class.k-calendar-view": "this.getComponentClass", "class.k-align-items-start": "this.getComponentClass", "class.k-justify-content-center": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass" } }, usesOnChanges: true, ngImport: i0, template: `
2122
+ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: { cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", activeRangeEnd: "activeRangeEnd", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectionRange: "selectionRange", selectedDates: "selectedDates", views: "views", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", orientation: "orientation", activeDescendant: "activeDescendant", tabIndex: "tabIndex", disabled: "disabled", id: "id", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", cellEnter: "cellEnter", cellLeave: "cellLeave", activeDateChange: "activeDateChange", focusCalendar: "focusCalendar", blurCalendar: "blurCalendar", focusedCellChange: "focusedCellChange" }, host: { listeners: { "focus": "handleFocus()" }, properties: { "class.k-calendar-view": "this.getComponentClass", "class.k-align-items-start": "this.getComponentClass", "class.k-justify-content-center": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass" } }, usesOnChanges: true, ngImport: i0, template: `
2041
2123
  <ng-template #tableTemplate let-date="date" let-class="className">
2042
2124
  <table
2043
2125
  role="grid"
2044
2126
  class="k-content k-calendar-table"
2045
2127
  [ngClass]="class"
2128
+ [attr.aria-labelledby]="id"
2129
+ [attr.aria-activedescendant]="getActiveDescendant"
2130
+ [attr.tabindex]="getTabIndex"
2131
+ (focus)="focusCalendar.emit()"
2132
+ (focusout)="blurCalendar.emit($event)"
2046
2133
  >
2047
2134
  <caption *ngIf="showViewHeader" [ngClass]="getCaptionClass()">{{ getCaptionTitle(date) }}</caption>
2048
- <thead *ngIf="isMonthView()" class="k-calendar-thead">
2135
+ <thead *ngIf="isMonthView()" class="k-calendar-thead" role="rowgroup">
2049
2136
  <tr class="k-calendar-tr" role="row">
2050
- <th *ngFor="let name of weekNames" class="k-calendar-th">{{name}}</th>
2137
+ <th *ngFor="let name of weekNames; let i = index;"
2138
+ class="k-calendar-th"
2139
+ scope="col"
2140
+ [attr.aria-label]="wideWeekNames[i]"
2141
+ role="columnheader"
2142
+ >{{name}}</th>
2051
2143
  </tr>
2052
2144
  </thead>
2053
2145
  <tbody
@@ -2072,6 +2164,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
2072
2164
  (weekNumberCellClick)="weekNumberCellClick.emit($event)"
2073
2165
  (cellEnter)="cellEnter.emit($event)"
2074
2166
  (cellLeave)="cellLeave.emit($event)"
2167
+ (focusedCellId)="focusedCellChange.emit($event)"
2075
2168
  >
2076
2169
  </tbody>
2077
2170
  </table>
@@ -2107,7 +2200,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
2107
2200
  }"
2108
2201
  >
2109
2202
  </ng-template>
2110
- `, isInline: true, components: [{ type: ViewComponent, selector: "[kendoCalendarView]", inputs: ["direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2203
+ `, isInline: true, components: [{ type: ViewComponent, selector: "[kendoCalendarView]", inputs: ["direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "focusedCellId"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2111
2204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HorizontalViewListComponent, decorators: [{
2112
2205
  type: Component,
2113
2206
  args: [{
@@ -2119,11 +2212,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2119
2212
  role="grid"
2120
2213
  class="k-content k-calendar-table"
2121
2214
  [ngClass]="class"
2215
+ [attr.aria-labelledby]="id"
2216
+ [attr.aria-activedescendant]="getActiveDescendant"
2217
+ [attr.tabindex]="getTabIndex"
2218
+ (focus)="focusCalendar.emit()"
2219
+ (focusout)="blurCalendar.emit($event)"
2122
2220
  >
2123
2221
  <caption *ngIf="showViewHeader" [ngClass]="getCaptionClass()">{{ getCaptionTitle(date) }}</caption>
2124
- <thead *ngIf="isMonthView()" class="k-calendar-thead">
2222
+ <thead *ngIf="isMonthView()" class="k-calendar-thead" role="rowgroup">
2125
2223
  <tr class="k-calendar-tr" role="row">
2126
- <th *ngFor="let name of weekNames" class="k-calendar-th">{{name}}</th>
2224
+ <th *ngFor="let name of weekNames; let i = index;"
2225
+ class="k-calendar-th"
2226
+ scope="col"
2227
+ [attr.aria-label]="wideWeekNames[i]"
2228
+ role="columnheader"
2229
+ >{{name}}</th>
2127
2230
  </tr>
2128
2231
  </thead>
2129
2232
  <tbody
@@ -2148,6 +2251,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2148
2251
  (weekNumberCellClick)="weekNumberCellClick.emit($event)"
2149
2252
  (cellEnter)="cellEnter.emit($event)"
2150
2253
  (cellLeave)="cellLeave.emit($event)"
2254
+ (focusedCellId)="focusedCellChange.emit($event)"
2151
2255
  >
2152
2256
  </tbody>
2153
2257
  </table>
@@ -2185,7 +2289,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2185
2289
  </ng-template>
2186
2290
  `
2187
2291
  }]
2188
- }], ctorParameters: function () { return [{ type: BusViewService }, { type: i1.IntlService }, { type: WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { cellTemplateRef: [{
2292
+ }], ctorParameters: function () { return [{ type: BusViewService }, { type: i1.IntlService }, { type: WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { handleFocus: [{
2293
+ type: HostListener,
2294
+ args: ["focus"]
2295
+ }], cellTemplateRef: [{
2189
2296
  type: Input
2190
2297
  }], weekNumberTemplateRef: [{
2191
2298
  type: Input
@@ -2215,6 +2322,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2215
2322
  type: Input
2216
2323
  }], orientation: [{
2217
2324
  type: Input
2325
+ }], activeDescendant: [{
2326
+ type: Input
2327
+ }], tabIndex: [{
2328
+ type: Input
2329
+ }], disabled: [{
2330
+ type: Input
2331
+ }], id: [{
2332
+ type: Input
2218
2333
  }], weekNumber: [{
2219
2334
  type: Input
2220
2335
  }], cellClick: [{
@@ -2227,6 +2342,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2227
2342
  type: Output
2228
2343
  }], activeDateChange: [{
2229
2344
  type: Output
2345
+ }], focusCalendar: [{
2346
+ type: Output
2347
+ }], blurCalendar: [{
2348
+ type: Output
2349
+ }], focusedCellChange: [{
2350
+ type: Output
2230
2351
  }], getComponentClass: [{
2231
2352
  type: HostBinding,
2232
2353
  args: ["class.k-calendar-view"]
@@ -2299,6 +2420,7 @@ class HeaderComponent {
2299
2420
  }
2300
2421
  this.activeViewValue = CalendarViewEnum[this.activeView];
2301
2422
  this.todayMessage = this.localization.get('today');
2423
+ this.parentViewButtonTitle = this.localization.get('parentViewButtonTitle');
2302
2424
  this.setTodayAvailability();
2303
2425
  this.navigate = this.bus.canMoveUp(this.activeView);
2304
2426
  this.title = this.getTitle();
@@ -2319,6 +2441,9 @@ class HeaderComponent {
2319
2441
  }
2320
2442
  this.bus.moveUp(this.activeView);
2321
2443
  }
2444
+ isDisabled() {
2445
+ return this.navigate ? null : '';
2446
+ }
2322
2447
  intlChange() {
2323
2448
  if (this.currentDate && this.bus.service(this.activeView)) {
2324
2449
  this.title = this.getTitle();
@@ -2328,6 +2453,7 @@ class HeaderComponent {
2328
2453
  l10nChange() {
2329
2454
  this.prevButtonTitle = this.localization.get('prevButtonTitle');
2330
2455
  this.nextButtonTitle = this.localization.get('nextButtonTitle');
2456
+ this.parentViewButtonTitle = this.localization.get('parentViewButtonTitle');
2331
2457
  this.todayMessage = this.localization.get('today');
2332
2458
  this.cdr.markForCheck();
2333
2459
  }
@@ -2353,11 +2479,17 @@ class HeaderComponent {
2353
2479
  }
2354
2480
  }
2355
2481
  HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeaderComponent, deps: [{ token: BusViewService }, { token: i0.ChangeDetectorRef }, { token: i1$1.LocalizationService }, { token: i1.IntlService }, { token: DisabledDatesService }], target: i0.ɵɵFactoryTarget.Component });
2356
- HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: HeaderComponent, selector: "kendo-calendar-header", inputs: { activeView: "activeView", currentDate: "currentDate", min: "min", max: "max", rangeLength: "rangeLength", templateRef: "templateRef", isPrevDisabled: "isPrevDisabled", isNextDisabled: "isNextDisabled", showNavigationButtons: "showNavigationButtons", orientation: "orientation" }, outputs: { todayButtonClick: "todayButtonClick", prevButtonClick: "prevButtonClick", nextButtonClick: "nextButtonClick" }, host: { properties: { "class.k-calendar-header": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass" } }, usesOnChanges: true, ngImport: i0, template: `
2357
- <span class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title" [class.k-disabled]="!navigate"
2482
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: HeaderComponent, selector: "kendo-calendar-header", inputs: { activeView: "activeView", currentDate: "currentDate", min: "min", max: "max", rangeLength: "rangeLength", templateRef: "templateRef", isPrevDisabled: "isPrevDisabled", isNextDisabled: "isNextDisabled", showNavigationButtons: "showNavigationButtons", orientation: "orientation", id: "id" }, outputs: { todayButtonClick: "todayButtonClick", prevButtonClick: "prevButtonClick", nextButtonClick: "nextButtonClick" }, host: { properties: { "class.k-calendar-header": "this.getComponentClass", "class.k-hstack": "this.horizontalHostClass", "class.k-vstack": "this.verticalHostClass" } }, usesOnChanges: true, ngImport: i0, template: `
2483
+ <span class="k-button k-nav-fast k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title"
2484
+ role="button"
2485
+ [id]="id"
2486
+ tabindex="-1"
2487
+ [class.k-disabled]="!navigate"
2488
+ [attr.aria-disabled]="isDisabled()"
2358
2489
  [kendoEventsOutsideAngular]="{
2359
2490
  click: handleNavigation
2360
2491
  }"
2492
+ [title]="parentViewButtonTitle"
2361
2493
  [scope]="this">
2362
2494
  <ng-template [ngIf]="!templateRef">{{title}}</ng-template>
2363
2495
  <ng-template
@@ -2371,6 +2503,7 @@ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
2371
2503
  <button
2372
2504
  *ngIf="showNavigationButtons"
2373
2505
  class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-calendar-nav-prev"
2506
+ tabindex="-1"
2374
2507
  type="button"
2375
2508
  [attr.aria-disabled]="isPrevDisabled"
2376
2509
  [disabled]="isPrevDisabled"
@@ -2381,17 +2514,20 @@ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
2381
2514
  </button>
2382
2515
  <span
2383
2516
  class="k-today k-calendar-nav-today"
2517
+ tabindex="-1"
2384
2518
  [class.k-disabled]="!todayAvailable"
2385
2519
  [kendoEventsOutsideAngular]="{
2386
2520
  click: handleTodayClick
2387
2521
  }"
2388
2522
  [scope]="this"
2523
+ role="link"
2389
2524
  >
2390
2525
  {{ todayMessage }}
2391
2526
  </span>
2392
2527
  <button
2393
2528
  *ngIf="showNavigationButtons"
2394
2529
  class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-calendar-nav-next"
2530
+ tabindex="-1"
2395
2531
  type="button"
2396
2532
  [attr.aria-disabled]="isNextDisabled"
2397
2533
  [disabled]="isNextDisabled"
@@ -2407,10 +2543,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2407
2543
  args: [{
2408
2544
  selector: 'kendo-calendar-header',
2409
2545
  template: `
2410
- <span class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title" [class.k-disabled]="!navigate"
2546
+ <span class="k-button k-nav-fast k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title"
2547
+ role="button"
2548
+ [id]="id"
2549
+ tabindex="-1"
2550
+ [class.k-disabled]="!navigate"
2551
+ [attr.aria-disabled]="isDisabled()"
2411
2552
  [kendoEventsOutsideAngular]="{
2412
2553
  click: handleNavigation
2413
2554
  }"
2555
+ [title]="parentViewButtonTitle"
2414
2556
  [scope]="this">
2415
2557
  <ng-template [ngIf]="!templateRef">{{title}}</ng-template>
2416
2558
  <ng-template
@@ -2424,6 +2566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2424
2566
  <button
2425
2567
  *ngIf="showNavigationButtons"
2426
2568
  class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-calendar-nav-prev"
2569
+ tabindex="-1"
2427
2570
  type="button"
2428
2571
  [attr.aria-disabled]="isPrevDisabled"
2429
2572
  [disabled]="isPrevDisabled"
@@ -2434,17 +2577,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2434
2577
  </button>
2435
2578
  <span
2436
2579
  class="k-today k-calendar-nav-today"
2580
+ tabindex="-1"
2437
2581
  [class.k-disabled]="!todayAvailable"
2438
2582
  [kendoEventsOutsideAngular]="{
2439
2583
  click: handleTodayClick
2440
2584
  }"
2441
2585
  [scope]="this"
2586
+ role="link"
2442
2587
  >
2443
2588
  {{ todayMessage }}
2444
2589
  </span>
2445
2590
  <button
2446
2591
  *ngIf="showNavigationButtons"
2447
2592
  class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-calendar-nav-next"
2593
+ tabindex="-1"
2448
2594
  type="button"
2449
2595
  [attr.aria-disabled]="isNextDisabled"
2450
2596
  [disabled]="isNextDisabled"
@@ -2476,6 +2622,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2476
2622
  type: Input
2477
2623
  }], orientation: [{
2478
2624
  type: Input
2625
+ }], id: [{
2626
+ type: Input
2479
2627
  }], todayButtonClick: [{
2480
2628
  type: Output
2481
2629
  }], prevButtonClick: [{
@@ -2493,51 +2641,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2493
2641
  args: ["class.k-vstack"]
2494
2642
  }] } });
2495
2643
 
2496
- const KEY_TO_ACTION = {
2497
- '33': Action.PrevView,
2498
- '34': Action.NextView,
2499
- '35': Action.LastInView,
2500
- '36': Action.FirstInView,
2501
- '37': Action.Left,
2502
- '38': Action.Up,
2503
- '39': Action.Right,
2504
- '40': Action.Down,
2505
- 'meta+38': Action.UpperView,
2506
- 'meta+40': Action.LowerView
2507
- };
2508
- /**
2509
- * @hidden
2510
- */
2511
- class NavigationService {
2512
- constructor(bus) {
2513
- this.bus = bus;
2514
- }
2515
- action(event) {
2516
- const action = `${event.ctrlKey || event.metaKey ? 'meta+' : ''}${event.keyCode}`;
2517
- return KEY_TO_ACTION[action];
2518
- }
2519
- move(value, action, activeView) {
2520
- const service = this.bus.service(activeView);
2521
- if (!service) {
2522
- return value;
2523
- }
2524
- if (action === Action.UpperView && this.bus.canMoveUp(activeView)) {
2525
- this.bus.moveUp(activeView);
2526
- return value;
2527
- }
2528
- if (action === Action.LowerView && this.bus.canMoveDown(activeView)) {
2529
- this.bus.moveDown(activeView);
2530
- return value;
2531
- }
2532
- return service.move(value, action);
2533
- }
2534
- }
2535
- NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, deps: [{ token: BusViewService }], target: i0.ɵɵFactoryTarget.Injectable });
2536
- NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService });
2537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, decorators: [{
2538
- type: Injectable
2539
- }], ctorParameters: function () { return [{ type: BusViewService }]; } });
2540
-
2541
2644
  /**
2542
2645
  * @hidden
2543
2646
  */
@@ -2562,6 +2665,10 @@ class SelectionService {
2562
2665
  const [start, end] = sortDates([rangePivot || date, date]);
2563
2666
  selectedDates = this.bus.service(activeViewEnum).dateRange(start, end);
2564
2667
  rangePivot = date > selectedDates[0] ? selectedDates[0] : last(selectedDates);
2668
+ if (modifiers.anyArrow) {
2669
+ const [start, end] = sortDates([this.lastClicked || date, date]);
2670
+ selectedDates = this.bus.service(0).dateRange(start, end);
2671
+ }
2565
2672
  }
2566
2673
  else {
2567
2674
  selectedDates = [date];
@@ -2918,13 +3025,58 @@ const disabledDatesRangeValidator = (isDateDisabled) => {
2918
3025
  };
2919
3026
  };
2920
3027
 
3028
+ const KEY_TO_ACTION = {
3029
+ '33': Action.PrevView,
3030
+ '34': Action.NextView,
3031
+ '35': Action.LastInView,
3032
+ '36': Action.FirstInView,
3033
+ '37': Action.Left,
3034
+ '38': Action.Up,
3035
+ '39': Action.Right,
3036
+ '40': Action.Down,
3037
+ 'meta+38': Action.UpperView,
3038
+ 'meta+40': Action.LowerView
3039
+ };
3040
+ /**
3041
+ * @hidden
3042
+ */
3043
+ class NavigationService {
3044
+ constructor(bus) {
3045
+ this.bus = bus;
3046
+ }
3047
+ action(event) {
3048
+ const action = `${event.ctrlKey || event.metaKey ? 'meta+' : ''}${event.keyCode}`;
3049
+ return KEY_TO_ACTION[action];
3050
+ }
3051
+ move(value, action, activeView) {
3052
+ const service = this.bus.service(activeView);
3053
+ if (!service) {
3054
+ return value;
3055
+ }
3056
+ if (action === Action.UpperView && this.bus.canMoveUp(activeView)) {
3057
+ this.bus.moveUp(activeView);
3058
+ return value;
3059
+ }
3060
+ if (action === Action.LowerView && this.bus.canMoveDown(activeView)) {
3061
+ this.bus.moveDown(activeView);
3062
+ return value;
3063
+ }
3064
+ return service.move(value, action);
3065
+ }
3066
+ }
3067
+ NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, deps: [{ token: BusViewService }], target: i0.ɵɵFactoryTarget.Injectable });
3068
+ NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService });
3069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, decorators: [{
3070
+ type: Injectable
3071
+ }], ctorParameters: function () { return [{ type: BusViewService }]; } });
3072
+
2921
3073
  /**
2922
3074
  * @hidden
2923
3075
  */
2924
3076
  class Messages$1 extends ComponentMessages {
2925
3077
  }
2926
3078
  Messages$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages$1, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2927
- Messages$1.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages$1, selector: "kendo-multiview-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle" }, usesInheritance: true, ngImport: i0 });
3079
+ Messages$1.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages$1, selector: "kendo-multiview-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle", parentViewButtonTitle: "parentViewButtonTitle" }, usesInheritance: true, ngImport: i0 });
2928
3080
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages$1, decorators: [{
2929
3081
  type: Directive,
2930
3082
  args: [{
@@ -2937,6 +3089,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2937
3089
  type: Input
2938
3090
  }], nextButtonTitle: [{
2939
3091
  type: Input
3092
+ }], parentViewButtonTitle: [{
3093
+ type: Input
2940
3094
  }] } });
2941
3095
 
2942
3096
  /**
@@ -3013,10 +3167,6 @@ class MultiViewCalendarComponent {
3013
3167
  this.zone = zone;
3014
3168
  this.disabledDatesService = disabledDatesService;
3015
3169
  this.selectionService = selectionService;
3016
- /**
3017
- * @hidden
3018
- */
3019
- this.id = guid();
3020
3170
  /**
3021
3171
  * Determines whether the built-in min or max validators are enforced when validating a form.
3022
3172
  */
@@ -3052,10 +3202,6 @@ class MultiViewCalendarComponent {
3052
3202
  * @hidden
3053
3203
  */
3054
3204
  this.isActive = false;
3055
- /**
3056
- * @hidden
3057
- */
3058
- this.isHeaderActive = false;
3059
3205
  /**
3060
3206
  * Defines the active view that the Calendar initially renders
3061
3207
  * ([see example]({% slug activeview_multiviewcalendar %})).
@@ -3132,6 +3278,10 @@ class MultiViewCalendarComponent {
3132
3278
  * @hidden
3133
3279
  */
3134
3280
  this.blurEvent = new EventEmitter();
3281
+ /**
3282
+ * @hidden
3283
+ */
3284
+ this.focusCalendar = new EventEmitter();
3135
3285
  this.cellUID = guid();
3136
3286
  this.isHovered = false;
3137
3287
  this.isPrevDisabled = true;
@@ -3151,6 +3301,7 @@ class MultiViewCalendarComponent {
3151
3301
  this.disabledDatesRangeValidateFn = noop$2;
3152
3302
  this.subscriptions = new Subscription();
3153
3303
  this.setClasses(element.nativeElement);
3304
+ this.id = `kendo-multiviewcalendarid-${this.bus.calendarId}-`;
3154
3305
  }
3155
3306
  /**
3156
3307
  * Sets or gets the `focusedDate` property of the Calendar and
@@ -3165,6 +3316,24 @@ class MultiViewCalendarComponent {
3165
3316
  get focusedDate() {
3166
3317
  return this._focusedDate;
3167
3318
  }
3319
+ /**
3320
+ * @hidden
3321
+ */
3322
+ get headerId() {
3323
+ return this.id + 'header-';
3324
+ }
3325
+ /**
3326
+ * @hidden
3327
+ */
3328
+ get multiViewCalendarHeaderIdLabel() {
3329
+ return this.views === 2 ? this.id + 'header-' : null;
3330
+ }
3331
+ /**
3332
+ * @hidden
3333
+ */
3334
+ get calendarHeaderIdLabel() {
3335
+ return this.views === 1 ? this.id + 'header-' : null;
3336
+ }
3168
3337
  /**
3169
3338
  * Sets or gets the `min` property of the Calendar and
3170
3339
  * defines the minimum allowed date value.
@@ -3335,14 +3504,14 @@ class MultiViewCalendarComponent {
3335
3504
  return CalendarViewEnum[this.topView];
3336
3505
  }
3337
3506
  get widgetId() {
3338
- return this.id;
3339
- }
3340
- get calendarTabIndex() {
3341
- return this.disabled ? undefined : this.tabIndex;
3507
+ return this.views === 2 ? this.id : null;
3342
3508
  }
3343
3509
  get ariaDisabled() {
3344
3510
  return this.disabled;
3345
3511
  }
3512
+ /**
3513
+ * @hidden
3514
+ */
3346
3515
  get ariaActivedescendant() {
3347
3516
  return this.cellUID + this.focusedDate.getTime();
3348
3517
  }
@@ -3357,14 +3526,13 @@ class MultiViewCalendarComponent {
3357
3526
  }
3358
3527
  this.isActive = false;
3359
3528
  this.isHovered = false; //ensure that hovered is also not active
3360
- this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
3361
3529
  }
3362
3530
  /**
3363
3531
  * @hidden
3364
3532
  */
3365
3533
  handleFocus() {
3366
3534
  this.isActive = true;
3367
- this.isHeaderActive = false;
3535
+ this.focusCalendar.emit();
3368
3536
  }
3369
3537
  /**
3370
3538
  * @hidden
@@ -3397,10 +3565,27 @@ class MultiViewCalendarComponent {
3397
3565
  * @hidden
3398
3566
  */
3399
3567
  keydown(event) {
3400
- if (this.isHeaderActive) {
3568
+ const onArrowRightAndControl = event.keyCode === Keys$1.ArrowRight && (event.ctrlKey || event.metaKey);
3569
+ const onArrowLeftAndControl = event.keyCode === Keys$1.ArrowLeft && (event.ctrlKey || event.metaKey);
3570
+ const onTKeyPress = event.keyCode === Keys$1.KeyT;
3571
+ const onEnterKeyPress = event.keyCode === Keys$1.Enter;
3572
+ if (onArrowRightAndControl) {
3573
+ event.preventDefault();
3574
+ this.navigateView(this.nextView);
3575
+ return;
3576
+ }
3577
+ else if (onArrowLeftAndControl) {
3578
+ event.preventDefault();
3579
+ this.navigateView(this.prevView);
3401
3580
  return;
3402
3581
  }
3403
- if (event.keyCode === Keys.Enter) {
3582
+ else if (onTKeyPress) {
3583
+ this.focusedDate = getToday();
3584
+ this.bus.moveToBottom(this.activeViewEnum);
3585
+ return;
3586
+ }
3587
+ else if (onEnterKeyPress) {
3588
+ this.selectionService.lastClicked = this.focusedDate;
3404
3589
  this.performSelection(this.focusedDate, event);
3405
3590
  }
3406
3591
  const candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
@@ -3413,6 +3598,10 @@ class MultiViewCalendarComponent {
3413
3598
  if (!isSameView) {
3414
3599
  this.emitNavigate(this.focusedDate);
3415
3600
  }
3601
+ if (isArrowWithShiftPressed(event)) {
3602
+ event['anyArrow'] = true;
3603
+ this.performSelection(this.focusedDate, event);
3604
+ }
3416
3605
  }
3417
3606
  ngOnInit() {
3418
3607
  this.subscriptions.add(this.bus.viewChanged.subscribe(({ view }) => {
@@ -3464,7 +3653,7 @@ class MultiViewCalendarComponent {
3464
3653
  if (!this.element) {
3465
3654
  return;
3466
3655
  }
3467
- this.element.nativeElement.focus();
3656
+ this.element.nativeElement.querySelector('.k-calendar-view').focus();
3468
3657
  }
3469
3658
  /**
3470
3659
  * Blurs the Calendar component.
@@ -3473,13 +3662,9 @@ class MultiViewCalendarComponent {
3473
3662
  if (!this.element) {
3474
3663
  return;
3475
3664
  }
3476
- this.element.nativeElement.blur();
3477
- }
3478
- /**
3479
- * @hidden
3480
- */
3481
- handleHeaderFocus() {
3482
- this.isHeaderActive = true;
3665
+ const activeElement = this.views === 2 ? this.element.nativeElement.querySelector('.k-calendar-view') :
3666
+ this.element.nativeElement.querySelector('.k-content.k-calendar-table');
3667
+ activeElement.blur();
3483
3668
  }
3484
3669
  /**
3485
3670
  * @hidden
@@ -3608,6 +3793,7 @@ class MultiViewCalendarComponent {
3608
3793
  * @hidden
3609
3794
  */
3610
3795
  handleCellClick({ date, modifiers }) {
3796
+ this.selectionService.lastClicked = date;
3611
3797
  this.performSelection(date, modifiers);
3612
3798
  const isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
3613
3799
  if (!isSameView) {
@@ -3631,6 +3817,7 @@ class MultiViewCalendarComponent {
3631
3817
  setClasses(element) {
3632
3818
  this.renderer.addClass(element, 'k-widget');
3633
3819
  this.renderer.addClass(element, 'k-calendar');
3820
+ this.renderer.addClass(element, 'k-calendar-md');
3634
3821
  this.renderer.addClass(element, 'k-calendar-range');
3635
3822
  }
3636
3823
  verifyChanges() {
@@ -3686,7 +3873,7 @@ class MultiViewCalendarComponent {
3686
3873
  }
3687
3874
  }
3688
3875
  MultiViewCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiViewCalendarComponent, deps: [{ token: BusViewService }, { token: i0.ElementRef }, { token: NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: DisabledDatesService }, { token: SelectionService }], target: i0.ɵɵFactoryTarget.Component });
3689
- MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: { id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", disabledDatesRangeValidation: "disabledDatesRangeValidation", selection: "selection", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", isActive: "isActive", disabledDates: "disabledDates", activeView: "activeView", bottomView: "bottomView", topView: "topView", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", weekNumber: "weekNumber", activeRangeEnd: "activeRangeEnd", selectionRange: "selectionRange", views: "views", orientation: "orientation", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"] }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", cellEnter: "cellEnter", cellLeave: "cellLeave", valueChange: "valueChange", blurEvent: "blur" }, host: { listeners: { "focusout": "handleFocusout($event)", "focus": "handleFocus()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()", "mousedown": "handleMousedown($event)", "click": "handleClick()", "keydown": "keydown($event)" }, properties: { "attr.id": "this.widgetId", "attr.tabindex": "this.calendarTabIndex", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled", "attr.aria-activedescendant": "this.ariaActivedescendant" } }, providers: [
3876
+ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: { id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", disabledDatesRangeValidation: "disabledDatesRangeValidation", selection: "selection", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", isActive: "isActive", disabledDates: "disabledDates", activeView: "activeView", bottomView: "bottomView", topView: "topView", showViewHeader: "showViewHeader", animateNavigation: "animateNavigation", weekNumber: "weekNumber", activeRangeEnd: "activeRangeEnd", selectionRange: "selectionRange", views: "views", orientation: "orientation", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"] }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", cellEnter: "cellEnter", cellLeave: "cellLeave", valueChange: "valueChange", blurEvent: "blur", focusCalendar: "focusCalendar" }, host: { listeners: { "focusout": "handleFocusout($event)", "focus": "handleFocus()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()", "mousedown": "handleMousedown($event)", "click": "handleClick()", "keydown": "keydown($event)" }, properties: { "attr.id": "this.widgetId", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled" } }, providers: [
3690
3877
  BusViewService,
3691
3878
  RANGE_CALENDAR_VALUE_ACCESSOR,
3692
3879
  RANGE_CALENDAR_RANGE_VALIDATORS,
@@ -3708,6 +3895,9 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
3708
3895
 
3709
3896
  i18n-nextButtonTitle="kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar"
3710
3897
  nextButtonTitle="Navigate to next view"
3898
+
3899
+ i18n-parentViewButtonTitle="kendo.multiviewcalendar.parentViewButtonTitle|The title of the parent view button in the Multiview calendar header"
3900
+ parentViewButtonTitle="Navigate to parent view"
3711
3901
  >
3712
3902
  </ng-container>
3713
3903
  <kendo-calendar-header
@@ -3715,6 +3905,7 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
3715
3905
  [currentDate]="activeDate"
3716
3906
  [min]="min"
3717
3907
  [max]="max"
3908
+ [id]="headerId"
3718
3909
  [rangeLength]="views"
3719
3910
  [templateRef]="headerTitleTemplateRef?.templateRef"
3720
3911
  [isPrevDisabled]="isPrevDisabled"
@@ -3724,15 +3915,14 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
3724
3915
  (todayButtonClick)="handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })"
3725
3916
  (prevButtonClick)="navigateView(prevView)"
3726
3917
  (nextButtonClick)="navigateView(nextView)"
3727
- [kendoEventsOutsideAngular]="{
3728
- focusin: handleHeaderFocus
3729
- }"
3730
- [scope]="this"
3731
3918
  >
3732
3919
  </kendo-calendar-header>
3733
3920
  <kendo-calendar-horizontal
3921
+ [id]="calendarHeaderIdLabel"
3922
+ [attr.aria-labelledby]="multiViewCalendarHeaderIdLabel"
3734
3923
  [activeView]="activeViewEnum"
3735
- [isActive]="isActive || (isHovered && !isHeaderActive)"
3924
+ [activeDescendant]="ariaActivedescendant"
3925
+ [isActive]="isActive || isHovered"
3736
3926
  [cellTemplateRef]="activeCellTemplate()?.templateRef"
3737
3927
  [weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
3738
3928
  [cellUID]="cellUID"
@@ -3747,14 +3937,18 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
3747
3937
  [selectionRange]="selectionRange"
3748
3938
  [selectedDates]="selectedDates"
3749
3939
  [orientation]="orientation"
3940
+ [tabIndex]="tabIndex"
3941
+ [disabled]="disabled"
3750
3942
  (cellClick)="handleCellClick($event)"
3751
3943
  (weekNumberCellClick)="handleWeekNumberClick($event)"
3752
3944
  (cellEnter)="emitCellEvent(cellEnter, $event)"
3753
3945
  (cellLeave)="emitCellEvent(cellLeave, $event)"
3754
3946
  (activeDateChange)="setActiveDate($event)"
3947
+ (focusCalendar)="handleFocus()"
3948
+ (blurCalendar)="handleFocusout($event)"
3755
3949
  >
3756
3950
  </kendo-calendar-horizontal>
3757
- `, isInline: true, components: [{ type: HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: ["cellTemplateRef", "weekNumberTemplateRef", "activeRangeEnd", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectionRange", "selectedDates", "views", "showViewHeader", "animateNavigation", "orientation", "weekNumber"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "activeDateChange"] }], directives: [{ type: MultiViewCalendarLocalizedMessagesDirective, selector: "[kendoMultiViewCalendarLocalizedMessages]" }, { type: i5.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3951
+ `, isInline: true, components: [{ type: HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation", "id"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: HorizontalViewListComponent, selector: "kendo-calendar-horizontal", inputs: ["cellTemplateRef", "weekNumberTemplateRef", "activeRangeEnd", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectionRange", "selectedDates", "views", "showViewHeader", "animateNavigation", "orientation", "activeDescendant", "tabIndex", "disabled", "id", "weekNumber"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "activeDateChange", "focusCalendar", "blurCalendar", "focusedCellChange"] }], directives: [{ type: MultiViewCalendarLocalizedMessagesDirective, selector: "[kendoMultiViewCalendarLocalizedMessages]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3758
3952
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiViewCalendarComponent, decorators: [{
3759
3953
  type: Component,
3760
3954
  args: [{
@@ -3784,6 +3978,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3784
3978
 
3785
3979
  i18n-nextButtonTitle="kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar"
3786
3980
  nextButtonTitle="Navigate to next view"
3981
+
3982
+ i18n-parentViewButtonTitle="kendo.multiviewcalendar.parentViewButtonTitle|The title of the parent view button in the Multiview calendar header"
3983
+ parentViewButtonTitle="Navigate to parent view"
3787
3984
  >
3788
3985
  </ng-container>
3789
3986
  <kendo-calendar-header
@@ -3791,6 +3988,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3791
3988
  [currentDate]="activeDate"
3792
3989
  [min]="min"
3793
3990
  [max]="max"
3991
+ [id]="headerId"
3794
3992
  [rangeLength]="views"
3795
3993
  [templateRef]="headerTitleTemplateRef?.templateRef"
3796
3994
  [isPrevDisabled]="isPrevDisabled"
@@ -3800,15 +3998,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3800
3998
  (todayButtonClick)="handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })"
3801
3999
  (prevButtonClick)="navigateView(prevView)"
3802
4000
  (nextButtonClick)="navigateView(nextView)"
3803
- [kendoEventsOutsideAngular]="{
3804
- focusin: handleHeaderFocus
3805
- }"
3806
- [scope]="this"
3807
4001
  >
3808
4002
  </kendo-calendar-header>
3809
4003
  <kendo-calendar-horizontal
4004
+ [id]="calendarHeaderIdLabel"
4005
+ [attr.aria-labelledby]="multiViewCalendarHeaderIdLabel"
3810
4006
  [activeView]="activeViewEnum"
3811
- [isActive]="isActive || (isHovered && !isHeaderActive)"
4007
+ [activeDescendant]="ariaActivedescendant"
4008
+ [isActive]="isActive || isHovered"
3812
4009
  [cellTemplateRef]="activeCellTemplate()?.templateRef"
3813
4010
  [weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
3814
4011
  [cellUID]="cellUID"
@@ -3823,11 +4020,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3823
4020
  [selectionRange]="selectionRange"
3824
4021
  [selectedDates]="selectedDates"
3825
4022
  [orientation]="orientation"
4023
+ [tabIndex]="tabIndex"
4024
+ [disabled]="disabled"
3826
4025
  (cellClick)="handleCellClick($event)"
3827
4026
  (weekNumberCellClick)="handleWeekNumberClick($event)"
3828
4027
  (cellEnter)="emitCellEvent(cellEnter, $event)"
3829
4028
  (cellLeave)="emitCellEvent(cellLeave, $event)"
3830
4029
  (activeDateChange)="setActiveDate($event)"
4030
+ (focusCalendar)="handleFocus()"
4031
+ (blurCalendar)="handleFocusout($event)"
3831
4032
  >
3832
4033
  </kendo-calendar-horizontal>
3833
4034
  `
@@ -3891,6 +4092,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3891
4092
  }], blurEvent: [{
3892
4093
  type: Output,
3893
4094
  args: ['blur']
4095
+ }], focusCalendar: [{
4096
+ type: Output
3894
4097
  }], cellTemplate: [{
3895
4098
  type: ContentChild,
3896
4099
  args: [CellTemplateDirective, { static: false }]
@@ -3942,18 +4145,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3942
4145
  }], widgetId: [{
3943
4146
  type: HostBinding,
3944
4147
  args: ['attr.id']
3945
- }], calendarTabIndex: [{
3946
- type: HostBinding,
3947
- args: ['attr.tabindex']
3948
4148
  }], ariaDisabled: [{
3949
4149
  type: HostBinding,
3950
4150
  args: ['attr.aria-disabled']
3951
4151
  }, {
3952
4152
  type: HostBinding,
3953
4153
  args: ['class.k-disabled']
3954
- }], ariaActivedescendant: [{
3955
- type: HostBinding,
3956
- args: ['attr.aria-activedescendant']
3957
4154
  }], handleFocusout: [{
3958
4155
  type: HostListener,
3959
4156
  args: ['focusout', ['$event']]
@@ -4802,15 +4999,21 @@ class ViewListComponent {
4802
4999
  this.min = new Date(MIN_DATE);
4803
5000
  this.max = new Date(MAX_DATE);
4804
5001
  this.selectedDates = [];
5002
+ this.tabIndex = 0;
5003
+ this.disabled = false;
4805
5004
  this.cellClick = new EventEmitter();
4806
5005
  this.weekNumberCellClick = new EventEmitter();
4807
5006
  this.activeDateChange = new EventEmitter();
4808
5007
  this.todayButtonClick = new EventEmitter();
4809
5008
  this.pageChange = new EventEmitter();
5009
+ this.focusCalendar = new EventEmitter();
5010
+ this.blurCalendar = new EventEmitter();
5011
+ this.focusedCellChange = new EventEmitter();
4810
5012
  this.getComponentClass = true;
4811
5013
  this.dates = [];
4812
5014
  this.cols = [];
4813
5015
  this.weekNames = [];
5016
+ this.wideWeekNames = [];
4814
5017
  this.take = VIEWS_COUNT;
4815
5018
  this.animateToIndex = true;
4816
5019
  this.indexToScroll = -1;
@@ -4835,7 +5038,8 @@ class ViewListComponent {
4835
5038
  return this.activeView === CalendarViewEnum.century;
4836
5039
  }
4837
5040
  ngOnInit() {
4838
- this.weekNames = this.getWeekNames();
5041
+ this.weekNames = this.getWeekNames('short');
5042
+ this.wideWeekNames = this.getWeekNames('wide');
4839
5043
  this.bottomOffset = this.getBottomOffset();
4840
5044
  this.viewOffset = -1 * this.dom.headerHeight;
4841
5045
  this.viewHeight = this.dom.viewHeight(this.activeView);
@@ -4847,7 +5051,8 @@ class ViewListComponent {
4847
5051
  return;
4848
5052
  }
4849
5053
  this.cols = new Array(this.service.rowLength({ prependCell: this.weekNumber })).fill('');
4850
- this.weekNames = hasChange(changes, 'weekNumber') && this.weekNumber ? this.getWeekNames() : this.weekNames;
5054
+ this.weekNames = hasChange(changes, 'weekNumber') && this.weekNumber ? this.getWeekNames('short') : this.weekNames;
5055
+ this.wideWeekNames = hasChange(changes, 'weekNumber') && this.weekNumber ? this.getWeekNames('wide') : this.weekNames;
4851
5056
  const activeViewChanged = hasChange(changes, 'activeView');
4852
5057
  const focusedDate = this.focusedDate;
4853
5058
  const viewDate = dateInRange(this.service.viewDate(focusedDate, this.max, this.minViewsToRender), this.min, this.max);
@@ -4912,6 +5117,9 @@ class ViewListComponent {
4912
5117
  isScrolled() {
4913
5118
  return this.virtualization.isListScrolled(this.service.skip(this.focusedDate, this.min));
4914
5119
  }
5120
+ getTabIndex() {
5121
+ return this.disabled ? null : this.tabIndex;
5122
+ }
4915
5123
  getBottomOffset() {
4916
5124
  return this.getScrollableHeight() - this.dom.viewHeight(this.activeView);
4917
5125
  }
@@ -4923,23 +5131,25 @@ class ViewListComponent {
4923
5131
  getTake(skip) {
4924
5132
  return Math.min(this.total - skip, this.take);
4925
5133
  }
4926
- getWeekNames() {
4927
- const weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());
5134
+ getWeekNames(nameType) {
5135
+ const weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: nameType, type: 'days' }), this.intl.firstDay());
4928
5136
  return this.weekNumber ? [''].concat(weekNames) : weekNames;
4929
5137
  }
4930
5138
  intlChange() {
4931
- this.weekNames = this.getWeekNames();
5139
+ this.weekNames = this.getWeekNames('short');
5140
+ this.wideWeekNames = this.getWeekNames('wide');
4932
5141
  if (this.isMonthView()) {
4933
5142
  this.cdr.markForCheck();
4934
5143
  }
4935
5144
  }
4936
5145
  }
4937
5146
  ViewListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewListComponent, deps: [{ token: BusViewService }, { token: i0.ChangeDetectorRef }, { token: i1.IntlService }, { token: CalendarDOMService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
4938
- ViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ViewListComponent, selector: "kendo-calendar-viewlist", inputs: { cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", headerTitleTemplateRef: "headerTitleTemplateRef", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectedDates: "selectedDates", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", activeDateChange: "activeDateChange", todayButtonClick: "todayButtonClick", pageChange: "pageChange" }, host: { properties: { "class.k-vstack": "this.getComponentClass", "class.k-calendar-view": "this.getComponentClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass" } }, viewQueries: [{ propertyName: "virtualization", first: true, predicate: VirtualizationComponent, descendants: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
5147
+ ViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ViewListComponent, selector: "kendo-calendar-viewlist", inputs: { cellTemplateRef: "cellTemplateRef", weekNumberTemplateRef: "weekNumberTemplateRef", headerTitleTemplateRef: "headerTitleTemplateRef", activeView: "activeView", cellUID: "cellUID", focusedDate: "focusedDate", isActive: "isActive", min: "min", max: "max", selectedDates: "selectedDates", tabIndex: "tabIndex", disabled: "disabled", id: "id", weekNumber: "weekNumber" }, outputs: { cellClick: "cellClick", weekNumberCellClick: "weekNumberCellClick", activeDateChange: "activeDateChange", todayButtonClick: "todayButtonClick", pageChange: "pageChange", focusCalendar: "focusCalendar", blurCalendar: "blurCalendar", focusedCellChange: "focusedCellChange" }, host: { properties: { "class.k-vstack": "this.getComponentClass", "class.k-calendar-view": "this.getComponentClass", "class.k-calendar-monthview": "this.getComponentMonthClass", "class.k-calendar-yearview": "this.getComponentYearClass", "class.k-calendar-decadeview": "this.getComponentDecadeClass", "class.k-calendar-centuryview": "this.getComponentCenturyClass" } }, viewQueries: [{ propertyName: "virtualization", first: true, predicate: VirtualizationComponent, descendants: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
4939
5148
  <kendo-calendar-header
4940
5149
  [currentDate]="activeDate"
4941
5150
  [min]="min"
4942
5151
  [max]="max"
5152
+ [id]="id"
4943
5153
  [activeView]="activeView"
4944
5154
  [templateRef]="headerTitleTemplateRef"
4945
5155
  (todayButtonClick)="todayButtonClick.emit($event)"
@@ -4948,7 +5158,7 @@ ViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
4948
5158
  <table class="k-calendar-weekdays k-calendar-table" style="table-layout: auto;" *ngIf="isMonthView()">
4949
5159
  <thead class="k-calendar-thead">
4950
5160
  <tr class="k-calendar-tr">
4951
- <th class="k-calendar-th" *ngFor="let name of weekNames">{{name}}</th>
5161
+ <th class="k-calendar-th" *ngFor="let name of weekNames; let i = index;" scope="col" [attr.aria-label]="wideWeekNames[i]" role="columnheader">{{name}}</th>
4952
5162
  </tr>
4953
5163
  </thead>
4954
5164
  </table>
@@ -4970,6 +5180,10 @@ ViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
4970
5180
  #list
4971
5181
  role="grid"
4972
5182
  class="k-calendar-table"
5183
+ [attr.tabindex]="getTabIndex()"
5184
+ [attr.aria-labelledby]="id"
5185
+ (focus)="focusCalendar.emit()"
5186
+ (focusout)="blurCalendar.emit($event)"
4973
5187
  >
4974
5188
  <colgroup><col *ngFor="let _ of cols" /></colgroup>
4975
5189
 
@@ -4989,10 +5203,11 @@ ViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
4989
5203
  [viewDate]="date"
4990
5204
  (cellClick)="cellClick.emit($event)"
4991
5205
  (weekNumberCellClick)="weekNumberCellClick.emit($event)"
5206
+ (focusedCellId)="focusedCellChange.emit($event)"
4992
5207
  ></tbody>
4993
5208
  </table>
4994
5209
  </kendo-virtualization>
4995
- `, isInline: true, components: [{ type: HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: VirtualizationComponent, selector: "kendo-virtualization", inputs: ["direction", "itemHeight", "itemWidth", "topOffset", "bottomOffset", "maxScrollDifference", "scrollOffsetSize", "scrollDuration", "skip", "take", "total"], outputs: ["activeIndexChange", "pageChange", "scrollChange"] }, { type: ViewComponent, selector: "[kendoCalendarView]", inputs: ["direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5210
+ `, isInline: true, components: [{ type: HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation", "id"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: VirtualizationComponent, selector: "kendo-virtualization", inputs: ["direction", "itemHeight", "itemWidth", "topOffset", "bottomOffset", "maxScrollDifference", "scrollOffsetSize", "scrollDuration", "skip", "take", "total"], outputs: ["activeIndexChange", "pageChange", "scrollChange"] }, { type: ViewComponent, selector: "[kendoCalendarView]", inputs: ["direction", "isActive", "activeView", "cellUID", "focusedDate", "viewDate", "activeRangeEnd", "selectionRange", "min", "max", "selectedDates", "weekNumber", "viewIndex", "templateRef", "weekNumberTemplateRef"], outputs: ["cellClick", "weekNumberCellClick", "cellEnter", "cellLeave", "focusedCellId"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4996
5211
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewListComponent, decorators: [{
4997
5212
  type: Component,
4998
5213
  args: [{
@@ -5003,6 +5218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5003
5218
  [currentDate]="activeDate"
5004
5219
  [min]="min"
5005
5220
  [max]="max"
5221
+ [id]="id"
5006
5222
  [activeView]="activeView"
5007
5223
  [templateRef]="headerTitleTemplateRef"
5008
5224
  (todayButtonClick)="todayButtonClick.emit($event)"
@@ -5011,7 +5227,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5011
5227
  <table class="k-calendar-weekdays k-calendar-table" style="table-layout: auto;" *ngIf="isMonthView()">
5012
5228
  <thead class="k-calendar-thead">
5013
5229
  <tr class="k-calendar-tr">
5014
- <th class="k-calendar-th" *ngFor="let name of weekNames">{{name}}</th>
5230
+ <th class="k-calendar-th" *ngFor="let name of weekNames; let i = index;" scope="col" [attr.aria-label]="wideWeekNames[i]" role="columnheader">{{name}}</th>
5015
5231
  </tr>
5016
5232
  </thead>
5017
5233
  </table>
@@ -5033,6 +5249,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5033
5249
  #list
5034
5250
  role="grid"
5035
5251
  class="k-calendar-table"
5252
+ [attr.tabindex]="getTabIndex()"
5253
+ [attr.aria-labelledby]="id"
5254
+ (focus)="focusCalendar.emit()"
5255
+ (focusout)="blurCalendar.emit($event)"
5036
5256
  >
5037
5257
  <colgroup><col *ngFor="let _ of cols" /></colgroup>
5038
5258
 
@@ -5052,6 +5272,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5052
5272
  [viewDate]="date"
5053
5273
  (cellClick)="cellClick.emit($event)"
5054
5274
  (weekNumberCellClick)="weekNumberCellClick.emit($event)"
5275
+ (focusedCellId)="focusedCellChange.emit($event)"
5055
5276
  ></tbody>
5056
5277
  </table>
5057
5278
  </kendo-virtualization>
@@ -5077,6 +5298,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5077
5298
  type: Input
5078
5299
  }], selectedDates: [{
5079
5300
  type: Input
5301
+ }], tabIndex: [{
5302
+ type: Input
5303
+ }], disabled: [{
5304
+ type: Input
5305
+ }], id: [{
5306
+ type: Input
5080
5307
  }], weekNumber: [{
5081
5308
  type: Input
5082
5309
  }], cellClick: [{
@@ -5089,6 +5316,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5089
5316
  type: Output
5090
5317
  }], pageChange: [{
5091
5318
  type: Output
5319
+ }], focusCalendar: [{
5320
+ type: Output
5321
+ }], blurCalendar: [{
5322
+ type: Output
5323
+ }], focusedCellChange: [{
5324
+ type: Output
5092
5325
  }], virtualization: [{
5093
5326
  type: ViewChild,
5094
5327
  args: [VirtualizationComponent, { static: false }]
@@ -5279,7 +5512,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5279
5512
  class CalendarMessages extends ComponentMessages {
5280
5513
  }
5281
5514
  CalendarMessages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
5282
- CalendarMessages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: CalendarMessages, selector: "kendo-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle" }, usesInheritance: true, ngImport: i0 });
5515
+ CalendarMessages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: CalendarMessages, selector: "kendo-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle", parentViewButtonTitle: "parentViewButtonTitle" }, usesInheritance: true, ngImport: i0 });
5283
5516
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarMessages, decorators: [{
5284
5517
  type: Directive,
5285
5518
  args: [{
@@ -5292,6 +5525,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
5292
5525
  type: Input
5293
5526
  }], nextButtonTitle: [{
5294
5527
  type: Input
5528
+ }], parentViewButtonTitle: [{
5529
+ type: Input
5295
5530
  }] } });
5296
5531
 
5297
5532
  /**
@@ -5381,10 +5616,6 @@ class CalendarComponent {
5381
5616
  this.localization = localization;
5382
5617
  this.selectionService = selectionService;
5383
5618
  this.pickerService = pickerService;
5384
- /**
5385
- * @hidden
5386
- */
5387
- this.id = guid();
5388
5619
  /**
5389
5620
  * Determines whether the built-in min or max validators are enforced when validating a form.
5390
5621
  */
@@ -5487,6 +5718,7 @@ class CalendarComponent {
5487
5718
  this.resolvedPromise = Promise.resolve(null);
5488
5719
  this.destroyed = false;
5489
5720
  validatePackage(packageMetadata);
5721
+ this.id = `kendo-calendarid-${this.bus.calendarId}-`;
5490
5722
  this.setClasses(element.nativeElement);
5491
5723
  if (this.pickerService) {
5492
5724
  this.pickerService.calendar = this;
@@ -5511,6 +5743,12 @@ class CalendarComponent {
5511
5743
  this._focusedDate = focusedDate || getToday();
5512
5744
  this.setAriaActivedescendant();
5513
5745
  }
5746
+ /**
5747
+ * @hidden
5748
+ */
5749
+ get headerId() {
5750
+ return this.id + 'header-';
5751
+ }
5514
5752
  get focusedDate() {
5515
5753
  return this._focusedDate;
5516
5754
  }
@@ -5706,10 +5944,6 @@ class CalendarComponent {
5706
5944
  get widgetId() {
5707
5945
  return this.id;
5708
5946
  }
5709
- get calendarTabIndex() {
5710
- // in Classic mode, the inner MultiViewCalendar is the focusable element
5711
- return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
5712
- }
5713
5947
  get ariaDisabled() {
5714
5948
  // in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
5715
5949
  return this.type === 'classic' ? undefined : this.disabled;
@@ -5780,7 +6014,7 @@ class CalendarComponent {
5780
6014
  this.cdr.detectChanges();
5781
6015
  }
5782
6016
  /**
5783
- * Focuses the host element of the Calendar.
6017
+ * Focuses the Calendar by making the table.k-calendar-table element active.
5784
6018
  *
5785
6019
  * @example
5786
6020
  * ```ts
@@ -5795,19 +6029,18 @@ class CalendarComponent {
5795
6029
  * ```
5796
6030
  */
5797
6031
  focus() {
5798
- const focusTarget = this.type === 'infinite' ?
5799
- this.element && this.element.nativeElement :
5800
- this.multiViewCalendar;
5801
- if (isPresent(focusTarget)) {
5802
- focusTarget.focus();
5803
- }
6032
+ var _a, _b, _c;
6033
+ this.currentlyFocusedElement = this.type === 'infinite' ?
6034
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelector(selectors.infiniteCalendarTable) :
6035
+ this.currentlyFocusedElement = (_b = this.element) === null || _b === void 0 ? void 0 : _b.nativeElement.querySelector(selectors.multiViewCalendarTable);
6036
+ (_c = this.currentlyFocusedElement) === null || _c === void 0 ? void 0 : _c.focus();
5804
6037
  }
5805
6038
  /**
5806
6039
  * Blurs the Calendar component.
5807
6040
  */
5808
6041
  blur() {
5809
6042
  const blurTarget = this.type === 'infinite' ?
5810
- this.element && this.element.nativeElement :
6043
+ this.currentlyFocusedElement :
5811
6044
  this.multiViewCalendar;
5812
6045
  if (isPresent(blurTarget)) {
5813
6046
  blurTarget.blur();
@@ -5984,6 +6217,8 @@ class CalendarComponent {
5984
6217
  * @hidden
5985
6218
  */
5986
6219
  handleCellClick({ date, modifiers }) {
6220
+ this.focus();
6221
+ this.selectionService.lastClicked = date;
5987
6222
  this.performSelection(date, modifiers);
5988
6223
  }
5989
6224
  /**
@@ -6007,6 +6242,7 @@ class CalendarComponent {
6007
6242
  if (this.element.nativeElement.contains(args.relatedTarget)) {
6008
6243
  return;
6009
6244
  }
6245
+ ;
6010
6246
  this.isActive = false;
6011
6247
  // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
6012
6248
  // and enters the zone for no reason because the parent component is still untouched
@@ -6037,13 +6273,14 @@ class CalendarComponent {
6037
6273
  */
6038
6274
  handleMultiViewCalendarKeydown(args) {
6039
6275
  // Prevent form from submitting on enter if used in datepicker (classic view)
6040
- if (isPresent(this.pickerService) && args.keyCode === Keys.Enter) {
6276
+ if (isPresent(this.pickerService) && args.keyCode === Keys$1.Enter) {
6041
6277
  args.preventDefault();
6042
6278
  }
6043
6279
  }
6044
6280
  setClasses(element) {
6045
6281
  this.renderer.addClass(element, 'k-widget');
6046
6282
  this.renderer.addClass(element, 'k-calendar');
6283
+ this.renderer.addClass(element, 'k-calendar-md');
6047
6284
  this.renderer.addClass(element, `k-calendar-${this.type}`);
6048
6285
  }
6049
6286
  verifyChanges() {
@@ -6095,29 +6332,42 @@ class CalendarComponent {
6095
6332
  }
6096
6333
  }
6097
6334
  handleKeydown(args) {
6098
- const headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
6099
- if (headerActive) {
6100
- return;
6101
- }
6102
- // reserve the alt + arrow key commands for the picker
6103
- const arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
6104
- if (isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
6105
- return;
6106
- }
6107
- // Prevent form from submitting on enter if used in datepicker (infinite view)
6108
- if (isPresent(this.pickerService) && args.keyCode === Keys.Enter) {
6109
- args.preventDefault();
6110
- }
6111
- const candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(args), this.activeViewEnum), this.min, this.max);
6112
- if (!isEqual(this.focusedDate, candidate)) {
6113
- this.focusedDate = candidate;
6114
- this.detectChanges();
6115
- args.preventDefault();
6116
- }
6117
- if (args.keyCode === Keys.Enter) {
6118
- this.performSelection(this.focusedDate, args);
6335
+ if (this.type === 'infinite') {
6336
+ // reserve the alt + arrow key commands for the picker
6337
+ const arrowKeyPressed = [Keys$1.ArrowUp, Keys$1.ArrowRight, Keys$1.ArrowDown, Keys$1.ArrowLeft].indexOf(args.keyCode) !== -1;
6338
+ const reserveKeyCommandsForPicker = isPresent(this.pickerService) && arrowKeyPressed && args.altKey;
6339
+ if (reserveKeyCommandsForPicker) {
6340
+ return;
6341
+ }
6342
+ // Prevent form from submitting on enter if used in datepicker (infinite view)
6343
+ const preventSubmitInDatePicker = isPresent(this.pickerService) && args.keyCode === Keys$1.Enter;
6344
+ if (preventSubmitInDatePicker) {
6345
+ args.preventDefault();
6346
+ }
6347
+ const candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(args), this.activeViewEnum), this.min, this.max);
6348
+ if (!isEqual(this.focusedDate, candidate)) {
6349
+ this.focusedDate = candidate;
6350
+ this.detectChanges();
6351
+ args.preventDefault();
6352
+ }
6353
+ if (args.keyCode === Keys$1.Enter) {
6354
+ this.selectionService.lastClicked = this.focusedDate;
6355
+ this.performSelection(this.focusedDate, args);
6356
+ }
6357
+ if (args.keyCode === Keys$1.KeyT) {
6358
+ this.focusToday();
6359
+ }
6360
+ if (isArrowWithShiftPressed(args)) {
6361
+ args.anyArrow = true;
6362
+ this.performSelection(this.focusedDate, args);
6363
+ }
6119
6364
  }
6120
6365
  }
6366
+ focusToday() {
6367
+ this.focusedDate = getToday();
6368
+ this.bus.moveToBottom(this.activeViewEnum);
6369
+ this.cdr.detectChanges();
6370
+ }
6121
6371
  detectChanges() {
6122
6372
  if (!this.destroyed) {
6123
6373
  this.cdr.detectChanges();
@@ -6129,16 +6379,19 @@ class CalendarComponent {
6129
6379
  }
6130
6380
  }
6131
6381
  setAriaActivedescendant() {
6382
+ var _a;
6132
6383
  // in Classic mode, the inner MultiViewCalendar handles the activedescendant
6133
- if (!isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
6384
+ const infiniteCalendarTable = (_a = this.element.nativeElement) === null || _a === void 0 ? void 0 : _a.querySelector(selectors.infiniteCalendarTable);
6385
+ const activedescendantHandledByInnerMultiViewCalendar = !isPresent(infiniteCalendarTable) || (this.type === 'classic' && !infiniteCalendarTable.hasAttribute(attributeNames.ariaActiveDescendant));
6386
+ if (activedescendantHandledByInnerMultiViewCalendar) {
6134
6387
  return;
6135
6388
  }
6136
6389
  if (this.type === 'classic') {
6137
- this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
6390
+ this.renderer.removeAttribute(infiniteCalendarTable, attributeNames.ariaActiveDescendant);
6138
6391
  return;
6139
6392
  }
6140
6393
  const focusedCellId = this.cellUID + this.focusedDate.getTime();
6141
- this.renderer.setAttribute(this.element.nativeElement, 'aria-activedescendant', focusedCellId);
6394
+ this.renderer.setAttribute(infiniteCalendarTable, attributeNames.ariaActiveDescendant, focusedCellId);
6142
6395
  }
6143
6396
  parseSelectionToValue(selection) {
6144
6397
  selection = selection || [];
@@ -6161,7 +6414,7 @@ class CalendarComponent {
6161
6414
  }
6162
6415
  }
6163
6416
  CalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarComponent, deps: [{ token: BusViewService }, { token: CalendarDOMService }, { token: i0.ElementRef }, { token: NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: ScrollSyncService }, { token: DisabledDatesService }, { token: i1$1.LocalizationService }, { token: SelectionService }, { token: PickerService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
6164
- CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CalendarComponent, selector: "kendo-calendar", inputs: { id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", selection: "selection", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", navigation: "navigation", activeView: "activeView", bottomView: "bottomView", topView: "topView", type: "type", animateNavigation: "animateNavigation", weekNumber: "weekNumber", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"] }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", activeViewDateChange: "activeViewDateChange", valueChange: "valueChange" }, host: { properties: { "class.k-week-number": "this.weekNumber", "attr.id": "this.widgetId", "attr.tabindex": "this.calendarTabIndex", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled" } }, providers: [
6417
+ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CalendarComponent, selector: "kendo-calendar", inputs: { id: "id", focusedDate: "focusedDate", min: "min", max: "max", rangeValidation: "rangeValidation", selection: "selection", value: "value", disabled: "disabled", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", navigation: "navigation", activeView: "activeView", bottomView: "bottomView", topView: "topView", type: "type", animateNavigation: "animateNavigation", weekNumber: "weekNumber", cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"] }, outputs: { activeViewChange: "activeViewChange", navigate: "navigate", activeViewDateChange: "activeViewDateChange", valueChange: "valueChange" }, host: { properties: { "class.k-week-number": "this.weekNumber", "attr.id": "this.widgetId", "attr.aria-disabled": "this.ariaDisabled", "class.k-disabled": "this.ariaDisabled" } }, providers: [
6165
6418
  BusViewService,
6166
6419
  CALENDAR_VALUE_ACCESSOR,
6167
6420
  CALENDAR_RANGE_VALIDATORS,
@@ -6185,6 +6438,9 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6185
6438
 
6186
6439
  i18n-nextButtonTitle="kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar"
6187
6440
  nextButtonTitle="Navigate to next view"
6441
+
6442
+ i18n-parentViewButtonTitle="kendo.calendar.parentViewButtonTitle|The title of the parent view button in the calendar header"
6443
+ parentViewButtonTitle="Navigate to parent view"
6188
6444
  >
6189
6445
  </ng-container>
6190
6446
  <ng-container *ngIf="type === 'infinite'">
@@ -6202,6 +6458,7 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6202
6458
  <kendo-calendar-viewlist
6203
6459
  [activeView]="activeViewEnum"
6204
6460
  [isActive]="isActive"
6461
+ [id]="headerId"
6205
6462
  [cellTemplateRef]="activeCellTemplate()?.templateRef"
6206
6463
  [headerTitleTemplateRef]="headerTitleTemplateRef?.templateRef"
6207
6464
  [weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
@@ -6211,6 +6468,8 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6211
6468
  [focusedDate]="focusedDate"
6212
6469
  [weekNumber]="weekNumber"
6213
6470
  [selectedDates]="selectedDates"
6471
+ [tabIndex]="tabIndex"
6472
+ [disabled]="disabled"
6214
6473
  (todayButtonClick)="handleDateChange({
6215
6474
  selectedDates: [$event],
6216
6475
  focusedDate: $event
@@ -6219,6 +6478,8 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6219
6478
  (weekNumberCellClick)="handleWeekNumberClick($event)"
6220
6479
  (activeDateChange)="handleActiveDateChange($event)"
6221
6480
  (pageChange)="onPageChange()"
6481
+ (focusCalendar)="handleFocus()"
6482
+ (blurCalendar)="handleBlur($event)"
6222
6483
  >
6223
6484
  </kendo-calendar-viewlist>
6224
6485
  <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
@@ -6229,7 +6490,9 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6229
6490
  [views]="1"
6230
6491
  [min]="min"
6231
6492
  [max]="max"
6493
+ [id]="id"
6232
6494
  [isActive]="isActive"
6495
+ [tabIndex]="tabIndex"
6233
6496
  [activeView]="activeView"
6234
6497
  [bottomView]="bottomView"
6235
6498
  [topView]="topView"
@@ -6249,7 +6512,7 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6249
6512
  (activeViewChange)="handleActiveViewChange($event)"
6250
6513
  (navigate)="handleNavigate($event)"
6251
6514
  (valueChange)="handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)"
6252
- (focus)="handleFocus()"
6515
+ (focusCalendar)="handleFocus()"
6253
6516
  (blur)="handleBlur($event)"
6254
6517
  (keydown)="handleMultiViewCalendarKeydown($event)"
6255
6518
  >
@@ -6257,11 +6520,12 @@ CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
6257
6520
  [today]="localization.get('today')"
6258
6521
  [prevButtonTitle]="localization.get('prevButtonTitle')"
6259
6522
  [nextButtonTitle]="localization.get('nextButtonTitle')"
6523
+ [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
6260
6524
  >
6261
6525
  </kendo-multiviewcalendar-messages>
6262
6526
  </kendo-multiviewcalendar>
6263
6527
  </ng-container>
6264
- `, isInline: true, components: [{ type: NavigationComponent, selector: "kendo-calendar-navigation", inputs: ["activeView", "min", "max", "focusedDate", "templateRef"], outputs: ["valueChange", "pageChange"] }, { type: ViewListComponent, selector: "kendo-calendar-viewlist", inputs: ["cellTemplateRef", "weekNumberTemplateRef", "headerTitleTemplateRef", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectedDates", "weekNumber"], outputs: ["cellClick", "weekNumberCellClick", "activeDateChange", "todayButtonClick", "pageChange"] }, { type: i5.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur"], exportAs: ["kendo-multiviewcalendar"] }, { type: MultiViewCalendarCustomMessagesComponent, selector: "kendo-multiviewcalendar-messages" }], directives: [{ type: CalendarLocalizedMessagesDirective, selector: "[kendoCalendarLocalizedMessages]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6528
+ `, isInline: true, components: [{ type: NavigationComponent, selector: "kendo-calendar-navigation", inputs: ["activeView", "min", "max", "focusedDate", "templateRef"], outputs: ["valueChange", "pageChange"] }, { type: ViewListComponent, selector: "kendo-calendar-viewlist", inputs: ["cellTemplateRef", "weekNumberTemplateRef", "headerTitleTemplateRef", "activeView", "cellUID", "focusedDate", "isActive", "min", "max", "selectedDates", "tabIndex", "disabled", "id", "weekNumber"], outputs: ["cellClick", "weekNumberCellClick", "activeDateChange", "todayButtonClick", "pageChange", "focusCalendar", "blurCalendar", "focusedCellChange"] }, { type: i5.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur", "focusCalendar"], exportAs: ["kendo-multiviewcalendar"] }, { type: MultiViewCalendarCustomMessagesComponent, selector: "kendo-multiviewcalendar-messages" }], directives: [{ type: CalendarLocalizedMessagesDirective, selector: "[kendoCalendarLocalizedMessages]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6265
6529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarComponent, decorators: [{
6266
6530
  type: Component,
6267
6531
  args: [{
@@ -6293,6 +6557,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6293
6557
 
6294
6558
  i18n-nextButtonTitle="kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar"
6295
6559
  nextButtonTitle="Navigate to next view"
6560
+
6561
+ i18n-parentViewButtonTitle="kendo.calendar.parentViewButtonTitle|The title of the parent view button in the calendar header"
6562
+ parentViewButtonTitle="Navigate to parent view"
6296
6563
  >
6297
6564
  </ng-container>
6298
6565
  <ng-container *ngIf="type === 'infinite'">
@@ -6310,6 +6577,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6310
6577
  <kendo-calendar-viewlist
6311
6578
  [activeView]="activeViewEnum"
6312
6579
  [isActive]="isActive"
6580
+ [id]="headerId"
6313
6581
  [cellTemplateRef]="activeCellTemplate()?.templateRef"
6314
6582
  [headerTitleTemplateRef]="headerTitleTemplateRef?.templateRef"
6315
6583
  [weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
@@ -6319,6 +6587,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6319
6587
  [focusedDate]="focusedDate"
6320
6588
  [weekNumber]="weekNumber"
6321
6589
  [selectedDates]="selectedDates"
6590
+ [tabIndex]="tabIndex"
6591
+ [disabled]="disabled"
6322
6592
  (todayButtonClick)="handleDateChange({
6323
6593
  selectedDates: [$event],
6324
6594
  focusedDate: $event
@@ -6327,6 +6597,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6327
6597
  (weekNumberCellClick)="handleWeekNumberClick($event)"
6328
6598
  (activeDateChange)="handleActiveDateChange($event)"
6329
6599
  (pageChange)="onPageChange()"
6600
+ (focusCalendar)="handleFocus()"
6601
+ (blurCalendar)="handleBlur($event)"
6330
6602
  >
6331
6603
  </kendo-calendar-viewlist>
6332
6604
  <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
@@ -6337,7 +6609,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6337
6609
  [views]="1"
6338
6610
  [min]="min"
6339
6611
  [max]="max"
6612
+ [id]="id"
6340
6613
  [isActive]="isActive"
6614
+ [tabIndex]="tabIndex"
6341
6615
  [activeView]="activeView"
6342
6616
  [bottomView]="bottomView"
6343
6617
  [topView]="topView"
@@ -6357,7 +6631,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6357
6631
  (activeViewChange)="handleActiveViewChange($event)"
6358
6632
  (navigate)="handleNavigate($event)"
6359
6633
  (valueChange)="handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)"
6360
- (focus)="handleFocus()"
6634
+ (focusCalendar)="handleFocus()"
6361
6635
  (blur)="handleBlur($event)"
6362
6636
  (keydown)="handleMultiViewCalendarKeydown($event)"
6363
6637
  >
@@ -6365,6 +6639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6365
6639
  [today]="localization.get('today')"
6366
6640
  [prevButtonTitle]="localization.get('prevButtonTitle')"
6367
6641
  [nextButtonTitle]="localization.get('nextButtonTitle')"
6642
+ [parentViewButtonTitle]="localization.get('parentViewButtonTitle')"
6368
6643
  >
6369
6644
  </kendo-multiviewcalendar-messages>
6370
6645
  </kendo-multiviewcalendar>
@@ -6480,9 +6755,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6480
6755
  }], widgetId: [{
6481
6756
  type: HostBinding,
6482
6757
  args: ['attr.id']
6483
- }], calendarTabIndex: [{
6484
- type: HostBinding,
6485
- args: ['attr.tabindex']
6486
6758
  }], ariaDisabled: [{
6487
6759
  type: HostBinding,
6488
6760
  args: ['attr.aria-disabled']
@@ -7026,7 +7298,7 @@ class DateInputComponent {
7026
7298
  /**
7027
7299
  * @hidden
7028
7300
  */
7029
- this.role = 'spinbutton';
7301
+ this.role = 'textbox';
7030
7302
  /**
7031
7303
  * @hidden
7032
7304
  */
@@ -7199,11 +7471,15 @@ class DateInputComponent {
7199
7471
  this._size = DEFAULT_SIZE;
7200
7472
  this._rounded = DEFAULT_ROUNDED;
7201
7473
  this._fillMode = DEFAULT_FILL_MODE;
7474
+ this.subs = new Subscription();
7202
7475
  this.symbolsMap = this.dateSymbolMap();
7203
7476
  this.updateFormatSections();
7204
7477
  if (this.pickerService) {
7205
7478
  this.pickerService.input = this;
7206
7479
  }
7480
+ else {
7481
+ this.ariaReadOnly = null;
7482
+ }
7207
7483
  }
7208
7484
  /**
7209
7485
  * @hidden
@@ -7328,6 +7604,13 @@ class DateInputComponent {
7328
7604
  }
7329
7605
  }
7330
7606
  }
7607
+ /**
7608
+ * @hidden
7609
+ */
7610
+ get formControl() {
7611
+ const ngControl = this.injector.get(NgControl, null);
7612
+ return (ngControl === null || ngControl === void 0 ? void 0 : ngControl.control) || null;
7613
+ }
7331
7614
  get inputFormat() {
7332
7615
  if (!this.format) {
7333
7616
  return DEFAULT_FORMAT$1;
@@ -7363,6 +7646,21 @@ class DateInputComponent {
7363
7646
  containsElement(element) {
7364
7647
  return Boolean(closest(element, node => node === this.wrapper.nativeElement));
7365
7648
  }
7649
+ /**
7650
+ * @hidden
7651
+ */
7652
+ ngOnInit() {
7653
+ this.kendoDate = this.getKendoDate(this.value);
7654
+ this.updateElementValue();
7655
+ this.subs.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
7656
+ this.ngControl = this.injector.get(NgControl, null);
7657
+ if (this.wrapper) {
7658
+ this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
7659
+ this.ngZone.runOutsideAngular(() => {
7660
+ this.bindEvents();
7661
+ });
7662
+ }
7663
+ }
7366
7664
  /**
7367
7665
  * @hidden
7368
7666
  */
@@ -7384,10 +7682,16 @@ class DateInputComponent {
7384
7682
  this.updateElementValue(this.isActive);
7385
7683
  }
7386
7684
  }
7685
+ ngAfterViewInit() {
7686
+ var _a, _b;
7687
+ this.setComponentClasses();
7688
+ const formControl = (_a = this.injector.get(NgControl, null)) === null || _a === void 0 ? void 0 : _a.control;
7689
+ this.control = formControl;
7690
+ this.subs.add((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => this.setAriaInvalid()));
7691
+ this.setAriaInvalid();
7692
+ }
7387
7693
  ngOnDestroy() {
7388
- if (this.intlSubscription) {
7389
- this.intlSubscription.unsubscribe();
7390
- }
7694
+ this.subs.unsubscribe();
7391
7695
  if (this.pickerService) {
7392
7696
  this.pickerService.input = null;
7393
7697
  }
@@ -7396,32 +7700,28 @@ class DateInputComponent {
7396
7700
  /**
7397
7701
  * @hidden
7398
7702
  */
7399
- validate(control) {
7400
- return this.minValidator(control) || this.maxValidator(control) || this.incompleteValidator(control, this.isDateIncomplete);
7703
+ setAriaInvalid() {
7704
+ if (!this.control) {
7705
+ return;
7706
+ }
7707
+ if (this.control.invalid) {
7708
+ this.renderer.setAttribute(this.inputElement, attributeNames.ariaInvalid, 'true');
7709
+ }
7710
+ else {
7711
+ this.renderer.setAttribute(this.inputElement, attributeNames.ariaInvalid, 'false');
7712
+ }
7401
7713
  }
7402
7714
  /**
7403
7715
  * @hidden
7404
7716
  */
7405
- registerOnValidatorChange(fn) {
7406
- this.onValidatorChange = fn;
7717
+ validate(control) {
7718
+ return this.minValidator(control) || this.maxValidator(control) || this.incompleteValidator(control, this.isDateIncomplete);
7407
7719
  }
7408
7720
  /**
7409
7721
  * @hidden
7410
7722
  */
7411
- ngOnInit() {
7412
- this.kendoDate = this.getKendoDate(this.value);
7413
- this.updateElementValue();
7414
- this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));
7415
- this.ngControl = this.injector.get(NgControl, null);
7416
- if (this.wrapper) {
7417
- this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
7418
- this.ngZone.runOutsideAngular(() => {
7419
- this.bindEvents();
7420
- });
7421
- }
7422
- }
7423
- ngAfterViewInit() {
7424
- this.setComponentClasses();
7723
+ registerOnValidatorChange(fn) {
7724
+ this.onValidatorChange = fn;
7425
7725
  }
7426
7726
  /**
7427
7727
  * @hidden
@@ -7801,34 +8101,34 @@ class DateInputComponent {
7801
8101
  if (this.disabled || this.readonly || event.altKey || event.ctrlKey || event.metaKey) {
7802
8102
  return;
7803
8103
  }
7804
- if (event.keyCode === Keys.Tab) {
8104
+ if (event.keyCode === Keys$1.Tab) {
7805
8105
  const moved = this.switchDateSegment(event.shiftKey ? -1 : 1);
7806
8106
  if (moved) {
7807
8107
  event.preventDefault();
7808
8108
  }
7809
8109
  return;
7810
8110
  }
7811
- if (event.keyCode === Keys.Backspace) {
8111
+ if (event.keyCode === Keys$1.Backspace) {
7812
8112
  this.backspace = true;
7813
8113
  return;
7814
8114
  }
7815
8115
  switch (event.keyCode) {
7816
- case Keys.ArrowDown:
8116
+ case Keys$1.ArrowDown:
7817
8117
  this.modifyDateSegmentValue(-1);
7818
8118
  break;
7819
- case Keys.ArrowUp:
8119
+ case Keys$1.ArrowUp:
7820
8120
  this.modifyDateSegmentValue(1);
7821
8121
  break;
7822
- case Keys.ArrowRight:
8122
+ case Keys$1.ArrowRight:
7823
8123
  this.switchDateSegment(1);
7824
8124
  break;
7825
- case Keys.ArrowLeft:
8125
+ case Keys$1.ArrowLeft:
7826
8126
  this.switchDateSegment(-1);
7827
8127
  break;
7828
- case Keys.Home:
8128
+ case Keys$1.Home:
7829
8129
  this.selectNearestSegment(0);
7830
8130
  break;
7831
- case Keys.End:
8131
+ case Keys$1.End:
7832
8132
  this.selectNearestSegment(this.inputValue.length);
7833
8133
  break;
7834
8134
  default:
@@ -8296,6 +8596,7 @@ const TWO_DIGIT_YEAR_MAX$1 = 68;
8296
8596
  */
8297
8597
  class DatePickerComponent {
8298
8598
  constructor(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, disabledDatesService, touchEnabled) {
8599
+ var _a;
8299
8600
  this.zone = zone;
8300
8601
  this.localization = localization;
8301
8602
  this.cdr = cdr;
@@ -8309,7 +8610,7 @@ class DatePickerComponent {
8309
8610
  /**
8310
8611
  * @hidden
8311
8612
  */
8312
- this.focusableId = `k-${guid()}`;
8613
+ this.focusableId = `k-datepicker-${(_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id}-`;
8313
8614
  /**
8314
8615
  * Defines the active view that the Calendar initially renders
8315
8616
  * ([see example]({% slug calendar_type_datepicker %}#toc-active-view)).
@@ -8512,7 +8813,6 @@ class DatePickerComponent {
8512
8813
  * @hidden
8513
8814
  */
8514
8815
  this.wrapperClasses = true;
8515
- this.popupUID = guid();
8516
8816
  this._popupSettings = { animate: true };
8517
8817
  this._show = false;
8518
8818
  this._value = null;
@@ -8706,12 +9006,11 @@ class DatePickerComponent {
8706
9006
  get disabledClass() {
8707
9007
  return this.disabled;
8708
9008
  }
8709
- /**
8710
- * @hidden
8711
- */
8712
- get inputRole() {
8713
- return this.readOnlyInput ? 'listbox' : 'spinbutton';
9009
+ get popupUID() {
9010
+ var _a;
9011
+ return (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id;
8714
9012
  }
9013
+ ;
8715
9014
  get isActive() {
8716
9015
  return this._active;
8717
9016
  }
@@ -8960,18 +9259,18 @@ class DatePickerComponent {
8960
9259
  */
8961
9260
  handleKeydown(e) {
8962
9261
  const { altKey, shiftKey, keyCode, target } = e;
8963
- if (keyCode === Keys.Escape) {
9262
+ if (keyCode === Keys$1.Escape) {
8964
9263
  this.show = false;
8965
9264
  }
8966
9265
  if (altKey) {
8967
- if (keyCode === Keys.ArrowDown && !this.show) {
9266
+ if (keyCode === Keys$1.ArrowDown && !this.show) {
8968
9267
  this.show = true;
8969
9268
  }
8970
- if (keyCode === Keys.ArrowUp) {
9269
+ if (keyCode === Keys$1.ArrowUp) {
8971
9270
  this.show = false;
8972
9271
  }
8973
9272
  }
8974
- if (keyCode === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
9273
+ if (keyCode === Keys$1.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
8975
9274
  this.input.focus();
8976
9275
  this.show = false;
8977
9276
  }
@@ -8995,6 +9294,7 @@ class DatePickerComponent {
8995
9294
  return;
8996
9295
  }
8997
9296
  this._show = show;
9297
+ const inputElement = this.wrapper.nativeElement.querySelector('input');
8998
9298
  if (show) {
8999
9299
  const direction = this.localization.rtl ? 'right' : 'left';
9000
9300
  this.popupRef = this.popupService.open({
@@ -9007,13 +9307,27 @@ class DatePickerComponent {
9007
9307
  popupClass: this.popupClasses,
9008
9308
  positionMode: 'absolute'
9009
9309
  });
9310
+ if (this.calendar.type === 'infinite') {
9311
+ this.pickerSubscriptions.add(this.calendar.monthView.focusedCellChange.subscribe((id) => {
9312
+ this.renderer.setAttribute(inputElement, attributeNames.ariaActiveDescendant, id);
9313
+ }));
9314
+ }
9315
+ else {
9316
+ this.pickerSubscriptions.add(this.calendar.multiViewCalendar.viewList.focusedCellChange.subscribe((id) => {
9317
+ this.renderer.setAttribute(inputElement, attributeNames.ariaActiveDescendant, id);
9318
+ }));
9319
+ }
9010
9320
  this.popupRef.popupElement.setAttribute('id', this.popupUID);
9321
+ this.renderer.setAttribute(inputElement, attributeNames.ariaControls, this.popupUID);
9011
9322
  this.subscription = this.popupRef.popupAnchorViewportLeave.subscribe(() => this.show = false);
9012
9323
  }
9013
9324
  else {
9014
9325
  this.popupRef.close();
9015
9326
  this.popupRef = null;
9016
9327
  this.subscription.unsubscribe();
9328
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaControls);
9329
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaActiveDescendant);
9330
+ this.cdr.detectChanges();
9017
9331
  }
9018
9332
  }
9019
9333
  focusInput() {
@@ -9129,7 +9443,7 @@ class DatePickerComponent {
9129
9443
  }
9130
9444
  }
9131
9445
  }
9132
- DatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DatePickerComponent, deps: [{ token: i0.NgZone }, { token: i1$1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: PickerService }, { token: DisabledDatesService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
9446
+ DatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DatePickerComponent, deps: [{ token: i0.NgZone }, { token: i1$1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i1$2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: PickerService }, { token: DisabledDatesService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
9133
9447
  DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DatePickerComponent, selector: "kendo-datepicker", inputs: { cellTemplateRef: ["cellTemplate", "cellTemplateRef"], monthCellTemplateRef: ["monthCellTemplate", "monthCellTemplateRef"], yearCellTemplateRef: ["yearCellTemplate", "yearCellTemplateRef"], decadeCellTemplateRef: ["decadeCellTemplate", "decadeCellTemplateRef"], centuryCellTemplateRef: ["centuryCellTemplate", "centuryCellTemplateRef"], weekNumberTemplateRef: ["weekNumberTemplate", "weekNumberTemplateRef"], headerTitleTemplateRef: ["headerTitleTemplate", "headerTitleTemplateRef"], navigationItemTemplateRef: ["navigationItemTemplate", "navigationItemTemplateRef"], focusableId: "focusableId", activeView: "activeView", bottomView: "bottomView", topView: "topView", calendarType: "calendarType", animateCalendarNavigation: "animateCalendarNavigation", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", popupSettings: "popupSettings", navigation: "navigation", min: "min", max: "max", incompleteDateValidation: "incompleteDateValidation", focusedDate: "focusedDate", value: "value", format: "format", twoDigitYearMax: "twoDigitYearMax", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", tabindex: "tabindex", tabIndex: "tabIndex", disabledDates: "disabledDates", title: "title", rangeValidation: "rangeValidation", disabledDatesValidation: "disabledDatesValidation", weekNumber: "weekNumber", size: "size", rounded: "rounded", fillMode: "fillMode" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { properties: { "class.k-datepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
9134
9448
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
9135
9449
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
@@ -9158,7 +9472,7 @@ DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
9158
9472
  </ng-container>
9159
9473
  <kendo-dateinput
9160
9474
  #input
9161
- [role]="inputRole"
9475
+ [role]="'combobox'"
9162
9476
  [focusableId]="focusableId"
9163
9477
  [hasPopup]="true"
9164
9478
  [isPopupOpen]="show"
@@ -9269,7 +9583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
9269
9583
  </ng-container>
9270
9584
  <kendo-dateinput
9271
9585
  #input
9272
- [role]="inputRole"
9586
+ [role]="'combobox'"
9273
9587
  [focusableId]="focusableId"
9274
9588
  [hasPopup]="true"
9275
9589
  [isPopupOpen]="show"
@@ -9346,7 +9660,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
9346
9660
  <ng-template>
9347
9661
  `
9348
9662
  }]
9349
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.PopupService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: PickerService }, { type: DisabledDatesService }, { type: undefined, decorators: [{
9663
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i1$2.PopupService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: PickerService }, { type: DisabledDatesService }, { type: undefined, decorators: [{
9350
9664
  type: Optional
9351
9665
  }, {
9352
9666
  type: Inject,
@@ -10152,12 +10466,13 @@ const services = {
10152
10466
  * @hidden
10153
10467
  */
10154
10468
  class TimeListComponent {
10155
- constructor(element, injector, dom, renderer, zone) {
10469
+ constructor(element, injector, dom, renderer, zone, localization) {
10156
10470
  this.element = element;
10157
10471
  this.injector = injector;
10158
10472
  this.dom = dom;
10159
10473
  this.renderer = renderer;
10160
10474
  this.zone = zone;
10475
+ this.localization = localization;
10161
10476
  this.min = cloneDate(MIDNIGHT_DATE);
10162
10477
  this.max = cloneDate(MAX_TIME);
10163
10478
  this.step = 1;
@@ -10171,11 +10486,32 @@ class TimeListComponent {
10171
10486
  this.data = [];
10172
10487
  this.indexToScroll = -1;
10173
10488
  this.domEvents = [];
10489
+ this.hostElement = this.element.nativeElement;
10490
+ }
10491
+ get roleAttribute() {
10492
+ return this.isDayPeriod ? 'listbox' : 'spinbutton';
10493
+ }
10494
+ get ariaLabel() {
10495
+ var _a;
10496
+ return this.localization.get((_a = this.part) === null || _a === void 0 ? void 0 : _a.type);
10497
+ }
10498
+ get valueMin() {
10499
+ var _a;
10500
+ return (_a = this.data[0]) === null || _a === void 0 ? void 0 : _a.text;
10501
+ }
10502
+ get valueMax() {
10503
+ var _a;
10504
+ return (_a = this.data[this.data.length - 1]) === null || _a === void 0 ? void 0 : _a.text;
10174
10505
  }
10175
10506
  get tabIndex() {
10176
10507
  return this.disabled ? undefined : 0;
10177
10508
  }
10509
+ get isDayPeriod() {
10510
+ var _a;
10511
+ return ((_a = this.part) === null || _a === void 0 ? void 0 : _a.type) === 'dayperiod';
10512
+ }
10178
10513
  ngOnChanges(changes) {
10514
+ var _a, _b;
10179
10515
  if (changes.part) {
10180
10516
  this.service = this.injector.get(services[this.part.type]);
10181
10517
  this.service.configure(this.serviceSettings());
@@ -10195,6 +10531,8 @@ class TimeListComponent {
10195
10531
  this.animateToIndex = this.animateToIndex && this.textHasChanged(valueChanges);
10196
10532
  this.total = this.service.total(value);
10197
10533
  this.indexToScroll = this.selectedIndex(value);
10534
+ this.renderer.setAttribute(this.hostElement, attributeNames.valueNow, (_a = this.getCurrentItem()) === null || _a === void 0 ? void 0 : _a.value.toString());
10535
+ this.renderer.setAttribute(this.hostElement, attributeNames.valuetext, (_b = this.getCurrentItem()) === null || _b === void 0 ? void 0 : _b.text);
10198
10536
  }
10199
10537
  ngOnInit() {
10200
10538
  this.animateToIndex = true;
@@ -10227,6 +10565,9 @@ class TimeListComponent {
10227
10565
  this.animateToIndex = true;
10228
10566
  });
10229
10567
  }
10568
+ getCurrentItem() {
10569
+ return this.indexToScroll >= 0 ? this.data[this.indexToScroll] : null;
10570
+ }
10230
10571
  handleChange(dataItem) {
10231
10572
  const candidate = this.service.apply(this.value, dataItem.value);
10232
10573
  if (this.value.getTime() === candidate.getTime()) {
@@ -10343,8 +10684,8 @@ class TimeListComponent {
10343
10684
  this.domEvents.push(this.renderer.listen(element, 'mouseover', () => !this.isActive && this.focus()), this.renderer.listen(element, 'click', () => this.focus()), this.renderer.listen(element, 'blur', () => this.isActive = false), this.renderer.listen(element, 'focus', () => this.isActive = true), this.renderer.listen(element, 'keydown', this.handleKeyDown.bind(this)));
10344
10685
  }
10345
10686
  }
10346
- TimeListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimeListComponent, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: TimePickerDOMService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
10347
- TimeListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TimeListComponent, selector: "kendo-timelist", inputs: { min: "min", max: "max", part: "part", step: "step", disabled: "disabled", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.tabindex": "this.tabIndex", "class.k-time-list": "this.componentClass" } }, viewQueries: [{ propertyName: "virtualization", first: true, predicate: VirtualizationComponent, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
10687
+ TimeListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimeListComponent, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: TimePickerDOMService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
10688
+ TimeListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TimeListComponent, selector: "kendo-timelist", inputs: { min: "min", max: "max", part: "part", step: "step", disabled: "disabled", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.role": "this.roleAttribute", "attr.aria-label": "this.ariaLabel", "attr.valuemin": "this.valueMin", "attr.valuemax": "this.valueMax", "attr.tabindex": "this.tabIndex", "class.k-time-list": "this.componentClass" } }, viewQueries: [{ propertyName: "virtualization", first: true, predicate: VirtualizationComponent, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
10348
10689
  <kendo-virtualization
10349
10690
  [skip]="skip"
10350
10691
  [take]="total"
@@ -10362,9 +10703,12 @@ TimeListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
10362
10703
  click: handleItemClick
10363
10704
  }"
10364
10705
  [scope]="this"
10706
+ [attr.role]="isDayPeriod ? 'presentation' : null"
10365
10707
  >
10366
10708
  <li *ngFor="let item of data; let index = index;" class="k-item"
10367
- [attr.data-timelist-item-index]="index">
10709
+ [attr.data-timelist-item-index]="index"
10710
+ [attr.role]="isDayPeriod ? 'option' : null"
10711
+ >
10368
10712
  <span>{{item.text}}</span>
10369
10713
  </li>
10370
10714
  </ul>
@@ -10392,16 +10736,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
10392
10736
  click: handleItemClick
10393
10737
  }"
10394
10738
  [scope]="this"
10739
+ [attr.role]="isDayPeriod ? 'presentation' : null"
10395
10740
  >
10396
10741
  <li *ngFor="let item of data; let index = index;" class="k-item"
10397
- [attr.data-timelist-item-index]="index">
10742
+ [attr.data-timelist-item-index]="index"
10743
+ [attr.role]="isDayPeriod ? 'option' : null"
10744
+ >
10398
10745
  <span>{{item.text}}</span>
10399
10746
  </li>
10400
10747
  </ul>
10401
10748
  </kendo-virtualization>
10402
10749
  `
10403
10750
  }]
10404
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: TimePickerDOMService }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { min: [{
10751
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: TimePickerDOMService }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1$1.LocalizationService }]; }, propDecorators: { min: [{
10405
10752
  type: Input
10406
10753
  }], max: [{
10407
10754
  type: Input
@@ -10418,6 +10765,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
10418
10765
  }], virtualization: [{
10419
10766
  type: ViewChild,
10420
10767
  args: [VirtualizationComponent, { static: true }]
10768
+ }], roleAttribute: [{
10769
+ type: HostBinding,
10770
+ args: ["attr.role"]
10771
+ }], ariaLabel: [{
10772
+ type: HostBinding,
10773
+ args: ["attr.aria-label"]
10774
+ }], valueMin: [{
10775
+ type: HostBinding,
10776
+ args: ['attr.valuemin']
10777
+ }], valueMax: [{
10778
+ type: HostBinding,
10779
+ args: ["attr.valuemax"]
10421
10780
  }], tabIndex: [{
10422
10781
  type: HostBinding,
10423
10782
  args: ["attr.tabindex"]
@@ -10497,7 +10856,7 @@ const snapTime = snappers => (candidate, min) => {
10497
10856
  class TimePickerMessages extends ComponentMessages {
10498
10857
  }
10499
10858
  TimePickerMessages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimePickerMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
10500
- TimePickerMessages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TimePickerMessages, selector: "kendo-timepicker-messages-base", inputs: { accept: "accept", acceptLabel: "acceptLabel", cancel: "cancel", cancelLabel: "cancelLabel", now: "now", nowLabel: "nowLabel", toggle: "toggle" }, usesInheritance: true, ngImport: i0 });
10859
+ TimePickerMessages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TimePickerMessages, selector: "kendo-timepicker-messages-base", inputs: { accept: "accept", acceptLabel: "acceptLabel", cancel: "cancel", cancelLabel: "cancelLabel", now: "now", nowLabel: "nowLabel", toggle: "toggle", hour: "hour", minute: "minute", second: "second", millisecond: "millisecond", dayperiod: "dayperiod" }, usesInheritance: true, ngImport: i0 });
10501
10860
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimePickerMessages, decorators: [{
10502
10861
  type: Directive,
10503
10862
  args: [{
@@ -10518,6 +10877,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
10518
10877
  type: Input
10519
10878
  }], toggle: [{
10520
10879
  type: Input
10880
+ }], hour: [{
10881
+ type: Input
10882
+ }], minute: [{
10883
+ type: Input
10884
+ }], second: [{
10885
+ type: Input
10886
+ }], millisecond: [{
10887
+ type: Input
10888
+ }], dayperiod: [{
10889
+ type: Input
10521
10890
  }] } });
10522
10891
 
10523
10892
  /**
@@ -10864,15 +11233,15 @@ class TimeSelectorComponent {
10864
11233
  handleKeydown(args) {
10865
11234
  const { keyCode, altKey } = args;
10866
11235
  // reserve the alt + arrow key commands for the picker
10867
- const arrowKeyPressed = [Keys.ArrowLeft, Keys.ArrowRight].indexOf(keyCode) !== -1;
11236
+ const arrowKeyPressed = [Keys$1.ArrowLeft, Keys$1.ArrowRight].indexOf(keyCode) !== -1;
10868
11237
  if (isPresent(this.pickerService) && arrowKeyPressed && altKey) {
10869
11238
  return;
10870
11239
  }
10871
- if (keyCode === Keys.Enter && !this.hasActiveButton()) {
11240
+ if (keyCode === Keys$1.Enter && !this.hasActiveButton()) {
10872
11241
  this.handleAccept();
10873
11242
  }
10874
- else if (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight) {
10875
- this.focusList(keyCode === Keys.ArrowLeft ? Direction.Left : Direction.Right);
11243
+ else if (keyCode === Keys$1.ArrowLeft || keyCode === Keys$1.ArrowRight) {
11244
+ this.focusList(keyCode === Keys$1.ArrowLeft ? Direction.Left : Direction.Right);
10876
11245
  }
10877
11246
  }
10878
11247
  emitBlur(args) {
@@ -11241,7 +11610,8 @@ const formatRegExp = new RegExp(`${TIME_PART.hour}|${TIME_PART.minute}|${TIME_PA
11241
11610
  * Represents the [Kendo UI TimePicker component for Angular]({% slug overview_timepicker %}#toc-basic-usage).
11242
11611
  */
11243
11612
  class TimePickerComponent {
11244
- constructor(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, intl, touchEnabled) {
11613
+ constructor(bus, zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, intl, touchEnabled) {
11614
+ this.bus = bus;
11245
11615
  this.zone = zone;
11246
11616
  this.localization = localization;
11247
11617
  this.cdr = cdr;
@@ -11255,7 +11625,7 @@ class TimePickerComponent {
11255
11625
  /**
11256
11626
  * @hidden
11257
11627
  */
11258
- this.focusableId = `k-${guid()}`;
11628
+ this.focusableId = `k-timepicker-${this.bus.calendarId}-`;
11259
11629
  /**
11260
11630
  * Sets or gets the `disabled` property of the TimePicker and
11261
11631
  * determines whether the component is active
@@ -11393,7 +11763,6 @@ class TimePickerComponent {
11393
11763
  * @hidden
11394
11764
  */
11395
11765
  this.wrapperClasses = true;
11396
- this.popupUID = guid();
11397
11766
  this.onControlChange = noop$2;
11398
11767
  this.onControlTouched = noop$2;
11399
11768
  this.onValidatorChange = noop$2;
@@ -11572,12 +11941,10 @@ class TimePickerComponent {
11572
11941
  get disabledClass() {
11573
11942
  return this.disabled;
11574
11943
  }
11575
- /**
11576
- * @hidden
11577
- */
11578
- get inputRole() {
11579
- return this.readOnlyInput ? 'listbox' : 'spinbutton';
11944
+ get popupUID() {
11945
+ return `k-timepicker-popup-${this.bus.calendarId}-`;
11580
11946
  }
11947
+ ;
11581
11948
  get isActive() {
11582
11949
  return this._active;
11583
11950
  }
@@ -11677,15 +12044,15 @@ class TimePickerComponent {
11677
12044
  */
11678
12045
  handleKeydown(event) {
11679
12046
  const { altKey, keyCode } = event;
11680
- if (keyCode === Keys.Escape) {
12047
+ if (keyCode === Keys$1.Escape) {
11681
12048
  this.show = false;
11682
12049
  return;
11683
12050
  }
11684
12051
  if (altKey) {
11685
- if (keyCode === Keys.ArrowUp) {
12052
+ if (keyCode === Keys$1.ArrowUp) {
11686
12053
  this.show = false;
11687
12054
  }
11688
- if (keyCode === Keys.ArrowDown && !this.show) {
12055
+ if (keyCode === Keys$1.ArrowDown && !this.show) {
11689
12056
  this.show = true;
11690
12057
  }
11691
12058
  }
@@ -11878,6 +12245,7 @@ class TimePickerComponent {
11878
12245
  }
11879
12246
  this._show = show;
11880
12247
  this.cdr.markForCheck();
12248
+ const inputElement = this.wrapper.nativeElement.querySelector('input');
11881
12249
  if (show) {
11882
12250
  const direction = this.localization.rtl ? 'right' : 'left';
11883
12251
  this.popupRef = this.popupService.open({
@@ -11891,11 +12259,13 @@ class TimePickerComponent {
11891
12259
  positionMode: 'absolute'
11892
12260
  });
11893
12261
  this.popupRef.popupElement.setAttribute('id', this.popupUID);
12262
+ this.renderer.setAttribute(inputElement, attributeNames.ariaControls, this.popupUID);
11894
12263
  this.popupRef.popupAnchorViewportLeave.subscribe(() => this.show = false);
11895
12264
  }
11896
12265
  else {
11897
12266
  this.popupRef.close();
11898
12267
  this.popupRef = null;
12268
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaControls);
11899
12269
  }
11900
12270
  }
11901
12271
  focusInput() {
@@ -12005,12 +12375,13 @@ class TimePickerComponent {
12005
12375
  }
12006
12376
  }
12007
12377
  }
12008
- TimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimePickerComponent, deps: [{ token: i0.NgZone }, { token: i1$1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: PickerService }, { token: i1.IntlService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
12378
+ TimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimePickerComponent, deps: [{ token: BusViewService }, { token: i0.NgZone }, { token: i1$1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i1$2.PopupService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: PickerService }, { token: i1.IntlService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
12009
12379
  TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TimePickerComponent, selector: "kendo-timepicker", inputs: { focusableId: "focusableId", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", format: "format", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", min: "min", max: "max", incompleteDateValidation: "incompleteDateValidation", cancelButton: "cancelButton", nowButton: "nowButton", steps: "steps", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex", title: "title", rangeValidation: "rangeValidation", value: "value", size: "size", rounded: "rounded", fillMode: "fillMode" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { properties: { "class.k-timepicker": "this.wrapperClasses", "class.k-input": "this.wrapperClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
12010
12380
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TimePickerComponent), multi: true },
12011
12381
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => TimePickerComponent), multi: true },
12012
12382
  { provide: KendoInput, useExisting: forwardRef(() => TimePickerComponent) },
12013
12383
  LocalizationService,
12384
+ BusViewService,
12014
12385
  {
12015
12386
  provide: L10N_PREFIX,
12016
12387
  useValue: 'kendo.timepicker'
@@ -12038,6 +12409,21 @@ TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
12038
12409
 
12039
12410
  i18n-toggle="kendo.timepicker.toggle|The label for the toggle button in the timepicker component"
12040
12411
  toggle="Toggle time list"
12412
+
12413
+ i18n-hour="kendo.timepicker.hour|The label for the hour part in the timepicker component"
12414
+ hour="Hour"
12415
+
12416
+ i18n-minute="kendo.timepicker.minute|The label for the minute part in the timepicker component"
12417
+ minute="Minute"
12418
+
12419
+ i18n-second="kendo.timepicker.second|The label for the second part in the timepicker component"
12420
+ second="Second"
12421
+
12422
+ i18n-millisecond="kendo.timepicker.millisecond|The label for the millisecond part in the timepicker component"
12423
+ millisecond="Millisecond"
12424
+
12425
+ i18n-dayperiod="kendo.timepicker.dayperiod|The label for the dayperiod part in the timepicker component"
12426
+ dayperiod="Dayperiod"
12041
12427
  >
12042
12428
  </ng-container>
12043
12429
  <kendo-dateinput
@@ -12047,7 +12433,7 @@ TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
12047
12433
  [isPopupOpen]="show"
12048
12434
  [disabled]="disabled"
12049
12435
  [readonly]="readonly || readOnlyInput"
12050
- [role]="inputRole"
12436
+ [role]="'combobox'"
12051
12437
  [ariaReadOnly]="readonly"
12052
12438
  [format]="format"
12053
12439
  [formatPlaceholder]="formatPlaceholder"
@@ -12067,6 +12453,7 @@ TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
12067
12453
  <button
12068
12454
  #toggleButton
12069
12455
  type="button"
12456
+ tabindex="-1"
12070
12457
  class="k-input-button k-button k-icon-button"
12071
12458
  [attr.title]="localization.get('toggle')"
12072
12459
  [attr.aria-label]="localization.get('toggle')"
@@ -12103,6 +12490,11 @@ TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
12103
12490
  [cancel]="localization.get('cancel')"
12104
12491
  [nowLabel]="localization.get('nowLabel')"
12105
12492
  [now]="localization.get('now')"
12493
+ [hour]="localization.get('hour')"
12494
+ [minute]="localization.get('minute')"
12495
+ [second]="localization.get('second')"
12496
+ [millisecond]="localization.get('millisecond')"
12497
+ [dayperiod]="localization.get('dayperiod')"
12106
12498
  >
12107
12499
  </kendo-timeselector-messages>
12108
12500
  </kendo-timeselector>
@@ -12119,6 +12511,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12119
12511
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => TimePickerComponent), multi: true },
12120
12512
  { provide: KendoInput, useExisting: forwardRef(() => TimePickerComponent) },
12121
12513
  LocalizationService,
12514
+ BusViewService,
12122
12515
  {
12123
12516
  provide: L10N_PREFIX,
12124
12517
  useValue: 'kendo.timepicker'
@@ -12148,6 +12541,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12148
12541
 
12149
12542
  i18n-toggle="kendo.timepicker.toggle|The label for the toggle button in the timepicker component"
12150
12543
  toggle="Toggle time list"
12544
+
12545
+ i18n-hour="kendo.timepicker.hour|The label for the hour part in the timepicker component"
12546
+ hour="Hour"
12547
+
12548
+ i18n-minute="kendo.timepicker.minute|The label for the minute part in the timepicker component"
12549
+ minute="Minute"
12550
+
12551
+ i18n-second="kendo.timepicker.second|The label for the second part in the timepicker component"
12552
+ second="Second"
12553
+
12554
+ i18n-millisecond="kendo.timepicker.millisecond|The label for the millisecond part in the timepicker component"
12555
+ millisecond="Millisecond"
12556
+
12557
+ i18n-dayperiod="kendo.timepicker.dayperiod|The label for the dayperiod part in the timepicker component"
12558
+ dayperiod="Dayperiod"
12151
12559
  >
12152
12560
  </ng-container>
12153
12561
  <kendo-dateinput
@@ -12157,7 +12565,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12157
12565
  [isPopupOpen]="show"
12158
12566
  [disabled]="disabled"
12159
12567
  [readonly]="readonly || readOnlyInput"
12160
- [role]="inputRole"
12568
+ [role]="'combobox'"
12161
12569
  [ariaReadOnly]="readonly"
12162
12570
  [format]="format"
12163
12571
  [formatPlaceholder]="formatPlaceholder"
@@ -12177,6 +12585,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12177
12585
  <button
12178
12586
  #toggleButton
12179
12587
  type="button"
12588
+ tabindex="-1"
12180
12589
  class="k-input-button k-button k-icon-button"
12181
12590
  [attr.title]="localization.get('toggle')"
12182
12591
  [attr.aria-label]="localization.get('toggle')"
@@ -12213,6 +12622,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12213
12622
  [cancel]="localization.get('cancel')"
12214
12623
  [nowLabel]="localization.get('nowLabel')"
12215
12624
  [now]="localization.get('now')"
12625
+ [hour]="localization.get('hour')"
12626
+ [minute]="localization.get('minute')"
12627
+ [second]="localization.get('second')"
12628
+ [millisecond]="localization.get('millisecond')"
12629
+ [dayperiod]="localization.get('dayperiod')"
12216
12630
  >
12217
12631
  </kendo-timeselector-messages>
12218
12632
  </kendo-timeselector>
@@ -12220,7 +12634,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
12220
12634
  <ng-container #container></ng-container>
12221
12635
  `
12222
12636
  }]
12223
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.PopupService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: PickerService }, { type: i1.IntlService }, { type: undefined, decorators: [{
12637
+ }], ctorParameters: function () { return [{ type: BusViewService }, { type: i0.NgZone }, { type: i1$1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i1$2.PopupService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: PickerService }, { type: i1.IntlService }, { type: undefined, decorators: [{
12224
12638
  type: Optional
12225
12639
  }, {
12226
12640
  type: Inject,
@@ -12385,6 +12799,7 @@ const TWO_DIGIT_YEAR_MAX = 68;
12385
12799
  */
12386
12800
  class DateTimePickerComponent {
12387
12801
  constructor(popupService, intl, cdr, pickerService, ngZone, wrapper, touchEnabled, localization, disabledDatesService, renderer) {
12802
+ var _a;
12388
12803
  this.popupService = popupService;
12389
12804
  this.intl = intl;
12390
12805
  this.cdr = cdr;
@@ -12410,7 +12825,7 @@ class DateTimePickerComponent {
12410
12825
  /**
12411
12826
  * @hidden
12412
12827
  */
12413
- this.focusableId = `k-${guid()}`;
12828
+ this.focusableId = `k-datetimepicker-${(_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id}-`;
12414
12829
  /**
12415
12830
  * Sets the title of the input element of the DateTimePicker.
12416
12831
  */
@@ -12574,6 +12989,12 @@ class DateTimePickerComponent {
12574
12989
  get input() {
12575
12990
  return this.pickerService.input;
12576
12991
  }
12992
+ /**
12993
+ * @hidden
12994
+ */
12995
+ get inputElement() {
12996
+ return this.wrapper.nativeElement.querySelector('input');
12997
+ }
12577
12998
  /**
12578
12999
  * @hidden
12579
13000
  */
@@ -12812,12 +13233,6 @@ class DateTimePickerComponent {
12812
13233
  get disableCalendar() {
12813
13234
  return this.activeTab !== 'date' && !this.calendar.isActive;
12814
13235
  }
12815
- /**
12816
- * @hidden
12817
- */
12818
- get inputRole() {
12819
- return this.readOnlyInput ? 'listbox' : 'spinbutton';
12820
- }
12821
13236
  /**
12822
13237
  * @hidden
12823
13238
  *
@@ -12843,6 +13258,11 @@ class DateTimePickerComponent {
12843
13258
  }
12844
13259
  return appendTo === 'component' ? this.container : appendTo;
12845
13260
  }
13261
+ get popupUID() {
13262
+ var _a;
13263
+ return (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.id;
13264
+ }
13265
+ ;
12846
13266
  ngOnInit() {
12847
13267
  this.subscriptions.add(this.pickerService.onFocus
12848
13268
  // detect popup changes to disable the inactive view mark-up when the popup is open
@@ -13042,6 +13462,9 @@ class DateTimePickerComponent {
13042
13462
  if (event.target !== dateTimeSelector) {
13043
13463
  return;
13044
13464
  }
13465
+ if (this.activeTab === 'time') {
13466
+ this.renderer.removeAttribute(this.inputElement, attributeNames.ariaActiveDescendant);
13467
+ }
13045
13468
  this.activeTabComponent.focus();
13046
13469
  }
13047
13470
  /**
@@ -13094,20 +13517,20 @@ class DateTimePickerComponent {
13094
13517
  }
13095
13518
  const { keyCode, altKey } = event;
13096
13519
  switch (keyCode) {
13097
- case altKey && Keys.ArrowUp:
13098
- case Keys.Escape:
13520
+ case altKey && Keys$1.ArrowUp:
13521
+ case Keys$1.Escape:
13099
13522
  this.handleCancel();
13100
13523
  break;
13101
- case !this.isOpen && altKey && Keys.ArrowDown:
13524
+ case !this.isOpen && altKey && Keys$1.ArrowDown:
13102
13525
  this.ngZone.run(() => this.togglePopup(true));
13103
13526
  break;
13104
- case altKey && Keys.ArrowRight:
13527
+ case altKey && Keys$1.ArrowRight:
13105
13528
  this.changeActiveTab('time');
13106
13529
  break;
13107
- case altKey && Keys.ArrowLeft:
13530
+ case altKey && Keys$1.ArrowLeft:
13108
13531
  this.changeActiveTab('date');
13109
13532
  break;
13110
- case this.isOpen && this.timeSelector.isActive && isPresent(this.calendarValue) && Keys.Enter:
13533
+ case this.isOpen && this.timeSelector.isActive && isPresent(this.calendarValue) && Keys$1.Enter:
13111
13534
  this.handleAccept();
13112
13535
  break;
13113
13536
  default: return;
@@ -13121,7 +13544,7 @@ class DateTimePickerComponent {
13121
13544
  const { keyCode, shiftKey, target } = event;
13122
13545
  // if no focusable next sibling elements exist in the controls sections, the user is tabbing out of the popup
13123
13546
  const focusableSiblingAvailable = isPresent(target.nextElementSibling) && !target.nextElementSibling.disabled;
13124
- if (keyCode === Keys.Tab && !shiftKey && !focusableSiblingAvailable) {
13547
+ if (keyCode === Keys$1.Tab && !shiftKey && !focusableSiblingAvailable) {
13125
13548
  this.input.focus();
13126
13549
  this.handleCancel();
13127
13550
  }
@@ -13131,7 +13554,7 @@ class DateTimePickerComponent {
13131
13554
  */
13132
13555
  handleBackTabOut(event) {
13133
13556
  const { keyCode, shiftKey } = event;
13134
- if (keyCode === Keys.Tab && shiftKey) {
13557
+ if (keyCode === Keys$1.Tab && shiftKey) {
13135
13558
  this.input.focus();
13136
13559
  }
13137
13560
  }
@@ -13251,12 +13674,28 @@ class DateTimePickerComponent {
13251
13674
  anchorAlign: { vertical: 'bottom', horizontal: direction },
13252
13675
  popupAlign: { vertical: 'top', horizontal: direction }
13253
13676
  });
13677
+ this.popupRef.popupElement.setAttribute('id', this.popupUID);
13678
+ this.renderer.setAttribute(this.inputElement, attributeNames.ariaControls, this.popupUID);
13679
+ if (this.activeTab === 'date') {
13680
+ if (this.calendar.type === 'infinite') {
13681
+ this.subscriptions.add(this.calendar.monthView.focusedCellChange.subscribe((id) => {
13682
+ this.renderer.setAttribute(this.inputElement, attributeNames.ariaActiveDescendant, id);
13683
+ }));
13684
+ }
13685
+ else {
13686
+ this.subscriptions.add(this.calendar.multiViewCalendar.viewList.focusedCellChange.subscribe((id) => {
13687
+ this.renderer.setAttribute(this.inputElement, attributeNames.ariaActiveDescendant, id);
13688
+ }));
13689
+ }
13690
+ }
13254
13691
  this.popupRef.popupAnchorViewportLeave.subscribe(() => this.handleCancel());
13255
13692
  }
13256
13693
  closePopup() {
13257
13694
  if (!this.isOpen) {
13258
13695
  return;
13259
13696
  }
13697
+ this.renderer.removeAttribute(this.inputElement, attributeNames.ariaControls);
13698
+ this.renderer.removeAttribute(this.inputElement, attributeNames.ariaActiveDescendant);
13260
13699
  this.popupRef.close();
13261
13700
  this.popupRef = null;
13262
13701
  }
@@ -13331,7 +13770,7 @@ class DateTimePickerComponent {
13331
13770
  }
13332
13771
  }
13333
13772
  }
13334
- DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i2.PopupService }, { token: i1.IntlService }, { token: i0.ChangeDetectorRef }, { token: PickerService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: TOUCH_ENABLED }, { token: i1$1.LocalizationService }, { token: DisabledDatesService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
13773
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i1$2.PopupService }, { token: i1.IntlService }, { token: i0.ChangeDetectorRef }, { token: PickerService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: TOUCH_ENABLED }, { token: i1$1.LocalizationService }, { token: DisabledDatesService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
13335
13774
  DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateTimePickerComponent, selector: "kendo-datetimepicker", inputs: { value: "value", format: "format", twoDigitYearMax: "twoDigitYearMax", tabindex: "tabindex", disabledDates: "disabledDates", popupSettings: "popupSettings", focusableId: "focusableId", title: "title", disabled: "disabled", readonly: "readonly", readOnlyInput: "readOnlyInput", cancelButton: "cancelButton", formatPlaceholder: "formatPlaceholder", placeholder: "placeholder", steps: "steps", focusedDate: "focusedDate", calendarType: "calendarType", animateCalendarNavigation: "animateCalendarNavigation", weekNumber: "weekNumber", min: "min", max: "max", rangeValidation: "rangeValidation", disabledDatesValidation: "disabledDatesValidation", incompleteDateValidation: "incompleteDateValidation", defaultTab: "defaultTab", size: "size", rounded: "rounded", fillMode: "fillMode" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-datetimepicker": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.disabledClass" } }, providers: [
13336
13775
  PickerService,
13337
13776
  LocalizationService,
@@ -13399,7 +13838,7 @@ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
13399
13838
  [placeholder]="placeholder"
13400
13839
  [disabled]="disabled"
13401
13840
  [readonly]="readonly || readOnlyInput"
13402
- [role]="inputRole"
13841
+ [role]="'combobox'"
13403
13842
  [ariaReadOnly]="readonly"
13404
13843
  [steps]="steps"
13405
13844
  [tabindex]="tabindex"
@@ -13658,7 +14097,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
13658
14097
  [placeholder]="placeholder"
13659
14098
  [disabled]="disabled"
13660
14099
  [readonly]="readonly || readOnlyInput"
13661
- [role]="inputRole"
14100
+ [role]="'combobox'"
13662
14101
  [ariaReadOnly]="readonly"
13663
14102
  [steps]="steps"
13664
14103
  [tabindex]="tabindex"
@@ -13844,7 +14283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
13844
14283
  </ng-template>
13845
14284
  `
13846
14285
  }]
13847
- }], ctorParameters: function () { return [{ type: i2.PopupService }, { type: i1.IntlService }, { type: i0.ChangeDetectorRef }, { type: PickerService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: undefined, decorators: [{
14286
+ }], ctorParameters: function () { return [{ type: i1$2.PopupService }, { type: i1.IntlService }, { type: i0.ChangeDetectorRef }, { type: PickerService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: undefined, decorators: [{
13848
14287
  type: Inject,
13849
14288
  args: [TOUCH_ENABLED]
13850
14289
  }] }, { type: i1$1.LocalizationService }, { type: DisabledDatesService }, { type: i0.Renderer2 }]; }, propDecorators: { hostClasses: [{
@@ -13982,7 +14421,10 @@ const hasActiveContent = (popup) => popup && popup.hasActiveContent();
13982
14421
  */
13983
14422
  class DateRangeService {
13984
14423
  /** @hidden */
13985
- constructor() {
14424
+ constructor(renderer) {
14425
+ this.renderer = renderer;
14426
+ /** @hidden */
14427
+ this.focusedCellChange = new Subscription();
13986
14428
  /**
13987
14429
  * An Observable instance that notifies when the `activeRangeEnd` state is changed.
13988
14430
  */
@@ -14047,10 +14489,19 @@ class DateRangeService {
14047
14489
  * The method opens the popup and focuses the calendar.
14048
14490
  */
14049
14491
  activatePopup() {
14492
+ var _a;
14050
14493
  const dateRangePopup = this.dateRangePopup$.value;
14051
14494
  if (!dateRangePopup) {
14052
14495
  return;
14053
14496
  }
14497
+ if (this.startInput$.value) {
14498
+ const inputElement = this.startInput$.value.dateInput.nativeElement;
14499
+ this.renderer.setAttribute(inputElement, attributeNames.ariaControls, dateRangePopup.popupUID);
14500
+ this.renderer.setAttribute(inputElement, attributeNames.ariaExpanded, 'true');
14501
+ this.focusedCellChange = (_a = dateRangePopup.viewCalendar.first) === null || _a === void 0 ? void 0 : _a.viewList.focusedCellChange.subscribe((id) => {
14502
+ this.renderer.setAttribute(inputElement, attributeNames.ariaActiveDescendant, id);
14503
+ });
14504
+ }
14054
14505
  dateRangePopup.activate();
14055
14506
  }
14056
14507
  /**
@@ -14058,10 +14509,18 @@ class DateRangeService {
14058
14509
  * The method closes the popup.
14059
14510
  */
14060
14511
  deactivatePopup() {
14512
+ var _a;
14061
14513
  const dateRangePopup = this.dateRangePopup$.value;
14062
14514
  if (!(dateRangePopup && dateRangePopup.show)) {
14063
14515
  return;
14064
14516
  }
14517
+ if (this.startInput$.value) {
14518
+ const inputElement = this.startInput$.value.dateInput.nativeElement;
14519
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaControls);
14520
+ this.renderer.setAttribute(inputElement, attributeNames.ariaExpanded, 'false');
14521
+ (_a = this.focusedCellChange) === null || _a === void 0 ? void 0 : _a.unsubscribe();
14522
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaActiveDescendant);
14523
+ }
14065
14524
  dateRangePopup.show = false;
14066
14525
  }
14067
14526
  /**
@@ -14145,11 +14604,13 @@ class DateRangeService {
14145
14604
  this.range$.next(range);
14146
14605
  }
14147
14606
  }
14148
- DateRangeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14607
+ DateRangeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeService, deps: [{ token: i0.Renderer2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
14149
14608
  DateRangeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeService });
14150
14609
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeService, decorators: [{
14151
14610
  type: Injectable
14152
- }], ctorParameters: function () { return []; } });
14611
+ }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
14612
+ type: Optional
14613
+ }] }]; } });
14153
14614
 
14154
14615
  /**
14155
14616
  * A directive which manages the MultiViewCalendar range selection.
@@ -14180,7 +14641,7 @@ class DateRangeSelectionDirective {
14180
14641
  */
14181
14642
  this.selectionRangeChange = new EventEmitter();
14182
14643
  this.calendarSubscriptions = new Subscription();
14183
- this.dateRangeService = this.dateRangeService || new DateRangeService();
14644
+ this.dateRangeService = this.dateRangeService || new DateRangeService(renderer);
14184
14645
  renderer.setAttribute(element.nativeElement, 'aria-multiselectable', 'true');
14185
14646
  }
14186
14647
  /**
@@ -14549,7 +15010,7 @@ class DateRangePopupComponent {
14549
15010
  }
14550
15011
  handleKeydown(event) {
14551
15012
  const { altKey, keyCode } = event;
14552
- if (keyCode === Keys.Escape || (altKey && keyCode === Keys.ArrowUp)) {
15013
+ if (keyCode === Keys$1.Escape || (altKey && keyCode === Keys$1.ArrowUp)) {
14553
15014
  this.zone.run(() => this.cancelPopup());
14554
15015
  }
14555
15016
  }
@@ -14561,9 +15022,9 @@ class DateRangePopupComponent {
14561
15022
  if (!calendar) {
14562
15023
  return;
14563
15024
  }
14564
- const nativeElement = calendar.element.nativeElement;
14565
- this.blurSubscription = fromEvent(nativeElement, 'blur').subscribe(() => this.onBlur.emit());
14566
- this.focusSubscription = fromEvent(nativeElement, 'focus').subscribe(() => this.onFocus.emit());
15025
+ const calendarElement = calendar.element.nativeElement.querySelector('.k-calendar-view');
15026
+ this.blurSubscription = fromEvent(calendarElement, 'blur').subscribe(() => this.onBlur.emit());
15027
+ this.focusSubscription = fromEvent(calendarElement, 'focus').subscribe(() => this.onFocus.emit());
14567
15028
  }
14568
15029
  addPopupSubscriptions(...subscriptions) {
14569
15030
  if (!isPresent(this.popupSubscriptions)) {
@@ -14611,13 +15072,13 @@ class DateRangePopupComponent {
14611
15072
  }
14612
15073
  }
14613
15074
  }
14614
- DateRangePopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangePopupComponent, deps: [{ token: i2.PopupService }, { token: DateRangeService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: RTL, optional: true }], target: i0.ɵɵFactoryTarget.Component });
15075
+ DateRangePopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangePopupComponent, deps: [{ token: i1$2.PopupService }, { token: DateRangeService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: RTL, optional: true }], target: i0.ɵɵFactoryTarget.Component });
14615
15076
  DateRangePopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangePopupComponent, selector: "kendo-daterange-popup", inputs: { animate: "animate", anchor: "anchor", anchorAlign: "anchorAlign", appendTo: "appendTo", collision: "collision", popupAlign: "popupAlign", margin: "margin" }, outputs: { open: "open", close: "close", onBlur: "blur", onFocus: "focus", cancel: "cancel" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: DateRangePopupTemplateDirective, descendants: true }, { propertyName: "contentCalendar", predicate: MultiViewCalendarComponent }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }, { propertyName: "defaultTemplate", first: true, predicate: ["defaultTemplate"], descendants: true }, { propertyName: "viewCalendar", predicate: MultiViewCalendarComponent, descendants: true }], exportAs: ["kendo-daterange-popup"], ngImport: i0, template: `
14616
15077
  <ng-container #container></ng-container>
14617
15078
  <ng-template #defaultTemplate>
14618
15079
  <kendo-multiviewcalendar kendoDateRangeSelection></kendo-multiviewcalendar>
14619
15080
  </ng-template>
14620
- `, isInline: true, components: [{ type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur"], exportAs: ["kendo-multiviewcalendar"] }], directives: [{ type: DateRangeSelectionDirective, selector: "[kendoDateRangeSelection]", inputs: ["autoCorrectOn", "selectionRange", "activeRangeEnd"], outputs: ["activeRangeEndChange", "selectionRangeChange"] }] });
15081
+ `, isInline: true, components: [{ type: MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur", "focusCalendar"], exportAs: ["kendo-multiviewcalendar"] }], directives: [{ type: DateRangeSelectionDirective, selector: "[kendoDateRangeSelection]", inputs: ["autoCorrectOn", "selectionRange", "activeRangeEnd"], outputs: ["activeRangeEndChange", "selectionRangeChange"] }] });
14621
15082
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangePopupComponent, decorators: [{
14622
15083
  type: Component,
14623
15084
  args: [{
@@ -14630,7 +15091,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
14630
15091
  </ng-template>
14631
15092
  `
14632
15093
  }]
14633
- }], ctorParameters: function () { return [{ type: i2.PopupService }, { type: DateRangeService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
15094
+ }], ctorParameters: function () { return [{ type: i1$2.PopupService }, { type: DateRangeService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
14634
15095
  type: Optional
14635
15096
  }, {
14636
15097
  type: Inject,
@@ -14698,7 +15159,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
14698
15159
  * ```
14699
15160
  */
14700
15161
  class DateRangeComponent {
14701
- constructor() {
15162
+ constructor(dateRangeService) {
15163
+ this.dateRangeService = dateRangeService;
14702
15164
  this.wrapperClass = true;
14703
15165
  /**
14704
15166
  * @hidden
@@ -14706,6 +15168,19 @@ class DateRangeComponent {
14706
15168
  this.showDefault = false;
14707
15169
  validatePackage(packageMetadata);
14708
15170
  }
15171
+ /**
15172
+ * @hidden
15173
+ */
15174
+ keydown(event) {
15175
+ const shouldOpenPopup = event.keyCode === Keys$1.ArrowDown && event.altKey;
15176
+ if (shouldOpenPopup) {
15177
+ this.dateRangeService.activatePopup();
15178
+ }
15179
+ const shouldClosePopup = (event.keyCode === Keys$1.ArrowUp && event.altKey) || event.keyCode === Keys$1.Escape;
15180
+ if (shouldClosePopup) {
15181
+ this.dateRangeService.deactivatePopup();
15182
+ }
15183
+ }
14709
15184
  get hasContentPopup() {
14710
15185
  return this.contentPopup.length > 0;
14711
15186
  }
@@ -14716,13 +15191,12 @@ class DateRangeComponent {
14716
15191
  });
14717
15192
  }
14718
15193
  ngOnDestroy() {
14719
- if (this.subscription) {
14720
- this.subscription.unsubscribe();
14721
- }
15194
+ var _a;
15195
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
14722
15196
  }
14723
15197
  }
14724
- DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14725
- DateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeComponent, selector: "kendo-daterange", host: { properties: { "class.k-daterangepicker": "this.wrapperClass" } }, providers: [DateRangeService], queries: [{ propertyName: "contentPopup", predicate: DateRangePopupComponent }], ngImport: i0, template: `
15198
+ DateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeComponent, deps: [{ token: DateRangeService }], target: i0.ɵɵFactoryTarget.Component });
15199
+ DateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeComponent, selector: "kendo-daterange", host: { listeners: { "keydown": "keydown($event)" }, properties: { "class.k-daterangepicker": "this.wrapperClass" } }, providers: [DateRangeService], queries: [{ propertyName: "contentPopup", predicate: DateRangePopupComponent }], ngImport: i0, template: `
14726
15200
  <ng-content></ng-content>
14727
15201
  <kendo-daterange-popup *ngIf="showDefault"></kendo-daterange-popup>
14728
15202
  `, isInline: true, components: [{ type: DateRangePopupComponent, selector: "kendo-daterange-popup", inputs: ["animate", "anchor", "anchorAlign", "appendTo", "collision", "popupAlign", "margin"], outputs: ["open", "close", "blur", "focus", "cancel"], exportAs: ["kendo-daterange-popup"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
@@ -14736,7 +15210,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
14736
15210
  <kendo-daterange-popup *ngIf="showDefault"></kendo-daterange-popup>
14737
15211
  `
14738
15212
  }]
14739
- }], ctorParameters: function () { return []; }, propDecorators: { wrapperClass: [{
15213
+ }], ctorParameters: function () { return [{ type: DateRangeService }]; }, propDecorators: { keydown: [{
15214
+ type: HostListener,
15215
+ args: ['keydown', ['$event']]
15216
+ }], wrapperClass: [{
14740
15217
  type: HostBinding,
14741
15218
  args: ['class.k-daterangepicker']
14742
15219
  }], contentPopup: [{
@@ -14832,10 +15309,10 @@ class DateRangeInput {
14832
15309
  }
14833
15310
  }
14834
15311
  togglePopup({ altKey, keyCode }) {
14835
- if (keyCode === Keys.Escape) {
15312
+ if (keyCode === Keys$1.Escape) {
14836
15313
  this.dateRangeService.cancelPopup();
14837
15314
  }
14838
- else if (altKey && keyCode === Keys.ArrowDown) {
15315
+ else if (altKey && keyCode === Keys$1.ArrowDown) {
14839
15316
  this.dateRangeService.activatePopup();
14840
15317
  }
14841
15318
  }
@@ -14852,6 +15329,12 @@ class DateRangeInput {
14852
15329
  }
14853
15330
  }
14854
15331
  }
15332
+ DateRangeInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeInput, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
15333
+ DateRangeInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DateRangeInput, ngImport: i0 });
15334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DateRangeInput, decorators: [{
15335
+ type: Directive,
15336
+ args: [{}]
15337
+ }], ctorParameters: function () { return [{ type: undefined }, { type: DateRangeService }, { type: DateInputComponent }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; } });
14855
15338
 
14856
15339
  /**
14857
15340
  * A directive which manages the end range selection.
@@ -14893,6 +15376,10 @@ class DateRangeEndInputDirective extends DateRangeInput {
14893
15376
  this.rangeService.registerEndInput(this.dateInput);
14894
15377
  super.init();
14895
15378
  }
15379
+ ngAfterViewInit() {
15380
+ const inputElement = this.dateInput.inputElement;
15381
+ this.renderer.removeAttribute(inputElement, attributeNames.ariaExpanded);
15382
+ }
14896
15383
  ngOnDestroy() {
14897
15384
  super.destroy();
14898
15385
  }
@@ -14938,6 +15425,7 @@ class DateRangeStartInputDirective extends DateRangeInput {
14938
15425
  super('start', rangeService, dateInput, element, renderer, zone);
14939
15426
  this.rangeService = rangeService;
14940
15427
  this.dateInput = dateInput;
15428
+ this.renderer = renderer;
14941
15429
  /**
14942
15430
  * Specifies the navigation behavior of the calendar when the active end is changed on input focus.
14943
15431
  * When enabled, the calendar navigates to the value of the focused input. Otherwise, the calendar
@@ -14969,6 +15457,11 @@ class DateRangeStartInputDirective extends DateRangeInput {
14969
15457
  this.rangeService.registerStartInput(this.dateInput);
14970
15458
  super.init();
14971
15459
  }
15460
+ ngAfterViewInit() {
15461
+ const inputElement = this.dateInput.inputElement;
15462
+ this.renderer.setAttribute(inputElement, 'role', 'combobox');
15463
+ this.renderer.setAttribute(inputElement, attributeNames.ariaHasPopup, 'true');
15464
+ }
14972
15465
  ngOnDestroy() {
14973
15466
  super.destroy();
14974
15467
  }