@progress/kendo-angular-inputs 8.0.9-dev.202203171224 → 8.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-inputs.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/maskedtextbox/maskedtextbox.component.js +48 -44
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rangeslider/rangeslider.component.js +9 -5
- package/dist/es/textarea/textarea-suffix.component.js +1 -2
- package/dist/es/textbox/textbox-suffix.directive.js +0 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/maskedtextbox/maskedtextbox.component.d.ts +5 -4
- package/dist/es2015/maskedtextbox/maskedtextbox.component.js +45 -41
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rangeslider/rangeslider.component.js +9 -5
- package/dist/es2015/textarea/textarea-suffix.component.d.ts +1 -2
- package/dist/es2015/textarea/textarea-suffix.component.js +2 -4
- package/dist/es2015/textbox/textbox-suffix.directive.d.ts +0 -1
- package/dist/es2015/textbox/textbox-suffix.directive.js +0 -1
- package/dist/fesm2015/index.js +56 -51
- package/dist/fesm5/index.js +58 -52
- package/dist/npm/maskedtextbox/maskedtextbox.component.js +48 -44
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rangeslider/rangeslider.component.js +9 -5
- package/dist/npm/textarea/textarea-suffix.component.js +1 -2
- package/dist/npm/textbox/textbox-suffix.directive.js +0 -1
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, ElementRef, EventEmitter, HostBinding, HostListener, Inject, Input, Optional, Output, Renderer2, ViewChild, forwardRef, NgZone, Injector, isDevMode, ChangeDetectorRef } from '@angular/core';
|
|
7
7
|
import { NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
8
|
+
import { guid, hasObservers, isChanged, KendoInput } from '@progress/kendo-angular-common';
|
|
8
9
|
import { RTL } from '@progress/kendo-angular-l10n';
|
|
9
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
11
|
import { packageMetadata } from '../package-metadata';
|
|
11
12
|
import { MaskingService } from './masking.service';
|
|
12
|
-
import { isChanged, anyChanged, guid, hasObservers, KendoInput } from '@progress/kendo-angular-common';
|
|
13
13
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
14
14
|
import { requiresZoneOnBlur, isPresent, getStylingClasses } from '../common/utils';
|
|
15
15
|
var resolvedPromise = Promise.resolve(null);
|
|
@@ -57,7 +57,6 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
57
57
|
* Determines whether the MaskedTextBox is in its read-only state ([see example]({% slug readonly_maskedtextbox %})).
|
|
58
58
|
*/
|
|
59
59
|
this.readonly = false;
|
|
60
|
-
this.hostClasses = true;
|
|
61
60
|
/**
|
|
62
61
|
* Represents a prompt character for the masked value.
|
|
63
62
|
* @default `_`
|
|
@@ -133,6 +132,7 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
133
132
|
* Fires each time the value changes.
|
|
134
133
|
*/
|
|
135
134
|
this.valueChange = new EventEmitter();
|
|
135
|
+
this.hostClasses = true;
|
|
136
136
|
this.focusClick = false;
|
|
137
137
|
this.defaultRules = {
|
|
138
138
|
"#": /[\d\s\+\-]/,
|
|
@@ -263,20 +263,13 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
263
263
|
enumerable: true,
|
|
264
264
|
configurable: true
|
|
265
265
|
});
|
|
266
|
-
Object.defineProperty(MaskedTextBoxComponent.prototype, "
|
|
266
|
+
Object.defineProperty(MaskedTextBoxComponent.prototype, "rules", {
|
|
267
267
|
get: function () {
|
|
268
|
-
return this.
|
|
268
|
+
return this._rules || this.defaultRules;
|
|
269
269
|
},
|
|
270
|
-
enumerable: true,
|
|
271
|
-
configurable: true
|
|
272
|
-
});
|
|
273
|
-
Object.defineProperty(MaskedTextBoxComponent.prototype, "rules", {
|
|
274
270
|
/**
|
|
275
271
|
* Exposes the RegExp-based mask validation array ([see example]({% slug masks_maskedtextbox %})).
|
|
276
272
|
*/
|
|
277
|
-
get: function () {
|
|
278
|
-
return this._rules || this.defaultRules;
|
|
279
|
-
},
|
|
280
273
|
set: function (value) {
|
|
281
274
|
this._rules = Object.assign({}, this.defaultRules, value);
|
|
282
275
|
},
|
|
@@ -296,6 +289,13 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
296
289
|
enumerable: true,
|
|
297
290
|
configurable: true
|
|
298
291
|
});
|
|
292
|
+
Object.defineProperty(MaskedTextBoxComponent.prototype, "hostDisabledClass", {
|
|
293
|
+
get: function () {
|
|
294
|
+
return this.disabled;
|
|
295
|
+
},
|
|
296
|
+
enumerable: true,
|
|
297
|
+
configurable: true
|
|
298
|
+
});
|
|
299
299
|
MaskedTextBoxComponent.prototype.ngOnInit = function () {
|
|
300
300
|
if (this.hostElement) {
|
|
301
301
|
this.renderer.removeAttribute(this.hostElement.nativeElement, "tabindex");
|
|
@@ -373,7 +373,7 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
373
373
|
var value = e.target.value;
|
|
374
374
|
var _a = this.selection, start = _a[0], end = _a[1];
|
|
375
375
|
if (!this.mask) {
|
|
376
|
-
this.
|
|
376
|
+
this.updateValueWithEvents(value);
|
|
377
377
|
this.isPasted = false;
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
@@ -385,10 +385,10 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
385
385
|
result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
|
|
386
386
|
}
|
|
387
387
|
else {
|
|
388
|
-
result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
|
|
388
|
+
result = this.service.maskInput(value, this.maskedValue || '', e.target.selectionStart);
|
|
389
389
|
}
|
|
390
390
|
this.updateInput(result.value, result.selection);
|
|
391
|
-
this.
|
|
391
|
+
this.updateValueWithEvents(result.value);
|
|
392
392
|
};
|
|
393
393
|
/**
|
|
394
394
|
* @hidden
|
|
@@ -404,20 +404,13 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
404
404
|
}
|
|
405
405
|
var next = this.extractChanges(changes);
|
|
406
406
|
this.updateService(next);
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
this.updateInput(maskedValue);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
else if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
407
|
+
var maskedValue = this.service.maskRaw(this.value);
|
|
408
|
+
this.updateInput(maskedValue, null, true);
|
|
409
|
+
if (changes.includeLiterals || isChanged('promptPlaceholder', changes)) {
|
|
414
410
|
resolvedPromise.then(function () {
|
|
415
|
-
_this.
|
|
411
|
+
_this.updateValueWithEvents(_this.maskedValue);
|
|
416
412
|
});
|
|
417
413
|
}
|
|
418
|
-
else {
|
|
419
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
420
|
-
}
|
|
421
414
|
};
|
|
422
415
|
/**
|
|
423
416
|
* @hidden
|
|
@@ -426,6 +419,9 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
426
419
|
MaskedTextBoxComponent.prototype.writeValue = function (value) {
|
|
427
420
|
this.value = this.normalizeValue(value);
|
|
428
421
|
this.updateInput(this.service.maskRaw(this.value));
|
|
422
|
+
if (this.includeLiterals) {
|
|
423
|
+
this.updateValue(this.maskedValue);
|
|
424
|
+
}
|
|
429
425
|
};
|
|
430
426
|
/**
|
|
431
427
|
* @hidden
|
|
@@ -476,18 +472,26 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
476
472
|
/**
|
|
477
473
|
* @hidden
|
|
478
474
|
*/
|
|
479
|
-
MaskedTextBoxComponent.prototype.
|
|
480
|
-
|
|
475
|
+
MaskedTextBoxComponent.prototype.updateValueWithEvents = function (maskedValue) {
|
|
476
|
+
this.updateValue(maskedValue);
|
|
477
|
+
if (hasObservers(this.valueChange)) {
|
|
478
|
+
this.valueChange.emit(this.value);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
MaskedTextBoxComponent.prototype.updateValue = function (value) {
|
|
482
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
481
483
|
this.value = '';
|
|
482
484
|
}
|
|
483
485
|
else {
|
|
484
|
-
this.value = this.service.rawValue(
|
|
486
|
+
this.value = this.service.rawValue(value);
|
|
485
487
|
}
|
|
486
488
|
this.onChange(this.value);
|
|
487
|
-
this.valueChange.emit(this.value);
|
|
488
489
|
};
|
|
489
|
-
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
|
|
490
|
+
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection, isFromOnChanges) {
|
|
490
491
|
if (maskedValue === void 0) { maskedValue = ''; }
|
|
492
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
491
495
|
this.maskedValue = maskedValue;
|
|
492
496
|
var value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
493
497
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
|
@@ -605,20 +609,6 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
605
609
|
tslib_1.__metadata("design:type", String),
|
|
606
610
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
607
611
|
], MaskedTextBoxComponent.prototype, "fillMode", null);
|
|
608
|
-
tslib_1.__decorate([
|
|
609
|
-
HostBinding('attr.dir'),
|
|
610
|
-
tslib_1.__metadata("design:type", String)
|
|
611
|
-
], MaskedTextBoxComponent.prototype, "direction", void 0);
|
|
612
|
-
tslib_1.__decorate([
|
|
613
|
-
HostBinding('class.k-input'),
|
|
614
|
-
HostBinding('class.k-maskedtextbox'),
|
|
615
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
616
|
-
], MaskedTextBoxComponent.prototype, "hostClasses", void 0);
|
|
617
|
-
tslib_1.__decorate([
|
|
618
|
-
HostBinding('class.k-disabled'),
|
|
619
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
620
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
621
|
-
], MaskedTextBoxComponent.prototype, "hostDisabledClass", null);
|
|
622
612
|
tslib_1.__decorate([
|
|
623
613
|
Input(),
|
|
624
614
|
tslib_1.__metadata("design:type", String)
|
|
@@ -673,6 +663,20 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
673
663
|
Output(),
|
|
674
664
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
675
665
|
], MaskedTextBoxComponent.prototype, "valueChange", void 0);
|
|
666
|
+
tslib_1.__decorate([
|
|
667
|
+
HostBinding('attr.dir'),
|
|
668
|
+
tslib_1.__metadata("design:type", String)
|
|
669
|
+
], MaskedTextBoxComponent.prototype, "direction", void 0);
|
|
670
|
+
tslib_1.__decorate([
|
|
671
|
+
HostBinding('class.k-input'),
|
|
672
|
+
HostBinding('class.k-maskedtextbox'),
|
|
673
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
674
|
+
], MaskedTextBoxComponent.prototype, "hostClasses", void 0);
|
|
675
|
+
tslib_1.__decorate([
|
|
676
|
+
HostBinding('class.k-disabled'),
|
|
677
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
678
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
679
|
+
], MaskedTextBoxComponent.prototype, "hostDisabledClass", null);
|
|
676
680
|
tslib_1.__decorate([
|
|
677
681
|
ViewChild('input', { static: true }),
|
|
678
682
|
tslib_1.__metadata("design:type", ElementRef)
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-inputs',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1648211916,
|
|
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
|
};
|
|
@@ -226,9 +226,13 @@ var RangeSliderComponent = /** @class */ (function (_super) {
|
|
|
226
226
|
var lastCoords = this.draggedHandle.getBoundingClientRect();
|
|
227
227
|
this.lastHandlePosition = { x: lastCoords.left, y: lastCoords.top };
|
|
228
228
|
this.dragging = { value: true, target: target };
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
var mousePos = {
|
|
230
|
+
x: (args.pageX - 0.5) - (lastCoords.width / 2),
|
|
231
|
+
y: (args.pageY - (lastCoords.width / 2))
|
|
232
|
+
};
|
|
233
|
+
var left = mousePos.x < this.lastHandlePosition.x;
|
|
234
|
+
var right = mousePos.x > this.lastHandlePosition.x;
|
|
235
|
+
var up = mousePos.y > this.lastHandlePosition.y;
|
|
232
236
|
var moveStartHandle = function () { return _this.changeValue([eventValue(args, _this.track.nativeElement, _this.getProps()), _this.value[1]]); };
|
|
233
237
|
var moveEndHandle = function () { return _this.changeValue([_this.value[0], eventValue(args, _this.track.nativeElement, _this.getProps())]); };
|
|
234
238
|
var moveBothHandles = function () { return _this.changeValue([eventValue(args, _this.track.nativeElement, _this.getProps()), eventValue(args, _this.track.nativeElement, _this.getProps())]); };
|
|
@@ -236,8 +240,8 @@ var RangeSliderComponent = /** @class */ (function (_super) {
|
|
|
236
240
|
var vertical = this.vertical;
|
|
237
241
|
var horizontal = !vertical;
|
|
238
242
|
var forward = (vertical && up) || (this.reverse ? horizontal && right : horizontal && left);
|
|
239
|
-
|
|
240
|
-
if (this.value[0] === this.value[1]) {
|
|
243
|
+
var incorrectValueState = this.value[0] > this.value[1];
|
|
244
|
+
if (this.value[0] === this.value[1] || incorrectValueState) {
|
|
241
245
|
if (forward) {
|
|
242
246
|
activeStartHandle ? moveStartHandle() : moveBothHandles();
|
|
243
247
|
}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, HostBinding } from '@angular/core';
|
|
7
7
|
/**
|
|
8
|
-
* Specifies the adornments in the suffix container ([see example]({% slug textarea_adornments %}).
|
|
9
|
-
* @example
|
|
8
|
+
* Specifies the adornments in the suffix container ([see example]({% slug textarea_adornments %})).
|
|
10
9
|
* ```ts-no-run
|
|
11
10
|
* _@Component({
|
|
12
11
|
* selector: 'my-app',
|
|
@@ -6,7 +6,6 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
import { Directive, Optional, TemplateRef } from '@angular/core';
|
|
7
7
|
/**
|
|
8
8
|
* Specifies the adornments in the suffix container ([see examples]({% slug adornments_textbox %}#toc-suffixadornments)).
|
|
9
|
-
* @example
|
|
10
9
|
* ```ts-no-run
|
|
11
10
|
* _@Component({
|
|
12
11
|
* selector: 'my-app',
|