@onecx/angular-accelerator 8.3.0 → 8.3.1

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 { 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';
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, untracked, Input, ChangeDetectorRef, viewChildren, 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
5
  import { HAS_PERMISSION_CHECKER, SKIP_STYLE_SCOPING, getScopeIdentifier, dataStyleIdKey, dataNoPortalLayoutStylesKey, MultiLanguageMissingTranslationHandler, localeLoaders, DynamicLocaleId, providePermissionChecker, provideTranslationPathFromMeta, provideMultiLanguageIdentifier, provideTranslationConnectionService } from '@onecx/angular-utils';
@@ -1038,11 +1038,11 @@ class SearchHeaderComponent {
1038
1038
  this.visibleFormControls = contentChildren(FormControlName, { ...(ngDevMode ? { debugName: "visibleFormControls" } : {}), descendants: true });
1039
1039
  this.searchParameterFields = viewChild('searchParameterFields', ...(ngDevMode ? [{ debugName: "searchParameterFields" }] : []));
1040
1040
  this.hasAdvanced = signal(false, ...(ngDevMode ? [{ debugName: "hasAdvanced" }] : []));
1041
- this.simpleAdvancedAction = signal({
1041
+ this.simpleAdvancedAction = {
1042
1042
  id: 'simpleAdvancedButton',
1043
1043
  actionCallback: () => this.toggleViewMode(),
1044
1044
  show: 'always',
1045
- }, ...(ngDevMode ? [{ debugName: "simpleAdvancedAction" }] : []));
1045
+ };
1046
1046
  this.headerActions = signal([], ...(ngDevMode ? [{ debugName: "headerActions" }] : []));
1047
1047
  this.searchButtonsReversed$ = of(null);
1048
1048
  this.fieldValues$ = combineLatest([
@@ -1055,12 +1055,22 @@ class SearchHeaderComponent {
1055
1055
  this.searchConfigChangedSlotEmitter = new EventEmitter();
1056
1056
  effect(() => {
1057
1057
  const viewMode = this.viewMode();
1058
- this.viewModeChanged?.emit(viewMode);
1059
- this.componentStateChanged.emit({
1060
- activeViewMode: viewMode,
1058
+ untracked(() => {
1059
+ this.viewModeChanged?.emit(viewMode);
1060
+ this.componentStateChanged.emit({
1061
+ activeViewMode: viewMode,
1062
+ });
1063
+ });
1064
+ });
1065
+ // Update header actions whenever view mode, advanced availability or actions input changes
1066
+ effect(() => {
1067
+ this.viewMode();
1068
+ this.hasAdvanced();
1069
+ this.actions();
1070
+ untracked(() => {
1071
+ this.updateHeaderActions();
1072
+ setTimeout(() => this.addKeyUpEventListener());
1061
1073
  });
1062
- this.updateHeaderActions();
1063
- setTimeout(() => this.addKeyUpEventListener());
1064
1074
  });
1065
1075
  this.announceSearchResults();
1066
1076
  const configurationService = inject(ConfigurationService);
@@ -1084,7 +1094,7 @@ class SearchHeaderComponent {
1084
1094
  updateHeaderActions() {
1085
1095
  const headerActions = [];
1086
1096
  if (this.hasAdvanced()) {
1087
- const simpleAdvancedAction = this.simpleAdvancedAction();
1097
+ const simpleAdvancedAction = this.simpleAdvancedAction;
1088
1098
  simpleAdvancedAction.labelKey =
1089
1099
  this.viewMode() === 'basic'
1090
1100
  ? 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.ADVANCED.TEXT'
@@ -1126,7 +1136,9 @@ class SearchHeaderComponent {
1126
1136
  else {
1127
1137
  announmentKey = 'OCX_SEARCH_HEADER.ANNOUNCEMENTS.RESULTS_FOUND';
1128
1138
  }
1129
- firstValueFrom(this.translate.get(announmentKey, { count: !this.loading() && this.searchResultsCount() ? this.searchResultsCount() : null })).then((translatedText) => {
1139
+ firstValueFrom(this.translate.get(announmentKey, {
1140
+ count: !this.loading() && this.searchResultsCount() ? this.searchResultsCount() : null,
1141
+ })).then((translatedText) => {
1130
1142
  this.liveAnnouncer.announce(translatedText, 'polite');
1131
1143
  });
1132
1144
  });
@@ -5764,7 +5776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
5764
5776
  }] });
5765
5777
 
5766
5778
  const LIB_NAME = '@onecx/angular-accelerator';
5767
- const LIB_VERSION = '8.3.0';
5779
+ const LIB_VERSION = '8.3.1';
5768
5780
 
5769
5781
  class AngularAcceleratorMissingTranslationHandler extends MultiLanguageMissingTranslationHandler {
5770
5782
  }