@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.
- package/bundles/kendo-angular-dateinputs.umd.js +1 -1
- package/calendar/calendar.component.d.ts +7 -2
- package/calendar/header.component.d.ts +4 -1
- package/calendar/horizontal-view-list.component.d.ts +17 -1
- package/calendar/localization/calendar-messages.d.ts +5 -1
- package/calendar/localization/multiview-calendar-messages.d.ts +5 -1
- package/calendar/multiview-calendar.component.d.ts +21 -11
- package/calendar/services/bus-view.service.d.ts +1 -0
- package/calendar/services/selection.service.d.ts +2 -0
- package/calendar/services/weeknames.service.d.ts +1 -1
- package/calendar/view-list.component.d.ts +9 -1
- package/calendar/view.component.d.ts +3 -1
- package/common/utils.d.ts +33 -0
- package/dateinput/dateinput.component.d.ts +16 -6
- package/datepicker/datepicker.component.d.ts +1 -5
- package/daterange/date-range-end-input.directive.d.ts +1 -0
- package/daterange/date-range-input.d.ts +4 -1
- package/daterange/date-range-start-input.directive.d.ts +2 -0
- package/daterange/date-range.component.d.ts +7 -1
- package/daterange/date-range.service.d.ts +6 -2
- package/datetimepicker/datetimepicker.component.d.ts +5 -4
- package/esm2015/calendar/calendar.component.js +85 -48
- package/esm2015/calendar/header.component.js +30 -3
- package/esm2015/calendar/horizontal-view-list.component.js +83 -11
- package/esm2015/calendar/localization/calendar-messages.js +3 -1
- package/esm2015/calendar/localization/multiview-calendar-messages.js +3 -1
- package/esm2015/calendar/multiview-calendar.component.js +87 -45
- package/esm2015/calendar/services/bus-view.service.js +2 -0
- package/esm2015/calendar/services/month-view.service.js +1 -1
- package/esm2015/calendar/services/selection.service.js +4 -0
- package/esm2015/calendar/services/weeknames.service.js +2 -2
- package/esm2015/calendar/view-list.component.js +45 -9
- package/esm2015/calendar/view.component.js +16 -3
- package/esm2015/common/utils.js +34 -0
- package/esm2015/dateinput/dateinput.component.js +52 -23
- package/esm2015/datepicker/datepicker.component.js +25 -11
- package/esm2015/daterange/date-range-end-input.directive.js +5 -1
- package/esm2015/daterange/date-range-input.js +10 -0
- package/esm2015/daterange/date-range-popup.component.js +4 -4
- package/esm2015/daterange/date-range-selection.directive.js +1 -1
- package/esm2015/daterange/date-range-start-input.directive.js +7 -0
- package/esm2015/daterange/date-range.component.js +29 -11
- package/esm2015/daterange/date-range.service.js +28 -4
- package/esm2015/datetimepicker/datetimepicker.component.js +36 -11
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/timepicker/localization/messages.js +11 -1
- package/esm2015/timepicker/timelist.component.js +57 -10
- package/esm2015/timepicker/timepicker.component.js +71 -24
- package/esm2015/util.js +2 -2
- package/fesm2015/kendo-angular-dateinputs.js +773 -280
- package/package.json +1 -1
- package/timepicker/localization/messages.d.ts +21 -1
- package/timepicker/timelist.component.d.ts +10 -1
- package/timepicker/timepicker.component.d.ts +5 -7
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/* eslint-disable @angular-eslint/component-selector */
|
|
6
|
-
import { Component, ChangeDetectionStrategy, EventEmitter, HostBinding, Input, Output } from '@angular/core';
|
|
6
|
+
import { Component, ChangeDetectionStrategy, EventEmitter, HostBinding, Input, Output, HostListener } from '@angular/core';
|
|
7
7
|
import { cloneDate } from '@progress/kendo-date-math';
|
|
8
8
|
import { Action } from './models/navigation-action.enum';
|
|
9
9
|
import { CalendarViewEnum } from './models/view.enum';
|
|
10
10
|
import { MIN_DATE, MAX_DATE } from '../defaults';
|
|
11
11
|
import { dateInRange, hasChange } from '../util';
|
|
12
12
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
13
|
-
import { isPresent } from '../common/utils';
|
|
13
|
+
import { attributeNames, isPresent } from '../common/utils';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
15
|
import * as i1 from "./services/bus-view.service";
|
|
16
16
|
import * as i2 from "@progress/kendo-angular-intl";
|
|
@@ -39,16 +39,28 @@ export class HorizontalViewListComponent {
|
|
|
39
39
|
this.showViewHeader = false;
|
|
40
40
|
this.animateNavigation = false;
|
|
41
41
|
this.orientation = 'horizontal';
|
|
42
|
+
this.tabIndex = 0;
|
|
43
|
+
this.disabled = false;
|
|
42
44
|
this.cellClick = new EventEmitter();
|
|
43
45
|
this.weekNumberCellClick = new EventEmitter();
|
|
44
46
|
this.cellEnter = new EventEmitter();
|
|
45
47
|
this.cellLeave = new EventEmitter();
|
|
46
48
|
this.activeDateChange = new EventEmitter();
|
|
49
|
+
this.focusCalendar = new EventEmitter();
|
|
50
|
+
this.blurCalendar = new EventEmitter();
|
|
51
|
+
this.focusedCellChange = new EventEmitter();
|
|
47
52
|
this.getComponentClass = true;
|
|
48
53
|
this.weekNames = [];
|
|
54
|
+
this.wideWeekNames = [];
|
|
49
55
|
this.dates = [];
|
|
50
56
|
this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));
|
|
51
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
handleFocus() {
|
|
62
|
+
this.focusCalendar.emit();
|
|
63
|
+
}
|
|
52
64
|
get weekNumber() {
|
|
53
65
|
return this.showWeekNumbers && this.isMonthView();
|
|
54
66
|
}
|
|
@@ -73,10 +85,17 @@ export class HorizontalViewListComponent {
|
|
|
73
85
|
get getComponentCenturyClass() {
|
|
74
86
|
return this.activeView === CalendarViewEnum.century;
|
|
75
87
|
}
|
|
88
|
+
get getActiveDescendant() {
|
|
89
|
+
return this.views === 1 ? this.activeDescendant : null;
|
|
90
|
+
}
|
|
91
|
+
get getTabIndex() {
|
|
92
|
+
return this.disabled || this.views === 2 ? null : this.tabIndex;
|
|
93
|
+
}
|
|
76
94
|
ngOnChanges(changes) {
|
|
77
95
|
this.initService();
|
|
78
96
|
if (this.weekNames.length === 0 || changes.weekNumber) {
|
|
79
|
-
this.weekNames = this.
|
|
97
|
+
this.weekNames = this.getWeekNames('short');
|
|
98
|
+
this.wideWeekNames = this.getWeekNames('wide');
|
|
80
99
|
}
|
|
81
100
|
if (!this.service) {
|
|
82
101
|
return;
|
|
@@ -93,6 +112,11 @@ export class HorizontalViewListComponent {
|
|
|
93
112
|
this.activeDate = cloneDate(this.dates[0]);
|
|
94
113
|
this.activeDateChange.emit(this.activeDate);
|
|
95
114
|
}
|
|
115
|
+
this.setAriaActivedescendant();
|
|
116
|
+
//set tabindex for MultiViewCalendar
|
|
117
|
+
if (this.views === 2) {
|
|
118
|
+
this.renderer.setAttribute(this.element.nativeElement, 'tabindex', this.tabIndex.toString());
|
|
119
|
+
}
|
|
96
120
|
}
|
|
97
121
|
ngAfterViewInit() {
|
|
98
122
|
// make the calendar look the same in the different browsers
|
|
@@ -197,6 +221,9 @@ export class HorizontalViewListComponent {
|
|
|
197
221
|
}
|
|
198
222
|
return this.isListInRange(this.service.datesList(this.move(action), this.getTake(this.skip)));
|
|
199
223
|
}
|
|
224
|
+
getWeekNames(type) {
|
|
225
|
+
return this.weekService.getWeekNames(this.weekNumber, type);
|
|
226
|
+
}
|
|
200
227
|
setTableMinWidth() {
|
|
201
228
|
const container = this.element.nativeElement;
|
|
202
229
|
const table = container.querySelector('table');
|
|
@@ -206,7 +233,8 @@ export class HorizontalViewListComponent {
|
|
|
206
233
|
}
|
|
207
234
|
}
|
|
208
235
|
intlChange() {
|
|
209
|
-
this.weekNames = this.
|
|
236
|
+
this.weekNames = this.getWeekNames('short');
|
|
237
|
+
this.wideWeekNames = this.getWeekNames('wide');
|
|
210
238
|
this.cdr.markForCheck();
|
|
211
239
|
}
|
|
212
240
|
clampDate(value) {
|
|
@@ -226,19 +254,34 @@ export class HorizontalViewListComponent {
|
|
|
226
254
|
getTake(skip) {
|
|
227
255
|
return Math.min(this.total - skip, this.views);
|
|
228
256
|
}
|
|
257
|
+
setAriaActivedescendant() {
|
|
258
|
+
if (this.views === 2) {
|
|
259
|
+
this.renderer.setAttribute(this.element.nativeElement, attributeNames.ariaActiveDescendant, this.activeDescendant);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
229
262
|
}
|
|
230
263
|
HorizontalViewListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HorizontalViewListComponent, deps: [{ token: i1.BusViewService }, { token: i2.IntlService }, { token: i3.WeekNamesService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
231
|
-
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: `
|
|
264
|
+
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: `
|
|
232
265
|
<ng-template #tableTemplate let-date="date" let-class="className">
|
|
233
266
|
<table
|
|
234
267
|
role="grid"
|
|
235
268
|
class="k-content k-calendar-table"
|
|
236
269
|
[ngClass]="class"
|
|
270
|
+
[attr.aria-labelledby]="id"
|
|
271
|
+
[attr.aria-activedescendant]="getActiveDescendant"
|
|
272
|
+
[attr.tabindex]="getTabIndex"
|
|
273
|
+
(focus)="focusCalendar.emit()"
|
|
274
|
+
(focusout)="blurCalendar.emit($event)"
|
|
237
275
|
>
|
|
238
276
|
<caption *ngIf="showViewHeader" [ngClass]="getCaptionClass()">{{ getCaptionTitle(date) }}</caption>
|
|
239
|
-
<thead *ngIf="isMonthView()" class="k-calendar-thead">
|
|
277
|
+
<thead *ngIf="isMonthView()" class="k-calendar-thead" role="rowgroup">
|
|
240
278
|
<tr class="k-calendar-tr" role="row">
|
|
241
|
-
<th *ngFor="let name of weekNames
|
|
279
|
+
<th *ngFor="let name of weekNames; let i = index;"
|
|
280
|
+
class="k-calendar-th"
|
|
281
|
+
scope="col"
|
|
282
|
+
[attr.aria-label]="wideWeekNames[i]"
|
|
283
|
+
role="columnheader"
|
|
284
|
+
>{{name}}</th>
|
|
242
285
|
</tr>
|
|
243
286
|
</thead>
|
|
244
287
|
<tbody
|
|
@@ -263,6 +306,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
263
306
|
(weekNumberCellClick)="weekNumberCellClick.emit($event)"
|
|
264
307
|
(cellEnter)="cellEnter.emit($event)"
|
|
265
308
|
(cellLeave)="cellLeave.emit($event)"
|
|
309
|
+
(focusedCellId)="focusedCellChange.emit($event)"
|
|
266
310
|
>
|
|
267
311
|
</tbody>
|
|
268
312
|
</table>
|
|
@@ -298,7 +342,7 @@ HorizontalViewListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
298
342
|
}"
|
|
299
343
|
>
|
|
300
344
|
</ng-template>
|
|
301
|
-
`, isInline: true, components: [{ type: i4.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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
345
|
+
`, isInline: true, components: [{ type: i4.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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.KForOf, selector: "[kFor][kForOf]", inputs: ["kForOf", "kForTrackBy", "kForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
302
346
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HorizontalViewListComponent, decorators: [{
|
|
303
347
|
type: Component,
|
|
304
348
|
args: [{
|
|
@@ -310,11 +354,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
310
354
|
role="grid"
|
|
311
355
|
class="k-content k-calendar-table"
|
|
312
356
|
[ngClass]="class"
|
|
357
|
+
[attr.aria-labelledby]="id"
|
|
358
|
+
[attr.aria-activedescendant]="getActiveDescendant"
|
|
359
|
+
[attr.tabindex]="getTabIndex"
|
|
360
|
+
(focus)="focusCalendar.emit()"
|
|
361
|
+
(focusout)="blurCalendar.emit($event)"
|
|
313
362
|
>
|
|
314
363
|
<caption *ngIf="showViewHeader" [ngClass]="getCaptionClass()">{{ getCaptionTitle(date) }}</caption>
|
|
315
|
-
<thead *ngIf="isMonthView()" class="k-calendar-thead">
|
|
364
|
+
<thead *ngIf="isMonthView()" class="k-calendar-thead" role="rowgroup">
|
|
316
365
|
<tr class="k-calendar-tr" role="row">
|
|
317
|
-
<th *ngFor="let name of weekNames
|
|
366
|
+
<th *ngFor="let name of weekNames; let i = index;"
|
|
367
|
+
class="k-calendar-th"
|
|
368
|
+
scope="col"
|
|
369
|
+
[attr.aria-label]="wideWeekNames[i]"
|
|
370
|
+
role="columnheader"
|
|
371
|
+
>{{name}}</th>
|
|
318
372
|
</tr>
|
|
319
373
|
</thead>
|
|
320
374
|
<tbody
|
|
@@ -339,6 +393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
339
393
|
(weekNumberCellClick)="weekNumberCellClick.emit($event)"
|
|
340
394
|
(cellEnter)="cellEnter.emit($event)"
|
|
341
395
|
(cellLeave)="cellLeave.emit($event)"
|
|
396
|
+
(focusedCellId)="focusedCellChange.emit($event)"
|
|
342
397
|
>
|
|
343
398
|
</tbody>
|
|
344
399
|
</table>
|
|
@@ -376,7 +431,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
376
431
|
</ng-template>
|
|
377
432
|
`
|
|
378
433
|
}]
|
|
379
|
-
}], ctorParameters: function () { return [{ type: i1.BusViewService }, { type: i2.IntlService }, { type: i3.WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: {
|
|
434
|
+
}], ctorParameters: function () { return [{ type: i1.BusViewService }, { type: i2.IntlService }, { type: i3.WeekNamesService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { handleFocus: [{
|
|
435
|
+
type: HostListener,
|
|
436
|
+
args: ["focus"]
|
|
437
|
+
}], cellTemplateRef: [{
|
|
380
438
|
type: Input
|
|
381
439
|
}], weekNumberTemplateRef: [{
|
|
382
440
|
type: Input
|
|
@@ -406,6 +464,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
406
464
|
type: Input
|
|
407
465
|
}], orientation: [{
|
|
408
466
|
type: Input
|
|
467
|
+
}], activeDescendant: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], tabIndex: [{
|
|
470
|
+
type: Input
|
|
471
|
+
}], disabled: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], id: [{
|
|
474
|
+
type: Input
|
|
409
475
|
}], weekNumber: [{
|
|
410
476
|
type: Input
|
|
411
477
|
}], cellClick: [{
|
|
@@ -418,6 +484,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
418
484
|
type: Output
|
|
419
485
|
}], activeDateChange: [{
|
|
420
486
|
type: Output
|
|
487
|
+
}], focusCalendar: [{
|
|
488
|
+
type: Output
|
|
489
|
+
}], blurCalendar: [{
|
|
490
|
+
type: Output
|
|
491
|
+
}], focusedCellChange: [{
|
|
492
|
+
type: Output
|
|
421
493
|
}], getComponentClass: [{
|
|
422
494
|
type: HostBinding,
|
|
423
495
|
args: ["class.k-calendar-view"]
|
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export class CalendarMessages extends ComponentMessages {
|
|
12
12
|
}
|
|
13
13
|
CalendarMessages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
-
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 });
|
|
14
|
+
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 });
|
|
15
15
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CalendarMessages, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
@@ -24,4 +24,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
24
24
|
type: Input
|
|
25
25
|
}], nextButtonTitle: [{
|
|
26
26
|
type: Input
|
|
27
|
+
}], parentViewButtonTitle: [{
|
|
28
|
+
type: Input
|
|
27
29
|
}] } });
|
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
export class Messages extends ComponentMessages {
|
|
12
12
|
}
|
|
13
13
|
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
-
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, selector: "kendo-multiview-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle" }, usesInheritance: true, ngImport: i0 });
|
|
14
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, selector: "kendo-multiview-calendar-messages-base", inputs: { today: "today", prevButtonTitle: "prevButtonTitle", nextButtonTitle: "nextButtonTitle", parentViewButtonTitle: "parentViewButtonTitle" }, usesInheritance: true, ngImport: i0 });
|
|
15
15
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
@@ -24,4 +24,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
24
24
|
type: Input
|
|
25
25
|
}], nextButtonTitle: [{
|
|
26
26
|
type: Input
|
|
27
|
+
}], parentViewButtonTitle: [{
|
|
28
|
+
type: Input
|
|
27
29
|
}] } });
|
|
@@ -10,7 +10,6 @@ import { hasObservers, guid, Keys } from '@progress/kendo-angular-common';
|
|
|
10
10
|
import { HorizontalViewListComponent } from './horizontal-view-list.component';
|
|
11
11
|
import { HeaderComponent } from './header.component';
|
|
12
12
|
import { BusViewService } from './services/bus-view.service';
|
|
13
|
-
import { NavigationService } from './services/navigation.service';
|
|
14
13
|
import { SelectionService } from './services/selection.service';
|
|
15
14
|
import { DisabledDatesService } from './services/disabled-dates.service';
|
|
16
15
|
import { CellTemplateDirective } from './templates/cell-template.directive';
|
|
@@ -28,7 +27,8 @@ import { disabledDatesRangeValidator } from '../validators/disabled-dates-range.
|
|
|
28
27
|
import { MIN_DATE, MAX_DATE } from '../defaults';
|
|
29
28
|
import { areDatesEqual, dateInRange, getToday, hasExistingValue, last, noop } from '../util';
|
|
30
29
|
import { Subscription } from 'rxjs';
|
|
31
|
-
import { isPresent } from '../common/utils';
|
|
30
|
+
import { isArrowWithShiftPressed, isPresent } from '../common/utils';
|
|
31
|
+
import { NavigationService } from './services/navigation.service';
|
|
32
32
|
import * as i0 from "@angular/core";
|
|
33
33
|
import * as i1 from "./services/bus-view.service";
|
|
34
34
|
import * as i2 from "./services/navigation.service";
|
|
@@ -37,7 +37,6 @@ import * as i4 from "./services/selection.service";
|
|
|
37
37
|
import * as i5 from "./header.component";
|
|
38
38
|
import * as i6 from "./horizontal-view-list.component";
|
|
39
39
|
import * as i7 from "./localization/multiview-calendar-localized-messages.directive";
|
|
40
|
-
import * as i8 from "@progress/kendo-angular-common";
|
|
41
40
|
const BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';
|
|
42
41
|
const TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';
|
|
43
42
|
const MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';
|
|
@@ -83,10 +82,6 @@ export class MultiViewCalendarComponent {
|
|
|
83
82
|
this.zone = zone;
|
|
84
83
|
this.disabledDatesService = disabledDatesService;
|
|
85
84
|
this.selectionService = selectionService;
|
|
86
|
-
/**
|
|
87
|
-
* @hidden
|
|
88
|
-
*/
|
|
89
|
-
this.id = guid();
|
|
90
85
|
/**
|
|
91
86
|
* Determines whether the built-in min or max validators are enforced when validating a form.
|
|
92
87
|
*/
|
|
@@ -122,10 +117,6 @@ export class MultiViewCalendarComponent {
|
|
|
122
117
|
* @hidden
|
|
123
118
|
*/
|
|
124
119
|
this.isActive = false;
|
|
125
|
-
/**
|
|
126
|
-
* @hidden
|
|
127
|
-
*/
|
|
128
|
-
this.isHeaderActive = false;
|
|
129
120
|
/**
|
|
130
121
|
* Defines the active view that the Calendar initially renders
|
|
131
122
|
* ([see example]({% slug activeview_multiviewcalendar %})).
|
|
@@ -202,6 +193,10 @@ export class MultiViewCalendarComponent {
|
|
|
202
193
|
* @hidden
|
|
203
194
|
*/
|
|
204
195
|
this.blurEvent = new EventEmitter();
|
|
196
|
+
/**
|
|
197
|
+
* @hidden
|
|
198
|
+
*/
|
|
199
|
+
this.focusCalendar = new EventEmitter();
|
|
205
200
|
this.cellUID = guid();
|
|
206
201
|
this.isHovered = false;
|
|
207
202
|
this.isPrevDisabled = true;
|
|
@@ -221,6 +216,7 @@ export class MultiViewCalendarComponent {
|
|
|
221
216
|
this.disabledDatesRangeValidateFn = noop;
|
|
222
217
|
this.subscriptions = new Subscription();
|
|
223
218
|
this.setClasses(element.nativeElement);
|
|
219
|
+
this.id = `kendo-multiviewcalendarid-${this.bus.calendarId}-`;
|
|
224
220
|
}
|
|
225
221
|
/**
|
|
226
222
|
* Sets or gets the `focusedDate` property of the Calendar and
|
|
@@ -235,6 +231,24 @@ export class MultiViewCalendarComponent {
|
|
|
235
231
|
get focusedDate() {
|
|
236
232
|
return this._focusedDate;
|
|
237
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @hidden
|
|
236
|
+
*/
|
|
237
|
+
get headerId() {
|
|
238
|
+
return this.id + 'header-';
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* @hidden
|
|
242
|
+
*/
|
|
243
|
+
get multiViewCalendarHeaderIdLabel() {
|
|
244
|
+
return this.views === 2 ? this.id + 'header-' : null;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @hidden
|
|
248
|
+
*/
|
|
249
|
+
get calendarHeaderIdLabel() {
|
|
250
|
+
return this.views === 1 ? this.id + 'header-' : null;
|
|
251
|
+
}
|
|
238
252
|
/**
|
|
239
253
|
* Sets or gets the `min` property of the Calendar and
|
|
240
254
|
* defines the minimum allowed date value.
|
|
@@ -405,14 +419,14 @@ export class MultiViewCalendarComponent {
|
|
|
405
419
|
return CalendarViewEnum[this.topView];
|
|
406
420
|
}
|
|
407
421
|
get widgetId() {
|
|
408
|
-
return this.id;
|
|
409
|
-
}
|
|
410
|
-
get calendarTabIndex() {
|
|
411
|
-
return this.disabled ? undefined : this.tabIndex;
|
|
422
|
+
return this.views === 2 ? this.id : null;
|
|
412
423
|
}
|
|
413
424
|
get ariaDisabled() {
|
|
414
425
|
return this.disabled;
|
|
415
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* @hidden
|
|
429
|
+
*/
|
|
416
430
|
get ariaActivedescendant() {
|
|
417
431
|
return this.cellUID + this.focusedDate.getTime();
|
|
418
432
|
}
|
|
@@ -427,14 +441,13 @@ export class MultiViewCalendarComponent {
|
|
|
427
441
|
}
|
|
428
442
|
this.isActive = false;
|
|
429
443
|
this.isHovered = false; //ensure that hovered is also not active
|
|
430
|
-
this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
|
|
431
444
|
}
|
|
432
445
|
/**
|
|
433
446
|
* @hidden
|
|
434
447
|
*/
|
|
435
448
|
handleFocus() {
|
|
436
449
|
this.isActive = true;
|
|
437
|
-
this.
|
|
450
|
+
this.focusCalendar.emit();
|
|
438
451
|
}
|
|
439
452
|
/**
|
|
440
453
|
* @hidden
|
|
@@ -467,10 +480,27 @@ export class MultiViewCalendarComponent {
|
|
|
467
480
|
* @hidden
|
|
468
481
|
*/
|
|
469
482
|
keydown(event) {
|
|
470
|
-
|
|
483
|
+
const onArrowRightAndControl = event.keyCode === Keys.ArrowRight && (event.ctrlKey || event.metaKey);
|
|
484
|
+
const onArrowLeftAndControl = event.keyCode === Keys.ArrowLeft && (event.ctrlKey || event.metaKey);
|
|
485
|
+
const onTKeyPress = event.keyCode === Keys.KeyT;
|
|
486
|
+
const onEnterKeyPress = event.keyCode === Keys.Enter;
|
|
487
|
+
if (onArrowRightAndControl) {
|
|
488
|
+
event.preventDefault();
|
|
489
|
+
this.navigateView(this.nextView);
|
|
471
490
|
return;
|
|
472
491
|
}
|
|
473
|
-
if (
|
|
492
|
+
else if (onArrowLeftAndControl) {
|
|
493
|
+
event.preventDefault();
|
|
494
|
+
this.navigateView(this.prevView);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
else if (onTKeyPress) {
|
|
498
|
+
this.focusedDate = getToday();
|
|
499
|
+
this.bus.moveToBottom(this.activeViewEnum);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
else if (onEnterKeyPress) {
|
|
503
|
+
this.selectionService.lastClicked = this.focusedDate;
|
|
474
504
|
this.performSelection(this.focusedDate, event);
|
|
475
505
|
}
|
|
476
506
|
const candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
|
|
@@ -483,6 +513,10 @@ export class MultiViewCalendarComponent {
|
|
|
483
513
|
if (!isSameView) {
|
|
484
514
|
this.emitNavigate(this.focusedDate);
|
|
485
515
|
}
|
|
516
|
+
if (isArrowWithShiftPressed(event)) {
|
|
517
|
+
event['anyArrow'] = true;
|
|
518
|
+
this.performSelection(this.focusedDate, event);
|
|
519
|
+
}
|
|
486
520
|
}
|
|
487
521
|
ngOnInit() {
|
|
488
522
|
this.subscriptions.add(this.bus.viewChanged.subscribe(({ view }) => {
|
|
@@ -534,7 +568,7 @@ export class MultiViewCalendarComponent {
|
|
|
534
568
|
if (!this.element) {
|
|
535
569
|
return;
|
|
536
570
|
}
|
|
537
|
-
this.element.nativeElement.focus();
|
|
571
|
+
this.element.nativeElement.querySelector('.k-calendar-view').focus();
|
|
538
572
|
}
|
|
539
573
|
/**
|
|
540
574
|
* Blurs the Calendar component.
|
|
@@ -543,13 +577,9 @@ export class MultiViewCalendarComponent {
|
|
|
543
577
|
if (!this.element) {
|
|
544
578
|
return;
|
|
545
579
|
}
|
|
546
|
-
this.element.nativeElement.
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
* @hidden
|
|
550
|
-
*/
|
|
551
|
-
handleHeaderFocus() {
|
|
552
|
-
this.isHeaderActive = true;
|
|
580
|
+
const activeElement = this.views === 2 ? this.element.nativeElement.querySelector('.k-calendar-view') :
|
|
581
|
+
this.element.nativeElement.querySelector('.k-content.k-calendar-table');
|
|
582
|
+
activeElement.blur();
|
|
553
583
|
}
|
|
554
584
|
/**
|
|
555
585
|
* @hidden
|
|
@@ -678,6 +708,7 @@ export class MultiViewCalendarComponent {
|
|
|
678
708
|
* @hidden
|
|
679
709
|
*/
|
|
680
710
|
handleCellClick({ date, modifiers }) {
|
|
711
|
+
this.selectionService.lastClicked = date;
|
|
681
712
|
this.performSelection(date, modifiers);
|
|
682
713
|
const isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
683
714
|
if (!isSameView) {
|
|
@@ -701,6 +732,7 @@ export class MultiViewCalendarComponent {
|
|
|
701
732
|
setClasses(element) {
|
|
702
733
|
this.renderer.addClass(element, 'k-widget');
|
|
703
734
|
this.renderer.addClass(element, 'k-calendar');
|
|
735
|
+
this.renderer.addClass(element, 'k-calendar-md');
|
|
704
736
|
this.renderer.addClass(element, 'k-calendar-range');
|
|
705
737
|
}
|
|
706
738
|
verifyChanges() {
|
|
@@ -756,7 +788,7 @@ export class MultiViewCalendarComponent {
|
|
|
756
788
|
}
|
|
757
789
|
}
|
|
758
790
|
MultiViewCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiViewCalendarComponent, deps: [{ token: i1.BusViewService }, { token: i0.ElementRef }, { token: i2.NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i3.DisabledDatesService }, { token: i4.SelectionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
759
|
-
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.
|
|
791
|
+
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: [
|
|
760
792
|
BusViewService,
|
|
761
793
|
RANGE_CALENDAR_VALUE_ACCESSOR,
|
|
762
794
|
RANGE_CALENDAR_RANGE_VALIDATORS,
|
|
@@ -778,6 +810,9 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
778
810
|
|
|
779
811
|
i18n-nextButtonTitle="kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar"
|
|
780
812
|
nextButtonTitle="Navigate to next view"
|
|
813
|
+
|
|
814
|
+
i18n-parentViewButtonTitle="kendo.multiviewcalendar.parentViewButtonTitle|The title of the parent view button in the Multiview calendar header"
|
|
815
|
+
parentViewButtonTitle="Navigate to parent view"
|
|
781
816
|
>
|
|
782
817
|
</ng-container>
|
|
783
818
|
<kendo-calendar-header
|
|
@@ -785,6 +820,7 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
785
820
|
[currentDate]="activeDate"
|
|
786
821
|
[min]="min"
|
|
787
822
|
[max]="max"
|
|
823
|
+
[id]="headerId"
|
|
788
824
|
[rangeLength]="views"
|
|
789
825
|
[templateRef]="headerTitleTemplateRef?.templateRef"
|
|
790
826
|
[isPrevDisabled]="isPrevDisabled"
|
|
@@ -794,15 +830,14 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
794
830
|
(todayButtonClick)="handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })"
|
|
795
831
|
(prevButtonClick)="navigateView(prevView)"
|
|
796
832
|
(nextButtonClick)="navigateView(nextView)"
|
|
797
|
-
[kendoEventsOutsideAngular]="{
|
|
798
|
-
focusin: handleHeaderFocus
|
|
799
|
-
}"
|
|
800
|
-
[scope]="this"
|
|
801
833
|
>
|
|
802
834
|
</kendo-calendar-header>
|
|
803
835
|
<kendo-calendar-horizontal
|
|
836
|
+
[id]="calendarHeaderIdLabel"
|
|
837
|
+
[attr.aria-labelledby]="multiViewCalendarHeaderIdLabel"
|
|
804
838
|
[activeView]="activeViewEnum"
|
|
805
|
-
[
|
|
839
|
+
[activeDescendant]="ariaActivedescendant"
|
|
840
|
+
[isActive]="isActive || isHovered"
|
|
806
841
|
[cellTemplateRef]="activeCellTemplate()?.templateRef"
|
|
807
842
|
[weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
|
|
808
843
|
[cellUID]="cellUID"
|
|
@@ -817,14 +852,18 @@ MultiViewCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
817
852
|
[selectionRange]="selectionRange"
|
|
818
853
|
[selectedDates]="selectedDates"
|
|
819
854
|
[orientation]="orientation"
|
|
855
|
+
[tabIndex]="tabIndex"
|
|
856
|
+
[disabled]="disabled"
|
|
820
857
|
(cellClick)="handleCellClick($event)"
|
|
821
858
|
(weekNumberCellClick)="handleWeekNumberClick($event)"
|
|
822
859
|
(cellEnter)="emitCellEvent(cellEnter, $event)"
|
|
823
860
|
(cellLeave)="emitCellEvent(cellLeave, $event)"
|
|
824
861
|
(activeDateChange)="setActiveDate($event)"
|
|
862
|
+
(focusCalendar)="handleFocus()"
|
|
863
|
+
(blurCalendar)="handleFocusout($event)"
|
|
825
864
|
>
|
|
826
865
|
</kendo-calendar-horizontal>
|
|
827
|
-
`, isInline: true, components: [{ type: i5.HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: i6.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: i7.MultiViewCalendarLocalizedMessagesDirective, selector: "[kendoMultiViewCalendarLocalizedMessages]" }
|
|
866
|
+
`, isInline: true, components: [{ type: i5.HeaderComponent, selector: "kendo-calendar-header", inputs: ["activeView", "currentDate", "min", "max", "rangeLength", "templateRef", "isPrevDisabled", "isNextDisabled", "showNavigationButtons", "orientation", "id"], outputs: ["todayButtonClick", "prevButtonClick", "nextButtonClick"] }, { type: i6.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: i7.MultiViewCalendarLocalizedMessagesDirective, selector: "[kendoMultiViewCalendarLocalizedMessages]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
828
867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MultiViewCalendarComponent, decorators: [{
|
|
829
868
|
type: Component,
|
|
830
869
|
args: [{
|
|
@@ -854,6 +893,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
854
893
|
|
|
855
894
|
i18n-nextButtonTitle="kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar"
|
|
856
895
|
nextButtonTitle="Navigate to next view"
|
|
896
|
+
|
|
897
|
+
i18n-parentViewButtonTitle="kendo.multiviewcalendar.parentViewButtonTitle|The title of the parent view button in the Multiview calendar header"
|
|
898
|
+
parentViewButtonTitle="Navigate to parent view"
|
|
857
899
|
>
|
|
858
900
|
</ng-container>
|
|
859
901
|
<kendo-calendar-header
|
|
@@ -861,6 +903,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
861
903
|
[currentDate]="activeDate"
|
|
862
904
|
[min]="min"
|
|
863
905
|
[max]="max"
|
|
906
|
+
[id]="headerId"
|
|
864
907
|
[rangeLength]="views"
|
|
865
908
|
[templateRef]="headerTitleTemplateRef?.templateRef"
|
|
866
909
|
[isPrevDisabled]="isPrevDisabled"
|
|
@@ -870,15 +913,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
870
913
|
(todayButtonClick)="handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })"
|
|
871
914
|
(prevButtonClick)="navigateView(prevView)"
|
|
872
915
|
(nextButtonClick)="navigateView(nextView)"
|
|
873
|
-
[kendoEventsOutsideAngular]="{
|
|
874
|
-
focusin: handleHeaderFocus
|
|
875
|
-
}"
|
|
876
|
-
[scope]="this"
|
|
877
916
|
>
|
|
878
917
|
</kendo-calendar-header>
|
|
879
918
|
<kendo-calendar-horizontal
|
|
919
|
+
[id]="calendarHeaderIdLabel"
|
|
920
|
+
[attr.aria-labelledby]="multiViewCalendarHeaderIdLabel"
|
|
880
921
|
[activeView]="activeViewEnum"
|
|
881
|
-
[
|
|
922
|
+
[activeDescendant]="ariaActivedescendant"
|
|
923
|
+
[isActive]="isActive || isHovered"
|
|
882
924
|
[cellTemplateRef]="activeCellTemplate()?.templateRef"
|
|
883
925
|
[weekNumberTemplateRef]="weekNumberTemplateRef?.templateRef"
|
|
884
926
|
[cellUID]="cellUID"
|
|
@@ -893,11 +935,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
893
935
|
[selectionRange]="selectionRange"
|
|
894
936
|
[selectedDates]="selectedDates"
|
|
895
937
|
[orientation]="orientation"
|
|
938
|
+
[tabIndex]="tabIndex"
|
|
939
|
+
[disabled]="disabled"
|
|
896
940
|
(cellClick)="handleCellClick($event)"
|
|
897
941
|
(weekNumberCellClick)="handleWeekNumberClick($event)"
|
|
898
942
|
(cellEnter)="emitCellEvent(cellEnter, $event)"
|
|
899
943
|
(cellLeave)="emitCellEvent(cellLeave, $event)"
|
|
900
944
|
(activeDateChange)="setActiveDate($event)"
|
|
945
|
+
(focusCalendar)="handleFocus()"
|
|
946
|
+
(blurCalendar)="handleFocusout($event)"
|
|
901
947
|
>
|
|
902
948
|
</kendo-calendar-horizontal>
|
|
903
949
|
`
|
|
@@ -961,6 +1007,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
961
1007
|
}], blurEvent: [{
|
|
962
1008
|
type: Output,
|
|
963
1009
|
args: ['blur']
|
|
1010
|
+
}], focusCalendar: [{
|
|
1011
|
+
type: Output
|
|
964
1012
|
}], cellTemplate: [{
|
|
965
1013
|
type: ContentChild,
|
|
966
1014
|
args: [CellTemplateDirective, { static: false }]
|
|
@@ -1012,18 +1060,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1012
1060
|
}], widgetId: [{
|
|
1013
1061
|
type: HostBinding,
|
|
1014
1062
|
args: ['attr.id']
|
|
1015
|
-
}], calendarTabIndex: [{
|
|
1016
|
-
type: HostBinding,
|
|
1017
|
-
args: ['attr.tabindex']
|
|
1018
1063
|
}], ariaDisabled: [{
|
|
1019
1064
|
type: HostBinding,
|
|
1020
1065
|
args: ['attr.aria-disabled']
|
|
1021
1066
|
}, {
|
|
1022
1067
|
type: HostBinding,
|
|
1023
1068
|
args: ['class.k-disabled']
|
|
1024
|
-
}], ariaActivedescendant: [{
|
|
1025
|
-
type: HostBinding,
|
|
1026
|
-
args: ['attr.aria-activedescendant']
|
|
1027
1069
|
}], handleFocusout: [{
|
|
1028
1070
|
type: HostListener,
|
|
1029
1071
|
args: ['focusout', ['$event']]
|
|
@@ -19,6 +19,7 @@ const viewOffset = (view, offset) => {
|
|
|
19
19
|
const candidate = CalendarViewEnum[CalendarViewEnum[view + offset]];
|
|
20
20
|
return candidate !== undefined ? candidate : view;
|
|
21
21
|
};
|
|
22
|
+
let nextCalendarId = 0;
|
|
22
23
|
/**
|
|
23
24
|
* @hidden
|
|
24
25
|
*/
|
|
@@ -28,6 +29,7 @@ export class BusViewService {
|
|
|
28
29
|
this.viewChanged = new EventEmitter();
|
|
29
30
|
this.bottom = CalendarViewEnum.month;
|
|
30
31
|
this.top = CalendarViewEnum.century;
|
|
32
|
+
this.calendarId = nextCalendarId++;
|
|
31
33
|
}
|
|
32
34
|
configure(bottom, top) {
|
|
33
35
|
this.bottom = bottom;
|
|
@@ -77,7 +77,7 @@ export class MonthViewService {
|
|
|
77
77
|
const isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);
|
|
78
78
|
return {
|
|
79
79
|
formattedValue: this.value(cellDate),
|
|
80
|
-
id: `${cellUID}${cellDate.getTime()}`,
|
|
80
|
+
id: `${cellUID}${otherMonth ? cellDate.getTime() + '1' : cellDate.getTime()}`,
|
|
81
81
|
isFocused: this.isEqual(cellDate, focusedDate),
|
|
82
82
|
isSelected: isActiveView && selectedDates.some(date => this.isEqual(cellDate, date)),
|
|
83
83
|
isWeekend: this.isWeekend(cellDate),
|