@dsivd/prestations-ng 19.0.2-beta.2 → 19.0.2-beta.4

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, inject, model, input, viewChildren, viewChild, forwardRef, output, computed, linkedSignal, DestroyRef, effect, Directive, ChangeDetectorRef, Pipe, Component, contentChildren, InjectionToken, signal, ElementRef, makeEnvironmentProviders, ErrorHandler, provideAppInitializer, importProvidersFrom, NgZone, untracked, contentChild, TemplateRef } from '@angular/core';
2
+ import { Injectable, inject, model, input, viewChildren, viewChild, forwardRef, output, computed, linkedSignal, DestroyRef, effect, Directive, ChangeDetectorRef, Pipe, Component, contentChildren, InjectionToken, EnvironmentInjector, runInInjectionContext, signal, ElementRef, makeEnvironmentProviders, ErrorHandler, provideAppInitializer, importProvidersFrom, NgZone, untracked, contentChild, TemplateRef } from '@angular/core';
3
3
  import { takeUntilDestroyed, toObservable, outputToObservable } from '@angular/core/rxjs-interop';
4
4
  import { Router, ActivatedRoute, RouterLink, NavigationStart, NavigationEnd } from '@angular/router';
5
5
  import { Subject, BehaviorSubject, combineLatest, of, filter as filter$1, tap as tap$1, throwError, switchMap as switchMap$1, forkJoin, from, concatMap, toArray, EMPTY, startWith, merge, interval, withLatestFrom, map as map$1, concat } from 'rxjs';
@@ -793,6 +793,11 @@ class FoehnInputComponent {
793
793
  this.modelEffect = effect(() => {
794
794
  this.onModelChange(this.model());
795
795
  }, ...(ngDevMode ? [{ debugName: "modelEffect" }] : /* istanbul ignore next */ []));
796
+ }
797
+ get errors() {
798
+ return this._errors?.sort((a, b) => ObjectHelper.stripHtml(a.message).localeCompare(ObjectHelper.stripHtml(b.message)));
799
+ }
800
+ ngOnInit() {
796
801
  combineLatest([
797
802
  this.validationHandlerService.validationErrorsSubject,
798
803
  this.validationHandlerService.validationDisplaySubject,
@@ -801,11 +806,6 @@ class FoehnInputComponent {
801
806
  .subscribe((values) => {
802
807
  this.refreshErrors(values);
803
808
  });
804
- }
805
- get errors() {
806
- return this._errors?.sort((a, b) => ObjectHelper.stripHtml(a.message).localeCompare(ObjectHelper.stripHtml(b.message)));
807
- }
808
- ngOnInit() {
809
809
  this.userInputSubject
810
810
  .pipe(
811
811
  // This is used to ensure that we only catch the latest of multiple
@@ -2496,6 +2496,7 @@ class FoehnNavigationService {
2496
2496
  this.location = inject(Location);
2497
2497
  this.demandeTransmitInterceptor = inject(DemandeTransmitInterceptor);
2498
2498
  this.eventsLoggerService = inject(SdkEventsLoggerService);
2499
+ this.injector = inject(EnvironmentInjector);
2499
2500
  this.isInit = false;
2500
2501
  this.initializedAndRouteActivated = new BehaviorSubject(false);
2501
2502
  this.linearRouting = true;
@@ -2740,7 +2741,7 @@ class FoehnNavigationService {
2740
2741
  return !canActivate.some((guardFn) => !this.evaluateGuard(guardFn));
2741
2742
  }
2742
2743
  evaluateGuard(guardFn) {
2743
- const guardResult = guardFn(this.route.snapshot, null);
2744
+ const guardResult = runInInjectionContext(this.injector, () => guardFn(this.route.snapshot, null));
2744
2745
  if (typeof guardResult !== 'boolean') {
2745
2746
  throw new Error('Not implemented: Dynamic routing guards only support boolean results');
2746
2747
  }
@@ -9155,7 +9156,7 @@ class FoehnMultiselectAutocompleteComponent extends FoehnAutocompleteComponent {
9155
9156
  hasErrorsToDisplay() {
9156
9157
  const autocompleteComponent = this.autocompleteComponent();
9157
9158
  return !!autocompleteComponent
9158
- ? autocompleteComponent.hasErrorsToDisplay()
9159
+ ? !!autocompleteComponent.hasErrorsToDisplay()
9159
9160
  : false;
9160
9161
  }
9161
9162
  getLabel(value) {