@progress/kendo-angular-dateinputs 5.2.4-dev.202110081056 → 5.3.1-dev.202112011809
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 +90 -46
- package/dist/es/calendar/header.component.js +3 -4
- package/dist/es/calendar/horizontal-view-list.component.js +1 -1
- package/dist/es/calendar/multiview-calendar.component.js +66 -19
- 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/daterange/date-range-input.js +3 -3
- package/dist/es/daterange/date-range-popup.component.js +2 -2
- package/dist/es/daterange/date-range-selection.directive.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/util.js +15 -0
- package/dist/es2015/calendar/calendar.component.d.ts +27 -3
- package/dist/es2015/calendar/calendar.component.js +92 -41
- package/dist/es2015/calendar/header.component.js +3 -4
- 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 +30 -3
- package/dist/es2015/calendar/multiview-calendar.component.js +69 -18
- 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/daterange/date-range-input.js +3 -3
- package/dist/es2015/daterange/date-range-popup.component.js +2 -2
- package/dist/es2015/daterange/date-range-selection.directive.js +1 -1
- 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 +7223 -7084
- package/dist/fesm5/index.js +6794 -6671
- package/dist/npm/calendar/calendar.component.js +90 -46
- package/dist/npm/calendar/header.component.js +3 -4
- package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
- package/dist/npm/calendar/multiview-calendar.component.js +66 -19
- 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/daterange/date-range-input.js +3 -3
- package/dist/npm/daterange/date-range-popup.component.js +2 -2
- package/dist/npm/daterange/date-range-selection.directive.js +1 -1
- 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 +5 -5
|
@@ -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 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
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)).
|
|
@@ -213,6 +219,14 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
213
219
|
* > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
|
|
214
220
|
*/
|
|
215
221
|
set: function (focusedDate) {
|
|
222
|
+
if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
|
|
223
|
+
var service = this.bus.service(this.activeViewEnum);
|
|
224
|
+
var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
|
|
225
|
+
var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
|
|
226
|
+
if (!isFocusedDateInRange) {
|
|
227
|
+
this.emitNavigate(focusedDate);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
216
230
|
this._focusedDate = focusedDate || getToday();
|
|
217
231
|
this.setAriaActivedescendant();
|
|
218
232
|
},
|
|
@@ -435,23 +449,18 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
435
449
|
enumerable: true,
|
|
436
450
|
configurable: true
|
|
437
451
|
});
|
|
438
|
-
Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
|
|
439
|
-
get: function () {
|
|
440
|
-
return 'grid';
|
|
441
|
-
},
|
|
442
|
-
enumerable: true,
|
|
443
|
-
configurable: true
|
|
444
|
-
});
|
|
445
452
|
Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
|
|
446
453
|
get: function () {
|
|
447
|
-
|
|
454
|
+
// in Classic mode, the inner MultiViewCalendar is the focusable element
|
|
455
|
+
return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
|
|
448
456
|
},
|
|
449
457
|
enumerable: true,
|
|
450
458
|
configurable: true
|
|
451
459
|
});
|
|
452
460
|
Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
|
|
453
461
|
get: function () {
|
|
454
|
-
|
|
462
|
+
// in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
|
|
463
|
+
return this.type === 'classic' ? undefined : this.disabled;
|
|
455
464
|
},
|
|
456
465
|
enumerable: true,
|
|
457
466
|
configurable: true
|
|
@@ -537,19 +546,23 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
537
546
|
* ```
|
|
538
547
|
*/
|
|
539
548
|
CalendarComponent.prototype.focus = function () {
|
|
540
|
-
|
|
541
|
-
|
|
549
|
+
var focusTarget = this.type === 'infinite' ?
|
|
550
|
+
this.element && this.element.nativeElement :
|
|
551
|
+
this.multiViewCalendar;
|
|
552
|
+
if (isPresent(focusTarget)) {
|
|
553
|
+
focusTarget.focus();
|
|
542
554
|
}
|
|
543
|
-
this.element.nativeElement.focus();
|
|
544
555
|
};
|
|
545
556
|
/**
|
|
546
557
|
* Blurs the Calendar component.
|
|
547
558
|
*/
|
|
548
559
|
CalendarComponent.prototype.blur = function () {
|
|
549
|
-
|
|
550
|
-
|
|
560
|
+
var blurTarget = this.type === 'infinite' ?
|
|
561
|
+
this.element && this.element.nativeElement :
|
|
562
|
+
this.multiViewCalendar;
|
|
563
|
+
if (isPresent(blurTarget)) {
|
|
564
|
+
blurTarget.blur();
|
|
551
565
|
}
|
|
552
|
-
this.element.nativeElement.blur();
|
|
553
566
|
};
|
|
554
567
|
/**
|
|
555
568
|
* @hidden
|
|
@@ -678,6 +691,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
678
691
|
return null;
|
|
679
692
|
}
|
|
680
693
|
};
|
|
694
|
+
/**
|
|
695
|
+
* @hidden
|
|
696
|
+
*/
|
|
697
|
+
CalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
698
|
+
var activeView = CalendarViewEnum[this.activeViewEnum];
|
|
699
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
700
|
+
};
|
|
681
701
|
/**
|
|
682
702
|
* @hidden
|
|
683
703
|
*/
|
|
@@ -688,6 +708,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
688
708
|
});
|
|
689
709
|
}
|
|
690
710
|
};
|
|
711
|
+
/**
|
|
712
|
+
* @hidden
|
|
713
|
+
*/
|
|
714
|
+
CalendarComponent.prototype.handleActiveDateChange = function (date) {
|
|
715
|
+
this.activeViewDate = date;
|
|
716
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
717
|
+
};
|
|
691
718
|
/**
|
|
692
719
|
* @hidden
|
|
693
720
|
*/
|
|
@@ -718,6 +745,39 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
718
745
|
});
|
|
719
746
|
});
|
|
720
747
|
};
|
|
748
|
+
/**
|
|
749
|
+
* @hidden
|
|
750
|
+
*/
|
|
751
|
+
CalendarComponent.prototype.handleBlur = function (args) {
|
|
752
|
+
var _this = this;
|
|
753
|
+
if (this.element.nativeElement.contains(args.relatedTarget)) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
this.isActive = false;
|
|
757
|
+
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
758
|
+
// and enters the zone for no reason because the parent component is still untouched
|
|
759
|
+
if (!this.pickerService && requiresZoneOnBlur(this.control)) {
|
|
760
|
+
this.ngZone.run(function () {
|
|
761
|
+
_this.onControlTouched();
|
|
762
|
+
_this.emitBlur(args);
|
|
763
|
+
_this.cdr.markForCheck();
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
this.emitBlur(args);
|
|
768
|
+
this.detectChanges();
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
/**
|
|
772
|
+
* @hidden
|
|
773
|
+
*/
|
|
774
|
+
CalendarComponent.prototype.handleFocus = function () {
|
|
775
|
+
this.isActive = true;
|
|
776
|
+
if (!NgZone.isInAngularZone()) {
|
|
777
|
+
this.detectChanges();
|
|
778
|
+
}
|
|
779
|
+
this.emitFocus();
|
|
780
|
+
};
|
|
721
781
|
CalendarComponent.prototype.setClasses = function (element) {
|
|
722
782
|
this.renderer.addClass(element, 'k-widget');
|
|
723
783
|
this.renderer.addClass(element, 'k-calendar');
|
|
@@ -762,30 +822,6 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
762
822
|
this.pickerService.onFocus.emit();
|
|
763
823
|
}
|
|
764
824
|
};
|
|
765
|
-
CalendarComponent.prototype.handleBlur = function (args) {
|
|
766
|
-
var _this = this;
|
|
767
|
-
this.isActive = false;
|
|
768
|
-
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
769
|
-
// and enters the zone for no reason because the parent component is still untouched
|
|
770
|
-
if (!this.pickerService && requiresZoneOnBlur(this.control)) {
|
|
771
|
-
this.ngZone.run(function () {
|
|
772
|
-
_this.onControlTouched();
|
|
773
|
-
_this.emitBlur(args);
|
|
774
|
-
_this.cdr.markForCheck();
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
else {
|
|
778
|
-
this.emitBlur(args);
|
|
779
|
-
this.detectChanges();
|
|
780
|
-
}
|
|
781
|
-
};
|
|
782
|
-
CalendarComponent.prototype.handleFocus = function () {
|
|
783
|
-
this.isActive = true;
|
|
784
|
-
if (!NgZone.isInAngularZone()) {
|
|
785
|
-
this.detectChanges();
|
|
786
|
-
}
|
|
787
|
-
this.emitFocus();
|
|
788
|
-
};
|
|
789
825
|
CalendarComponent.prototype.handleComponentClick = function () {
|
|
790
826
|
if (!this.isActive) {
|
|
791
827
|
if (this.type === 'infinite' && this.monthView.isScrolled()) {
|
|
@@ -822,7 +858,12 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
822
858
|
}
|
|
823
859
|
};
|
|
824
860
|
CalendarComponent.prototype.setAriaActivedescendant = function () {
|
|
825
|
-
|
|
861
|
+
// in Classic mode, the inner MultiViewCalendar handles the activedescendant
|
|
862
|
+
if (!isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
if (this.type === 'classic') {
|
|
866
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
|
|
826
867
|
return;
|
|
827
868
|
}
|
|
828
869
|
var focusedCellId = this.cellUID + this.focusedDate.getTime();
|
|
@@ -931,6 +972,10 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
931
972
|
Output(),
|
|
932
973
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
933
974
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
975
|
+
tslib_1.__decorate([
|
|
976
|
+
Output(),
|
|
977
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
978
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
934
979
|
tslib_1.__decorate([
|
|
935
980
|
Output(),
|
|
936
981
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1019,16 +1064,15 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1019
1064
|
ViewChild(ViewListComponent, { static: false }),
|
|
1020
1065
|
tslib_1.__metadata("design:type", ViewListComponent)
|
|
1021
1066
|
], CalendarComponent.prototype, "monthView", void 0);
|
|
1067
|
+
tslib_1.__decorate([
|
|
1068
|
+
ViewChild(MultiViewCalendarComponent, { static: false }),
|
|
1069
|
+
tslib_1.__metadata("design:type", MultiViewCalendarComponent)
|
|
1070
|
+
], CalendarComponent.prototype, "multiViewCalendar", void 0);
|
|
1022
1071
|
tslib_1.__decorate([
|
|
1023
1072
|
HostBinding('attr.id'),
|
|
1024
1073
|
tslib_1.__metadata("design:type", String),
|
|
1025
1074
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1026
1075
|
], CalendarComponent.prototype, "widgetId", null);
|
|
1027
|
-
tslib_1.__decorate([
|
|
1028
|
-
HostBinding('attr.role'),
|
|
1029
|
-
tslib_1.__metadata("design:type", String),
|
|
1030
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1031
|
-
], CalendarComponent.prototype, "widgetRole", null);
|
|
1032
1076
|
tslib_1.__decorate([
|
|
1033
1077
|
HostBinding('attr.tabindex'),
|
|
1034
1078
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1060,7 +1104,7 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1060
1104
|
SelectionService
|
|
1061
1105
|
],
|
|
1062
1106
|
selector: 'kendo-calendar',
|
|
1063
|
-
template: "\n <ng-container kendoCalendarLocalizedMessages\n i18n-today=\"kendo.calendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.calendar.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <ng-container *ngIf=\"type === 'infinite'\">\n <kendo-calendar-navigation\n *ngIf=\"navigation\"\n [activeView]=\"activeViewEnum\"\n [focusedDate]=\"focusedDate\"\n [min]=\"min\"\n [max]=\"max\"\n [templateRef]=\"navigationItemTemplate?.templateRef\"\n (valueChange)=\"handleNavigation($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-navigation>\n <kendo-calendar-viewlist\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [headerTitleTemplateRef]=\"headerTitleTemplate?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [selectedDates]=\"selectedDates\"\n (todayButtonClick)=\"handleDateChange({\n selectedDates: [$event],\n focusedDate: $event\n })\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (activeDateChange)=\"
|
|
1107
|
+
template: "\n <ng-container kendoCalendarLocalizedMessages\n i18n-today=\"kendo.calendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.calendar.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.calendar.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <ng-container *ngIf=\"type === 'infinite'\">\n <kendo-calendar-navigation\n *ngIf=\"navigation\"\n [activeView]=\"activeViewEnum\"\n [focusedDate]=\"focusedDate\"\n [min]=\"min\"\n [max]=\"max\"\n [templateRef]=\"navigationItemTemplate?.templateRef\"\n (valueChange)=\"handleNavigation($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-navigation>\n <kendo-calendar-viewlist\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [headerTitleTemplateRef]=\"headerTitleTemplate?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [selectedDates]=\"selectedDates\"\n (todayButtonClick)=\"handleDateChange({\n selectedDates: [$event],\n focusedDate: $event\n })\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (activeDateChange)=\"handleActiveDateChange($event)\"\n (pageChange)=\"onPageChange()\"\n >\n </kendo-calendar-viewlist>\n <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n </ng-container>\n <ng-container *ngIf=\"type === 'classic'\">\n <kendo-multiviewcalendar\n #multiviewcalendar\n [views]=\"1\"\n [min]=\"min\"\n [max]=\"max\"\n [isActive]=\"isActive\"\n [activeView]=\"activeView\"\n [bottomView]=\"bottomView\"\n [topView]=\"topView\"\n [weekNumber]=\"weekNumber\"\n [animateNavigation]=\"animateNavigation\"\n [cellTemplate]=\"activeCellTemplate()\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [focusedDate]=\"focusedDate\"\n [selection]=\"selection\"\n [value]=\"value\"\n [disabledDates]=\"disabledDates\"\n (activeViewChange)=\"handleActiveViewChange($event)\"\n (navigate)=\"navigate.emit($event)\"\n (valueChange)=\"handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)\"\n (focus)=\"handleFocus()\"\n (blur)=\"handleBlur($event)\"\n >\n <kendo-multiviewcalendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-multiviewcalendar-messages>\n </kendo-multiviewcalendar>\n </ng-container>\n "
|
|
1064
1108
|
}),
|
|
1065
1109
|
tslib_1.__param(12, Optional()),
|
|
1066
1110
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
@@ -38,10 +38,9 @@ var HeaderComponent = /** @class */ (function () {
|
|
|
38
38
|
this.subscriptions = new Subscription();
|
|
39
39
|
}
|
|
40
40
|
HeaderComponent.prototype.ngOnInit = function () {
|
|
41
|
-
this.subscriptions
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
41
|
+
this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
|
|
42
|
+
this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
|
|
43
|
+
this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
45
44
|
};
|
|
46
45
|
HeaderComponent.prototype.ngOnChanges = function (_) {
|
|
47
46
|
var service = this.bus.service(this.activeView);
|
|
@@ -349,7 +349,7 @@ var HorizontalViewListComponent = /** @class */ (function () {
|
|
|
349
349
|
Component({
|
|
350
350
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
351
351
|
selector: 'kendo-calendar-horizontal',
|
|
352
|
-
template: "\n <ng-template #tableTemplate let-date=\"date\" let-class=\"className\">\n <table\n class=\"k-content k-calendar-content k-calendar-table\"\n [ngClass]=\"class\"\n >\n <caption *ngIf=\"showViewHeader\" [ngClass]=\"getCaptionClass()\">{{ getCaptionTitle(date) }}</caption>\n <thead *ngIf=\"isMonthView()\" class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\" role=\"row\">\n <th *ngFor=\"let name of weekNames\" class=\"k-calendar-th\">{{name}}</th>\n </tr>\n </thead>\n <tbody\n class=\"k-calendar-tbody\"\n kendoCalendarView\n role=\"rowgroup\"\n direction=\"horizontal\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\"\n [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [selectionRange]=\"selectionRange\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n (cellEnter)=\"cellEnter.emit($event)\"\n (cellLeave)=\"cellLeave.emit($event)\"\n >\n </tbody>\n </table>\n </ng-template>\n\n <!-- When Next is clicked a placeholder table is rendered before the Main Table -->\n <ng-template\n *ngIf=\"nextAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: nextAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n\n <ng-template\n *kFor=\"let date of dates\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: date\n }\"\n >\n </ng-template>\n\n <!-- When Prev is clicked a placeholder table is rendered after the Main Table -->\n <ng-template\n *ngIf=\"prevAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: prevAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n "
|
|
352
|
+
template: "\n <ng-template #tableTemplate let-date=\"date\" let-class=\"className\">\n <table\n role=\"grid\"\n class=\"k-content k-calendar-content k-calendar-table\"\n [ngClass]=\"class\"\n >\n <caption *ngIf=\"showViewHeader\" [ngClass]=\"getCaptionClass()\">{{ getCaptionTitle(date) }}</caption>\n <thead *ngIf=\"isMonthView()\" class=\"k-calendar-thead\">\n <tr class=\"k-calendar-tr\" role=\"row\">\n <th *ngFor=\"let name of weekNames\" class=\"k-calendar-th\">{{name}}</th>\n </tr>\n </thead>\n <tbody\n class=\"k-calendar-tbody\"\n kendoCalendarView\n role=\"rowgroup\"\n direction=\"horizontal\"\n [activeView]=\"activeView\"\n [isActive]=\"isActive\"\n [min]=\"min\"\n [max]=\"max\"\n [cellUID]=\"cellUID\"\n [focusedDate]=\"focusedDate\"\n [selectedDates]=\"selectedDates\"\n [selectionRange]=\"selectionRange\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [weekNumber]=\"weekNumber\"\n [templateRef]=\"cellTemplateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplateRef\"\n [viewDate]=\"date\"\n (cellClick)=\"cellClick.emit($event)\"\n (weekNumberCellClick)=\"weekNumberCellClick.emit($event)\"\n (cellEnter)=\"cellEnter.emit($event)\"\n (cellLeave)=\"cellLeave.emit($event)\"\n >\n </tbody>\n </table>\n </ng-template>\n\n <!-- When Next is clicked a placeholder table is rendered before the Main Table -->\n <ng-template\n *ngIf=\"nextAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: nextAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n\n <ng-template\n *kFor=\"let date of dates\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: date\n }\"\n >\n </ng-template>\n\n <!-- When Prev is clicked a placeholder table is rendered after the Main Table -->\n <ng-template\n *ngIf=\"prevAnimationDate\"\n [ngTemplateOutlet]=\"tableTemplate\"\n [ngTemplateOutletContext]=\"{\n date: prevAnimationDate,\n className: 'k-pointer-events-none'\n }\"\n >\n </ng-template>\n "
|
|
353
353
|
}),
|
|
354
354
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
355
355
|
IntlService,
|
|
@@ -10,6 +10,7 @@ import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
10
10
|
import { cloneDate, isEqual } from '@progress/kendo-date-math';
|
|
11
11
|
import { hasObservers, guid, Keys } from '@progress/kendo-angular-common';
|
|
12
12
|
import { HorizontalViewListComponent } from './horizontal-view-list.component';
|
|
13
|
+
import { HeaderComponent } from './header.component';
|
|
13
14
|
import { BusViewService } from './services/bus-view.service';
|
|
14
15
|
import { NavigationService } from './services/navigation.service';
|
|
15
16
|
import { SelectionService } from './services/selection.service';
|
|
@@ -114,6 +115,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
114
115
|
* @hidden
|
|
115
116
|
*/
|
|
116
117
|
this.isActive = false;
|
|
118
|
+
/**
|
|
119
|
+
* @hidden
|
|
120
|
+
*/
|
|
121
|
+
this.isHeaderActive = false;
|
|
117
122
|
/**
|
|
118
123
|
* Defines the active view that the Calendar initially renders
|
|
119
124
|
* ([see example]({% slug activeview_multiviewcalendar %})).
|
|
@@ -158,6 +163,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
158
163
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
159
164
|
*/
|
|
160
165
|
this.activeViewChange = new EventEmitter();
|
|
166
|
+
/**
|
|
167
|
+
* Fires when navigating in the currently active view
|
|
168
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
169
|
+
*/
|
|
170
|
+
this.navigate = new EventEmitter();
|
|
161
171
|
/**
|
|
162
172
|
* Fires when a view cell is entered
|
|
163
173
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -173,6 +183,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
173
183
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
174
184
|
*/
|
|
175
185
|
this.valueChange = new EventEmitter();
|
|
186
|
+
/**
|
|
187
|
+
* @hidden
|
|
188
|
+
*/
|
|
189
|
+
this.blurEvent = new EventEmitter();
|
|
176
190
|
this.cellUID = guid();
|
|
177
191
|
this.isHovered = false;
|
|
178
192
|
this.isPrevDisabled = true;
|
|
@@ -190,7 +204,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
190
204
|
this.minValidateFn = noop;
|
|
191
205
|
this.maxValidateFn = noop;
|
|
192
206
|
this.disabledDatesRangeValidateFn = noop;
|
|
193
|
-
this.subscriptions = new Subscription(
|
|
207
|
+
this.subscriptions = new Subscription();
|
|
194
208
|
this.setClasses(element.nativeElement);
|
|
195
209
|
}
|
|
196
210
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "focusedDate", {
|
|
@@ -408,13 +422,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
408
422
|
enumerable: true,
|
|
409
423
|
configurable: true
|
|
410
424
|
});
|
|
411
|
-
Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
|
|
412
|
-
get: function () {
|
|
413
|
-
return 'grid';
|
|
414
|
-
},
|
|
415
|
-
enumerable: true,
|
|
416
|
-
configurable: true
|
|
417
|
-
});
|
|
418
425
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
|
|
419
426
|
get: function () {
|
|
420
427
|
return this.disabled ? undefined : this.tabIndex;
|
|
@@ -439,10 +446,15 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
439
446
|
/**
|
|
440
447
|
* @hidden
|
|
441
448
|
*/
|
|
442
|
-
MultiViewCalendarComponent.prototype.handleBlur = function () {
|
|
443
|
-
|
|
449
|
+
MultiViewCalendarComponent.prototype.handleBlur = function (event) {
|
|
450
|
+
var target = event.target;
|
|
451
|
+
if (!this.element.nativeElement.contains(event.relatedTarget)) {
|
|
452
|
+
this.blurEvent.emit(event);
|
|
453
|
+
this.onControlTouched();
|
|
454
|
+
}
|
|
444
455
|
this.isActive = false;
|
|
445
456
|
this.isHovered = false; //ensure that hovered is also not active
|
|
457
|
+
this.isHeaderActive = this.headerElement.nativeElement.contains(target);
|
|
446
458
|
};
|
|
447
459
|
/**
|
|
448
460
|
* @hidden
|
|
@@ -490,6 +502,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
490
502
|
}
|
|
491
503
|
this.focusedDate = candidate;
|
|
492
504
|
event.preventDefault();
|
|
505
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
506
|
+
if (!isSameView) {
|
|
507
|
+
this.emitNavigate(this.focusedDate);
|
|
508
|
+
}
|
|
493
509
|
};
|
|
494
510
|
MultiViewCalendarComponent.prototype.ngOnInit = function () {
|
|
495
511
|
var _this = this;
|
|
@@ -578,6 +594,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
578
594
|
this.onControlChange(this.parseSelectionToValue(availableDates));
|
|
579
595
|
this.valueChange.emit(this.parseSelectionToValue(availableDates));
|
|
580
596
|
};
|
|
597
|
+
/**
|
|
598
|
+
* @hidden
|
|
599
|
+
*/
|
|
600
|
+
MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
|
|
601
|
+
var todayDate = args.focusedDate;
|
|
602
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
|
|
603
|
+
var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
|
|
604
|
+
if (!isSameView && isBottomView) {
|
|
605
|
+
this.emitNavigate(todayDate);
|
|
606
|
+
}
|
|
607
|
+
this.handleDateChange(args);
|
|
608
|
+
};
|
|
581
609
|
/**
|
|
582
610
|
* @hidden
|
|
583
611
|
*/
|
|
@@ -644,9 +672,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
644
672
|
/**
|
|
645
673
|
* @hidden
|
|
646
674
|
*/
|
|
647
|
-
MultiViewCalendarComponent.prototype.
|
|
675
|
+
MultiViewCalendarComponent.prototype.navigateView = function (action) {
|
|
648
676
|
this.focusedDate = this.viewList.navigate(action);
|
|
649
677
|
this.updateButtonState();
|
|
678
|
+
this.emitNavigate(this.focusedDate);
|
|
679
|
+
};
|
|
680
|
+
/**
|
|
681
|
+
* @hidden
|
|
682
|
+
*/
|
|
683
|
+
MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
684
|
+
var activeView = CalendarViewEnum[this.activeViewEnum];
|
|
685
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
650
686
|
};
|
|
651
687
|
/**
|
|
652
688
|
* @hidden
|
|
@@ -664,6 +700,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
664
700
|
MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
|
|
665
701
|
var date = _a.date, modifiers = _a.modifiers;
|
|
666
702
|
this.performSelection(date, modifiers);
|
|
703
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
704
|
+
if (!isSameView) {
|
|
705
|
+
this.emitNavigate(this.focusedDate);
|
|
706
|
+
}
|
|
667
707
|
};
|
|
668
708
|
/**
|
|
669
709
|
* @hidden
|
|
@@ -836,6 +876,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
836
876
|
Output(),
|
|
837
877
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
838
878
|
], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
|
|
879
|
+
tslib_1.__decorate([
|
|
880
|
+
Output(),
|
|
881
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
882
|
+
], MultiViewCalendarComponent.prototype, "navigate", void 0);
|
|
839
883
|
tslib_1.__decorate([
|
|
840
884
|
Output(),
|
|
841
885
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -848,6 +892,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
848
892
|
Output(),
|
|
849
893
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
850
894
|
], MultiViewCalendarComponent.prototype, "valueChange", void 0);
|
|
895
|
+
tslib_1.__decorate([
|
|
896
|
+
Output('blur'),
|
|
897
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
898
|
+
], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
|
|
851
899
|
tslib_1.__decorate([
|
|
852
900
|
ContentChild(CellTemplateDirective, { static: true }),
|
|
853
901
|
tslib_1.__metadata("design:type", CellTemplateDirective)
|
|
@@ -911,6 +959,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
911
959
|
tslib_1.__metadata("design:type", HeaderTitleTemplateDirective),
|
|
912
960
|
tslib_1.__metadata("design:paramtypes", [HeaderTitleTemplateDirective])
|
|
913
961
|
], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
|
|
962
|
+
tslib_1.__decorate([
|
|
963
|
+
ViewChild(HeaderComponent, { static: false, read: ElementRef }),
|
|
964
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
965
|
+
], MultiViewCalendarComponent.prototype, "headerElement", void 0);
|
|
914
966
|
tslib_1.__decorate([
|
|
915
967
|
ViewChild(HorizontalViewListComponent, { static: false }),
|
|
916
968
|
tslib_1.__metadata("design:type", HorizontalViewListComponent)
|
|
@@ -920,11 +972,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
920
972
|
tslib_1.__metadata("design:type", String),
|
|
921
973
|
tslib_1.__metadata("design:paramtypes", [])
|
|
922
974
|
], MultiViewCalendarComponent.prototype, "widgetId", null);
|
|
923
|
-
tslib_1.__decorate([
|
|
924
|
-
HostBinding('attr.role'),
|
|
925
|
-
tslib_1.__metadata("design:type", String),
|
|
926
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
927
|
-
], MultiViewCalendarComponent.prototype, "widgetRole", null);
|
|
928
975
|
tslib_1.__decorate([
|
|
929
976
|
HostBinding('attr.tabindex'),
|
|
930
977
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -942,9 +989,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
942
989
|
tslib_1.__metadata("design:paramtypes", [])
|
|
943
990
|
], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
|
|
944
991
|
tslib_1.__decorate([
|
|
945
|
-
HostListener(
|
|
992
|
+
HostListener('focusout', ['$event']),
|
|
946
993
|
tslib_1.__metadata("design:type", Function),
|
|
947
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
994
|
+
tslib_1.__metadata("design:paramtypes", [FocusEvent]),
|
|
948
995
|
tslib_1.__metadata("design:returntype", void 0)
|
|
949
996
|
], MultiViewCalendarComponent.prototype, "handleBlur", null);
|
|
950
997
|
tslib_1.__decorate([
|
|
@@ -1001,7 +1048,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
1001
1048
|
SelectionService
|
|
1002
1049
|
],
|
|
1003
1050
|
selector: 'kendo-multiviewcalendar',
|
|
1004
|
-
template: "\n <ng-container kendoMultiViewCalendarLocalizedMessages\n i18n-today=\"kendo.multiviewcalendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.multiviewcalendar.prevButtonTitle|The label for the previous button in the Multiview calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-calendar-header\n [activeView]=\"activeViewEnum\"\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [rangeLength]=\"views\"\n [templateRef]=\"headerTitleTemplate?.templateRef\"\n [isPrevDisabled]=\"isPrevDisabled\"\n [isNextDisabled]=\"isNextDisabled\"\n [showNavigationButtons]=\"true\"\n (todayButtonClick)=\"
|
|
1051
|
+
template: "\n <ng-container kendoMultiViewCalendarLocalizedMessages\n i18n-today=\"kendo.multiviewcalendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.multiviewcalendar.prevButtonTitle|The label for the previous button in the Multiview calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-calendar-header\n [activeView]=\"activeViewEnum\"\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [rangeLength]=\"views\"\n [templateRef]=\"headerTitleTemplate?.templateRef\"\n [isPrevDisabled]=\"isPrevDisabled\"\n [isNextDisabled]=\"isNextDisabled\"\n [showNavigationButtons]=\"true\"\n (todayButtonClick)=\"handleTodayButtonClick({ selectedDates: [$event], focusedDate: $event })\"\n (prevButtonClick)=\"navigateView(prevView)\"\n (nextButtonClick)=\"navigateView(nextView)\"\n >\n </kendo-calendar-header>\n <kendo-calendar-horizontal\n [activeView]=\"activeViewEnum\"\n [isActive]=\"isActive || (isHovered && !isHeaderActive)\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [views]=\"views\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [animateNavigation]=\"animateNavigation\"\n [showViewHeader]=\"showViewHeader\"\n [weekNumber]=\"weekNumber\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [selectionRange]=\"selectionRange\"\n [selectedDates]=\"selectedDates\"\n (valueChange)=\"handleDateChange($event)\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (cellEnter)=\"emitCellEvent(cellEnter, $event)\"\n (cellLeave)=\"emitCellEvent(cellLeave, $event)\"\n (activeDateChange)=\"setActiveDate($event)\"\n >\n </kendo-calendar-horizontal>\n "
|
|
1005
1052
|
}),
|
|
1006
1053
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
1007
1054
|
ElementRef,
|
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var _a;
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
|
-
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate } from '@progress/kendo-date-math';
|
|
9
|
+
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate, lastYearOfDecade, lastMonthOfYear, lastDayOfMonth } 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';
|
|
@@ -114,6 +114,12 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
114
114
|
var firstYear = firstYearOfDecade(firstDecadeOfCentury(date));
|
|
115
115
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
116
116
|
};
|
|
117
|
+
CenturyViewService.prototype.lastDayOfPeriod = function (date) {
|
|
118
|
+
var decade = lastDecadeOfCentury(date);
|
|
119
|
+
var year = lastYearOfDecade(decade);
|
|
120
|
+
var month = lastMonthOfYear(year);
|
|
121
|
+
return lastDayOfMonth(month);
|
|
122
|
+
};
|
|
117
123
|
CenturyViewService.prototype.isRangeStart = function (value) {
|
|
118
124
|
return value.getFullYear() % 1000 === 0;
|
|
119
125
|
};
|
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var _a;
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
|
-
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate } from '@progress/kendo-date-math';
|
|
9
|
+
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate, lastMonthOfYear, lastDayOfMonth } 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';
|
|
@@ -114,6 +114,11 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
114
114
|
var firstYear = firstYearOfDecade(date);
|
|
115
115
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
116
116
|
};
|
|
117
|
+
DecadeViewService.prototype.lastDayOfPeriod = function (date) {
|
|
118
|
+
var year = lastYearOfDecade(date);
|
|
119
|
+
var month = lastMonthOfYear(year);
|
|
120
|
+
return lastDayOfMonth(month);
|
|
121
|
+
};
|
|
117
122
|
DecadeViewService.prototype.isRangeStart = function (value) {
|
|
118
123
|
return value.getFullYear() % 100 === 0;
|
|
119
124
|
};
|
|
@@ -124,6 +124,9 @@ var MonthViewService = /** @class */ (function () {
|
|
|
124
124
|
}
|
|
125
125
|
return createDate(date.getFullYear(), date.getMonth(), 1);
|
|
126
126
|
};
|
|
127
|
+
MonthViewService.prototype.lastDayOfPeriod = function (date) {
|
|
128
|
+
return lastDayOfMonth(date);
|
|
129
|
+
};
|
|
127
130
|
MonthViewService.prototype.isRangeStart = function (value) {
|
|
128
131
|
return !value.getMonth();
|
|
129
132
|
};
|
|
@@ -7,7 +7,7 @@ var _a;
|
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
9
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
10
|
-
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
10
|
+
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastDayOfMonth, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
11
11
|
import { Action } from '../models/navigation-action.enum';
|
|
12
12
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
13
13
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -138,6 +138,10 @@ var YearViewService = /** @class */ (function () {
|
|
|
138
138
|
}
|
|
139
139
|
return createDate(date.getFullYear(), 0, 1);
|
|
140
140
|
};
|
|
141
|
+
YearViewService.prototype.lastDayOfPeriod = function (date) {
|
|
142
|
+
var month = lastMonthOfYear(date);
|
|
143
|
+
return lastDayOfMonth(month);
|
|
144
|
+
};
|
|
141
145
|
YearViewService.prototype.isRangeStart = function (value) {
|
|
142
146
|
return value.getFullYear() % 10 === 0;
|
|
143
147
|
};
|
|
@@ -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
|
}
|