@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
|
@@ -13,6 +13,7 @@ var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
|
13
13
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
14
14
|
var kendo_licensing_1 = require("@progress/kendo-licensing");
|
|
15
15
|
var package_metadata_1 = require("../package-metadata");
|
|
16
|
+
var multiview_calendar_component_1 = require("./multiview-calendar.component");
|
|
16
17
|
var navigation_component_1 = require("./navigation.component");
|
|
17
18
|
var view_list_component_1 = require("./view-list.component");
|
|
18
19
|
var dom_service_1 = require("./services/dom.service");
|
|
@@ -171,6 +172,11 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
171
172
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
172
173
|
*/
|
|
173
174
|
this.activeViewChange = new core_1.EventEmitter();
|
|
175
|
+
/**
|
|
176
|
+
* Fires when navigating in the currently active view
|
|
177
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
178
|
+
*/
|
|
179
|
+
this.navigate = new core_1.EventEmitter();
|
|
174
180
|
/**
|
|
175
181
|
* Fires when the active view date is changed
|
|
176
182
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -216,6 +222,14 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
216
222
|
* > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
|
|
217
223
|
*/
|
|
218
224
|
set: function (focusedDate) {
|
|
225
|
+
if (this.activeViewDate && !kendo_date_math_1.isEqual(this._focusedDate, focusedDate)) {
|
|
226
|
+
var service = this.bus.service(this.activeViewEnum);
|
|
227
|
+
var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
|
|
228
|
+
var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
|
|
229
|
+
if (!isFocusedDateInRange) {
|
|
230
|
+
this.emitNavigate(focusedDate);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
219
233
|
this._focusedDate = focusedDate || util_1.getToday();
|
|
220
234
|
this.setAriaActivedescendant();
|
|
221
235
|
},
|
|
@@ -438,23 +452,18 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
438
452
|
enumerable: true,
|
|
439
453
|
configurable: true
|
|
440
454
|
});
|
|
441
|
-
Object.defineProperty(CalendarComponent.prototype, "widgetRole", {
|
|
442
|
-
get: function () {
|
|
443
|
-
return 'grid';
|
|
444
|
-
},
|
|
445
|
-
enumerable: true,
|
|
446
|
-
configurable: true
|
|
447
|
-
});
|
|
448
455
|
Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
|
|
449
456
|
get: function () {
|
|
450
|
-
|
|
457
|
+
// in Classic mode, the inner MultiViewCalendar is the focusable element
|
|
458
|
+
return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
|
|
451
459
|
},
|
|
452
460
|
enumerable: true,
|
|
453
461
|
configurable: true
|
|
454
462
|
});
|
|
455
463
|
Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", {
|
|
456
464
|
get: function () {
|
|
457
|
-
|
|
465
|
+
// in Classic mode, the inner MultiViewCalendar should handle the disabled class and aria attr
|
|
466
|
+
return this.type === 'classic' ? undefined : this.disabled;
|
|
458
467
|
},
|
|
459
468
|
enumerable: true,
|
|
460
469
|
configurable: true
|
|
@@ -540,19 +549,23 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
540
549
|
* ```
|
|
541
550
|
*/
|
|
542
551
|
CalendarComponent.prototype.focus = function () {
|
|
543
|
-
|
|
544
|
-
|
|
552
|
+
var focusTarget = this.type === 'infinite' ?
|
|
553
|
+
this.element && this.element.nativeElement :
|
|
554
|
+
this.multiViewCalendar;
|
|
555
|
+
if (utils_1.isPresent(focusTarget)) {
|
|
556
|
+
focusTarget.focus();
|
|
545
557
|
}
|
|
546
|
-
this.element.nativeElement.focus();
|
|
547
558
|
};
|
|
548
559
|
/**
|
|
549
560
|
* Blurs the Calendar component.
|
|
550
561
|
*/
|
|
551
562
|
CalendarComponent.prototype.blur = function () {
|
|
552
|
-
|
|
553
|
-
|
|
563
|
+
var blurTarget = this.type === 'infinite' ?
|
|
564
|
+
this.element && this.element.nativeElement :
|
|
565
|
+
this.multiViewCalendar;
|
|
566
|
+
if (utils_1.isPresent(blurTarget)) {
|
|
567
|
+
blurTarget.blur();
|
|
554
568
|
}
|
|
555
|
-
this.element.nativeElement.blur();
|
|
556
569
|
};
|
|
557
570
|
/**
|
|
558
571
|
* @hidden
|
|
@@ -681,6 +694,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
681
694
|
return null;
|
|
682
695
|
}
|
|
683
696
|
};
|
|
697
|
+
/**
|
|
698
|
+
* @hidden
|
|
699
|
+
*/
|
|
700
|
+
CalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
701
|
+
var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
|
|
702
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
703
|
+
};
|
|
684
704
|
/**
|
|
685
705
|
* @hidden
|
|
686
706
|
*/
|
|
@@ -691,6 +711,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
691
711
|
});
|
|
692
712
|
}
|
|
693
713
|
};
|
|
714
|
+
/**
|
|
715
|
+
* @hidden
|
|
716
|
+
*/
|
|
717
|
+
CalendarComponent.prototype.handleActiveDateChange = function (date) {
|
|
718
|
+
this.activeViewDate = date;
|
|
719
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
720
|
+
};
|
|
694
721
|
/**
|
|
695
722
|
* @hidden
|
|
696
723
|
*/
|
|
@@ -721,6 +748,39 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
721
748
|
});
|
|
722
749
|
});
|
|
723
750
|
};
|
|
751
|
+
/**
|
|
752
|
+
* @hidden
|
|
753
|
+
*/
|
|
754
|
+
CalendarComponent.prototype.handleBlur = function (args) {
|
|
755
|
+
var _this = this;
|
|
756
|
+
if (this.element.nativeElement.contains(args.relatedTarget)) {
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
this.isActive = false;
|
|
760
|
+
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
761
|
+
// and enters the zone for no reason because the parent component is still untouched
|
|
762
|
+
if (!this.pickerService && utils_1.requiresZoneOnBlur(this.control)) {
|
|
763
|
+
this.ngZone.run(function () {
|
|
764
|
+
_this.onControlTouched();
|
|
765
|
+
_this.emitBlur(args);
|
|
766
|
+
_this.cdr.markForCheck();
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
this.emitBlur(args);
|
|
771
|
+
this.detectChanges();
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* @hidden
|
|
776
|
+
*/
|
|
777
|
+
CalendarComponent.prototype.handleFocus = function () {
|
|
778
|
+
this.isActive = true;
|
|
779
|
+
if (!core_1.NgZone.isInAngularZone()) {
|
|
780
|
+
this.detectChanges();
|
|
781
|
+
}
|
|
782
|
+
this.emitFocus();
|
|
783
|
+
};
|
|
724
784
|
CalendarComponent.prototype.setClasses = function (element) {
|
|
725
785
|
this.renderer.addClass(element, 'k-widget');
|
|
726
786
|
this.renderer.addClass(element, 'k-calendar');
|
|
@@ -765,30 +825,6 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
765
825
|
this.pickerService.onFocus.emit();
|
|
766
826
|
}
|
|
767
827
|
};
|
|
768
|
-
CalendarComponent.prototype.handleBlur = function (args) {
|
|
769
|
-
var _this = this;
|
|
770
|
-
this.isActive = false;
|
|
771
|
-
// the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)
|
|
772
|
-
// and enters the zone for no reason because the parent component is still untouched
|
|
773
|
-
if (!this.pickerService && utils_1.requiresZoneOnBlur(this.control)) {
|
|
774
|
-
this.ngZone.run(function () {
|
|
775
|
-
_this.onControlTouched();
|
|
776
|
-
_this.emitBlur(args);
|
|
777
|
-
_this.cdr.markForCheck();
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
else {
|
|
781
|
-
this.emitBlur(args);
|
|
782
|
-
this.detectChanges();
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
CalendarComponent.prototype.handleFocus = function () {
|
|
786
|
-
this.isActive = true;
|
|
787
|
-
if (!core_1.NgZone.isInAngularZone()) {
|
|
788
|
-
this.detectChanges();
|
|
789
|
-
}
|
|
790
|
-
this.emitFocus();
|
|
791
|
-
};
|
|
792
828
|
CalendarComponent.prototype.handleComponentClick = function () {
|
|
793
829
|
if (!this.isActive) {
|
|
794
830
|
if (this.type === 'infinite' && this.monthView.isScrolled()) {
|
|
@@ -825,7 +861,12 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
825
861
|
}
|
|
826
862
|
};
|
|
827
863
|
CalendarComponent.prototype.setAriaActivedescendant = function () {
|
|
828
|
-
|
|
864
|
+
// in Classic mode, the inner MultiViewCalendar handles the activedescendant
|
|
865
|
+
if (!utils_1.isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (this.type === 'classic') {
|
|
869
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
|
|
829
870
|
return;
|
|
830
871
|
}
|
|
831
872
|
var focusedCellId = this.cellUID + this.focusedDate.getTime();
|
|
@@ -934,6 +975,10 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
934
975
|
core_1.Output(),
|
|
935
976
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
936
977
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
978
|
+
tslib_1.__decorate([
|
|
979
|
+
core_1.Output(),
|
|
980
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
981
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
937
982
|
tslib_1.__decorate([
|
|
938
983
|
core_1.Output(),
|
|
939
984
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -1022,16 +1067,15 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1022
1067
|
core_1.ViewChild(view_list_component_1.ViewListComponent, { static: false }),
|
|
1023
1068
|
tslib_1.__metadata("design:type", view_list_component_1.ViewListComponent)
|
|
1024
1069
|
], CalendarComponent.prototype, "monthView", void 0);
|
|
1070
|
+
tslib_1.__decorate([
|
|
1071
|
+
core_1.ViewChild(multiview_calendar_component_1.MultiViewCalendarComponent, { static: false }),
|
|
1072
|
+
tslib_1.__metadata("design:type", multiview_calendar_component_1.MultiViewCalendarComponent)
|
|
1073
|
+
], CalendarComponent.prototype, "multiViewCalendar", void 0);
|
|
1025
1074
|
tslib_1.__decorate([
|
|
1026
1075
|
core_1.HostBinding('attr.id'),
|
|
1027
1076
|
tslib_1.__metadata("design:type", String),
|
|
1028
1077
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1029
1078
|
], CalendarComponent.prototype, "widgetId", null);
|
|
1030
|
-
tslib_1.__decorate([
|
|
1031
|
-
core_1.HostBinding('attr.role'),
|
|
1032
|
-
tslib_1.__metadata("design:type", String),
|
|
1033
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1034
|
-
], CalendarComponent.prototype, "widgetRole", null);
|
|
1035
1079
|
tslib_1.__decorate([
|
|
1036
1080
|
core_1.HostBinding('attr.tabindex'),
|
|
1037
1081
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1063,7 +1107,7 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1063
1107
|
selection_service_1.SelectionService
|
|
1064
1108
|
],
|
|
1065
1109
|
selector: 'kendo-calendar',
|
|
1066
|
-
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)=\"
|
|
1110
|
+
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 "
|
|
1067
1111
|
}),
|
|
1068
1112
|
tslib_1.__param(12, core_1.Optional()),
|
|
1069
1113
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
@@ -40,10 +40,9 @@ var HeaderComponent = /** @class */ (function () {
|
|
|
40
40
|
this.subscriptions = new rxjs_1.Subscription();
|
|
41
41
|
}
|
|
42
42
|
HeaderComponent.prototype.ngOnInit = function () {
|
|
43
|
-
this.subscriptions
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
43
|
+
this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
|
|
44
|
+
this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
|
|
45
|
+
this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
47
46
|
};
|
|
48
47
|
HeaderComponent.prototype.ngOnChanges = function (_) {
|
|
49
48
|
var service = this.bus.service(this.activeView);
|
|
@@ -351,7 +351,7 @@ var HorizontalViewListComponent = /** @class */ (function () {
|
|
|
351
351
|
core_1.Component({
|
|
352
352
|
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
353
353
|
selector: 'kendo-calendar-horizontal',
|
|
354
|
-
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 "
|
|
354
|
+
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 "
|
|
355
355
|
}),
|
|
356
356
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
357
357
|
kendo_angular_intl_1.IntlService,
|
|
@@ -12,6 +12,7 @@ var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
|
12
12
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
13
13
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
14
14
|
var horizontal_view_list_component_1 = require("./horizontal-view-list.component");
|
|
15
|
+
var header_component_1 = require("./header.component");
|
|
15
16
|
var bus_view_service_1 = require("./services/bus-view.service");
|
|
16
17
|
var navigation_service_1 = require("./services/navigation.service");
|
|
17
18
|
var selection_service_1 = require("./services/selection.service");
|
|
@@ -116,6 +117,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
116
117
|
* @hidden
|
|
117
118
|
*/
|
|
118
119
|
this.isActive = false;
|
|
120
|
+
/**
|
|
121
|
+
* @hidden
|
|
122
|
+
*/
|
|
123
|
+
this.isHeaderActive = false;
|
|
119
124
|
/**
|
|
120
125
|
* Defines the active view that the Calendar initially renders
|
|
121
126
|
* ([see example]({% slug activeview_multiviewcalendar %})).
|
|
@@ -160,6 +165,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
160
165
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
161
166
|
*/
|
|
162
167
|
this.activeViewChange = new core_1.EventEmitter();
|
|
168
|
+
/**
|
|
169
|
+
* Fires when navigating in the currently active view
|
|
170
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
171
|
+
*/
|
|
172
|
+
this.navigate = new core_1.EventEmitter();
|
|
163
173
|
/**
|
|
164
174
|
* Fires when a view cell is entered
|
|
165
175
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -175,6 +185,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
175
185
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
176
186
|
*/
|
|
177
187
|
this.valueChange = new core_1.EventEmitter();
|
|
188
|
+
/**
|
|
189
|
+
* @hidden
|
|
190
|
+
*/
|
|
191
|
+
this.blurEvent = new core_1.EventEmitter();
|
|
178
192
|
this.cellUID = kendo_angular_common_1.guid();
|
|
179
193
|
this.isHovered = false;
|
|
180
194
|
this.isPrevDisabled = true;
|
|
@@ -192,7 +206,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
192
206
|
this.minValidateFn = util_1.noop;
|
|
193
207
|
this.maxValidateFn = util_1.noop;
|
|
194
208
|
this.disabledDatesRangeValidateFn = util_1.noop;
|
|
195
|
-
this.subscriptions = new rxjs_1.Subscription(
|
|
209
|
+
this.subscriptions = new rxjs_1.Subscription();
|
|
196
210
|
this.setClasses(element.nativeElement);
|
|
197
211
|
}
|
|
198
212
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "focusedDate", {
|
|
@@ -410,13 +424,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
410
424
|
enumerable: true,
|
|
411
425
|
configurable: true
|
|
412
426
|
});
|
|
413
|
-
Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
|
|
414
|
-
get: function () {
|
|
415
|
-
return 'grid';
|
|
416
|
-
},
|
|
417
|
-
enumerable: true,
|
|
418
|
-
configurable: true
|
|
419
|
-
});
|
|
420
427
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
|
|
421
428
|
get: function () {
|
|
422
429
|
return this.disabled ? undefined : this.tabIndex;
|
|
@@ -441,10 +448,15 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
441
448
|
/**
|
|
442
449
|
* @hidden
|
|
443
450
|
*/
|
|
444
|
-
MultiViewCalendarComponent.prototype.handleBlur = function () {
|
|
445
|
-
|
|
451
|
+
MultiViewCalendarComponent.prototype.handleBlur = function (event) {
|
|
452
|
+
var target = event.target;
|
|
453
|
+
if (!this.element.nativeElement.contains(event.relatedTarget)) {
|
|
454
|
+
this.blurEvent.emit(event);
|
|
455
|
+
this.onControlTouched();
|
|
456
|
+
}
|
|
446
457
|
this.isActive = false;
|
|
447
458
|
this.isHovered = false; //ensure that hovered is also not active
|
|
459
|
+
this.isHeaderActive = this.headerElement.nativeElement.contains(target);
|
|
448
460
|
};
|
|
449
461
|
/**
|
|
450
462
|
* @hidden
|
|
@@ -492,6 +504,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
492
504
|
}
|
|
493
505
|
this.focusedDate = candidate;
|
|
494
506
|
event.preventDefault();
|
|
507
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
508
|
+
if (!isSameView) {
|
|
509
|
+
this.emitNavigate(this.focusedDate);
|
|
510
|
+
}
|
|
495
511
|
};
|
|
496
512
|
MultiViewCalendarComponent.prototype.ngOnInit = function () {
|
|
497
513
|
var _this = this;
|
|
@@ -580,6 +596,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
580
596
|
this.onControlChange(this.parseSelectionToValue(availableDates));
|
|
581
597
|
this.valueChange.emit(this.parseSelectionToValue(availableDates));
|
|
582
598
|
};
|
|
599
|
+
/**
|
|
600
|
+
* @hidden
|
|
601
|
+
*/
|
|
602
|
+
MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
|
|
603
|
+
var todayDate = args.focusedDate;
|
|
604
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
|
|
605
|
+
var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
|
|
606
|
+
if (!isSameView && isBottomView) {
|
|
607
|
+
this.emitNavigate(todayDate);
|
|
608
|
+
}
|
|
609
|
+
this.handleDateChange(args);
|
|
610
|
+
};
|
|
583
611
|
/**
|
|
584
612
|
* @hidden
|
|
585
613
|
*/
|
|
@@ -646,9 +674,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
646
674
|
/**
|
|
647
675
|
* @hidden
|
|
648
676
|
*/
|
|
649
|
-
MultiViewCalendarComponent.prototype.
|
|
677
|
+
MultiViewCalendarComponent.prototype.navigateView = function (action) {
|
|
650
678
|
this.focusedDate = this.viewList.navigate(action);
|
|
651
679
|
this.updateButtonState();
|
|
680
|
+
this.emitNavigate(this.focusedDate);
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* @hidden
|
|
684
|
+
*/
|
|
685
|
+
MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
686
|
+
var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
|
|
687
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
652
688
|
};
|
|
653
689
|
/**
|
|
654
690
|
* @hidden
|
|
@@ -666,6 +702,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
666
702
|
MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
|
|
667
703
|
var date = _a.date, modifiers = _a.modifiers;
|
|
668
704
|
this.performSelection(date, modifiers);
|
|
705
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
706
|
+
if (!isSameView) {
|
|
707
|
+
this.emitNavigate(this.focusedDate);
|
|
708
|
+
}
|
|
669
709
|
};
|
|
670
710
|
/**
|
|
671
711
|
* @hidden
|
|
@@ -838,6 +878,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
838
878
|
core_1.Output(),
|
|
839
879
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
840
880
|
], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
|
|
881
|
+
tslib_1.__decorate([
|
|
882
|
+
core_1.Output(),
|
|
883
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
884
|
+
], MultiViewCalendarComponent.prototype, "navigate", void 0);
|
|
841
885
|
tslib_1.__decorate([
|
|
842
886
|
core_1.Output(),
|
|
843
887
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -850,6 +894,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
850
894
|
core_1.Output(),
|
|
851
895
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
852
896
|
], MultiViewCalendarComponent.prototype, "valueChange", void 0);
|
|
897
|
+
tslib_1.__decorate([
|
|
898
|
+
core_1.Output('blur'),
|
|
899
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
900
|
+
], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
|
|
853
901
|
tslib_1.__decorate([
|
|
854
902
|
core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: true }),
|
|
855
903
|
tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
|
|
@@ -913,6 +961,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
913
961
|
tslib_1.__metadata("design:type", header_title_template_directive_1.HeaderTitleTemplateDirective),
|
|
914
962
|
tslib_1.__metadata("design:paramtypes", [header_title_template_directive_1.HeaderTitleTemplateDirective])
|
|
915
963
|
], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
|
|
964
|
+
tslib_1.__decorate([
|
|
965
|
+
core_1.ViewChild(header_component_1.HeaderComponent, { static: false, read: core_1.ElementRef }),
|
|
966
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
967
|
+
], MultiViewCalendarComponent.prototype, "headerElement", void 0);
|
|
916
968
|
tslib_1.__decorate([
|
|
917
969
|
core_1.ViewChild(horizontal_view_list_component_1.HorizontalViewListComponent, { static: false }),
|
|
918
970
|
tslib_1.__metadata("design:type", horizontal_view_list_component_1.HorizontalViewListComponent)
|
|
@@ -922,11 +974,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
922
974
|
tslib_1.__metadata("design:type", String),
|
|
923
975
|
tslib_1.__metadata("design:paramtypes", [])
|
|
924
976
|
], MultiViewCalendarComponent.prototype, "widgetId", null);
|
|
925
|
-
tslib_1.__decorate([
|
|
926
|
-
core_1.HostBinding('attr.role'),
|
|
927
|
-
tslib_1.__metadata("design:type", String),
|
|
928
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
929
|
-
], MultiViewCalendarComponent.prototype, "widgetRole", null);
|
|
930
977
|
tslib_1.__decorate([
|
|
931
978
|
core_1.HostBinding('attr.tabindex'),
|
|
932
979
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -944,9 +991,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
944
991
|
tslib_1.__metadata("design:paramtypes", [])
|
|
945
992
|
], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
|
|
946
993
|
tslib_1.__decorate([
|
|
947
|
-
core_1.HostListener(
|
|
994
|
+
core_1.HostListener('focusout', ['$event']),
|
|
948
995
|
tslib_1.__metadata("design:type", Function),
|
|
949
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
996
|
+
tslib_1.__metadata("design:paramtypes", [FocusEvent]),
|
|
950
997
|
tslib_1.__metadata("design:returntype", void 0)
|
|
951
998
|
], MultiViewCalendarComponent.prototype, "handleBlur", null);
|
|
952
999
|
tslib_1.__decorate([
|
|
@@ -1003,7 +1050,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
1003
1050
|
selection_service_1.SelectionService
|
|
1004
1051
|
],
|
|
1005
1052
|
selector: 'kendo-multiviewcalendar',
|
|
1006
|
-
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)=\"
|
|
1053
|
+
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 "
|
|
1007
1054
|
}),
|
|
1008
1055
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
1009
1056
|
core_1.ElementRef,
|
|
@@ -116,6 +116,12 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
116
116
|
var firstYear = kendo_date_math_1.firstYearOfDecade(kendo_date_math_1.firstDecadeOfCentury(date));
|
|
117
117
|
return kendo_date_math_1.createDate(firstYear.getFullYear(), 0, 1);
|
|
118
118
|
};
|
|
119
|
+
CenturyViewService.prototype.lastDayOfPeriod = function (date) {
|
|
120
|
+
var decade = kendo_date_math_1.lastDecadeOfCentury(date);
|
|
121
|
+
var year = kendo_date_math_1.lastYearOfDecade(decade);
|
|
122
|
+
var month = kendo_date_math_1.lastMonthOfYear(year);
|
|
123
|
+
return kendo_date_math_1.lastDayOfMonth(month);
|
|
124
|
+
};
|
|
119
125
|
CenturyViewService.prototype.isRangeStart = function (value) {
|
|
120
126
|
return value.getFullYear() % 1000 === 0;
|
|
121
127
|
};
|
|
@@ -116,6 +116,11 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
116
116
|
var firstYear = kendo_date_math_1.firstYearOfDecade(date);
|
|
117
117
|
return kendo_date_math_1.createDate(firstYear.getFullYear(), 0, 1);
|
|
118
118
|
};
|
|
119
|
+
DecadeViewService.prototype.lastDayOfPeriod = function (date) {
|
|
120
|
+
var year = kendo_date_math_1.lastYearOfDecade(date);
|
|
121
|
+
var month = kendo_date_math_1.lastMonthOfYear(year);
|
|
122
|
+
return kendo_date_math_1.lastDayOfMonth(month);
|
|
123
|
+
};
|
|
119
124
|
DecadeViewService.prototype.isRangeStart = function (value) {
|
|
120
125
|
return value.getFullYear() % 100 === 0;
|
|
121
126
|
};
|
|
@@ -126,6 +126,9 @@ var MonthViewService = /** @class */ (function () {
|
|
|
126
126
|
}
|
|
127
127
|
return kendo_date_math_1.createDate(date.getFullYear(), date.getMonth(), 1);
|
|
128
128
|
};
|
|
129
|
+
MonthViewService.prototype.lastDayOfPeriod = function (date) {
|
|
130
|
+
return kendo_date_math_1.lastDayOfMonth(date);
|
|
131
|
+
};
|
|
129
132
|
MonthViewService.prototype.isRangeStart = function (value) {
|
|
130
133
|
return !value.getMonth();
|
|
131
134
|
};
|
|
@@ -142,6 +142,10 @@ var YearViewService = /** @class */ (function () {
|
|
|
142
142
|
}
|
|
143
143
|
return kendo_date_math_1.createDate(date.getFullYear(), 0, 1);
|
|
144
144
|
};
|
|
145
|
+
YearViewService.prototype.lastDayOfPeriod = function (date) {
|
|
146
|
+
var month = kendo_date_math_1.lastMonthOfYear(date);
|
|
147
|
+
return kendo_date_math_1.lastDayOfMonth(month);
|
|
148
|
+
};
|
|
145
149
|
YearViewService.prototype.isRangeStart = function (value) {
|
|
146
150
|
return value.getFullYear() % 10 === 0;
|
|
147
151
|
};
|
|
@@ -290,7 +290,7 @@ var ViewListComponent = /** @class */ (function () {
|
|
|
290
290
|
core_1.Component({
|
|
291
291
|
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
292
292
|
selector: 'kendo-calendar-viewlist',
|
|
293
|
-
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
|
|
293
|
+
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 "
|
|
294
294
|
}),
|
|
295
295
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
296
296
|
core_1.ChangeDetectorRef,
|
|
@@ -122,11 +122,13 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
122
122
|
/**
|
|
123
123
|
* Specifies the smallest valid date
|
|
124
124
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
125
|
+
* By default, the `min` value is `1900-1-1`.
|
|
125
126
|
*/
|
|
126
127
|
this.min = kendo_date_math_1.cloneDate(defaults_1.MIN_DATE);
|
|
127
128
|
/**
|
|
128
129
|
* Specifies the biggest valid date
|
|
129
130
|
* ([see example]({% slug dateranges_datepicker %})).
|
|
131
|
+
* By default, the `max` value is `2099-12-31`.
|
|
130
132
|
*/
|
|
131
133
|
this.max = kendo_date_math_1.cloneDate(defaults_1.MAX_DATE);
|
|
132
134
|
/**
|
|
@@ -718,7 +720,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
718
720
|
* @hidden
|
|
719
721
|
*/
|
|
720
722
|
DatePickerComponent.prototype.handleKeydown = function (e) {
|
|
721
|
-
var altKey = e.altKey, keyCode = e.keyCode;
|
|
723
|
+
var altKey = e.altKey, shiftKey = e.shiftKey, keyCode = e.keyCode, target = e.target;
|
|
722
724
|
if (keyCode === kendo_angular_common_1.Keys.Escape) {
|
|
723
725
|
this.show = false;
|
|
724
726
|
}
|
|
@@ -730,7 +732,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
730
732
|
this.show = false;
|
|
731
733
|
}
|
|
732
734
|
}
|
|
733
|
-
if (keyCode === kendo_angular_common_1.Keys.Tab && this.show && this.calendar.isActive) {
|
|
735
|
+
if (keyCode === kendo_angular_common_1.Keys.Tab && this.show && this.calendar.isActive && util_1.isTabExitingCalendar(this.calendarType, target, shiftKey)) {
|
|
734
736
|
this.input.focus();
|
|
735
737
|
this.show = false;
|
|
736
738
|
}
|
|
@@ -21,8 +21,8 @@ var DateRangeInput = /** @class */ (function () {
|
|
|
21
21
|
this.renderer = renderer;
|
|
22
22
|
this.zone = zone;
|
|
23
23
|
this.navigateCalendarOnFocus = false;
|
|
24
|
-
this.popupSubscriptions = new rxjs_1.Subscription(
|
|
25
|
-
this.subscriptions = new rxjs_1.Subscription(
|
|
24
|
+
this.popupSubscriptions = new rxjs_1.Subscription();
|
|
25
|
+
this.subscriptions = new rxjs_1.Subscription();
|
|
26
26
|
}
|
|
27
27
|
Object.defineProperty(DateRangeInput.prototype, "isActiveEnd", {
|
|
28
28
|
get: function () {
|
|
@@ -81,7 +81,7 @@ var DateRangeInput = /** @class */ (function () {
|
|
|
81
81
|
};
|
|
82
82
|
DateRangeInput.prototype.unsubscribePopup = function () {
|
|
83
83
|
this.popupSubscriptions.unsubscribe();
|
|
84
|
-
this.popupSubscriptions = new rxjs_1.Subscription(
|
|
84
|
+
this.popupSubscriptions = new rxjs_1.Subscription();
|
|
85
85
|
};
|
|
86
86
|
DateRangeInput.prototype.activate = function () {
|
|
87
87
|
this.dateRangeService.setActiveRangeEnd(this.activeRangeEnd);
|
|
@@ -86,8 +86,8 @@ var DateRangePopupComponent = /** @class */ (function () {
|
|
|
86
86
|
* @hidden
|
|
87
87
|
*/
|
|
88
88
|
this.popupUID = kendo_angular_common_1.guid();
|
|
89
|
-
this.calendarSubscriptions = new rxjs_1.Subscription(
|
|
90
|
-
this.popupSubscriptions = new rxjs_1.Subscription(
|
|
89
|
+
this.calendarSubscriptions = new rxjs_1.Subscription();
|
|
90
|
+
this.popupSubscriptions = new rxjs_1.Subscription();
|
|
91
91
|
this.resolvedPromise = Promise.resolve();
|
|
92
92
|
}
|
|
93
93
|
Object.defineProperty(DateRangePopupComponent.prototype, "calendar", {
|