common-header-lib 0.0.17 → 0.5.15

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.
Files changed (43) hide show
  1. package/README.md +24 -24
  2. package/assets/i18n/ar.json +1 -2
  3. package/assets/i18n/de.json +1 -2
  4. package/assets/i18n/en.json +2 -2
  5. package/assets/i18n/es.json +1 -2
  6. package/assets/i18n/fr.json +1 -2
  7. package/assets/i18n/hi.json +1 -2
  8. package/assets/i18n/ja.json +1 -2
  9. package/assets/i18n/ko.json +1 -2
  10. package/assets/images/toast-alert.svg +3 -3
  11. package/assets/images/toast-error.svg +3 -3
  12. package/assets/images/toast-info.svg +3 -3
  13. package/assets/images/toast-success.svg +10 -10
  14. package/assets/scss/styles.scss +577 -577
  15. package/esm2020/lib/common-header-lib.component.mjs +7 -1
  16. package/esm2020/lib/common-header-lib.module.mjs +20 -158
  17. package/esm2020/lib/common-header-lib.service.mjs +1 -1
  18. package/esm2020/lib/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
  19. package/esm2020/lib/components/ng-translation/ng-translation.component.mjs +27 -33
  20. package/esm2020/lib/model/data_model.mjs +5 -17
  21. package/esm2020/lib/services/http/http-common.service.mjs +1 -1
  22. package/esm2020/public-api.mjs +1 -1
  23. package/fesm2015/common-header-lib.mjs +58 -208
  24. package/fesm2015/common-header-lib.mjs.map +1 -1
  25. package/fesm2020/common-header-lib.mjs +56 -204
  26. package/fesm2020/common-header-lib.mjs.map +1 -1
  27. package/lib/common-header-lib.module.d.ts +1 -47
  28. package/lib/components/ng-translation/ng-translation.component.d.ts +8 -6
  29. package/lib/model/data_model.d.ts +0 -1
  30. package/package.json +1 -1
  31. package/src/assets/i18n/ar.json +1 -2
  32. package/src/assets/i18n/de.json +1 -2
  33. package/src/assets/i18n/en.json +2 -2
  34. package/src/assets/i18n/es.json +1 -2
  35. package/src/assets/i18n/fr.json +1 -2
  36. package/src/assets/i18n/hi.json +1 -2
  37. package/src/assets/i18n/ja.json +1 -2
  38. package/src/assets/i18n/ko.json +1 -2
  39. package/src/assets/images/toast-alert.svg +3 -3
  40. package/src/assets/images/toast-error.svg +3 -3
  41. package/src/assets/images/toast-info.svg +3 -3
  42. package/src/assets/images/toast-success.svg +10 -10
  43. package/src/assets/scss/styles.scss +577 -577
@@ -2,7 +2,6 @@ import { HttpClient } from '@angular/common/http';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { TranslateHttpLoader } from '@ngx-translate/http-loader';
4
4
  import { StorageService } from './services/storage.service';
5
- import { ToastMsgService } from './services/toast-msg.service';
6
5
  import * as i0 from "@angular/core";
7
6
  import * as i1 from "./common-header-lib.component";
8
7
  import * as i2 from "./pipes/slice-to-two.pipe";
@@ -40,50 +39,5 @@ export declare class CommonHeaderLibModule {
40
39
  static ɵmod: i0.ɵɵNgModuleDeclaration<CommonHeaderLibModule, [typeof i1.CommonHeaderLibComponent, typeof i2.SliceToTwoPipe, typeof i3.customDateFormatPipe, typeof i4.DateDiffPipe, typeof i5.UserSidebarComponent, typeof i6.SidePopupComponent, typeof i7.NgTranslationComponent, typeof i8.UserMailboxComponent, typeof i9.NotificationSidebarComponent, typeof i10.GeneralConfigurationComponent, typeof i11.TimezoneConfigurationComponent, typeof i12.LandingpgConfigComponent, typeof i13.NoServiceMyAccessPgComponent, typeof i14.GridPaginationComponent, typeof i15.ConfirmDialogComponent, typeof i16.ViewpasswordPopupComponent], [typeof i17.CommonModule, typeof i18.HttpClientModule, typeof i19.ReactiveFormsModule, typeof i20.InputTextModule, typeof i21.DropdownModule, typeof i22.OverlayPanelModule, typeof i23.BadgeModule, typeof i24.DialogModule, typeof i25.SkeletonModule, typeof i26.PaginatorModule, typeof i27.TableModule, typeof i28.ButtonModule, typeof i29.ConfirmDialogModule, typeof i30.NgbModule, typeof i31.TranslateModule], [typeof i1.CommonHeaderLibComponent, typeof i2.SliceToTwoPipe, typeof i4.DateDiffPipe, typeof i3.customDateFormatPipe, typeof i15.ConfirmDialogComponent, typeof i16.ViewpasswordPopupComponent, typeof i31.TranslateModule]>;
41
40
  static ɵinj: i0.ɵɵInjectorDeclaration<CommonHeaderLibModule>;
42
41
  }
