@progress/kendo-angular-dateinputs 5.3.1-dev.202201070925 → 6.0.0-dev.202201181611
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 +1 -1
- 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 +127 -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.js +1 -1
- 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 +152 -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 +756 -267
- package/dist/fesm5/index.js +600 -67
- 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 +1 -1
- 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 +126 -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 +2 -2
|
@@ -17,7 +17,7 @@ import { packageMetadata } from '../package-metadata';
|
|
|
17
17
|
import { PickerService } from '../common/picker.service';
|
|
18
18
|
import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
|
|
19
19
|
import { isPresent } from '../common/utils';
|
|
20
|
-
import { mergeDateAndTime, noop, lastMillisecondOfDate, isInRange, isValidRange, isWindowAvailable } from '../util';
|
|
20
|
+
import { mergeDateAndTime, noop, lastMillisecondOfDate, isInRange, isValidRange, isWindowAvailable, getFillModeClass, getRoundedClass, getSizeClass } from '../util';
|
|
21
21
|
import { PreventableEvent } from '../preventable-event';
|
|
22
22
|
import { minValidator } from '../validators/min.validator';
|
|
23
23
|
import { maxValidator } from '../validators/max.validator';
|
|
@@ -44,13 +44,13 @@ var TWO_DIGIT_YEAR_MAX = 68;
|
|
|
44
44
|
* Represents the [Kendo UI DateTimePicker component for Angular]({% slug overview_datetimepicker %}).
|
|
45
45
|
*/
|
|
46
46
|
var DateTimePickerComponent = /** @class */ (function () {
|
|
47
|
-
function DateTimePickerComponent(popupService, intl, cdr, pickerService, ngZone,
|
|
47
|
+
function DateTimePickerComponent(popupService, intl, cdr, pickerService, ngZone, wrapper, touchEnabled, localization, disabledDatesService, renderer) {
|
|
48
48
|
this.popupService = popupService;
|
|
49
49
|
this.intl = intl;
|
|
50
50
|
this.cdr = cdr;
|
|
51
51
|
this.pickerService = pickerService;
|
|
52
52
|
this.ngZone = ngZone;
|
|
53
|
-
this.
|
|
53
|
+
this.wrapper = wrapper;
|
|
54
54
|
this.touchEnabled = touchEnabled;
|
|
55
55
|
this.localization = localization;
|
|
56
56
|
this.disabledDatesService = disabledDatesService;
|
|
@@ -217,9 +217,22 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
217
217
|
this.disabledDatesValidateFn = noop;
|
|
218
218
|
this.incompleteValidator = noop;
|
|
219
219
|
this.subscriptions = new Subscription();
|
|
220
|
+
this._size = 'medium';
|
|
221
|
+
this._rounded = 'medium';
|
|
222
|
+
this._fillMode = 'solid';
|
|
220
223
|
validatePackage(packageMetadata);
|
|
221
224
|
}
|
|
222
225
|
DateTimePickerComponent_1 = DateTimePickerComponent;
|
|
226
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "disabledClass", {
|
|
227
|
+
/**
|
|
228
|
+
* @hidden
|
|
229
|
+
*/
|
|
230
|
+
get: function () {
|
|
231
|
+
return this.disabled;
|
|
232
|
+
},
|
|
233
|
+
enumerable: true,
|
|
234
|
+
configurable: true
|
|
235
|
+
});
|
|
223
236
|
Object.defineProperty(DateTimePickerComponent.prototype, "input", {
|
|
224
237
|
/**
|
|
225
238
|
* @hidden
|
|
@@ -400,10 +413,10 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
400
413
|
},
|
|
401
414
|
set: function (value) {
|
|
402
415
|
if (value) {
|
|
403
|
-
this.renderer.addClass(this.wrapper.nativeElement, 'k-
|
|
416
|
+
this.renderer.addClass(this.wrapper.nativeElement, 'k-focus');
|
|
404
417
|
}
|
|
405
418
|
else {
|
|
406
|
-
this.renderer.removeClass(this.wrapper.nativeElement, 'k-
|
|
419
|
+
this.renderer.removeClass(this.wrapper.nativeElement, 'k-focus');
|
|
407
420
|
}
|
|
408
421
|
this._isActive = value;
|
|
409
422
|
},
|
|
@@ -425,6 +438,85 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
425
438
|
enumerable: true,
|
|
426
439
|
configurable: true
|
|
427
440
|
});
|
|
441
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "size", {
|
|
442
|
+
get: function () {
|
|
443
|
+
return this._size;
|
|
444
|
+
},
|
|
445
|
+
/**
|
|
446
|
+
* Sets the size of the component.
|
|
447
|
+
*
|
|
448
|
+
* The possible values are:
|
|
449
|
+
* * `'small'`
|
|
450
|
+
* * `'medium'` (Default)
|
|
451
|
+
* * `'large'`
|
|
452
|
+
* * `null`
|
|
453
|
+
*
|
|
454
|
+
*/
|
|
455
|
+
set: function (size) {
|
|
456
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
457
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, getSizeClass('input', this.size));
|
|
458
|
+
if (size) {
|
|
459
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', size));
|
|
460
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('input', size));
|
|
461
|
+
}
|
|
462
|
+
this._size = size;
|
|
463
|
+
},
|
|
464
|
+
enumerable: true,
|
|
465
|
+
configurable: true
|
|
466
|
+
});
|
|
467
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "rounded", {
|
|
468
|
+
get: function () {
|
|
469
|
+
return this._rounded;
|
|
470
|
+
},
|
|
471
|
+
/**
|
|
472
|
+
* Sets the border radius of the component.
|
|
473
|
+
*
|
|
474
|
+
* The possible values are:
|
|
475
|
+
* * `'small'`
|
|
476
|
+
* * `'medium'` (Default)
|
|
477
|
+
* * `'large'`
|
|
478
|
+
* * `'full'`
|
|
479
|
+
* * `null`
|
|
480
|
+
*
|
|
481
|
+
*/
|
|
482
|
+
set: function (rounded) {
|
|
483
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
484
|
+
if (rounded) {
|
|
485
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
486
|
+
}
|
|
487
|
+
this._rounded = rounded;
|
|
488
|
+
},
|
|
489
|
+
enumerable: true,
|
|
490
|
+
configurable: true
|
|
491
|
+
});
|
|
492
|
+
Object.defineProperty(DateTimePickerComponent.prototype, "fillMode", {
|
|
493
|
+
get: function () {
|
|
494
|
+
return this._fillMode;
|
|
495
|
+
},
|
|
496
|
+
/**
|
|
497
|
+
* Sets the fillMode of the component.
|
|
498
|
+
*
|
|
499
|
+
* The possible values are:
|
|
500
|
+
* * `'solid'` (Default)
|
|
501
|
+
* * `'flat'`
|
|
502
|
+
* * `'outline'`
|
|
503
|
+
* * `null`
|
|
504
|
+
*
|
|
505
|
+
*/
|
|
506
|
+
set: function (fillMode) {
|
|
507
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
508
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
|
|
509
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
510
|
+
if (fillMode) {
|
|
511
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', fillMode));
|
|
512
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', fillMode));
|
|
513
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + fillMode + "-base");
|
|
514
|
+
}
|
|
515
|
+
this._fillMode = fillMode;
|
|
516
|
+
},
|
|
517
|
+
enumerable: true,
|
|
518
|
+
configurable: true
|
|
519
|
+
});
|
|
428
520
|
Object.defineProperty(DateTimePickerComponent.prototype, "tabSwitchTransition", {
|
|
429
521
|
/**
|
|
430
522
|
* @hidden
|
|
@@ -515,6 +607,9 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
515
607
|
this.subscriptions.add(this.ngZone.runOutsideAngular(function () { return fromEvent(window, 'blur').subscribe(_this.handleCancel.bind(_this)); }));
|
|
516
608
|
}
|
|
517
609
|
};
|
|
610
|
+
DateTimePickerComponent.prototype.ngAfterViewInit = function () {
|
|
611
|
+
this.setComponentClasses();
|
|
612
|
+
};
|
|
518
613
|
DateTimePickerComponent.prototype.ngOnChanges = function (changes) {
|
|
519
614
|
if (isPresent(changes.min) || isPresent(changes.max)) {
|
|
520
615
|
this.verifyMinMaxRange();
|
|
@@ -669,7 +764,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
669
764
|
return;
|
|
670
765
|
}
|
|
671
766
|
this.isActive = false;
|
|
672
|
-
var isNgControlUntouched = this.
|
|
767
|
+
var isNgControlUntouched = this.wrapper.nativeElement.classList.contains('ng-untouched');
|
|
673
768
|
var runInZone = isNgControlUntouched || hasObservers(this.onBlur) || (this.isOpen && hasObservers(this.close));
|
|
674
769
|
this.run(runInZone, function () {
|
|
675
770
|
_this.onBlur.emit();
|
|
@@ -797,6 +892,13 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
797
892
|
this.input.focus();
|
|
798
893
|
}
|
|
799
894
|
};
|
|
895
|
+
/**
|
|
896
|
+
* @hidden
|
|
897
|
+
*/
|
|
898
|
+
DateTimePickerComponent.prototype.popupButtonsClasses = function (type) {
|
|
899
|
+
var buttonType = type ? type : 'base';
|
|
900
|
+
return (this.size ? getSizeClass('button', this.size) : '') + " " + (this.rounded ? getRoundedClass(this.rounded) : '') + " " + (this.fillMode ? 'k-button-' + this.fillMode + ' ' + 'k-button-' + this.fillMode + '-' + buttonType : '');
|
|
901
|
+
};
|
|
800
902
|
/**
|
|
801
903
|
* @hidden
|
|
802
904
|
*
|
|
@@ -921,7 +1023,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
921
1023
|
};
|
|
922
1024
|
/**
|
|
923
1025
|
* Indicates whether the focus target is part of this component,
|
|
924
|
-
* that is, whether the focus target is inside the component
|
|
1026
|
+
* that is, whether the focus target is inside the component or in the popup.
|
|
925
1027
|
*/
|
|
926
1028
|
DateTimePickerComponent.prototype.focusTargetInComponent = function (event) {
|
|
927
1029
|
if (!isPresent(event)) {
|
|
@@ -968,16 +1070,35 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
968
1070
|
this.cdr.markForCheck();
|
|
969
1071
|
this.ngZone.run(function () { return _this.onValidatorChange(); });
|
|
970
1072
|
};
|
|
1073
|
+
DateTimePickerComponent.prototype.setComponentClasses = function () {
|
|
1074
|
+
if (this.size) {
|
|
1075
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
1076
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
|
|
1077
|
+
}
|
|
1078
|
+
if (this.rounded) {
|
|
1079
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
1080
|
+
}
|
|
1081
|
+
if (this.fillMode) {
|
|
1082
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
1083
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
|
|
1084
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
971
1087
|
var DateTimePickerComponent_1;
|
|
972
1088
|
tslib_1.__decorate([
|
|
973
|
-
HostBinding('class.k-widget'),
|
|
974
1089
|
HostBinding('class.k-datetimepicker'),
|
|
1090
|
+
HostBinding('class.k-input'),
|
|
975
1091
|
tslib_1.__metadata("design:type", Boolean)
|
|
976
1092
|
], DateTimePickerComponent.prototype, "hostClasses", void 0);
|
|
977
1093
|
tslib_1.__decorate([
|
|
978
|
-
|
|
1094
|
+
HostBinding('class.k-disabled'),
|
|
1095
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
1096
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1097
|
+
], DateTimePickerComponent.prototype, "disabledClass", null);
|
|
1098
|
+
tslib_1.__decorate([
|
|
1099
|
+
ViewChild('toggleButton', { static: true }),
|
|
979
1100
|
tslib_1.__metadata("design:type", ElementRef)
|
|
980
|
-
], DateTimePickerComponent.prototype, "
|
|
1101
|
+
], DateTimePickerComponent.prototype, "toggleButton", void 0);
|
|
981
1102
|
tslib_1.__decorate([
|
|
982
1103
|
Input(),
|
|
983
1104
|
tslib_1.__metadata("design:type", Date),
|
|
@@ -1106,6 +1227,21 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
1106
1227
|
tslib_1.__metadata("design:type", String),
|
|
1107
1228
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
1108
1229
|
], DateTimePickerComponent.prototype, "defaultTab", null);
|
|
1230
|
+
tslib_1.__decorate([
|
|
1231
|
+
Input(),
|
|
1232
|
+
tslib_1.__metadata("design:type", String),
|
|
1233
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1234
|
+
], DateTimePickerComponent.prototype, "size", null);
|
|
1235
|
+
tslib_1.__decorate([
|
|
1236
|
+
Input(),
|
|
1237
|
+
tslib_1.__metadata("design:type", String),
|
|
1238
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1239
|
+
], DateTimePickerComponent.prototype, "rounded", null);
|
|
1240
|
+
tslib_1.__decorate([
|
|
1241
|
+
Input(),
|
|
1242
|
+
tslib_1.__metadata("design:type", String),
|
|
1243
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1244
|
+
], DateTimePickerComponent.prototype, "fillMode", null);
|
|
1109
1245
|
tslib_1.__decorate([
|
|
1110
1246
|
ContentChild(CellTemplateDirective, { static: false }),
|
|
1111
1247
|
tslib_1.__metadata("design:type", CellTemplateDirective)
|
|
@@ -1156,7 +1292,7 @@ var DateTimePickerComponent = /** @class */ (function () {
|
|
|
1156
1292
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(function () { return DateTimePickerComponent_1; }), multi: true },
|
|
1157
1293
|
{ provide: KendoInput, useExisting: forwardRef(function () { return DateTimePickerComponent_1; }) }
|
|
1158
1294
|
],
|
|
1159
|
-
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 "
|
|
1295
|
+
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 "
|
|
1160
1296
|
}),
|
|
1161
1297
|
tslib_1.__param(6, Inject(TOUCH_ENABLED)),
|
|
1162
1298
|
tslib_1.__metadata("design:paramtypes", [PopupService,
|
|
@@ -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: 1642521990,
|
|
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
|
};
|
|
@@ -9,19 +9,22 @@ import { domContainerFactory as containerFactory } from '../../util';
|
|
|
9
9
|
var div = containerFactory('div');
|
|
10
10
|
var ul = containerFactory('ul');
|
|
11
11
|
var li = containerFactory('li');
|
|
12
|
+
var span = containerFactory('span');
|
|
13
|
+
var listTitle = function () { return span('hour', 'k-title k-timeselector-title'); };
|
|
14
|
+
var ɵ0 = listTitle;
|
|
12
15
|
var listItem = function () { return li('<span>02</span>', 'k-item'); };
|
|
13
|
-
var ɵ
|
|
16
|
+
var ɵ1 = listItem;
|
|
14
17
|
var list = function () { return ul([listItem()], 'k-reset'); };
|
|
15
|
-
var ɵ
|
|
16
|
-
var scrollable = function () { return (div([list()], 'k-time-container k-content k-scrollable')); };
|
|
17
|
-
var ɵ
|
|
18
|
+
var ɵ2 = list;
|
|
19
|
+
var scrollable = function () { return (div([list()], 'k-time-container k-flex k-content k-calendar-content k-scrollable')); };
|
|
20
|
+
var ɵ3 = scrollable;
|
|
18
21
|
var timeListWrapper = function () {
|
|
19
22
|
if (!isDocumentAvailable()) {
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
22
|
-
return div([div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
|
|
25
|
+
return div([listTitle(), div([scrollable()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });
|
|
23
26
|
};
|
|
24
|
-
var ɵ
|
|
27
|
+
var ɵ4 = timeListWrapper;
|
|
25
28
|
var TIMELIST_WRAPPER = timeListWrapper();
|
|
26
29
|
/**
|
|
27
30
|
* @hidden
|
|
@@ -42,7 +45,8 @@ var TimePickerDOMService = /** @class */ (function () {
|
|
|
42
45
|
var listContainer = container && container.querySelector('.k-time-list-container');
|
|
43
46
|
var hostContainer = listContainer || document.body;
|
|
44
47
|
var wrapper = hostContainer.appendChild(TIMELIST_WRAPPER);
|
|
45
|
-
this.
|
|
48
|
+
this.timeListTitleHeight = wrapper.querySelector('.k-timeselector-title').getBoundingClientRect().height;
|
|
49
|
+
this.timeListHeight = wrapper.getBoundingClientRect().height;
|
|
46
50
|
this.itemHeight = wrapper.querySelector('li').getBoundingClientRect().height;
|
|
47
51
|
hostContainer.removeChild(wrapper);
|
|
48
52
|
};
|
|
@@ -58,4 +62,4 @@ var TimePickerDOMService = /** @class */ (function () {
|
|
|
58
62
|
return TimePickerDOMService;
|
|
59
63
|
}());
|
|
60
64
|
export { TimePickerDOMService };
|
|
61
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3 };
|
|
65
|
+
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4 };
|
|
@@ -93,8 +93,9 @@ var TimeListComponent = /** @class */ (function () {
|
|
|
93
93
|
this.dom.ensureHeights();
|
|
94
94
|
this.itemHeight = this.dom.itemHeight;
|
|
95
95
|
this.listHeight = this.dom.timeListHeight;
|
|
96
|
-
|
|
97
|
-
this.
|
|
96
|
+
var titleHeight = this.dom.timeListTitleHeight;
|
|
97
|
+
this.topOffset = (this.listHeight - this.itemHeight - titleHeight) / 2;
|
|
98
|
+
this.bottomOffset = this.listHeight - this.itemHeight - titleHeight;
|
|
98
99
|
this.topThreshold = this.itemHeight * SNAP_THRESHOLD;
|
|
99
100
|
this.bottomThreshold = this.itemHeight * (1 - SNAP_THRESHOLD);
|
|
100
101
|
var translate = "translateY(" + this.topOffset + "px)";
|
|
@@ -17,7 +17,7 @@ import { PickerService } from '../common/picker.service';
|
|
|
17
17
|
import { requiresZoneOnBlur, currentFocusTarget } from '../common/utils';
|
|
18
18
|
import { TIME_PART } from './models/time-part.default';
|
|
19
19
|
import { PreventableEvent } from '../preventable-event';
|
|
20
|
-
import { noop, setTime, isWindowAvailable } from '../util';
|
|
20
|
+
import { noop, setTime, isWindowAvailable, getFillModeClass, getSizeClass, getRoundedClass } from '../util';
|
|
21
21
|
import { timeRangeValidator } from '../validators/time-range.validator';
|
|
22
22
|
import { TOUCH_ENABLED } from '../touch-enabled';
|
|
23
23
|
import { fromEvent } from 'rxjs';
|
|
@@ -29,12 +29,12 @@ var formatRegExp = new RegExp(TIME_PART.hour + "|" + TIME_PART.minute + "|" + TI
|
|
|
29
29
|
* Represents the [Kendo UI TimePicker component for Angular]({% slug overview_timepicker %}#toc-basic-usage).
|
|
30
30
|
*/
|
|
31
31
|
var TimePickerComponent = /** @class */ (function () {
|
|
32
|
-
function TimePickerComponent(zone, localization, cdr, popupService,
|
|
32
|
+
function TimePickerComponent(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, intl, touchEnabled) {
|
|
33
33
|
this.zone = zone;
|
|
34
34
|
this.localization = localization;
|
|
35
35
|
this.cdr = cdr;
|
|
36
36
|
this.popupService = popupService;
|
|
37
|
-
this.
|
|
37
|
+
this.wrapper = wrapper;
|
|
38
38
|
this.renderer = renderer;
|
|
39
39
|
this.injector = injector;
|
|
40
40
|
this.pickerService = pickerService;
|
|
@@ -196,6 +196,9 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
196
196
|
this._value = null;
|
|
197
197
|
this._active = false;
|
|
198
198
|
this.domEvents = [];
|
|
199
|
+
this._size = 'medium';
|
|
200
|
+
this._rounded = 'medium';
|
|
201
|
+
this._fillMode = 'solid';
|
|
199
202
|
validatePackage(packageMetadata);
|
|
200
203
|
this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));
|
|
201
204
|
this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));
|
|
@@ -306,6 +309,85 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
306
309
|
enumerable: true,
|
|
307
310
|
configurable: true
|
|
308
311
|
});
|
|
312
|
+
Object.defineProperty(TimePickerComponent.prototype, "size", {
|
|
313
|
+
get: function () {
|
|
314
|
+
return this._size;
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* Sets the size of the component.
|
|
318
|
+
*
|
|
319
|
+
* The possible values are:
|
|
320
|
+
* * `'small'`
|
|
321
|
+
* * `'medium'` (Default)
|
|
322
|
+
* * `'large'`
|
|
323
|
+
* * `null`
|
|
324
|
+
*
|
|
325
|
+
*/
|
|
326
|
+
set: function (size) {
|
|
327
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
328
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, getSizeClass('input', this.size));
|
|
329
|
+
if (size) {
|
|
330
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', size));
|
|
331
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('input', size));
|
|
332
|
+
}
|
|
333
|
+
this._size = size;
|
|
334
|
+
},
|
|
335
|
+
enumerable: true,
|
|
336
|
+
configurable: true
|
|
337
|
+
});
|
|
338
|
+
Object.defineProperty(TimePickerComponent.prototype, "rounded", {
|
|
339
|
+
get: function () {
|
|
340
|
+
return this._rounded;
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* Sets the border radius of the component.
|
|
344
|
+
*
|
|
345
|
+
* The possible values are:
|
|
346
|
+
* * `'small'`
|
|
347
|
+
* * `'medium'` (Default)
|
|
348
|
+
* * `'large'`
|
|
349
|
+
* * `'full'`
|
|
350
|
+
* * `null`
|
|
351
|
+
*
|
|
352
|
+
*/
|
|
353
|
+
set: function (rounded) {
|
|
354
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
355
|
+
if (rounded) {
|
|
356
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
357
|
+
}
|
|
358
|
+
this._rounded = rounded;
|
|
359
|
+
},
|
|
360
|
+
enumerable: true,
|
|
361
|
+
configurable: true
|
|
362
|
+
});
|
|
363
|
+
Object.defineProperty(TimePickerComponent.prototype, "fillMode", {
|
|
364
|
+
get: function () {
|
|
365
|
+
return this._fillMode;
|
|
366
|
+
},
|
|
367
|
+
/**
|
|
368
|
+
* Sets the fillMode of the component.
|
|
369
|
+
*
|
|
370
|
+
* The possible values are:
|
|
371
|
+
* * `'solid'` (Default)
|
|
372
|
+
* * `'flat'`
|
|
373
|
+
* * `'outline'`
|
|
374
|
+
* * `null`
|
|
375
|
+
*
|
|
376
|
+
*/
|
|
377
|
+
set: function (fillMode) {
|
|
378
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
379
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
|
|
380
|
+
this.renderer.removeClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
381
|
+
if (fillMode) {
|
|
382
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', fillMode));
|
|
383
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', fillMode));
|
|
384
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + fillMode + "-base");
|
|
385
|
+
}
|
|
386
|
+
this._fillMode = fillMode;
|
|
387
|
+
},
|
|
388
|
+
enumerable: true,
|
|
389
|
+
configurable: true
|
|
390
|
+
});
|
|
309
391
|
Object.defineProperty(TimePickerComponent.prototype, "disabledClass", {
|
|
310
392
|
/**
|
|
311
393
|
* @hidden
|
|
@@ -337,10 +419,10 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
337
419
|
}
|
|
338
420
|
var element = this.wrapper.nativeElement;
|
|
339
421
|
if (value) {
|
|
340
|
-
this.renderer.addClass(element, 'k-
|
|
422
|
+
this.renderer.addClass(element, 'k-focus');
|
|
341
423
|
}
|
|
342
424
|
else {
|
|
343
|
-
this.renderer.removeClass(element, 'k-
|
|
425
|
+
this.renderer.removeClass(element, 'k-focus');
|
|
344
426
|
}
|
|
345
427
|
},
|
|
346
428
|
enumerable: true,
|
|
@@ -397,13 +479,19 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
397
479
|
this.localizationChangeSubscription = this.localization
|
|
398
480
|
.changes.subscribe(function () { return _this.cdr.markForCheck(); });
|
|
399
481
|
this.control = this.injector.get(NgControl, null);
|
|
400
|
-
if (this.
|
|
401
|
-
this.renderer.removeAttribute(this.
|
|
482
|
+
if (this.wrapper) {
|
|
483
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
|
|
402
484
|
this.zone.runOutsideAngular(function () {
|
|
403
485
|
_this.bindEvents();
|
|
404
486
|
});
|
|
405
487
|
}
|
|
406
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* @hidden
|
|
491
|
+
*/
|
|
492
|
+
TimePickerComponent.prototype.ngAfterViewInit = function () {
|
|
493
|
+
this.setComponentClasses();
|
|
494
|
+
};
|
|
407
495
|
/**
|
|
408
496
|
* @hidden
|
|
409
497
|
*/
|
|
@@ -716,7 +804,7 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
716
804
|
}
|
|
717
805
|
};
|
|
718
806
|
TimePickerComponent.prototype.bindEvents = function () {
|
|
719
|
-
var element = this.
|
|
807
|
+
var element = this.wrapper.nativeElement;
|
|
720
808
|
this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
|
|
721
809
|
if (isWindowAvailable()) {
|
|
722
810
|
this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));
|
|
@@ -768,6 +856,20 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
768
856
|
this.cdr.markForCheck();
|
|
769
857
|
this.zone.run(function () { return _this.onValidatorChange(); });
|
|
770
858
|
};
|
|
859
|
+
TimePickerComponent.prototype.setComponentClasses = function () {
|
|
860
|
+
if (this.size) {
|
|
861
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
862
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
|
|
863
|
+
}
|
|
864
|
+
if (this.rounded) {
|
|
865
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
866
|
+
}
|
|
867
|
+
if (this.fillMode) {
|
|
868
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
869
|
+
this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
|
|
870
|
+
this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
|
|
871
|
+
}
|
|
872
|
+
};
|
|
771
873
|
var TimePickerComponent_1;
|
|
772
874
|
tslib_1.__decorate([
|
|
773
875
|
ViewChild('container', { read: ViewContainerRef, static: false }),
|
|
@@ -778,9 +880,9 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
778
880
|
tslib_1.__metadata("design:type", TemplateRef)
|
|
779
881
|
], TimePickerComponent.prototype, "popupTemplate", void 0);
|
|
780
882
|
tslib_1.__decorate([
|
|
781
|
-
ViewChild('
|
|
883
|
+
ViewChild('toggleButton', { static: true }),
|
|
782
884
|
tslib_1.__metadata("design:type", ElementRef)
|
|
783
|
-
], TimePickerComponent.prototype, "
|
|
885
|
+
], TimePickerComponent.prototype, "toggleButton", void 0);
|
|
784
886
|
tslib_1.__decorate([
|
|
785
887
|
Input(),
|
|
786
888
|
tslib_1.__metadata("design:type", String)
|
|
@@ -863,6 +965,21 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
863
965
|
tslib_1.__metadata("design:type", Date),
|
|
864
966
|
tslib_1.__metadata("design:paramtypes", [Date])
|
|
865
967
|
], TimePickerComponent.prototype, "value", null);
|
|
968
|
+
tslib_1.__decorate([
|
|
969
|
+
Input(),
|
|
970
|
+
tslib_1.__metadata("design:type", String),
|
|
971
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
972
|
+
], TimePickerComponent.prototype, "size", null);
|
|
973
|
+
tslib_1.__decorate([
|
|
974
|
+
Input(),
|
|
975
|
+
tslib_1.__metadata("design:type", String),
|
|
976
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
977
|
+
], TimePickerComponent.prototype, "rounded", null);
|
|
978
|
+
tslib_1.__decorate([
|
|
979
|
+
Input(),
|
|
980
|
+
tslib_1.__metadata("design:type", String),
|
|
981
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
982
|
+
], TimePickerComponent.prototype, "fillMode", null);
|
|
866
983
|
tslib_1.__decorate([
|
|
867
984
|
Output(),
|
|
868
985
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -884,12 +1001,12 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
884
1001
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
885
1002
|
], TimePickerComponent.prototype, "close", void 0);
|
|
886
1003
|
tslib_1.__decorate([
|
|
887
|
-
HostBinding('class.k-widget'),
|
|
888
1004
|
HostBinding('class.k-timepicker'),
|
|
1005
|
+
HostBinding('class.k-input'),
|
|
889
1006
|
tslib_1.__metadata("design:type", Boolean)
|
|
890
1007
|
], TimePickerComponent.prototype, "wrapperClasses", void 0);
|
|
891
1008
|
tslib_1.__decorate([
|
|
892
|
-
HostBinding('class.k-
|
|
1009
|
+
HostBinding('class.k-disabled'),
|
|
893
1010
|
tslib_1.__metadata("design:type", Boolean),
|
|
894
1011
|
tslib_1.__metadata("design:paramtypes", [])
|
|
895
1012
|
], TimePickerComponent.prototype, "disabledClass", null);
|
|
@@ -909,7 +1026,7 @@ var TimePickerComponent = /** @class */ (function () {
|
|
|
909
1026
|
PickerService
|
|
910
1027
|
],
|
|
911
1028
|
selector: 'kendo-timepicker',
|
|
912
|
-
template: "\n <ng-container kendoTimePickerLocalizedMessages\n i18n-accept=\"kendo.timepicker.accept|The Accept button text in the timepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timepicker.acceptLabel|The label for the Accept button in the timepicker component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timepicker.cancel|The Cancel button text in the timepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timepicker.cancelLabel|The label for the Cancel button in the timepicker component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timepicker.now|The Now button text in the timepicker component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-toggle=\"kendo.timepicker.toggle|The label for the toggle button in the timepicker component\"\n toggle=\"Toggle time list\"\n >\n </ng-container>\n <
|
|
1029
|
+
template: "\n <ng-container kendoTimePickerLocalizedMessages\n i18n-accept=\"kendo.timepicker.accept|The Accept button text in the timepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timepicker.acceptLabel|The label for the Accept button in the timepicker component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timepicker.cancel|The Cancel button text in the timepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timepicker.cancelLabel|The label for the Cancel button in the timepicker component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timepicker.now|The Now button text in the timepicker component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-toggle=\"kendo.timepicker.toggle|The label for the toggle button in the timepicker component\"\n toggle=\"Toggle time list\"\n >\n </ng-container>\n <kendo-dateinput\n #input\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"show\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [role]=\"inputRole\"\n [ariaReadOnly]=\"readonly\"\n [format]=\"format\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [min]=\"normalizeTime(min)\"\n [max]=\"normalizeTime(max)\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [fillMode]=\"fillMode\"\n [rounded]=\"rounded\"\n [size]=\"size\"\n [steps]=\"steps\"\n [tabindex]=\"!show ? tabindex : -1\"\n [title]=\"title\"\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 [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-clock\"></span>\n </button>\n <ng-template #popupTemplate>\n <kendo-timeselector\n #timeSelector\n [cancelButton]=\"cancelButton\"\n [nowButton]=\"nowButton\"\n [format]=\"format\"\n [min]=\"min\"\n [max]=\"max\"\n [steps]=\"steps\"\n [value]=\"value\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeydown,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n (valueChange)=\"handleChange($event)\"\n (valueReject)=\"handleReject()\"\n >\n <kendo-timeselector-messages\n [acceptLabel]=\"localization.get('acceptLabel')\"\n [accept]=\"localization.get('accept')\"\n [cancelLabel]=\"localization.get('cancelLabel')\"\n [cancel]=\"localization.get('cancel')\"\n [nowLabel]=\"localization.get('nowLabel')\"\n [now]=\"localization.get('now')\"\n >\n </kendo-timeselector-messages>\n </kendo-timeselector>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
913
1030
|
}),
|
|
914
1031
|
tslib_1.__param(9, Optional()), tslib_1.__param(9, Inject(TOUCH_ENABLED)),
|
|
915
1032
|
tslib_1.__metadata("design:paramtypes", [NgZone,
|