@onecx/angular-accelerator 8.2.1 → 8.3.0

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,4 +2,6 @@
2
2
 
3
3
  @import '/node_modules/primeflex/primeflex.scss';
4
4
 
5
- @import '../src/lib/directives/loading-indicator.directive.scss';
5
+ @import '../src/lib/directives/loading-indicator.directive.scss';
6
+
7
+ @import '../src/lib/directives/content.directive.scss';
@@ -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';
@@ -174,7 +174,7 @@ class OcxContentDirective {
174
174
  }
175
175
  addContentStyles() {
176
176
  const addClasses = (classes) => this.el.nativeElement.classList.add(...classes);
177
- addClasses(['card']);
177
+ addClasses(['ocx-card']);
178
178
  }
179
179
  prependTitle() {
180
180
  const titleElementId = this.titleElementId();
@@ -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 = '8.2.1';
5767
+ const LIB_VERSION = '8.3.0';
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 {
@@ -6122,7 +6104,7 @@ function _hasShowTime(datePickers, formKey) {
6122
6104
  /**
6123
6105
  * Safely builds the search criteria based on form values
6124
6106
  * @param formRawValue the raw value of the form to use
6125
- * @param datePickers a list of primeng datePickers of the form (use `@ViewChildren(DatePicker) datePickers!: QueryList<DatePicker>;`)
6107
+ * @param datePickers a list of primeng datePickers of the form (use `viewChildren` to get list of datePickers)
6126
6108
  * @param parameters {@link BuildSearchCriteriaParameters} to use when building the search criteria
6127
6109
  * @returns the search criteria as a partial of T (T = type of the search criteria)
6128
6110
  */