@sdcorejs/angular 19.2.1 → 19.2.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.
@@ -26,6 +26,7 @@ export declare class SdSidebarV1Panel {
26
26
  logoUrl: import("@angular/core").Signal<string | undefined>;
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": "@sdcorejs/angular",
3
- "version": "19.2.1",
3
+ "version": "19.2.2",
4
4
  "description": "Angular component library: data table, query bar/builder, 20+ signal-based form controls, layout, auth and workflow services. Standalone, OnPush, signals-first. Published in parallel lines for Angular 19, 20 and 21.",
5
5
  "keywords": [
6
6
  "angular",
@@ -302,14 +302,14 @@
302
302
  "types": "./forms/inline-text/index.d.ts",
303
303
  "default": "./fesm2022/sdcorejs-angular-forms-inline-text.mjs"
304
304
  },
305
- "./forms/input": {
306
- "types": "./forms/input/index.d.ts",
307
- "default": "./fesm2022/sdcorejs-angular-forms-input.mjs"
308
- },
309
305
  "./forms/input-color": {
310
306
  "types": "./forms/input-color/index.d.ts",
311
307
  "default": "./fesm2022/sdcorejs-angular-forms-input-color.mjs"
312
308
  },
309
+ "./forms/input": {
310
+ "types": "./forms/input/index.d.ts",
311
+ "default": "./fesm2022/sdcorejs-angular-forms-input.mjs"
312
+ },
313
313
  "./forms/input-number": {
314
314
  "types": "./forms/input-number/index.d.ts",
315
315
  "default": "./fesm2022/sdcorejs-angular-forms-input-number.mjs"