@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
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
/* tslint:disable:no-forward-ref */
|
|
7
6
|
import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone } from '@angular/core';
|
|
8
7
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
9
8
|
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
9
|
import { cloneDate, isEqual } from '@progress/kendo-date-math';
|
|
11
10
|
import { hasObservers, guid, Keys } from '@progress/kendo-angular-common';
|
|
12
11
|
import { HorizontalViewListComponent } from './horizontal-view-list.component';
|
|
12
|
+
import { HeaderComponent } from './header.component';
|
|
13
13
|
import { BusViewService } from './services/bus-view.service';
|
|
14
14
|
import { NavigationService } from './services/navigation.service';
|
|
15
15
|
import { SelectionService } from './services/selection.service';
|
|
@@ -114,6 +114,10 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
114
114
|
* @hidden
|
|
115
115
|
*/
|
|
116
116
|
this.isActive = false;
|
|
117
|
+
/**
|
|
118
|
+
* @hidden
|
|
119
|
+
*/
|
|
120
|
+
this.isHeaderActive = false;
|
|
117
121
|
/**
|
|
118
122
|
* Defines the active view that the Calendar initially renders
|
|
119
123
|
* ([see example]({% slug activeview_multiviewcalendar %})).
|
|
@@ -158,6 +162,11 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
158
162
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
159
163
|
*/
|
|
160
164
|
this.activeViewChange = new EventEmitter();
|
|
165
|
+
/**
|
|
166
|
+
* Fires when navigating in the currently active view
|
|
167
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
168
|
+
*/
|
|
169
|
+
this.navigate = new EventEmitter();
|
|
161
170
|
/**
|
|
162
171
|
* Fires when a view cell is entered
|
|
163
172
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -173,6 +182,10 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
173
182
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
174
183
|
*/
|
|
175
184
|
this.valueChange = new EventEmitter();
|
|
185
|
+
/**
|
|
186
|
+
* @hidden
|
|
187
|
+
*/
|
|
188
|
+
this.blurEvent = new EventEmitter();
|
|
176
189
|
this.cellUID = guid();
|
|
177
190
|
this.isHovered = false;
|
|
178
191
|
this.isPrevDisabled = true;
|
|
@@ -336,9 +349,6 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
336
349
|
get widgetId() {
|
|
337
350
|
return this.id;
|
|
338
351
|
}
|
|
339
|
-
get widgetRole() {
|
|
340
|
-
return 'grid';
|
|
341
|
-
}
|
|
342
352
|
get calendarTabIndex() {
|
|
343
353
|
return this.disabled ? undefined : this.tabIndex;
|
|
344
354
|
}
|
|
@@ -351,16 +361,22 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
351
361
|
/**
|
|
352
362
|
* @hidden
|
|
353
363
|
*/
|
|
354
|
-
|
|
355
|
-
|
|
364
|
+
handleFocusout(event) {
|
|
365
|
+
const relatedTarget = event.relatedTarget;
|
|
366
|
+
if (!this.element.nativeElement.contains(relatedTarget)) {
|
|
367
|
+
this.blurEvent.emit(event);
|
|
368
|
+
this.onControlTouched();
|
|
369
|
+
}
|
|
356
370
|
this.isActive = false;
|
|
357
371
|
this.isHovered = false; //ensure that hovered is also not active
|
|
372
|
+
this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
|
|
358
373
|
}
|
|
359
374
|
/**
|
|
360
375
|
* @hidden
|
|
361
376
|
*/
|
|
362
377
|
handleFocus() {
|
|
363
378
|
this.isActive = true;
|
|
379
|
+
this.isHeaderActive = false;
|
|
364
380
|
}
|
|
365
381
|
/**
|
|
366
382
|
* @hidden
|
|
@@ -393,6 +409,9 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
393
409
|
* @hidden
|
|
394
410
|
*/
|
|
395
411
|
keydown(event) {
|
|
412
|
+
if (this.isHeaderActive) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
396
415
|
if (event.keyCode === Keys.Enter) {
|
|
397
416
|
this.performSelection(this.focusedDate, event);
|
|
398
417
|
}
|
|
@@ -402,6 +421,10 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
402
421
|
}
|
|
403
422
|
this.focusedDate = candidate;
|
|
404
423
|
event.preventDefault();
|
|
424
|
+
const isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
425
|
+
if (!isSameView) {
|
|
426
|
+
this.emitNavigate(this.focusedDate);
|
|
427
|
+
}
|
|
405
428
|
}
|
|
406
429
|
ngOnInit() {
|
|
407
430
|
this.subscriptions.add(this.bus.viewChanged.subscribe(({ view }) => {
|
|
@@ -464,6 +487,12 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
464
487
|
}
|
|
465
488
|
this.element.nativeElement.blur();
|
|
466
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* @hidden
|
|
492
|
+
*/
|
|
493
|
+
handleHeaderFocus() {
|
|
494
|
+
this.isHeaderActive = true;
|
|
495
|
+
}
|
|
467
496
|
/**
|
|
468
497
|
* @hidden
|
|
469
498
|
*/
|
|
@@ -487,6 +516,18 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
487
516
|
this.onControlChange(this.parseSelectionToValue(availableDates));
|
|
488
517
|
this.valueChange.emit(this.parseSelectionToValue(availableDates));
|
|
489
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* @hidden
|
|
521
|
+
*/
|
|
522
|
+
handleTodayButtonClick(args) {
|
|
523
|
+
const todayDate = args.focusedDate;
|
|
524
|
+
const isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
|
|
525
|
+
const isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
|
|
526
|
+
if (!isSameView && isBottomView) {
|
|
527
|
+
this.emitNavigate(todayDate);
|
|
528
|
+
}
|
|
529
|
+
this.handleDateChange(args);
|
|
530
|
+
}
|
|
490
531
|
/**
|
|
491
532
|
* @hidden
|
|
492
533
|
*/
|
|
@@ -553,9 +594,17 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
553
594
|
/**
|
|
554
595
|
* @hidden
|
|
555
596
|
*/
|
|
556
|
-
|
|
597
|
+
navigateView(action) {
|
|
557
598
|
this.focusedDate = this.viewList.navigate(action);
|
|
558
599
|
this.updateButtonState();
|
|
600
|
+
this.emitNavigate(this.focusedDate);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* @hidden
|
|
604
|
+
*/
|
|
605
|
+
emitNavigate(focusedDate) {
|
|
606
|
+
const activeView = CalendarViewEnum[this.activeViewEnum];
|
|
607
|
+
this.navigate.emit({ activeView, focusedDate });
|
|
559
608
|
}
|
|
560
609
|
/**
|
|
561
610
|
* @hidden
|
|
@@ -572,6 +621,10 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
|
|
|
572
621
|
*/
|
|
573
622
|
handleCellClick({ date, modifiers }) {
|
|
574
623
|
this.performSelection(date, modifiers);
|
|
624
|
+
const isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
625
|
+
if (!isSameView) {
|
|
626
|
+
this.emitNavigate(this.focusedDate);
|
|
627
|
+
}
|
|
575
628
|
}
|
|
576
629
|
/**
|
|
577
630
|
* @hidden
|
|
@@ -743,6 +796,10 @@ tslib_1.__decorate([
|
|
|
743
796
|
Output(),
|
|
744
797
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
745
798
|
], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
|
|
799
|
+
tslib_1.__decorate([
|
|
800
|
+
Output(),
|
|
801
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
802
|
+
], MultiViewCalendarComponent.prototype, "navigate", void 0);
|
|
746
803
|
tslib_1.__decorate([
|
|
747
804
|
Output(),
|
|
748
805
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -755,6 +812,10 @@ tslib_1.__decorate([
|
|
|
755
812
|
Output(),
|
|
756
813
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
757
814
|
], MultiViewCalendarComponent.prototype, "valueChange", void 0);
|
|
815
|
+
tslib_1.__decorate([
|
|
816
|
+
Output('blur'),
|
|
817
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
818
|
+
], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
|
|
758
819
|
tslib_1.__decorate([
|
|
759
820
|
ContentChild(CellTemplateDirective, { static: true }),
|
|
760
821
|
tslib_1.__metadata("design:type", CellTemplateDirective)
|
|
@@ -818,6 +879,10 @@ tslib_1.__decorate([
|
|
|
818
879
|
tslib_1.__metadata("design:type", HeaderTitleTemplateDirective),
|
|
819
880
|
tslib_1.__metadata("design:paramtypes", [HeaderTitleTemplateDirective])
|
|
820
881
|
], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
|
|
882
|
+
tslib_1.__decorate([
|
|
883
|
+
ViewChild(HeaderComponent, { static: false, read: ElementRef }),
|
|
884
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
885
|
+
], MultiViewCalendarComponent.prototype, "headerElement", void 0);
|
|
821
886
|
tslib_1.__decorate([
|
|
822
887
|
ViewChild(HorizontalViewListComponent, { static: false }),
|
|
823
888
|
tslib_1.__metadata("design:type", HorizontalViewListComponent)
|
|
@@ -827,11 +892,6 @@ tslib_1.__decorate([
|
|
|
827
892
|
tslib_1.__metadata("design:type", String),
|
|
828
893
|
tslib_1.__metadata("design:paramtypes", [])
|
|
829
894
|
], MultiViewCalendarComponent.prototype, "widgetId", null);
|
|
830
|
-
tslib_1.__decorate([
|
|
831
|
-
HostBinding('attr.role'),
|
|
832
|
-
tslib_1.__metadata("design:type", String),
|
|
833
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
834
|
-
], MultiViewCalendarComponent.prototype, "widgetRole", null);
|
|
835
895
|
tslib_1.__decorate([
|
|
836
896
|
HostBinding('attr.tabindex'),
|
|
837
897
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -849,11 +909,11 @@ tslib_1.__decorate([
|
|
|
849
909
|
tslib_1.__metadata("design:paramtypes", [])
|
|
850
910
|
], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
|
|
851
911
|
tslib_1.__decorate([
|
|
852
|
-
HostListener(
|
|
912
|
+
HostListener('focusout', ['$event']),
|
|
853
913
|
tslib_1.__metadata("design:type", Function),
|
|
854
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
914
|
+
tslib_1.__metadata("design:paramtypes", [FocusEvent]),
|
|
855
915
|
tslib_1.__metadata("design:returntype", void 0)
|
|
856
|
-
], MultiViewCalendarComponent.prototype, "
|
|
916
|
+
], MultiViewCalendarComponent.prototype, "handleFocusout", null);
|
|
857
917
|
tslib_1.__decorate([
|
|
858
918
|
HostListener("focus"),
|
|
859
919
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -930,14 +990,18 @@ MultiViewCalendarComponent = tslib_1.__decorate([
|
|
|
930
990
|
[isPrevDisabled]="isPrevDisabled"
|
|
931
991
|
[isNextDisabled]="isNextDisabled"
|
|
932
992
|
[showNavigationButtons]="true"
|
|
933
|
-
(todayButtonClick)="
|
|
934
|
-
(prevButtonClick)="
|
|
935
|
-
(nextButtonClick)="
|
|
993
|
+
(todayButtonClick)="handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })"
|
|
994
|
+
(prevButtonClick)="navigateView(prevView)"
|
|
995
|
+
(nextButtonClick)="navigateView(nextView)"
|
|
996
|
+
[kendoEventsOutsideAngular]="{
|
|
997
|
+
focusin: handleHeaderFocus
|
|
998
|
+
}"
|
|
999
|
+
[scope]="this"
|
|
936
1000
|
>
|
|
937
1001
|
</kendo-calendar-header>
|
|
938
1002
|
<kendo-calendar-horizontal
|
|
939
1003
|
[activeView]="activeViewEnum"
|
|
940
|
-
[isActive]="isActive || isHovered"
|
|
1004
|
+
[isActive]="isActive || (isHovered && !isHeaderActive)"
|
|
941
1005
|
[cellTemplateRef]="activeCellTemplate()?.templateRef"
|
|
942
1006
|
[weekNumberTemplateRef]="weekNumberTemplate?.templateRef"
|
|
943
1007
|
[cellUID]="cellUID"
|
|
@@ -7,6 +7,7 @@ import { NgModule } from '@angular/core';
|
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import { IntlModule } from '@progress/kendo-angular-intl';
|
|
9
9
|
import { PopupModule } from '@progress/kendo-angular-popup';
|
|
10
|
+
import { EventsModule } from '@progress/kendo-angular-common';
|
|
10
11
|
import { CalendarCommonModule } from './calendar-common.module';
|
|
11
12
|
import { TemplatesModule } from './templates.module';
|
|
12
13
|
import { HorizontalViewListComponent } from './horizontal-view-list.component';
|
|
@@ -72,7 +73,14 @@ MultiViewCalendarModule = tslib_1.__decorate([
|
|
|
72
73
|
CalendarCommonModule,
|
|
73
74
|
TemplatesModule
|
|
74
75
|
],
|
|
75
|
-
imports: [
|
|
76
|
+
imports: [
|
|
77
|
+
CommonModule,
|
|
78
|
+
CalendarCommonModule,
|
|
79
|
+
IntlModule,
|
|
80
|
+
TemplatesModule,
|
|
81
|
+
PopupModule,
|
|
82
|
+
EventsModule
|
|
83
|
+
],
|
|
76
84
|
providers: [
|
|
77
85
|
NavigationService,
|
|
78
86
|
CenturyViewService,
|
|
@@ -16,6 +16,7 @@ export declare class CenturyViewService implements ViewService {
|
|
|
16
16
|
isInArray(date: Date, dates: Date[]): boolean;
|
|
17
17
|
isInRange(candidate: Date, min: Date, max: Date): boolean;
|
|
18
18
|
beginningOfPeriod(date: Date): Date;
|
|
19
|
+
lastDayOfPeriod(date: Date): Date;
|
|
19
20
|
isRangeStart(value: Date): boolean;
|
|
20
21
|
move(value: Date, action: Action): Date;
|
|
21
22
|
cellTitle(value: Date): string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
/* tslint:disable:object-literal-sort-keys */
|
|
7
7
|
import { Injectable } from '@angular/core';
|
|
8
|
-
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate } from '@progress/kendo-date-math';
|
|
8
|
+
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate, lastYearOfDecade, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
|
|
9
9
|
import { Action } from '../models/navigation-action.enum';
|
|
10
10
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
11
11
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -115,6 +115,12 @@ let CenturyViewService = class CenturyViewService {
|
|
|
115
115
|
const firstYear = firstYearOfDecade(firstDecadeOfCentury(date));
|
|
116
116
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
117
117
|
}
|
|
118
|
+
lastDayOfPeriod(date) {
|
|
119
|
+
const decade = lastDecadeOfCentury(date);
|
|
120
|
+
const year = lastYearOfDecade(decade);
|
|
121
|
+
const month = lastMonthOfYear(year);
|
|
122
|
+
return lastDayOfMonth(month);
|
|
123
|
+
}
|
|
118
124
|
isRangeStart(value) {
|
|
119
125
|
return value.getFullYear() % 1000 === 0;
|
|
120
126
|
}
|
|
@@ -16,6 +16,7 @@ export declare class DecadeViewService implements ViewService {
|
|
|
16
16
|
isInArray(date: Date, dates: Date[]): boolean;
|
|
17
17
|
isInRange(candidate: Date, min: Date, max: Date): boolean;
|
|
18
18
|
beginningOfPeriod(date: Date): Date;
|
|
19
|
+
lastDayOfPeriod(date: Date): Date;
|
|
19
20
|
isRangeStart(value: Date): boolean;
|
|
20
21
|
move(value: Date, action: Action): Date;
|
|
21
22
|
cellTitle(value: Date): string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
/* tslint:disable:object-literal-sort-keys */
|
|
7
7
|
import { Injectable } from '@angular/core';
|
|
8
|
-
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate } from '@progress/kendo-date-math';
|
|
8
|
+
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
|
|
9
9
|
import { Action } from '../models/navigation-action.enum';
|
|
10
10
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
11
11
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -115,6 +115,11 @@ let DecadeViewService = class DecadeViewService {
|
|
|
115
115
|
const firstYear = firstYearOfDecade(date);
|
|
116
116
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
117
117
|
}
|
|
118
|
+
lastDayOfPeriod(date) {
|
|
119
|
+
const year = lastYearOfDecade(date);
|
|
120
|
+
const month = lastMonthOfYear(year);
|
|
121
|
+
return lastDayOfMonth(month);
|
|
122
|
+
}
|
|
118
123
|
isRangeStart(value) {
|
|
119
124
|
return value.getFullYear() % 100 === 0;
|
|
120
125
|
}
|
|
@@ -20,6 +20,7 @@ export declare class MonthViewService implements ViewService {
|
|
|
20
20
|
isInArray(date: Date, dates: Date[]): boolean;
|
|
21
21
|
isInRange(candidate: Date, min: Date, max: Date): boolean;
|
|
22
22
|
beginningOfPeriod(date: Date): Date;
|
|
23
|
+
lastDayOfPeriod(date: Date): Date;
|
|
23
24
|
isRangeStart(value: Date): boolean;
|
|
24
25
|
move(value: Date, action: Action): Date;
|
|
25
26
|
cellTitle(value: Date): string;
|
|
@@ -122,6 +122,9 @@ let MonthViewService = class MonthViewService {
|
|
|
122
122
|
}
|
|
123
123
|
return createDate(date.getFullYear(), date.getMonth(), 1);
|
|
124
124
|
}
|
|
125
|
+
lastDayOfPeriod(date) {
|
|
126
|
+
return lastDayOfMonth(date);
|
|
127
|
+
}
|
|
125
128
|
isRangeStart(value) {
|
|
126
129
|
return !value.getMonth();
|
|
127
130
|
}
|
|
@@ -19,6 +19,7 @@ export declare class YearViewService implements ViewService {
|
|
|
19
19
|
isInArray(date: Date, dates: Date[]): boolean;
|
|
20
20
|
isInRange(candidate: Date, min: Date, max: Date): boolean;
|
|
21
21
|
beginningOfPeriod(date: Date): Date;
|
|
22
|
+
lastDayOfPeriod(date: Date): Date;
|
|
22
23
|
isRangeStart(value: Date): boolean;
|
|
23
24
|
move(value: Date, action: Action): Date;
|
|
24
25
|
cellTitle(value: Date): string;
|
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
/* tslint:disable:object-literal-sort-keys */
|
|
7
7
|
import { Injectable } from '@angular/core';
|
|
8
8
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
9
|
-
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
9
|
+
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastDayOfMonth, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
10
10
|
import { Action } from '../models/navigation-action.enum';
|
|
11
11
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
12
12
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -136,6 +136,10 @@ let YearViewService = class YearViewService {
|
|
|
136
136
|
}
|
|
137
137
|
return createDate(date.getFullYear(), 0, 1);
|
|
138
138
|
}
|
|
139
|
+
lastDayOfPeriod(date) {
|
|
140
|
+
const month = lastMonthOfYear(date);
|
|
141
|
+
return lastDayOfMonth(month);
|
|
142
|
+
}
|
|
139
143
|
isRangeStart(value) {
|
|
140
144
|
return value.getFullYear() % 10 === 0;
|
|
141
145
|
}
|
|
@@ -297,7 +297,11 @@ ViewListComponent = tslib_1.__decorate([
|
|
|
297
297
|
(scrollChange)="scrollChange($event)"
|
|
298
298
|
(activeIndexChange)="setActiveDate($event)"
|
|
299
299
|
>
|
|
300
|
-
<table
|
|
300
|
+
<table
|
|
301
|
+
#list
|
|
302
|
+
role="grid"
|
|
303
|
+
class="k-calendar-table"
|
|
304
|
+
>
|
|
301
305
|
<colgroup><col *ngFor="let _ of cols" /></colgroup>
|
|
302
306
|
|
|
303
307
|
<tbody class="k-calendar-tbody"
|
|
@@ -154,11 +154,13 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
154
154
|
/**
|
|
155
155
|
* Specifies the biggest date that is valid
|
|
156
156
|
* ([see example]({% slug dateranges_dateinput %})).
|
|
157
|
+
* By default, the `max` value is `2099-12-31`.
|
|
157
158
|
*/
|
|
158
159
|
max: Date;
|
|
159
160
|
/**
|
|
160
161
|
* Specifies the smallest date that is valid
|
|
161
162
|
* ([see example]({% slug dateranges_dateinput %})).
|
|
163
|
+
* By default, the `min` value is `1900-1-1`.
|
|
162
164
|
*/
|
|
163
165
|
min: Date;
|
|
164
166
|
/**
|
|
@@ -181,11 +181,13 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
181
181
|
/**
|
|
182
182
|
* Specifies the smallest valid date
|
|
183
183
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
184
|
+
* By default, the `min` value is `1900-1-1`.
|
|
184
185
|
*/
|
|
185
186
|
min: Date;
|
|
186
187
|
/**
|
|
187
188
|
* Specifies the biggest valid date
|
|
188
189
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
190
|
+
* By default, the `max` value is `2099-12-31`.
|
|
189
191
|
*/
|
|
190
192
|
max: Date;
|
|
191
193
|
/**
|
|
@@ -28,7 +28,7 @@ import { HeaderTitleTemplateDirective } from '../calendar/templates/header-title
|
|
|
28
28
|
import { NavigationItemTemplateDirective } from '../calendar/templates/navigation-item-template.directive';
|
|
29
29
|
import { PickerService } from '../common/picker.service';
|
|
30
30
|
import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
|
|
31
|
-
import { noop, isValidRange, setTime, isWindowAvailable } from '../util';
|
|
31
|
+
import { noop, isValidRange, setTime, isWindowAvailable, isTabExitingCalendar } from '../util';
|
|
32
32
|
import { TOUCH_ENABLED } from '../touch-enabled';
|
|
33
33
|
import { requiresZoneOnBlur, currentFocusTarget } from '../common/utils';
|
|
34
34
|
import { fromEvent } from 'rxjs';
|
|
@@ -121,11 +121,13 @@ let DatePickerComponent = DatePickerComponent_1 = class DatePickerComponent {
|
|
|
121
121
|
/**
|
|
122
122
|
* Specifies the smallest valid date
|
|
123
123
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
124
|
+
* By default, the `min` value is `1900-1-1`.
|
|
124
125
|
*/
|
|
125
126
|
this.min = cloneDate(MIN_DATE);
|
|
126
127
|
/**
|
|
127
128
|
* Specifies the biggest valid date
|
|
128
129
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
130
|
+
* By default, the `max` value is `2099-12-31`.
|
|
129
131
|
*/
|
|
130
132
|
this.max = cloneDate(MAX_DATE);
|
|
131
133
|
/**
|
|
@@ -629,7 +631,7 @@ let DatePickerComponent = DatePickerComponent_1 = class DatePickerComponent {
|
|
|
629
631
|
* @hidden
|
|
630
632
|
*/
|
|
631
633
|
handleKeydown(e) {
|
|
632
|
-
const { altKey, keyCode } = e;
|
|
634
|
+
const { altKey, shiftKey, keyCode, target } = e;
|
|
633
635
|
if (keyCode === Keys.Escape) {
|
|
634
636
|
this.show = false;
|
|
635
637
|
}
|
|
@@ -641,7 +643,7 @@ let DatePickerComponent = DatePickerComponent_1 = class DatePickerComponent {
|
|
|
641
643
|
this.show = false;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
|
-
if (keyCode === Keys.Tab && this.show && this.calendar.isActive) {
|
|
646
|
+
if (keyCode === Keys.Tab && this.show && this.calendar.isActive && isTabExitingCalendar(this.calendarType, target, shiftKey)) {
|
|
645
647
|
this.input.focus();
|
|
646
648
|
this.show = false;
|
|
647
649
|
}
|