bways-report 0.1.6 → 0.1.8
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 +293 -464
- package/esm2022/lib/core/config/bways-report-config.mjs +83 -0
- package/esm2022/lib/core/index.mjs +2 -1
- package/esm2022/lib/core/models/report-definition.model.mjs +1 -1
- package/esm2022/lib/core/services/report-data-discovery.service.mjs +6 -3
- package/esm2022/lib/core/services/report-session-context.service.mjs +11 -7
- package/esm2022/lib/core/tokens/reporting-config.token.mjs +1 -1
- package/esm2022/lib/core/utils/data-normalization.util.mjs +87 -1
- package/esm2022/lib/core/utils/report-parameter.util.mjs +119 -3
- package/esm2022/lib/data-access/adapters/endpoint-datasource.adapter.mjs +69 -0
- package/esm2022/lib/data-access/adapters/endpoint-lookup.adapter.mjs +98 -0
- package/esm2022/lib/data-access/adapters/endpoint-masterdata.adapter.mjs +57 -0
- package/esm2022/lib/data-access/adapters/endpoint-persistence.adapter.mjs +85 -0
- package/esm2022/lib/data-access/adapters/endpoint-schema-discovery.adapter.mjs +163 -0
- package/esm2022/lib/data-access/adapters/endpoint-tokens.mjs +12 -0
- package/esm2022/lib/data-access/adapters/http-lookup.adapter.mjs +4 -23
- package/esm2022/lib/data-access/adapters/index.mjs +8 -1
- package/esm2022/lib/data-access/contracts/lookup.contract.mjs +1 -1
- package/esm2022/lib/features/designer/components/component-palette/component-palette.component.mjs +12 -2
- package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +5 -5
- package/esm2022/lib/features/designer/components/dialogs/report-saved-dialog.component.mjs +407 -0
- package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +109 -60
- package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +3 -3
- package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +110 -20
- package/esm2022/lib/features/designer/components/property-editor/property-editor-general.component.mjs +3 -3
- package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +60 -3
- package/esm2022/lib/features/designer/components/property-editor/property-editor-layout.component.mjs +11 -5
- package/esm2022/lib/features/designer/components/property-editor/property-editor-report.component.mjs +3 -3
- package/esm2022/lib/features/designer/components/property-editor/property-editor-validation.component.mjs +15 -3
- package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +204 -10
- package/esm2022/lib/features/designer/designer.component.mjs +276 -21
- package/esm2022/lib/features/designer/services/designer-state.service.mjs +9 -2
- package/esm2022/lib/features/embed/bways-report-builder.component.mjs +207 -0
- package/esm2022/lib/features/embed/bways-report-menu.component.mjs +433 -0
- package/esm2022/lib/features/embed/bways-report-page.component.mjs +204 -0
- package/esm2022/lib/features/embed/index.mjs +5 -0
- package/esm2022/lib/features/embed/inject-report-menu.mjs +99 -0
- package/esm2022/lib/features/index.mjs +2 -1
- package/esm2022/lib/features/persistence/services/report-store.service.mjs +43 -5
- package/esm2022/lib/features/routing/components/routed-report-runtime.component.mjs +4 -4
- package/esm2022/lib/features/routing/index.mjs +2 -2
- package/esm2022/lib/features/routing/models/report-route.models.mjs +1 -1
- package/esm2022/lib/features/routing/report-routes.mjs +42 -1
- package/esm2022/lib/features/routing/resolvers/report.resolver.mjs +6 -8
- package/esm2022/lib/features/routing/services/report-menu.service.mjs +14 -4
- package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +22 -3
- package/esm2022/lib/features/runtime/report-grid-bridge.component.mjs +16 -2
- package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +28 -5
- package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +86 -19
- package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +8 -1
- package/esm2022/lib/primitives/components/index.mjs +2 -1
- package/esm2022/lib/primitives/components/number/rpt-number.component.mjs +9 -3
- package/esm2022/lib/primitives/components/searchable-select/rpt-searchable-select.component.mjs +386 -0
- package/esm2022/lib/provide-reporting.mjs +137 -7
- package/fesm2022/bways-report.mjs +4286 -859
- package/fesm2022/bways-report.mjs.map +1 -1
- package/lib/core/config/bways-report-config.d.ts +161 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/models/report-definition.model.d.ts +16 -0
- package/lib/core/services/report-session-context.service.d.ts +1 -0
- package/lib/core/tokens/reporting-config.token.d.ts +16 -0
- package/lib/core/utils/data-normalization.util.d.ts +10 -0
- package/lib/core/utils/report-parameter.util.d.ts +18 -1
- package/lib/data-access/adapters/endpoint-datasource.adapter.d.ts +13 -0
- package/lib/data-access/adapters/endpoint-lookup.adapter.d.ts +14 -0
- package/lib/data-access/adapters/endpoint-masterdata.adapter.d.ts +11 -0
- package/lib/data-access/adapters/endpoint-persistence.adapter.d.ts +15 -0
- package/lib/data-access/adapters/endpoint-schema-discovery.adapter.d.ts +21 -0
- package/lib/data-access/adapters/endpoint-tokens.d.ts +21 -0
- package/lib/data-access/adapters/index.d.ts +7 -0
- package/lib/data-access/contracts/lookup.contract.d.ts +2 -2
- package/lib/features/designer/components/component-palette/component-palette.component.d.ts +1 -0
- package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +1 -1
- package/lib/features/designer/components/dialogs/report-saved-dialog.component.d.ts +34 -0
- package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +1 -0
- package/lib/features/designer/components/property-editor/property-editor-datasource.component.d.ts +12 -2
- package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +10 -0
- package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +13 -1
- package/lib/features/designer/designer.component.d.ts +15 -0
- package/lib/features/embed/bways-report-builder.component.d.ts +48 -0
- package/lib/features/embed/bways-report-menu.component.d.ts +40 -0
- package/lib/features/embed/bways-report-page.component.d.ts +61 -0
- package/lib/features/embed/index.d.ts +4 -0
- package/lib/features/embed/inject-report-menu.d.ts +44 -0
- package/lib/features/index.d.ts +1 -0
- package/lib/features/persistence/services/report-store.service.d.ts +5 -0
- package/lib/features/routing/index.d.ts +1 -1
- package/lib/features/routing/models/report-route.models.d.ts +3 -0
- package/lib/features/routing/report-routes.d.ts +40 -0
- package/lib/features/routing/resolvers/report.resolver.d.ts +1 -1
- package/lib/features/runtime/dynamic-renderer.component.d.ts +1 -0
- package/lib/features/runtime/report-grid-bridge.component.d.ts +1 -1
- package/lib/primitives/components/button/rpt-button.component.d.ts +3 -0
- package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +16 -3
- package/lib/primitives/components/index.d.ts +2 -0
- package/lib/primitives/components/searchable-select/rpt-searchable-select.component.d.ts +89 -0
- package/lib/provide-reporting.d.ts +22 -6
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ReportDefinition, ReportSummary } from '../../core/models/report-definition.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `<bways-report-builder>`
|
|
6
|
+
*
|
|
7
|
+
* Drop-in, single-tag visual report designer component for host applications.
|
|
8
|
+
*
|
|
9
|
+
* Wraps the full visual builder with:
|
|
10
|
+
* - Direct width and height inputs (`width="100%" height="calc(100vh - 64px)"`)
|
|
11
|
+
* - Built-in report selector dropdown and "+ New Report" button
|
|
12
|
+
* - Automatic persistence and menu synchronization
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```html
|
|
16
|
+
* <!-- Drop anywhere in your admin or report management page -->
|
|
17
|
+
* <bways-report-builder width="100%" height="calc(100vh - 64px)" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class BwaysReportBuilderComponent implements OnInit {
|
|
21
|
+
private readonly store;
|
|
22
|
+
private readonly destroyRef;
|
|
23
|
+
/** Width of the builder container. Defaults to '100%'. */
|
|
24
|
+
readonly width: import("@angular/core").InputSignal<string>;
|
|
25
|
+
/** Height of the builder container. Defaults to '100%'. */
|
|
26
|
+
readonly height: import("@angular/core").InputSignal<string>;
|
|
27
|
+
/** Initial report ID to open in the designer. */
|
|
28
|
+
readonly reportId: import("@angular/core").InputSignal<string | undefined>;
|
|
29
|
+
/** Whether to show the top switcher bar with report selector and "+ New" button. */
|
|
30
|
+
readonly showReportList: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
/** Emitted when a report definition is saved. */
|
|
32
|
+
readonly saved: import("@angular/core").OutputEmitterRef<ReportDefinition>;
|
|
33
|
+
/** Emitted when the report definition changes. */
|
|
34
|
+
readonly definitionChange: import("@angular/core").OutputEmitterRef<ReportDefinition>;
|
|
35
|
+
/** Emitted when a report is selected from the list. */
|
|
36
|
+
readonly reportSelect: import("@angular/core").OutputEmitterRef<string>;
|
|
37
|
+
readonly activeReportId: import("@angular/core").WritableSignal<string | null>;
|
|
38
|
+
readonly reportsList: import("@angular/core").WritableSignal<ReportSummary[]>;
|
|
39
|
+
readonly saveStatus: import("@angular/core").WritableSignal<string | null>;
|
|
40
|
+
readonly designerKey: import("@angular/core").WritableSignal<number>;
|
|
41
|
+
ngOnInit(): void;
|
|
42
|
+
onSelectReport(id: string): void;
|
|
43
|
+
createNewReport(): void;
|
|
44
|
+
onReportSaved(def: ReportDefinition): void;
|
|
45
|
+
private refreshReports;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BwaysReportBuilderComponent, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BwaysReportBuilderComponent, "bways-report-builder", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "reportId": { "alias": "reportId"; "required": false; "isSignal": true; }; "showReportList": { "alias": "showReportList"; "required": false; "isSignal": true; }; }, { "saved": "saved"; "definitionChange": "definitionChange"; "reportSelect": "reportSelect"; }, never, never, true, never>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReportMenuGroup, ReportMenuItem } from '../routing/models/report-route.models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export type ReportMenuVariant = 'sidebar' | 'navbar' | 'dropdown';
|
|
4
|
+
/**
|
|
5
|
+
* Drop-in menu component for bways-report.
|
|
6
|
+
*
|
|
7
|
+
* Automatically displays saved and published report pages from the backend or storage.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```html
|
|
11
|
+
* <!-- Sidebar navigation -->
|
|
12
|
+
* <bways-report-menu variant="sidebar" />
|
|
13
|
+
*
|
|
14
|
+
* <!-- Horizontal navigation bar -->
|
|
15
|
+
* <bways-report-menu variant="navbar" />
|
|
16
|
+
*
|
|
17
|
+
* <!-- Header dropdown button -->
|
|
18
|
+
* <bways-report-menu variant="dropdown" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class BwaysReportMenuComponent {
|
|
22
|
+
readonly variant: import("@angular/core").InputSignal<ReportMenuVariant>;
|
|
23
|
+
readonly basePath: import("@angular/core").InputSignal<string | undefined>;
|
|
24
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
25
|
+
readonly showIcons: import("@angular/core").InputSignal<boolean>;
|
|
26
|
+
readonly allowSearch: import("@angular/core").InputSignal<boolean>;
|
|
27
|
+
readonly includeDrafts: import("@angular/core").InputSignal<boolean>;
|
|
28
|
+
readonly searchQuery: import("@angular/core").WritableSignal<string>;
|
|
29
|
+
readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
30
|
+
readonly collapsedGroups: import("@angular/core").WritableSignal<Set<string>>;
|
|
31
|
+
private readonly rawMenu;
|
|
32
|
+
private readonly rawGroups;
|
|
33
|
+
readonly totalItems: import("@angular/core").Signal<number>;
|
|
34
|
+
readonly filteredFlatItems: import("@angular/core").Signal<ReportMenuItem[]>;
|
|
35
|
+
readonly filteredGroups: import("@angular/core").Signal<ReportMenuGroup[]>;
|
|
36
|
+
isGroupCollapsed(category: string): boolean;
|
|
37
|
+
toggleGroup(category: string): void;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BwaysReportMenuComponent, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BwaysReportMenuComponent, "bways-report-menu", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "basePath": { "alias": "basePath"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "showIcons": { "alias": "showIcons"; "required": false; "isSignal": true; }; "allowSearch": { "alias": "allowSearch"; "required": false; "isSignal": true; }; "includeDrafts": { "alias": "includeDrafts"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReportDefinition } from '../../core/models/report-definition.model';
|
|
2
|
+
import { GridRowClickAction } from '../../core/models/report-grid.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `<bways-report-page>`
|
|
6
|
+
*
|
|
7
|
+
* Drop-in standalone component that loads a saved report by its slug (or ID)
|
|
8
|
+
* and renders the complete interactive live form, data filters, and grid.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```html
|
|
12
|
+
* <!-- By slug (recommended) -->
|
|
13
|
+
* <bways-report-page slug="sale-report" />
|
|
14
|
+
*
|
|
15
|
+
* <!-- Or pass parameters & overrides -->
|
|
16
|
+
* <bways-report-page
|
|
17
|
+
* [slug]="currentSlug"
|
|
18
|
+
* [parameters]="{ BranchId: 5 }"
|
|
19
|
+
* [showExport]="true"
|
|
20
|
+
* (rowClick)="onRowSelected($event)"
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class BwaysReportPageComponent {
|
|
25
|
+
private readonly store;
|
|
26
|
+
private readonly destroyRef;
|
|
27
|
+
/** Report slug (e.g. 'sale-report') or unique ID */
|
|
28
|
+
readonly slug: import("@angular/core").InputSignal<string | undefined>;
|
|
29
|
+
/** Alternative alias for ID or slug */
|
|
30
|
+
readonly id: import("@angular/core").InputSignal<string | undefined>;
|
|
31
|
+
/** Explicit in-memory ReportDefinition if already loaded */
|
|
32
|
+
readonly report: import("@angular/core").InputSignal<ReportDefinition | null>;
|
|
33
|
+
/** Default input parameter values for the report */
|
|
34
|
+
readonly parameters: import("@angular/core").InputSignal<Record<string, unknown>>;
|
|
35
|
+
/** Whether to show export controls (Excel, CSV, Print) */
|
|
36
|
+
readonly showExport: import("@angular/core").InputSignal<boolean>;
|
|
37
|
+
/** Whether to enable saved view presets */
|
|
38
|
+
readonly enablePresets: import("@angular/core").InputSignal<boolean>;
|
|
39
|
+
/** Whether to automatically execute the query when the page opens */
|
|
40
|
+
readonly autoExecute: import("@angular/core").InputSignal<boolean>;
|
|
41
|
+
/** Container width */
|
|
42
|
+
readonly width: import("@angular/core").InputSignal<string>;
|
|
43
|
+
/** Container height */
|
|
44
|
+
readonly height: import("@angular/core").InputSignal<string>;
|
|
45
|
+
readonly rowClick: import("@angular/core").OutputEmitterRef<{
|
|
46
|
+
row: Record<string, unknown>;
|
|
47
|
+
parameters: Record<string, unknown>;
|
|
48
|
+
action?: GridRowClickAction;
|
|
49
|
+
}>;
|
|
50
|
+
readonly dataLoaded: import("@angular/core").OutputEmitterRef<unknown[]>;
|
|
51
|
+
readonly selectionChange: import("@angular/core").OutputEmitterRef<any[]>;
|
|
52
|
+
readonly selectionChanged: import("@angular/core").OutputEmitterRef<any[]>;
|
|
53
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
54
|
+
readonly error: import("@angular/core").WritableSignal<string | null>;
|
|
55
|
+
readonly reportDefinition: import("@angular/core").WritableSignal<ReportDefinition | null>;
|
|
56
|
+
constructor();
|
|
57
|
+
reloadReport(): void;
|
|
58
|
+
private fetchReport;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BwaysReportPageComponent, never>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BwaysReportPageComponent, "bways-report-page", never, { "slug": { "alias": "slug"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "report": { "alias": "report"; "required": false; "isSignal": true; }; "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; "showExport": { "alias": "showExport"; "required": false; "isSignal": true; }; "enablePresets": { "alias": "enablePresets"; "required": false; "isSignal": true; }; "autoExecute": { "alias": "autoExecute"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, { "rowClick": "rowClick"; "dataLoaded": "dataLoaded"; "selectionChange": "selectionChange"; "selectionChanged": "selectionChanged"; }, never, never, true, never>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { BwaysReportBuilderComponent } from './bways-report-builder.component';
|
|
2
|
+
export { BwaysReportPageComponent } from './bways-report-page.component';
|
|
3
|
+
export { BwaysReportMenuComponent, type ReportMenuVariant } from './bways-report-menu.component';
|
|
4
|
+
export { injectReportMenu, injectReportMenuGroups, type InjectReportMenuOptions, } from './inject-report-menu';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { ReportMenuGroup, ReportMenuItem } from '../routing/models/report-route.models';
|
|
3
|
+
/**
|
|
4
|
+
* Options for `injectReportMenu`.
|
|
5
|
+
*/
|
|
6
|
+
export interface InjectReportMenuOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Base route path for generated links.
|
|
9
|
+
* Defaults to configured `routeBase` (e.g. 'reports') or '/reports'.
|
|
10
|
+
*/
|
|
11
|
+
basePath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to include draft/unpublished reports.
|
|
14
|
+
* Default: false (only published reports appear in menus).
|
|
15
|
+
*/
|
|
16
|
+
includeDrafts?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Injects a reactive signal of published report menu items.
|
|
20
|
+
*
|
|
21
|
+
* Automatically triggers loading of report metadata from the persistence store/endpoint
|
|
22
|
+
* if not already loaded.
|
|
23
|
+
*
|
|
24
|
+
* Usage in component:
|
|
25
|
+
* ```typescript
|
|
26
|
+
* @Component({ ... })
|
|
27
|
+
* export class AppSidebarComponent {
|
|
28
|
+
* readonly reportMenu = injectReportMenu();
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
* Usage in template:
|
|
32
|
+
* ```html
|
|
33
|
+
* @for (item of reportMenu(); track item.slug) {
|
|
34
|
+
* <a [routerLink]="item.route">{{ item.name }}</a>
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function injectReportMenu(options?: InjectReportMenuOptions): Signal<ReportMenuItem[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Injects a reactive signal of published report menu groups (hierarchical).
|
|
41
|
+
*
|
|
42
|
+
* Useful for sidebars that organize reports under collapsible group headings.
|
|
43
|
+
*/
|
|
44
|
+
export declare function injectReportMenuGroups(options?: InjectReportMenuOptions): Signal<ReportMenuGroup[]>;
|
package/lib/features/index.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare class ReportStoreService {
|
|
|
31
31
|
* @param forceRefresh - If true, bypasses the in-memory cache.
|
|
32
32
|
*/
|
|
33
33
|
loadReport(reportId: string, forceRefresh?: boolean): Observable<ReportDefinition>;
|
|
34
|
+
/**
|
|
35
|
+
* Loads a report definition by slug or ID.
|
|
36
|
+
* Resolves from cache, loaded summaries, or adapter.
|
|
37
|
+
*/
|
|
38
|
+
loadReportBySlug(slugOrId: string, forceRefresh?: boolean): Observable<ReportDefinition>;
|
|
34
39
|
/**
|
|
35
40
|
* Saves a report definition, validates it, and updates local cache.
|
|
36
41
|
*/
|
|
@@ -2,5 +2,5 @@ export type { ReportRoutingConfig, ReportMenuItem, ReportMenuGroup } from './mod
|
|
|
2
2
|
export { reportResolver } from './resolvers/report.resolver';
|
|
3
3
|
export { RoutedReportRuntimeComponent } from './components/routed-report-runtime.component';
|
|
4
4
|
export { RoutedReportDesignerComponent } from './components/routed-report-designer.component';
|
|
5
|
-
export { createReportRoutes } from './report-routes';
|
|
5
|
+
export { createReportRoutes, bwaysReportRoutes, type BwaysReportRoutesOptions } from './report-routes';
|
|
6
6
|
export { ReportMenuService, groupReportsByCategory } from './services/report-menu.service';
|
|
@@ -14,3 +14,43 @@ import { ReportRoutingConfig } from './models/report-route.models';
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
export declare function createReportRoutes(config?: ReportRoutingConfig): Routes;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration options for `bwaysReportRoutes`.
|
|
19
|
+
*/
|
|
20
|
+
export interface BwaysReportRoutesOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Whether to include designer/builder routes ('new' and ':slug/edit').
|
|
23
|
+
* Defaults to false (since developers can embed <bways-report-builder> directly).
|
|
24
|
+
*/
|
|
25
|
+
includeBuilder?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Custom route guards for live report pages.
|
|
28
|
+
*/
|
|
29
|
+
runtimeGuards?: any[];
|
|
30
|
+
/**
|
|
31
|
+
* Custom route guards for builder/designer pages if enabled.
|
|
32
|
+
*/
|
|
33
|
+
builderGuards?: any[];
|
|
34
|
+
/**
|
|
35
|
+
* Optional custom route parameter name. Defaults to 'slug'.
|
|
36
|
+
*/
|
|
37
|
+
slugParam?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Extra static data passed into the route definitions.
|
|
40
|
+
*/
|
|
41
|
+
extraData?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Drop-in route definitions for bways-report.
|
|
45
|
+
*
|
|
46
|
+
* Example usage in host application `app.routes.ts`:
|
|
47
|
+
* ```typescript
|
|
48
|
+
* export const routes: Routes = [
|
|
49
|
+
* {
|
|
50
|
+
* path: 'reports',
|
|
51
|
+
* children: bwaysReportRoutes() // /reports/:slug -> live report page
|
|
52
|
+
* }
|
|
53
|
+
* ];
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function bwaysReportRoutes(options?: BwaysReportRoutesOptions): Routes;
|
|
@@ -2,6 +2,6 @@ import { ResolveFn } from '@angular/router';
|
|
|
2
2
|
import { ReportDefinition } from '../../../core/models';
|
|
3
3
|
/**
|
|
4
4
|
* Functional resolver that fetches a ReportDefinition using ReportStoreService
|
|
5
|
-
* based on the :reportId route parameter.
|
|
5
|
+
* based on the :slug or :reportId route parameter.
|
|
6
6
|
*/
|
|
7
7
|
export declare const reportResolver: ResolveFn<ReportDefinition | null>;
|
|
@@ -56,6 +56,7 @@ export declare class DynamicRendererComponent {
|
|
|
56
56
|
getGridRow(comp: ReportComponentDefinition): string;
|
|
57
57
|
getComponentHeight(comp: ReportComponentDefinition): string;
|
|
58
58
|
getComponentMinHeight(comp: ReportComponentDefinition): string;
|
|
59
|
+
isFormInput(type: string): boolean;
|
|
59
60
|
isComponentVisible(comp: ReportComponentDefinition): boolean;
|
|
60
61
|
onSubmit(): void;
|
|
61
62
|
handleAction(action: ComponentActionDefinition, comp?: ReportComponentDefinition): void;
|
|
@@ -19,6 +19,7 @@ export declare class RptGridOutletDirective implements OnDestroy {
|
|
|
19
19
|
}>;
|
|
20
20
|
readonly selectionChange: import("@angular/core").OutputEmitterRef<any[]>;
|
|
21
21
|
constructor();
|
|
22
|
+
private canAcceptInput;
|
|
22
23
|
private isReportStateMatching;
|
|
23
24
|
private isColumnDefsMatching;
|
|
24
25
|
private recreateComponent;
|
|
@@ -180,7 +181,6 @@ export declare class ReportGridBridgeComponent {
|
|
|
180
181
|
reportState: any;
|
|
181
182
|
pagination: boolean;
|
|
182
183
|
pageSize: number;
|
|
183
|
-
rowSelection: "single" | "multiple";
|
|
184
184
|
}>;
|
|
185
185
|
readonly showRowNumbers: import("@angular/core").Signal<boolean>;
|
|
186
186
|
readonly isPaginationEnabled: import("@angular/core").Signal<boolean>;
|
|
@@ -7,6 +7,9 @@ export declare class RptButtonComponent {
|
|
|
7
7
|
readonly onAction: import("@angular/core").InputSignal<((action: ComponentActionDefinition) => void) | undefined>;
|
|
8
8
|
readonly actionTriggered: import("@angular/core").OutputEmitterRef<ComponentActionDefinition>;
|
|
9
9
|
readonly elementId: import("@angular/core").Signal<string>;
|
|
10
|
+
readonly showFieldLabel: import("@angular/core").Signal<boolean>;
|
|
11
|
+
readonly fieldLabel: import("@angular/core").Signal<string>;
|
|
12
|
+
readonly hasLabelSpacer: import("@angular/core").Signal<boolean>;
|
|
10
13
|
readonly buttonLabel: import("@angular/core").Signal<string>;
|
|
11
14
|
readonly buttonHtmlType: import("@angular/core").Signal<"submit" | "button" | "reset">;
|
|
12
15
|
readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { ConnectedPosition, ConnectedOverlayPositionChange, ScrollStrategy } from '@angular/cdk/overlay';
|
|
3
4
|
import { ReportComponentDefinition } from '../../../core/models/report-component.model';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export interface DropdownOption {
|
|
@@ -10,13 +11,18 @@ export declare class RptDropdownComponent implements OnDestroy {
|
|
|
10
11
|
private readonly masterDataProvider;
|
|
11
12
|
private readonly lookupAdapter;
|
|
12
13
|
private readonly sessionService;
|
|
13
|
-
private readonly reportingConfig;
|
|
14
14
|
private readonly elementRef;
|
|
15
|
+
private readonly reportingConfig;
|
|
16
|
+
private readonly overlay;
|
|
17
|
+
readonly scrollStrategy: ScrollStrategy;
|
|
18
|
+
readonly triggerWidth: import("@angular/core").WritableSignal<string | number>;
|
|
19
|
+
readonly overlayPositions: ConnectedPosition[];
|
|
15
20
|
readonly config: import("@angular/core").InputSignal<ReportComponentDefinition>;
|
|
16
21
|
readonly control: import("@angular/core").InputSignal<FormControl<any> | null | undefined>;
|
|
17
22
|
readonly parentForm: import("@angular/core").InputSignal<FormGroup<any> | null>;
|
|
18
23
|
/** Designer mode: shows a small status line (Loading / N records / Waiting for…). */
|
|
19
24
|
readonly showStatus: import("@angular/core").InputSignal<boolean>;
|
|
25
|
+
readonly dropdownClick: import("@angular/core").OutputEmitterRef<void>;
|
|
20
26
|
private readonly fallbackControl;
|
|
21
27
|
readonly dynamicOptions: import("@angular/core").WritableSignal<DropdownOption[]>;
|
|
22
28
|
private lookupSub?;
|
|
@@ -48,9 +54,14 @@ export declare class RptDropdownComponent implements OnDestroy {
|
|
|
48
54
|
readonly selectedOption: import("@angular/core").Signal<DropdownOption | null>;
|
|
49
55
|
readonly filteredOptions: import("@angular/core").Signal<DropdownOption[]>;
|
|
50
56
|
readonly MAX_FILTER_RENDER = 200;
|
|
57
|
+
readonly INITIAL_FILTER_RENDER = 200;
|
|
58
|
+
readonly filterRenderLimit: import("@angular/core").WritableSignal<number>;
|
|
51
59
|
readonly visibleFilteredOptions: import("@angular/core").Signal<DropdownOption[]>;
|
|
52
60
|
readonly excessFilteredCount: import("@angular/core").Signal<number>;
|
|
53
|
-
|
|
61
|
+
onOptionsScroll(event: Event): void;
|
|
62
|
+
loadMoreFiltered(): void;
|
|
63
|
+
loadAllFiltered(): void;
|
|
64
|
+
readonly MAX_RENDERED_OPTIONS = 5000;
|
|
54
65
|
readonly renderedOptions: import("@angular/core").Signal<DropdownOption[]>;
|
|
55
66
|
readonly hasExcessOptions: import("@angular/core").Signal<boolean>;
|
|
56
67
|
readonly excessOptionsCount: import("@angular/core").Signal<number>;
|
|
@@ -64,6 +75,8 @@ export declare class RptDropdownComponent implements OnDestroy {
|
|
|
64
75
|
isSelected(opt: DropdownOption): boolean;
|
|
65
76
|
toggleOpen(event?: Event): void;
|
|
66
77
|
openDropdown(): void;
|
|
78
|
+
onPositionChange(change: ConnectedOverlayPositionChange): void;
|
|
79
|
+
onOverlayAttached(): void;
|
|
67
80
|
closeDropdown(): void;
|
|
68
81
|
selectOption(opt: DropdownOption): void;
|
|
69
82
|
clearSelection(event: Event): void;
|
|
@@ -79,5 +92,5 @@ export declare class RptDropdownComponent implements OnDestroy {
|
|
|
79
92
|
private scheduleReload;
|
|
80
93
|
private reloadDataSourceOptions;
|
|
81
94
|
static ɵfac: i0.ɵɵFactoryDeclaration<RptDropdownComponent, never>;
|
|
82
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RptDropdownComponent, "rpt-dropdown", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "showStatus": { "alias": "showStatus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RptDropdownComponent, "rpt-dropdown", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "showStatus": { "alias": "showStatus"; "required": false; "isSignal": true; }; }, { "dropdownClick": "dropdownClick"; }, never, never, true, never>;
|
|
83
96
|
}
|
|
@@ -12,3 +12,5 @@ export type { KpiTheme, TrendDirection } from './kpi-card/rpt-kpi-card.component
|
|
|
12
12
|
export { ReportChartBridgeComponent } from './chart-bridge/report-chart-bridge.component';
|
|
13
13
|
export type { ChartDataItem, ChartType } from './chart-bridge/report-chart-bridge.component';
|
|
14
14
|
export { RptIconComponent } from './icon/rpt-icon.component';
|
|
15
|
+
export { RptSearchableSelectComponent } from './searchable-select/rpt-searchable-select.component';
|
|
16
|
+
export type { SearchableSelectOption } from './searchable-select/rpt-searchable-select.component';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { ConnectedPosition, ConnectedOverlayPositionChange, ScrollStrategy } from '@angular/cdk/overlay';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface SearchableSelectOption<T = any> {
|
|
6
|
+
value: T;
|
|
7
|
+
label: string;
|
|
8
|
+
sublabel?: string;
|
|
9
|
+
badge?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
group?: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
}
|
|
14
|
+
export declare class RptSearchableSelectComponent implements ControlValueAccessor {
|
|
15
|
+
private readonly elementRef;
|
|
16
|
+
private readonly overlay;
|
|
17
|
+
readonly panelId: string;
|
|
18
|
+
readonly scrollStrategy: ScrollStrategy;
|
|
19
|
+
readonly triggerWidth: import("@angular/core").WritableSignal<string | number>;
|
|
20
|
+
readonly overlayPositions: ConnectedPosition[];
|
|
21
|
+
constructor(elementRef: ElementRef<HTMLElement>);
|
|
22
|
+
readonly options: import("@angular/core").InputSignal<any[] | SearchableSelectOption<any>[]>;
|
|
23
|
+
readonly value: import("@angular/core").InputSignal<any>;
|
|
24
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
25
|
+
readonly searchPlaceholder: import("@angular/core").InputSignal<string>;
|
|
26
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
27
|
+
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
28
|
+
readonly loadingText: import("@angular/core").InputSignal<string>;
|
|
29
|
+
readonly emptyText: import("@angular/core").InputSignal<string>;
|
|
30
|
+
readonly clearable: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
readonly searchable: import("@angular/core").InputSignal<boolean>;
|
|
32
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg">;
|
|
33
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
34
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
35
|
+
readonly valueKey: import("@angular/core").InputSignal<string>;
|
|
36
|
+
readonly labelKey: import("@angular/core").InputSignal<string>;
|
|
37
|
+
readonly sublabelKey: import("@angular/core").InputSignal<string>;
|
|
38
|
+
readonly badgeKey: import("@angular/core").InputSignal<string>;
|
|
39
|
+
readonly panelMaxHeight: import("@angular/core").InputSignal<string>;
|
|
40
|
+
readonly openAbove: import("@angular/core").InputSignal<boolean | undefined>;
|
|
41
|
+
readonly valueChange: import("@angular/core").OutputEmitterRef<any>;
|
|
42
|
+
readonly selectionChange: import("@angular/core").OutputEmitterRef<SearchableSelectOption<any>>;
|
|
43
|
+
readonly opened: import("@angular/core").OutputEmitterRef<void>;
|
|
44
|
+
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
45
|
+
readonly triggerBtnEl: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
46
|
+
readonly searchInputEl: import("@angular/core").Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
47
|
+
readonly optionsListEl: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
48
|
+
readonly internalValue: import("@angular/core").WritableSignal<any>;
|
|
49
|
+
readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
50
|
+
readonly opensAbove: import("@angular/core").WritableSignal<boolean>;
|
|
51
|
+
readonly searchTerm: import("@angular/core").WritableSignal<string>;
|
|
52
|
+
readonly focusedIndex: import("@angular/core").WritableSignal<number>;
|
|
53
|
+
private readonly cvaDisabled;
|
|
54
|
+
private onChange;
|
|
55
|
+
private onTouched;
|
|
56
|
+
readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
57
|
+
readonly normalizedOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
|
|
58
|
+
readonly filteredOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
|
|
59
|
+
readonly MAX_VISIBLE_OPTIONS = 150;
|
|
60
|
+
readonly INITIAL_VISIBLE_OPTIONS = 150;
|
|
61
|
+
readonly renderedLimit: import("@angular/core").WritableSignal<number>;
|
|
62
|
+
readonly visibleFilteredOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
|
|
63
|
+
readonly excessCount: import("@angular/core").Signal<number>;
|
|
64
|
+
onOptionsScroll(event: Event): void;
|
|
65
|
+
loadMore(): void;
|
|
66
|
+
loadAll(): void;
|
|
67
|
+
readonly selectedOption: import("@angular/core").Signal<SearchableSelectOption<any> | undefined>;
|
|
68
|
+
writeValue(obj: any): void;
|
|
69
|
+
registerOnChange(fn: any): void;
|
|
70
|
+
registerOnTouched(fn: any): void;
|
|
71
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
72
|
+
toggle(event?: Event): void;
|
|
73
|
+
open(): void;
|
|
74
|
+
onPositionChange(change: ConnectedOverlayPositionChange): void;
|
|
75
|
+
onOverlayAttached(): void;
|
|
76
|
+
close(): void;
|
|
77
|
+
selectOption(opt: SearchableSelectOption): void;
|
|
78
|
+
clearSelection(event: Event): void;
|
|
79
|
+
clearSearch(event: Event): void;
|
|
80
|
+
onSearchInput(event: Event): void;
|
|
81
|
+
onTriggerKeydown(event: KeyboardEvent): void;
|
|
82
|
+
onSearchKeydown(event: KeyboardEvent): void;
|
|
83
|
+
private scrollFocusedIntoView;
|
|
84
|
+
isSelected(opt: SearchableSelectOption): boolean;
|
|
85
|
+
onDocumentClick(event: MouseEvent): void;
|
|
86
|
+
onEscape(): void;
|
|
87
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RptSearchableSelectComponent, never>;
|
|
88
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RptSearchableSelectComponent, "rpt-searchable-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "labelKey": { "alias": "labelKey"; "required": false; "isSignal": true; }; "sublabelKey": { "alias": "sublabelKey"; "required": false; "isSignal": true; }; "badgeKey": { "alias": "badgeKey"; "required": false; "isSignal": true; }; "panelMaxHeight": { "alias": "panelMaxHeight"; "required": false; "isSignal": true; }; "openAbove": { "alias": "openAbove"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "selectionChange": "selectionChange"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
89
|
+
}
|
|
@@ -11,6 +11,7 @@ import { MasterDataProvider } from './data-access/contracts/master-data.provider
|
|
|
11
11
|
import { ReportPersistenceAdapter } from './data-access/contracts/report-persistence.contract';
|
|
12
12
|
import { ReportSchemaDiscoveryAdapter } from './data-access/contracts/schema-discovery.contract';
|
|
13
13
|
import { ReportLookupAdapter } from './data-access/contracts/lookup.contract';
|
|
14
|
+
import { BwaysReportConfig } from './core/config/bways-report-config';
|
|
14
15
|
/**
|
|
15
16
|
* Kinds of reporting features available in `provideBwaysReport`.
|
|
16
17
|
*/
|
|
@@ -116,16 +117,31 @@ export type ProvideBwaysReportingOptions = ProvideBwaysReportOptions;
|
|
|
116
117
|
/**
|
|
117
118
|
* Provides the BWays-Report library to the Angular application.
|
|
118
119
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
120
|
+
* **Simple config (recommended for most projects):**
|
|
121
|
+
* ```typescript
|
|
122
|
+
* provideBwaysReport({
|
|
123
|
+
* spEndpoint: '/api/reporting/procedures',
|
|
124
|
+
* tablesEndpoint: '/api/reporting/tables',
|
|
125
|
+
* executeEndpoint: '/api/reporting/execute',
|
|
126
|
+
* reportsEndpoint: '/api/reporting/reports',
|
|
127
|
+
* components: ['formInputs', 'actionButtons'],
|
|
128
|
+
* session: () => inject(AuthService).session(),
|
|
129
|
+
* })
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* **Advanced config (existing adapter pattern):**
|
|
133
|
+
* ```typescript
|
|
134
|
+
* provideBwaysReport(
|
|
135
|
+
* { apiBaseUrl: '/api/reporting' },
|
|
136
|
+
* withHttpAdapters({ apiBaseUrl: '/api/reporting' })
|
|
137
|
+
* )
|
|
138
|
+
* ```
|
|
123
139
|
*
|
|
124
|
-
* @param options -
|
|
140
|
+
* @param options - Either a `BwaysReportConfig` (simple) or `ProvideBwaysReportOptions` (advanced).
|
|
125
141
|
* @param features - Optional features like `withHttpAdapters(...)` or `withLocalStorage()`.
|
|
126
142
|
* @returns Environment providers for the reporting library.
|
|
127
143
|
*/
|
|
128
|
-
export declare function provideBwaysReport(options?: ProvideBwaysReportOptions, ...features: ReportingFeature[]): EnvironmentProviders;
|
|
144
|
+
export declare function provideBwaysReport(options?: BwaysReportConfig | ProvideBwaysReportOptions, ...features: ReportingFeature[]): EnvironmentProviders;
|
|
129
145
|
/** Alias for provideBwaysReport */
|
|
130
146
|
export declare const provideBwaysReporting: typeof provideBwaysReport;
|
|
131
147
|
/** Backward-compatible alias for provideBwaysReport */
|