@sdcorejs/angular 19.1.4 → 19.1.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/i18n/src/en.d.ts CHANGED
@@ -491,7 +491,11 @@ export declare const EN_MESSAGES: {
491
491
  readonly 'core.component.upload-file.preview-title': "Preview image";
492
492
  readonly 'core.module.layout.user.change-password': "Change password";
493
493
  readonly 'core.module.layout.user.logout': "Sign out";
494
+ readonly 'core.module.layout.user.update-profile': "Update profile";
495
+ readonly 'core.module.layout.user.setting': "Settings";
496
+ readonly 'core.module.layout.user.notification': "Notifications";
494
497
  readonly 'core.module.layout.sidebar.search': "Search";
498
+ readonly 'core.module.layout.sidebar.toggle': "Toggle sidebar";
495
499
  readonly 'core.module.layout.greeting.hello': "Hello, {name}";
496
500
  readonly 'core.module.layout.weekday.0': "Sunday";
497
501
  readonly 'core.module.layout.weekday.1': "Monday";
@@ -9,6 +9,7 @@ interface SdLayoutMenuTreeNode {
9
9
  isGroup: boolean;
10
10
  isActive: boolean;
11
11
  isPinned: boolean;
12
+ isPinVisible: boolean;
12
13
  }
13
14
  export declare class SdLayoutMenuTreeComponent {
14
15
  #private;
@@ -17,12 +18,16 @@ export declare class SdLayoutMenuTreeComponent {
17
18
  activePath: import("@angular/core").InputSignal<string>;
18
19
  pinnedKeys: import("@angular/core").InputSignal<string[]>;
19
20
  showPin: import("@angular/core").InputSignal<boolean>;
21
+ pinVisibility: import("@angular/core").InputSignal<"hover" | "always">;
20
22
  navigate: import("@angular/core").OutputEmitterRef<SdLayoutRootMenu>;
21
23
  togglePinned: import("@angular/core").OutputEmitterRef<SdLayoutMenu>;
22
24
  nodes: import("@angular/core").Signal<SdLayoutMenuTreeNode[]>;
25
+ constructor();
23
26
  onNavigate(menu: SdLayoutMenu): void;
24
27
  onTogglePinned(event: MouseEvent, menu: SdLayoutMenu): void;
28
+ onPinHoverStart(key: string): void;
29
+ onPinHoverEnd(key: string): void;
25
30
  static ɵfac: i0.ɵɵFactoryDeclaration<SdLayoutMenuTreeComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<SdLayoutMenuTreeComponent, "sd-layout-menu-tree", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; "isSignal": true; }; "activePath": { "alias": "activePath"; "required": false; "isSignal": true; }; "pinnedKeys": { "alias": "pinnedKeys"; "required": false; "isSignal": true; }; "showPin": { "alias": "showPin"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; "togglePinned": "togglePinned"; }, never, never, true, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdLayoutMenuTreeComponent, "sd-layout-menu-tree", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; "isSignal": true; }; "activePath": { "alias": "activePath"; "required": false; "isSignal": true; }; "pinnedKeys": { "alias": "pinnedKeys"; "required": false; "isSignal": true; }; "showPin": { "alias": "showPin"; "required": false; "isSignal": true; }; "pinVisibility": { "alias": "pinVisibility"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; "togglePinned": "togglePinned"; }, never, never, true, never>;
27
32
  }
