common-header-lib 0.20.3 → 0.20.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.
package/index.d.ts CHANGED
@@ -5,14 +5,41 @@ import { DynamicDialogConfig } from 'primeng/dynamicdialog';
5
5
  import * as i7 from '@ngx-translate/core';
6
6
  import { HttpInterceptorFn } from '@angular/common/http';
7
7
 
8
+ /**
9
+ * Holds a reference to <lib-app-header>'s own host element, so this
10
+ * library's dialogs (LOB confirm dialog, General Configuration, Password /
11
+ * View-Password) can be appended there instead of PrimeNG's default of
12
+ * <body> — letting consuming apps target/style the dialogs with a scoped
13
+ * CSS selector, since they stay inside the header's own DOM subtree.
14
+ *
15
+ * Provided at CommonHeaderLibComponent level (not root) so every dialog
16
+ * this library renders can inject it and reach that one instance, and so
17
+ * multiple <lib-app-header> instances on the same page each get their own.
18
+ */
19
+ declare class DialogHostService {
20
+ hostElement: HTMLElement | null;
21
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogHostService, never>;
22
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogHostService>;
23
+ }
24
+
8
25
  declare class ConfirmDialogComponent {
9
26
  header: _angular_core.InputSignal<string>;
10
27
  message: _angular_core.InputSignal<string>;
28
+ /** Extra class(es) to layer onto the underlying p-confirmDialog root, e.g.
29
+ * a per-instance marker so a specific confirm dialog (like the LOB change
30
+ * confirmation) can be targeted from consuming apps' global styles.
31
+ * Always combined with the library's own `lib-dialog` scoping class —
32
+ * see _dialogs.scss. */
33
+ styleClass: _angular_core.InputSignal<string>;
11
34
  result: _angular_core.OutputEmitterRef<boolean>;
12
35
  private readonly confirmationService;
36
+ /** Appends the dialog inside <lib-app-header> instead of PrimeNG's default
37
+ * of <body>, so consuming apps can target it with a scoped CSS selector.
38
+ * See DialogHostService. */
39
+ protected readonly dialogHostService: DialogHostService;
13
40
  openConfirmModal(event: Event): void;
14
41
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
15
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmDialogComponent, "confirm-dialog", never, { "header": { "alias": "header"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; }, { "result": "result"; }, never, never, true, never>;
42
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmDialogComponent, "confirm-dialog", never, { "header": { "alias": "header"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, { "result": "result"; }, never, never, true, never>;
16
43
  }
17
44
 
18
45
  interface Language {
@@ -130,7 +157,11 @@ declare class AppPanelComponent {
130
157
  private readonly msgService;
131
158
  private readonly destroyRef;
132
159
  private readonly cdRef;
160
+ private readonly document;
133
161
  private readonly popoverRef;
162
+ private readonly popoverContentRef;
163
+ /** The 9-dots trigger button, captured on open so focus can return to it on close. */
164
+ private triggerElement;
134
165
  private readonly APP_PANEL_SKELETON_COUNT;
135
166
  /** List of apps the user is privileged to access. */
136
167
  ListOfUserPrivillegedApp: AppDetails[];
@@ -140,6 +171,34 @@ declare class AppPanelComponent {
140
171
  private readonly APP_CONNECTION_CHECKS;
141
172
  /** Toggles the popover and fetches the app list the first time it opens. */
142
173
  toggle(event: Event): void;
174
+ /** Moves focus to the first app tile. Called on popover open, and again once
175
+ * the app list finishes loading if the popover was opened while it was
176
+ * still showing the skeleton (which has no focusable tiles yet). */
177
+ onPopoverShow(): void;
178
+ /** Returns focus to the 9-dots trigger button on most close paths (Escape,
179
+ * outside click, or selecting an app). Skipped for a forward Tab-out —
180
+ * see onPopoverKeydown's Tab case and skipTriggerFocusOnHide below. */
181
+ onPopoverHide(): void;
182
+ /** Set just before closing via a forward Tab-out (see onPopoverKeydown),
183
+ * so onPopoverHide's normal focus-to-trigger restore is skipped — that
184
+ * path already sent focus to the next element itself. */
185
+ private skipTriggerFocusOnHide;
186
+ /** Grid keyboard navigation for the app tiles, matching the reference
187
+ * acmo-login-page waffle panel: Arrow keys + Home/End move the roving
188
+ * focus between tiles (3-column grid, see .waffle-align).
189
+ * Tab past the last tile continues the user's forward tab traversal to
190
+ * whatever comes after the 9-dots button on the page, instead of looping
191
+ * focus back onto it. Shift+Tab before the first tile returns focus to
192
+ * the 9-dots button itself (the natural "one step back" target). */
193
+ onPopoverKeydown(event: KeyboardEvent): void;
194
+ private focusFirstTile;
195
+ private getFocusableTiles;
196
+ /** Focuses whatever comes immediately after the 9-dots trigger button in
197
+ * the page's natural tab order, continuing the user's forward Tab press
198
+ * instead of looping it back onto the button they just tabbed away from.
199
+ * App tiles are excluded from the candidate list since they're mid-close. */
200
+ private focusNextAfterTrigger;
201
+ private isVisible;
143
202
  /** Fetches the apps assigned to the current user. */
144
203
  private getUserAssignedApp;
145
204
  /** Handles a click on an app tile.
@@ -233,6 +292,9 @@ interface LobItem {
233
292
  * - Persist the confirmed LOB selection back to localStorage
234
293
  * - Revert the dropdown to the last confirmed LOB when the user cancels
235
294
  * - Validate LOB IDs set programmatically by the host app
295
+ * - When read-only (host sets `lobReadOnly`), freeze the LOB and refuse
296
+ * every mutation below regardless of caller — see loadLOBs()'s readOnly
297
+ * param for how a page reload during read-only mode stays frozen too.
236
298
  *
237
299
  * Provided at the component level so each header instance has isolated LOB state.
238
300
  */
@@ -248,21 +310,44 @@ declare class LobService {
248
310
  /** Tracks the last confirmed LOB ID so changes can be reverted on cancel. */
249
311
  private tempSelectedLobId;
250
312
  /** Fetches the LOB list and resolves the initial selection.
251
- * - If localStorage has a valid pre-selected LOB, it is restored.
252
- * - Otherwise the first item in the list is selected and saved to localStorage. */
253
- loadLOBs(showAllLOB: boolean): Observable<{
313
+ * - Normally: if localStorage['XOB'] has a valid pre-selected LOB, it is
314
+ * restored; otherwise the first item in the list is selected and saved.
315
+ * - When readOnly is true: localStorage['XOB'] is not trusted at all (that
316
+ * is the exact tamper vector read-only mode exists to close). Instead the
317
+ * LOB is resolved from a separate 'XOB_LOCK' key. The first time this
318
+ * runs while read-only, 'XOB_LOCK' doesn't exist yet, so the normal
319
+ * XOB-restore-or-default resolution runs once to establish a baseline,
320
+ * which is then locked into 'XOB_LOCK' — 'XOB' itself is left untouched
321
+ * so the pre-lock value is intact once read-only turns back off. Every
322
+ * subsequent call while still read-only (including across a page reload)
323
+ * reads 'XOB_LOCK' instead, so editing 'XOB' has no effect. */
324
+ loadLOBs(showAllLOB: boolean, readOnly?: boolean): Observable<{
254
325
  initialLobSelected: LobItem;
255
326
  selectedLobId: any;
256
327
  }>;
328
+ /** Read-only resolution: prefer the existing lock; if none exists yet
329
+ * (first read-only load), establish one from the normal XOB-or-default
330
+ * resolution without touching 'XOB' itself. */
331
+ private resolveReadOnlyLob;
332
+ /** Shared resolution used by both the normal and first-time-read-only
333
+ * paths: restore from `readKey` if it holds a valid, still-listed LOB;
334
+ * otherwise default to the first list item. Writes the resolved value to
335
+ * `writeKey` (only on the default branch, unless forceWrite is set — used
336
+ * by the read-only baseline path, which must persist even when it
337
+ * legitimately restored from 'XOB' rather than defaulting). */
338
+ private resolveAndPersistLob;
257
339
  /** Called when the user confirms the LOB change dialog.
258
- * Updates the temp reference and persists the new selection to localStorage. */
259
- confirmChange(selectedLobId: any): LobItem;
340
+ * Updates the temp reference and persists the new selection to localStorage.
341
+ * No-ops when readOnly is true — defense-in-depth so this stays safe even
342
+ * if a caller bypasses the component-level guard. */
343
+ confirmChange(selectedLobId: any, readOnly?: boolean): LobItem | null;
260
344
  /** Called when the user cancels the LOB change dialog.
261
345
  * Returns the last confirmed LOB ID so the dropdown can be reverted. */
262
346
  revertChange(): any;
263
347
  /** Validates a LOB ID set programmatically by the host app (via setCustomLobId).
264
- * Shows an error toast if the ID does not exist in the current list. */
265
- validateCustomLobId(lobId: any): LobItem | null;
348
+ * Shows an error toast if the ID does not exist in the current list.
349
+ * No-ops when readOnly is true — defense-in-depth, same as confirmChange. */
350
+ validateCustomLobId(lobId: any, readOnly?: boolean): LobItem | null;
266
351
  /** Finds a LOB in the list by its ID and returns a normalised LobItem.
267
352
  * Returns an empty object cast as LobItem when no match is found. */
268
353
  getLobById(list: any[], id: any): LobItem;
@@ -291,6 +376,7 @@ declare class CommonHeaderLibComponent implements OnInit {
291
376
  EnableTimeZone: _angular_core.InputSignal<boolean>;
292
377
  EnableLOB: _angular_core.InputSignal<boolean>;
293
378
  showAllLOB: _angular_core.InputSignal<boolean>;
379
+ lobReadOnly: _angular_core.InputSignal<boolean>;
294
380
  EnableMail: _angular_core.InputSignal<boolean>;
295
381
  EnableNotifications: _angular_core.InputSignal<boolean>;
296
382
  EnableMoreApps: _angular_core.InputSignal<boolean>;
@@ -307,6 +393,8 @@ declare class CommonHeaderLibComponent implements OnInit {
307
393
  appPanelRef: _angular_core.Signal<AppPanelComponent>;
308
394
  readonly headerData: HeaderDataService;
309
395
  readonly lobService: LobService;
396
+ private readonly dialogHostService;
397
+ private readonly elementRef;
310
398
  selectedLOBId: any;
311
399
  isOpenSidePopup: boolean;
312
400
  showUserDetails: boolean;
@@ -324,15 +412,28 @@ declare class CommonHeaderLibComponent implements OnInit {
324
412
  OpenNotificationModal(): void;
325
413
  closeModal(): void;
326
414
  /** Called when the user picks a different LOB from the dropdown.
327
- * Stores the new value and opens the confirmation dialog before committing. */
415
+ * Stores the new value and opens the confirmation dialog before committing.
416
+ * When lobReadOnly is true: PrimeNG's [(ngModel)] has already written
417
+ * event.value into selectedLOBId by the time this handler runs (ngModel
418
+ * writeback happens before (onChange) fires), so a bare early return would
419
+ * leave the dropdown showing the tampered value — force-revert it to the
420
+ * last confirmed LOB instead, and never open the confirm dialog. */
328
421
  onLobChangeEvent(event: any): void;
329
422
  /** Called when the user confirms the LOB change dialog.
330
- * Persists the new selection and emits it to the host app. */
423
+ * Persists the new selection and emits it to the host app.
424
+ * Re-checks lobReadOnly here too (not just in onLobChangeEvent) so a
425
+ * dialog already open when read-only turns on, or the dialog's own accept
426
+ * callback invoked directly, cannot still commit a change. */
331
427
  confirmLobChange(): void;
332
428
  /** Called when the user cancels the LOB change dialog.
333
- * Reverts the dropdown back to the previously confirmed LOB. */
429
+ * Reverts the dropdown back to the previously confirmed LOB. Intentionally
430
+ * NOT gated by lobReadOnly — reverting only ever restores the last
431
+ * confirmed value, never advances it, so it's safe (and useful as a
432
+ * self-heal) to allow regardless of read-only state. */
334
433
  revertLobChange(): void;
335
- /** Public API — allows the host app to force-select a specific LOB by ID. */
434
+ /** Public API — allows the host app to force-select a specific LOB by ID.
435
+ * Also respects lobReadOnly: while read-only, nobody — including host-app
436
+ * code — can change the LOB except by first turning the flag back off. */
336
437
  setCustomLobId(lobId: any): void;
337
438
  /** Sets the base API URL once. Falls back to the current browser origin
338
439
  * if no URL has been stored in localStorage under '_WAU'. */
@@ -340,10 +441,16 @@ declare class CommonHeaderLibComponent implements OnInit {
340
441
  /** Loads the LOB list and emits the initially selected LOB to the host app.
341
442
  * detectChanges() is used (not markForCheck) because lobService properties
342
443
  * are plain values, not signals — we need an immediate re-render after the
343
- * subscription updates showLobLoader and userLOBList on the service. */
444
+ * subscription updates showLobLoader and userLOBList on the service.
445
+ * lobReadOnly is read here (not inside the constructor effect, which only
446
+ * depends on EnableLOB) so toggling lobReadOnly never re-triggers this
447
+ * call on its own — the effect's untracked() wrapper means changes here
448
+ * are inert as an effect dependency, matching the existing showAllLOB
449
+ * pattern. This is what keeps a read-only toggle from re-resolving or
450
+ * re-emitting lobSelected by itself. */
344
451
  private getListofLOB;
345
452
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommonHeaderLibComponent, never>;
346
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommonHeaderLibComponent, "lib-app-header", never, { "EnableLogo": { "alias": "EnableLogo"; "required": false; "isSignal": true; }; "moduleName": { "alias": "moduleName"; "required": false; "isSignal": true; }; "EnableTimeZone": { "alias": "EnableTimeZone"; "required": false; "isSignal": true; }; "EnableLOB": { "alias": "EnableLOB"; "required": false; "isSignal": true; }; "showAllLOB": { "alias": "showAllLOB"; "required": false; "isSignal": true; }; "EnableMail": { "alias": "EnableMail"; "required": false; "isSignal": true; }; "EnableNotifications": { "alias": "EnableNotifications"; "required": false; "isSignal": true; }; "EnableMoreApps": { "alias": "EnableMoreApps"; "required": false; "isSignal": true; }; "EnableProfile": { "alias": "EnableProfile"; "required": false; "isSignal": true; }; "EnableLearningCenter": { "alias": "EnableLearningCenter"; "required": false; "isSignal": true; }; "EnableGeneralConfiguration": { "alias": "EnableGeneralConfiguration"; "required": false; "isSignal": true; }; "languages": { "alias": "languages"; "required": false; "isSignal": true; }; }, { "timezoneDetails": "timezoneDetails"; "lobSelected": "lobSelected"; "getBgImage": "getBgImage"; "langChange": "langChange"; "overlayStateChange": "overlayStateChange"; }, never, never, true, never>;
453
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommonHeaderLibComponent, "lib-app-header", never, { "EnableLogo": { "alias": "EnableLogo"; "required": false; "isSignal": true; }; "moduleName": { "alias": "moduleName"; "required": false; "isSignal": true; }; "EnableTimeZone": { "alias": "EnableTimeZone"; "required": false; "isSignal": true; }; "EnableLOB": { "alias": "EnableLOB"; "required": false; "isSignal": true; }; "showAllLOB": { "alias": "showAllLOB"; "required": false; "isSignal": true; }; "lobReadOnly": { "alias": "lobReadOnly"; "required": false; "isSignal": true; }; "EnableMail": { "alias": "EnableMail"; "required": false; "isSignal": true; }; "EnableNotifications": { "alias": "EnableNotifications"; "required": false; "isSignal": true; }; "EnableMoreApps": { "alias": "EnableMoreApps"; "required": false; "isSignal": true; }; "EnableProfile": { "alias": "EnableProfile"; "required": false; "isSignal": true; }; "EnableLearningCenter": { "alias": "EnableLearningCenter"; "required": false; "isSignal": true; }; "EnableGeneralConfiguration": { "alias": "EnableGeneralConfiguration"; "required": false; "isSignal": true; }; "languages": { "alias": "languages"; "required": false; "isSignal": true; }; }, { "timezoneDetails": "timezoneDetails"; "lobSelected": "lobSelected"; "getBgImage": "getBgImage"; "langChange": "langChange"; "overlayStateChange": "overlayStateChange"; }, never, never, true, never>;
347
454
  }
348
455
 
349
456
  declare class SliceToTwoPipe implements PipeTransform {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "common-header-lib",
3
- "version": "0.20.3",
3
+ "version": "0.20.5",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.0",
6
6
  "@angular/common": "^20.3.0",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "إعادة إنشاء",
15
15
  "Copied": "تم النسخ",
16
16
  "Action": "فعل",
17
- "ArconLearningCenter": "مركز أركون التعليمي",
17
+ "ArconCIResourceCenter": "مركز موارد ARCON CI",
18
18
  "AssetName": "اسم الأصول",
19
19
  "AssetNameFieldValidation": "الرجاء تحديد اسم الأصل",
20
20
  "AssetNamePlaceholder": "حدد اسم الأصل",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "Neu generieren",
15
15
  "Copied": "Kopiert",
16
16
  "Action": "Aktion",
17
- "ArconLearningCenter": "Arcon Lernzentrum",
17
+ "ArconCIResourceCenter": "ARCON CI-Ressourcenzentrum",
18
18
  "AssetName": "Asset-Name",
19
19
  "AssetNameFieldValidation": "Bitte Asset-Namen auswählen",
20
20
  "AssetNamePlaceholder": "Asset-Namen auswählen",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "Regenerate",
15
15
  "Copied": "Copied",
16
16
  "Action": "Action",
17
- "ArconLearningCenter": "Arcon Learning Center",
17
+ "ArconCIResourceCenter": "ARCON CI Resource Center",
18
18
  "AssetName": "Asset Name",
19
19
  "AssetNameFieldValidation": "Please Select Asset Name",
20
20
  "AssetNamePlaceholder": "Select Asset Name",
@@ -96,7 +96,7 @@
96
96
  "RequiredField": "Required field",
97
97
  "LandingPageValidation": "Please Select Application Name",
98
98
  "SettingInvalidLobIdMsg": "The LOB you are trying to set is not available.",
99
- "Successful": "Successful",
99
+ "Successful": "Success",
100
100
  "Error": "Error",
101
101
  "Warning": "Warning",
102
102
  "Information": "Information",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "Regenerar",
15
15
  "Copied": "Copiado",
16
16
  "Action": "Acción",
17
- "ArconLearningCenter": "Centro de Aprendizaje Arcon",
17
+ "ArconCIResourceCenter": "Centro de Recursos ARCON CI",
18
18
  "AssetName": "Nombre del activo",
19
19
  "AssetNameFieldValidation": "Por favor seleccione el nombre del activo",
20
20
  "AssetNamePlaceholder": "Seleccione el nombre del activo",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "Régénérer",
15
15
  "Copied": "Copié",
16
16
  "Action": "Action",
17
- "ArconLearningCenter": "Centre d’apprentissage Arcon",
17
+ "ArconCIResourceCenter": "Centre de ressources ARCON CI",
18
18
  "AssetName": "Nom de l’actif",
19
19
  "AssetNameFieldValidation": "Veuillez sélectionner le nom de l’actif",
20
20
  "AssetNamePlaceholder": "Sélectionnez le nom de l’actif",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "पुनः जनरेट करें",
15
15
  "Copied": "कॉपी किया गया",
16
16
  "Action": "क्रिया",
17
- "ArconLearningCenter": "आर्कॉन लर्निंग सेंटर",
17
+ "ArconCIResourceCenter": "आर्कॉन सीआई संसाधन केंद्र",
18
18
  "AssetName": "एसेट नाम",
19
19
  "AssetNameFieldValidation": "कृपया एसेट नाम चुनें",
20
20
  "AssetNamePlaceholder": "एसेट नाम चुनें",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "再生成",
15
15
  "Copied": "コピーしました",
16
16
  "Action": "アクション",
17
- "ArconLearningCenter": "Arcon学習センター",
17
+ "ArconCIResourceCenter": "ARCON CI リソースセンター",
18
18
  "AssetName": "アセット名",
19
19
  "AssetNameFieldValidation": "アセット名を選択してください",
20
20
  "AssetNamePlaceholder": "アセット名を選択",
@@ -14,7 +14,7 @@
14
14
  "Regenerate": "재생성",
15
15
  "Copied": "복사됨",
16
16
  "Action": "작업",
17
- "ArconLearningCenter": "Arcon 학습 센터",
17
+ "ArconCIResourceCenter": "ARCON CI 리소스 센터",
18
18
  "AssetName": "자산 이름",
19
19
  "AssetNameFieldValidation": "자산 이름을 선택하세요",
20
20
  "AssetNamePlaceholder": "자산 이름 선택",