bways-report 0.1.2 → 0.1.3

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.
Files changed (100) hide show
  1. package/README.md +150 -51
  2. package/esm2022/lib/core/errors/reporting-errors.mjs +2 -2
  3. package/esm2022/lib/core/index.mjs +3 -1
  4. package/esm2022/lib/core/models/report-datasource.model.mjs +1 -1
  5. package/esm2022/lib/core/models/report-definition.model.mjs +1 -1
  6. package/esm2022/lib/core/models/report-grid.model.mjs +1 -1
  7. package/esm2022/lib/core/services/report-session-context.service.mjs +50 -5
  8. package/esm2022/lib/core/utils/data-normalization.util.mjs +56 -0
  9. package/esm2022/lib/core/utils/report-parameter.util.mjs +180 -0
  10. package/esm2022/lib/data-access/adapters/http-datasource.adapter.mjs +82 -0
  11. package/esm2022/lib/data-access/adapters/http-lookup.adapter.mjs +34 -9
  12. package/esm2022/lib/data-access/adapters/http-masterdata.adapter.mjs +38 -0
  13. package/esm2022/lib/data-access/adapters/http-persistence.adapter.mjs +217 -0
  14. package/esm2022/lib/data-access/adapters/http-schema-discovery.adapter.mjs +3 -1
  15. package/esm2022/lib/data-access/adapters/index.mjs +8 -3
  16. package/esm2022/lib/data-access/adapters/local-storage-persistence.adapter.mjs +167 -0
  17. package/esm2022/lib/data-access/adapters/mock-datasource.adapter.mjs +60 -0
  18. package/esm2022/lib/data-access/contracts/api-dtos.mjs +6 -0
  19. package/esm2022/lib/data-access/contracts/index.mjs +2 -1
  20. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +555 -92
  21. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +593 -0
  22. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +164 -23
  23. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +410 -12
  24. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +149 -2
  25. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +109 -6
  26. package/esm2022/lib/features/designer/designer.component.mjs +101 -12
  27. package/esm2022/lib/features/designer/index.mjs +4 -1
  28. package/esm2022/lib/features/designer/rpt-report-designer.component.mjs +102 -0
  29. package/esm2022/lib/features/designer/services/designer-state.service.mjs +10 -9
  30. package/esm2022/lib/features/designer/services/report-template.service.mjs +318 -0
  31. package/esm2022/lib/features/designer/utilities/canvas-layout.util.mjs +41 -9
  32. package/esm2022/lib/features/export/index.mjs +2 -2
  33. package/esm2022/lib/features/export/models/export.models.mjs +1 -1
  34. package/esm2022/lib/features/export/services/report-export.service.mjs +420 -5
  35. package/esm2022/lib/features/routing/components/routed-report-runtime.component.mjs +2 -2
  36. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +231 -33
  37. package/esm2022/lib/features/runtime/index.mjs +2 -1
  38. package/esm2022/lib/features/runtime/report-execution.service.mjs +64 -0
  39. package/esm2022/lib/features/runtime/report-grid-bridge.component.mjs +224 -26
  40. package/esm2022/lib/features/runtime/report-runtime.component.mjs +341 -7
  41. package/esm2022/lib/features/runtime/rpt-report.component.mjs +537 -0
  42. package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +19 -8
  43. package/esm2022/lib/primitives/components/chart-bridge/report-chart-bridge.component.mjs +18 -7
  44. package/esm2022/lib/primitives/components/date-range/rpt-date-range.component.mjs +346 -0
  45. package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +727 -73
  46. package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +8 -1
  47. package/esm2022/lib/primitives/components/index.mjs +2 -1
  48. package/esm2022/lib/primitives/register-builtins.mjs +51 -2
  49. package/esm2022/lib/provide-reporting.mjs +145 -24
  50. package/fesm2022/bways-report.mjs +6871 -753
  51. package/fesm2022/bways-report.mjs.map +1 -1
  52. package/lib/core/index.d.ts +2 -0
  53. package/lib/core/models/report-datasource.model.d.ts +9 -0
  54. package/lib/core/models/report-definition.model.d.ts +2 -0
  55. package/lib/core/models/report-grid.model.d.ts +44 -0
  56. package/lib/core/services/report-session-context.service.d.ts +6 -1
  57. package/lib/core/utils/data-normalization.util.d.ts +15 -0
  58. package/lib/core/utils/report-parameter.util.d.ts +35 -0
  59. package/lib/data-access/adapters/http-datasource.adapter.d.ts +20 -0
  60. package/lib/data-access/adapters/http-lookup.adapter.d.ts +3 -0
  61. package/lib/data-access/adapters/http-masterdata.adapter.d.ts +13 -0
  62. package/lib/data-access/adapters/http-persistence.adapter.d.ts +27 -0
  63. package/lib/data-access/adapters/http-schema-discovery.adapter.d.ts +2 -0
  64. package/lib/data-access/adapters/index.d.ts +7 -2
  65. package/lib/data-access/adapters/local-storage-persistence.adapter.d.ts +19 -0
  66. package/lib/data-access/adapters/mock-datasource.adapter.d.ts +9 -0
  67. package/lib/data-access/contracts/api-dtos.d.ts +67 -0
  68. package/lib/data-access/contracts/index.d.ts +1 -0
  69. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +22 -0
  70. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +1 -1
  71. package/lib/features/designer/components/property-editor/property-editor-action.component.d.ts +33 -0
  72. package/lib/features/designer/components/property-editor/property-editor-datasource.component.d.ts +4 -0
  73. package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +16 -2
  74. package/lib/features/designer/components/property-editor/property-editor.component.d.ts +5 -0
  75. package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +7 -0
  76. package/lib/features/designer/designer.component.d.ts +5 -0
  77. package/lib/features/designer/index.d.ts +4 -0
  78. package/lib/features/designer/rpt-report-designer.component.d.ts +38 -0
  79. package/lib/features/designer/services/designer-state.service.d.ts +1 -1
  80. package/lib/features/designer/services/report-template.service.d.ts +32 -0
  81. package/lib/features/designer/utilities/canvas-layout.util.d.ts +4 -0
  82. package/lib/features/export/index.d.ts +2 -2
  83. package/lib/features/export/models/export.models.d.ts +23 -0
  84. package/lib/features/export/services/report-export.service.d.ts +31 -2
  85. package/lib/features/runtime/dynamic-renderer.component.d.ts +39 -2
  86. package/lib/features/runtime/index.d.ts +2 -0
  87. package/lib/features/runtime/report-execution.service.d.ts +16 -0
  88. package/lib/features/runtime/report-grid-bridge.component.d.ts +129 -6
  89. package/lib/features/runtime/report-runtime.component.d.ts +83 -1
  90. package/lib/features/runtime/rpt-report.component.d.ts +66 -0
  91. package/lib/primitives/components/button/rpt-button.component.d.ts +5 -2
  92. package/lib/primitives/components/chart-bridge/report-chart-bridge.component.d.ts +1 -0
  93. package/lib/primitives/components/date-range/rpt-date-range.component.d.ts +43 -0
  94. package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +55 -7
  95. package/lib/primitives/components/index.d.ts +2 -0
  96. package/lib/provide-reporting.d.ts +79 -26
  97. package/package.json +2 -1
  98. package/schematics/collection.json +10 -0
  99. package/schematics/ng-add/index.js +45 -0
  100. package/schematics/ng-add/schema.json +17 -0
