@sdcorejs/angular 21.3.0 → 21.3.2

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 (199) hide show
  1. package/README.md +2 -2
  2. package/assets/STYLE-GUIDE.md +25 -5
  3. package/assets/THEME.md +237 -5
  4. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  5. package/assets/scss/ckeditor5.scss +2 -88
  6. package/assets/scss/core/_control.scss +39 -0
  7. package/assets/scss/core/form.scss +156 -45
  8. package/assets/scss/core/view.scss +24 -0
  9. package/assets/scss/editor-content.scss +173 -0
  10. package/assets/scss/sd-core.scss +1 -0
  11. package/assets/scss/themes/_component-tokens.scss +93 -31
  12. package/assets/scss/themes/_material-tokens.scss +112 -0
  13. package/assets/scss/themes/_presets.scss +25 -0
  14. package/assets/scss/themes/_scales.scss +10 -0
  15. package/assets/scss/themes/_semantic.scss +13 -0
  16. package/assets/scss/themes/default.scss +8 -2
  17. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  18. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  20. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs +542 -24
  22. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-button.mjs +31 -3
  24. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  26. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  28. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  30. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  32. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2209 -106
  34. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2616 -1054
  36. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  38. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  40. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  42. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  44. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-components-kanban.mjs +451 -0
  46. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -0
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  48. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  49. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  50. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  51. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  52. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  53. package/fesm2022/sdcorejs-angular-components-operator.mjs +260 -43
  54. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  55. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  56. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  57. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  58. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  59. package/fesm2022/sdcorejs-angular-components-section.mjs +5 -4
  60. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  61. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  62. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-components-stepper.mjs +5 -1
  64. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  65. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +192 -42
  66. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  67. package/fesm2022/sdcorejs-angular-components-tab.mjs +12 -4
  68. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  69. package/fesm2022/sdcorejs-angular-components-table.mjs +564 -110
  70. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  71. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  72. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  73. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +1 -1
  74. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  75. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  76. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-components-window.mjs +484 -0
  78. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  79. package/fesm2022/sdcorejs-angular-components.mjs +2 -0
  80. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  81. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  82. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  83. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +15 -2
  85. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  87. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +454 -125
  89. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +75 -13
  91. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-date.mjs +71 -18
  93. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +75 -16
  95. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  97. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  99. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  100. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  101. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  102. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +40 -5
  103. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  104. package/fesm2022/sdcorejs-angular-forms-input.mjs +50 -7
  105. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  107. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  109. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +243 -0
  111. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -0
  112. package/fesm2022/sdcorejs-angular-forms-select.mjs +63 -15
  113. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  114. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  115. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  116. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +2 -2
  117. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  118. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  119. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  120. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  121. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  122. package/fesm2022/sdcorejs-angular-forms.mjs +8 -0
  123. package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
  124. package/fesm2022/sdcorejs-angular-i18n.mjs +1830 -17
  125. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  126. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  127. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  128. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs +478 -0
  129. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs +214 -0
  131. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs +277 -0
  133. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs +1556 -0
  135. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs.map +1 -0
  136. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  137. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  138. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  139. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  140. package/fesm2022/sdcorejs-angular-modules-layout.mjs +1825 -62
  141. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  142. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  143. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  144. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  145. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  146. package/fesm2022/sdcorejs-angular-services-confirm.mjs +2 -2
  147. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  148. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  149. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  151. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  152. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  153. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  154. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  155. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  156. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  157. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  158. package/package.json +48 -7
  159. package/types/sdcorejs-angular-components-avatar.d.ts +67 -2
  160. package/types/sdcorejs-angular-components-badge.d.ts +188 -6
  161. package/types/sdcorejs-angular-components-button.d.ts +20 -1
  162. package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +3 -18
  163. package/types/sdcorejs-angular-components-editor-engine.d.ts +246 -0
  164. package/types/sdcorejs-angular-components-editor.d.ts +20 -17
  165. package/types/sdcorejs-angular-components-file-explorer.d.ts +449 -57
  166. package/types/sdcorejs-angular-components-form-generic.d.ts +301 -37
  167. package/types/sdcorejs-angular-components-kanban.d.ts +179 -0
  168. package/types/sdcorejs-angular-components-mini-editor.d.ts +33 -70
  169. package/types/sdcorejs-angular-components-modal-resizable.d.ts +1 -124
  170. package/types/sdcorejs-angular-components-operator.d.ts +137 -8
  171. package/types/sdcorejs-angular-components-section.d.ts +2 -1
  172. package/types/sdcorejs-angular-components-tab-router.d.ts +31 -18
  173. package/types/sdcorejs-angular-components-tab.d.ts +3 -1
  174. package/types/sdcorejs-angular-components-table.d.ts +84 -6
  175. package/types/sdcorejs-angular-components-window.d.ts +81 -0
  176. package/types/sdcorejs-angular-components.d.ts +2 -0
  177. package/types/sdcorejs-angular-configurations.d.ts +8 -1
  178. package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -0
  179. package/types/sdcorejs-angular-forms-chip-calendar.d.ts +163 -18
  180. package/types/sdcorejs-angular-forms-date-range.d.ts +24 -2
  181. package/types/sdcorejs-angular-forms-date.d.ts +23 -2
  182. package/types/sdcorejs-angular-forms-directives.d.ts +47 -2
  183. package/types/sdcorejs-angular-forms-input-number.d.ts +23 -2
  184. package/types/sdcorejs-angular-forms-input.d.ts +23 -2
  185. package/types/sdcorejs-angular-forms-models.d.ts +38 -3
  186. package/types/sdcorejs-angular-forms-segmented.d.ts +90 -0
  187. package/types/sdcorejs-angular-forms-select.d.ts +32 -2
  188. package/types/sdcorejs-angular-forms.d.ts +8 -6
  189. package/types/sdcorejs-angular-i18n.d.ts +360 -1
  190. package/types/sdcorejs-angular-modules-generic.d.ts +316 -0
  191. package/types/sdcorejs-angular-modules-icon.d.ts +37 -6
  192. package/types/sdcorejs-angular-modules-layout.d.ts +536 -86
  193. package/types/sdcorejs-angular-modules.d.ts +1 -0
  194. package/types/sdcorejs-angular-pipes.d.ts +2 -0
  195. package/types/sdcorejs-angular-services-date-time.d.ts +57 -0
  196. package/types/sdcorejs-angular-services-storage.d.ts +8 -1
  197. package/types/sdcorejs-angular-services.d.ts +1 -0
  198. package/types/sdcorejs-angular-utilities-read-state.d.ts +2 -0
  199. package/types/sdcorejs-angular-utilities-theme.d.ts +1 -1