43
- /**
44
- * Initializes ngx-translate language configuration during application startup.
45
- *
46
- * Flow:
47
- * 1. Load and validate supported languages from:
48
- * assets/common-header-lib/i18n/languages.json
49
- *
50
- * 2. Build USERFILTEREDLANGUAGES using the exact order defined in languages.json:
51
- * - removes duplicate langKeys
52
- * - ignores unsupported language codes safely
53
- *
54
- * 3. Read USERLANG from localStorage:
55
- * COOKIECONSTANT.USERLANG
56
- *
57
- * 4. If USERLANG:
58
- * - exists in supported languages
59
- * - and translation JSON loads successfully
60
- * → initialize application using USERLANG
61
- *
62
- * 5. If USERLANG is invalid or translation loading fails:
63
- * → fallback to first language from USERFILTEREDLANGUAGES
64
- * (preserving languages.json order)
65
- *
66
- * 6. If first fallback language also fails:
67
- * → fallback to GlobalConstants.DEFAULTLANG
68
- *
69
- * 7. If DEFAULTLANG translation also fails:
70
- * → initialize empty translations safely
71
- * → prevent application bootstrap crash
72
- *
73
- * Example:
74
- * languages.json = ["it", "ja", "ko"]
75
- * localStorage USERLANG = { langKey: "vi" }
76
- *
77
- * Result:
78
- * - "vi" ignored because unsupported
79
- * - tries "it.json"
80
- * - if "it.json" fails → loads DEFAULTLANG ("en")
81
- *
82
- * Notes:
83
- * - languages.json controls supported language order and priority
84
- * - translation files are validated before translate.use(...)
85
- * - invalid localStorage data is ignored safely
86
- * - application startup is protected against translation failures
87
- */
88
- export declare function initTranslateService(translate: TranslateService, localStorageService: StorageService, http: HttpClient, msgService: ToastMsgService): () => Promise<void>;
42
+ export declare function initTranslateService(translate: TranslateService, localStorageService: StorageService): () => import("rxjs").Subscription;
89
43
  export declare function createLibTranslateLoader(http: HttpClient): TranslateHttpLoader;
@@ -1,19 +1,21 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { StorageService } from '../../services/storage.service';
4
- import { ToastMsgService } from '../../services/toast-msg.service';
4
+ import { CookieService } from 'ngx-cookie-service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class NgTranslationComponent implements OnInit {
7
7
  _translate: TranslateService;
8
8
  private readonly _localstorage;
9
- private readonly msgService;
10
- languages: any[];
9
+ private readonly cookieService;
10
+ languages: {
11
+ langKey: string;
12
+ langName: string;
13
+ }[];
11
14
  selectedLang: any;
12
- constructor(_translate: TranslateService, _localstorage: StorageService, msgService: ToastMsgService);
15
+ constructor(_translate: TranslateService, _localstorage: StorageService, cookieService: CookieService);
13
16
  ngOnInit(): void;
14
- loadLanguages(): void;
17
+ setDefaultLanguage(): void;
15
18
  selectLang(event: any): void;
16
- useTranslate(selectedLang: any): void;
17
19
  saveUserLanguage(lang: any): void;
18
20
  static ɵfac: i0.ɵɵFactoryDeclaration<NgTranslationComponent, never>;
19
21
  static ɵcmp: i0.ɵɵComponentDeclaration<NgTranslationComponent, "ng-translation", never, {}, {}, never, never, false>;
@@ -42,7 +42,6 @@ export declare class GlobalConstants {
42
42
  langKey: string;
43
43
  langName: string;
44
44
  }[];
45
- static USERFILTEREDLANGUAGES: any;
46
45
  static DEFAULTLANG: {
47
46
  langKey: string;
48
47
  langName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "common-header-lib",
3
- "version": "0.0.17",
3
+ "version": "0.005.15",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.2.0",
6
6
  "@angular/core": "^14.2.0",
@@ -84,7 +84,6 @@
84
84
  "Successful": "ناجح",
85
85
  "Error": "خطأ",
86
86
  "Warning": "تحذير",
87
- "Information": "معلومات",
88
- "FailedToLoadLanguageFile": "فشل في تحميل ملف اللغة."
87
+ "Information": "معلومات"
89
88
  }
90
89
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "Erfolgreich",
85
85
  "Error": "Fehler",
86
86
  "Warning": "Warnung",
87
- "Information": "Information",
88
- "FailedToLoadLanguageFile": "Fehler beim Laden der Sprachdatei."
87
+ "Information": "Information"
89
88
  }
90
89
  }
@@ -80,11 +80,11 @@
80
80
  "YouHaveNNotifications": "You have {{count}} notifications",
81
81
  "Refresh": "Refresh",
82
82
  "LandingPageValidation": "Please Select Application Name",
