@progress/kendo-angular-dateinputs 5.3.1-dev.202112201533 → 6.0.0
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/calendar/calendar.component.js +1 -1
- package/dist/es/calendar/header.component.js +1 -1
- package/dist/es/calendar/multiview-calendar.component.js +11 -4
- package/dist/es/calendar/services/dom.service.js +1 -1
- package/dist/es/calendar/view.component.js +1 -1
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/dateinput/dateinput.component.js +143 -18
- package/dist/es/datepicker/datepicker.component.js +130 -13
- package/dist/es/daterange/date-range-input.js +1 -1
- package/dist/es/datetimepicker/datetimepicker.component.js +147 -11
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/services/dom.service.js +12 -8
- package/dist/es/timepicker/timelist.component.js +3 -2
- package/dist/es/timepicker/timepicker.component.js +130 -13
- package/dist/es/timepicker/timeselector.component.js +2 -2
- package/dist/es/util.js +37 -0
- package/dist/es2015/calendar/calendar.component.js +1 -1
- package/dist/es2015/calendar/header.component.js +4 -4
- package/dist/es2015/calendar/multiview-calendar.component.d.ts +3 -1
- package/dist/es2015/calendar/multiview-calendar.component.js +11 -4
- package/dist/es2015/calendar/services/dom.service.js +1 -1
- package/dist/es2015/calendar/view.component.js +1 -1
- package/dist/es2015/common/models/fillmode.d.ts +14 -0
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +15 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/dateinput/dateinput.component.d.ts +49 -8
- package/dist/es2015/dateinput/dateinput.component.js +183 -68
- package/dist/es2015/datepicker/datepicker.component.d.ts +47 -5
- package/dist/es2015/datepicker/datepicker.component.js +155 -49
- package/dist/es2015/daterange/date-range-input.js +1 -1
- package/dist/es2015/datetimepicker/datetimepicker.component.d.ts +56 -6
- package/dist/es2015/datetimepicker/datetimepicker.component.js +186 -63
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/timepicker/services/dom.service.d.ts +1 -0
- package/dist/es2015/timepicker/services/dom.service.js +12 -8
- package/dist/es2015/timepicker/timelist.component.js +3 -2
- package/dist/es2015/timepicker/timepicker.component.d.ts +50 -5
- package/dist/es2015/timepicker/timepicker.component.js +174 -69
- package/dist/es2015/timepicker/timeselector.component.js +7 -5
- package/dist/es2015/util.d.ts +18 -0
- package/dist/es2015/util.js +37 -0
- package/dist/fesm2015/index.js +780 -282
- package/dist/fesm5/index.js +625 -83
- package/dist/npm/calendar/calendar.component.js +1 -1
- package/dist/npm/calendar/header.component.js +1 -1
- package/dist/npm/calendar/multiview-calendar.component.js +10 -3
- package/dist/npm/calendar/services/dom.service.js +1 -1
- package/dist/npm/calendar/view.component.js +1 -1
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/dateinput/dateinput.component.js +142 -17
- package/dist/npm/datepicker/datepicker.component.js +129 -12
- package/dist/npm/daterange/date-range-input.js +1 -1
- package/dist/npm/datetimepicker/datetimepicker.component.js +146 -10
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/services/dom.service.js +15 -10
- package/dist/npm/timepicker/timelist.component.js +3 -2
- package/dist/npm/timepicker/timepicker.component.js +129 -12
- package/dist/npm/timepicker/timeselector.component.js +2 -2
- package/dist/npm/util.js +37 -0
- package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
- package/package.json +7 -7
|
@@ -44,12 +44,12 @@ var TWO_DIGIT_YEAR_MAX = 68;
|
|
|
44
44
|
* Represents the [Kendo UI DatePicker component for Angular]({% slug overview_datepicker %}#toc-basic-usage).
|
|
45
45
|
*/
|
|
46
46
|
var DatePickerComponent = /** @class */ (function () {
|
|
47
|
-
function DatePickerComponent(zone, localization, cdr, popupService,
|
|
47
|
+
function DatePickerComponent(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, disabledDatesService, touchEnabled) {
|
|
48
48
|
this.zone = zone;
|
|
49
49
|
this.localization = localization;
|
|
50
50
|
this.cdr = cdr;
|
|
51
51
|
this.popupService = popupService;
|
|
52
|
-
this.
|
|
52
|
+
this.wrapper = wrapper;
|
|
53
53
|
this.renderer = renderer;
|
|
54
54
|
this.injector = injector;
|
|
55
55
|
this.pickerService = pickerService;
|
|
@@ -275,6 +275,9 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
275
275
|
this.incompleteValidator = util_1.noop;
|
|
276
276
|
this.resolvedPromise = Promise.resolve(null);
|
|
277
277
|
this.domEvents = [];
|
|
278
|
+
this._size = 'medium';
|
|
279
|
+
this._rounded = 'medium';
|
|
280
|
+
this._fillMode = 'solid';
|
|
278
281
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
279
282
|
this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));
|
|
280
283
|
this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));
|
|
@@ -425,6 +428,85 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
425
428
|
enumerable: true,
|
|
426
429
|
configurable: true
|
|
427
430
|
});
|
|
431
|
+
Object.defineProperty(DatePickerComponent.prototype, "size", {
|
|
432
|
+
get: function () {
|
|
433
|
+
return this._size;
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* Sets the size of the component.
|
|
437
|
+
*
|
|
438
|
+
* The possible values are:
|
|
439
|
+
* * `'small'`
|
|
440
|
+
* * `'medium'` (Default)
|
|
441
|
+
* * `'large'`
|
|
442
|
+
* * `null`
|
|
443
|
+
*
|
|
444
|
+
*/
|
|
445
|
+
set: function (size) {
|
|
446
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
|
|
447
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, util_1.getSizeClass('input', this.size));
|
|
448
|
+
if (size) {
|
|
449
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', size));
|
|
450
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getSizeClass('input', size));
|
|
451
|
+
}
|
|
452
|
+
this._size = size;
|
|
453
|
+
},
|
|
454
|
+
enumerable: true,
|
|
455
|
+
configurable: true
|
|
456
|
+
});
|
|
457
|
+
Object.defineProperty(DatePickerComponent.prototype, "rounded", {
|
|
458
|
+
get: function () {
|
|
459
|
+
return this._rounded;
|
|
460
|
+
},
|
|
461
|
+
/**
|
|
462
|
+
* Sets the border radius of the component.
|
|
463
|
+
*
|
|
464
|
+
* The possible values are:
|
|
465
|
+
* * `'small'`
|
|
466
|
+
* * `'medium'` (Default)
|
|
467
|
+
* * `'large'`
|
|
468
|
+
* * `'full'`
|
|
469
|
+
* * `null`
|
|
470
|
+
*
|
|
471
|
+
*/
|
|
472
|
+
set: function (rounded) {
|
|
473
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
474
|
+
if (rounded) {
|
|
475
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(rounded));
|
|
476
|
+
}
|
|
477
|
+
this._rounded = rounded;
|
|
478
|
+
},
|
|
479
|
+
enumerable: true,
|
|
480
|
+
configurable: true
|
|
481
|
+
});
|
|
482
|
+
Object.defineProperty(DatePickerComponent.prototype, "fillMode", {
|
|
483
|
+
get: function () {
|
|
484
|
+
return this._fillMode;
|
|
485
|
+
},
|
|
486
|
+
/**
|
|
487
|
+
* Sets the fillMode of the component.
|
|
488
|
+
*
|
|
489
|
+
* The possible values are:
|
|
490
|
+
* * `'solid'` (Default)
|
|
491
|
+
* * `'flat'`
|
|
492
|
+
* * `'outline'`
|
|
493
|
+
* * `null`
|
|
494
|
+
*
|
|
495
|
+
*/
|
|
496
|
+
set: function (fillMode) {
|
|
497
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
|
|
498
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', this.fillMode));
|
|
499
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
500
|
+
if (fillMode) {
|
|
501
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', fillMode));
|
|
502
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + fillMode + "-base");
|
|
503
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', fillMode));
|
|
504
|
+
}
|
|
505
|
+
this._fillMode = fillMode;
|
|
506
|
+
},
|
|
507
|
+
enumerable: true,
|
|
508
|
+
configurable: true
|
|
509
|
+
});
|
|
428
510
|
Object.defineProperty(DatePickerComponent.prototype, "disabledClass", {
|
|
429
511
|
/**
|
|
430
512
|
* @hidden
|
|
@@ -456,10 +538,10 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
456
538
|
}
|
|
457
539
|
var element = this.wrapper.nativeElement;
|
|
458
540
|
if (value) {
|
|
459
|
-
this.renderer.addClass(element, 'k-
|
|
541
|
+
this.renderer.addClass(element, 'k-focus');
|
|
460
542
|
}
|
|
461
543
|
else {
|
|
462
|
-
this.renderer.removeClass(element, 'k-
|
|
544
|
+
this.renderer.removeClass(element, 'k-focus');
|
|
463
545
|
}
|
|
464
546
|
},
|
|
465
547
|
enumerable: true,
|
|
@@ -503,13 +585,16 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
503
585
|
.changes
|
|
504
586
|
.subscribe(function () { return _this.cdr.markForCheck(); });
|
|
505
587
|
this.control = this.injector.get(forms_1.NgControl, null);
|
|
506
|
-
if (this.
|
|
507
|
-
this.renderer.removeAttribute(this.
|
|
588
|
+
if (this.wrapper) {
|
|
589
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
|
|
508
590
|
this.zone.runOutsideAngular(function () {
|
|
509
591
|
_this.bindEvents();
|
|
510
592
|
});
|
|
511
593
|
}
|
|
512
594
|
};
|
|
595
|
+
DatePickerComponent.prototype.ngAfterViewInit = function () {
|
|
596
|
+
this.setComponentClasses();
|
|
597
|
+
};
|
|
513
598
|
/**
|
|
514
599
|
* @hidden
|
|
515
600
|
*/
|
|
@@ -732,6 +817,9 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
732
817
|
this.show = false;
|
|
733
818
|
}
|
|
734
819
|
}
|
|
820
|
+
if (keyCode === kendo_angular_common_1.Keys.Enter && target.classList.contains('k-calendar')) {
|
|
821
|
+
e.preventDefault(); // Don't submit form on date selection in popup
|
|
822
|
+
}
|
|
735
823
|
if (keyCode === kendo_angular_common_1.Keys.Tab && this.show && this.calendar.isActive && util_1.isTabExitingCalendar(this.calendarType, target, shiftKey)) {
|
|
736
824
|
this.input.focus();
|
|
737
825
|
this.show = false;
|
|
@@ -820,7 +908,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
820
908
|
}
|
|
821
909
|
};
|
|
822
910
|
DatePickerComponent.prototype.bindEvents = function () {
|
|
823
|
-
var element = this.
|
|
911
|
+
var element = this.wrapper.nativeElement;
|
|
824
912
|
this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
|
|
825
913
|
if (util_1.isWindowAvailable()) {
|
|
826
914
|
this.windowBlurSubscription = rxjs_1.fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));
|
|
@@ -879,6 +967,20 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
879
967
|
this.cdr.markForCheck();
|
|
880
968
|
this.zone.run(function () { return _this.onValidatorChange(); });
|
|
881
969
|
};
|
|
970
|
+
DatePickerComponent.prototype.setComponentClasses = function () {
|
|
971
|
+
if (this.size) {
|
|
972
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
|
|
973
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getSizeClass('button', this.size));
|
|
974
|
+
}
|
|
975
|
+
if (this.rounded) {
|
|
976
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
977
|
+
}
|
|
978
|
+
if (this.fillMode) {
|
|
979
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
|
|
980
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', this.fillMode));
|
|
981
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
982
|
+
}
|
|
983
|
+
};
|
|
882
984
|
var DatePickerComponent_1;
|
|
883
985
|
tslib_1.__decorate([
|
|
884
986
|
core_1.ViewChild('container', { read: core_1.ViewContainerRef, static: true }),
|
|
@@ -889,9 +991,9 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
889
991
|
tslib_1.__metadata("design:type", core_1.TemplateRef)
|
|
890
992
|
], DatePickerComponent.prototype, "popupTemplate", void 0);
|
|
891
993
|
tslib_1.__decorate([
|
|
892
|
-
core_1.ViewChild('
|
|
994
|
+
core_1.ViewChild('toggleButton', { static: true }),
|
|
893
995
|
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
894
|
-
], DatePickerComponent.prototype, "
|
|
996
|
+
], DatePickerComponent.prototype, "toggleButton", void 0);
|
|
895
997
|
tslib_1.__decorate([
|
|
896
998
|
core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: false }),
|
|
897
999
|
tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
|
|
@@ -1076,6 +1178,21 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
1076
1178
|
core_1.Input(),
|
|
1077
1179
|
tslib_1.__metadata("design:type", Boolean)
|
|
1078
1180
|
], DatePickerComponent.prototype, "weekNumber", void 0);
|
|
1181
|
+
tslib_1.__decorate([
|
|
1182
|
+
core_1.Input(),
|
|
1183
|
+
tslib_1.__metadata("design:type", String),
|
|
1184
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1185
|
+
], DatePickerComponent.prototype, "size", null);
|
|
1186
|
+
tslib_1.__decorate([
|
|
1187
|
+
core_1.Input(),
|
|
1188
|
+
tslib_1.__metadata("design:type", String),
|
|
1189
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1190
|
+
], DatePickerComponent.prototype, "rounded", null);
|
|
1191
|
+
tslib_1.__decorate([
|
|
1192
|
+
core_1.Input(),
|
|
1193
|
+
tslib_1.__metadata("design:type", String),
|
|
1194
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1195
|
+
], DatePickerComponent.prototype, "fillMode", null);
|
|
1079
1196
|
tslib_1.__decorate([
|
|
1080
1197
|
core_1.Output(),
|
|
1081
1198
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
@@ -1097,12 +1214,12 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
1097
1214
|
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
1098
1215
|
], DatePickerComponent.prototype, "close", void 0);
|
|
1099
1216
|
tslib_1.__decorate([
|
|
1100
|
-
core_1.HostBinding('class.k-widget'),
|
|
1101
1217
|
core_1.HostBinding('class.k-datepicker'),
|
|
1218
|
+
core_1.HostBinding('class.k-input'),
|
|
1102
1219
|
tslib_1.__metadata("design:type", Boolean)
|
|
1103
1220
|
], DatePickerComponent.prototype, "wrapperClasses", void 0);
|
|
1104
1221
|
tslib_1.__decorate([
|
|
1105
|
-
core_1.HostBinding('class.k-
|
|
1222
|
+
core_1.HostBinding('class.k-disabled'),
|
|
1106
1223
|
tslib_1.__metadata("design:type", Boolean),
|
|
1107
1224
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1108
1225
|
], DatePickerComponent.prototype, "disabledClass", null);
|
|
@@ -1123,7 +1240,7 @@ var DatePickerComponent = /** @class */ (function () {
|
|
|
1123
1240
|
}
|
|
1124
1241
|
],
|
|
1125
1242
|
selector: 'kendo-datepicker',
|
|
1126
|
-
template: "\n <ng-container kendoDatePickerLocalizedMessages\n i18n-today=\"kendo.datepicker.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-toggle=\"kendo.datepicker.toggle|The title of the toggle button in the datepicker component\"\n toggle=\"Toggle calendar\"\n\n i18n-prevButtonTitle=\"kendo.datepicker.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.datepicker.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <
|
|
1243
|
+
template: "\n <ng-container kendoDatePickerLocalizedMessages\n i18n-today=\"kendo.datepicker.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-toggle=\"kendo.datepicker.toggle|The title of the toggle button in the datepicker component\"\n toggle=\"Toggle calendar\"\n\n i18n-prevButtonTitle=\"kendo.datepicker.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.datepicker.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n <kendo-dateinput\n #input\n [role]=\"inputRole\"\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"show\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [ariaReadOnly]=\"readonly\"\n [tabindex]=\"tabindex\"\n [title]=\"title\"\n [format]=\"format\"\n [twoDigitYearMax]=\"twoDigitYearMax\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [min]=\"min\"\n [max]=\"max\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [fillMode]=\"null\"\n [rounded]=\"null\"\n [size]=\"null\"\n [value]=\"value\"\n (valueChange)=\"handleInputChange($event)\"\n ></kendo-dateinput>\n <button\n #toggleButton\n type=\"button\"\n class=\"k-input-button k-button k-icon-button\"\n [tabindex]=\"-1\"\n [attr.title]=\"localization.get('toggle')\"\n [attr.aria-label]=\"localization.get('toggle')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleIconClick,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-button-icon k-icon k-i-calendar\"></span>\n </button>\n <ng-container #container></ng-container>\n <ng-template #popupTemplate>\n <kendo-calendar\n #calendar\n [type]=\"calendarType\"\n [min]=\"min\"\n [max]=\"max\"\n [navigation]=\"navigation\"\n [animateNavigation]=\"animateCalendarNavigation\"\n [activeView]=\"activeView\"\n [bottomView]=\"bottomView\"\n [topView]=\"topView\"\n [weekNumber]=\"weekNumber\"\n [cellTemplate]=\"cellTemplate\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [navigationItemTemplate]=\"navigationItemTemplate\"\n [focusedDate]=\"focusedDate\"\n [value]=\"value\"\n (valueChange)=\"handleChange(mergeTime($event))\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeydown\n }\"\n [scope]=\"this\"\n [disabledDates]=\"disabledDates\"\n >\n <kendo-calendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-calendar-messages>\n </kendo-calendar>\n <ng-template>\n "
|
|
1127
1244
|
}),
|
|
1128
1245
|
tslib_1.__param(9, core_1.Optional()), tslib_1.__param(9, core_1.Inject(touch_enabled_1.TOUCH_ENABLED)),
|
|
1129
1246
|
tslib_1.__metadata("design:paramtypes", [core_1.NgZone,
|
|
@@ -125,7 +125,7 @@ var DateRangeInput = /** @class */ (function () {
|
|
|
125
125
|
var action = show ? 'addClass' : 'removeClass';
|
|
126
126
|
var nativeElement = this.element.nativeElement;
|
|
127
127
|
if (nativeElement && nativeElement.querySelector) {
|
|
128
|
-
this.renderer[action](nativeElement
|
|
128
|
+
this.renderer[action](nativeElement, 'k-focus');
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
return DateRangeInput;
|
|
@@ -46,13 +46,13 @@ var TWO_DIGIT_YEAR_MAX = 68;
|
|
|
46
46
|
* Represents the [Kendo UI DateTimePicker component for Angular]({% slug overview_datetimepicker %}).
|
|
47
47
|
*/
|
|
48
48
|
var DateTimePickerComponent = /** @class */ (function () {
|
|
49
|
-
function DateTimePickerComponent(popupService, intl, cdr, pickerService, ngZone,
|
|
49
|
+
function DateTimePickerComponent(popupService, intl, cdr, pickerService, ngZone, wrapper, touchEnabled, localization, disabledDatesService, renderer) {
|
|
50
50
|
this.popupService = popupService;
|
|
51
51
|
this.intl = intl;
|
|
52
52
|
this.cdr = cdr;
|
|
53
53
|
this.pickerService = pickerService;
|
|
54
54
|
this.ngZone = ngZone;
|
|
55
|
-
this.
|
|
55
|
+
this.wrapper = wrapper;
|
|
56
56
|
this.touchEnabled = touchEnabled;
|
|
57
57
|
this.localization = localization;
|
|
58
58
|
this.disabledDatesService = disabledDatesService;
|
|
@@ -219,9 +219,22 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
219
219
|
this.disabledDatesValidateFn = util_1.noop;
|
|
220
220
|
this.incompleteValidator = util_1.noop;
|
|
221
221
|
this.subscriptions = new rxjs_1.Subscription();
|
|
222
|
+
this._size = 'medium';
|
|
223
|
+
this._rounded = 'medium';
|
|
224
|
+
this._fillMode = 'solid';
|
|
222
225
|
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
223
226
|
}
|
|
224
227
|
DateTimePickerComponent_1 = DateTimePickerComponent;
|
|
228
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "disabledClass", {
|
|
229
|
+
/**
|
|
230
|
+
* @hidden
|
|
231
|
+
*/
|
|
232
|
+
get: function () {
|
|
233
|
+
return this.disabled;
|
|
234
|
+
},
|
|
235
|
+
enumerable: true,
|
|
236
|
+
configurable: true
|
|
237
|
+
});
|
|
225
238
|
Object.defineProperty(DateTimePickerComponent.prototype, "input", {
|
|
226
239
|
/**
|
|
227
240
|
* @hidden
|
|
@@ -402,10 +415,10 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
402
415
|
},
|
|
403
416
|
set: function (value) {
|
|
404
417
|
if (value) {
|
|
405
|
-
this.renderer.addClass(this.wrapper.nativeElement, 'k-
|
|
418
|
+
this.renderer.addClass(this.wrapper.nativeElement, 'k-focus');
|
|
406
419
|
}
|
|
407
420
|
else {
|
|
408
|
-
this.renderer.removeClass(this.wrapper.nativeElement, 'k-
|
|
421
|
+
this.renderer.removeClass(this.wrapper.nativeElement, 'k-focus');
|
|
409
422
|
}
|
|
410
423
|
this._isActive = value;
|
|
411
424
|
},
|
|
@@ -427,6 +440,85 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
427
440
|
enumerable: true,
|
|
428
441
|
configurable: true
|
|
429
442
|
});
|
|
443
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "size", {
|
|
444
|
+
get: function () {
|
|
445
|
+
return this._size;
|
|
446
|
+
},
|
|
447
|
+
/**
|
|
448
|
+
* Sets the size of the component.
|
|
449
|
+
*
|
|
450
|
+
* The possible values are:
|
|
451
|
+
* * `'small'`
|
|
452
|
+
* * `'medium'` (Default)
|
|
453
|
+
* * `'large'`
|
|
454
|
+
* * `null`
|
|
455
|
+
*
|
|
456
|
+
*/
|
|
457
|
+
set: function (size) {
|
|
458
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
|
|
459
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, util_1.getSizeClass('input', this.size));
|
|
460
|
+
if (size) {
|
|
461
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', size));
|
|
462
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getSizeClass('input', size));
|
|
463
|
+
}
|
|
464
|
+
this._size = size;
|
|
465
|
+
},
|
|
466
|
+
enumerable: true,
|
|
467
|
+
configurable: true
|
|
468
|
+
});
|
|
469
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "rounded", {
|
|
470
|
+
get: function () {
|
|
471
|
+
return this._rounded;
|
|
472
|
+
},
|
|
473
|
+
/**
|
|
474
|
+
* Sets the border radius of the component.
|
|
475
|
+
*
|
|
476
|
+
* The possible values are:
|
|
477
|
+
* * `'small'`
|
|
478
|
+
* * `'medium'` (Default)
|
|
479
|
+
* * `'large'`
|
|
480
|
+
* * `'full'`
|
|
481
|
+
* * `null`
|
|
482
|
+
*
|
|
483
|
+
*/
|
|
484
|
+
set: function (rounded) {
|
|
485
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
486
|
+
if (rounded) {
|
|
487
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(rounded));
|
|
488
|
+
}
|
|
489
|
+
this._rounded = rounded;
|
|
490
|
+
},
|
|
491
|
+
enumerable: true,
|
|
492
|
+
configurable: true
|
|
493
|
+
});
|
|
494
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "fillMode", {
|
|
495
|
+
get: function () {
|
|
496
|
+
return this._fillMode;
|
|
497
|
+
},
|
|
498
|
+
/**
|
|
499
|
+
* Sets the fillMode of the component.
|
|
500
|
+
*
|
|
501
|
+
* The possible values are:
|
|
502
|
+
* * `'solid'` (Default)
|
|
503
|
+
* * `'flat'`
|
|
504
|
+
* * `'outline'`
|
|
505
|
+
* * `null`
|
|
506
|
+
*
|
|
507
|
+
*/
|
|
508
|
+
set: function (fillMode) {
|
|
509
|
+
this.renderer.removeClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
|
|
510
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', this.fillMode));
|
|
511
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
512
|
+
if (fillMode) {
|
|
513
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', fillMode));
|
|
514
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', fillMode));
|
|
515
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + fillMode + "-base");
|
|
516
|
+
}
|
|
517
|
+
this._fillMode = fillMode;
|
|
518
|
+
},
|
|
519
|
+
enumerable: true,
|
|
520
|
+
configurable: true
|
|
521
|
+
});
|
|
430
522
|
Object.defineProperty(DateTimePickerComponent.prototype, "tabSwitchTransition", {
|
|
431
523
|
/**
|
|
432
524
|
* @hidden
|
|
@@ -517,6 +609,9 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
517
609
|
this.subscriptions.add(this.ngZone.runOutsideAngular(function () { return rxjs_1.fromEvent(window, 'blur').subscribe(_this.handleCancel.bind(_this)); }));
|
|
518
610
|
}
|
|
519
611
|
};
|
|
612
|
+
DateTimePickerComponent.prototype.ngAfterViewInit = function () {
|
|
613
|
+
this.setComponentClasses();
|
|
614
|
+
};
|
|
520
615
|
DateTimePickerComponent.prototype.ngOnChanges = function (changes) {
|
|
521
616
|
if (utils_1.isPresent(changes.min) || utils_1.isPresent(changes.max)) {
|
|
522
617
|
this.verifyMinMaxRange();
|
|
@@ -671,7 +766,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
671
766
|
return;
|
|
672
767
|
}
|
|
673
768
|
this.isActive = false;
|
|
674
|
-
var isNgControlUntouched = this.
|
|
769
|
+
var isNgControlUntouched = this.wrapper.nativeElement.classList.contains('ng-untouched');
|
|
675
770
|
var runInZone = isNgControlUntouched || kendo_angular_common_1.hasObservers(this.onBlur) || (this.isOpen && kendo_angular_common_1.hasObservers(this.close));
|
|
676
771
|
this.run(runInZone, function () {
|
|
677
772
|
_this.onBlur.emit();
|
|
@@ -799,6 +894,13 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
799
894
|
this.input.focus();
|
|
800
895
|
}
|
|
801
896
|
};
|
|
897
|
+
/**
|
|
898
|
+
* @hidden
|
|
899
|
+
*/
|
|
900
|
+
DateTimePickerComponent.prototype.popupButtonsClasses = function (type) {
|
|
901
|
+
var buttonType = type ? type : 'base';
|
|
902
|
+
return (this.size ? util_1.getSizeClass('button', this.size) : '') + " " + (this.rounded ? util_1.getRoundedClass(this.rounded) : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode + ' ' + 'k-button-' + this.fillMode + '-' + buttonType : '');
|
|
903
|
+
};
|
|
802
904
|
/**
|
|
803
905
|
* @hidden
|
|
804
906
|
*
|
|
@@ -923,7 +1025,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
923
1025
|
};
|
|
924
1026
|
/**
|
|
925
1027
|
* Indicates whether the focus target is part of this component,
|
|
926
|
-
* that is, whether the focus target is inside the component
|
|
1028
|
+
* that is, whether the focus target is inside the component or in the popup.
|
|
927
1029
|
*/
|
|
928
1030
|
DateTimePickerComponent.prototype.focusTargetInComponent = function (event) {
|
|
929
1031
|
if (!utils_1.isPresent(event)) {
|
|
@@ -970,16 +1072,35 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
970
1072
|
this.cdr.markForCheck();
|
|
971
1073
|
this.ngZone.run(function () { return _this.onValidatorChange(); });
|
|
972
1074
|
};
|
|
1075
|
+
DateTimePickerComponent.prototype.setComponentClasses = function () {
|
|
1076
|
+
if (this.size) {
|
|
1077
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getSizeClass('input', this.size));
|
|
1078
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getSizeClass('button', this.size));
|
|
1079
|
+
}
|
|
1080
|
+
if (this.rounded) {
|
|
1081
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getRoundedClass(this.rounded));
|
|
1082
|
+
}
|
|
1083
|
+
if (this.fillMode) {
|
|
1084
|
+
this.renderer.addClass(this.wrapper.nativeElement, util_1.getFillModeClass('input', this.fillMode));
|
|
1085
|
+
this.renderer.addClass(this.toggleButton.nativeElement, util_1.getFillModeClass('button', this.fillMode));
|
|
1086
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
973
1089
|
var DateTimePickerComponent_1;
|
|
974
1090
|
tslib_1.__decorate([
|
|
975
|
-
core_1.HostBinding('class.k-widget'),
|
|
976
1091
|
core_1.HostBinding('class.k-datetimepicker'),
|
|
1092
|
+
core_1.HostBinding('class.k-input'),
|
|
977
1093
|
tslib_1.__metadata("design:type", Boolean)
|
|
978
1094
|
], DateTimePickerComponent.prototype, "hostClasses", void 0);
|
|
979
1095
|
tslib_1.__decorate([
|
|
980
|
-
core_1.
|
|
1096
|
+
core_1.HostBinding('class.k-disabled'),
|
|
1097
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1098
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1099
|
+
], DateTimePickerComponent.prototype, "disabledClass", null);
|
|
1100
|
+
tslib_1.__decorate([
|
|
1101
|
+
core_1.ViewChild('toggleButton', { static: true }),
|
|
981
1102
|
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
982
|
-
], DateTimePickerComponent.prototype, "
|
|
1103
|
+
], DateTimePickerComponent.prototype, "toggleButton", void 0);
|
|
983
1104
|
tslib_1.__decorate([
|
|
984
1105
|
core_1.Input(),
|
|
985
1106
|
tslib_1.__metadata("design:type", Date),
|
|
@@ -1108,6 +1229,21 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
1108
1229
|
tslib_1.__metadata("design:type", String),
|
|
1109
1230
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
1110
1231
|
], DateTimePickerComponent.prototype, "defaultTab", null);
|
|
1232
|
+
tslib_1.__decorate([
|
|
1233
|
+
core_1.Input(),
|
|
1234
|
+
tslib_1.__metadata("design:type", String),
|
|
1235
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1236
|
+
], DateTimePickerComponent.prototype, "size", null);
|
|
1237
|
+
tslib_1.__decorate([
|
|
1238
|
+
core_1.Input(),
|
|
1239
|
+
tslib_1.__metadata("design:type", String),
|
|
1240
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1241
|
+
], DateTimePickerComponent.prototype, "rounded", null);
|
|
1242
|
+
tslib_1.__decorate([
|
|
1243
|
+
core_1.Input(),
|
|
1244
|
+
tslib_1.__metadata("design:type", String),
|
|
1245
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1246
|
+
], DateTimePickerComponent.prototype, "fillMode", null);
|
|
1111
1247
|
tslib_1.__decorate([
|
|
1112
1248
|
core_1.ContentChild(cell_template_directive_1.CellTemplateDirective, { static: false }),
|
|
1113
1249
|
tslib_1.__metadata("design:type", cell_template_directive_1.CellTemplateDirective)
|
|
@@ -1158,7 +1294,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
1158
1294
|
{ provide: forms_1.NG_VALIDATORS, useExisting: core_1.forwardRef(function () { return DateTimePickerComponent_1; }), multi: true },
|
|
1159
1295
|
{ provide: kendo_angular_common_1.KendoInput, useExisting: core_1.forwardRef(function () { return DateTimePickerComponent_1; }) }
|
|
1160
1296
|
],
|
|
1161
|
-
template: "\n <ng-container\n kendoDateTimePickerLocalizedMessages\n\n i18n-dateTab=\"kendo.datetimepicker.dateTab|The Date tab text in the datetimepicker popup header\"\n dateTab=\"Date\"\n\n i18n-dateTabLabel=\"kendo.datetimepicker.dateTabLabel|The label for the Date tab in the datetimepicker popup header\"\n dateTabLabel=\"Date tab\"\n\n i18n-timeTab=\"kendo.datetimepicker.timeTab|The Time tab text in the datetimepicker popup header\"\n timeTab=\"Time\"\n\n i18n-timeTabLabel=\"kendo.datetimepicker.timeTabLabel|The label for the Time tab in the datetimepicker popup header\"\n timeTabLabel=\"Time tab\"\n\n i18n-toggle=\"kendo.datetimepicker.toggle|The title of the toggle button in the datetimepicker component\"\n toggle=\"Toggle popup\"\n\n i18n-accept=\"kendo.datetimepicker.accept|The Accept button text in the datetimepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.datetimepicker.acceptLabel|The label for the Accept button in the datetimepicker component\"\n acceptLabel=\"Set\"\n\n i18n-cancel=\"kendo.datetimepicker.cancel|The Cancel button text in the datetimepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.datetimepicker.cancelLabel|The label for the Cancel button in the datetimepicker component\"\n cancelLabel=\"Cancel\"\n\n i18n-now=\"kendo.datetimepicker.now|The Now button text in the timepicker component\"\n now=\"NOW\"\n\n i18n-nowLabel=\"kendo.datetimepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-today=\"kendo.datetimepicker.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.datetimepicker.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.datetimepicker.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n\n <span\n #wrapper\n class=\"k-picker-wrap\"\n [class.k-state-disabled]=\"disabled\"\n >\n <kendo-dateinput\n [value]=\"value\"\n [format]=\"format\"\n [twoDigitYearMax]=\"twoDigitYearMax\"\n [min]=\"min\"\n [max]=\"max\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [role]=\"inputRole\"\n [ariaReadOnly]=\"readonly\"\n [steps]=\"steps\"\n [tabindex]=\"tabindex\"\n [title]=\"title\"\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"isOpen\"\n (valueChange)=\"handleInputValueChange($event)\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeyDown\n }\"\n [scope]=\"this\"\n >\n </kendo-dateinput>\n <span class=\"k-select\"\n [attr.title]=\"localization.get('toggle')\"\n [attr.aria-label]=\"localization.get('toggle')\"\n [kendoEventsOutsideAngular]=\"{\n mousedown: preventMouseDown,\n click: handleIconClick\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-link k-link-date\">\n <span\n class=\"k-icon\"\n [class.k-i-calendar]=\"activeTab === 'date'\"\n [class.k-i-clock]=\"activeTab === 'time'\"\n >\n </span>\n </span>\n </span>\n </span>\n\n <ng-container #container></ng-container>\n\n <ng-template #popupTemplate>\n <div\n class=\"k-datetime-wrap k-{{activeTab}}-tab\"\n [kendoEventsOutsideAngular]=\"{\n mousedown: preventMouseDown,\n keydown: handleKeyDown\n }\"\n [scope]=\"this\"\n >\n <div class=\"k-datetime-buttongroup\"\n [kendoEventsOutsideAngular]=\"{\n focusin: handleFocus,\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n <div class=\"k-button-group k-button-group-stretched\">\n <button\n type=\"button\"\n class=\"k-button k-date-tab\"\n [class.k-state-active]=\"activeTab === 'date'\"\n [attr.title]=\"localization.get('dateTabLabel')\"\n [attr.aria-label]=\"localization.get('dateTabLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: changeActiveTab.bind(this, 'date'),\n keydown: handleBackTabOut\n }\"\n [scope]=\"this\"\n >\n {{localization.get('dateTab')}}\n </button>\n <button\n type=\"button\"\n class=\"k-button k-time-tab\"\n [class.k-state-active]=\"activeTab === 'time'\"\n [attr.title]=\"localization.get('timeTabLabel')\"\n [attr.aria-label]=\"localization.get('timeTabLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: changeActiveTab.bind(this, 'time')\n }\"\n >\n {{localization.get('timeTab')}}\n </button>\n </div>\n </div>\n <div\n #dateTimeSelector\n class=\"k-datetime-selector\"\n [style.transition]=\"tabSwitchTransition\"\n [kendoEventsOutsideAngular]=\"{\n transitionend: handleTabChangeTransitionEnd.bind(this, dateTimeSelector)\n }\"\n >\n <div class=\"k-datetime-calendar-wrap\">\n <kendo-calendar\n [(value)]=\"calendarValue\"\n [type]=\"calendarType\"\n [min]=\"calendarMin\"\n [max]=\"calendarMax\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [navigation]=\"false\"\n [animateNavigation]=\"animateCalendarNavigation\"\n [cellTemplate]=\"cellTemplate\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [disabled]=\"disableCalendar\"\n [disabledDates]=\"disabledDates\"\n (valueChange)=\"handleCalendarValueChange()\"\n >\n <kendo-calendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-calendar-messages>\n </kendo-calendar>\n </div>\n <div class=\"k-datetime-time-wrap\">\n <kendo-timeselector\n [value]=\"value\"\n [format]=\"timeSelectorFormat\"\n [min]=\"timeSelectorMin\"\n [max]=\"timeSelectorMax\"\n [setButton]=\"false\"\n [cancelButton]=\"false\"\n [steps]=\"steps\"\n [disabled]=\"disableTimeSelector\"\n >\n <kendo-timeselector-messages\n [now]=\"localization.get('now')\"\n [nowLabel]=\"localization.get('nowLabel')\"\n >\n </kendo-timeselector-messages>\n </kendo-timeselector>\n </div>\n </div>\n <div\n class=\"k-datetime-footer k-action-buttons k-actions k-hstack k-justify-content-stretch\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleTabOut,\n focusin: handleFocus,\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n <button\n *ngIf=\"cancelButton\"\n type=\"button\"\n class=\"k-button k-time-cancel\"\n [attr.title]=\"localization.get('cancelLabel')\"\n [attr.aria-label]=\"localization.get('cancelLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleCancel\n }\"\n [scope]=\"this\"\n >\n {{localization.get('cancel')}}\n </button>\n <button\n type=\"button\"\n class=\"k-time-accept k-button k-primary\"\n [attr.title]=\"localization.get('acceptLabel')\"\n [attr.aria-label]=\"localization.get('acceptLabel')\"\n [disabled]=\"!calendarValue\"\n [kendoEventsOutsideAngular]=\"{\n click: handleAccept\n }\"\n [scope]=\"this\"\n >\n {{localization.get('accept')}}\n </button>\n </div>\n </div>\n </ng-template>\n "
|
|
1297
|
+
template: "\n <ng-container\n kendoDateTimePickerLocalizedMessages\n\n i18n-dateTab=\"kendo.datetimepicker.dateTab|The Date tab text in the datetimepicker popup header\"\n dateTab=\"Date\"\n\n i18n-dateTabLabel=\"kendo.datetimepicker.dateTabLabel|The label for the Date tab in the datetimepicker popup header\"\n dateTabLabel=\"Date tab\"\n\n i18n-timeTab=\"kendo.datetimepicker.timeTab|The Time tab text in the datetimepicker popup header\"\n timeTab=\"Time\"\n\n i18n-timeTabLabel=\"kendo.datetimepicker.timeTabLabel|The label for the Time tab in the datetimepicker popup header\"\n timeTabLabel=\"Time tab\"\n\n i18n-toggle=\"kendo.datetimepicker.toggle|The title of the toggle button in the datetimepicker component\"\n toggle=\"Toggle popup\"\n\n i18n-accept=\"kendo.datetimepicker.accept|The Accept button text in the datetimepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.datetimepicker.acceptLabel|The label for the Accept button in the datetimepicker component\"\n acceptLabel=\"Set\"\n\n i18n-cancel=\"kendo.datetimepicker.cancel|The Cancel button text in the datetimepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.datetimepicker.cancelLabel|The label for the Cancel button in the datetimepicker component\"\n cancelLabel=\"Cancel\"\n\n i18n-now=\"kendo.datetimepicker.now|The Now button text in the timepicker component\"\n now=\"NOW\"\n\n i18n-nowLabel=\"kendo.datetimepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-today=\"kendo.datetimepicker.today|The label for the today button in the calendar header\"\n today=\"Today\"\n\n i18n-prevButtonTitle=\"kendo.datetimepicker.prevButtonTitle|The title of the previous button in the Classic calendar\"\n prevButtonTitle=\"Navigate to previous view\"\n\n i18n-nextButtonTitle=\"kendo.datetimepicker.nextButtonTitle|The title of the next button in the Classic calendar\"\n nextButtonTitle=\"Navigate to next view\"\n >\n </ng-container>\n\n <kendo-dateinput\n [value]=\"value\"\n [format]=\"format\"\n [twoDigitYearMax]=\"twoDigitYearMax\"\n [min]=\"min\"\n [max]=\"max\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [role]=\"inputRole\"\n [ariaReadOnly]=\"readonly\"\n [steps]=\"steps\"\n [tabindex]=\"tabindex\"\n [title]=\"title\"\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"isOpen\"\n (valueChange)=\"handleInputValueChange($event)\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeyDown\n }\"\n [scope]=\"this\"\n [fillMode]=\"fillMode\"\n [rounded]=\"rounded\"\n [size]=\"size\"\n >\n </kendo-dateinput>\n <button\n #toggleButton\n type=\"button\"\n class=\"k-input-button k-button k-icon-button\"\n [tabindex]=\"-1\"\n [attr.title]=\"localization.get('toggle')\"\n [attr.aria-label]=\"localization.get('toggle')\"\n [kendoEventsOutsideAngular]=\"{\n mousedown: preventMouseDown,\n click: handleIconClick\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-button-icon k-icon\"\n [ngClass]=\"{\n 'k-i-calendar': activeTab === 'date',\n 'k-i-clock': activeTab === 'time'\n }\"\n ></span>\n </button>\n\n <ng-container #container></ng-container>\n\n <ng-template #popupTemplate>\n <div\n class=\"k-datetime-wrap k-{{activeTab}}-tab\"\n [kendoEventsOutsideAngular]=\"{\n mousedown: preventMouseDown,\n keydown: handleKeyDown\n }\"\n [scope]=\"this\"\n >\n <div class=\"k-datetime-buttongroup\"\n [kendoEventsOutsideAngular]=\"{\n focusin: handleFocus,\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n <div class=\"k-button-group k-button-group-stretched\">\n <button\n type=\"button\"\n class=\"k-button k-group-start k-date-tab\"\n [ngClass]=\"popupButtonsClasses()\"\n [class.k-active]=\"activeTab === 'date'\"\n [attr.title]=\"localization.get('dateTabLabel')\"\n [attr.aria-label]=\"localization.get('dateTabLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: changeActiveTab.bind(this, 'date'),\n keydown: handleBackTabOut\n }\"\n [scope]=\"this\"\n >\n {{localization.get('dateTab')}}\n </button>\n <button\n type=\"button\"\n class=\"k-button k-group-end k-time-tab\"\n [ngClass]=\"popupButtonsClasses()\"\n [class.k-active]=\"activeTab === 'time'\"\n [attr.title]=\"localization.get('timeTabLabel')\"\n [attr.aria-label]=\"localization.get('timeTabLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: changeActiveTab.bind(this, 'time')\n }\"\n >\n {{localization.get('timeTab')}}\n </button>\n </div>\n </div>\n <div\n #dateTimeSelector\n class=\"k-datetime-selector\"\n [style.transition]=\"tabSwitchTransition\"\n [kendoEventsOutsideAngular]=\"{\n transitionend: handleTabChangeTransitionEnd.bind(this, dateTimeSelector)\n }\"\n >\n <div class=\"k-datetime-calendar-wrap\">\n <kendo-calendar\n [(value)]=\"calendarValue\"\n [type]=\"calendarType\"\n [min]=\"calendarMin\"\n [max]=\"calendarMax\"\n [focusedDate]=\"focusedDate\"\n [weekNumber]=\"weekNumber\"\n [navigation]=\"false\"\n [animateNavigation]=\"animateCalendarNavigation\"\n [cellTemplate]=\"cellTemplate\"\n [monthCellTemplate]=\"monthCellTemplate\"\n [yearCellTemplate]=\"yearCellTemplate\"\n [decadeCellTemplate]=\"decadeCellTemplate\"\n [centuryCellTemplate]=\"centuryCellTemplate\"\n [weekNumberTemplate]=\"weekNumberTemplate\"\n [headerTitleTemplate]=\"headerTitleTemplate\"\n [disabled]=\"disableCalendar\"\n [disabledDates]=\"disabledDates\"\n (valueChange)=\"handleCalendarValueChange()\"\n >\n <kendo-calendar-messages\n [today]=\"localization.get('today')\"\n [prevButtonTitle]=\"localization.get('prevButtonTitle')\"\n [nextButtonTitle]=\"localization.get('nextButtonTitle')\"\n >\n </kendo-calendar-messages>\n </kendo-calendar>\n </div>\n <div class=\"k-datetime-time-wrap\">\n <kendo-timeselector\n [value]=\"value\"\n [format]=\"timeSelectorFormat\"\n [min]=\"timeSelectorMin\"\n [max]=\"timeSelectorMax\"\n [setButton]=\"false\"\n [cancelButton]=\"false\"\n [steps]=\"steps\"\n [disabled]=\"disableTimeSelector\"\n >\n <kendo-timeselector-messages\n [now]=\"localization.get('now')\"\n [nowLabel]=\"localization.get('nowLabel')\"\n >\n </kendo-timeselector-messages>\n </kendo-timeselector>\n </div>\n </div>\n <div\n class=\"k-datetime-footer k-action-buttons k-actions k-hstack k-justify-content-stretch\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleTabOut,\n focusin: handleFocus,\n focusout: handleBlur\n }\"\n [scope]=\"this\"\n >\n <button\n *ngIf=\"cancelButton\"\n type=\"button\"\n class=\"k-button k-time-cancel\"\n [ngClass]=\"popupButtonsClasses()\"\n [attr.title]=\"localization.get('cancelLabel')\"\n [attr.aria-label]=\"localization.get('cancelLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleCancel\n }\"\n [scope]=\"this\"\n >\n {{localization.get('cancel')}}\n </button>\n <button\n type=\"button\"\n class=\"k-button k-time-accept\"\n [ngClass]=\"popupButtonsClasses('primary')\"\n [attr.title]=\"localization.get('acceptLabel')\"\n [attr.aria-label]=\"localization.get('acceptLabel')\"\n [disabled]=\"!calendarValue\"\n [kendoEventsOutsideAngular]=\"{\n click: handleAccept\n }\"\n [scope]=\"this\"\n >\n {{localization.get('accept')}}\n </button>\n </div>\n </div>\n </ng-template>\n "
|
|
1162
1298
|
}),
|
|
1163
1299
|
tslib_1.__param(6, core_1.Inject(touch_enabled_1.TOUCH_ENABLED)),
|
|
1164
1300
|
tslib_1.__metadata("design:paramtypes", [kendo_angular_popup_1.PopupService,
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-dateinputs',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1642573758,
|
|
15
15
|
version: '',
|
|
16
16
|
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'
|
|
17
17
|
};
|
|
@@ -11,23 +11,27 @@ var util_1 = require("../../util");
|
|
|
11
11
|
var div = util_1.domContainerFactory('div');
|
|
12
12
|
var ul = util_1.domContainerFactory('ul');
|
|
13
13
|
var li = util_1.domContainerFactory('li');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var span = util_1.domContainerFactory('span');
|
|
15
|
+
var listTitle = function () { return span('hour', 'k-title k-timeselector-title'); };
|
|
16
|
+
var ɵ0 = listTitle;
|
|
16
17
|
exports.ɵ0 = ɵ0;
|
|
17
|
-
var
|
|
18
|
-
var ɵ1 =
|
|
18
|
+
var listItem = function () { return li('<span>02</span>', 'k-item'); };
|
|
19
|
+
var ɵ1 = listItem;
|
|
19
20
|
exports.ɵ1 = ɵ1;
|
|
20
|
-
var
|
|
21
|
-
var ɵ2 =
|
|
21
|
+
var list = function () { return ul([listItem()], 'k-reset'); };
|
|
22
|
+
var ɵ2 = list;
|
|
22
23
|
exports.ɵ2 = ɵ2;
|
|
24
|
+
var scrollable = function () { return (div([list()], 'k-time-container k-flex k-content k-calendar-content k-scrollable')); };
|
|
25
|
+
var ɵ3 = scrollable;
|
|
26
|
+
exports.ɵ3 = ɵ3;
|
|
23
27
|
var timeListWrapper = function () {
|
|
24
28
|
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
25
29
|
return null;
|
|
26
30
|
}
|
|
27
|
-
return div([div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
|
|
31
|
+
return div([listTitle(), div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
|
|
28
32
|
};
|
|
29
|
-
var ɵ
|
|
30
|
-
exports.ɵ
|
|
33
|
+
var ɵ4 = timeListWrapper;
|
|
34
|
+
exports.ɵ4 = ɵ4;
|
|
31
35
|
var TIMELIST_WRAPPER = timeListWrapper();
|
|
32
36
|
/**
|
|
33
37
|
* @hidden
|
|
@@ -48,7 +52,8 @@ var TimePickerDOMService = /** @class */ (function () {
|
|
|
48
52
|
var listContainer = container && container.querySelector('.k-time-list-container');
|
|
49
53
|
var hostContainer = listContainer || document.body;
|
|
50
54
|
var wrapper = hostContainer.appendChild(TIMELIST_WRAPPER);
|
|
51
|
-
this.
|
|
55
|
+
this.timeListTitleHeight = wrapper.querySelector('.k-timeselector-title').getBoundingClientRect().height;
|
|
56
|
+
this.timeListHeight = wrapper.getBoundingClientRect().height;
|
|
52
57
|
this.itemHeight = wrapper.querySelector('li').getBoundingClientRect().height;
|
|
53
58
|
hostContainer.removeChild(wrapper);
|
|
54
59
|
};
|
|
@@ -96,8 +96,9 @@ var TimeListComponent = /** @class */ (function () {
|
|
|
96
96
|
this.dom.ensureHeights();
|
|
97
97
|
this.itemHeight = this.dom.itemHeight;
|
|
98
98
|
this.listHeight = this.dom.timeListHeight;
|
|
99
|
-
|
|
100
|
-
this.
|
|
99
|
+
var titleHeight = this.dom.timeListTitleHeight;
|
|
100
|
+
this.topOffset = (this.listHeight - this.itemHeight - titleHeight) / 2;
|
|
101
|
+
this.bottomOffset = this.listHeight - this.itemHeight - titleHeight;
|
|
101
102
|
this.topThreshold = this.itemHeight * SNAP_THRESHOLD;
|
|
102
103
|
this.bottomThreshold = this.itemHeight * (1 - SNAP_THRESHOLD);
|
|
103
104
|
var translate = "translateY(" + this.topOffset + "px)";
|