@@ -5,3 +5,5 @@ export * from './errors';
5
5
  export * from './validation';
6
6
  export * from './services';
7
7
  export * from './utilities';
8
+ export * from './utils/data-normalization.util';
9
+ export * from './utils/report-parameter.util';
@@ -17,6 +17,15 @@ export interface ReportDataSourceDefinition {
17
17
  endpoint: string;
18
18
  /** HTTP method or execution method hint. */
19
19
  method?: 'GET' | 'POST' | 'STORED_PROCEDURE' | 'CUSTOM';
20
+ /** Database schema (defaults to 'dbo'). */
21
+ schema?: string;
22
+ /** Backend execution type. */
23
+ type?: 'stored_procedure' | 'table' | 'view' | 'sql' | string;
24
+ /**
25
+ * Stored procedure parameter mappings. Values may be fixed, or tokens:
26
+ * `{{session.branchId}}`, `{{context.today}}`, `{{fieldKey}}` (canvas field).
27
+ */
28
+ parameterMappings?: Record<string, string | number | boolean>;
20
29
  /**
21
30
  * Parameter keys that this data source requires.
22
31
  * These are resolved from the report's current parameter values
@@ -77,6 +77,8 @@ export interface ReportDefinition {
77
77
  version: number;
78
78
  /** Category or group for organizing reports. */
79
79
  category?: string;
80
+ /** Whether the report is published (vs. draft). */
81
+ isPublished?: boolean;
80
82
  /** Page layout configuration. */
81
83
  layout: ReportLayoutDefinition;
82
84
  /** Components (controls, buttons, display elements) on this report page. */
@@ -6,6 +6,36 @@
6
6
  * library's API. The `ReportGridBridgeComponent` translates this into
7
7
  * whatever the host's grid component (BWays-grid, AG Grid, etc.) expects.
8
8
  */
9
+ /**
10
+ * Interactive action triggered when a row or cell in the result grid is clicked.
11
+ */
12
+ export interface GridRowClickAction {
13
+ /**
14
+ * Action type:
15
+ * - 'drilldown-report': navigates to or opens a target sub-report
16
+ * - 'open-drawer': opens an in-page slide-over drawer running the target report
17
+ * - 'navigate': opens an external URL or application route
18
+ * - 'emit-custom': emits a custom event for the host application
19
+ */
20
+ type: 'drilldown-report' | 'open-drawer' | 'navigate' | 'emit-custom';
21
+ /** Target report ID to open/drill into (e.g. 'rep_customer_ledger'). */
22
+ targetReportId?: string;
23
+ /** External URL or route template if type === 'navigate'. Supports `{{row.field}}` replacements. */
24
+ targetUrl?: string;
25
+ /** Target browsing context: '_blank' | '_self' when navigating. */
26
+ openNewTab?: boolean;
27
+ /** Title for the slide-over drawer or dialog. Supports `{{row.field}}` replacements. */
28
+ drawerTitle?: string;
29
+ /** Width of the slide drawer (CSS value, e.g. '680px', '50vw'). Default: '720px'. */
30
+ drawerWidth?: string;
31
+ /**
32
+ * Maps parameter keys of the target sub-report to expressions:
33
+ * e.g. { "@CustCode": "row.customerId", "@BranchId": "session.branchId", "fromDate": "form.fromDate" }
34
+ */
35
+ parameterMapping?: Record<string, string>;
36
+ /** Custom event or action identifier when type === 'emit-custom'. */
37
+ customActionName?: string;
38
+ }
9
39
  /**
10
40
  * Defines the result grid for a report.
11
41
  */
@@ -16,6 +46,8 @@ export interface ReportGridDefinition {
16
46
  columns: GridColumnDefinition[];
17
47
  /** Grid-level options. */
18
48
  options?: GridOptionsDefinition;
49
+ /** Declarative row-click action for master-detail drill-downs. */
50
+ rowClickAction?: GridRowClickAction;
19
51
  }
20
52
  /**
21
53
  * Defines a single column in the result grid.
@@ -45,6 +77,8 @@ export interface GridColumnDefinition {
45
77
  order?: number;
46
78
  /** Aggregate function to display in a footer row. */
47
79
  aggregate?: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'none';
80
+ /** Optional cell-specific click action (overrides grid-level rowClickAction for this column). */
81
+ action?: GridRowClickAction;
48
82
  }
