@sdcorejs/angular 19.1.4 → 19.1.6

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 (35) hide show
  1. package/README.md +2 -2
  2. package/components/preview/src/preview-pdf/pdf-worker-inline.generated.d.ts +7 -0
  3. package/components/table/src/services/table-export/table-export.service.d.ts +3 -1
  4. package/components/table/src/table.component.d.ts +1 -1
  5. package/fesm2022/sdcorejs-angular-components-preview.mjs +31 -2
  6. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  7. package/fesm2022/sdcorejs-angular-components-table.mjs +18 -3
  8. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  9. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +3 -4
  10. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  11. package/fesm2022/sdcorejs-angular-forms-date.mjs +122 -27
  12. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-forms-models.mjs +54 -2
  14. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-i18n.mjs +40 -0
  16. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-modules-layout.mjs +367 -237
  18. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  19. package/forms/date/src/date-input.util.d.ts +18 -0
  20. package/forms/date/src/date.component.d.ts +8 -1
  21. package/forms/models/index.d.ts +1 -0
  22. package/forms/models/src/sd-strict-date-adapter.d.ts +26 -0
  23. package/i18n/src/en.d.ts +8 -0
  24. package/modules/layout/components/shared/menu-tree/menu-tree.component.d.ts +6 -1
  25. package/modules/layout/components/shared/search-field/search-field.component.d.ts +9 -0
  26. package/modules/layout/components/shared/user-menu/user-menu.component.d.ts +26 -6
  27. package/modules/layout/components/sidebar-mobile-v1/components/user/user.component.d.ts +3 -11
  28. package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
  29. package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +3 -9
  30. package/modules/layout/components/sidebar-v1/main.component.d.ts +1 -0
  31. package/modules/layout/configurations/layout.configuration.d.ts +42 -3
  32. package/modules/layout/index.d.ts +1 -0
  33. package/modules/layout/utils/index.d.ts +1 -0
  34. package/modules/layout/utils/tab-name.util.d.ts +8 -0
  35. package/package.json +13 -5
@@ -0,0 +1,18 @@
1
+ export declare const DATE_DISPLAY_FORMAT = "dd/MM/yyyy";
2
+ export declare const DATE_DISPLAY_PATTERN: RegExp;
3
+ export declare const DATE_INPUT_MAX_DIGITS = 8;
4
+ /** Chèn `/` vào chuỗi số người dùng đang gõ: `22081991` → `22/08/1991`. */
5
+ export declare function formatDateInput(value: string, addTrailingSeparator: boolean): string;
6
+ /** Chuỗi còn dở dang (đang gõ) — chưa đủ `dd/MM/yyyy` nhưng vẫn đúng khuôn. */
7
+ export declare function isPartialDateInput(value: string): boolean;
8
+ /**
9
+ * Chỉ nhận đúng `dd/MM/yyyy` ĐẦY ĐỦ và có thật trên lịch.
10
+ *
11
+ * WHY chặt tay như vậy: `date-fns.parse(value, 'dd/MM/yyyy')` rất dễ dãi — nó
12
+ * nhận cả năm thiếu chữ số, nên `11/12/2` ra năm 0002 còn `11/12/20` ra năm
13
+ * 0020. Nếu để lọt, người dùng mới gõ nửa chừng đã bị coi là nhập xong.
14
+ */
15
+ export declare function parseDateInput(value: string): Date | null;
16
+ /** Giữ con trỏ đứng đúng chỗ sau khi chuỗi được chèn thêm `/`. */
17
+ export declare function getCaretPosition(value: string, selectionStart: number, formattedValue: string, addTrailingSeparator: boolean): number;
18
+ export declare function dateControlsEqual(left: Date | null, right: Date | null): boolean;
@@ -7,6 +7,11 @@ import { SdFormControl, SdViewed, SdViewedInput } from '@sdcorejs/angular/forms/
7
7
  import { Size } from '@sdcorejs/utils/models';
8
8
  import * as i0 from "@angular/core";
9
9
  type SdDateModelValue = string | number | Date | undefined | null;
