@tilde-nlp/ngx-common 8.1.55 → 8.1.56

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Input, ViewChild, Output, NgModule, Optional, Inject, Pipe, inject, Directive, HostListener, HostBinding, ViewChildren, input, effect, ElementRef, ContentChild, ContentChildren, InjectionToken, signal, output, computed, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, ViewChild, Output, NgModule, Optional, Inject, Pipe, inject, Directive, HostListener, HostBinding, ViewChildren, input, effect, ElementRef, ContentChild, ContentChildren, InjectionToken, signal, output, computed, ChangeDetectorRef, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
3
3
  import * as i2 from '@angular/material/icon';
4
4
  import { MatIconModule, MatIcon } from '@angular/material/icon';
5
5
  import * as i2$1 from '@angular/platform-browser';
@@ -9362,6 +9362,7 @@ class CookieConsentComponent {
9362
9362
  this.#analytics = inject(AnalyticsService);
9363
9363
  this.#translate = inject(TranslateService);
9364
9364
  this.#storage = inject(USER_CONFIG_STORAGE, { optional: true });
9365
+ this.#changeDetector = inject(ChangeDetectorRef);
9365
9366
  this.isClosed = false;
9366
9367
  this.isDetailsVisible = false;
9367
9368
  this.destroy = new Subject();
@@ -9369,6 +9370,7 @@ class CookieConsentComponent {
9369
9370
  #analytics;
9370
9371
  #translate;
9371
9372
  #storage;
9373
+ #changeDetector;
9372
9374
  ngOnInit() {
9373
9375
  this.injectConsentScript();
9374
9376
  this.resolveInitialConsentState();
@@ -9390,10 +9392,9 @@ class CookieConsentComponent {
9390
9392
  this.removeListeners();
9391
9393
  }
9392
9394
  autoFocus() {
9393
- setTimeout(() => {
9394
- const acceptButton = document.querySelector('.cookie-consent-actions button');
9395
- acceptButton?.focus();
9396
- }, 0);
9395
+ this.#changeDetector.detectChanges();
9396
+ const acceptButton = document.querySelector('.cookie-consent-actions button');
9397
+ acceptButton?.focus();
9397
9398
  }
9398
9399
  removeListeners() {
9399
9400
  if (this.isClosed) {