@onecx/angular-accelerator 9.0.0-rc.4 → 9.0.0-rc.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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { inject, ElementRef, input, effect, Directive, signal, Renderer2, ViewContainerRef, TemplateRef, DestroyRef, computed, HostListener, EventEmitter, Output, OutputEmitterRef, assertInInjectionContext, NgZone, Injectable, Injector, LOCALE_ID, Pipe, model, output, contentChild, ViewChild, ViewEncapsulation, Component, contentChildren, viewChild, Input, ChangeDetectorRef, viewChildren, untracked, ChangeDetectionStrategy, Type, NgModule, APP_INITIALIZER } from '@angular/core';
3
3
  import { toObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
4
4
  import { UserService, AppStateService, ConfigurationService, CONFIG_KEY, ShellCapabilityService, Capability, AppConfigService } from '@onecx/angular-integration-interface';
5
- import { HAS_PERMISSION_CHECKER, SKIP_STYLE_SCOPING, getScopeIdentifier, dataStyleIdKey, dataNoPortalLayoutStylesKey, MultiLanguageMissingTranslationHandler, providePermissionChecker, provideTranslationPathFromMeta, provideMultiLanguageIdentifier, provideTranslationConnectionService } from '@onecx/angular-utils';
5
+ import { HAS_PERMISSION_CHECKER, SKIP_STYLE_SCOPING, getScopeIdentifier, dataStyleIdKey, dataNoPortalLayoutStylesKey, MultiLanguageMissingTranslationHandler, localeLoaders, DynamicLocaleId, providePermissionChecker, provideTranslationPathFromMeta, provideMultiLanguageIdentifier, provideTranslationConnectionService } from '@onecx/angular-utils';
6
6
  import { switchMap, of, from, take, map, BehaviorSubject, filter, concat, tap, combineLatest, mergeMap, startWith, debounceTime, firstValueFrom, ReplaySubject, timestamp, isObservable, withLatestFrom, Subject, skip } from 'rxjs';
7
7
  import { createLoggerFactory, Topic, getLocation, isValidDate, getUTCDateWithoutTimezoneIssues } from '@onecx/accelerator';
8
8
  import { HttpClient } from '@angular/common/http';
@@ -12,7 +12,7 @@ import { LiveAnnouncer } from '@angular/cdk/a11y';
12
12
  import * as i8 from '@ngx-translate/core';
13
13
  import { TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
14
14
  import * as i1 from '@angular/common';
15
- import { DatePipe, DecimalPipe, CurrencyPipe, formatDate, CommonModule } from '@angular/common';
15
+ import { DatePipe, DecimalPipe, CurrencyPipe, formatDate, registerLocaleData, CommonModule } from '@angular/common';
16
16
  import * as i2$1 from 'primeng/button';
17
17
  import { ButtonModule } from 'primeng/button';
18
18
  import * as i5 from 'primeng/skeleton';
@@ -5763,38 +5763,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
5763
5763
  }]
5764
5764
  }] });
5765
5765
 
5766
- /**
5767
- * @deprecated Use DynamicLocaleId from @onecx/angular-utils instead
5768
- */
5769
- class DynamicLocaleId {
5770
- constructor(userService) {
5771
- this.userService = userService;
5772
- Object.getOwnPropertyNames(String.prototype).forEach((k) => {
5773
- if (k != 'valueOf' && k != 'length') {
5774
- ;
5775
- this[k] = function (...args) {
5776
- const str = this.valueOf();
5777
- return str[k](...args);
5778
- };
5779
- }
5780
- });
5781
- }
5782
- valueOf() {
5783
- return this.userService.lang$.getValue();
5784
- }
5785
- get length() {
5786
- return this.valueOf().length;
5787
- }
5788
- }
5789
-
5790
5766
  const LIB_NAME = '@onecx/angular-accelerator';
5791
- const LIB_VERSION = '9.0.0-rc.4';
5767
+ const LIB_VERSION = '9.0.0-rc.5';
5792
5768
 
5793
5769
  class AngularAcceleratorMissingTranslationHandler extends MultiLanguageMissingTranslationHandler {
5794
5770
  }
5795
5771
  function appInitializer(userService) {
5796
5772
  return async () => {
5797
- await firstValueFrom(userService.lang$.pipe(skip(1)));
5773
+ const lang = await firstValueFrom(userService.lang$.pipe(skip(1)));
5774
+ try {
5775
+ await localeLoaders[lang]?.().then(data => registerLocaleData(data.default ?? data));
5776
+ }
5777
+ catch (error) {
5778
+ console.warn(`Could not load locale data for '${lang}'. Angular pipes may not format correctly.`, error);
5779
+ }
5798
5780
  };
5799
5781
  }
5800
5782
  class AngularAcceleratorModule {