10
+ type SdDateKeyupEvent = Event | {
11
+ target?: {
12
+ value?: string | null;
13
+ };
14
+ };
10
15
  export declare class SdDate implements OnDestroy, OnInit {
11
16
  #private;
12
17
  id: string;
@@ -80,7 +85,9 @@ export declare class SdDate implements OnDestroy, OnInit {
80
85
  open: () => void;
81
86
  focusInputElement(): void;
82
87
  onKeyDown: (event: KeyboardEvent) => boolean;
83
- onKeyup: (event: any) => void;
88
+ onInput: (event: Event) => void;
89
+ /** Kept as a compatibility entry point for callers that used the old keyup handler. */
90
+ onKeyup: (event: SdDateKeyupEvent) => void;
84
91
  onChange: (event: MatDatepickerInputEvent<Date>) => void;
85
92
  clear: ($event: any) => void;
86
93
  static ɵfac: i0.ɵɵFactoryDeclaration<SdDate, never>;
@@ -6,3 +6,4 @@ export type * from './src/sd-search.model';
6
6
  export * from './src/form-control-state';
7
7
  export * from './src/sd-viewed';
8
8
  export * from './src/sd-form-control-connector';
9
+ export * from './src/sd-strict-date-adapter';
@@ -0,0 +1,26 @@
1
+ import { Provider } from '@angular/core';
2
+ import { DateFnsAdapter } from '@angular/material-date-fns-adapter';
3
+ import { MatDateFormats } from '@angular/material/core';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * DateAdapter từ chối mọi chuỗi người dùng chưa gõ xong.
7
+ *
8
+ * WHY cần đến mức này: `<input matInput [matDatepicker]>` khiến Material tự
9
+ * `parse()` lại ô nhập SAU MỖI PHÍM GÕ rồi ghi thẳng kết quả vào form control.
10
+ * Adapter mặc định quá dễ dãi trên hai đường:
11
+ *
12
+ * 1. `date-fns.parse` nhận năm thiếu chữ số → `11/12/2` thành năm 0002,
13
+ * `11/12/20` thành năm 0020. Ô nhập vừa gõ dở đã bị coi là hợp lệ (cờ lỗi
14
+ * bị xoá) và control ôm một ngày rác.
15
+ * 2. `parseISO` coi chuỗi 2 chữ số là thế kỷ → xoá lùi còn `11` ra năm 1100.
16
+ *
17
+ * Cả hai đường đều bị chặn ở đây: control chỉ nhận giá trị khi người dùng thực
18
+ * sự gõ xong.
19
+ */
20
+ export declare class SdStrictDateFnsAdapter extends DateFnsAdapter {
21
+ parse(value: unknown, parseFormat: string | string[]): Date | null;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdStrictDateFnsAdapter, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<SdStrictDateFnsAdapter>;
24
+ }
25
+ /** `provideDateFnsAdapter` + ép dùng adapter parse chặt ở trên. */
26
+ export declare function provideSdStrictDateFnsAdapter(formats: MatDateFormats): Provider[];
package/i18n/src/en.d.ts CHANGED
@@ -458,6 +458,8 @@ export declare const EN_MESSAGES: {
458
458
  readonly 'core.component.table.choose-filter-hint': "Please choose a filter to start";
459
459
  readonly 'core.component.table.no-data': "No data";
460
460
  readonly 'core.component.table.export-excel': "Export Excel";
461
+ readonly 'core.component.table.exporting': "Exporting...{percent}%";
462
+ readonly 'core.component.table.export': "Export";
461
463
  readonly 'core.component.table.export-csv': "Export CSV";
462
464
  readonly 'core.component.table.showing': "Showing:";
463
465
  readonly 'core.component.table.paginator.first-page': "First page";
@@ -491,7 +493,11 @@ export declare const EN_MESSAGES: {
491
493
  readonly 'core.component.upload-file.preview-title': "Preview image";
492
494
  readonly 'core.module.layout.user.change-password': "Change password";
493
495
  readonly 'core.module.layout.user.logout': "Sign out";
496
+ readonly 'core.module.layout.user.update-profile': "Update profile";
497
+ readonly 'core.module.layout.user.setting': "Settings";
498
+ readonly 'core.module.layout.user.notification': "Notifications";
494
499
  readonly 'core.module.layout.sidebar.search': "Search";
500
+ readonly 'core.module.layout.sidebar.toggle': "Toggle sidebar";
495
501
  readonly 'core.module.layout.greeting.hello': "Hello, {name}";
496
502
  readonly 'core.module.layout.weekday.0': "Sunday";
497
503
  readonly 'core.module.layout.weekday.1': "Monday";
@@ -508,6 +514,8 @@ export declare const EN_MESSAGES: {
508
514
  readonly 'core.module.layout.not-found.message': "The page you're looking for doesn't exist or has been removed. Please check the URL or go back to the home page to continue.";
509
515
  readonly 'core.module.layout.not-found.back': "Go back";
510
516
  readonly 'core.module.layout.home.tab-name': "Home";
517
+ readonly 'core.module.layout.not-found.tab-name': "Page Not Found";
518
+ readonly 'core.module.layout.forbidden.tab-name': "Access Denied";
511
519
  readonly 'core.module.layout.home.feature.data': "Data";
512
520
  readonly 'core.module.layout.home.feature.reports': "Reports";
513
521
  readonly 'core.module.layout.home.feature.users': "Users";
@@ -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 {
@@ -2,5 +2,6 @@ export * from './modules';
2
2
  export * from './services';
3
3
  export * from './components';
4
4
  export * from './configurations';
5
+ export * from './utils';
5
6
  export * from './pipes';
6
7
  export * from './layout.module';
@@ -0,0 +1 @@
1
+ export * from './tab-name.util';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Resolve a translated tab name for `@SdTabComponent`.
3
+ *
4
+ * WHY not I18nService: the decorator runs at module-evaluation time, before
5
+ * Angular's DI exists, so the service cannot be injected. We read the language
6
+ * the app persisted and look the key up in the static catalog instead.
7
+ */
8
+ export declare function resolveTabName(key: string): string;
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@sdcorejs/angular",
3
- "version": "19.1.4",
3
+ "version": "19.1.6",
4
4
  "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/sdcorejs/sdcorejs-angular.git"
8
+ },
9
+ "homepage": "https://sdcorejs.github.io/sdcorejs-angular/",
10
+ "bugs": {
11
+ "url": "https://github.com/sdcorejs/sdcorejs-angular/issues"
12
+ },
5
13
  "peerDependencies": {
6
14
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
7
15
  "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
@@ -35,14 +43,14 @@
35
43
  "types": "./index.d.ts",
36
44
  "default": "./fesm2022/sdcorejs-angular.mjs"
37
45
  },
38
- "./components": {
39
- "types": "./components/index.d.ts",
40
- "default": "./fesm2022/sdcorejs-angular-components.mjs"
41
- },
42
46
  "./configurations": {
43
47
  "types": "./configurations/index.d.ts",
44
48
  "default": "./fesm2022/sdcorejs-angular-configurations.mjs"
45
49
  },
50
+ "./components": {
51
+ "types": "./components/index.d.ts",
52
+ "default": "./fesm2022/sdcorejs-angular-components.mjs"
53
+ },
46
54
  "./directives": {
47
55
  "types": "./directives/index.d.ts",
48
56
  "default": "./fesm2022/sdcorejs-angular-directives.mjs"