@sd-angular/core 19.0.18 → 19.0.29

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.
@@ -26,6 +26,7 @@ export declare class SidebarComponent {
26
26
  totalMenuInMenusByGroup: import("@angular/core").Signal<number>;
27
27
  pinnedNodeKeys: import("@angular/core").Signal<Set<string>>;
28
28
  isPinnedMenuGroupActive: import("@angular/core").Signal<boolean>;
29
+ activeMenuPath: import("@angular/core").Signal<string | null>;
29
30
  dataSource: MatTreeNestedDataSource<SdLayoutMenu>;
30
31
  treeControl: NestedTreeControl<SdLayoutMenu, SdLayoutMenu>;
31
32
  constructor();
@@ -2,8 +2,12 @@ import { PipeTransform } from '@angular/core';
2
2
  import { SdLayoutMenu } from '../services';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class MenuFocusPipe implements PipeTransform {
5
- #private;
6
- transform(routePath: string, menuItem: SdLayoutMenu): boolean;
5
+ /**
6
+ * @param activeMenuPath Path khớp sát nhất với route hiện tại (xem `resolveActiveMenuPath`).
7
+ * Truyền vào thì chỉ menu chứa đúng path đó mới focus, nên '/appointment' không sáng khi đang ở
8
+ * '/appointment/cs'. Bỏ trống thì giữ cách khớp phần đầu cũ.
9
+ */
10
+ transform(routePath: string, menuItem: SdLayoutMenu, activeMenuPath?: string | null): boolean;
7
11
  static ɵfac: i0.ɵɵFactoryDeclaration<MenuFocusPipe, never>;
8
12
  static ɵpipe: i0.ɵɵPipeDeclaration<MenuFocusPipe, "menuFocus", true>;
9
13
  static ɵprov: i0.ɵɵInjectableDeclaration<MenuFocusPipe>;
@@ -1 +1,2 @@
1
+ export * from './menu-path.util';
1
2
  export * from './tab-name.util';
@@ -0,0 +1,16 @@
1
+ import { SdLayoutMenu } from '../services/menu/menu.model';
2
+ /** Thêm '/' ở cuối để so khớp theo segment: '/appointment' không khớp nhầm '/appointments'. */
3
+ export declare const normalizeMenuPath: (path: string) => string;
4
+ /** 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). */
5
+ export declare const isMenuPathMatch: (routePath: string, path: string) => boolean;
6
+ /** Mọi path trong cây menu khớp với route hiện tại. */
7
+ export declare const collectMatchedMenuPaths: (menus: SdLayoutMenu[] | null | undefined, routePath: string) => string[];
8
+ /**
9
+ * Path khớp sát nhất với route hiện tại trong cả cây menu.
10
+ * Khi cả '/appointment' và '/appointment/cs' cùng khớp route '/appointment/cs',
11
+ * chỉ path dài nhất được coi là active — path còn lại không được highlight.
12
+ * Hoà nhau thì lấy path xuất hiện trước theo thứ tự khai báo.
13
+ */
14
+ export declare const resolveActiveMenuPath: (menus: SdLayoutMenu[] | null | undefined, routePath: string) => string | null;
15
+ /** Chính menu này, hoặc bất kỳ menu con nào ở mọi cấp, có đúng path đó. */
16
+ export declare const containsMenuPath: (menuItem: SdLayoutMenu, path: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-angular/core",
3
- "version": "19.0.18",
3
+ "version": "19.0.29",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
6
6
  "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
@@ -104,14 +104,14 @@
104
104
  "types": "./components/button/index.d.ts",
105
105
  "default": "./fesm2022/sd-angular-core-components-button.mjs"
106
106
  },
107
- "./components/chart": {
108
- "types": "./components/chart/index.d.ts",
109
- "default": "./fesm2022/sd-angular-core-components-chart.mjs"
110
- },
111
107
  "./components/ckeditor-styles": {
112
108
  "types": "./components/ckeditor-styles/index.d.ts",
113
109
  "default": "./fesm2022/sd-angular-core-components-ckeditor-styles.mjs"
114
110
  },
111
+ "./components/chart": {
112
+ "types": "./components/chart/index.d.ts",
113
+ "default": "./fesm2022/sd-angular-core-components-chart.mjs"
114
+ },
115
115
  "./components/code-editor": {
116
116
  "types": "./components/code-editor/index.d.ts",
117
117
  "default": "./fesm2022/sd-angular-core-components-code-editor.mjs"
@@ -136,6 +136,10 @@
136
136
  "types": "./components/import-excel/index.d.ts",
137
137
  "default": "./fesm2022/sd-angular-core-components-import-excel.mjs"
138
138
  },
139
+ "./components/inform": {
140
+ "types": "./components/inform/index.d.ts",
141
+ "default": "./fesm2022/sd-angular-core-components-inform.mjs"
142
+ },
139
143
  "./components/mini-editor": {
140
144
  "types": "./components/mini-editor/index.d.ts",
141
145
  "default": "./fesm2022/sd-angular-core-components-mini-editor.mjs"
@@ -144,22 +148,18 @@
144
148
  "types": "./components/modal/index.d.ts",
145
149
  "default": "./fesm2022/sd-angular-core-components-modal.mjs"
146
150
  },
147
- "./components/inform": {
148
- "types": "./components/inform/index.d.ts",
149
- "default": "./fesm2022/sd-angular-core-components-inform.mjs"
150
- },
151
151
  "./components/modal-resizable": {
152
152
  "types": "./components/modal-resizable/index.d.ts",
153
153
  "default": "./fesm2022/sd-angular-core-components-modal-resizable.mjs"
154
154
  },
155
- "./components/operator": {
156
- "types": "./components/operator/index.d.ts",
157
- "default": "./fesm2022/sd-angular-core-components-operator.mjs"
158
- },
159
155
  "./components/org-chart": {
160
156
  "types": "./components/org-chart/index.d.ts",
161
157
  "default": "./fesm2022/sd-angular-core-components-org-chart.mjs"
162
158
  },
159
+ "./components/operator": {
160
+ "types": "./components/operator/index.d.ts",
161
+ "default": "./fesm2022/sd-angular-core-components-operator.mjs"
162
+ },
163
163
  "./components/preview": {
164
164
  "types": "./components/preview/index.d.ts",
165
165
  "default": "./fesm2022/sd-angular-core-components-preview.mjs"
@@ -184,14 +184,14 @@
184
184
  "types": "./components/side-drawer/index.d.ts",
185
185
  "default": "./fesm2022/sd-angular-core-components-side-drawer.mjs"
186
186
  },
187
- "./components/splitter": {
188
- "types": "./components/splitter/index.d.ts",
189
- "default": "./fesm2022/sd-angular-core-components-splitter.mjs"
190
- },
191
187
  "./components/stepper": {
192
188
  "types": "./components/stepper/index.d.ts",
193
189
  "default": "./fesm2022/sd-angular-core-components-stepper.mjs"
194
190
  },
191
+ "./components/splitter": {
192
+ "types": "./components/splitter/index.d.ts",
193
+ "default": "./fesm2022/sd-angular-core-components-splitter.mjs"
194
+ },
195
195
  "./components/tab": {
196
196
  "types": "./components/tab/index.d.ts",
197
197
  "default": "./fesm2022/sd-angular-core-components-tab.mjs"
@@ -228,10 +228,6 @@
228
228
  "types": "./forms/chip/index.d.ts",
229
229
  "default": "./fesm2022/sd-angular-core-forms-chip.mjs"
230
230
  },
231
- "./forms/chip-calendar": {
232
- "types": "./forms/chip-calendar/index.d.ts",
233
- "default": "./fesm2022/sd-angular-core-forms-chip-calendar.mjs"
234
- },
235
231
  "./forms/date": {
236
232
  "types": "./forms/date/index.d.ts",
237
233
  "default": "./fesm2022/sd-angular-core-forms-date.mjs"
@@ -248,6 +244,10 @@
248
244
  "types": "./forms/directives/index.d.ts",
249
245
  "default": "./fesm2022/sd-angular-core-forms-directives.mjs"
250
246
  },
247
+ "./forms/chip-calendar": {
248
+ "types": "./forms/chip-calendar/index.d.ts",
249
+ "default": "./fesm2022/sd-angular-core-forms-chip-calendar.mjs"
250
+ },
251
251
  "./forms/inline-text": {
252
252
  "types": "./forms/inline-text/index.d.ts",
253
253
  "default": "./fesm2022/sd-angular-core-forms-inline-text.mjs"