83
+
83
84
  "SettingInvalidLobIdMsg": "The LOB you are trying to set is not available.",
84
85
  "Successful": "Successful",
85
86
  "Error": "Error",
86
87
  "Warning": "Warning",
87
- "Information": "Information",
88
- "FailedToLoadLanguageFile": "Failed to load language file."
88
+ "Information": "Information"
89
89
  }
90
90
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "Exitoso",
85
85
  "Error": "Error",
86
86
  "Warning": "Advertencia",
87
- "Information": "Información",
88
- "FailedToLoadLanguageFile": "Error al cargar el archivo de idioma."
87
+ "Information": "Información"
89
88
  }
90
89
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "Réussi",
85
85
  "Error": "Erreur",
86
86
  "Warning": "Avertissement",
87
- "Information": "Information",
88
- "FailedToLoadLanguageFile": "Échec du chargement du fichier de langue."
87
+ "Information": "Information"
89
88
  }
90
89
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "सफल",
85
85
  "Error": "त्रुटि",
86
86
  "Warning": "चेतावनी",
87
- "Information": "जानकारी",
88
- "FailedToLoadLanguageFile": "भाषा फ़ाइल लोड करने में विफल।"
87
+ "Information": "जानकारी"
89
88
  }
90
89
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "成功",
85
85
  "Error": "エラー",
86
86
  "Warning": "警告",
87
- "Information": "情報",
88
- "FailedToLoadLanguageFile": "言語ファイルの読み込みに失敗しました。"
87
+ "Information": "情報"
89
88
  }
90
89
  }
@@ -84,7 +84,6 @@
84
84
  "Successful": "성공",
85
85
  "Error": "오류",
86
86
  "Warning": "경고",
87
- "Information": "정보",
88
- "FailedToLoadLanguageFile": "언어 파일을 불러오지 못했습니다."
87
+ "Information": "정보"
89
88
  }
90
89
  }
@@ -1,3 +1,3 @@
1
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9.99967 7.50019V10.8335M9.99967 14.1669H10.008M8.84576 3.24329L1.99166 15.0821C1.61149 15.7388 1.42141 16.0671 1.4495 16.3366C1.47401 16.5716 1.59715 16.7852 1.78828 16.9242C2.00741 17.0835 2.3868 17.0835 3.14556 17.0835H16.8537C17.6125 17.0835 17.9918 17.0835 18.211 16.9242C18.4021 16.7852 18.5253 16.5716 18.5498 16.3366C18.5778 16.0671 18.3878 15.7388 18.0076 15.0821L11.1535 3.24329C10.7748 2.58898 10.5853 2.26183 10.3383 2.15196C10.1227 2.05612 9.87659 2.05612 9.66109 2.15196C9.41392 2.26183 9.22451 2.58899 8.84576 3.24329Z" stroke="#EAAA15" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
- </svg>
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.99967 7.50019V10.8335M9.99967 14.1669H10.008M8.84576 3.24329L1.99166 15.0821C1.61149 15.7388 1.42141 16.0671 1.4495 16.3366C1.47401 16.5716 1.59715 16.7852 1.78828 16.9242C2.00741 17.0835 2.3868 17.0835 3.14556 17.0835H16.8537C17.6125 17.0835 17.9918 17.0835 18.211 16.9242C18.4021 16.7852 18.5253 16.5716 18.5498 16.3366C18.5778 16.0671 18.3878 15.7388 18.0076 15.0821L11.1535 3.24329C10.7748 2.58898 10.5853 2.26183 10.3383 2.15196C10.1227 2.05612 9.87659 2.05612 9.66109 2.15196C9.41392 2.26183 9.22451 2.58899 8.84576 3.24329Z" stroke="#EAAA15" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M8.4 17L12 13.4L15.6 17L17 15.6L13.4 12L17 8.4L15.6 7L12 10.6L8.4 7L7 8.4L10.6 12L7 15.6L8.4 17ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" fill="#D83A52"/>
3
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.4 17L12 13.4L15.6 17L17 15.6L13.4 12L17 8.4L15.6 7L12 10.6L8.4 7L7 8.4L10.6 12L7 15.6L8.4 17ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" fill="#D83A52"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M11 17H13V11H11V17ZM12 9C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8C11 8.28333 11.0958 8.52083 11.2875 8.7125C11.4792 8.90417 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" fill="#0073EA"/>
3
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11 17H13V11H11V17ZM12 9C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8C11 8.28333 11.0958 8.52083 11.2875 8.7125C11.4792 8.90417 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" fill="#0073EA"/>
3
+ </svg>
@@ -1,10 +1,10 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_489_23587)">
3
- <path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z" fill="#258750"/>
4
- </g>
5
- <defs>
6
- <clipPath id="clip0_489_23587">
7
- <rect width="24" height="24" fill="white"/>
8
- </clipPath>
9
- </defs>
10
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_489_23587)">
3
+ <path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z" fill="#258750"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_489_23587">
7
+ <rect width="24" height="24" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>