49
83
  /**
50
84
  * Grid-level options.
@@ -70,4 +104,14 @@ export interface GridOptionsDefinition {
70
104
  showFooter?: boolean;
71
105
  /** Height of the grid (CSS value). */
72
106
  height?: string;
107
+ /** Active column grouping fields in order (e.g. ['branch', 'customer']). */
108
+ groupModel?: string[];
109
+ /** Active sort model definitions. */
110
+ sortModel?: unknown[];
111
+ /** Complete serialized grid report state (filters, highlights, groups). */
112
+ reportState?: Record<string, unknown>;
113
+ /** View presets / saved custom grid views. */
114
+ presets?: unknown[];
115
+ /** Declarative row-click action for master-detail drill-downs. */
116
+ rowClickAction?: GridRowClickAction;
73
117
  }
@@ -64,10 +64,15 @@ export declare class ReportSessionContextService implements OnDestroy {
64
64
  * Always pulls the latest runtime state. Never throws or crashes the thread.
65
65
  */
66
66
  getCurrentSessionContext(): SessionContextMap;
67
+ /**
68
+ * Safely detects session parameters from host project browser storage
69
+ * (sessionStorage: user_Info, currentUser; localStorage: currentUser, CompanyData, user_Info).
70
+ */
71
+ private detectBrowserSession;
67
72
  /**
68
73
  * Normalizes a parameter or session key into a lowercase alphanumeric string
69
74
  * for reliable, case-insensitive, and symbol-insensitive matching.
70
- * E.g. '@BranchId' -> 'branchid', 'branch_id' -> 'branchid', 'BranchID' -> 'branchid'
75
+ * Strips SQL Server Hungarian type prefixes (e.g. '@chrCompanyId' -> 'companyid').
71
76
  */
72
77
  normalizeKey(key: string): string;
73
78
  /**
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Utility to normalize arbitrary backend HTTP responses into standard array of records.
3
+ *
4
+ * Supports:
5
+ * - Direct array payloads: `[ { ... }, { ... } ]`
6
+ * - Standard envelope wrappers: `{ data: [...] }`, `{ rows: [...] }`, `{ result: [...] }`, `{ items: [...] }`
7
+ * - OData envelopes: `{ value: [...] }`
8
+ * - Paginated wrappers: `{ total: 100, page: 1, data: [...] }`
9
+ */
10
+ export declare function extractRowArray<T = unknown>(response: unknown): T[];
11
+ /**
12
+ * Case-insensitive lookup in an object/record.
13
+ * Searches for exact match first, then lower-cased match, then normalized (ignoring underscores/dashes).
14
+ */
15
+ export declare function getFieldCaseInsensitive(record: Record<string, unknown> | null | undefined, targetKey: string): unknown;
@@ -0,0 +1,35 @@
1
+ import { ReportDefinition } from '../models/report-definition.model';
2
+ import { ReportDataSourceDefinition } from '../models/report-datasource.model';
3
+ export type ParameterMappings = Record<string, string | number | boolean>;
4
+ /** Resolves `{{context.xxx}}` presets such as today / startOfMonth. */
5
+ export declare function resolveContextPreset(key: string): string;
6
+ /**
7
+ * Looks up a field value from formValues supporting direct names, dot paths (a.b),
8
+ * and compound date ranges (e.g. dateRange.from, dateRange_from, dateRangeFrom).
9
+ */
10
+ export declare function resolveCanvasFieldValue(formValues: Record<string, unknown>, inner: string): unknown;
11
+ /**
12
+ * Resolves one raw mapping value against session + canvas form values.
13
+ * - `{{session.branchId}}` -> session value (case-insensitive)
14
+ * - `{{context.today}}` -> computed date
15
+ * - `{{fromDate}}` -> value of canvas field with key `fromDate` (case-insensitive)
16
+ * - `{{dateRange.from}}` -> value of nested from property
17
+ * - anything else -> returned unchanged (fixed value)
18
+ */
19
+ export declare function resolveParameterValue(raw: unknown, session: Record<string, unknown>, formValues: Record<string, unknown>): unknown;
20
+ /** Resolves every mapping into concrete values (de-duplicating `@name` / `name`). */
21
+ export declare function resolveParameterMappings(mappings: ParameterMappings | undefined, session: Record<string, unknown>, formValues: Record<string, unknown>): Record<string, unknown>;
22
+ /**
23
+ * Returns canvas field keys referenced by mappings that currently have no value.
24
+ * Session / context / fixed values never block execution.
25
+ */
26
+ export declare function findMissingCanvasFields(mappings: ParameterMappings | undefined, formValues: Record<string, unknown>): string[];
27
+ /**
28
+ * Picks the data source the result grid should run:
29
+ * 1. the one referenced by `grid.dataSourceId`
30
+ * 2. otherwise the first declared data source
31
+ * 3. otherwise a procedure/table bound to a component (legacy reports)
32
+ */
33
+ export declare function resolveExecutionDataSource(def: ReportDefinition): ReportDataSourceDefinition | null;
34
+ /** Strips SQL Server Hungarian prefixes: `@chrFromDate` -> `fromDate`. */
35
+ export declare function toFieldKey(paramName: string): string;
@@ -0,0 +1,20 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ReportDataSourceAdapter } from '../contracts/data-source.contract';
3
+ import { ReportDataSourceDefinition } from '../../core/models/report-datasource.model';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Built-in HTTP adapter for executing report data sources against the reporting backend.
7
+ * Automatically injects active multi-tenant session headers (X-Company-Id, X-Branch-Id)
8
+ * and includes rich development fallback data when the backend is unreachable.
9
+ */
10
+ export declare class HttpReportDataSourceAdapter extends ReportDataSourceAdapter {
11
+ private readonly http;
12
+ private readonly config;
13
+ private readonly sessionService;
14
+ execute(dataSource: ReportDataSourceDefinition, parameters: Record<string, unknown>): Observable<unknown[]>;
15
+ private getMockExecutionData;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpReportDataSourceAdapter, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpReportDataSourceAdapter>;
18
+ }
19
+ /** Convenience alias */
20
+ export declare const HttpDataSourceAdapter: typeof HttpReportDataSourceAdapter;
@@ -8,6 +8,7 @@ import * as i0 from "@angular/core";
8
8
  export declare class HttpReportLookupAdapter extends ReportLookupAdapter {
9
9
  private readonly http;
10
10
  private readonly config;
11
+ private readonly sessionService;
11
12
  private readonly cache;
12
13
  private readonly mockDataStore;
13
14
  fetchOptions(request: LookupQueryRequest): Observable<LookupOptionItem[]>;
@@ -17,3 +18,5 @@ export declare class HttpReportLookupAdapter extends ReportLookupAdapter {
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpReportLookupAdapter, never>;
18
19
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpReportLookupAdapter>;
19
20
  }
21
+ /** Convenience alias */
22
+ export declare const HttpLookupAdapter: typeof HttpReportLookupAdapter;
@@ -0,0 +1,13 @@
1
+ import { Observable } from 'rxjs';
2
+ import { MasterDataItem, MasterDataOptions, MasterDataProvider } from '../contracts/master-data.provider';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Built-in HTTP adapter for legacy master data queries.
6
+ * Integrates directly with the reporting backend lookup service.
7
+ */
8
+ export declare class HttpMasterDataAdapter extends MasterDataProvider {
9
+ private readonly lookupAdapter;
10
+ getMasterData(masterName: string, options?: MasterDataOptions): Observable<MasterDataItem[]>;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpMasterDataAdapter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpMasterDataAdapter>;
13
+ }
@@ -0,0 +1,27 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ReportDefinition, ReportSummary } from '../../core/models/report-definition.model';
3
+ import { ReportPersistenceAdapter } from '../contracts/report-persistence.contract';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Built-in HTTP adapter for report definitions persistence.
7
+ * Connects to NestJS `/api/reporting/reports` endpoints.
8
+ * Includes in-memory mock fallback when the remote backend is unreachable.
9
+ */
10
+ export declare class HttpReportPersistenceAdapter extends ReportPersistenceAdapter {
11
+ private readonly http;
12
+ private readonly config;
13
+ private readonly mockStore;
14
+ constructor();
15
+ load(reportId: string): Observable<ReportDefinition>;
16
+ save(report: ReportDefinition): Observable<ReportDefinition>;
17
+ list(): Observable<ReportSummary[]>;
18
+ delete(reportId: string): Observable<void>;
19
+ publish(reportId: string, version: number): Observable<void>;
20
+ private getMockReport;
21
+ private getMockSummaries;
22
+ private seedDefaultMockReports;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpReportPersistenceAdapter, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpReportPersistenceAdapter>;
25
+ }
26
+ /** Convenience alias */
27
+ export declare const HttpPersistenceAdapter: typeof HttpReportPersistenceAdapter;
@@ -18,3 +18,5 @@ export declare class HttpReportSchemaDiscoveryAdapter extends ReportSchemaDiscov
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpReportSchemaDiscoveryAdapter, never>;
19
19
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpReportSchemaDiscoveryAdapter>;
20
20
  }