28
33
  export {};
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class SdLayoutSearchFieldComponent {
3
+ model: import("@angular/core").InputSignal<string>;
4
+ placeholder: import("@angular/core").InputSignal<string>;
5
+ autoId: import("@angular/core").InputSignal<string>;
6
+ sdChange: import("@angular/core").OutputEmitterRef<string>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdLayoutSearchFieldComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdLayoutSearchFieldComponent, "sd-layout-search-field", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": true; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": true; "isSignal": true; }; }, { "sdChange": "sdChange"; }, never, never, true, never>;
9
+ }
@@ -1,18 +1,35 @@
1
- import { SdLayoutUserInfo } from '../../../configurations';
1
+ import { SdLayoutAccountAction, SdLayoutNotificationConfiguration, SdLayoutUserInfo } from '../../../configurations';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class SdLayoutUserMenuComponent {
4
4
  #private;
5
5
  private readonly trigger;
6
6
  private readonly menu;
7
7
  userInfo: import("@angular/core").InputSignal<SdLayoutUserInfo>;
8
- signout: import("@angular/core").InputSignal<(() => void | Promise<void>) | undefined>;
9
- changePassword: import("@angular/core").InputSignal<(() => void | Promise<void>) | undefined>;
8
+ signout: import("@angular/core").InputSignal<SdLayoutAccountAction | undefined>;
9
+ changePassword: import("@angular/core").InputSignal<SdLayoutAccountAction | undefined>;
10
+ updateProfile: import("@angular/core").InputSignal<SdLayoutAccountAction | undefined>;
11
+ setting: import("@angular/core").InputSignal<SdLayoutAccountAction | undefined>;
12
+ notification: import("@angular/core").InputSignal<SdLayoutNotificationConfiguration | undefined>;
10
13
  compact: import("@angular/core").InputSignal<boolean>;
14
+ presentation: import("@angular/core").InputSignal<"disclosure" | "mobile" | "mobile-inline">;
15
+ opened: import("@angular/core").OutputEmitterRef<void>;
16
+ closed: import("@angular/core").OutputEmitterRef<void>;
11
17
  isOpen: import("@angular/core").WritableSignal<boolean>;
12
18
  avatar: import("@angular/core").Signal<string | undefined>;
13
19
  displayName: import("@angular/core").Signal<string>;
14
- signoutAction: import("@angular/core").Signal<(() => void | Promise<void>) | undefined>;
15
- changePasswordAction: import("@angular/core").Signal<(() => void | Promise<void>) | undefined>;
20
+ role: import("@angular/core").Signal<{
21
+ text: string;
22
+ icon?: string;
23
+ color?: string;
24
+ } | undefined>;
25
+ signoutAction: import("@angular/core").Signal<SdLayoutAccountAction | undefined>;
26
+ changePasswordAction: import("@angular/core").Signal<SdLayoutAccountAction | undefined>;
27
+ updateProfileAction: import("@angular/core").Signal<SdLayoutAccountAction | undefined>;
28
+ settingAction: import("@angular/core").Signal<SdLayoutAccountAction | undefined>;
29
+ notificationConfiguration: import("@angular/core").Signal<SdLayoutNotificationConfiguration | undefined>;
30
+ notificationAction: import("@angular/core").Signal<SdLayoutAccountAction | undefined>;
31
+ notificationCount: import("@angular/core").Signal<number>;
32
+ notificationBadge: import("@angular/core").Signal<string | undefined>;
16
33
  constructor();
17
34
  open(): void;
18
35
  toggle(): void;
@@ -20,6 +37,9 @@ export declare class SdLayoutUserMenuComponent {
20
37
  onMenuKeydown(event: KeyboardEvent): void;
21
38
  runChangePassword(): void;
22
39
  runSignout(): void;
40
+ runUpdateProfile(): void;
41
+ runSetting(): void;
42
+ runNotification(): void;
23
43
  static ɵfac: i0.ɵɵFactoryDeclaration<SdLayoutUserMenuComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<SdLayoutUserMenuComponent, "sd-layout-user-menu", never, { "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "signout": { "alias": "signout"; "required": false; "isSignal": true; }; "changePassword": { "alias": "changePassword"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdLayoutUserMenuComponent, "sd-layout-user-menu", never, { "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "signout": { "alias": "signout"; "required": false; "isSignal": true; }; "changePassword": { "alias": "changePassword"; "required": false; "isSignal": true; }; "updateProfile": { "alias": "updateProfile"; "required": false; "isSignal": true; }; "setting": { "alias": "setting"; "required": false; "isSignal": true; }; "notification": { "alias": "notification"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "presentation": { "alias": "presentation"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
25
45
  }
@@ -1,7 +1,6 @@
1
1
  import { SdLayoutUserInfo } from '../../../../configurations';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class LayoutUserComponent {
4
- #private;
5
4
  isMobileOrTablet: import("@angular/core").InputSignal<boolean>;
6
5
  isMenuLock: import("@angular/core").InputSignal<boolean>;
7
6
  isShowSidebar: import("@angular/core").InputSignal<boolean>;
@@ -9,16 +8,9 @@ export declare class LayoutUserComponent {
9
8
  menuClosed: import("@angular/core").OutputEmitterRef<void>;
10
9
  menuOpened: import("@angular/core").OutputEmitterRef<void>;
11
10
  toggleMenuLock: import("@angular/core").OutputEmitterRef<Event>;
12
- singoutLayoutConfig: () => void | Promise<void>;
13
- changePasswordLayoutConfig: (() => void | Promise<void>) | undefined;
14
- isExpanded: import("@angular/core").WritableSignal<boolean>;
15
- onMenuOpened: () => void;
16
- onMenuClosed: () => void;
17
- keepOpenWhenClickInsideMenu: (event: Event) => void;
18
- toggleExpanded: () => void;
19
- logout: () => void;
20
- changePassword: () => void;
21
- onToggleMenuLock: (event: Event) => void;
11
+ onMenuOpened(): void;
12
+ onMenuClosed(): void;
13
+ onToggleMenuLock(event: Event): void;
22
14
  static ɵfac: i0.ɵɵFactoryDeclaration<LayoutUserComponent, never>;
23
15
  static ɵcmp: i0.ɵɵComponentDeclaration<LayoutUserComponent, "lib-layout-user", never, { "isMobileOrTablet": { "alias": "isMobileOrTablet"; "required": false; "isSignal": true; }; "isMenuLock": { "alias": "isMenuLock"; "required": false; "isSignal": true; }; "isShowSidebar": { "alias": "isShowSidebar"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; }, { "menuClosed": "menuClosed"; "menuOpened": "menuOpened"; "toggleMenuLock": "toggleMenuLock"; }, never, never, true, never>;
24
16
  }
@@ -23,6 +23,7 @@ export declare class SidebarComponent {
23
23
  menusByGroup: import("@angular/core").WritableSignal<SdLayoutMenu[]>;
24
24
  pinnedMenuGroup: import("@angular/core").Signal<SdLayoutChildrenMenu>;
25
25
  totalMenuInMenusByGroup: import("@angular/core").Signal<number>;
26
+ logoUrl: import("@angular/core").Signal<string | undefined>;
26
27
  pinnedNodeKeys: import("@angular/core").Signal<Set<string>>;
27
28
  isPinnedMenuGroupActive: import("@angular/core").Signal<boolean>;
28
29
  dataSource: MatTreeNestedDataSource<SdLayoutMenu>;
@@ -1,7 +1,6 @@
1
1
  import { SdLayoutUserInfo } from '../../../../configurations';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class LayoutUserComponent {
4
- #private;
5
4
  isMobileOrTablet: import("@angular/core").InputSignal<boolean>;
6
5
  isMenuLock: import("@angular/core").InputSignal<boolean>;
7
6
  isShowSidebar: import("@angular/core").InputSignal<boolean>;
@@ -9,14 +8,9 @@ export declare class LayoutUserComponent {
9
8
  menuClosed: import("@angular/core").OutputEmitterRef<void>;
10
9
  menuOpened: import("@angular/core").OutputEmitterRef<void>;
11
10
  toggleMenuLock: import("@angular/core").OutputEmitterRef<Event>;
12
- singoutLayoutConfig: () => void | Promise<void>;
13
- changePasswordLayoutConfig: (() => void | Promise<void>) | undefined;
14
- onMenuOpened: () => void;
15
- onMenuClosed: () => void;
16
- keepOpenWhenClickInsideMenu: (event: Event) => void;
17
- logout: () => void;
18
- changePassword: () => void;
19
- onToggleMenuLock: (event: Event) => void;
11
+ onMenuOpened(): void;
12
+ onMenuClosed(): void;
13
+ onToggleMenuLock(event: Event): void;
20
14
  static ɵfac: i0.ɵɵFactoryDeclaration<LayoutUserComponent, never>;
21
15
  static ɵcmp: i0.ɵɵComponentDeclaration<LayoutUserComponent, "lib-layout-user", never, { "isMobileOrTablet": { "alias": "isMobileOrTablet"; "required": false; "isSignal": true; }; "isMenuLock": { "alias": "isMenuLock"; "required": false; "isSignal": true; }; "isShowSidebar": { "alias": "isShowSidebar"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; }, { "menuClosed": "menuClosed"; "menuOpened": "menuOpened"; "toggleMenuLock": "toggleMenuLock"; }, never, never, true, never>;
22
16
  }
@@ -18,6 +18,7 @@ export declare class SidebarV1Component {
18
18
  onPopupOfSideBarClosed: () => void;
19
19
  onExpandSideBar: () => void;
20
20
  onMouseleaveSideBar: () => void;
21
+ onSidenavOpenedChange: (opened: boolean) => void;
21
22
  onToggle: (data: boolean | null) => void;
22
23
  static ɵfac: i0.ɵɵFactoryDeclaration<SidebarV1Component, never>;
23
24
  static ɵcmp: i0.ɵɵComponentDeclaration<SidebarV1Component, "sidebar-v1", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; "isMobile": { "alias": "isMobile"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
@@ -1,12 +1,46 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { InjectionToken, Signal } from '@angular/core';
2
2
  import { MaybeAsync } from '@sdcorejs/utils/models';
3
+ import { Observable } from 'rxjs';
4
+ /** Consumer-owned account action invoked without arguments by the shared user menu. */
5
+ export type SdLayoutAccountAction = () => void | Promise<void>;
6
+ /** Notification badge source and the action that opens the consumer's notification experience. */
7
+ export interface SdLayoutNotificationConfiguration {
8
+ /**
9
+ * Số lượng thông báo chưa đọc. Hỗ trợ giá trị tĩnh hoặc nguồn reactive dài hạn.
10
+ */
11
+ count: number | Signal<number> | Observable<number>;
12
+ /**
13
+ * Tác vụ do consumer xử lý khi người dùng chọn thông báo.
14
+ */
15
+ action: SdLayoutAccountAction;
16
+ }
3
17
  export interface ISdLayoutConfiguration {
4
18
  homeUrl?: string;
5
19
  mobileBreakpoint?: number;
6
20
  sidebar: ISdSidebarConfiguration | (() => MaybeAsync<ISdSidebarConfiguration>);
7
21
  userInfo: SdLayoutUserInfo | (() => MaybeAsync<SdLayoutUserInfo>);
8
- signout: () => void | Promise<void>;
9
- changePassword?: () => void | Promise<void>;
22
+ signout: SdLayoutAccountAction;
23
+ changePassword?: SdLayoutAccountAction;
24
+ /**
25
+ * Tác vụ chỉnh sửa hồ sơ do consumer cung cấp.
26
+ */
27
+ updateProfile?: SdLayoutAccountAction;
28
+ /**
29
+ * Tác vụ mở thiết lập tài khoản do consumer cung cấp.
30
+ */
31
+ setting?: SdLayoutAccountAction;
32
+ /**
33
+ * Cấu hình số lượng và tác vụ thông báo của tài khoản.
34
+ */
35
+ notification?: SdLayoutNotificationConfiguration;
36
+ }
37
+ /** Optional role metadata rendered below the user's email when `text` is non-empty. */
38
+ export interface SdLayoutUserRole {
39
+ text: string;
40
+ /** Icon name resolved by `SdIcon`. */
41
+ icon?: string;
42
+ /** CSS color applied to the role metadata. */
43
+ color?: string;
10
44
  }
11
45
  export interface SdLayoutUserInfo {
12
46
  /**
@@ -30,6 +64,11 @@ export interface SdLayoutUserInfo {
30
64
  * Hỗ trợ các định dạng: URL (http/https), chuỗi base64 (data:image), hoặc đường dẫn nội bộ.
31
65
  */
32
66
  avatar?: string;
67
+ /**
68
+ * Chức vụ hoặc vai trò hiển thị cùng thông tin người dùng.
69
+ * Không render khi `text` rỗng.
70
+ */
71
+ role?: SdLayoutUserRole;
33
72
  }
34
73
  export declare const DEFAULT_LAYOUT_MOBILE_BREAKPOINT = 1024;
35
74
  export interface SidebarConfigurationBase {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdcorejs/angular",
3
- "version": "19.1.4",
3
+ "version": "19.1.5",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",