bways-report 0.2.4 → 0.2.5
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 +5 -0
- package/esm2022/lib/core/config/bways-report-config.mjs +10 -1
- package/esm2022/lib/core/models/index.mjs +2 -2
- package/esm2022/lib/core/models/report-menu.model.mjs +2 -0
- package/esm2022/lib/core/tokens/reporting-config.token.mjs +1 -1
- package/esm2022/lib/core/utils/report-menu.util.mjs +41 -0
- package/esm2022/lib/features/designer/components/dialogs/report-saved-dialog.component.mjs +44 -13
- package/esm2022/lib/features/designer/components/menu-selector/report-menu-selector.component.mjs +246 -0
- package/esm2022/lib/features/designer/designer.component.mjs +8 -3
- package/esm2022/lib/features/designer/rpt-report-designer.component.mjs +9 -3
- package/esm2022/lib/features/designer/services/designer-config.service.mjs +3 -1
- package/esm2022/lib/features/embed/bways-report-builder.component.mjs +2 -2
- package/esm2022/lib/features/routing/components/routed-report-designer.component.mjs +2 -2
- package/esm2022/lib/provide-reporting.mjs +4 -1
- package/fesm2022/bways-report.mjs +350 -18
- package/fesm2022/bways-report.mjs.map +1 -1
- package/lib/core/config/bways-report-config.d.ts +4 -0
- package/lib/core/models/index.d.ts +1 -0
- package/lib/core/models/report-menu.model.d.ts +29 -0
- package/lib/core/tokens/reporting-config.token.d.ts +2 -0
- package/lib/core/utils/report-menu.util.d.ts +10 -0
- package/lib/features/designer/components/dialogs/report-saved-dialog.component.d.ts +12 -0
- package/lib/features/designer/components/menu-selector/report-menu-selector.component.d.ts +49 -0
- package/lib/features/designer/designer.component.d.ts +5 -1
- package/lib/features/designer/rpt-report-designer.component.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BwaysReportMenuConfig } from '../models/report-menu.model';
|
|
1
2
|
/**
|
|
2
3
|
* Simplified configuration for bways-report.
|
|
3
4
|
*
|
|
@@ -43,6 +44,8 @@ export declare const PALETTE_CATEGORY_MAP: Record<PaletteCategory, string>;
|
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
46
|
export interface BwaysReportConfig {
|
|
47
|
+
/** Optional menu destination review. null disables an inherited loader. */
|
|
48
|
+
menu?: BwaysReportMenuConfig | null;
|
|
46
49
|
/**
|
|
47
50
|
* GET endpoint returning the list of stored procedures with their parameters.
|
|
48
51
|
* Response: `[{ name, schema, parameters: [{ name, sqlType, required, defaultValue? }] }]`
|
|
@@ -149,6 +152,7 @@ export interface BwaysReportConfig {
|
|
|
149
152
|
* Result of normalizing a `BwaysReportConfig` for internal use.
|
|
150
153
|
*/
|
|
151
154
|
export interface NormalizedBwaysConfig {
|
|
155
|
+
menu: BwaysReportMenuConfig | null;
|
|
152
156
|
/** Endpoint URLs */
|
|
153
157
|
spEndpoint: string;
|
|
154
158
|
tablesEndpoint: string;
|
|
@@ -10,3 +10,4 @@ export type { ReportGridDefinition, GridColumnDefinition, GridOptionsDefinition,
|
|
|
10
10
|
export type { ReportLayoutDefinition, ComponentLayoutDefinition, } from './report-layout.model';
|
|
11
11
|
export type { ValidationDefinition, } from './validation.model';
|
|
12
12
|
export type { ComponentEventDefinition, ComponentActionDefinition, } from './component-event.model';
|
|
13
|
+
export * from './report-menu.model';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
/** Host-normalized menu tree. IDs must be unique and stable within the menu context. */
|
|
3
|
+
export interface BwaysReportMenuNode {
|
|
4
|
+
id: string;
|
|
5
|
+
caption: string;
|
|
6
|
+
moduleNo?: string;
|
|
7
|
+
menuKey?: string;
|
|
8
|
+
parentKey?: string;
|
|
9
|
+
selectable: boolean;
|
|
10
|
+
children?: readonly BwaysReportMenuNode[];
|
|
11
|
+
}
|
|
12
|
+
/** Review-only menu destination; phase one does not persist or activate it. */
|
|
13
|
+
export interface BwaysReportMenuSelection {
|
|
14
|
+
targetId: string;
|
|
15
|
+
moduleNo?: string;
|
|
16
|
+
menuKey: string;
|
|
17
|
+
menuCaption: string;
|
|
18
|
+
parentKey?: string;
|
|
19
|
+
path: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface BwaysReportMenuConfig {
|
|
22
|
+
/** Return a fresh complete tree, not a Subscription or only expanded rows. */
|
|
23
|
+
load: () => Observable<readonly BwaysReportMenuNode[]>;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Read reactive company/user/module signals here to invalidate an open review on context changes. */
|
|
26
|
+
contextKey?: () => string;
|
|
27
|
+
/** Defaults to 30 seconds. */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
* Core configuration models and injection tokens.
|
|
5
5
|
* Decoupled from UI primitives and data-access adapters.
|
|
6
6
|
*/
|
|
7
|
+
import { BwaysReportMenuConfig } from '../models/report-menu.model';
|
|
7
8
|
import { InjectionToken, Type } from '@angular/core';
|
|
8
9
|
/**
|
|
9
10
|
* Library configuration options.
|
|
10
11
|
*/
|
|
11
12
|
export interface ReportingConfig {
|
|
13
|
+
menu?: BwaysReportMenuConfig | null;
|
|
12
14
|
/** Default page size for grids. */
|
|
13
15
|
defaultPageSize: number;
|
|
14
16
|
/** Date format string used across the library. */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BwaysReportMenuNode, BwaysReportMenuSelection } from '../models/report-menu.model';
|
|
2
|
+
export interface ReportMenuRow {
|
|
3
|
+
node: BwaysReportMenuNode;
|
|
4
|
+
depth: number;
|
|
5
|
+
parentId?: string;
|
|
6
|
+
path: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Validate host data once per load; never mutate the host tree or silently omit bad branches. */
|
|
9
|
+
export declare function indexReportMenus(nodes: readonly BwaysReportMenuNode[]): ReportMenuRow[];
|
|
10
|
+
export declare function reportMenuSelection(row: ReportMenuRow): BwaysReportMenuSelection;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
import { BwaysReportMenuConfig, BwaysReportMenuSelection } from '../../../../core/models/report-menu.model';
|
|
1
2
|
import { ReportDefinition } from '../../../../core/models/report-definition.model';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export interface ReportSavedDialogData {
|
|
5
|
+
menuSelection?: BwaysReportMenuSelection | null;
|
|
4
6
|
report: ReportDefinition;
|
|
5
7
|
routeBase?: string;
|
|
6
8
|
}
|
|
7
9
|
export interface ReportSavedDialogResult {
|
|
10
|
+
/** Review-only: returned separately from report JSON, never persisted by phase one. */
|
|
11
|
+
menuSelection?: BwaysReportMenuSelection | null;
|
|
8
12
|
action: 'back_to_designer' | 'open_live_page';
|
|
9
13
|
report: ReportDefinition;
|
|
10
14
|
}
|
|
11
15
|
interface UpdateConfirmation {
|
|
12
16
|
report: ReportDefinition;
|
|
13
17
|
action: ReportSavedDialogResult['action'];
|
|
18
|
+
menuSelection?: BwaysReportMenuSelection | null;
|
|
19
|
+
menuContext: string;
|
|
20
|
+
menuConfig: BwaysReportMenuConfig | null;
|
|
14
21
|
expectedVersion: number;
|
|
15
22
|
existingName: string;
|
|
16
23
|
contextKey: string;
|
|
@@ -23,6 +30,11 @@ export declare class ReportSavedDialogComponent {
|
|
|
23
30
|
private readonly reportingConfig;
|
|
24
31
|
private idCheck?;
|
|
25
32
|
private customSlug;
|
|
33
|
+
private readonly menuSelector;
|
|
34
|
+
readonly menuConfig: import("@angular/core").Signal<BwaysReportMenuConfig | null>;
|
|
35
|
+
readonly menuSelection: import("@angular/core").WritableSignal<BwaysReportMenuSelection | null>;
|
|
36
|
+
readonly menuValid: import("@angular/core").WritableSignal<boolean>;
|
|
37
|
+
private menuContext;
|
|
26
38
|
readonly report: ReportDefinition;
|
|
27
39
|
readonly baseRoute: import("@angular/core").WritableSignal<string>;
|
|
28
40
|
readonly reportId: import("@angular/core").WritableSignal<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
3
|
+
import { BwaysReportMenuConfig, BwaysReportMenuSelection } from '../../../../core/models/report-menu.model';
|
|
4
|
+
import { ReportMenuRow } from '../../../../core/utils/report-menu.util';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ReportMenuSelectorComponent {
|
|
7
|
+
readonly config: import("@angular/core").InputSignal<BwaysReportMenuConfig>;
|
|
8
|
+
readonly value: import("@angular/core").InputSignal<BwaysReportMenuSelection | null>;
|
|
9
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
10
|
+
readonly selectionChange: import("@angular/core").OutputEmitterRef<BwaysReportMenuSelection | null>;
|
|
11
|
+
readonly validityChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
12
|
+
readonly selection: import("@angular/core").WritableSignal<BwaysReportMenuSelection | null>;
|
|
13
|
+
readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
14
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
15
|
+
readonly loaded: import("@angular/core").WritableSignal<boolean>;
|
|
16
|
+
readonly error: import("@angular/core").WritableSignal<string>;
|
|
17
|
+
readonly query: import("@angular/core").WritableSignal<string>;
|
|
18
|
+
readonly rows: import("@angular/core").WritableSignal<ReportMenuRow[]>;
|
|
19
|
+
readonly expanded: import("@angular/core").WritableSignal<Set<string>>;
|
|
20
|
+
readonly active: import("@angular/core").WritableSignal<number>;
|
|
21
|
+
readonly panelId: string;
|
|
22
|
+
readonly trigger: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
23
|
+
readonly search: import("@angular/core").Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
24
|
+
readonly list: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
25
|
+
private readonly element;
|
|
26
|
+
readonly scrollStrategy: import("@angular/cdk/overlay").ScrollStrategy;
|
|
27
|
+
readonly width: import("@angular/core").WritableSignal<number>;
|
|
28
|
+
readonly positions: ConnectedPosition[];
|
|
29
|
+
private request?;
|
|
30
|
+
private generation;
|
|
31
|
+
private context?;
|
|
32
|
+
readonly valid: import("@angular/core").Signal<boolean>;
|
|
33
|
+
readonly unavailable: import("@angular/core").Signal<boolean>;
|
|
34
|
+
readonly visible: import("@angular/core").Signal<ReportMenuRow[]>;
|
|
35
|
+
constructor();
|
|
36
|
+
toggle(): void;
|
|
37
|
+
attached(): void;
|
|
38
|
+
close(focus?: boolean): void;
|
|
39
|
+
reload(): void;
|
|
40
|
+
choose(row: ReportMenuRow): void;
|
|
41
|
+
clear(): void;
|
|
42
|
+
isExpanded(row: ReportMenuRow): boolean;
|
|
43
|
+
expand(row: ReportMenuRow): void;
|
|
44
|
+
onQuery(value: string): void;
|
|
45
|
+
triggerKey(event: KeyboardEvent): void;
|
|
46
|
+
key(event: KeyboardEvent): void;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ReportMenuSelectorComponent, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ReportMenuSelectorComponent, "rpt-report-menu-selector", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "validityChange": "validityChange"; }, never, never, true, never>;
|
|
49
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BwaysReportMenuSelection } from '../../core/models/report-menu.model';
|
|
1
2
|
import { BwaysReportConfig } from '../../core/config/bways-report-config';
|
|
2
3
|
import { OnInit } from '@angular/core';
|
|
3
4
|
import { ReportDefinition } from '../../core/models/report-definition.model';
|
|
@@ -33,6 +34,9 @@ export declare class DesignerComponent implements OnInit {
|
|
|
33
34
|
readonly definition: import("@angular/core").InputSignal<ReportDefinition | null | undefined>;
|
|
34
35
|
/** Emitted when the user saves the report */
|
|
35
36
|
readonly reportSaved: import("@angular/core").OutputEmitterRef<ReportDefinition>;
|
|
37
|
+
/** Review-only menu selection, independently supplied and returned by the host. */
|
|
38
|
+
readonly menuSelection: import("@angular/core").InputSignal<BwaysReportMenuSelection | null>;
|
|
39
|
+
readonly menuSelectionChange: import("@angular/core").OutputEmitterRef<BwaysReportMenuSelection | null>;
|
|
36
40
|
/** Emitted whenever the report definition changes in the visual designer */
|
|
37
41
|
readonly definitionChanged: import("@angular/core").OutputEmitterRef<ReportDefinition>;
|
|
38
42
|
readonly currentDefinition: import("@angular/core").WritableSignal<ReportDefinition>;
|
|
@@ -75,5 +79,5 @@ export declare class DesignerComponent implements OnInit {
|
|
|
75
79
|
private syntaxHighlightJson;
|
|
76
80
|
private showToast;
|
|
77
81
|
static ɵfac: i0.ɵɵFactoryDeclaration<DesignerComponent, never>;
|
|
78
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DesignerComponent, "rpt-designer", never, { "config": { "alias": "config"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "reportId": { "alias": "reportId"; "required": false; "isSignal": true; }; "loadSavedReportOnInit": { "alias": "loadSavedReportOnInit"; "required": false; "isSignal": true; }; "definition": { "alias": "initialReport"; "required": false; "isSignal": true; }; }, { "reportSaved": "save"; "definitionChanged": "definitionChange"; }, never, never, true, never>;
|
|
82
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DesignerComponent, "rpt-designer", never, { "config": { "alias": "config"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "reportId": { "alias": "reportId"; "required": false; "isSignal": true; }; "loadSavedReportOnInit": { "alias": "loadSavedReportOnInit"; "required": false; "isSignal": true; }; "definition": { "alias": "initialReport"; "required": false; "isSignal": true; }; "menuSelection": { "alias": "menuSelection"; "required": false; "isSignal": true; }; }, { "reportSaved": "save"; "menuSelectionChange": "menuSelectionChange"; "definitionChanged": "definitionChange"; }, never, never, true, never>;
|
|
79
83
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BwaysReportMenuSelection } from '../../core/models/report-menu.model';
|
|
1
2
|
import { BwaysReportConfig } from '../../core/config/bways-report-config';
|
|
2
3
|
import { BwaysReportApiUrls } from '../../data-access/adapters/endpoint-tokens';
|
|
3
4
|
import { ReportDefinition } from '../../core/models/report-definition.model';
|
|
@@ -31,6 +32,8 @@ export declare class RptReportDesignerComponent {
|
|
|
31
32
|
readonly closeLabel: import("@angular/core").InputSignal<string>;
|
|
32
33
|
/** Emitted when user saves the report */
|
|
33
34
|
readonly saved: import("@angular/core").OutputEmitterRef<ReportDefinition>;
|
|
35
|
+
readonly menuSelection: import("@angular/core").InputSignal<BwaysReportMenuSelection | null>;
|
|
36
|
+
readonly menuSelectionChange: import("@angular/core").OutputEmitterRef<BwaysReportMenuSelection | null>;
|
|
34
37
|
/** Emitted when user clicks the close button */
|
|
35
38
|
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
36
39
|
/** Emitted whenever the designer definition changes */
|
|
@@ -39,5 +42,5 @@ export declare class RptReportDesignerComponent {
|
|
|
39
42
|
onDefinitionChange(definition: ReportDefinition): void;
|
|
40
43
|
onClose(): void;
|
|
41
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<RptReportDesignerComponent, never>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RptReportDesignerComponent, "rpt-report-designer, rpt-designer-view", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "apiUrl": { "alias": "apiUrl"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "loadSavedReportOnInit": { "alias": "loadSavedReportOnInit"; "required": false; "isSignal": true; }; "report": { "alias": "report"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; }, { "saved": "saved"; "closed": "closed"; "definitionChange": "definitionChange"; }, never, never, true, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RptReportDesignerComponent, "rpt-report-designer, rpt-designer-view", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "apiUrl": { "alias": "apiUrl"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "loadSavedReportOnInit": { "alias": "loadSavedReportOnInit"; "required": false; "isSignal": true; }; "report": { "alias": "report"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; "menuSelection": { "alias": "menuSelection"; "required": false; "isSignal": true; }; }, { "saved": "saved"; "menuSelectionChange": "menuSelectionChange"; "closed": "closed"; "definitionChange": "definitionChange"; }, never, never, true, never>;
|
|
43
46
|
}
|