bways-report 0.2.5 → 0.2.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.
@@ -18,12 +18,28 @@ export interface BwaysReportMenuSelection {
18
18
  parentKey?: string;
19
19
  path: string[];
20
20
  }
21
- export interface BwaysReportMenuConfig {
22
- /** Return a fresh complete tree, not a Subscription or only expanded rows. */
23
- load: () => Observable<readonly BwaysReportMenuNode[]>;
21
+ /** Existing ERP MenuService module/subItems tree. Extra host fields are ignored. */
22
+ export interface BwaysReportErpMenuNode {
23
+ MODULE_NO?: string | number;
24
+ MODULE_NAME?: string;
25
+ MENU_KEY?: string | number;
26
+ MENU_CAPTION?: string;
27
+ PARENT?: string | number | null;
28
+ IS_MENU_SOURCE?: string | number;
29
+ subItems?: readonly BwaysReportErpMenuNode[];
30
+ }
31
+ export interface BwaysReportMenuOptions {
24
32
  required?: boolean;
25
33
  /** Read reactive company/user/module signals here to invalidate an open review on context changes. */
26
34
  contextKey?: () => string;
27
35
  /** Defaults to 30 seconds. */
28
36
  timeoutMs?: number;
29
37
  }
38
+ /** Default tree format remains compatible; ERP format removes the host mapper requirement. */
39
+ export type BwaysReportMenuConfig = BwaysReportMenuOptions & ({
40
+ format?: 'tree';
41
+ load: () => Observable<readonly BwaysReportMenuNode[]>;
42
+ } | {
43
+ format: 'erp';
44
+ load: () => Observable<readonly BwaysReportErpMenuNode[]>;
45
+ });
@@ -1,4 +1,4 @@
1
- import { BwaysReportMenuNode, BwaysReportMenuSelection } from '../models/report-menu.model';
1
+ import { BwaysReportErpMenuNode, BwaysReportMenuNode, BwaysReportMenuSelection } from '../models/report-menu.model';
2
2
  export interface ReportMenuRow {
3
3
  node: BwaysReportMenuNode;
4
4
  depth: number;
@@ -8,3 +8,5 @@ export interface ReportMenuRow {
8
8
  /** Validate host data once per load; never mutate the host tree or silently omit bad branches. */
9
9
  export declare function indexReportMenus(nodes: readonly BwaysReportMenuNode[]): ReportMenuRow[];
10
10
  export declare function reportMenuSelection(row: ReportMenuRow): BwaysReportMenuSelection;
11
+ /** Opt-in ERP compatibility boundary. Generic tree users keep their own selection rules. */
12
+ export declare function normalizeReportMenuTree(nodes: readonly (BwaysReportMenuNode | BwaysReportErpMenuNode)[], format?: 'tree' | 'erp'): readonly BwaysReportMenuNode[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bways-report",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",