@progress/kendo-angular-dateinputs 5.2.4-dev.202110261444 → 5.3.1-dev.202112071202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/calendar/calendar.component.js +102 -46
- package/dist/es/calendar/horizontal-view-list.component.js +1 -1
- package/dist/es/calendar/multiview-calendar.component.js +76 -20
- package/dist/es/calendar/multiview-calendar.module.js +9 -1
- package/dist/es/calendar/services/century-view.service.js +7 -1
- package/dist/es/calendar/services/decade-view.service.js +6 -1
- package/dist/es/calendar/services/month-view.service.js +3 -0
- package/dist/es/calendar/services/year-view.service.js +5 -1
- package/dist/es/calendar/view-list.component.js +1 -1
- package/dist/es/datepicker/datepicker.component.js +5 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/util.js +15 -0
- package/dist/es2015/calendar/calendar.component.d.ts +34 -3
- package/dist/es2015/calendar/calendar.component.js +104 -41
- package/dist/es2015/calendar/horizontal-view-list.component.js +1 -0
- package/dist/es2015/calendar/models/view-service.interface.d.ts +1 -0
- package/dist/es2015/calendar/multiview-calendar.component.d.ts +34 -3
- package/dist/es2015/calendar/multiview-calendar.component.js +83 -19
- package/dist/es2015/calendar/multiview-calendar.module.js +9 -1
- package/dist/es2015/calendar/services/century-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/century-view.service.js +7 -1
- package/dist/es2015/calendar/services/decade-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/decade-view.service.js +6 -1
- package/dist/es2015/calendar/services/month-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/month-view.service.js +3 -0
- package/dist/es2015/calendar/services/year-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/year-view.service.js +5 -1
- package/dist/es2015/calendar/view-list.component.js +5 -1
- package/dist/es2015/dateinput/dateinput.component.d.ts +2 -0
- package/dist/es2015/datepicker/datepicker.component.d.ts +2 -0
- package/dist/es2015/datepicker/datepicker.component.js +5 -3
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/util.d.ts +7 -0
- package/dist/es2015/util.js +15 -0
- package/dist/fesm2015/index.js +7253 -7080
- package/dist/fesm5/index.js +6807 -6654
- package/dist/npm/calendar/calendar.component.js +102 -46
- package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
- package/dist/npm/calendar/multiview-calendar.component.js +76 -20
- package/dist/npm/calendar/multiview-calendar.module.js +9 -1
- package/dist/npm/calendar/services/century-view.service.js +6 -0
- package/dist/npm/calendar/services/decade-view.service.js +5 -0
- package/dist/npm/calendar/services/month-view.service.js +3 -0
- package/dist/npm/calendar/services/year-view.service.js +4 -0
- package/dist/npm/calendar/view-list.component.js +1 -1
- package/dist/npm/datepicker/datepicker.component.js +4 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/util.js +15 -0
- package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
- package/package.json +1 -1
|
@@ -287,7 +287,7 @@ var ViewListComponent = /** @class */ (function () {
|
|
|
287
287
|
Component({
|
|
288
288
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
289
289
|
selector: 'kendo-calendar-viewlist',
|
|
290
|
-
template: "\n <kendo-calendar-header\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [activeView]=\"activeView\"\n [templateRef]=\"headerTitleTemplateRef\"\n (todayButtonClick)=\"todayButtonClick.emit($event)\"\n >\n </kendo-calendar-header>\n <table class=\"k-calendar-weekdays k-calendar-table\" style=\"table-layout: auto;\" *ngIf=\"isMonthView()\">\n <thead class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\">\n <th class=\"k-calendar-th\" *ngFor=\"let name of weekNames\" [style.width.%]=\"colWidth\">{{name}}</th>\n </tr>\n </thead>\n </table>\n <kendo-virtualization\n [tabindex]=\"-1\"\n [skip]=\"skip\"\n [take]=\"take\"\n [total]=\"total\"\n [itemHeight]=\"viewHeight\"\n [topOffset]=\"viewOffset\"\n [bottomOffset]=\"bottomOffset\"\n [scrollOffsetSize]=\"viewOffset\"\n [maxScrollDifference]=\"viewHeight\"\n (pageChange)=\"onPageChange($event)\"\n (scrollChange)=\"scrollChange($event)\"\n (activeIndexChange)=\"setActiveDate($event)\"\n >\n <table
|
|
290
|
+
template: "\n <kendo-calendar-header\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [activeView]=\"activeView\"\n [templateRef]=\"headerTitleTemplateRef\"\n (todayButtonClick)=\"todayButtonClick.emit($event)\"\n >\n </kendo-calendar-header>\n <table class=\"k-calendar-weekdays k-calendar-table\" style=\"table-layout: auto;\" *ngIf=\"isMonthView()\">\n <thead class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\">\n <th class=\"k-calendar-th\" *ngFor=\"let name of weekNames\" [style.width.%]=\"colWidth\">{{name}}</th>\n </tr>\n </thead>\n </table>\n <kendo-virtualization\n [tabindex]=\"-1\"\n [skip]=\"skip\"\n [take]=\"take\"\n [total]=\"total\"\n [itemHeight]=\"viewHeight\"\n [topOffset]=\"viewOffset\"\n [bottomOffset]=\"bottomOffset\"\n [scrollOffsetSize]=\"viewOffset\"\n [maxScrollDifference]=\"viewHeight\"\n (pageChange)=\"onPageChange($event)\"\n (scrollChange)=\"scrollChange($event)\"\n (activeIndexChange)=\"setActiveDate($event)\"\n >\n <table\n #list\n role=\"grid\"\n class=\"k-calendar-table\"\n >\n <colgroup><col *ngFor=\"let _ of cols\" /></colgroup>\n\n <tbody class=\"k-calendar-tbody\"\n *kFor=\"let date of dates\"\n kendoCalendarView\n role=\"rowgroup\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\" [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n ></tbody>\n </table>\n </kendo-virtualization>\n "
|
|
291
291
|
}),
|
|
292
292
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
293
293
|
ChangeDetectorRef,
|
|
@@ -27,7 +27,7 @@ import { HeaderTitleTemplateDirective } from '../calendar/templates/header-title
|
|
|
27
27
|
import { NavigationItemTemplateDirective } from '../calendar/templates/navigation-item-template.directive';
|
|
28
28
|
import { PickerService } from '../common/picker.service';
|
|
29
29
|
import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
|
|
30
|
-
import { noop, isValidRange, setTime, isWindowAvailable } from '../util';
|
|
30
|
+
import { noop, isValidRange, setTime, isWindowAvailable, isTabExitingCalendar } from '../util';
|
|
31
31
|
import { TOUCH_ENABLED } from '../touch-enabled';
|
|
32
32
|
import { requiresZoneOnBlur, currentFocusTarget } from '../common/utils';
|
|
33
33
|
import { fromEvent } from 'rxjs';
|
|
@@ -120,11 +120,13 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
120
120
|
/**
|
|
121
121
|
* Specifies the smallest valid date
|
|
122
122
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
123
|
+
* By default, the `min` value is `1900-1-1`.
|
|
123
124
|
*/
|
|
124
125
|
this.min = cloneDate(MIN_DATE);
|
|
125
126
|
/**
|
|
126
127
|
* Specifies the biggest valid date
|
|
127
128
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
129
|
+
* By default, the `max` value is `2099-12-31`.
|
|
128
130
|
*/
|
|
129
131
|
this.max = cloneDate(MAX_DATE);
|
|
130
132
|
/**
|
|
@@ -716,7 +718,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
716
718
|
* @hidden
|
|
717
719
|
*/
|
|
718
720
|
DatePickerComponent.prototype.handleKeydown = function (e) {
|
|
719
|
-
var altKey = e.altKey, keyCode = e.keyCode;
|
|
721
|
+
var altKey = e.altKey, shiftKey = e.shiftKey, keyCode = e.keyCode, target = e.target;
|
|
720
722
|
if (keyCode === Keys.Escape) {
|
|
721
723
|
this.show = false;
|
|
722
724
|
}
|
|
@@ -728,7 +730,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
728
730
|
this.show = false;
|
|
729
731
|
}
|
|
730
732
|
}
|
|
731
|
-
if (keyCode === Keys.Tab && this.show && this.calendar.isActive) {
|
|
733
|
+
if (keyCode === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
|
|
732
734
|
this.input.focus();
|
|
733
735
|
this.show = false;
|
|
734
736
|
}
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-dateinputs',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1638878303,
|
|
13
13
|
version: '',
|
|
14
14
|
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'
|
|
15
15
|
};
|
package/dist/es/util.js
CHANGED
|
@@ -340,4 +340,19 @@ export var millisecondDigitsInFormat = function (format) {
|
|
|
340
340
|
export var millisecondStepFor = function (digits) {
|
|
341
341
|
return Math.pow(10, 3 - digits);
|
|
342
342
|
};
|
|
343
|
+
/**
|
|
344
|
+
* @hidden
|
|
345
|
+
*
|
|
346
|
+
* Checks if a tab keydown would would move the focus outside of the calendar.
|
|
347
|
+
*/
|
|
348
|
+
export var isTabExitingCalendar = function (calendarType, focusedElement, shiftKey) {
|
|
349
|
+
if (!isPresent(focusedElement)) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
return calendarType === 'infinite' || ( // infinte calendar is always exited on first tab keydown
|
|
353
|
+
calendarType === 'classic' &&
|
|
354
|
+
(shiftKey && focusedElement.classList.contains('k-calendar')) || // exited on main calendar element focused and back-tab
|
|
355
|
+
(!shiftKey && focusedElement.classList.contains('k-next-view')) // exited on next button focused and regular tab
|
|
356
|
+
);
|
|
357
|
+
};
|
|
343
358
|
export { ɵ0, ɵ1, ɵ2 };
|
|
@@ -6,6 +6,7 @@ import { ChangeDetectorRef, EventEmitter, ElementRef, Renderer2, AfterViewChecke
|
|
|
6
6
|
import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { Day } from '@progress/kendo-date-math';
|
|
9
|
+
import { MultiViewCalendarComponent } from './multiview-calendar.component';
|
|
9
10
|
import { NavigationComponent } from './navigation.component';
|
|
10
11
|
import { ViewListComponent } from './view-list.component';
|
|
11
12
|
import { CalendarDOMService } from './services/dom.service';
|
|
@@ -188,6 +189,14 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
188
189
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
189
190
|
*/
|
|
190
191
|
activeViewChange: EventEmitter<CalendarView>;
|
|
192
|
+
/**
|
|
193
|
+
* Fires when navigating in the currently active view
|
|
194
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
195
|
+
*/
|
|
196
|
+
navigate: EventEmitter<{
|
|
197
|
+
activeView: CalendarView;
|
|
198
|
+
focusedDate: Date;
|
|
199
|
+
}>;
|
|
191
200
|
/**
|
|
192
201
|
* Fires when the active view date is changed
|
|
193
202
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -265,6 +274,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
265
274
|
navigationItemTemplateRef: NavigationItemTemplateDirective;
|
|
266
275
|
navigationView: NavigationComponent;
|
|
267
276
|
monthView: ViewListComponent;
|
|
277
|
+
multiViewCalendar: MultiViewCalendarComponent;
|
|
268
278
|
isActive: boolean;
|
|
269
279
|
cellUID: string;
|
|
270
280
|
selectedDates: Date[];
|
|
@@ -286,7 +296,6 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
286
296
|
readonly bottomViewEnum: CalendarViewEnum;
|
|
287
297
|
readonly topViewEnum: CalendarViewEnum;
|
|
288
298
|
readonly widgetId: string;
|
|
289
|
-
readonly widgetRole: string;
|
|
290
299
|
readonly calendarTabIndex: number;
|
|
291
300
|
readonly ariaDisabled: boolean;
|
|
292
301
|
private domEvents;
|
|
@@ -295,6 +304,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
295
304
|
private resolvedPromise;
|
|
296
305
|
private destroyed;
|
|
297
306
|
private localizationChangeSubscription;
|
|
307
|
+
private activeViewDate;
|
|
298
308
|
constructor(bus: BusViewService, dom: CalendarDOMService, element: ElementRef, navigator: NavigationService, renderer: Renderer2, cdr: ChangeDetectorRef, ngZone: NgZone, injector: Injector, scrollSyncService: ScrollSyncService, disabledDatesService: DisabledDatesService, localization: LocalizationService, selectionService: SelectionService, pickerService?: PickerService);
|
|
299
309
|
ngOnInit(): void;
|
|
300
310
|
ngOnChanges(changes: any): void;
|
|
@@ -378,10 +388,25 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
378
388
|
* @hidden
|
|
379
389
|
*/
|
|
380
390
|
activeCellTemplate(): any;
|
|
391
|
+
/**
|
|
392
|
+
* @hidden
|
|
393
|
+
*/
|
|
394
|
+
handleNavigate(event: {
|
|
395
|
+
focusedDate: Date;
|
|
396
|
+
activeView: CalendarView;
|
|
397
|
+
}): void;
|
|
398
|
+
/**
|
|
399
|
+
* @hidden
|
|
400
|
+
*/
|
|
401
|
+
emitNavigate(focusedDate: Date): void;
|
|
381
402
|
/**
|
|
382
403
|
* @hidden
|
|
383
404
|
*/
|
|
384
405
|
emitEvent(emitter: any, args: any): void;
|
|
406
|
+
/**
|
|
407
|
+
* @hidden
|
|
408
|
+
*/
|
|
409
|
+
handleActiveDateChange(date: Date): void;
|
|
385
410
|
/**
|
|
386
411
|
* @hidden
|
|
387
412
|
*/
|
|
@@ -391,14 +416,20 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
391
416
|
* @hidden
|
|
392
417
|
*/
|
|
393
418
|
handleWeekNumberClick(dates: Date[]): void;
|
|
419
|
+
/**
|
|
420
|
+
* @hidden
|
|
421
|
+
*/
|
|
422
|
+
handleBlur(args: any): void;
|
|
423
|
+
/**
|
|
424
|
+
* @hidden
|
|
425
|
+
*/
|
|
426
|
+
handleFocus(): void;
|
|
394
427
|
private setClasses;
|
|
395
428
|
private verifyChanges;
|
|
396
429
|
private verifyValue;
|
|
397
430
|
private bindEvents;
|
|
398
431
|
private emitBlur;
|
|
399
432
|
private emitFocus;
|
|
400
|
-
private handleBlur;
|
|
401
|
-
private handleFocus;
|
|
402
433
|
private handleComponentClick;
|
|
403
434
|
private handleKeydown;
|
|
404
435
|
private detectChanges;
|
|
@@ -11,6 +11,7 @@ import { cloneDate, isEqual } from '@progress/kendo-date-math';
|
|
|
11
11
|
import { hasObservers, KendoInput, guid, Keys } from '@progress/kendo-angular-common';
|
|
12
12
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
13
|
import { packageMetadata } from '../package-metadata';
|
|
14
|
+
import { MultiViewCalendarComponent } from './multiview-calendar.component';
|
|
14
15
|
import { NavigationComponent } from './navigation.component';
|
|
15
16
|
import { ViewListComponent } from './view-list.component';
|
|
16
17
|
import { CalendarDOMService } from './services/dom.service';
|
|
@@ -168,6 +169,11 @@ let CalendarComponent = class CalendarComponent {
|
|
|
168
169
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
169
170
|
*/
|
|
170
171
|
this.activeViewChange = new EventEmitter();
|
|
172
|
+
/**
|
|
173
|
+
* Fires when navigating in the currently active view
|
|
174
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
175
|
+
*/
|
|
176
|
+
this.navigate = new EventEmitter();
|
|
171
177
|
/**
|
|
172
178
|
* Fires when the active view date is changed
|
|
173
179
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -209,6 +215,14 @@ let CalendarComponent = class CalendarComponent {
|
|
|
209
215
|
* > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
|
|
210
216
|
*/
|
|
211
217
|
set focusedDate(focusedDate) {
|
|
218
|
+
if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
|
|
219
|
+
const service = this.bus.service(this.activeViewEnum);
|
|
220
|
+
const lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
|
|
221
|
+
const isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
|
|
222
|
+
if (!isFocusedDateInRange) {
|
|
223
|
+
this.emitNavigate(focusedDate);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
212
226
|
this._focusedDate = focusedDate || getToday();
|
|
213
227
|
this.setAriaActivedescendant();
|
|
214
228
|
}
|
|
@@ -359,14 +373,13 @@ let CalendarComponent = class CalendarComponent {
|
|
|
359
373
|
get widgetId() {
|
|
360
374
|
return this.id;
|
|
361
375
|
}
|
|
362
|
-
get widgetRole() {
|
|
363
|
-
return 'grid';
|
|
364
|
-
}
|
|
365
376
|
get calendarTabIndex() {
|
|
366
|
-
|
|
377
|
+
// in Classic mode, the inner MultiViewCalendar is the focusable element
|
|
378
|
+
return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
|
|
367
379
|
}
|
|
368
380
|
get ariaDisabled() {
|
|
369
|
-
|
|
381
|
+
// in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
|
|
382
|
+
return this.type === 'classic' ? undefined : this.disabled;
|
|
370
383
|
}
|
|
371
384
|
ngOnInit() {
|
|
372
385
|
this.dom.calculateHeights(this.element.nativeElement);
|
|
@@ -445,19 +458,23 @@ let CalendarComponent = class CalendarComponent {
|
|
|
445
458
|
* ```
|
|
446
459
|
*/
|
|
447
460
|
focus() {
|
|
448
|
-
|
|
449
|
-
|
|
461
|
+
const focusTarget = this.type === 'infinite' ?
|
|
462
|
+
this.element && this.element.nativeElement :
|
|
463
|
+
this.multiViewCalendar;
|
|
464
|
+
if (isPresent(focusTarget)) {
|
|
465
|
+
focusTarget.focus();
|
|
450
466
|
}
|
|
451
|
-
this.element.nativeElement.focus();
|
|
452
467
|
}
|
|
453
468
|
/**
|
|
454
469
|
* Blurs the Calendar component.
|
|
455
470
|
*/
|
|
456
471
|
blur() {
|
|
457
|
-
|
|
458
|
-
|
|
472
|
+
const blurTarget = this.type === 'infinite' ?
|
|
473
|
+
this.element && this.element.nativeElement :
|
|
474
|
+
this.multiViewCalendar;
|
|
475
|
+
if (isPresent(blurTarget)) {
|
|
476
|
+
blurTarget.blur();
|
|
459
477
|
}
|
|
460
|
-
this.element.nativeElement.blur();
|
|
461
478
|
}
|
|
462
479
|
/**
|
|
463
480
|
* @hidden
|
|
@@ -583,6 +600,21 @@ let CalendarComponent = class CalendarComponent {
|
|
|
583
600
|
return null;
|
|
584
601
|
}
|
|
585
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* @hidden
|
|
605
|
+
*/
|
|
606
|
+
handleNavigate(event) {
|
|
607
|
+
this.focusedDate = event.focusedDate;
|
|
608
|
+
this.activeView = event.activeView;
|
|
609
|
+
this.emitNavigate(this.focusedDate);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* @hidden
|
|
613
|
+
*/
|
|
614
|
+
emitNavigate(focusedDate) {
|
|
615
|
+
const activeView = CalendarViewEnum[this.activeViewEnum];
|
|
616
|
+
this.navigate.emit({ activeView, focusedDate });
|
|
617
|
+
}
|
|
586
618
|
/**
|
|
587
619
|
* @hidden
|
|
588
620
|
*/
|
|
@@ -593,6 +625,13 @@ let CalendarComponent = class CalendarComponent {
|
|
|
593
625
|
});
|
|
594
626
|
}
|
|
595
627
|
}
|
|
628
|
+
/**
|
|
629
|
+
* @hidden
|
|
630
|
+
*/
|
|
631
|
+
handleActiveDateChange(date) {
|
|
632
|
+
this.activeViewDate = date;
|
|
633
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
634
|
+
}
|
|
596
635
|
/**
|
|
597
636
|
* @hidden
|
|
598
637
|
*/
|
|
@@ -621,6 +660,38 @@ let CalendarComponent = class CalendarComponent {
|
|
|
621
660
|
});
|
|
622
661
|
});
|
|
623
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* @hidden
|
|
665
|
+
*/
|
|
666
|
+
handleBlur(args) {
|
|
667
|
+
if (this.element.nativeElement.contains(args.relatedTarget)) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
this.isActive = false;
|
|
671
|
+
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
672
|
+
// and enters the zone for no reason because the parent component is still untouched
|
|
673
|
+
if (!this.pickerService && requiresZoneOnBlur(this.control)) {
|
|
674
|
+
this.ngZone.run(() => {
|
|
675
|
+
this.onControlTouched();
|
|
676
|
+
this.emitBlur(args);
|
|
677
|
+
this.cdr.markForCheck();
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
this.emitBlur(args);
|
|
682
|
+
this.detectChanges();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* @hidden
|
|
687
|
+
*/
|
|
688
|
+
handleFocus() {
|
|
689
|
+
this.isActive = true;
|
|
690
|
+
if (!NgZone.isInAngularZone()) {
|
|
691
|
+
this.detectChanges();
|
|
692
|
+
}
|
|
693
|
+
this.emitFocus();
|
|
694
|
+
}
|
|
624
695
|
setClasses(element) {
|
|
625
696
|
this.renderer.addClass(element, 'k-widget');
|
|
626
697
|
this.renderer.addClass(element, 'k-calendar');
|
|
@@ -665,29 +736,6 @@ let CalendarComponent = class CalendarComponent {
|
|
|
665
736
|
this.pickerService.onFocus.emit();
|
|
666
737
|
}
|
|
667
738
|
}
|
|
668
|
-
handleBlur(args) {
|
|
669
|
-
this.isActive = false;
|
|
670
|
-
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
671
|
-
// and enters the zone for no reason because the parent component is still untouched
|
|
672
|
-
if (!this.pickerService && requiresZoneOnBlur(this.control)) {
|
|
673
|
-
this.ngZone.run(() => {
|
|
674
|
-
this.onControlTouched();
|
|
675
|
-
this.emitBlur(args);
|
|
676
|
-
this.cdr.markForCheck();
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
else {
|
|
680
|
-
this.emitBlur(args);
|
|
681
|
-
this.detectChanges();
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
handleFocus() {
|
|
685
|
-
this.isActive = true;
|
|
686
|
-
if (!NgZone.isInAngularZone()) {
|
|
687
|
-
this.detectChanges();
|
|
688
|
-
}
|
|
689
|
-
this.emitFocus();
|
|
690
|
-
}
|
|
691
739
|
handleComponentClick() {
|
|
692
740
|
if (!this.isActive) {
|
|
693
741
|
if (this.type === 'infinite' && this.monthView.isScrolled()) {
|
|
@@ -698,6 +746,10 @@ let CalendarComponent = class CalendarComponent {
|
|
|
698
746
|
}
|
|
699
747
|
}
|
|
700
748
|
handleKeydown(args) {
|
|
749
|
+
const headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
|
|
750
|
+
if (headerActive) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
701
753
|
// reserve the alt + arrow key commands for the picker
|
|
702
754
|
const arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
|
|
703
755
|
if (isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
|
|
@@ -724,7 +776,12 @@ let CalendarComponent = class CalendarComponent {
|
|
|
724
776
|
}
|
|
725
777
|
}
|
|
726
778
|
setAriaActivedescendant() {
|
|
727
|
-
|
|
779
|
+
// in Classic mode, the inner MultiViewCalendar handles the activedescendant
|
|
780
|
+
if (!isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
if (this.type === 'classic') {
|
|
784
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
|
|
728
785
|
return;
|
|
729
786
|
}
|
|
730
787
|
const focusedCellId = this.cellUID + this.focusedDate.getTime();
|
|
@@ -834,6 +891,10 @@ tslib_1.__decorate([
|
|
|
834
891
|
Output(),
|
|
835
892
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
836
893
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
894
|
+
tslib_1.__decorate([
|
|
895
|
+
Output(),
|
|
896
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
897
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
837
898
|
tslib_1.__decorate([
|
|
838
899
|
Output(),
|
|
839
900
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -922,16 +983,15 @@ tslib_1.__decorate([
|
|
|
922
983
|
ViewChild(ViewListComponent, { static: false }),
|
|
923
984
|
tslib_1.__metadata("design:type", ViewListComponent)
|
|
924
985
|
], CalendarComponent.prototype, "monthView", void 0);
|
|
986
|
+
tslib_1.__decorate([
|
|
987
|
+
ViewChild(MultiViewCalendarComponent, { static: false }),
|
|
988
|
+
tslib_1.__metadata("design:type", MultiViewCalendarComponent)
|
|
989
|
+
], CalendarComponent.prototype, "multiViewCalendar", void 0);
|
|
925
990
|
tslib_1.__decorate([
|
|
926
991
|
HostBinding('attr.id'),
|
|
927
992
|
tslib_1.__metadata("design:type", String),
|
|
928
993
|
tslib_1.__metadata("design:paramtypes", [])
|
|
929
994
|
], CalendarComponent.prototype, "widgetId", null);
|
|
930
|
-
tslib_1.__decorate([
|
|
931
|
-
HostBinding('attr.role'),
|
|
932
|
-
tslib_1.__metadata("design:type", String),
|
|
933
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
934
|
-
], CalendarComponent.prototype, "widgetRole", null);
|
|
935
995
|
tslib_1.__decorate([
|
|
936
996
|
HostBinding('attr.tabindex'),
|
|
937
997
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1005,7 +1065,7 @@ CalendarComponent = tslib_1.__decorate([
|
|
|
1005
1065
|
})"
|
|
1006
1066
|
(cellClick)="handleCellClick($event)"
|
|
1007
1067
|
(weekNumberCellClick)="handleWeekNumberClick($event)"
|
|
1008
|
-
(activeDateChange)="
|
|
1068
|
+
(activeDateChange)="handleActiveDateChange($event)"
|
|
1009
1069
|
(pageChange)="onPageChange()"
|
|
1010
1070
|
>
|
|
1011
1071
|
</kendo-calendar-viewlist>
|
|
@@ -1035,7 +1095,10 @@ CalendarComponent = tslib_1.__decorate([
|
|
|
1035
1095
|
[value]="value"
|
|
1036
1096
|
[disabledDates]="disabledDates"
|
|
1037
1097
|
(activeViewChange)="handleActiveViewChange($event)"
|
|
1098
|
+
(navigate)="handleNavigate($event)"
|
|
1038
1099
|
(valueChange)="handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)"
|
|
1100
|
+
(focus)="handleFocus()"
|
|
1101
|
+
(blur)="handleBlur($event)"
|
|
1039
1102
|
>
|
|
1040
1103
|
<kendo-multiviewcalendar-messages
|
|
1041
1104
|
[today]="localization.get('today')"
|
|
@@ -126,6 +126,10 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
126
126
|
* @hidden
|
|
127
127
|
*/
|
|
128
128
|
isActive: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* @hidden
|
|
131
|
+
*/
|
|
132
|
+
isHeaderActive: boolean;
|
|
129
133
|
/**
|
|
130
134
|
* Sets the dates of the MultiViewCalendar that will be disabled
|
|
131
135
|
* ([see example]({% slug disabled_dates_multiviewcalendar %})).
|
|
@@ -187,6 +191,14 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
187
191
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
188
192
|
*/
|
|
189
193
|
activeViewChange: EventEmitter<CalendarView>;
|
|
194
|
+
/**
|
|
195
|
+
* Fires when navigating in the currently active view
|
|
196
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
197
|
+
*/
|
|
198
|
+
navigate: EventEmitter<{
|
|
199
|
+
activeView: CalendarView;
|
|
200
|
+
focusedDate: Date;
|
|
201
|
+
}>;
|
|
190
202
|
/**
|
|
191
203
|
* Fires when a view cell is entered
|
|
192
204
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -202,6 +214,10 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
202
214
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
203
215
|
*/
|
|
204
216
|
valueChange: EventEmitter<any>;
|
|
217
|
+
/**
|
|
218
|
+
* @hidden
|
|
219
|
+
*/
|
|
220
|
+
blurEvent: EventEmitter<any>;
|
|
205
221
|
/**
|
|
206
222
|
* @hidden
|
|
207
223
|
*/
|
|
@@ -258,6 +274,7 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
258
274
|
* @hidden
|
|
259
275
|
*/
|
|
260
276
|
headerTitleTemplateRef: HeaderTitleTemplateDirective;
|
|
277
|
+
headerElement: ElementRef<HTMLElement>;
|
|
261
278
|
viewList: HorizontalViewListComponent;
|
|
262
279
|
cellUID: string;
|
|
263
280
|
isHovered: boolean;
|
|
@@ -285,14 +302,13 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
285
302
|
readonly bottomViewEnum: CalendarViewEnum;
|
|
286
303
|
readonly topViewEnum: CalendarViewEnum;
|
|
287
304
|
readonly widgetId: string;
|
|
288
|
-
readonly widgetRole: string;
|
|
289
305
|
readonly calendarTabIndex: number;
|
|
290
306
|
readonly ariaDisabled: boolean;
|
|
291
307
|
readonly ariaActivedescendant: string;
|
|
292
308
|
/**
|
|
293
309
|
* @hidden
|
|
294
310
|
*/
|
|
295
|
-
|
|
311
|
+
handleFocusout(event: FocusEvent): void;
|
|
296
312
|
/**
|
|
297
313
|
* @hidden
|
|
298
314
|
*/
|
|
@@ -342,6 +358,10 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
342
358
|
* Blurs the Calendar component.
|
|
343
359
|
*/
|
|
344
360
|
blur(): void;
|
|
361
|
+
/**
|
|
362
|
+
* @hidden
|
|
363
|
+
*/
|
|
364
|
+
handleHeaderFocus(): void;
|
|
345
365
|
/**
|
|
346
366
|
* @hidden
|
|
347
367
|
*/
|
|
@@ -349,6 +369,13 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
349
369
|
selectedDates: Date[];
|
|
350
370
|
focusedDate: Date;
|
|
351
371
|
}): void;
|
|
372
|
+
/**
|
|
373
|
+
* @hidden
|
|
374
|
+
*/
|
|
375
|
+
handleTodayButtonClick(args: {
|
|
376
|
+
selectedDates: Date[];
|
|
377
|
+
focusedDate: Date;
|
|
378
|
+
}): void;
|
|
352
379
|
/**
|
|
353
380
|
* @hidden
|
|
354
381
|
*/
|
|
@@ -386,7 +413,11 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
386
413
|
/**
|
|
387
414
|
* @hidden
|
|
388
415
|
*/
|
|
389
|
-
|
|
416
|
+
navigateView(action: Action): void;
|
|
417
|
+
/**
|
|
418
|
+
* @hidden
|
|
419
|
+
*/
|
|
420
|
+
emitNavigate(focusedDate: Date): void;
|
|
390
421
|
/**
|
|
391
422
|
* @hidden
|
|
392
423
|
*/
|