@@ -1,13 +1,14 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InjectionToken, Signal, PipeTransform } from '@angular/core';
2
+ import { Signal, InjectionToken, PipeTransform } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import * as i1 from '@angular/router';
5
5
  import { Params } from '@angular/router';
6
6
  import { SdStorage } from '@sdcorejs/angular/services';
7
- import { SdViewport } from '@sdcorejs/angular/services/viewport';
8
- import * as _sdcorejs_angular_modules_layout from '@sdcorejs/angular/modules/layout';
9
7
  import { MaybeAsync } from '@sdcorejs/utils/models';
10
8
  import { Observable } from 'rxjs';
9
+ import { SdViewport } from '@sdcorejs/angular/services/viewport';
10
+ import * as _sdcorejs_angular_modules_layout from '@sdcorejs/angular/modules/layout';
11
+ import { FlexibleConnectedPositionStrategyOrigin, ConnectedPosition } from '@angular/cdk/overlay';
11
12
 
12
13
  declare class HomeRoutingModule {
13
14
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HomeRoutingModule, never>;
@@ -35,6 +36,23 @@ declare class ForbiddenModule {
35
36
 
36
37
  type SdLayoutMenu = SdLayoutRootMenu | SdLayoutChildrenMenu;
37
38
  type Menus = SdLayoutMenu[];
39
+ /**
40
+ * Amount of work the user must handle from this menu, such as 3 pending approvals.
41
+ * `neutral` (default) renders a plain count; `warning` and `error` render an attention pill.
42
+ */
43
+ interface SdLayoutMenuBadge {
44
+ value: number | string;
45
+ tone?: 'neutral' | 'warning' | 'error';
46
+ }
47
+ /**
48
+ * Informational system or connection state, such as "1 running" or "Connected"; it asks for no action.
49
+ * `live` adds a ring around the status dot.
50
+ */
51
+ interface SdLayoutMenuStatus {
52
+ label: string;
53
+ tone: 'success' | 'warning' | 'error';
54
+ live?: boolean;
55
+ }
38
56
  interface SdLayoutRootMenu {
39
57
  id?: string;
40
58
  path: string;
@@ -46,6 +64,14 @@ interface SdLayoutRootMenu {
46
64
  permission: string | string[] | boolean | (() => boolean);
47
65
  level?: number;
48
66
  tooltipTitle?: string;
67
+ /** Section heading this top-level menu is grouped under. Rendered by sidebar V4 only. */
68
+ section?: string;
69
+ /** Rendered by sidebar V4 only. */
70
+ badge?: SdLayoutMenuBadge;
71
+ /** Rendered by sidebar V4 only. */
72
+ status?: SdLayoutMenuStatus;
73
+ /** Sidebar V4 shows the item as aria-disabled, never navigates and leaves it out of search. */
74
+ comingSoon?: boolean;
49
75
  }
50
76
  interface SdLayoutChildrenMenu {
51
77
  id?: string;
@@ -55,85 +81,14 @@ interface SdLayoutChildrenMenu {
55
81
  children?: (SdLayoutRootMenu | SdLayoutChildrenMenu)[];
56
82
  level?: number;
57
83
  tooltipTitle?: string;
58
- }
59
-
60
- /**
61
- * Namespace áp cho toàn bộ state layout được persist — hằng chuỗi, hoặc hàm resolve lại mỗi lần đọc
62
- * (dùng cho danh tính chỉ biết được SAU khi đăng nhập, ví dụ id user hoặc tenant).
63
- */
64
- type SdLayoutStorageNamespace = string | (() => string | null | undefined);
65
- /**
66
- * Namespace do consumer cung cấp cho toàn bộ state layout được persist (thường là id user hoặc tenant).
67
- *
68
- * why: các key dưới đây là UUID CỐ ĐỊNH, không gắn với ai cả. Trên máy dùng chung, user A đăng xuất
69
- * rồi user B đăng nhập thì `pinnedMenuKeys` / `recentMenuKeys` / `lastActiveMenuGroupId` của A vẫn
70
- * còn nguyên trong localStorage và B nhìn thấy đúng những module A đã ghim và vừa truy cập. Cấp
71
- * namespace theo user/tenant sẽ tách hẳn không gian lưu trữ.
72
- *
73
- * ⚠️ `SdLayoutStorageService` là singleton `providedIn: 'root'`, thường được khởi tạo TRƯỚC khi biết
74
- * người dùng là ai. Vì vậy hãy cấp một **hàm** — nó được gọi lại ở mỗi lần truy cập handle, nên khi
75
- * danh tính đến (hoặc đổi) thì cả bảy handle tự dựng lại trên namespace mới:
76
- *
77
- * ```ts
78
- * providers: [
79
- * {
80
- * provide: SD_LAYOUT_STORAGE_NAMESPACE,
81
- * useFactory: () => {
82
- * const auth = inject(SdAuthService);
83
- * return () => auth.getAuthInfo?.()?.id;
84
- * },
85
- * },
86
- * ];
87
- * ```
88
- *
89
- * Đây là biện pháp bổ sung chứ không thay thế `SdLayoutStorageService.clear()` lúc signout.
90
- */
91
- declare const SD_LAYOUT_STORAGE_NAMESPACE: InjectionToken<SdLayoutStorageNamespace>;
92
- declare class SdLayoutStorageService {
93
- #private;
94
- get isShowSidebar(): SdStorage<boolean>;
95
- get menuLockStatus(): SdStorage<boolean>;
96
- get lastActiveMenuGroupId(): SdStorage<string>;
97
- get pinnedMenuGroup(): SdStorage<SdLayoutChildrenMenu>;
98
- get pinnedMenuKeys(): SdStorage<string[]>;
99
- get recentMenuKeys(): SdStorage<string[]>;
100
- get versionStates(): SdStorage<Record<string, SdLayoutVersionState>>;
101
- /**
102
- * Xoá toàn bộ state layout đã persist.
103
- *
104
- * **Consumer PHẢI gọi hàm này trong luồng signout, TRƯỚC khi danh tính bị xoá.** Nếu không,
105
- * pinned/recent/last-active của user vừa đăng xuất sẽ còn lại trên trình duyệt và hiện ra cho người
106
- * đăng nhập kế tiếp — rò rỉ tên module nội bộ mà người đó có thể không có quyền thấy.
107
- *
108
- * why: khi đã cấu hình `SD_LAYOUT_STORAGE_NAMESPACE` theo user, namespace được resolve NGAY LÚC GỌI.
109
- * Gọi `clear()` sau khi auth info về `undefined` sẽ xoá nhầm partition không-namespace, còn dữ liệu
110
- * của user vừa thoát thì vẫn nguyên.
111
- */
112
- clear(): void;
113
- readPinnedMenuKeys(menus: SdLayoutMenu[]): string[];
114
- writePinnedMenuKeys(keys: string[]): void;
115
- readRecentMenuKeys(menus: SdLayoutMenu[], maximum?: number): string[];
116
- writeRecentMenuKeys(keys: string[]): void;
117
- readVersionState(version: 1 | 2 | 3): SdLayoutVersionState;
118
- patchVersionState(version: 1 | 2 | 3, patch: SdLayoutVersionState): SdLayoutVersionState;
119
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutStorageService, never>;
120
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutStorageService>;
121
- }
122
- interface SdLayoutVersionState {
123
- activeGroupKey?: string;
124
- locked?: boolean;
125
- collapsed?: boolean;
126
- }
127
-
128
- type SdLayoutViewport = SdViewport;
129
- declare const SD_LAYOUT_VIEWPORT: _angular_core.InjectionToken<SdViewport | null>;
130
- /** @deprecated Prefer `SdViewportService` from `@sdcorejs/angular/services/viewport`. */
131
- declare class SdLayoutResponsiveService {
132
- #private;
133
- readonly viewportWidth: _angular_core.Signal<number>;
134
- isMobile(breakpoint: number): boolean;
135
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutResponsiveService, never>;
136
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutResponsiveService>;
84
+ /** Section heading this top-level menu is grouped under. Rendered by sidebar V4 only. */
85
+ section?: string;
86
+ /** Rendered by sidebar V4 only. */
87
+ badge?: SdLayoutMenuBadge;
88
+ /** Rendered by sidebar V4 only. */
89
+ status?: SdLayoutMenuStatus;
90
+ /** Sidebar V4 shows the item as aria-disabled, never navigates and leaves it and its children out of search. */
91
+ comingSoon?: boolean;
137
92
  }
138
93
 
139
94
  /** Consumer-owned account action invoked without arguments by the shared user menu. */
@@ -206,6 +161,30 @@ interface SdLayoutUserInfo {
206
161
  role?: SdLayoutUserRole;
207
162
  }
208
163
  declare const DEFAULT_LAYOUT_MOBILE_BREAKPOINT = 1024;
164
+ /** A context the signed-in user can switch between (for example a store or a legal entity). */
165
+ interface SdLayoutContext {
166
+ /** Stable identifier that Core persists and matches against the configured `items`. */
167
+ id: string;
168
+ /** Display name shown in the switcher. */
169
+ title: string;
170
+ /** Secondary line shown below the title. */
171
+ subtitle?: string;
172
+ /** Avatar image URL; the initial of `title` is shown when it is missing or fails to load. */
173
+ avatar?: string;
174
+ }
175
+ /**
176
+ * Context switcher configuration shared by sidebar versions 1–4.
177
+ * The consumer only assigns `items`; Core persists and restores the current context and reloads the page after a switch.
178
+ * Read the current context with `SdLayoutContextService.getCurrentContext()`.
179
+ */
180
+ interface SdLayoutContextConfiguration {
181
+ /** Name of the context kind shown in the switcher. Defaults to the translated "Context" label. */
182
+ label?: string;
183
+ /** Contexts the user can switch between. An empty list hides the switcher. */
184
+ items: SdLayoutContext[];
185
+ /** Forces the search box on or off. By default it is shown when there are more than 7 items. */
186
+ searchable?: boolean;
187
+ }
209
188
  interface SidebarConfigurationBase {
210
189
  brandColor?: string;
211
190
  brandLightColor?: string;
@@ -214,8 +193,14 @@ interface SidebarConfigurationBase {
214
193
  pin?: {
215
194
  enabled?: boolean;
216
195
  };
196
+ /**
197
+ * Context switcher rendered in the sidebar header. The consumer only assigns `items`;
198
+ * Core persists and restores the current context and reloads the page on switch.
199
+ * Read it with `SdLayoutContextService.getCurrentContext()`.
200
+ */
201
+ context?: SdLayoutContextConfiguration;
217
202
  }
218
- type ISdSidebarConfiguration = SidebarConfigurationV1 | SidebarConfigurationV2 | SidebarConfigurationV3;
203
+ type ISdSidebarConfiguration = SidebarConfigurationV1 | SidebarConfigurationV2 | SidebarConfigurationV3 | SidebarConfigurationV4;
219
204
  interface SidebarConfigurationV1 extends SidebarConfigurationBase {
220
205
  version: 1;
221
206
  /**
@@ -262,6 +247,20 @@ interface SidebarConfigurationV3 extends SidebarConfigurationBase {
262
247
  maxItems?: number;
263
248
  };
264
249
  }
250
+ /** Sidebar V4: V3 behaviour (collapse, pinned, recent) with token-driven colours; `brandColor`/`brandLightColor` are ignored. */
251
+ interface SidebarConfigurationV4 extends Omit<SidebarConfigurationV3, 'version'> {
252
+ version: 4;
253
+ /** Shape of the active/hover item highlight. @default 'pill' */
254
+ itemShape?: 'pill' | 'soft';
255
+ /** Row height: `compact` 36/32px, `comfortable` 40/34px. @default 'compact' */
256
+ density?: 'compact' | 'comfortable';
257
+ /** How a group opens while the rail is collapsed. @default 'flyout' */
258
+ collapsedGroup?: 'flyout' | 'expand';
259
+ /** Mobile shell options. `bottomBar` lists at most 4 menu ids shown in the bottom navigation bar. */
260
+ mobile?: {
261
+ bottomBar?: string[];
262
+ };
263
+ }
265
264
  interface ResolvedSidebarRecentConfiguration {
266
265
  enabled: boolean;
267
266
  maxItems: number;
@@ -272,8 +271,106 @@ declare function resolveSidebarV3Recent(sidebar: SidebarConfigurationV3): Resolv
272
271
  declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV1): SidebarConfigurationV1;
273
272
  declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV2): SidebarConfigurationV2;
274
273
  declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV3): SidebarConfigurationV3;
274
+ declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV4): SidebarConfigurationV4;
275
275
  declare const SD_LAYOUT_CONFIGURATION: InjectionToken<ISdLayoutConfiguration>;
276
276
 
277
+ /**
278
+ * Namespace áp cho toàn bộ state layout được persist — hằng chuỗi, hoặc hàm resolve lại mỗi lần đọc
279
+ * (dùng cho danh tính chỉ biết được SAU khi đăng nhập, ví dụ id user hoặc tenant).
280
+ */
281
+ type SdLayoutStorageNamespace = string | (() => string | null | undefined);
282
+ /**
283
+ * Namespace do consumer cung cấp cho toàn bộ state layout được persist (thường là id user hoặc tenant).
284
+ *
285
+ * why: các key dưới đây là UUID CỐ ĐỊNH, không gắn với ai cả. Trên máy dùng chung, user A đăng xuất
286
+ * rồi user B đăng nhập thì `pinnedMenuKeys` / `recentMenuKeys` / `lastActiveMenuGroupId` của A vẫn
287
+ * còn nguyên trong localStorage và B nhìn thấy đúng những module A đã ghim và vừa truy cập. Cấp
288
+ * namespace theo user/tenant sẽ tách hẳn không gian lưu trữ.
289
+ *
290
+ * ⚠️ `SdLayoutStorageService` là singleton `providedIn: 'root'`, thường được khởi tạo TRƯỚC khi biết
291
+ * người dùng là ai. Vì vậy hãy cấp một **hàm** — nó được gọi lại ở mỗi lần truy cập handle, nên khi
292
+ * danh tính đến (hoặc đổi) thì cả tám handle tự dựng lại trên namespace mới:
293
+ *
294
+ * ```ts
295
+ * providers: [
296
+ * {
297
+ * provide: SD_LAYOUT_STORAGE_NAMESPACE,
298
+ * useFactory: () => {
299
+ * const auth = inject(SdAuthService);
300
+ * return () => auth.getAuthInfo?.()?.id;
301
+ * },
302
+ * },
303
+ * ];
304
+ * ```
305
+ *
306
+ * Đây là biện pháp bổ sung chứ không thay thế `SdLayoutStorageService.clear()` lúc signout.
307
+ */
308
+ declare const SD_LAYOUT_STORAGE_NAMESPACE: InjectionToken<SdLayoutStorageNamespace>;
309
+ declare class SdLayoutStorageService {
310
+ #private;
311
+ get isShowSidebar(): SdStorage<boolean>;
312
+ get menuLockStatus(): SdStorage<boolean>;
313
+ get lastActiveMenuGroupId(): SdStorage<string>;
314
+ get pinnedMenuGroup(): SdStorage<SdLayoutChildrenMenu>;
315
+ get pinnedMenuKeys(): SdStorage<string[]>;
316
+ get recentMenuKeys(): SdStorage<string[]>;
317
+ get versionStates(): SdStorage<Record<string, SdLayoutVersionState>>;
318
+ /** Snapshot context hiện tại (`{ id, title, subtitle?, avatar? }`), chỉ `SdLayoutContextService` đọc/ghi. */
319
+ get currentContext(): SdStorage<SdLayoutContext>;
320
+ /**
321
+ * Xoá toàn bộ state layout đã persist.
322
+ *
323
+ * **Consumer PHẢI gọi hàm này trong luồng signout, TRƯỚC khi danh tính bị xoá.** Nếu không,
324
+ * pinned/recent/last-active của user vừa đăng xuất sẽ còn lại trên trình duyệt và hiện ra cho người
325
+ * đăng nhập kế tiếp — rò rỉ tên module nội bộ mà người đó có thể không có quyền thấy.
326
+ *
327
+ * why: khi đã cấu hình `SD_LAYOUT_STORAGE_NAMESPACE` theo user, namespace được resolve NGAY LÚC GỌI.
328
+ * Gọi `clear()` sau khi auth info về `undefined` sẽ xoá nhầm partition không-namespace, còn dữ liệu
329
+ * của user vừa thoát thì vẫn nguyên.
330
+ */
331
+ clear(): void;
332
+ /**
333
+ * Namespace mà các handle đang dùng tại lúc gọi (đã trim; rỗng/không cấu hình → `undefined`).
334
+ * So hai lần gọi để biết partition lưu trữ đã đổi (đăng nhập/đăng xuất trong SPA).
335
+ */
336
+ resolvedNamespace(): string | undefined;
337
+ readPinnedMenuKeys(menus: SdLayoutMenu[]): string[];
338
+ writePinnedMenuKeys(keys: string[]): void;
339
+ readRecentMenuKeys(menus: SdLayoutMenu[], maximum?: number): string[];
340
+ writeRecentMenuKeys(keys: string[]): void;
341
+ readVersionState(version: 1 | 2 | 3): SdLayoutVersionState;
342
+ patchVersionState(version: 1 | 2 | 3, patch: SdLayoutVersionState): SdLayoutVersionState;
343
+ /** Đọc snapshot context từ bộ nhớ; trả bản sao, hoặc `null` khi chưa có hay sai dạng (thiếu/rỗng `id`, `title`). */
344
+ readCurrentContext(): SdLayoutContext | null;
345
+ /** Lưu snapshot context, chỉ giữ `id`, `title`, `subtitle`, `avatar`; bỏ field tuỳ chọn đang `undefined`. */
346
+ writeCurrentContext(context: SdLayoutContext): void;
347
+ /**
348
+ * Đọc lại snapshot context từ storage, bỏ qua entry trong bộ nhớ; kiểm dạng như `readCurrentContext()`.
349
+ *
350
+ * why: `set()` cập nhật bộ nhớ trước và không báo ghi lỗi, còn tab khác ghi thì entry trong bộ nhớ không
351
+ * đổi — chỉ `refresh()` mới cho biết giá trị thật sự đã lưu.
352
+ */
353
+ refreshCurrentContext(): SdLayoutContext | null;
354
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutStorageService, never>;
355
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutStorageService>;
356
+ }
357
+ interface SdLayoutVersionState {
358
+ activeGroupKey?: string;
359
+ locked?: boolean;
360
+ collapsed?: boolean;
361
+ }
362
+
363
+ type SdLayoutViewport = SdViewport;
364
+ declare const SD_LAYOUT_VIEWPORT: _angular_core.InjectionToken<SdViewport | null>;
365
+ /** @deprecated Prefer `SdViewportService` from `@sdcorejs/angular/services/viewport`. */
366
+ declare class SdLayoutResponsiveService {
367
+ #private;
368
+ readonly viewportWidth: _angular_core.Signal<number>;
369
+ isMobile(breakpoint: number): boolean;
370
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutResponsiveService, never>;
371
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutResponsiveService>;
372
+ }
373
+
277
374
  declare class SdLayoutNavigationStateService {
278
375
  #private;
279
376
  readonly pinnedKeys: _angular_core.WritableSignal<string[]>;
@@ -289,11 +386,42 @@ declare class SdLayoutNavigationStateService {
289
386
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutNavigationStateService>;
290
387
  }
291
388
 
389
+ /** Top-level menus sharing one `section`; `section: null` holds unsectioned menus rendered without a heading. */
390
+ interface SdLayoutMenuSectionGroup {
391
+ section: string | null;
392
+ menus: SdLayoutMenu[];
393
+ }
394
+ /** The single trailing element sidebar V4 renders after a menu title. */
395
+ type SdLayoutMenuTrailing = {
396
+ kind: 'soon';
397
+ } | {
398
+ kind: 'count';
399
+ value: number | string;
400
+ } | {
401
+ kind: 'badge';
402
+ value: number | string;
403
+ tone: 'warning' | 'error';
404
+ } | {
405
+ kind: 'status';
406
+ label: string;
407
+ tone: SdLayoutMenuStatus['tone'];
408
+ live: boolean;
409
+ };
292
410
  declare function getMenuStableKey(menu: SdLayoutMenu | null | undefined, ancestors?: string[]): string;
293
411
  declare function searchMenuLeaves(menus: SdLayoutMenu[], query: string): SdLayoutRootMenu[];
412
+ /** Matches like `searchMenuLeaves` but leaves out `comingSoon` leaves and every leaf under a `comingSoon` group (sidebar V4 search). */
413
+ declare function searchAvailableMenuLeaves(menus: SdLayoutMenu[], query: string): SdLayoutRootMenu[];
294
414
  declare function selectPrimaryMenuGroups(menus: SdLayoutMenu[], requestedIds: string[] | undefined, maximum?: number): SdLayoutMenu[];
295
415
  declare function resolveMenuKeys(menus: SdLayoutMenu[], keys: string[]): (SdLayoutRootMenu | SdLayoutChildrenMenu)[];
296
416
  declare function flattenMenuLeaves(menus: SdLayoutMenu[]): SdLayoutRootMenu[];
417
+ /**
418
+ * Groups top-level menus by `section` in order of first appearance (sidebar V4).
419
+ * An unsectioned menu joins only the immediately preceding output group when that group is unsectioned (`section: null`);
420
+ * otherwise it starts a new unsectioned group.
421
+ */
422
+ declare function groupMenusBySection(menus: SdLayoutMenu[]): SdLayoutMenuSectionGroup[];
423
+ /** The one trailing element sidebar V4 renders, in the order `comingSoon`, `badge`, `status`; empty values are skipped. */
424
+ declare function resolveMenuTrailing(menu: SdLayoutMenu | null | undefined): SdLayoutMenuTrailing | null;
297
425
 
298
426
  /**
299
427
  * Bật fallback demo của `SdLayoutService` khi KHÔNG provide `SD_LAYOUT_CONFIGURATION`.
@@ -324,6 +452,89 @@ declare class SdLayoutService {
324
452
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutService>;
325
453
  }
326
454
 
455
+ /**
456
+ * Browser effects used by `SdLayoutContextService`. The default implementation wraps the document window;
457
+ * provide `SD_LAYOUT_CONTEXT_RUNTIME` with a fake in specs and demos so nothing reloads for real.
458
+ */
459
+ interface SdLayoutContextRuntime {
460
+ /** Reloads the page. */
461
+ reload(): void;
462
+ /** Subscribes to cross-tab localStorage changes (window 'storage' events); returns an unsubscribe function. */
463
+ onStorage(listener: () => void): () => void;
464
+ /** Per-tab reconcile marker; `undefined` when session storage is unavailable. */
465
+ readMarker(): string | null | undefined;
466
+ /** Writes the marker (`null` clears it); returns false when it could not be persisted. */
467
+ writeMarker(value: string | null): boolean;
468
+ }
469
+ /** Session storage key of the per-tab reconcile marker (id of the last context reconcile reload target). */
470
+ declare const SD_LAYOUT_CONTEXT_MARKER_KEY = "sd.layout.context.reconcile-marker";
471
+
472
+ /**
473
+ * Browser effects of the layout context feature: page reload, cross-tab `storage` events and the
474
+ * per-tab reconcile marker. Defaults to the document window; provide a fake `SdLayoutContextRuntime`
475
+ * in specs and demos so nothing reloads for real:
476
+ *
477
+ * ```ts
478
+ * providers: [{ provide: SD_LAYOUT_CONTEXT_RUNTIME, useValue: fakeRuntime }];
479
+ * ```
480
+ */
481
+ declare const SD_LAYOUT_CONTEXT_RUNTIME: InjectionToken<SdLayoutContextRuntime>;
482
+ /** Creates the default runtime over `view`; without a window every operation is a no-op. */
483
+ declare function createSdLayoutContextBrowserRuntime(view: Window | null): SdLayoutContextRuntime;
484
+
485
+ /**
486
+ * Owns the current layout context (for example a store or a legal entity) and its persisted snapshot.
487
+ *
488
+ * The snapshot is captured once, when the service is first injected, so `SD_LAYOUT_STORAGE_NAMESPACE`
489
+ * must already resolve at that moment (see `sd-layout.md`). Switching reloads the page — there is no
490
+ * change event. Read the context during bootstrap:
491
+ *
492
+ * ```ts
493
+ * provideAppInitializer(() => {
494
+ * const context = inject(SdLayoutContextService).getCurrentContext();
495
+ * inject(ApiContextHeader).set(context?.id);
496
+ * });
497
+ * ```
498
+ *
499
+ * The service works without `SD_LAYOUT_CONFIGURATION`; the context switcher passes the configured items to
500
+ * `syncItems()`, which reconciles the snapshot. A reconcile reload happens at most once per target id
501
+ * while the per-tab marker holds that id.
502
+ */
503
+ declare class SdLayoutContextService {
504
+ #private;
505
+ /** Context of this page load; title, subtitle and avatar may refresh from the configured items. */
506
+ readonly current: _angular_core.Signal<SdLayoutContext | null>;
507
+ /** Valid items last passed to `syncItems()` (entries without `id`/`title` and duplicate ids are dropped). */
508
+ readonly items: _angular_core.Signal<readonly SdLayoutContext[]>;
509
+ /** Id of the context being switched to, or `null`. */
510
+ readonly switchingId: _angular_core.Signal<string | null>;
511
+ /** `true` when the last switch could not be persisted (no reload happened). */
512
+ readonly switchFailed: _angular_core.Signal<boolean>;
513
+ /** `true` when another tab switched the stored context; this tab keeps its context until reloaded. */
514
+ readonly changedElsewhere: _angular_core.Signal<boolean>;
515
+ constructor();
516
+ /** Returns a copy of the current context, or `null` before any context was stored. */
517
+ getCurrentContext(): SdLayoutContext | null;
518
+ /**
519
+ * Switches to the item with `id`, then reloads the page once the snapshot is confirmed in storage.
520
+ * Ignored for the active id, before `syncItems()`, for ids that are not in `items` and once a reload
521
+ * was requested in this page load.
522
+ */
523
+ setCurrentContext(id: string): void;
524
+ /**
525
+ * Reconciles the stored snapshot with the configured items: a valid id only refreshes its metadata;
526
+ * a missing or stale id falls back to `items[0]` and reloads, unless the per-tab marker already holds
527
+ * that target. Empty items store nothing. While the load-time context is still in `items`, a different
528
+ * stored id only raises `changedElsewhere` and a removed snapshot keeps the context in memory.
529
+ * Repeated calls with the same items neither write nor reload again.
530
+ */
531
+ syncItems(items: readonly SdLayoutContext[] | null | undefined): void;
532
+ /** Reloads the page, for example from the "changed in another tab" notice. Does nothing once a reload was requested. */
533
+ reload(): void;
534
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutContextService, never>;
535
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutContextService>;
536
+ }
537
+
327
538
  declare class SdPageComponent {
328
539
  private el;
329
540
  title: _angular_core.InputSignal<string>;
@@ -343,6 +554,7 @@ declare class SdLayoutComponent {
343
554
  sidebarV1: _angular_core.Signal<SidebarConfigurationV1 | undefined>;
344
555
  sidebarV2: _angular_core.Signal<SidebarConfigurationV2 | undefined>;
345
556
  sidebarV3: _angular_core.Signal<SidebarConfigurationV3 | undefined>;
557
+ sidebarV4: _angular_core.Signal<SidebarConfigurationV4 | undefined>;
346
558
  mobileBreakpoint: number;
347
559
  isMobile: _angular_core.Signal<boolean>;
348
560
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutComponent, never>;
@@ -457,7 +669,7 @@ declare class SdLayoutUserMenuComponent {
457
669
  setting: _angular_core.InputSignal<SdLayoutAccountAction | undefined>;
458
670
  notification: _angular_core.InputSignal<SdLayoutNotificationConfiguration | undefined>;
459
671
  compact: _angular_core.InputSignal<boolean>;
460
- presentation: _angular_core.InputSignal<"disclosure" | "mobile" | "mobile-inline">;
672
+ presentation: _angular_core.InputSignal<"mobile" | "disclosure" | "mobile-inline">;
461
673
  opened: _angular_core.OutputEmitterRef<void>;
462
674
  closed: _angular_core.OutputEmitterRef<void>;
463
675
  isOpen: _angular_core.WritableSignal<boolean>;
@@ -550,6 +762,7 @@ declare class SdSidebarMobileV2 {
550
762
 
551
763
  declare class SdSidebarV3 {
552
764
  #private;
765
+ private readonly headerSwitcher;
553
766
  menus: _angular_core.InputSignal<SdLayoutMenu[]>;
554
767
  userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
555
768
  sidebar: _angular_core.InputSignal<SidebarConfigurationV3>;
@@ -567,6 +780,8 @@ declare class SdSidebarV3 {
567
780
  key: string;
568
781
  title: string;
569
782
  }[]>;
783
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
784
+ protected readonly contextOpen: _angular_core.Signal<boolean>;
570
785
  constructor();
571
786
  toggleCollapsed(): void;
572
787
  activateCollapsedMenu(menu: SdLayoutMenu): void;
@@ -602,6 +817,241 @@ declare class SdSidebarMobileV3 {
602
817
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSidebarMobileV3, "sd-sidebar-mobile-v3", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
603
818
  }
604
819
 
820
+ /** One row of the V4 search results, in the order `buildSidebarV4SearchResults` returns them. */
821
+ interface SdSidebarV4SearchResult {
822
+ /** `getMenuStableKey(menu)` of the leaf. */
823
+ key: string;
824
+ menu: SdLayoutRootMenu;
825
+ /** Ancestor titles joined with " / ", or the top-level `section` for a root leaf; empty when neither exists. */
826
+ path: string;
827
+ }
828
+
829
+ /** `SidebarConfigurationV4` as `normalizeSidebarConfiguration` returns it: every V4 default is filled (INV-012). */
830
+ type SdSidebarV4ResolvedConfiguration = SidebarConfigurationV4 & Required<Pick<SidebarConfigurationV4, 'defaultCollapsed' | 'itemShape' | 'density' | 'collapsedGroup'>> & {
831
+ recent: ResolvedSidebarRecentConfiguration;
832
+ };
833
+ /**
834
+ * Sidebar V4 desktop shell: a 280px drawer (72px rail when collapsed) with the brand header and Context Switcher,
835
+ * a pill search (`Ctrl+K` / `⌘K`), Pinned and Recent shortcuts, the V4 menu tree and the account footer.
836
+ * Routed content is projected into `<main>`.
837
+ *
838
+ * Routing, recent/pinned handling and the collapse preference behave like `sd-sidebar-v3`; the collapsed state is
839
+ * stored in the same version 3 entry (D-004). Options are read only after `normalizeSidebarConfiguration` (INV-012);
840
+ * `brandColor` / `brandLightColor` are ignored. Size tokens (`--sd-sidebar-v4-width`, `-rail-width`, `-item-height`,
841
+ * `-child-height`, `-item-radius`) are declared on the host and follow `density`, `itemShape` and the pointer type.
842
+ */
843
+ declare class SdSidebarV4 {
844
+ #private;
845
+ private readonly searchInput;
846
+ private readonly list;
847
+ private readonly mainTree;
848
+ private readonly headerSwitcher;
849
+ menus: _angular_core.InputSignal<SdLayoutMenu[]>;
850
+ userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
851
+ sidebar: _angular_core.InputSignal<SidebarConfigurationV4>;
852
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
853
+ protected readonly configuration: _angular_core.Signal<SdSidebarV4ResolvedConfiguration>;
854
+ isCollapsed: _angular_core.WritableSignal<boolean>;
855
+ protected readonly collapsedGroupKeys: _angular_core.WritableSignal<string[]>;
856
+ searchText: _angular_core.WritableSignal<string>;
857
+ activePath: _angular_core.WritableSignal<string>;
858
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
859
+ protected readonly searchResults: _angular_core.Signal<SdSidebarV4SearchResult[]>;
860
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
861
+ protected readonly focusedResultIndex: _angular_core.Signal<number>;
862
+ recentConfiguration: _angular_core.Signal<{
863
+ enabled?: boolean;
864
+ maxItems?: number;
865
+ } & ResolvedSidebarRecentConfiguration>;
866
+ pinnedKeys: _angular_core.WritableSignal<string[]>;
867
+ pinnedMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
868
+ recentMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
869
+ protected readonly hasQuery: _angular_core.Signal<boolean>;
870
+ protected readonly title: _angular_core.Signal<string>;
871
+ protected readonly logoInitial: _angular_core.Signal<string>;
872
+ /** The hierarchy starts with items that have no section heading. */
873
+ protected readonly leadsWithUnsectioned: _angular_core.Signal<boolean>;
874
+ protected readonly shortcutHint: string;
875
+ protected readonly shortcutKeys: string;
876
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
877
+ protected readonly contextOpen: _angular_core.Signal<boolean>;
878
+ constructor();
879
+ /** Collapses or expands the drawer and stores the choice in the version 3 entry, like V3 (D-004). */
880
+ toggleCollapsed(): void;
881
+ /** Expands a collapsed drawer, then moves focus to the menu search. */
882
+ focusSearch(): void;
883
+ /** Collapsed rail: a leaf navigates; a group expands the drawer and opens that group, like V3. */
884
+ activateCollapsedMenu(menu: SdLayoutMenu): void;
885
+ navigateMenu(menu: SdLayoutMenu): void;
886
+ onTogglePinned(menu: SdLayoutMenu): void;
887
+ protected onSearchInput(event: Event): void;
888
+ protected clearSearch(): void;
889
+ protected onSearchKeydown(event: KeyboardEvent): void;
890
+ protected onDocumentKeydown(event: KeyboardEvent): void;
891
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSidebarV4, never>;
892
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSidebarV4, "sd-sidebar-v4", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
893
+ }
894
+
895
+ /** `SidebarConfigurationV4` as `normalizeSidebarConfiguration` returns it: every V4 default is filled (INV-012). */
896
+ type SdSidebarMobileV4ResolvedConfiguration = SidebarConfigurationV4 & Required<Pick<SidebarConfigurationV4, 'itemShape' | 'density' | 'collapsedGroup'>> & {
897
+ recent: ResolvedSidebarRecentConfiguration;
898
+ };
899
+ /** One bottom-bar destination resolved from `mobile.bottomBar`. */
900
+ interface SdSidebarMobileV4Destination {
901
+ menu: SdLayoutMenu;
902
+ key: string;
903
+ label: string;
904
+ isGroup: boolean;
905
+ isActive: boolean;
906
+ disabled: boolean;
907
+ /** Keys of the group and its ancestor groups, opened when a group destination opens the drawer. */
908
+ expandKeys: string[];
909
+ badge: {
910
+ value: number | string;
911
+ tone: 'warning' | 'error';
912
+ } | null;
913
+ liveTone: 'success' | 'warning' | 'error' | null;
914
+ /** Live status label read out after the title; a badge is described through i18n in the template. */
915
+ liveLabel: string;
916
+ descriptionId: string;
917
+ }
918
+ /**
919
+ * Sidebar V4 mobile shell (README M1–M3): a 56px app bar, a `min(88vw, 360px)` modal drawer that hosts the V4 menu tree in
920
+ * `mobile` mode (44px rows, combobox search, Pinned/Recent, account footer, Context Switcher bottom sheet) and an opt-in
921
+ * bottom bar built from `mobile.bottomBar` (at most 4 menu ids plus "More"). Routed content is projected into `<main>`.
922
+ *
923
+ * Navigation, pinned and recent behave like `sd-sidebar-v4`. Every way of closing the drawer (backdrop, Escape, menu
924
+ * selection, including the page already open) clears the search and returns focus to the control that opened it (INV-011).
925
+ * Options are read only after `normalizeSidebarConfiguration` (INV-012). Mobile has no rail, so the collapse preference is
926
+ * never read or written. With `context` configured, `context.items` reach `SdLayoutContextService.syncItems()` on init,
927
+ * before the drawer and its switcher first render; without it the context service is never created.
928
+ */
929
+ declare class SdSidebarMobileV4 {
930
+ #private;
931
+ private readonly trigger;
932
+ private readonly searchInput;
933
+ private readonly list;
934
+ private readonly mainTree;
935
+ menus: _angular_core.InputSignal<SdLayoutMenu[]>;
936
+ userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
937
+ sidebar: _angular_core.InputSignal<SidebarConfigurationV4>;
938
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
939
+ protected readonly configuration: _angular_core.Signal<SdSidebarMobileV4ResolvedConfiguration>;
940
+ isDrawerOpen: _angular_core.WritableSignal<boolean>;
941
+ searchText: _angular_core.WritableSignal<string>;
942
+ activePath: _angular_core.WritableSignal<string>;
943
+ protected readonly collapsedGroupKeys: _angular_core.WritableSignal<string[]>;
944
+ /** The drawer was opened from the app-bar search button: its search input takes the initial focus. */
945
+ protected readonly focusSearchOnOpen: _angular_core.WritableSignal<boolean>;
946
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
947
+ protected readonly searchResults: _angular_core.Signal<SdSidebarV4SearchResult[]>;
948
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
949
+ protected readonly focusedResultIndex: _angular_core.Signal<number>;
950
+ recentConfiguration: _angular_core.Signal<{
951
+ enabled?: boolean;
952
+ maxItems?: number;
953
+ } & ResolvedSidebarRecentConfiguration>;
954
+ pinnedKeys: _angular_core.WritableSignal<string[]>;
955
+ pinnedMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
956
+ recentMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
957
+ protected readonly titleId: string;
958
+ protected readonly hasQuery: _angular_core.Signal<boolean>;
959
+ protected readonly title: _angular_core.Signal<string>;
960
+ protected readonly logoInitial: _angular_core.Signal<string>;
961
+ /** The hierarchy starts with items that have no section heading. */
962
+ protected readonly leadsWithUnsectioned: _angular_core.Signal<boolean>;
963
+ protected readonly displayName: _angular_core.Signal<string>;
964
+ /** First letters of the first and last word of the display name, as on the README M1 avatar. */
965
+ protected readonly userInitials: _angular_core.Signal<string>;
966
+ /** Menus of `mobile.bottomBar` that exist in `menus` (looked up by `id` at any depth), in configured order. */
967
+ protected readonly destinations: _angular_core.Signal<SdSidebarMobileV4Destination[]>;
968
+ constructor();
969
+ /** Opens the drawer; focus returns to `trigger` (default: the focused element, else the app-bar menu button) on close. */
970
+ openDrawer(trigger?: EventTarget | null): void;
971
+ /** Opens the drawer with its search focused; focus returns to `trigger` on close. */
972
+ openSearch(trigger?: EventTarget | null): void;
973
+ closeFromBackdrop(): void;
974
+ closeFromEscape(): void;
975
+ closeFromNavigation(): void;
976
+ onDrawerKeydown(event: KeyboardEvent): void;
977
+ navigateMenu(menu: SdLayoutMenu): void;
978
+ onTogglePinned(menu: SdLayoutMenu): void;
979
+ protected activateDestination(destination: SdSidebarMobileV4Destination, trigger: HTMLElement): void;
980
+ protected onSearchInput(event: Event): void;
981
+ protected clearSearch(): void;
982
+ protected onSearchKeydown(event: KeyboardEvent): void;
983
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSidebarMobileV4, never>;
984
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSidebarMobileV4, "sd-sidebar-mobile-v4", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
985
+ }
986
+
987
+ /** One rendered row: the context plus the state the template needs. */
988
+ interface SdLayoutContextSwitcherRow {
989
+ item: SdLayoutContext;
990
+ initial: string;
991
+ active: boolean;
992
+ busy: boolean;
993
+ disabled: boolean;
994
+ }
995
+ /**
996
+ * Context switcher shared by sidebar versions 1–4 and their mobile drawers.
997
+ *
998
+ * Forwards `configuration.items` to `SdLayoutContextService.syncItems()` and renders the service state:
999
+ * the current context, the switching row and the "changed in another tab" notice. Selecting another
1000
+ * context calls `setCurrentContext()`, which reloads the page; there is no change event.
1001
+ */
1002
+ declare class SdLayoutContextSwitcher {
1003
+ #private;
1004
+ private readonly trigger;
1005
+ private readonly sheetTemplate;
1006
+ /** Context configuration of the sidebar; nothing renders without items. */
1007
+ configuration: _angular_core.InputSignal<SdLayoutContextConfiguration | null | undefined>;
1008
+ /** Header trigger, collapsed-rail avatar, or mobile row that opens a bottom sheet. */
1009
+ appearance: _angular_core.InputSignal<"sheet" | "header" | "rail">;
1010
+ /** Side the desktop popover opens on; defaults to `below` for the header and `right` for the rail. The sheet ignores it. */
1011
+ placement: _angular_core.InputSignal<"below" | "right" | undefined>;
1012
+ /**
1013
+ * Element the desktop popover aligns to; defaults to the trigger. Pass the sidebar header for `below`
1014
+ * (the popover sits under it, 12px inside both edges) and the rail or aside for `right` (the popover opens
1015
+ * 8px from its right edge, top-aligned with the trigger).
1016
+ */
1017
+ anchor: _angular_core.InputSignal<HTMLElement | null | undefined>;
1018
+ /** `true` while the popover or the bottom sheet is open. */
1019
+ readonly isOpen: _angular_core.Signal<boolean>;
1020
+ protected readonly query: _angular_core.WritableSignal<string>;
1021
+ protected readonly popoverWidth: _angular_core.WritableSignal<string | null>;
1022
+ protected readonly popoverOrigin: _angular_core.WritableSignal<FlexibleConnectedPositionStrategyOrigin | null>;
1023
+ protected readonly sheetTitleId: string;
1024
+ protected readonly openIcon: string;
1025
+ protected readonly switchFailed: _angular_core.Signal<boolean>;
1026
+ protected readonly changedElsewhere: _angular_core.Signal<boolean>;
1027
+ /** Normalized items of the service; empty while no configuration is bound (INV-013). */
1028
+ protected readonly items: _angular_core.Signal<readonly SdLayoutContext[]>;
1029
+ protected readonly customLabel: _angular_core.Signal<string | null>;
1030
+ protected readonly canOpen: _angular_core.Signal<boolean>;
1031
+ protected readonly searchable: _angular_core.Signal<boolean>;
1032
+ protected readonly activeId: _angular_core.Signal<string | null>;
1033
+ protected readonly activeItem: _angular_core.Signal<SdLayoutContext>;
1034
+ protected readonly activeInitial: _angular_core.Signal<string>;
1035
+ protected readonly positions: _angular_core.Signal<ConnectedPosition[]>;
1036
+ protected readonly rows: _angular_core.Signal<SdLayoutContextSwitcherRow[]>;
1037
+ protected readonly isSwitching: _angular_core.Signal<boolean>;
1038
+ constructor();
1039
+ /** Opens or closes the popover (header, rail) or the bottom sheet (sheet). */
1040
+ toggle(): void;
1041
+ /** Opens the popover or the bottom sheet; ignored with fewer than two contexts. */
1042
+ open(): void;
1043
+ /** Closes the popover or the bottom sheet; focus returns to the trigger unless `restoreFocus` is false. */
1044
+ close(restoreFocus?: boolean): void;
1045
+ protected select(row: SdLayoutContextSwitcherRow): void;
1046
+ protected reload(): void;
1047
+ protected onSearch(event: Event): void;
1048
+ protected onPanelKeydown(event: KeyboardEvent): void;
1049
+ protected showAvatarImage(item: SdLayoutContext | null): boolean;
1050
+ protected onAvatarError(url: string | undefined): void;
1051
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutContextSwitcher, never>;
1052
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdLayoutContextSwitcher, "sd-layout-context-switcher", never, { "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1053
+ }
1054
+
605
1055
  /** Thêm '/' ở cuối để so khớp theo segment: '/appointment' không khớp nhầm '/appointments'. */
606
1056
  declare const normalizeMenuPath: (path: string) => string;
607
1057
  /** Route hiện tại có nằm trong nhánh của `path` không (khớp chính xác hoặc khớp phần đầu). */
@@ -665,5 +1115,5 @@ declare class SdLayoutModule {
665
1115
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<SdLayoutModule>;
666
1116
  }
667
1117
 
668
- export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarV2, SdSidebarV3, collectMatchedMenuPaths, containsMenuPath, flattenMenuLeaves, getMenuStableKey, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchMenuLeaves, selectPrimaryMenuGroups };
669
- export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, ResolvedSidebarRecentConfiguration, SdLayoutAccountAction, SdLayoutChildrenMenu, SdLayoutMenu, SdLayoutNotificationConfiguration, SdLayoutRootMenu, SdLayoutStorageNamespace, SdLayoutUserInfo, SdLayoutUserRole, SdLayoutVersionState, SdLayoutViewport, SidebarConfigurationBase, SidebarConfigurationV1, SidebarConfigurationV2, SidebarConfigurationV3 };
1118
+ export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_CONTEXT_MARKER_KEY, SD_LAYOUT_CONTEXT_RUNTIME, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutContextService, SdLayoutContextSwitcher, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarMobileV4, SdSidebarV2, SdSidebarV3, SdSidebarV4, collectMatchedMenuPaths, containsMenuPath, createSdLayoutContextBrowserRuntime, flattenMenuLeaves, getMenuStableKey, groupMenusBySection, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveMenuTrailing, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchAvailableMenuLeaves, searchMenuLeaves, selectPrimaryMenuGroups };
1119
+ export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, ResolvedSidebarRecentConfiguration, SdLayoutAccountAction, SdLayoutChildrenMenu, SdLayoutContext, SdLayoutContextConfiguration, SdLayoutContextRuntime, SdLayoutMenu, SdLayoutMenuBadge, SdLayoutMenuSectionGroup, SdLayoutMenuStatus, SdLayoutMenuTrailing, SdLayoutNotificationConfiguration, SdLayoutRootMenu, SdLayoutStorageNamespace, SdLayoutUserInfo, SdLayoutUserRole, SdLayoutVersionState, SdLayoutViewport, SidebarConfigurationBase, SidebarConfigurationV1, SidebarConfigurationV2, SidebarConfigurationV3, SidebarConfigurationV4 };