@progress/kendo-angular-inputs 8.0.9-dev.202203171224 → 8.0.9-dev.202203220940

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.
@@ -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 { take } from 'rxjs/operators';
9
+ import { anyChanged, guid, hasObservers, KendoInput } from '@progress/kendo-angular-common';
8
10
  import { RTL } from '@progress/kendo-angular-l10n';
9
11
  import { validatePackage } from '@progress/kendo-licensing';
10
12
  import { packageMetadata } from '../package-metadata';
11
13
  import { MaskingService } from './masking.service';
12
- import { isChanged, anyChanged, guid, hasObservers, KendoInput } from '@progress/kendo-angular-common';
13
14
  import { invokeElementMethod } from '../common/dom-utils';
14
15
  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 %}).
@@ -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, "hostDisabledClass", {
266
+ Object.defineProperty(MaskedTextBoxComponent.prototype, "rules", {
267
267
  get: function () {
268
- return this.disabled;
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.updateValue(value);
376
+ this.updateValueWithEvents(value);
377
377
  this.isPasted = false;
378
378
  return;
379
379
  }
@@ -388,36 +388,39 @@ var MaskedTextBoxComponent = /** @class */ (function () {
388
388
  result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart);
389
389
  }
390
390
  this.updateInput(result.value, result.selection);
391
- this.updateValue(result.value);
391
+ this.updateValueWithEvents(result.value);
392
392
  };
393
393
  /**
394
394
  * @hidden
395
395
  */
396
396
  MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) {
397
397
  var _this = this;
398
- if (changes.value) {
399
- this.value = this.normalizeValue();
400
- }
401
398
  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
- if (isChanged('value', changes)) {
407
+ if (changes.value) {
408
+ this.value = this.normalizeValue();
408
409
  var maskedValue = this.service.maskRaw(this.value);
409
410
  if (maskedValue !== this.maskedValue) {
410
411
  this.updateInput(maskedValue);
411
412
  }
413
+ if (this.includeLiterals) {
414
+ this.updateValue(this.maskedValue);
415
+ }
412
416
  }
413
- else if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
414
- resolvedPromise.then(function () {
415
- _this.updateValue(_this.maskedValue);
417
+ if (anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) {
418
+ this.ngZone.onStable.pipe(take(1)).subscribe(function () {
419
+ _this.updateValueWithEvents(_this.maskedValue);
416
420
  });
421
+ return;
417
422
  }
418
- else {
419
- this.updateInput(this.service.maskRaw(this.value));
420
- }
423
+ this.updateInput(this.service.maskRaw(this.value));
421
424
  };
422
425
  /**
423
426
  * @hidden
@@ -476,15 +479,18 @@ var MaskedTextBoxComponent = /** @class */ (function () {
476
479
  /**
477
480
  * @hidden
478
481
  */
479
- MaskedTextBoxComponent.prototype.updateValue = function (maskedValue) {
480
- if (this.mask && !this.service.validationValue(maskedValue)) {
482
+ MaskedTextBoxComponent.prototype.updateValueWithEvents = function (maskedValue) {
483
+ this.updateValue(maskedValue);
484
+ this.valueChange.emit(this.value);
485
+ };
486
+ MaskedTextBoxComponent.prototype.updateValue = function (value) {
487
+ if (this.mask && !this.service.validationValue(value)) {
481
488
  this.value = '';
482
489
  }
483
490
  else {
484
- this.value = this.service.rawValue(maskedValue);
491
+ this.value = this.service.rawValue(value);
485
492
  }
486
493
  this.onChange(this.value);
487
- this.valueChange.emit(this.value);
488
494
  };
489
495
  MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) {
490
496
  if (maskedValue === void 0) { maskedValue = ''; }
@@ -605,20 +611,6 @@ var MaskedTextBoxComponent = /** @class */ (function () {
605
611
  tslib_1.__metadata("design:type", String),
606
612
  tslib_1.__metadata("design:paramtypes", [String])
607
613
  ], 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
614
  tslib_1.__decorate([
623
615
  Input(),
624
616
  tslib_1.__metadata("design:type", String)
@@ -673,6 +665,20 @@ var MaskedTextBoxComponent = /** @class */ (function () {
673
665
  Output(),
674
666
  tslib_1.__metadata("design:type", EventEmitter)
675
667
  ], MaskedTextBoxComponent.prototype, "valueChange", void 0);
668
+ tslib_1.__decorate([
669
+ HostBinding('attr.dir'),
670
+ tslib_1.__metadata("design:type", String)
671
+ ], MaskedTextBoxComponent.prototype, "direction", void 0);
672
+ tslib_1.__decorate([
673
+ HostBinding('class.k-input'),
674
+ HostBinding('class.k-maskedtextbox'),
675
+ tslib_1.__metadata("design:type", Boolean)
676
+ ], MaskedTextBoxComponent.prototype, "hostClasses", void 0);
677
+ tslib_1.__decorate([
678
+ HostBinding('class.k-disabled'),
679
+ tslib_1.__metadata("design:type", Boolean),
680
+ tslib_1.__metadata("design:paramtypes", [])
681
+ ], MaskedTextBoxComponent.prototype, "hostDisabledClass", null);
676
682
  tslib_1.__decorate([
677
683
  ViewChild('input', { static: true }),
678
684
  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: 1647519685,
12
+ publishDate: 1647941853,
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 left = args.pageX < this.lastHandlePosition.x;
230
- var right = args.pageX > this.lastHandlePosition.x;
231
- var up = args.pageY > this.lastHandlePosition.y;
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
- // const forward = (this.reverse ? (!this.vertical && !left) : (!this.vertical && left)) || (this.vertical && up);
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',