@yuuvis/client-core 2.3.4 → 2.3.5

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.
@@ -3,7 +3,7 @@ import { TranslateService, TranslateLoader, MissingTranslationHandler, Translate
3
3
  export { TranslateDirective, TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
4
4
  import { HttpErrorResponse, HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpEventType, provideHttpClient, withInterceptors } from '@angular/common/http';
5
5
  import * as i0 from '@angular/core';
6
- import { inject, Injectable, InjectionToken, Inject, Directive, Pipe, importProvidersFrom, provideAppInitializer } from '@angular/core';
6
+ import { inject, Injectable, InjectionToken, Inject, signal, Directive, Pipe, importProvidersFrom, provideAppInitializer } from '@angular/core';
7
7
  import { tap, finalize, shareReplay, catchError, map, switchMap, first, filter, scan, delay } from 'rxjs/operators';
8
8
  import { EMPTY, of, forkJoin, Observable, ReplaySubject, Subject, fromEvent, BehaviorSubject, tap as tap$1, map as map$1, merge, filter as filter$1, debounceTime, throwError, isObservable, switchMap as switchMap$1 } from 'rxjs';
9
9
  import { StorageMap } from '@ngx-pwa/local-storage';
@@ -3260,6 +3260,7 @@ class DeviceService {
3260
3260
  #resize$;
3261
3261
  #screen;
3262
3262
  #screenSource;
3263
+ #supportsSmallScreens;
3263
3264
  constructor() {
3264
3265
  this.#deviceDetectorService = inject(DeviceDetectorService);
3265
3266
  this.#upperScreenBoundary = {
@@ -3271,6 +3272,13 @@ class DeviceService {
3271
3272
  this.#resize$ = fromEvent(window, 'resize').pipe(debounceTime(this.#getDebounceTime()));
3272
3273
  this.#screenSource = new ReplaySubject(1);
3273
3274
  this.screenChange$ = this.#screenSource.asObservable();
3275
+ /**
3276
+ * Signal to indicate if the screen size is small (e.g. mobile phone).
3277
+ * This will only be triggered if `supportsSmallScreens` is set to true.
3278
+ * Major components will use this metric to adapt to 'small screen behavior' and so can you
3279
+ */
3280
+ this.smallScreenLayout = signal(false);
3281
+ this.#supportsSmallScreens = signal(false);
3274
3282
  /**
3275
3283
  * if the device is a mobile device (android / iPhone / windows-phone etc)
3276
3284
  */
@@ -3289,7 +3297,8 @@ class DeviceService {
3289
3297
  this.#setScreen();
3290
3298
  });
3291
3299
  }
3292
- init() {
3300
+ init(supportsSmallScreens = false) {
3301
+ this.#supportsSmallScreens.set(supportsSmallScreens);
3293
3302
  this.#setScreen();
3294
3303
  }
3295
3304
  #isTouchEnabled() {
@@ -3317,6 +3326,7 @@ class DeviceService {
3317
3326
  height: bounds.height
3318
3327
  };
3319
3328
  this.#screenSource.next(this.#screen);
3329
+ this.smallScreenLayout.set(this.#supportsSmallScreens() && this.#screen.size === 's' && this.#screen.orientation === 'portrait');
3320
3330
  this.#setupDOM(this.#screen);
3321
3331
  // force change detection because resize will not be recognized by Angular in some cases
3322
3332
  // TODO: check: causes recursive ticks in some cases ...