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.
- package/README.md +1 -1
- package/esm2022/lib/core/config/bways-report-config.mjs +3 -1
- package/esm2022/lib/core/models/report-menu.model.mjs +1 -1
- package/esm2022/lib/core/utils/report-menu.util.mjs +61 -1
- package/esm2022/lib/features/designer/components/menu-selector/report-menu-selector.component.mjs +5 -4
- package/fesm2022/bways-report.mjs +65 -2
- package/fesm2022/bways-report.mjs.map +1 -1
- package/lib/core/models/report-menu.model.d.ts +19 -3
- package/lib/core/utils/report-menu.util.d.ts +3 -1
- package/package.json +1 -1
|
@@ -18,12 +18,28 @@ export interface BwaysReportMenuSelection {
|
|
|
18
18
|
parentKey?: string;
|
|
19
19
|
path: string[];
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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[];
|