@quadrel-enterprise-ui/framework 21.12.19 → 21.12.20

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.
@@ -11505,10 +11505,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
11505
11505
  }], ctorParameters: () => [] });
11506
11506
 
11507
11507
  class QdFormKeyboardService {
11508
+ _destroyRef = inject(DestroyRef);
11508
11509
  _keyManager;
11509
11510
  _components = [];
11511
+ _changesSubscription;
11512
+ ngOnDestroy() {
11513
+ this._keyManager?.destroy();
11514
+ }
11510
11515
  init(components) {
11511
11516
  const setupKeyManager = () => {
11517
+ this._keyManager?.destroy();
11512
11518
  this._components = components.toArray();
11513
11519
  this._keyManager = new ActiveDescendantKeyManager(components)
11514
11520
  .withWrap()
@@ -11519,7 +11525,10 @@ class QdFormKeyboardService {
11519
11525
  };
11520
11526
  if (components.length)
11521
11527
  setupKeyManager();
11522
- components.changes.subscribe(() => setupKeyManager());
11528
+ this._changesSubscription?.unsubscribe();
11529
+ this._changesSubscription = components.changes
11530
+ .pipe(takeUntilDestroyed(this._destroyRef))
11531
+ .subscribe(() => setupKeyManager());
11523
11532
  }
11524
11533
  handleKeydown(event) {
11525
11534
  this._keyManager?.onKeydown(event);
@@ -11550,6 +11559,7 @@ class QdFormKeyboardService {
11550
11559
  }
11551
11560
  }
11552
11561
  reset() {
11562
+ this._keyManager?.destroy();
11553
11563
  this._keyManager = undefined;
11554
11564
  }
11555
11565
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormKeyboardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -15146,6 +15156,7 @@ class QdPinCodeComponent {
15146
15156
  blurCurrent;
15147
15157
  control;
15148
15158
  _inputs = [];
15159
+ _isSubscribedToInputChanges = false;
15149
15160
  _destroyRef = inject(DestroyRef);
15150
15161
  _onChange = () => { };
15151
15162
  _onTouch = () => { };
@@ -15291,7 +15302,10 @@ class QdPinCodeComponent {
15291
15302
  return config.previousValue?.codeLength !== config.currentValue?.codeLength;
15292
15303
  }
15293
15304
  handleCodeLengthChange() {
15294
- this.inputsList?.changes.subscribe(() => {
15305
+ if (!this.inputsList || this._isSubscribedToInputChanges)
15306
+ return;
15307
+ this._isSubscribedToInputChanges = true;
15308
+ this.inputsList.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
15295
15309
  this.control?.markAsPristine();
15296
15310
  this.emptyAll();
15297
15311
  this.pinCodeService.reset();