@progress/kendo-angular-inputs 8.0.9-dev.202203220940 → 8.0.9-dev.202203231216
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 +21 -23
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/maskedtextbox/maskedtextbox.component.js +21 -23
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +22 -23
- package/dist/fesm5/index.js +22 -23
- package/dist/npm/maskedtextbox/maskedtextbox.component.js +20 -22
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-inputs.js +1 -1
- package/package.json +1 -1
|
@@ -5,14 +5,14 @@
|
|
|
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 {
|
|
9
|
-
import { anyChanged, guid, hasObservers, KendoInput } from '@progress/kendo-angular-common';
|
|
8
|
+
import { guid, hasObservers, isChanged, KendoInput } from '@progress/kendo-angular-common';
|
|
10
9
|
import { RTL } from '@progress/kendo-angular-l10n';
|
|
11
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
11
|
import { packageMetadata } from '../package-metadata';
|
|
13
12
|
import { MaskingService } from './masking.service';
|
|
14
13
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
15
14
|
import { requiresZoneOnBlur, isPresent, getStylingClasses } from '../common/utils';
|
|
15
|
+
var resolvedPromise = Promise.resolve(null);
|
|
16
16
|
var FOCUSED = 'k-focus';
|
|
17
17
|
/**
|
|
18
18
|
* Represents the [Kendo UI MaskedTextBox component for Angular]({% slug overview_maskedtextbox %}).
|
|
@@ -385,7 +385,7 @@ 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
391
|
this.updateValueWithEvents(result.value);
|
|
@@ -395,32 +395,22 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
395
395
|
*/
|
|
396
396
|
MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) {
|
|
397
397
|
var _this = this;
|
|
398
|
+
if (changes.value) {
|
|
399
|
+
this.value = this.normalizeValue();
|
|
400
|
+
}
|
|
398
401
|
if (!this.mask) {
|
|
399
|
-
if (changes.value) {
|
|
400
|
-
this.value = this.normalizeValue();
|
|
401
|
-
}
|
|
402
402
|
this.updateInput(this.value);
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
405
405
|
var next = this.extractChanges(changes);
|
|
406
406
|
this.updateService(next);
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
this.updateInput(maskedValue);
|
|
412
|
-
}
|
|
413
|
-
if (this.includeLiterals) {
|
|
414
|
-
this.updateValue(this.maskedValue);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
418
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(function () {
|
|
407
|
+
var maskedValue = this.service.maskRaw(this.value);
|
|
408
|
+
this.updateInput(maskedValue, null, true);
|
|
409
|
+
if (changes.includeLiterals || isChanged('promptPlaceholder', changes)) {
|
|
410
|
+
resolvedPromise.then(function () {
|
|
419
411
|
_this.updateValueWithEvents(_this.maskedValue);
|
|
420
412
|
});
|
|
421
|
-
return;
|
|
422
413
|
}
|
|
423
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
424
414
|
};
|
|
425
415
|
/**
|
|
426
416
|
* @hidden
|
|
@@ -429,6 +419,9 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
429
419
|
MaskedTextBoxComponent.prototype.writeValue = function (value) {
|
|
430
420
|
this.value = this.normalizeValue(value);
|
|
431
421
|
this.updateInput(this.service.maskRaw(this.value));
|
|
422
|
+
if (this.includeLiterals) {
|
|
423
|
+
this.updateValue(this.maskedValue);
|
|
424
|
+
}
|
|
432
425
|
};
|
|
433
426
|
/**
|
|
434
427
|
* @hidden
|
|
@@ -481,10 +474,12 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
481
474
|
*/
|
|
482
475
|
MaskedTextBoxComponent.prototype.updateValueWithEvents = function (maskedValue) {
|
|
483
476
|
this.updateValue(maskedValue);
|
|
484
|
-
this.valueChange
|
|
477
|
+
if (hasObservers(this.valueChange)) {
|
|
478
|
+
this.valueChange.emit(this.value);
|
|
479
|
+
}
|
|
485
480
|
};
|
|
486
481
|
MaskedTextBoxComponent.prototype.updateValue = function (value) {
|
|
487
|
-
if (this.mask && !this.service.validationValue(value)) {
|
|
482
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
488
483
|
this.value = '';
|
|
489
484
|
}
|
|
490
485
|
else {
|
|
@@ -492,8 +487,11 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
492
487
|
}
|
|
493
488
|
this.onChange(this.value);
|
|
494
489
|
};
|
|
495
|
-
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
|
|
490
|
+
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection, isFromOnChanges) {
|
|
496
491
|
if (maskedValue === void 0) { maskedValue = ''; }
|
|
492
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
497
495
|
this.maskedValue = maskedValue;
|
|
498
496
|
var value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
499
497
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
|
@@ -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: 1648037581,
|
|
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
|
};
|
|
@@ -6,14 +6,14 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
var MaskedTextBoxComponent_1;
|
|
7
7
|
import { Component, ElementRef, EventEmitter, HostBinding, HostListener, Inject, Input, Optional, Output, Renderer2, ViewChild, forwardRef, NgZone, Injector, isDevMode, ChangeDetectorRef } from '@angular/core';
|
|
8
8
|
import { NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
9
|
-
import {
|
|
10
|
-
import { anyChanged, guid, hasObservers, KendoInput } from '@progress/kendo-angular-common';
|
|
9
|
+
import { guid, hasObservers, isChanged, KendoInput } from '@progress/kendo-angular-common';
|
|
11
10
|
import { RTL } from '@progress/kendo-angular-l10n';
|
|
12
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
12
|
import { packageMetadata } from '../package-metadata';
|
|
14
13
|
import { MaskingService } from './masking.service';
|
|
15
14
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
16
15
|
import { requiresZoneOnBlur, isPresent, getStylingClasses } from '../common/utils';
|
|
16
|
+
const resolvedPromise = Promise.resolve(null);
|
|
17
17
|
const FOCUSED = 'k-focus';
|
|
18
18
|
/**
|
|
19
19
|
* Represents the [Kendo UI MaskedTextBox component for Angular]({% slug overview_maskedtextbox %}).
|
|
@@ -359,7 +359,7 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
359
359
|
result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
|
|
360
360
|
}
|
|
361
361
|
else {
|
|
362
|
-
result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
|
|
362
|
+
result = this.service.maskInput(value, this.maskedValue || '', e.target.selectionStart);
|
|
363
363
|
}
|
|
364
364
|
this.updateInput(result.value, result.selection);
|
|
365
365
|
this.updateValueWithEvents(result.value);
|
|
@@ -368,32 +368,22 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
368
368
|
* @hidden
|
|
369
369
|
*/
|
|
370
370
|
ngOnChanges(changes) {
|
|
371
|
+
if (changes.value) {
|
|
372
|
+
this.value = this.normalizeValue();
|
|
373
|
+
}
|
|
371
374
|
if (!this.mask) {
|
|
372
|
-
if (changes.value) {
|
|
373
|
-
this.value = this.normalizeValue();
|
|
374
|
-
}
|
|
375
375
|
this.updateInput(this.value);
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
378
|
const next = this.extractChanges(changes);
|
|
379
379
|
this.updateService(next);
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
this.updateInput(maskedValue);
|
|
385
|
-
}
|
|
386
|
-
if (this.includeLiterals) {
|
|
387
|
-
this.updateValue(this.maskedValue);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
391
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
380
|
+
const maskedValue = this.service.maskRaw(this.value);
|
|
381
|
+
this.updateInput(maskedValue, null, true);
|
|
382
|
+
if (changes.includeLiterals || isChanged('promptPlaceholder', changes)) {
|
|
383
|
+
resolvedPromise.then(() => {
|
|
392
384
|
this.updateValueWithEvents(this.maskedValue);
|
|
393
385
|
});
|
|
394
|
-
return;
|
|
395
386
|
}
|
|
396
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
397
387
|
}
|
|
398
388
|
/**
|
|
399
389
|
* @hidden
|
|
@@ -402,6 +392,9 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
402
392
|
writeValue(value) {
|
|
403
393
|
this.value = this.normalizeValue(value);
|
|
404
394
|
this.updateInput(this.service.maskRaw(this.value));
|
|
395
|
+
if (this.includeLiterals) {
|
|
396
|
+
this.updateValue(this.maskedValue);
|
|
397
|
+
}
|
|
405
398
|
}
|
|
406
399
|
/**
|
|
407
400
|
* @hidden
|
|
@@ -454,10 +447,12 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
454
447
|
*/
|
|
455
448
|
updateValueWithEvents(maskedValue) {
|
|
456
449
|
this.updateValue(maskedValue);
|
|
457
|
-
this.valueChange
|
|
450
|
+
if (hasObservers(this.valueChange)) {
|
|
451
|
+
this.valueChange.emit(this.value);
|
|
452
|
+
}
|
|
458
453
|
}
|
|
459
454
|
updateValue(value) {
|
|
460
|
-
if (this.mask && !this.service.validationValue(value)) {
|
|
455
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
461
456
|
this.value = '';
|
|
462
457
|
}
|
|
463
458
|
else {
|
|
@@ -465,7 +460,10 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
465
460
|
}
|
|
466
461
|
this.onChange(this.value);
|
|
467
462
|
}
|
|
468
|
-
updateInput(maskedValue = '', selection) {
|
|
463
|
+
updateInput(maskedValue = '', selection, isFromOnChanges) {
|
|
464
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
469
467
|
this.maskedValue = maskedValue;
|
|
470
468
|
const value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
471
469
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-inputs',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1648037581,
|
|
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
|
};
|
package/dist/fesm2015/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, RadioControlValueAccessor
|
|
|
8
8
|
import { Subscription, fromEvent, interval, merge, BehaviorSubject, Subject } from 'rxjs';
|
|
9
9
|
import { take, filter, concatMap, startWith, takeUntil, skip, debounceTime, throttleTime } from 'rxjs/operators';
|
|
10
10
|
import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages, MessageService } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent,
|
|
11
|
+
import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, isChanged, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent, closest } from '@progress/kendo-angular-common';
|
|
12
12
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
13
|
import { browser, mobileOS, detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
|
|
14
14
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
@@ -481,7 +481,7 @@ const packageMetadata = {
|
|
|
481
481
|
name: '@progress/kendo-angular-inputs',
|
|
482
482
|
productName: 'Kendo UI for Angular',
|
|
483
483
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
484
|
-
publishDate:
|
|
484
|
+
publishDate: 1648037581,
|
|
485
485
|
version: '',
|
|
486
486
|
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'
|
|
487
487
|
};
|
|
@@ -4380,6 +4380,7 @@ MaskingService = __decorate([
|
|
|
4380
4380
|
], MaskingService);
|
|
4381
4381
|
|
|
4382
4382
|
var MaskedTextBoxComponent_1;
|
|
4383
|
+
const resolvedPromise = Promise.resolve(null);
|
|
4383
4384
|
const FOCUSED$2 = 'k-focus';
|
|
4384
4385
|
/**
|
|
4385
4386
|
* Represents the [Kendo UI MaskedTextBox component for Angular]({% slug overview_maskedtextbox %}).
|
|
@@ -4725,7 +4726,7 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
4725
4726
|
result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
|
|
4726
4727
|
}
|
|
4727
4728
|
else {
|
|
4728
|
-
result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
|
|
4729
|
+
result = this.service.maskInput(value, this.maskedValue || '', e.target.selectionStart);
|
|
4729
4730
|
}
|
|
4730
4731
|
this.updateInput(result.value, result.selection);
|
|
4731
4732
|
this.updateValueWithEvents(result.value);
|
|
@@ -4734,32 +4735,22 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
4734
4735
|
* @hidden
|
|
4735
4736
|
*/
|
|
4736
4737
|
ngOnChanges(changes) {
|
|
4738
|
+
if (changes.value) {
|
|
4739
|
+
this.value = this.normalizeValue();
|
|
4740
|
+
}
|
|
4737
4741
|
if (!this.mask) {
|
|
4738
|
-
if (changes.value) {
|
|
4739
|
-
this.value = this.normalizeValue();
|
|
4740
|
-
}
|
|
4741
4742
|
this.updateInput(this.value);
|
|
4742
4743
|
return;
|
|
4743
4744
|
}
|
|
4744
4745
|
const next = this.extractChanges(changes);
|
|
4745
4746
|
this.updateService(next);
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
this.updateInput(maskedValue);
|
|
4751
|
-
}
|
|
4752
|
-
if (this.includeLiterals) {
|
|
4753
|
-
this.updateValue(this.maskedValue);
|
|
4754
|
-
}
|
|
4755
|
-
}
|
|
4756
|
-
if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
4757
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
4747
|
+
const maskedValue = this.service.maskRaw(this.value);
|
|
4748
|
+
this.updateInput(maskedValue, null, true);
|
|
4749
|
+
if (changes.includeLiterals || isChanged('promptPlaceholder', changes)) {
|
|
4750
|
+
resolvedPromise.then(() => {
|
|
4758
4751
|
this.updateValueWithEvents(this.maskedValue);
|
|
4759
4752
|
});
|
|
4760
|
-
return;
|
|
4761
4753
|
}
|
|
4762
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
4763
4754
|
}
|
|
4764
4755
|
/**
|
|
4765
4756
|
* @hidden
|
|
@@ -4768,6 +4759,9 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
4768
4759
|
writeValue(value) {
|
|
4769
4760
|
this.value = this.normalizeValue(value);
|
|
4770
4761
|
this.updateInput(this.service.maskRaw(this.value));
|
|
4762
|
+
if (this.includeLiterals) {
|
|
4763
|
+
this.updateValue(this.maskedValue);
|
|
4764
|
+
}
|
|
4771
4765
|
}
|
|
4772
4766
|
/**
|
|
4773
4767
|
* @hidden
|
|
@@ -4820,10 +4814,12 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
4820
4814
|
*/
|
|
4821
4815
|
updateValueWithEvents(maskedValue) {
|
|
4822
4816
|
this.updateValue(maskedValue);
|
|
4823
|
-
this.valueChange
|
|
4817
|
+
if (hasObservers(this.valueChange)) {
|
|
4818
|
+
this.valueChange.emit(this.value);
|
|
4819
|
+
}
|
|
4824
4820
|
}
|
|
4825
4821
|
updateValue(value) {
|
|
4826
|
-
if (this.mask && !this.service.validationValue(value)) {
|
|
4822
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
4827
4823
|
this.value = '';
|
|
4828
4824
|
}
|
|
4829
4825
|
else {
|
|
@@ -4831,7 +4827,10 @@ let MaskedTextBoxComponent = MaskedTextBoxComponent_1 = class MaskedTextBoxCompo
|
|
|
4831
4827
|
}
|
|
4832
4828
|
this.onChange(this.value);
|
|
4833
4829
|
}
|
|
4834
|
-
updateInput(maskedValue = '', selection) {
|
|
4830
|
+
updateInput(maskedValue = '', selection, isFromOnChanges) {
|
|
4831
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
4832
|
+
return;
|
|
4833
|
+
}
|
|
4835
4834
|
this.maskedValue = maskedValue;
|
|
4836
4835
|
const value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
4837
4836
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
package/dist/fesm5/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, RadioControlValueAccessor
|
|
|
8
8
|
import { Subscription, fromEvent, interval, merge, BehaviorSubject, Subject } from 'rxjs';
|
|
9
9
|
import { take, filter, concatMap, startWith, takeUntil, skip, debounceTime, throttleTime } from 'rxjs/operators';
|
|
10
10
|
import { LocalizationService, L10N_PREFIX, RTL, ComponentMessages, MessageService } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent,
|
|
11
|
+
import { Keys, guid, hasObservers, anyChanged, isDocumentAvailable, KendoInput, isChanged, DraggableModule, EventsModule, ResizeSensorModule, PreventableEvent, closest } from '@progress/kendo-angular-common';
|
|
12
12
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
13
|
import { browser, mobileOS, detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
|
|
14
14
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
@@ -514,7 +514,7 @@ var packageMetadata = {
|
|
|
514
514
|
name: '@progress/kendo-angular-inputs',
|
|
515
515
|
productName: 'Kendo UI for Angular',
|
|
516
516
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
517
|
-
publishDate:
|
|
517
|
+
publishDate: 1648037581,
|
|
518
518
|
version: '',
|
|
519
519
|
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'
|
|
520
520
|
};
|
|
@@ -4473,6 +4473,7 @@ var MaskingService = /** @class */ (function () {
|
|
|
4473
4473
|
return MaskingService;
|
|
4474
4474
|
}());
|
|
4475
4475
|
|
|
4476
|
+
var resolvedPromise = Promise.resolve(null);
|
|
4476
4477
|
var FOCUSED$2 = 'k-focus';
|
|
4477
4478
|
/**
|
|
4478
4479
|
* Represents the [Kendo UI MaskedTextBox component for Angular]({% slug overview_maskedtextbox %}).
|
|
@@ -4845,7 +4846,7 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
4845
4846
|
result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
|
|
4846
4847
|
}
|
|
4847
4848
|
else {
|
|
4848
|
-
result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
|
|
4849
|
+
result = this.service.maskInput(value, this.maskedValue || '', e.target.selectionStart);
|
|
4849
4850
|
}
|
|
4850
4851
|
this.updateInput(result.value, result.selection);
|
|
4851
4852
|
this.updateValueWithEvents(result.value);
|
|
@@ -4855,32 +4856,22 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
4855
4856
|
*/
|
|
4856
4857
|
MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) {
|
|
4857
4858
|
var _this = this;
|
|
4859
|
+
if (changes.value) {
|
|
4860
|
+
this.value = this.normalizeValue();
|
|
4861
|
+
}
|
|
4858
4862
|
if (!this.mask) {
|
|
4859
|
-
if (changes.value) {
|
|
4860
|
-
this.value = this.normalizeValue();
|
|
4861
|
-
}
|
|
4862
4863
|
this.updateInput(this.value);
|
|
4863
4864
|
return;
|
|
4864
4865
|
}
|
|
4865
4866
|
var next = this.extractChanges(changes);
|
|
4866
4867
|
this.updateService(next);
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
this.updateInput(maskedValue);
|
|
4872
|
-
}
|
|
4873
|
-
if (this.includeLiterals) {
|
|
4874
|
-
this.updateValue(this.maskedValue);
|
|
4875
|
-
}
|
|
4876
|
-
}
|
|
4877
|
-
if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
4878
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(function () {
|
|
4868
|
+
var maskedValue = this.service.maskRaw(this.value);
|
|
4869
|
+
this.updateInput(maskedValue, null, true);
|
|
4870
|
+
if (changes.includeLiterals || isChanged('promptPlaceholder', changes)) {
|
|
4871
|
+
resolvedPromise.then(function () {
|
|
4879
4872
|
_this.updateValueWithEvents(_this.maskedValue);
|
|
4880
4873
|
});
|
|
4881
|
-
return;
|
|
4882
4874
|
}
|
|
4883
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
4884
4875
|
};
|
|
4885
4876
|
/**
|
|
4886
4877
|
* @hidden
|
|
@@ -4889,6 +4880,9 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
4889
4880
|
MaskedTextBoxComponent.prototype.writeValue = function (value) {
|
|
4890
4881
|
this.value = this.normalizeValue(value);
|
|
4891
4882
|
this.updateInput(this.service.maskRaw(this.value));
|
|
4883
|
+
if (this.includeLiterals) {
|
|
4884
|
+
this.updateValue(this.maskedValue);
|
|
4885
|
+
}
|
|
4892
4886
|
};
|
|
4893
4887
|
/**
|
|
4894
4888
|
* @hidden
|
|
@@ -4941,10 +4935,12 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
4941
4935
|
*/
|
|
4942
4936
|
MaskedTextBoxComponent.prototype.updateValueWithEvents = function (maskedValue) {
|
|
4943
4937
|
this.updateValue(maskedValue);
|
|
4944
|
-
this.valueChange
|
|
4938
|
+
if (hasObservers(this.valueChange)) {
|
|
4939
|
+
this.valueChange.emit(this.value);
|
|
4940
|
+
}
|
|
4945
4941
|
};
|
|
4946
4942
|
MaskedTextBoxComponent.prototype.updateValue = function (value) {
|
|
4947
|
-
if (this.mask && !this.service.validationValue(value)) {
|
|
4943
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
4948
4944
|
this.value = '';
|
|
4949
4945
|
}
|
|
4950
4946
|
else {
|
|
@@ -4952,8 +4948,11 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
4952
4948
|
}
|
|
4953
4949
|
this.onChange(this.value);
|
|
4954
4950
|
};
|
|
4955
|
-
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
|
|
4951
|
+
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection, isFromOnChanges) {
|
|
4956
4952
|
if (maskedValue === void 0) { maskedValue = ''; }
|
|
4953
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
4954
|
+
return;
|
|
4955
|
+
}
|
|
4957
4956
|
this.maskedValue = maskedValue;
|
|
4958
4957
|
var value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
4959
4958
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
9
|
var forms_1 = require("@angular/forms");
|
|
10
|
-
var operators_1 = require("rxjs/operators");
|
|
11
10
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
12
11
|
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
13
12
|
var kendo_licensing_1 = require("@progress/kendo-licensing");
|
|
@@ -15,6 +14,7 @@ var package_metadata_1 = require("../package-metadata");
|
|
|
15
14
|
var masking_service_1 = require("./masking.service");
|
|
16
15
|
var dom_utils_1 = require("../common/dom-utils");
|
|
17
16
|
var utils_1 = require("../common/utils");
|
|
17
|
+
var resolvedPromise = Promise.resolve(null);
|
|
18
18
|
var FOCUSED = 'k-focus';
|
|
19
19
|
/**
|
|
20
20
|
* Represents the [Kendo UI MaskedTextBox component for Angular]({% slug overview_maskedtextbox %}).
|
|
@@ -387,7 +387,7 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
387
387
|
result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end);
|
|
388
388
|
}
|
|
389
389
|
else {
|
|
390
|
-
result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
|
|
390
|
+
result = this.service.maskInput(value, this.maskedValue || '', e.target.selectionStart);
|
|
391
391
|
}
|
|
392
392
|
this.updateInput(result.value, result.selection);
|
|
393
393
|
this.updateValueWithEvents(result.value);
|
|
@@ -397,32 +397,22 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
397
397
|
*/
|
|
398
398
|
MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) {
|
|
399
399
|
var _this = this;
|
|
400
|
+
if (changes.value) {
|
|
401
|
+
this.value = this.normalizeValue();
|
|
402
|
+
}
|
|
400
403
|
if (!this.mask) {
|
|
401
|
-
if (changes.value) {
|
|
402
|
-
this.value = this.normalizeValue();
|
|
403
|
-
}
|
|
404
404
|
this.updateInput(this.value);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
var next = this.extractChanges(changes);
|
|
408
408
|
this.updateService(next);
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
this.updateInput(maskedValue);
|
|
414
|
-
}
|
|
415
|
-
if (this.includeLiterals) {
|
|
416
|
-
this.updateValue(this.maskedValue);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
if (kendo_angular_common_1.anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
|
|
420
|
-
this.ngZone.onStable.pipe(operators_1.take(1)).subscribe(function () {
|
|
409
|
+
var maskedValue = this.service.maskRaw(this.value);
|
|
410
|
+
this.updateInput(maskedValue, null, true);
|
|
411
|
+
if (changes.includeLiterals || kendo_angular_common_1.isChanged('promptPlaceholder', changes)) {
|
|
412
|
+
resolvedPromise.then(function () {
|
|
421
413
|
_this.updateValueWithEvents(_this.maskedValue);
|
|
422
414
|
});
|
|
423
|
-
return;
|
|
424
415
|
}
|
|
425
|
-
this.updateInput(this.service.maskRaw(this.value));
|
|
426
416
|
};
|
|
427
417
|
/**
|
|
428
418
|
* @hidden
|
|
@@ -431,6 +421,9 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
431
421
|
MaskedTextBoxComponent.prototype.writeValue = function (value) {
|
|
432
422
|
this.value = this.normalizeValue(value);
|
|
433
423
|
this.updateInput(this.service.maskRaw(this.value));
|
|
424
|
+
if (this.includeLiterals) {
|
|
425
|
+
this.updateValue(this.maskedValue);
|
|
426
|
+
}
|
|
434
427
|
};
|
|
435
428
|
/**
|
|
436
429
|
* @hidden
|
|
@@ -483,10 +476,12 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
483
476
|
*/
|
|
484
477
|
MaskedTextBoxComponent.prototype.updateValueWithEvents = function (maskedValue) {
|
|
485
478
|
this.updateValue(maskedValue);
|
|
486
|
-
|
|
479
|
+
if (kendo_angular_common_1.hasObservers(this.valueChange)) {
|
|
480
|
+
this.valueChange.emit(this.value);
|
|
481
|
+
}
|
|
487
482
|
};
|
|
488
483
|
MaskedTextBoxComponent.prototype.updateValue = function (value) {
|
|
489
|
-
if (this.mask && !this.service.validationValue(value)) {
|
|
484
|
+
if (this.mask && !this.service.validationValue(value) && !this.includeLiterals) {
|
|
490
485
|
this.value = '';
|
|
491
486
|
}
|
|
492
487
|
else {
|
|
@@ -494,8 +489,11 @@ var MaskedTextBoxComponent = /** @class */ (function () {
|
|
|
494
489
|
}
|
|
495
490
|
this.onChange(this.value);
|
|
496
491
|
};
|
|
497
|
-
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
|
|
492
|
+
MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection, isFromOnChanges) {
|
|
498
493
|
if (maskedValue === void 0) { maskedValue = ''; }
|
|
494
|
+
if (isFromOnChanges && maskedValue === this.maskedValue) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
499
497
|
this.maskedValue = maskedValue;
|
|
500
498
|
var value = this.maskOnFocus && !this.focused && this.emptyMask ? '' : maskedValue;
|
|
501
499
|
this.renderer.setProperty(this.input.nativeElement, "value", value);
|
|
@@ -11,7 +11,7 @@ exports.packageMetadata = {
|
|
|
11
11
|
name: '@progress/kendo-angular-inputs',
|
|
12
12
|
productName: 'Kendo UI for Angular',
|
|
13
13
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
14
|
-
publishDate:
|
|
14
|
+
publishDate: 1648037581,
|
|
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
|
};
|