@progress/kendo-angular-dateinputs 5.2.4-dev.202110261444 → 5.3.1-dev.202112071202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/calendar/calendar.component.js +102 -46
- package/dist/es/calendar/horizontal-view-list.component.js +1 -1
- package/dist/es/calendar/multiview-calendar.component.js +76 -20
- package/dist/es/calendar/multiview-calendar.module.js +9 -1
- package/dist/es/calendar/services/century-view.service.js +7 -1
- package/dist/es/calendar/services/decade-view.service.js +6 -1
- package/dist/es/calendar/services/month-view.service.js +3 -0
- package/dist/es/calendar/services/year-view.service.js +5 -1
- package/dist/es/calendar/view-list.component.js +1 -1
- package/dist/es/datepicker/datepicker.component.js +5 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/util.js +15 -0
- package/dist/es2015/calendar/calendar.component.d.ts +34 -3
- package/dist/es2015/calendar/calendar.component.js +104 -41
- package/dist/es2015/calendar/horizontal-view-list.component.js +1 -0
- package/dist/es2015/calendar/models/view-service.interface.d.ts +1 -0
- package/dist/es2015/calendar/multiview-calendar.component.d.ts +34 -3
- package/dist/es2015/calendar/multiview-calendar.component.js +83 -19
- package/dist/es2015/calendar/multiview-calendar.module.js +9 -1
- package/dist/es2015/calendar/services/century-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/century-view.service.js +7 -1
- package/dist/es2015/calendar/services/decade-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/decade-view.service.js +6 -1
- package/dist/es2015/calendar/services/month-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/month-view.service.js +3 -0
- package/dist/es2015/calendar/services/year-view.service.d.ts +1 -0
- package/dist/es2015/calendar/services/year-view.service.js +5 -1
- package/dist/es2015/calendar/view-list.component.js +5 -1
- package/dist/es2015/dateinput/dateinput.component.d.ts +2 -0
- package/dist/es2015/datepicker/datepicker.component.d.ts +2 -0
- package/dist/es2015/datepicker/datepicker.component.js +5 -3
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/util.d.ts +7 -0
- package/dist/es2015/util.js +15 -0
- package/dist/fesm2015/index.js +7253 -7080
- package/dist/fesm5/index.js +6807 -6654
- package/dist/npm/calendar/calendar.component.js +102 -46
- package/dist/npm/calendar/horizontal-view-list.component.js +1 -1
- package/dist/npm/calendar/multiview-calendar.component.js +76 -20
- package/dist/npm/calendar/multiview-calendar.module.js +9 -1
- package/dist/npm/calendar/services/century-view.service.js +6 -0
- package/dist/npm/calendar/services/decade-view.service.js +5 -0
- package/dist/npm/calendar/services/month-view.service.js +3 -0
- package/dist/npm/calendar/services/year-view.service.js +4 -0
- package/dist/npm/calendar/view-list.component.js +1 -1
- package/dist/npm/datepicker/datepicker.component.js +4 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/util.js +15 -0
- package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
- package/package.json +1 -1
|
@@ -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,21 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
681
694
|
return null;
|
|
682
695
|
}
|
|
683
696
|
};
|
|
697
|
+
/**
|
|
698
|
+
* @hidden
|
|
699
|
+
*/
|
|
700
|
+
CalendarComponent.prototype.handleNavigate = function (event) {
|
|
701
|
+
this.focusedDate = event.focusedDate;
|
|
702
|
+
this.activeView = event.activeView;
|
|
703
|
+
this.emitNavigate(this.focusedDate);
|
|
704
|
+
};
|
|
705
|
+
/**
|
|
706
|
+
* @hidden
|
|
707
|
+
*/
|
|
708
|
+
CalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
709
|
+
var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
|
|
710
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
711
|
+
};
|
|
684
712
|
/**
|
|
685
713
|
* @hidden
|
|
686
714
|
*/
|
|
@@ -691,6 +719,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
691
719
|
});
|
|
692
720
|
}
|
|
693
721
|
};
|
|
722
|
+
/**
|
|
723
|
+
* @hidden
|
|
724
|
+
*/
|
|
725
|
+
CalendarComponent.prototype.handleActiveDateChange = function (date) {
|
|
726
|
+
this.activeViewDate = date;
|
|
727
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
728
|
+
};
|
|
694
729
|
/**
|
|
695
730
|
* @hidden
|
|
696
731
|
*/
|
|
@@ -721,6 +756,39 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
721
756
|
});
|
|
722
757
|
});
|
|
723
758
|
};
|
|
759
|
+
/**
|
|
760
|
+
* @hidden
|
|
761
|
+
*/
|
|
762
|
+
CalendarComponent.prototype.handleBlur = function (args) {
|
|
763
|
+
var _this = this;
|
|
764
|
+
if (this.element.nativeElement.contains(args.relatedTarget)) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
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 && utils_1.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
|
+
/**
|
|
783
|
+
* @hidden
|
|
784
|
+
*/
|
|
785
|
+
CalendarComponent.prototype.handleFocus = function () {
|
|
786
|
+
this.isActive = true;
|
|
787
|
+
if (!core_1.NgZone.isInAngularZone()) {
|
|
788
|
+
this.detectChanges();
|
|
789
|
+
}
|
|
790
|
+
this.emitFocus();
|
|
791
|
+
};
|
|
724
792
|
CalendarComponent.prototype.setClasses = function (element) {
|
|
725
793
|
this.renderer.addClass(element, 'k-widget');
|
|
726
794
|
this.renderer.addClass(element, 'k-calendar');
|
|
@@ -765,30 +833,6 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
765
833
|
this.pickerService.onFocus.emit();
|
|
766
834
|
}
|
|
767
835
|
};
|
|
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
836
|
CalendarComponent.prototype.handleComponentClick = function () {
|
|
793
837
|
if (!this.isActive) {
|
|
794
838
|
if (this.type === 'infinite' && this.monthView.isScrolled()) {
|
|
@@ -799,6 +843,10 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
799
843
|
}
|
|
800
844
|
};
|
|
801
845
|
CalendarComponent.prototype.handleKeydown = function (args) {
|
|
846
|
+
var headerActive = this.type === 'classic' && this.multiViewCalendar.isHeaderActive;
|
|
847
|
+
if (headerActive) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
802
850
|
// reserve the alt + arrow key commands for the picker
|
|
803
851
|
var arrowKeyPressed = [kendo_angular_common_1.Keys.ArrowUp, kendo_angular_common_1.Keys.ArrowRight, kendo_angular_common_1.Keys.ArrowDown, kendo_angular_common_1.Keys.ArrowLeft].indexOf(args.keyCode) !== -1;
|
|
804
852
|
if (utils_1.isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {
|
|
@@ -825,7 +873,12 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
825
873
|
}
|
|
826
874
|
};
|
|
827
875
|
CalendarComponent.prototype.setAriaActivedescendant = function () {
|
|
828
|
-
|
|
876
|
+
// in Classic mode, the inner MultiViewCalendar handles the activedescendant
|
|
877
|
+
if (!utils_1.isPresent(this.element) || (this.type === 'classic' && !this.element.nativeElement.hasAttribute('aria-activedescendant'))) {
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
if (this.type === 'classic') {
|
|
881
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-activedescendant');
|
|
829
882
|
return;
|
|
830
883
|
}
|
|
831
884
|
var focusedCellId = this.cellUID + this.focusedDate.getTime();
|
|
@@ -934,6 +987,10 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
934
987
|
core_1.Output(),
|
|
935
988
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
936
989
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
990
|
+
tslib_1.__decorate([
|
|
991
|
+
core_1.Output(),
|
|
992
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
993
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
937
994
|
tslib_1.__decorate([
|
|
938
995
|
core_1.Output(),
|
|
939
996
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -1022,16 +1079,15 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1022
1079
|
core_1.ViewChild(view_list_component_1.ViewListComponent, { static: false }),
|
|
1023
1080
|
tslib_1.__metadata("design:type", view_list_component_1.ViewListComponent)
|
|
1024
1081
|
], CalendarComponent.prototype, "monthView", void 0);
|
|
1082
|
+
tslib_1.__decorate([
|
|
1083
|
+
core_1.ViewChild(multiview_calendar_component_1.MultiViewCalendarComponent, { static: false }),
|
|
1084
|
+
tslib_1.__metadata("design:type", multiview_calendar_component_1.MultiViewCalendarComponent)
|
|
1085
|
+
], CalendarComponent.prototype, "multiViewCalendar", void 0);
|
|
1025
1086
|
tslib_1.__decorate([
|
|
1026
1087
|
core_1.HostBinding('attr.id'),
|
|
1027
1088
|
tslib_1.__metadata("design:type", String),
|
|
1028
1089
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1029
1090
|
], 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
1091
|
tslib_1.__decorate([
|
|
1036
1092
|
core_1.HostBinding('attr.tabindex'),
|
|
1037
1093
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -1063,7 +1119,7 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1063
1119
|
selection_service_1.SelectionService
|
|
1064
1120
|
],
|
|
1065
1121
|
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)=\"
|
|
1122
|
+
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)=\"handleNavigate($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
1123
|
}),
|
|
1068
1124
|
tslib_1.__param(12, core_1.Optional()),
|
|
1069
1125
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
@@ -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,
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"use strict";
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
|
-
/* tslint:disable:no-forward-ref */
|
|
9
8
|
var core_1 = require("@angular/core");
|
|
10
9
|
var forms_1 = require("@angular/forms");
|
|
11
10
|
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
12
11
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
13
12
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
14
13
|
var horizontal_view_list_component_1 = require("./horizontal-view-list.component");
|
|
14
|
+
var header_component_1 = require("./header.component");
|
|
15
15
|
var bus_view_service_1 = require("./services/bus-view.service");
|
|
16
16
|
var navigation_service_1 = require("./services/navigation.service");
|
|
17
17
|
var selection_service_1 = require("./services/selection.service");
|
|
@@ -116,6 +116,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
116
116
|
* @hidden
|
|
117
117
|
*/
|
|
118
118
|
this.isActive = false;
|
|
119
|
+
/**
|
|
120
|
+
* @hidden
|
|
121
|
+
*/
|
|
122
|
+
this.isHeaderActive = false;
|
|
119
123
|
/**
|
|
120
124
|
* Defines the active view that the Calendar initially renders
|
|
121
125
|
* ([see example]({% slug activeview_multiviewcalendar %})).
|
|
@@ -160,6 +164,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
160
164
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
161
165
|
*/
|
|
162
166
|
this.activeViewChange = new core_1.EventEmitter();
|
|
167
|
+
/**
|
|
168
|
+
* Fires when navigating in the currently active view
|
|
169
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
170
|
+
*/
|
|
171
|
+
this.navigate = new core_1.EventEmitter();
|
|
163
172
|
/**
|
|
164
173
|
* Fires when a view cell is entered
|
|
165
174
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -175,6 +184,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
175
184
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
176
185
|
*/
|
|
177
186
|
this.valueChange = new core_1.EventEmitter();
|
|
187
|
+
/**
|
|
188
|
+
* @hidden
|
|
189
|
+
*/
|
|
190
|
+
this.blurEvent = new core_1.EventEmitter();
|
|
178
191
|
this.cellUID = kendo_angular_common_1.guid();
|
|
179
192
|
this.isHovered = false;
|
|
180
193
|
this.isPrevDisabled = true;
|
|
@@ -410,13 +423,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
410
423
|
enumerable: true,
|
|
411
424
|
configurable: true
|
|
412
425
|
});
|
|
413
|
-
Object.defineProperty(MultiViewCalendarComponent.prototype, "widgetRole", {
|
|
414
|
-
get: function () {
|
|
415
|
-
return 'grid';
|
|
416
|
-
},
|
|
417
|
-
enumerable: true,
|
|
418
|
-
configurable: true
|
|
419
|
-
});
|
|
420
426
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "calendarTabIndex", {
|
|
421
427
|
get: function () {
|
|
422
428
|
return this.disabled ? undefined : this.tabIndex;
|
|
@@ -441,16 +447,22 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
441
447
|
/**
|
|
442
448
|
* @hidden
|
|
443
449
|
*/
|
|
444
|
-
MultiViewCalendarComponent.prototype.
|
|
445
|
-
|
|
450
|
+
MultiViewCalendarComponent.prototype.handleFocusout = function (event) {
|
|
451
|
+
var relatedTarget = event.relatedTarget;
|
|
452
|
+
if (!this.element.nativeElement.contains(relatedTarget)) {
|
|
453
|
+
this.blurEvent.emit(event);
|
|
454
|
+
this.onControlTouched();
|
|
455
|
+
}
|
|
446
456
|
this.isActive = false;
|
|
447
457
|
this.isHovered = false; //ensure that hovered is also not active
|
|
458
|
+
this.isHeaderActive = this.headerElement.nativeElement.contains(relatedTarget);
|
|
448
459
|
};
|
|
449
460
|
/**
|
|
450
461
|
* @hidden
|
|
451
462
|
*/
|
|
452
463
|
MultiViewCalendarComponent.prototype.handleFocus = function () {
|
|
453
464
|
this.isActive = true;
|
|
465
|
+
this.isHeaderActive = false;
|
|
454
466
|
};
|
|
455
467
|
/**
|
|
456
468
|
* @hidden
|
|
@@ -483,6 +495,9 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
483
495
|
* @hidden
|
|
484
496
|
*/
|
|
485
497
|
MultiViewCalendarComponent.prototype.keydown = function (event) {
|
|
498
|
+
if (this.isHeaderActive) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
486
501
|
if (event.keyCode === kendo_angular_common_1.Keys.Enter) {
|
|
487
502
|
this.performSelection(this.focusedDate, event);
|
|
488
503
|
}
|
|
@@ -492,6 +507,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
492
507
|
}
|
|
493
508
|
this.focusedDate = candidate;
|
|
494
509
|
event.preventDefault();
|
|
510
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
511
|
+
if (!isSameView) {
|
|
512
|
+
this.emitNavigate(this.focusedDate);
|
|
513
|
+
}
|
|
495
514
|
};
|
|
496
515
|
MultiViewCalendarComponent.prototype.ngOnInit = function () {
|
|
497
516
|
var _this = this;
|
|
@@ -556,6 +575,12 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
556
575
|
}
|
|
557
576
|
this.element.nativeElement.blur();
|
|
558
577
|
};
|
|
578
|
+
/**
|
|
579
|
+
* @hidden
|
|
580
|
+
*/
|
|
581
|
+
MultiViewCalendarComponent.prototype.handleHeaderFocus = function () {
|
|
582
|
+
this.isHeaderActive = true;
|
|
583
|
+
};
|
|
559
584
|
/**
|
|
560
585
|
* @hidden
|
|
561
586
|
*/
|
|
@@ -580,6 +605,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
580
605
|
this.onControlChange(this.parseSelectionToValue(availableDates));
|
|
581
606
|
this.valueChange.emit(this.parseSelectionToValue(availableDates));
|
|
582
607
|
};
|
|
608
|
+
/**
|
|
609
|
+
* @hidden
|
|
610
|
+
*/
|
|
611
|
+
MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
|
|
612
|
+
var todayDate = args.focusedDate;
|
|
613
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
|
|
614
|
+
var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
|
|
615
|
+
if (!isSameView && isBottomView) {
|
|
616
|
+
this.emitNavigate(todayDate);
|
|
617
|
+
}
|
|
618
|
+
this.handleDateChange(args);
|
|
619
|
+
};
|
|
583
620
|
/**
|
|
584
621
|
* @hidden
|
|
585
622
|
*/
|
|
@@ -646,9 +683,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
646
683
|
/**
|
|
647
684
|
* @hidden
|
|
648
685
|
*/
|
|
649
|
-
MultiViewCalendarComponent.prototype.
|
|
686
|
+
MultiViewCalendarComponent.prototype.navigateView = function (action) {
|
|
650
687
|
this.focusedDate = this.viewList.navigate(action);
|
|
651
688
|
this.updateButtonState();
|
|
689
|
+
this.emitNavigate(this.focusedDate);
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* @hidden
|
|
693
|
+
*/
|
|
694
|
+
MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
695
|
+
var activeView = view_enum_1.CalendarViewEnum[this.activeViewEnum];
|
|
696
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
652
697
|
};
|
|
653
698
|
/**
|
|
654
699
|
* @hidden
|
|
@@ -666,6 +711,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
666
711
|
MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
|
|
667
712
|
var date = _a.date, modifiers = _a.modifiers;
|
|
668
713
|
this.performSelection(date, modifiers);
|
|
714
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
715
|
+
if (!isSameView) {
|
|
716
|
+
this.emitNavigate(this.focusedDate);
|
|
717
|
+
}
|
|
669
718
|
};
|
|
670
719
|
/**
|
|
671
720
|
* @hidden
|
|
@@ -838,6 +887,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
838
887
|
core_1.Output(),
|
|
839
888
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
840
889
|
], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
|
|
890
|
+
tslib_1.__decorate([
|
|
891
|
+
core_1.Output(),
|
|
892
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
893
|
+
], MultiViewCalendarComponent.prototype, "navigate", void 0);
|
|
841
894
|
tslib_1.__decorate([
|
|
842
895
|
core_1.Output(),
|
|
843
896
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -850,6 +903,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
850
903
|
core_1.Output(),
|
|
851
904
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
852
905
|
], MultiViewCalendarComponent.prototype, "valueChange", void 0);
|
|
906
|
+
tslib_1.__decorate([
|
|
907
|
+
core_1.Output('blur'),
|
|
908
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
909
|
+
], MultiViewCalendarComponent.prototype, "blurEvent", void 0);
|
|
853
910
|
tslib_1.__decorate([
|
|
854
911
|
core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: true }),
|
|
855
912
|
tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
|
|
@@ -913,6 +970,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
913
970
|
tslib_1.__metadata("design:type", header_title_template_directive_1.HeaderTitleTemplateDirective),
|
|
914
971
|
tslib_1.__metadata("design:paramtypes", [header_title_template_directive_1.HeaderTitleTemplateDirective])
|
|
915
972
|
], MultiViewCalendarComponent.prototype, "headerTitleTemplateRef", null);
|
|
973
|
+
tslib_1.__decorate([
|
|
974
|
+
core_1.ViewChild(header_component_1.HeaderComponent, { static: false, read: core_1.ElementRef }),
|
|
975
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
976
|
+
], MultiViewCalendarComponent.prototype, "headerElement", void 0);
|
|
916
977
|
tslib_1.__decorate([
|
|
917
978
|
core_1.ViewChild(horizontal_view_list_component_1.HorizontalViewListComponent, { static: false }),
|
|
918
979
|
tslib_1.__metadata("design:type", horizontal_view_list_component_1.HorizontalViewListComponent)
|
|
@@ -922,11 +983,6 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
922
983
|
tslib_1.__metadata("design:type", String),
|
|
923
984
|
tslib_1.__metadata("design:paramtypes", [])
|
|
924
985
|
], 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
986
|
tslib_1.__decorate([
|
|
931
987
|
core_1.HostBinding('attr.tabindex'),
|
|
932
988
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -944,11 +1000,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
944
1000
|
tslib_1.__metadata("design:paramtypes", [])
|
|
945
1001
|
], MultiViewCalendarComponent.prototype, "ariaActivedescendant", null);
|
|
946
1002
|
tslib_1.__decorate([
|
|
947
|
-
core_1.HostListener(
|
|
1003
|
+
core_1.HostListener('focusout', ['$event']),
|
|
948
1004
|
tslib_1.__metadata("design:type", Function),
|
|
949
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
1005
|
+
tslib_1.__metadata("design:paramtypes", [FocusEvent]),
|
|
950
1006
|
tslib_1.__metadata("design:returntype", void 0)
|
|
951
|
-
], MultiViewCalendarComponent.prototype, "
|
|
1007
|
+
], MultiViewCalendarComponent.prototype, "handleFocusout", null);
|
|
952
1008
|
tslib_1.__decorate([
|
|
953
1009
|
core_1.HostListener("focus"),
|
|
954
1010
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1003,7 +1059,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
1003
1059
|
selection_service_1.SelectionService
|
|
1004
1060
|
],
|
|
1005
1061
|
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)=\"
|
|
1062
|
+
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 [kendoEventsOutsideAngular]=\"{\n focusin: handleHeaderFocus\n }\"\n [scope]=\"this\"\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
1063
|
}),
|
|
1008
1064
|
tslib_1.__metadata("design:paramtypes", [bus_view_service_1.BusViewService,
|
|
1009
1065
|
core_1.ElementRef,
|
|
@@ -9,6 +9,7 @@ var core_1 = require("@angular/core");
|
|
|
9
9
|
var common_1 = require("@angular/common");
|
|
10
10
|
var kendo_angular_intl_1 = require("@progress/kendo-angular-intl");
|
|
11
11
|
var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
|
|
12
|
+
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
12
13
|
var calendar_common_module_1 = require("./calendar-common.module");
|
|
13
14
|
var templates_module_1 = require("./templates.module");
|
|
14
15
|
var horizontal_view_list_component_1 = require("./horizontal-view-list.component");
|
|
@@ -75,7 +76,14 @@ var MultiViewCalendarModule = /** @class */ (function () {
|
|
|
75
76
|
calendar_common_module_1.CalendarCommonModule,
|
|
76
77
|
templates_module_1.TemplatesModule
|
|
77
78
|
],
|
|
78
|
-
imports: [
|
|
79
|
+
imports: [
|
|
80
|
+
common_1.CommonModule,
|
|
81
|
+
calendar_common_module_1.CalendarCommonModule,
|
|
82
|
+
kendo_angular_intl_1.IntlModule,
|
|
83
|
+
templates_module_1.TemplatesModule,
|
|
84
|
+
kendo_angular_popup_1.PopupModule,
|
|
85
|
+
kendo_angular_common_1.EventsModule
|
|
86
|
+
],
|
|
79
87
|
providers: [
|
|
80
88
|
navigation_service_1.NavigationService,
|
|
81
89
|
century_view_service_1.CenturyViewService,
|
|
@@ -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,
|