21
+ /** Convenience alias */
22
+ export declare const HttpSchemaDiscoveryAdapter: typeof HttpReportSchemaDiscoveryAdapter;
@@ -1,2 +1,7 @@
1
- export { HttpReportSchemaDiscoveryAdapter } from './http-schema-discovery.adapter';
2
- export { HttpReportLookupAdapter } from './http-lookup.adapter';
1
+ export { HttpReportSchemaDiscoveryAdapter, HttpSchemaDiscoveryAdapter, } from './http-schema-discovery.adapter';
2
+ export { HttpReportLookupAdapter, HttpLookupAdapter, } from './http-lookup.adapter';
3
+ export { HttpReportDataSourceAdapter, HttpDataSourceAdapter, } from './http-datasource.adapter';
4
+ export { HttpReportPersistenceAdapter, HttpPersistenceAdapter, } from './http-persistence.adapter';
5
+ export { HttpMasterDataAdapter, } from './http-masterdata.adapter';
6
+ export { LocalStorageReportPersistenceAdapter, } from './local-storage-persistence.adapter';
7
+ export { MockReportDataSourceAdapter, } from './mock-datasource.adapter';
@@ -0,0 +1,19 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ReportPersistenceAdapter } from '../contracts/report-persistence.contract';
3
+ import { ReportDefinition, ReportSummary } from '../../core/models/report-definition.model';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LocalStorageReportPersistenceAdapter extends ReportPersistenceAdapter {
6
+ private readonly templateService;
7
+ constructor();
8
+ private seedDefaultBlueprintsIfEmpty;
9
+ private getIndex;
10
+ private saveIndex;
11
+ private saveDirect;
12
+ load(reportId: string): Observable<ReportDefinition>;
13
+ save(report: ReportDefinition): Observable<ReportDefinition>;
14
+ list(): Observable<ReportSummary[]>;
15
+ delete(reportId: string): Observable<void>;
16
+ publish(reportId: string, version: number): Observable<void>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageReportPersistenceAdapter, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageReportPersistenceAdapter>;
19
+ }
@@ -0,0 +1,9 @@
1
+ import { Observable } from 'rxjs';
2
+ import { ReportDataSourceAdapter } from '../contracts/data-source.contract';
3
+ import { ReportDataSourceDefinition } from '../../core/models/report-datasource.model';
4
+ import * as i0 from "@angular/core";
5
+ export declare class MockReportDataSourceAdapter extends ReportDataSourceAdapter {
6
+ execute(dataSource: ReportDataSourceDefinition, parameters: Record<string, unknown>): Observable<unknown[]>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockReportDataSourceAdapter, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockReportDataSourceAdapter>;
9
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared API Contract DTOs for BWays Reporting.
3
+ * These types match the REST contract implemented by the backend and used by HTTP adapters.
4
+ */
5
+ import { ReportDataSourceDefinition } from '../../core/models/report-datasource.model';
6
+ import { ReportDefinition, ReportSummary } from '../../core/models/report-definition.model';
7
+ export interface ExecuteReportRequest {
8
+ /** The data source configuration to execute */
9
+ dataSource: ReportDataSourceDefinition;
10
+ /** Filter/parameter values provided by the runtime form or user */
11
+ parameters: Record<string, unknown>;
12
+ /** Optional session context values (e.g. branchId, companyId, userId) */
13
+ sessionContext?: Record<string, unknown>;
14
+ }
15
+ export type ReportSummaryDto = ReportSummary;
16
+ export interface SaveReportRequestDto {
17
+ id: string;
18
+ name: string;
19
+ description?: string;
20
+ category?: string;
21
+ version: number;
22
+ isPublished?: boolean;
23
+ definition: ReportDefinition;
24
+ }
25
+ export interface LookupQueryRequestDto {
26
+ sourceType: 'table' | 'view' | 'stored_procedure';
27
+ entityName: string;
28
+ valueField: string;
29
+ displayField: string;
30
+ filter?: Record<string, unknown>;
31
+ parameters?: Record<string, unknown>;
32
+ }
33
+ export interface LookupOptionResponseDto {
34
+ value: string | number;
35
+ label: string;
36
+ raw?: Record<string, unknown>;
37
+ }
38
+ export interface SchemaEntityDto {
39
+ name: string;
40
+ schema: string;
41
+ type: 'table' | 'view' | 'stored_procedure';
42
+ friendlyName?: string;
43
+ category?: string;
44
+ description?: string;
45
+ }
46
+ export interface SchemaColumnDto {
47
+ field: string;
48
+ label: string;
49
+ dataType: 'string' | 'number' | 'date' | 'boolean';
50
+ nullable: boolean;
51
+ sqlType?: string;
52
+ }
53
+ export interface SchemaProcedureParamDto {
54
+ name: string;
55
+ friendlyLabel?: string;
56
+ dataType: 'string' | 'number' | 'date' | 'boolean';
57
+ sqlType?: string;
58
+ required?: boolean;
59
+ defaultValue?: unknown;
60
+ description?: string;
61
+ }
62
+ export interface CompanySummaryDto {
63
+ id: string | number;
64
+ name: string;
65
+ uniqueName?: string;
66
+ isDefault?: boolean;
67
+ }
@@ -7,3 +7,4 @@ export { ReportSchemaDiscoveryAdapter } from './schema-discovery.contract';
7
7
  export type { DatabaseEntityType, DatabaseEntityMetadata, EntityColumnMetadata, ProcedureParameterMetadata, } from './schema-discovery.contract';
8
8
  export { ReportLookupAdapter } from './lookup.contract';
9
9
  export type { LookupQueryRequest, LookupOptionItem } from './lookup.contract';
10
+ export * from './api-dtos';
@@ -1,12 +1,28 @@
1
+ import { FormControl, FormGroup } from '@angular/forms';
1
2
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
3
  import { ReportComponentDefinition } from '../../../../core/models/report-component.model';
3
4
  import { getComponentIconName } from '../../utilities/canvas-layout.util';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class DesignCanvasComponent {
6
7
  private readonly designerState;
8
+ private readonly templateService;
9
+ private readonly formBuilder;
10
+ private readonly executionService;
7
11
  readonly definition: import("@angular/core").WritableSignal<import("bways-report").ReportDefinition>;
8
12
  readonly components: import("@angular/core").Signal<ReportComponentDefinition[]>;
9
13
  readonly selectedId: import("@angular/core").WritableSignal<string | null>;
14
+ private readonly _stableCanvasForm;
15
+ readonly canvasForm: import("@angular/core").Signal<FormGroup<any>>;
16
+ getCanvasControl(comp: ReportComponentDefinition): FormControl | null;
17
+ readonly highlightedFieldKeys: import("@angular/core").WritableSignal<Set<string>>;
18
+ readonly layoutJustUpdated: import("@angular/core").WritableSignal<boolean>;
19
+ isFieldHighlighted(comp: ReportComponentDefinition): boolean;
20
+ onControlInteract(comp: ReportComponentDefinition, event: Event): void;
21
+ getGridSummaryText(): string;
22
+ highlightMissingFields(fields: string[]): void;
23
+ readonly canvasGridData: import("@angular/core").WritableSignal<unknown[]>;
24
+ readonly isExecutingGrid: import("@angular/core").WritableSignal<boolean>;
25
+ readonly gridExecError: import("@angular/core").WritableSignal<string | null>;
10
26
  readonly totalColumns: import("@angular/core").Signal<number>;
11
27
  readonly gridTemplateColumns: import("@angular/core").Signal<string>;
12
28
  readonly sortedComponents: import("@angular/core").Signal<ReportComponentDefinition[]>;
@@ -38,7 +54,13 @@ export declare class DesignCanvasComponent {
38
54
  resetDimensions(comp: ReportComponentDefinition, event?: MouseEvent): void;
39
55
  onDrop(event: CdkDragDrop<ReportComponentDefinition[], unknown, unknown>): void;
40
56
  addResultGrid(event?: MouseEvent): void;
57
+ executeCanvasReport(event?: MouseEvent): void;
58
+ onCanvasButtonClick(comp: ReportComponentDefinition, event: MouseEvent): void;
59
+ onCanvasGridStateChange(state: any): void;
60
+ onCanvasColumnDefsChange(defs: any[]): void;
41
61
  removeGrid(event?: MouseEvent): void;
62
+ applyBlueprint(blueprintId: string): void;
63
+ addStarterComponent(type: string): void;
42
64
  static ɵfac: i0.ɵɵFactoryDeclaration<DesignCanvasComponent, never>;
43
65
  static ɵcmp: i0.ɵɵComponentDeclaration<DesignCanvasComponent, "rpt-design-canvas", never, {}, {}, never, never, true, never>;
44
66
  }
@@ -18,7 +18,7 @@ export declare class ParameterBindingEditorComponent {
18
18
  readonly internalMode: import("@angular/core").WritableSignal<ParameterBindingMode | null>;
19
19
  readonly sessionMatch: import("@angular/core").Signal<import("../../../../core/services/report-session-context.service").SessionParamMatch | null>;
20
20
  readonly friendlyLabel: import("@angular/core").Signal<string>;
21
- readonly displayType: import("@angular/core").Signal<"Text" | "Date" | "Number" | "Yes / No">;
21
+ readonly displayType: import("@angular/core").Signal<"Date" | "Text" | "Number" | "Yes / No">;
22
22
  readonly compatibleControls: import("@angular/core").Signal<ReportComponentDefinition[]>;
23
23
  readonly hasValue: import("@angular/core").Signal<boolean>;
24
24
  readonly activeMode: import("@angular/core").Signal<ParameterBindingMode>;
@@ -0,0 +1,33 @@
1
+ import { ReportComponentDefinition } from '../../../../core/models/report-component.model';
2
+ import * as i0 from "@angular/core";
3
+ export interface ActionTypeOption {
4
+ key: string;
5
+ label: string;
6
+ icon: string;
7
+ description: string;
8
+ }
9
+ /**
10
+ * Dedicated property editor for configuring Action Button click behavior.
11
+ * Empowers non-developers to configure actions such as Running Reports, Resetting Filters,
12
+ * Exporting to Excel/PDF, Crystal Report Printing, and Navigation.
13
+ */
14
+ export declare class PropertyEditorActionComponent {
15
+ private readonly designerState;
16
+ private readonly discoveryAdapter;
17
+ readonly comp: import("@angular/core").InputSignal<ReportComponentDefinition>;
18
+ readonly updateProperty: import("@angular/core").OutputEmitterRef<{
19
+ key: string;
20
+ value: unknown;
21
+ }>;
22
+ readonly actionOptions: ActionTypeOption[];
23
+ readonly currentActionType: import("@angular/core").Signal<string>;
24
+ readonly currentActionDescription: import("@angular/core").Signal<string>;
25
+ readonly hasGridOnCanvas: import("@angular/core").Signal<boolean>;
26
+ getActionParam<T>(paramKey: string, defaultValue: T): T;
27
+ onActionTypeChange(newType: string): void;
28
+ setActionParam(paramKey: string, value: unknown): void;
29
+ ensureResultGridForReport(): void;
30
+ private fallbackGridCreation;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<PropertyEditorActionComponent, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorActionComponent, "rpt-property-editor-action", never, { "comp": { "alias": "comp"; "required": true; "isSignal": true; }; }, { "updateProperty": "updateProperty"; }, never, never, true, never>;
33
+ }
@@ -8,6 +8,8 @@ export interface StaticOptionItem {
8
8
  }
9
9
  export declare class PropertyEditorDatasourceComponent implements OnInit {
10
10
  private readonly discoveryAdapter;
11
+ private readonly sessionService;
12
+ private readonly designerState;
11
13
  readonly comp: import("@angular/core").InputSignal<ReportComponentDefinition>;
12
14
  readonly allComponents: import("@angular/core").InputSignal<ReportComponentDefinition[]>;
13
15
  readonly updateDataSource: import("@angular/core").OutputEmitterRef<ComponentDataSourceDefinition>;
@@ -16,6 +18,7 @@ export declare class PropertyEditorDatasourceComponent implements OnInit {
16
18
  value: unknown;
17
19
  }>;
18
20
  readonly isAdvancedMode: import("@angular/core").WritableSignal<boolean>;
21
+ readonly isLoadingEntities: import("@angular/core").WritableSignal<boolean>;
19
22
  readonly allEntities: import("@angular/core").WritableSignal<DatabaseEntityMetadata[]>;
20
23
  readonly entityColumns: import("@angular/core").WritableSignal<EntityColumnMetadata[]>;
21
24
  readonly procedureParameters: import("@angular/core").WritableSignal<ProcedureParameterMetadata[]>;
@@ -48,6 +51,7 @@ export declare class PropertyEditorDatasourceComponent implements OnInit {
48
51
  ngOnInit(): void;
49
52
  loadEntities(): void;
50
53
  loadEntityDetails(entityName: string, type: DropdownSourceType): void;
54
+ autoWireAllParameters(paramsList?: ProcedureParameterMetadata[]): void;
51
55
  setSourceType(type: DropdownSourceType): void;
52
56
  onEntitySelected(entityName: string): void;
53
57
  onValueFieldChanged(valueField: string): void;
@@ -1,10 +1,11 @@
1
- import { GridColumnDefinition, ReportGridDefinition } from '../../../../core/models/report-grid.model';
1
+ import { GridColumnDefinition, GridRowClickAction, ReportGridDefinition } from '../../../../core/models/report-grid.model';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class PropertyEditorGridComponent {
4
4
  readonly grid: import("@angular/core").InputSignal<ReportGridDefinition | undefined>;
5
5
  readonly addGrid: import("@angular/core").OutputEmitterRef<void>;
6
6
  readonly removeGrid: import("@angular/core").OutputEmitterRef<void>;
7
7
  readonly addColumn: import("@angular/core").OutputEmitterRef<void>;
8
+ readonly autoDetectColumns: import("@angular/core").OutputEmitterRef<void>;
8
9
  readonly removeColumn: import("@angular/core").OutputEmitterRef<number>;
9
10
  readonly updateColumn: import("@angular/core").OutputEmitterRef<{
10
11
  index: number;
@@ -15,8 +16,21 @@ export declare class PropertyEditorGridComponent {
15
16
  field: string;
16
17
  value: unknown;
17
18
  }>;
19
+ readonly updateRowClickAction: import("@angular/core").OutputEmitterRef<GridRowClickAction | undefined>;
18
20
  readonly columns: import("@angular/core").Signal<GridColumnDefinition[]>;
21
+ readonly rowClickAction: import("@angular/core").Signal<GridRowClickAction | undefined>;
22
+ readonly hasRowClickAction: import("@angular/core").Signal<boolean>;
23
+ readonly parameterMappings: import("@angular/core").Signal<{
24
+ key: string;
25
+ value: string;
26
+ }[]>;
19
27
  onUpdateCol(index: number, field: string, value: unknown): void;
28
+ toggleRowClickAction(enabled: boolean): void;
29
+ updateRowActionField(field: keyof GridRowClickAction, value: unknown): void;
30
+ addParameterMapping(): void;
31
+ updateMappingKey(index: number, newKey: string): void;
32
+ updateMappingValue(index: number, newValue: string): void;
33
+ removeMapping(index: number): void;
20
34
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertyEditorGridComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorGridComponent, "rpt-property-editor-grid", never, { "grid": { "alias": "grid"; "required": false; "isSignal": true; }; }, { "addGrid": "addGrid"; "removeGrid": "removeGrid"; "addColumn": "addColumn"; "removeColumn": "removeColumn"; "updateColumn": "updateColumn"; "updateOption": "updateOption"; }, never, never, true, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorGridComponent, "rpt-property-editor-grid", never, { "grid": { "alias": "grid"; "required": false; "isSignal": true; }; }, { "addGrid": "addGrid"; "removeGrid": "removeGrid"; "addColumn": "addColumn"; "autoDetectColumns": "autoDetectColumns"; "removeColumn": "removeColumn"; "updateColumn": "updateColumn"; "updateOption": "updateOption"; "updateRowClickAction": "updateRowClickAction"; }, never, never, true, never>;
22
36
  }
@@ -1,6 +1,7 @@
1
1
  import { DesignerActiveTab } from '../../services/designer-state.service';
2
2
  import { PropertyDefinition } from '../../../../core/registry/property-definition.model';
3
3
  import { ComponentLayoutDefinition } from '../../../../core/models/report-layout.model';
4
+ import { GridRowClickAction } from '../../../../core/models/report-grid.model';
4
5
  import { ComponentDataSourceDefinition, ReportComponentDefinition } from '../../../../core/models/report-component.model';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
@@ -12,6 +13,7 @@ import * as i0 from "@angular/core";
12
13
  export declare class PropertyEditorComponent {
13
14
  private readonly designerState;
14
15
  private readonly registry;
16
+ private readonly discoveryAdapter;
15
17
  readonly definition: import("@angular/core").WritableSignal<import("bways-report").ReportDefinition>;
16
18
  readonly activeTab: import("@angular/core").WritableSignal<DesignerActiveTab>;
17
19
  readonly selectedComponent: import("@angular/core").Signal<ReportComponentDefinition | null>;
@@ -35,9 +37,12 @@ export declare class PropertyEditorComponent {
35
37
  removeColumn(index: number): void;
36
38
  updateColumn(index: number, field: string, value: unknown): void;
37
39
  updateGridOption(field: string, value: unknown): void;
40
+ updateGridRowClickAction(action: GridRowClickAction | undefined): void;
41
+ autoDetectGridColumns(): void;
38
42
  readonly expandedSections: import("@angular/core").WritableSignal<Record<string, boolean>>;
39
43
  toggleSection(section: string): void;
40
44
  isSectionExpanded(section: string): boolean;
45
+ getActionBadge(comp: ReportComponentDefinition): string;
41
46
  getDatasourceBadge(comp: ReportComponentDefinition): string;
42
47
  getLayoutBadge(comp: ReportComponentDefinition): string;
43
48
  getValidationBadge(comp: ReportComponentDefinition): string;
@@ -1,17 +1,24 @@
1
1
  import { DesignerViewMode } from '../../services/designer-state.service';
2
+ import { ReportBlueprint } from '../../services/report-template.service';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class DesignerToolbarComponent {
4
5
  private readonly designerState;
6
+ private readonly templateService;
5
7
  readonly definition: import("@angular/core").WritableSignal<import("bways-report").ReportDefinition>;
6
8
  readonly viewMode: import("@angular/core").WritableSignal<DesignerViewMode>;
7
9
  readonly isDirty: import("@angular/core").WritableSignal<boolean>;
8
10
  readonly canUndo: import("@angular/core").Signal<boolean>;
9
11
  readonly canRedo: import("@angular/core").Signal<boolean>;
12
+ readonly isTemplatesModalOpen: import("@angular/core").WritableSignal<boolean>;
13
+ readonly availableBlueprints: ReportBlueprint[];
10
14
  readonly saveRequested: import("@angular/core").OutputEmitterRef<void>;
11
15
  setMode(mode: DesignerViewMode): void;
12
16
  undo(): void;
13
17
  redo(): void;
14
18
  saveReport(): void;
19
+ openTemplatesModal(): void;
20
+ closeTemplatesModal(): void;
21
+ applyBlueprint(blueprintId: string): void;
15
22
  addResultGrid(): void;
16
23
  selectGridSettings(): void;
17
24
  exportJson(): void;
@@ -20,8 +20,13 @@ export declare class DesignerComponent implements OnInit {
20
20
  readonly previewData: import("@angular/core").WritableSignal<unknown[] | null>;
21
21
  readonly saveMessage: import("@angular/core").WritableSignal<string | null>;
22
22
  readonly copyStatus: import("@angular/core").WritableSignal<string>;
23
+ readonly isLeftPanelCollapsed: import("@angular/core").WritableSignal<boolean>;
24
+ readonly isRightPanelCollapsed: import("@angular/core").WritableSignal<boolean>;
25
+ toggleLeftPanel(): void;
26
+ toggleRightPanel(): void;
23
27
  readonly formattedJson: import("@angular/core").Signal<string>;
24
28
  private loadedReportId;
29
+ private loadedReportDef;
25
30
  constructor();
26
31
  ngOnInit(): void;
27
32
  onSave(): void;
@@ -1,7 +1,11 @@
1
1
  export { DesignerComponent } from './designer.component';
2
+ export { RptReportDesignerComponent } from './rpt-report-designer.component';
2
3
  export { DesignerStateService, } from './services';
3
4
  export type { DesignerViewMode, DesignerActiveTab, } from './services';
4
5
  export { ComponentPaletteComponent } from './components/component-palette/component-palette.component';
5
6
  export { DesignCanvasComponent } from './components/design-canvas/design-canvas.component';
6
7
  export { PropertyEditorComponent } from './components/property-editor/property-editor.component';
8
+ export { PropertyEditorActionComponent } from './components/property-editor/property-editor-action.component';
7
9
  export { DesignerToolbarComponent } from './components/toolbar/designer-toolbar.component';
10
+ export { ReportTemplateService } from './services/report-template.service';
11
+ export type { ReportBlueprint } from './services/report-template.service';