mesauth-angular 1.9.2 → 1.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mesauth-angular",
3
- "version": "1.9.2",
3
+ "version": "1.11.0",
4
4
  "description": "Angular helper library to connect to a backend API and SignalR hub to surface the current logged-in user and incoming notifications with dark/light theme support",
5
5
  "keywords": [
6
6
  "angular",
@@ -52,6 +52,11 @@ interface IUser {
52
52
  perms?: Set<string>;
53
53
  employeeCode?: string;
54
54
  avatarPath?: string;
55
+ avatarShape?: 'circle' | 'rounded' | 'rectangle' | 'portrait';
56
+ avatarFrame?: string | null;
57
+ avatarSize?: 'sm' | 'md' | 'lg';
58
+ avatarRatio?: 'ar-11' | 'ar-43' | 'ar-169';
59
+ avatarStyleAllowed?: boolean;
55
60
  loginMethod?: number;
56
61
  hrFullNameVn?: string;
57
62
  hrFullNameEn?: string;
@@ -145,6 +150,7 @@ declare class MesAuthService {
145
150
  /** _ngZone accepted but ignored - not needed in zoneless apps. */
146
151
  init(config: MesAuthConfig, httpClient: HttpClient, router?: Router, _ngZone?: unknown): void;
147
152
  private injectThemeStylesheet;
153
+ private updateThemeStylesheetVersion;
148
154
  getConfig(): MesAuthConfig | null;
149
155
  private fetchCurrentUser;
150
156
  getUnreadCount(): Observable<any>;
@@ -168,6 +174,16 @@ declare class MesAuthService {
168
174
  * Callers can subscribe to wait for completion before proceeding (e.g., navigating after login).
169
175
  */
170
176
  refreshUser(): Observable<any>;
177
+ getAvatarStyle(): Observable<{
178
+ data: string;
179
+ allowedActions: string[];
180
+ }>;
181
+ updateAvatarStyle(avatarShape: string | null, avatarFrame: string | null, avatarSize: string | null, avatarRatio: string | null): Observable<{
182
+ avatarShape: string | null;
183
+ avatarFrame: string | null;
184
+ avatarSize: string | null;
185
+ avatarRatio: string | null;
186
+ }>;
171
187
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MesAuthService, never>;
172
188
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MesAuthService>;
173
189
  }
@@ -185,6 +201,35 @@ declare class MesAuthModule {
185
201
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<MesAuthModule>;
186
202
  }
187
203
 
204
+ type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
205
+ type AvatarShape = 'circle' | 'rounded' | 'rectangle' | 'portrait';
206
+ interface AvatarFrameDef {
207
+ id: string;
208
+ label: string;
209
+ }
210
+ declare const AVATAR_FRAMES: ReadonlyArray<AvatarFrameDef>;
211
+ declare class MaAvatarComponent {
212
+ src: _angular_core.InputSignal<string>;
213
+ alt: _angular_core.InputSignal<string>;
214
+ initials: _angular_core.InputSignal<string>;
215
+ size: _angular_core.InputSignal<AvatarSize>;
216
+ shape: _angular_core.InputSignal<AvatarShape>;
217
+ frame: _angular_core.InputSignal<string>;
218
+ ratio: _angular_core.InputSignal<string>;
219
+ scale: _angular_core.InputSignal<number>;
220
+ ring: _angular_core.InputSignalWithTransform<boolean, unknown>;
221
+ ringActive: _angular_core.InputSignalWithTransform<boolean, unknown>;
222
+ private themeService;
223
+ get themeClass(): string;
224
+ readonly wrapperClass: _angular_core.Signal<string>;
225
+ readonly wrapperStyle: _angular_core.Signal<{
226
+ '--avatar-scale': number;
227
+ }>;
228
+ readonly showImage: _angular_core.Signal<boolean>;
229
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaAvatarComponent, never>;
230
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaAvatarComponent, "ma-avatar", never, { "src": { "alias": "src"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "initials": { "alias": "initials"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "frame": { "alias": "frame"; "required": false; "isSignal": true; }; "ratio": { "alias": "ratio"; "required": false; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; "ring": { "alias": "ring"; "required": false; "isSignal": true; }; "ringActive": { "alias": "ringActive"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
231
+ }
232
+
188
233
  declare class UserProfileComponent {
189
234
  notificationClick: _angular_core.OutputEmitterRef<void>;
190
235
  approvalClick: _angular_core.OutputEmitterRef<void>;
@@ -194,6 +239,11 @@ declare class UserProfileComponent {
194
239
  readonly pendingApprovalCount: _angular_core.WritableSignal<number>;
195
240
  readonly dropdownOpen: _angular_core.WritableSignal<boolean>;
196
241
  readonly avatarRefresh: _angular_core.WritableSignal<number>;
242
+ readonly navAvatarSize: _angular_core.Signal<AvatarSize>;
243
+ readonly dropAvatarSize: _angular_core.Signal<AvatarSize>;
244
+ readonly avatarShape: _angular_core.Signal<"circle" | "rounded" | "rectangle" | "portrait">;
245
+ readonly avatarFrame: _angular_core.Signal<string>;
246
+ readonly avatarRatio: _angular_core.Signal<"ar-11" | "ar-43" | "ar-169">;
197
247
  private readonly authService;
198
248
  private readonly router;
199
249
  private readonly themeService;
@@ -205,13 +255,14 @@ declare class UserProfileComponent {
205
255
  getAvatarUrl(user: IUser): string;
206
256
  getLastNameInitial(user: IUser): string;
207
257
  toggleDropdown(): void;
258
+ closeDropdown(): void;
208
259
  onDocumentClick(event: Event): void;
209
260
  onLogin(): void;
210
261
  onViewProfile(): void;
211
262
  onLogout(): void;
212
263
  onNotificationClick(): void;
213
264
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserProfileComponent, never>;
214
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserProfileComponent, "ma-user-profile", never, {}, { "notificationClick": "notificationClick"; "approvalClick": "approvalClick"; }, never, never, true, never>;
265
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserProfileComponent, "ma-user-profile", never, {}, { "notificationClick": "notificationClick"; "approvalClick": "approvalClick"; }, never, ["*"], true, never>;
215
266
  }
216
267
 
217
268
  declare enum ApprovalStepMode {
@@ -444,7 +495,7 @@ declare class MaUserComponent implements AfterViewInit {
444
495
  onNotificationRead(): void;
445
496
  onApprovalActioned(): void;
446
497
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaUserComponent, never>;
447
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaUserComponent, "ma-user", never, {}, {}, never, never, true, never>;
498
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaUserComponent, "ma-user", never, {}, {}, never, ["*"], true, never>;
448
499
  }
449
500
 
450
501
  declare class NotificationBadgeComponent {
@@ -686,6 +737,8 @@ interface MaUiManifest {
686
737
  /** Feature flags read by components at runtime. */
687
738
  features?: Record<string, boolean>;
688
739
  }
740
+ /** Current installed package version — keep in sync with package.json. */
741
+ declare const PACKAGE_VERSION = "1.11.0";
689
742
  /**
690
743
  * Provides server-driven UI configuration loaded from the hosted manifest.
691
744
  * Components read `labels()` and `features()` signals instead of hardcoded strings.
@@ -696,12 +749,15 @@ declare class MaUiConfigService {
696
749
  private _labels;
697
750
  private _features;
698
751
  private _updateRequired;
752
+ private _manifestVersion;
699
753
  /** Reactive map of UI string overrides from the server manifest. */
700
754
  readonly labels: _angular_core.Signal<Record<string, string>>;
701
755
  /** Reactive map of feature flags from the server manifest. */
702
756
  readonly features: _angular_core.Signal<Record<string, boolean>>;
703
757
  /** True when the server signals that a package upgrade is needed. */
704
758
  readonly updateRequired: _angular_core.Signal<boolean>;
759
+ /** The manifest version string loaded from the server, or null if not yet loaded. */
760
+ readonly manifestVersion: _angular_core.Signal<string>;
705
761
  /**
706
762
  * Returns a label by key, falling back to `defaultValue` when the server
707
763
  * manifest has not provided an override.
@@ -768,5 +824,24 @@ declare class MaThemeDirective {
768
824
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MaThemeDirective, "[maTheme]", never, {}, {}, never, never, true, never>;
769
825
  }
770
826
 
771
- export { ALL_ACTIONS, ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, MES_AUTH_CONFIG, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaIconComponent, MaThemeDirective, MaUiConfigService, MaUserComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, extractXMaPerm, mesAuthInterceptor, provideMesAuth, withXMaPerm, xMaResource };
772
- export type { ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MaUiManifest, MesAuthConfig, NotificationDto, PagedList, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };
827
+ declare enum MaUserMenuColor {
828
+ Default = "default",
829
+ Primary = "primary",
830
+ Success = "success",
831
+ Warning = "warning",
832
+ Danger = "danger",
833
+ Info = "info"
834
+ }
835
+
836
+ declare class MaUserMenuComponent {
837
+ name: _angular_core.InputSignal<string>;
838
+ color: _angular_core.InputSignal<MaUserMenuColor>;
839
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
840
+ itemClick: _angular_core.OutputEmitterRef<void>;
841
+ onClick(): void;
842
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaUserMenuComponent, never>;
843
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaUserMenuComponent, "ma-user-menu", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "itemClick": "itemClick"; }, never, ["[maUserMenuIcon]"], true, never>;
844
+ }
845
+
846
+ export { ALL_ACTIONS, AVATAR_FRAMES, ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, MES_AUTH_CONFIG, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaAvatarComponent, MaIconComponent, MaThemeDirective, MaUiConfigService, MaUserComponent, MaUserMenuColor, MaUserMenuComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, PACKAGE_VERSION, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, extractXMaPerm, mesAuthInterceptor, provideMesAuth, withXMaPerm, xMaResource };
847
+ export type { ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, AvatarFrameDef, AvatarShape, AvatarSize, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MaUiManifest, MesAuthConfig, NotificationDto, PagedList, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };