@progress/kendo-angular-dateinputs 5.2.3 → 5.3.0-dev.202110290637
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 +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/calendar/calendar.component.js +37 -2
- package/dist/es/calendar/header.component.js +3 -4
- package/dist/es/calendar/horizontal-view-list.component.js +3 -1
- package/dist/es/calendar/multiview-calendar.component.js +40 -3
- 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/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/es2015/calendar/calendar.component.d.ts +18 -0
- package/dist/es2015/calendar/calendar.component.js +38 -2
- package/dist/es2015/calendar/header.component.js +3 -4
- package/dist/es2015/calendar/horizontal-view-list.component.js +3 -1
- package/dist/es2015/calendar/models/view-service.interface.d.ts +1 -0
- package/dist/es2015/calendar/multiview-calendar.component.d.ts +20 -1
- package/dist/es2015/calendar/multiview-calendar.component.js +42 -5
- 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/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/fesm2015/index.js +112 -20
- package/dist/fesm5/index.js +109 -18
- package/dist/npm/calendar/calendar.component.js +37 -2
- package/dist/npm/calendar/header.component.js +3 -4
- package/dist/npm/calendar/horizontal-view-list.component.js +3 -1
- package/dist/npm/calendar/multiview-calendar.component.js +40 -3
- 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/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/systemjs/kendo-angular-dateinputs.js +1 -1
- package/package.json +5 -5
|
@@ -168,6 +168,11 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
168
168
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
169
169
|
*/
|
|
170
170
|
this.activeViewChange = new EventEmitter();
|
|
171
|
+
/**
|
|
172
|
+
* Fires when navigating in the currently active view
|
|
173
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
174
|
+
*/
|
|
175
|
+
this.navigate = new EventEmitter();
|
|
171
176
|
/**
|
|
172
177
|
* Fires when the active view date is changed
|
|
173
178
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -213,6 +218,14 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
213
218
|
* > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
|
|
214
219
|
*/
|
|
215
220
|
set: function (focusedDate) {
|
|
221
|
+
if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
|
|
222
|
+
var service = this.bus.service(this.activeViewEnum);
|
|
223
|
+
var lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
|
|
224
|
+
var isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
|
|
225
|
+
if (!isFocusedDateInRange) {
|
|
226
|
+
this.emitNavigate(focusedDate);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
216
229
|
this._focusedDate = focusedDate || getToday();
|
|
217
230
|
this.setAriaActivedescendant();
|
|
218
231
|
},
|
|
@@ -292,12 +305,16 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
292
305
|
configurable: true
|
|
293
306
|
});
|
|
294
307
|
Object.defineProperty(CalendarComponent.prototype, "disabledDates", {
|
|
308
|
+
get: function () {
|
|
309
|
+
return this._disabledDates;
|
|
310
|
+
},
|
|
295
311
|
/**
|
|
296
312
|
* Sets the dates of the Calendar that will be disabled
|
|
297
313
|
* ([see example]({% slug disabled_dates_calendar %})).
|
|
298
314
|
*/
|
|
299
315
|
set: function (value) {
|
|
300
316
|
this.disabledDatesService.initialize(value);
|
|
317
|
+
this._disabledDates = value;
|
|
301
318
|
},
|
|
302
319
|
enumerable: true,
|
|
303
320
|
configurable: true
|
|
@@ -440,7 +457,7 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
440
457
|
});
|
|
441
458
|
Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", {
|
|
442
459
|
get: function () {
|
|
443
|
-
return this.disabled ? undefined : this.tabIndex;
|
|
460
|
+
return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
|
|
444
461
|
},
|
|
445
462
|
enumerable: true,
|
|
446
463
|
configurable: true
|
|
@@ -674,6 +691,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
674
691
|
return null;
|
|
675
692
|
}
|
|
676
693
|
};
|
|
694
|
+
/**
|
|
695
|
+
* @hidden
|
|
696
|
+
*/
|
|
697
|
+
CalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
698
|
+
var activeView = CalendarViewEnum[this.activeViewEnum];
|
|
699
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
700
|
+
};
|
|
677
701
|
/**
|
|
678
702
|
* @hidden
|
|
679
703
|
*/
|
|
@@ -684,6 +708,13 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
684
708
|
});
|
|
685
709
|
}
|
|
686
710
|
};
|
|
711
|
+
/**
|
|
712
|
+
* @hidden
|
|
713
|
+
*/
|
|
714
|
+
CalendarComponent.prototype.handleActiveDateChange = function (date) {
|
|
715
|
+
this.activeViewDate = date;
|
|
716
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
717
|
+
};
|
|
687
718
|
/**
|
|
688
719
|
* @hidden
|
|
689
720
|
*/
|
|
@@ -927,6 +958,10 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
927
958
|
Output(),
|
|
928
959
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
929
960
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
961
|
+
tslib_1.__decorate([
|
|
962
|
+
Output(),
|
|
963
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
964
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
930
965
|
tslib_1.__decorate([
|
|
931
966
|
Output(),
|
|
932
967
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1056,7 +1091,7 @@ var CalendarComponent = /** @class */ (function () {
|
|
|
1056
1091
|
SelectionService
|
|
1057
1092
|
],
|
|
1058
1093
|
selector: 'kendo-calendar',
|
|
1059
|
-
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)=\"
|
|
1094
|
+
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 >\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 "
|
|
1060
1095
|
}),
|
|
1061
1096
|
tslib_1.__param(12, Optional()),
|
|
1062
1097
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
@@ -38,10 +38,9 @@ var HeaderComponent = /** @class */ (function () {
|
|
|
38
38
|
this.subscriptions = new Subscription();
|
|
39
39
|
}
|
|
40
40
|
HeaderComponent.prototype.ngOnInit = function () {
|
|
41
|
-
this.subscriptions
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
41
|
+
this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
|
|
42
|
+
this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
|
|
43
|
+
this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
45
44
|
};
|
|
46
45
|
HeaderComponent.prototype.ngOnChanges = function (_) {
|
|
47
46
|
var service = this.bus.service(this.activeView);
|
|
@@ -320,7 +320,9 @@ var HorizontalViewListComponent = /** @class */ (function () {
|
|
|
320
320
|
], HorizontalViewListComponent.prototype, "activeDateChange", void 0);
|
|
321
321
|
tslib_1.__decorate([
|
|
322
322
|
HostBinding("class.k-calendar-view"),
|
|
323
|
-
HostBinding("class.k-
|
|
323
|
+
HostBinding("class.k-hstack"),
|
|
324
|
+
HostBinding("class.k-align-items-start"),
|
|
325
|
+
HostBinding("class.k-justify-content-center"),
|
|
324
326
|
tslib_1.__metadata("design:type", Boolean)
|
|
325
327
|
], HorizontalViewListComponent.prototype, "getComponentClass", void 0);
|
|
326
328
|
tslib_1.__decorate([
|
|
@@ -158,6 +158,11 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
158
158
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
159
159
|
*/
|
|
160
160
|
this.activeViewChange = new EventEmitter();
|
|
161
|
+
/**
|
|
162
|
+
* Fires when navigating in the currently active view
|
|
163
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
164
|
+
*/
|
|
165
|
+
this.navigate = new EventEmitter();
|
|
161
166
|
/**
|
|
162
167
|
* Fires when a view cell is entered
|
|
163
168
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -190,7 +195,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
190
195
|
this.minValidateFn = noop;
|
|
191
196
|
this.maxValidateFn = noop;
|
|
192
197
|
this.disabledDatesRangeValidateFn = noop;
|
|
193
|
-
this.subscriptions = new Subscription(
|
|
198
|
+
this.subscriptions = new Subscription();
|
|
194
199
|
this.setClasses(element.nativeElement);
|
|
195
200
|
}
|
|
196
201
|
Object.defineProperty(MultiViewCalendarComponent.prototype, "focusedDate", {
|
|
@@ -490,6 +495,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
490
495
|
}
|
|
491
496
|
this.focusedDate = candidate;
|
|
492
497
|
event.preventDefault();
|
|
498
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
499
|
+
if (!isSameView) {
|
|
500
|
+
this.emitNavigate(this.focusedDate);
|
|
501
|
+
}
|
|
493
502
|
};
|
|
494
503
|
MultiViewCalendarComponent.prototype.ngOnInit = function () {
|
|
495
504
|
var _this = this;
|
|
@@ -578,6 +587,18 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
578
587
|
this.onControlChange(this.parseSelectionToValue(availableDates));
|
|
579
588
|
this.valueChange.emit(this.parseSelectionToValue(availableDates));
|
|
580
589
|
};
|
|
590
|
+
/**
|
|
591
|
+
* @hidden
|
|
592
|
+
*/
|
|
593
|
+
MultiViewCalendarComponent.prototype.handleTodayButtonClick = function (args) {
|
|
594
|
+
var todayDate = args.focusedDate;
|
|
595
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(todayDate, this.viewList.dates);
|
|
596
|
+
var isBottomView = !this.bus.canMoveDown(this.activeViewEnum);
|
|
597
|
+
if (!isSameView && isBottomView) {
|
|
598
|
+
this.emitNavigate(todayDate);
|
|
599
|
+
}
|
|
600
|
+
this.handleDateChange(args);
|
|
601
|
+
};
|
|
581
602
|
/**
|
|
582
603
|
* @hidden
|
|
583
604
|
*/
|
|
@@ -644,9 +665,17 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
644
665
|
/**
|
|
645
666
|
* @hidden
|
|
646
667
|
*/
|
|
647
|
-
MultiViewCalendarComponent.prototype.
|
|
668
|
+
MultiViewCalendarComponent.prototype.navigateView = function (action) {
|
|
648
669
|
this.focusedDate = this.viewList.navigate(action);
|
|
649
670
|
this.updateButtonState();
|
|
671
|
+
this.emitNavigate(this.focusedDate);
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
674
|
+
* @hidden
|
|
675
|
+
*/
|
|
676
|
+
MultiViewCalendarComponent.prototype.emitNavigate = function (focusedDate) {
|
|
677
|
+
var activeView = CalendarViewEnum[this.activeViewEnum];
|
|
678
|
+
this.navigate.emit({ activeView: activeView, focusedDate: focusedDate });
|
|
650
679
|
};
|
|
651
680
|
/**
|
|
652
681
|
* @hidden
|
|
@@ -664,6 +693,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
664
693
|
MultiViewCalendarComponent.prototype.handleCellClick = function (_a) {
|
|
665
694
|
var date = _a.date, modifiers = _a.modifiers;
|
|
666
695
|
this.performSelection(date, modifiers);
|
|
696
|
+
var isSameView = this.bus.service(this.activeViewEnum).isInArray(this.focusedDate, this.viewList.dates);
|
|
697
|
+
if (!isSameView) {
|
|
698
|
+
this.emitNavigate(this.focusedDate);
|
|
699
|
+
}
|
|
667
700
|
};
|
|
668
701
|
/**
|
|
669
702
|
* @hidden
|
|
@@ -836,6 +869,10 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
836
869
|
Output(),
|
|
837
870
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
838
871
|
], MultiViewCalendarComponent.prototype, "activeViewChange", void 0);
|
|
872
|
+
tslib_1.__decorate([
|
|
873
|
+
Output(),
|
|
874
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
875
|
+
], MultiViewCalendarComponent.prototype, "navigate", void 0);
|
|
839
876
|
tslib_1.__decorate([
|
|
840
877
|
Output(),
|
|
841
878
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1001,7 +1038,7 @@ var MultiViewCalendarComponent = /** @class */ (function () {
|
|
|
1001
1038
|
SelectionService
|
|
1002
1039
|
],
|
|
1003
1040
|
selector: 'kendo-multiviewcalendar',
|
|
1004
|
-
template: "\n <ng-container kendoMultiViewCalendarLocalizedMessages\n i18n-today=\"kendo.multiviewcalendar.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.multiviewcalendar.prevButtonTitle|The label for the previous button in the Multiview calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.multiviewcalendar.nextButtonTitle|The label for the next button in the Multiview calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-calendar-header\n [activeView]=\"activeViewEnum\"\n [currentDate]=\"activeDate\"\n [min]=\"min\"\n [max]=\"max\"\n [rangeLength]=\"views\"\n [templateRef]=\"headerTitleTemplate?.templateRef\"\n [isPrevDisabled]=\"isPrevDisabled\"\n [isNextDisabled]=\"isNextDisabled\"\n [showNavigationButtons]=\"true\"\n (todayButtonClick)=\"
|
|
1041
|
+
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\"\n [cellTemplateRef]=\"activeCellTemplate()?.templateRef\"\n [weekNumberTemplateRef]=\"weekNumberTemplate?.templateRef\"\n [cellUID]=\"cellUID\"\n [views]=\"views\"\n [min]=\"min\"\n [max]=\"max\"\n [focusedDate]=\"focusedDate\"\n [animateNavigation]=\"animateNavigation\"\n [showViewHeader]=\"showViewHeader\"\n [weekNumber]=\"weekNumber\"\n [activeRangeEnd]=\"activeRangeEnd\"\n [selectionRange]=\"selectionRange\"\n [selectedDates]=\"selectedDates\"\n (valueChange)=\"handleDateChange($event)\"\n (cellClick)=\"handleCellClick($event)\"\n (weekNumberCellClick)=\"handleWeekNumberClick($event)\"\n (cellEnter)=\"emitCellEvent(cellEnter, $event)\"\n (cellLeave)=\"emitCellEvent(cellLeave, $event)\"\n (activeDateChange)=\"setActiveDate($event)\"\n >\n </kendo-calendar-horizontal>\n "
|
|
1005
1042
|
}),
|
|
1006
1043
|
tslib_1.__metadata("design:paramtypes", [BusViewService,
|
|
1007
1044
|
ElementRef,
|
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var _a;
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
|
-
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate } from '@progress/kendo-date-math';
|
|
9
|
+
import { addDecades, addCenturies, cloneDate, durationInCenturies, firstYearOfDecade, firstDecadeOfCentury, lastDecadeOfCentury, createDate, lastYearOfDecade, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
|
|
10
10
|
import { Action } from '../models/navigation-action.enum';
|
|
11
11
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
12
12
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -114,6 +114,12 @@ var CenturyViewService = /** @class */ (function () {
|
|
|
114
114
|
var firstYear = firstYearOfDecade(firstDecadeOfCentury(date));
|
|
115
115
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
116
116
|
};
|
|
117
|
+
CenturyViewService.prototype.lastDayOfPeriod = function (date) {
|
|
118
|
+
var decade = lastDecadeOfCentury(date);
|
|
119
|
+
var year = lastYearOfDecade(decade);
|
|
120
|
+
var month = lastMonthOfYear(year);
|
|
121
|
+
return lastDayOfMonth(month);
|
|
122
|
+
};
|
|
117
123
|
CenturyViewService.prototype.isRangeStart = function (value) {
|
|
118
124
|
return value.getFullYear() % 1000 === 0;
|
|
119
125
|
};
|
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var _a;
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
|
-
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate } from '@progress/kendo-date-math';
|
|
9
|
+
import { addDecades, addYears, cloneDate, durationInDecades, firstYearOfDecade, lastYearOfDecade, createDate, lastMonthOfYear, lastDayOfMonth } from '@progress/kendo-date-math';
|
|
10
10
|
import { Action } from '../models/navigation-action.enum';
|
|
11
11
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
12
12
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -114,6 +114,11 @@ var DecadeViewService = /** @class */ (function () {
|
|
|
114
114
|
var firstYear = firstYearOfDecade(date);
|
|
115
115
|
return createDate(firstYear.getFullYear(), 0, 1);
|
|
116
116
|
};
|
|
117
|
+
DecadeViewService.prototype.lastDayOfPeriod = function (date) {
|
|
118
|
+
var year = lastYearOfDecade(date);
|
|
119
|
+
var month = lastMonthOfYear(year);
|
|
120
|
+
return lastDayOfMonth(month);
|
|
121
|
+
};
|
|
117
122
|
DecadeViewService.prototype.isRangeStart = function (value) {
|
|
118
123
|
return value.getFullYear() % 100 === 0;
|
|
119
124
|
};
|
|
@@ -124,6 +124,9 @@ var MonthViewService = /** @class */ (function () {
|
|
|
124
124
|
}
|
|
125
125
|
return createDate(date.getFullYear(), date.getMonth(), 1);
|
|
126
126
|
};
|
|
127
|
+
MonthViewService.prototype.lastDayOfPeriod = function (date) {
|
|
128
|
+
return lastDayOfMonth(date);
|
|
129
|
+
};
|
|
127
130
|
MonthViewService.prototype.isRangeStart = function (value) {
|
|
128
131
|
return !value.getMonth();
|
|
129
132
|
};
|
|
@@ -7,7 +7,7 @@ var _a;
|
|
|
7
7
|
/* tslint:disable:object-literal-sort-keys */
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
9
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
10
|
-
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
10
|
+
import { addMonths, addYears, cloneDate, createDate, durationInYears, firstMonthOfYear, lastDayOfMonth, lastMonthOfYear } from '@progress/kendo-date-math';
|
|
11
11
|
import { Action } from '../models/navigation-action.enum';
|
|
12
12
|
import { EMPTY_SELECTIONRANGE } from '../models/selection-range.interface';
|
|
13
13
|
import { getToday, isInSelectionRange, range } from '../../util';
|
|
@@ -138,6 +138,10 @@ var YearViewService = /** @class */ (function () {
|
|
|
138
138
|
}
|
|
139
139
|
return createDate(date.getFullYear(), 0, 1);
|
|
140
140
|
};
|
|
141
|
+
YearViewService.prototype.lastDayOfPeriod = function (date) {
|
|
142
|
+
var month = lastMonthOfYear(date);
|
|
143
|
+
return lastDayOfMonth(month);
|
|
144
|
+
};
|
|
141
145
|
YearViewService.prototype.isRangeStart = function (value) {
|
|
142
146
|
return value.getFullYear() % 10 === 0;
|
|
143
147
|
};
|
|
@@ -19,8 +19,8 @@ var DateRangeInput = /** @class */ (function () {
|
|
|
19
19
|
this.renderer = renderer;
|
|
20
20
|
this.zone = zone;
|
|
21
21
|
this.navigateCalendarOnFocus = false;
|
|
22
|
-
this.popupSubscriptions = new Subscription(
|
|
23
|
-
this.subscriptions = new Subscription(
|
|
22
|
+
this.popupSubscriptions = new Subscription();
|
|
23
|
+
this.subscriptions = new Subscription();
|
|
24
24
|
}
|
|
25
25
|
Object.defineProperty(DateRangeInput.prototype, "isActiveEnd", {
|
|
26
26
|
get: function () {
|
|
@@ -79,7 +79,7 @@ var DateRangeInput = /** @class */ (function () {
|
|
|
79
79
|
};
|
|
80
80
|
DateRangeInput.prototype.unsubscribePopup = function () {
|
|
81
81
|
this.popupSubscriptions.unsubscribe();
|
|
82
|
-
this.popupSubscriptions = new Subscription(
|
|
82
|
+
this.popupSubscriptions = new Subscription();
|
|
83
83
|
};
|
|
84
84
|
DateRangeInput.prototype.activate = function () {
|
|
85
85
|
this.dateRangeService.setActiveRangeEnd(this.activeRangeEnd);
|
|
@@ -84,8 +84,8 @@ var DateRangePopupComponent = /** @class */ (function () {
|
|
|
84
84
|
* @hidden
|
|
85
85
|
*/
|
|
86
86
|
this.popupUID = guid();
|
|
87
|
-
this.calendarSubscriptions = new Subscription(
|
|
88
|
-
this.popupSubscriptions = new Subscription(
|
|
87
|
+
this.calendarSubscriptions = new Subscription();
|
|
88
|
+
this.popupSubscriptions = new Subscription();
|
|
89
89
|
this.resolvedPromise = Promise.resolve();
|
|
90
90
|
}
|
|
91
91
|
Object.defineProperty(DateRangePopupComponent.prototype, "calendar", {
|
|
@@ -38,7 +38,7 @@ var DateRangeSelectionDirective = /** @class */ (function () {
|
|
|
38
38
|
* the section on [events]({% slug overview_multiviewcalendar %}#toc-events).
|
|
39
39
|
*/
|
|
40
40
|
this.selectionRangeChange = new EventEmitter();
|
|
41
|
-
this.calendarSubscriptions = new Subscription(
|
|
41
|
+
this.calendarSubscriptions = new Subscription();
|
|
42
42
|
this.dateRangeService = this.dateRangeService || new DateRangeService();
|
|
43
43
|
renderer.setAttribute(element.nativeElement, 'aria-multiselectable', 'true');
|
|
44
44
|
}
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-dateinputs',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1635489253,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -188,6 +188,14 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
188
188
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
189
189
|
*/
|
|
190
190
|
activeViewChange: EventEmitter<CalendarView>;
|
|
191
|
+
/**
|
|
192
|
+
* Fires when navigating in the currently active view
|
|
193
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
194
|
+
*/
|
|
195
|
+
navigate: EventEmitter<{
|
|
196
|
+
activeView: CalendarView;
|
|
197
|
+
focusedDate: Date;
|
|
198
|
+
}>;
|
|
191
199
|
/**
|
|
192
200
|
* Fires when the active view date is changed
|
|
193
201
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -269,6 +277,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
269
277
|
cellUID: string;
|
|
270
278
|
selectedDates: Date[];
|
|
271
279
|
rangePivot: Date;
|
|
280
|
+
private _disabledDates;
|
|
272
281
|
private _min;
|
|
273
282
|
private _max;
|
|
274
283
|
private _focusedDate;
|
|
@@ -294,6 +303,7 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
294
303
|
private resolvedPromise;
|
|
295
304
|
private destroyed;
|
|
296
305
|
private localizationChangeSubscription;
|
|
306
|
+
private activeViewDate;
|
|
297
307
|
constructor(bus: BusViewService, dom: CalendarDOMService, element: ElementRef, navigator: NavigationService, renderer: Renderer2, cdr: ChangeDetectorRef, ngZone: NgZone, injector: Injector, scrollSyncService: ScrollSyncService, disabledDatesService: DisabledDatesService, localization: LocalizationService, selectionService: SelectionService, pickerService?: PickerService);
|
|
298
308
|
ngOnInit(): void;
|
|
299
309
|
ngOnChanges(changes: any): void;
|
|
@@ -377,10 +387,18 @@ export declare class CalendarComponent implements ControlValueAccessor, OnChange
|
|
|
377
387
|
* @hidden
|
|
378
388
|
*/
|
|
379
389
|
activeCellTemplate(): any;
|
|
390
|
+
/**
|
|
391
|
+
* @hidden
|
|
392
|
+
*/
|
|
393
|
+
emitNavigate(focusedDate: Date): void;
|
|
380
394
|
/**
|
|
381
395
|
* @hidden
|
|
382
396
|
*/
|
|
383
397
|
emitEvent(emitter: any, args: any): void;
|
|
398
|
+
/**
|
|
399
|
+
* @hidden
|
|
400
|
+
*/
|
|
401
|
+
handleActiveDateChange(date: Date): void;
|
|
384
402
|
/**
|
|
385
403
|
* @hidden
|
|
386
404
|
*/
|
|
@@ -168,6 +168,11 @@ let CalendarComponent = class CalendarComponent {
|
|
|
168
168
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
169
169
|
*/
|
|
170
170
|
this.activeViewChange = new EventEmitter();
|
|
171
|
+
/**
|
|
172
|
+
* Fires when navigating in the currently active view
|
|
173
|
+
* ([more information and example]({% slug events_calendar %})).
|
|
174
|
+
*/
|
|
175
|
+
this.navigate = new EventEmitter();
|
|
171
176
|
/**
|
|
172
177
|
* Fires when the active view date is changed
|
|
173
178
|
* ([more information and example]({% slug overview_calendar %}#toc-events)).
|
|
@@ -209,6 +214,14 @@ let CalendarComponent = class CalendarComponent {
|
|
|
209
214
|
* > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.
|
|
210
215
|
*/
|
|
211
216
|
set focusedDate(focusedDate) {
|
|
217
|
+
if (this.activeViewDate && !isEqual(this._focusedDate, focusedDate)) {
|
|
218
|
+
const service = this.bus.service(this.activeViewEnum);
|
|
219
|
+
const lastDayInPeriod = service.lastDayOfPeriod(this.activeViewDate);
|
|
220
|
+
const isFocusedDateInRange = service.isInRange(focusedDate, this.activeViewDate, lastDayInPeriod);
|
|
221
|
+
if (!isFocusedDateInRange) {
|
|
222
|
+
this.emitNavigate(focusedDate);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
212
225
|
this._focusedDate = focusedDate || getToday();
|
|
213
226
|
this.setAriaActivedescendant();
|
|
214
227
|
}
|
|
@@ -277,6 +290,10 @@ let CalendarComponent = class CalendarComponent {
|
|
|
277
290
|
*/
|
|
278
291
|
set disabledDates(value) {
|
|
279
292
|
this.disabledDatesService.initialize(value);
|
|
293
|
+
this._disabledDates = value;
|
|
294
|
+
}
|
|
295
|
+
get disabledDates() {
|
|
296
|
+
return this._disabledDates;
|
|
280
297
|
}
|
|
281
298
|
/**
|
|
282
299
|
* Specifies the Calendar type.
|
|
@@ -359,7 +376,7 @@ let CalendarComponent = class CalendarComponent {
|
|
|
359
376
|
return 'grid';
|
|
360
377
|
}
|
|
361
378
|
get calendarTabIndex() {
|
|
362
|
-
return this.disabled ? undefined : this.tabIndex;
|
|
379
|
+
return this.disabled || this.type === 'classic' ? undefined : this.tabIndex;
|
|
363
380
|
}
|
|
364
381
|
get ariaDisabled() {
|
|
365
382
|
return this.disabled;
|
|
@@ -579,6 +596,13 @@ let CalendarComponent = class CalendarComponent {
|
|
|
579
596
|
return null;
|
|
580
597
|
}
|
|
581
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* @hidden
|
|
601
|
+
*/
|
|
602
|
+
emitNavigate(focusedDate) {
|
|
603
|
+
const activeView = CalendarViewEnum[this.activeViewEnum];
|
|
604
|
+
this.navigate.emit({ activeView, focusedDate });
|
|
605
|
+
}
|
|
582
606
|
/**
|
|
583
607
|
* @hidden
|
|
584
608
|
*/
|
|
@@ -589,6 +613,13 @@ let CalendarComponent = class CalendarComponent {
|
|
|
589
613
|
});
|
|
590
614
|
}
|
|
591
615
|
}
|
|
616
|
+
/**
|
|
617
|
+
* @hidden
|
|
618
|
+
*/
|
|
619
|
+
handleActiveDateChange(date) {
|
|
620
|
+
this.activeViewDate = date;
|
|
621
|
+
this.emitEvent(this.activeViewDateChange, date);
|
|
622
|
+
}
|
|
592
623
|
/**
|
|
593
624
|
* @hidden
|
|
594
625
|
*/
|
|
@@ -830,6 +861,10 @@ tslib_1.__decorate([
|
|
|
830
861
|
Output(),
|
|
831
862
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
832
863
|
], CalendarComponent.prototype, "activeViewChange", void 0);
|
|
864
|
+
tslib_1.__decorate([
|
|
865
|
+
Output(),
|
|
866
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
867
|
+
], CalendarComponent.prototype, "navigate", void 0);
|
|
833
868
|
tslib_1.__decorate([
|
|
834
869
|
Output(),
|
|
835
870
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1001,7 +1036,7 @@ CalendarComponent = tslib_1.__decorate([
|
|
|
1001
1036
|
})"
|
|
1002
1037
|
(cellClick)="handleCellClick($event)"
|
|
1003
1038
|
(weekNumberCellClick)="handleWeekNumberClick($event)"
|
|
1004
|
-
(activeDateChange)="
|
|
1039
|
+
(activeDateChange)="handleActiveDateChange($event)"
|
|
1005
1040
|
(pageChange)="onPageChange()"
|
|
1006
1041
|
>
|
|
1007
1042
|
</kendo-calendar-viewlist>
|
|
@@ -1031,6 +1066,7 @@ CalendarComponent = tslib_1.__decorate([
|
|
|
1031
1066
|
[value]="value"
|
|
1032
1067
|
[disabledDates]="disabledDates"
|
|
1033
1068
|
(activeViewChange)="handleActiveViewChange($event)"
|
|
1069
|
+
(navigate)="navigate.emit($event)"
|
|
1034
1070
|
(valueChange)="handleMultiViewCalendarValueChange($event, multiviewcalendar.focusedDate)"
|
|
1035
1071
|
>
|
|
1036
1072
|
<kendo-multiviewcalendar-messages
|
|
@@ -38,10 +38,9 @@ let HeaderComponent = class HeaderComponent {
|
|
|
38
38
|
this.subscriptions = new Subscription();
|
|
39
39
|
}
|
|
40
40
|
ngOnInit() {
|
|
41
|
-
this.subscriptions
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
41
|
+
this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this)));
|
|
42
|
+
this.subscriptions.add(this.localization.changes.subscribe(this.l10nChange.bind(this)));
|
|
43
|
+
this.subscriptions.add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));
|
|
45
44
|
}
|
|
46
45
|
ngOnChanges(_) {
|
|
47
46
|
const service = this.bus.service(this.activeView);
|
|
@@ -300,7 +300,9 @@ tslib_1.__decorate([
|
|
|
300
300
|
], HorizontalViewListComponent.prototype, "activeDateChange", void 0);
|
|
301
301
|
tslib_1.__decorate([
|
|
302
302
|
HostBinding("class.k-calendar-view"),
|
|
303
|
-
HostBinding("class.k-
|
|
303
|
+
HostBinding("class.k-hstack"),
|
|
304
|
+
HostBinding("class.k-align-items-start"),
|
|
305
|
+
HostBinding("class.k-justify-content-center"),
|
|
304
306
|
tslib_1.__metadata("design:type", Boolean)
|
|
305
307
|
], HorizontalViewListComponent.prototype, "getComponentClass", void 0);
|
|
306
308
|
tslib_1.__decorate([
|
|
@@ -187,6 +187,14 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
187
187
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
188
188
|
*/
|
|
189
189
|
activeViewChange: EventEmitter<CalendarView>;
|
|
190
|
+
/**
|
|
191
|
+
* Fires when navigating in the currently active view
|
|
192
|
+
* ([more information and example]({% slug events_multiviewcalendar %})).
|
|
193
|
+
*/
|
|
194
|
+
navigate: EventEmitter<{
|
|
195
|
+
activeView: CalendarView;
|
|
196
|
+
focusedDate: Date;
|
|
197
|
+
}>;
|
|
190
198
|
/**
|
|
191
199
|
* Fires when a view cell is entered
|
|
192
200
|
* ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).
|
|
@@ -349,6 +357,13 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
349
357
|
selectedDates: Date[];
|
|
350
358
|
focusedDate: Date;
|
|
351
359
|
}): void;
|
|
360
|
+
/**
|
|
361
|
+
* @hidden
|
|
362
|
+
*/
|
|
363
|
+
handleTodayButtonClick(args: {
|
|
364
|
+
selectedDates: Date[];
|
|
365
|
+
focusedDate: Date;
|
|
366
|
+
}): void;
|
|
352
367
|
/**
|
|
353
368
|
* @hidden
|
|
354
369
|
*/
|
|
@@ -386,7 +401,11 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
|
|
|
386
401
|
/**
|
|
387
402
|
* @hidden
|
|
388
403
|
*/
|
|
389
|
-
|
|
404
|
+
navigateView(action: Action): void;
|
|
405
|
+
/**
|
|
406
|
+
* @hidden
|
|
407
|
+
*/
|
|
408
|
+
emitNavigate(focusedDate: Date): void;
|
|
390
409
|
/**
|
|
391
410
|
* @hidden
|
|
392
411
|
*/
|