bways-report 0.1.2 → 0.1.4

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 (107) 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/component-palette/component-palette.component.mjs +24 -3
  21. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +572 -102
  22. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +593 -0
  23. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +225 -25
  24. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +568 -12
  25. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +238 -11
  26. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +191 -25
  27. package/esm2022/lib/features/designer/designer.component.mjs +245 -27
  28. package/esm2022/lib/features/designer/index.mjs +4 -1
  29. package/esm2022/lib/features/designer/rpt-report-designer.component.mjs +102 -0
  30. package/esm2022/lib/features/designer/services/designer-state.service.mjs +18 -10
  31. package/esm2022/lib/features/designer/services/report-template.service.mjs +318 -0
  32. package/esm2022/lib/features/designer/utilities/canvas-layout.util.mjs +41 -9
  33. package/esm2022/lib/features/export/index.mjs +2 -2
  34. package/esm2022/lib/features/export/models/export.models.mjs +1 -1
  35. package/esm2022/lib/features/export/services/report-export.service.mjs +420 -5
  36. package/esm2022/lib/features/routing/components/routed-report-runtime.component.mjs +2 -2
  37. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +239 -33
  38. package/esm2022/lib/features/runtime/index.mjs +2 -1
  39. package/esm2022/lib/features/runtime/report-execution.service.mjs +56 -0
  40. package/esm2022/lib/features/runtime/report-grid-bridge.component.mjs +423 -30
  41. package/esm2022/lib/features/runtime/report-runtime.component.mjs +349 -7
  42. package/esm2022/lib/features/runtime/rpt-report.component.mjs +545 -0
  43. package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +19 -8
  44. package/esm2022/lib/primitives/components/chart-bridge/report-chart-bridge.component.mjs +18 -7
  45. package/esm2022/lib/primitives/components/checkbox/rpt-checkbox.component.mjs +3 -3
  46. package/esm2022/lib/primitives/components/date/rpt-date.component.mjs +3 -3
  47. package/esm2022/lib/primitives/components/date-range/rpt-date-range.component.mjs +346 -0
  48. package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +728 -74
  49. package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +30 -1
  50. package/esm2022/lib/primitives/components/index.mjs +2 -1
  51. package/esm2022/lib/primitives/components/input/rpt-input.component.mjs +3 -3
  52. package/esm2022/lib/primitives/components/kpi-card/rpt-kpi-card.component.mjs +3 -3
  53. package/esm2022/lib/primitives/components/number/rpt-number.component.mjs +3 -3
  54. package/esm2022/lib/primitives/register-builtins.mjs +51 -2
  55. package/esm2022/lib/provide-reporting.mjs +145 -24
  56. package/fesm2022/bways-report.mjs +7797 -921
  57. package/fesm2022/bways-report.mjs.map +1 -1
  58. package/lib/core/index.d.ts +2 -0
  59. package/lib/core/models/report-datasource.model.d.ts +9 -0
  60. package/lib/core/models/report-definition.model.d.ts +2 -0
  61. package/lib/core/models/report-grid.model.d.ts +67 -1
  62. package/lib/core/services/report-session-context.service.d.ts +6 -1
  63. package/lib/core/utils/data-normalization.util.d.ts +15 -0
  64. package/lib/core/utils/report-parameter.util.d.ts +35 -0
  65. package/lib/data-access/adapters/http-datasource.adapter.d.ts +20 -0
  66. package/lib/data-access/adapters/http-lookup.adapter.d.ts +3 -0
  67. package/lib/data-access/adapters/http-masterdata.adapter.d.ts +13 -0
  68. package/lib/data-access/adapters/http-persistence.adapter.d.ts +27 -0
  69. package/lib/data-access/adapters/http-schema-discovery.adapter.d.ts +2 -0
  70. package/lib/data-access/adapters/index.d.ts +7 -2
  71. package/lib/data-access/adapters/local-storage-persistence.adapter.d.ts +19 -0
  72. package/lib/data-access/adapters/mock-datasource.adapter.d.ts +9 -0
  73. package/lib/data-access/contracts/api-dtos.d.ts +67 -0
  74. package/lib/data-access/contracts/index.d.ts +1 -0
  75. package/lib/features/designer/components/component-palette/component-palette.component.d.ts +2 -1
  76. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +22 -0
  77. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +1 -1
  78. package/lib/features/designer/components/property-editor/property-editor-action.component.d.ts +33 -0
  79. package/lib/features/designer/components/property-editor/property-editor-datasource.component.d.ts +13 -0
  80. package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +16 -2
  81. package/lib/features/designer/components/property-editor/property-editor.component.d.ts +9 -1
  82. package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +12 -1
  83. package/lib/features/designer/designer.component.d.ts +11 -0
  84. package/lib/features/designer/index.d.ts +4 -0
  85. package/lib/features/designer/rpt-report-designer.component.d.ts +38 -0
  86. package/lib/features/designer/services/designer-state.service.d.ts +1 -1
  87. package/lib/features/designer/services/report-template.service.d.ts +32 -0
  88. package/lib/features/designer/utilities/canvas-layout.util.d.ts +4 -0
  89. package/lib/features/export/index.d.ts +2 -2
  90. package/lib/features/export/models/export.models.d.ts +23 -0
  91. package/lib/features/export/services/report-export.service.d.ts +31 -2
  92. package/lib/features/runtime/dynamic-renderer.component.d.ts +42 -2
  93. package/lib/features/runtime/index.d.ts +2 -0
  94. package/lib/features/runtime/report-execution.service.d.ts +16 -0
  95. package/lib/features/runtime/report-grid-bridge.component.d.ts +171 -6
  96. package/lib/features/runtime/report-runtime.component.d.ts +86 -1
  97. package/lib/features/runtime/rpt-report.component.d.ts +69 -0
  98. package/lib/primitives/components/button/rpt-button.component.d.ts +5 -2
  99. package/lib/primitives/components/chart-bridge/report-chart-bridge.component.d.ts +1 -0
  100. package/lib/primitives/components/date-range/rpt-date-range.component.d.ts +43 -0
  101. package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +55 -7
  102. package/lib/primitives/components/index.d.ts +2 -0
  103. package/lib/provide-reporting.d.ts +79 -26
  104. package/package.json +2 -1
  105. package/schematics/collection.json +10 -0
  106. package/schematics/ng-add/index.js +45 -0
  107. 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,12 @@ 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
+ /** Whether to render a selection checkbox in this column's cells. */
81
+ checkboxSelection?: boolean;
82
+ /** Whether to render a select-all checkbox in this column's header. */
83
+ headerCheckboxSelection?: boolean;
84
+ /** Optional cell-specific click action (overrides grid-level rowClickAction for this column). */
85
+ action?: GridRowClickAction;
48
86
  }
49
87
  /**
50
88
  * Grid-level options.
@@ -56,8 +94,14 @@ export interface GridOptionsDefinition {
56
94
  pagination?: boolean;
57
95
  /** Whether row selection is enabled. */
58
96
  selectable?: boolean;
59
- /** Selection mode when selectable is true. */
97
+ /** Selection mode when selectable is true. Defaults to 'multiple'. */
60
98
  selectionMode?: 'single' | 'multiple';
99
+ /** Selection mode alias (compatible with UltraGrid and AG Grid rowSelection). */
100
+ rowSelection?: 'single' | 'multiple';
101
+ /** Whether to render selection checkboxes on rows. Defaults to true when selectable is true. */
102
+ checkboxSelection?: boolean;
103
+ /** Whether to render a select-all checkbox in the header. Defaults to true when multi-row checkbox selection is active. */
104
+ headerCheckboxSelection?: boolean;
61
105
  /** Whether to show row numbers. */
62
106
  showRowNumbers?: boolean;
63
107
  /** Whether to allow column reordering. */
@@ -70,4 +114,26 @@ export interface GridOptionsDefinition {
70
114
  showFooter?: boolean;
71
115
  /** Height of the grid (CSS value). */
72
116
  height?: string;
117
+ /** Active column grouping fields in order (e.g. ['branch', 'customer']). */
118
+ groupModel?: string[];
119
+ /** Active sort model definitions. */
120
+ sortModel?: unknown[];
121
+ /** Complete serialized grid report state (filters, highlights, groups). */
122
+ reportState?: Record<string, unknown>;
123
+ /** View presets / saved custom grid views. */
124
+ presets?: unknown[];
125
+ /**
126
+ * Whether the grid side panel (tool panels for columns, filters, highlights, export, analytics, AI chat) is enabled.
127
+ * Standard BWays-grid / UltraGrid feature. Defaults to `true`.
128
+ */
129
+ sideBar?: boolean | {
130
+ visible?: boolean;
131
+ panel?: ('columns' | 'filters' | 'highlights' | 'export' | 'analytics' | 'chat')[];
132
+ };
133
+ /** Whether the real-time global search bar is enabled. Defaults to `true`. */
134
+ globalSearch?: boolean;
135
+ /** Whether the bottom status bar is enabled. Defaults to `true`. */
136
+ statusBar?: boolean;
137
+ /** Declarative row-click action for master-detail drill-downs. */
138
+ rowClickAction?: GridRowClickAction;
73
139
  }
@@ -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';
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
3
3
  export declare class ComponentPaletteComponent {
4
4
  private readonly registry;
5
5
  private readonly designerState;
6
+ readonly collapseRequested: import("@angular/core").OutputEmitterRef<void>;
6
7
  readonly searchQuery: import("@angular/core").WritableSignal<string>;
7
8
  /** Layout view mode: 'grid' (2-column side-by-side grid) or 'list' (compact row list). Defaults to 'grid'. */
8
9
  readonly layoutMode: import("@angular/core").WritableSignal<"grid" | "list">;
@@ -27,7 +28,7 @@ export declare class ComponentPaletteComponent {
27
28
  onItemDoubleClick(type: string): void;
28
29
  onAddClick(event: MouseEvent, type: string): void;
29
30
  static ɵfac: i0.ɵɵFactoryDeclaration<ComponentPaletteComponent, never>;
30
- static ɵcmp: i0.ɵɵComponentDeclaration<ComponentPaletteComponent, "rpt-component-palette", never, {}, {}, never, never, true, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComponentPaletteComponent, "rpt-component-palette", never, {}, { "collapseRequested": "collapseRequested"; }, never, never, true, never>;
31
32
  }
32
33
  /** Dictionary of synonyms for component types and UI concepts */
33
34
  export declare const COMPONENT_SYNONYMS: Record<string, string[]>;
@@ -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,16 @@ export declare class PropertyEditorDatasourceComponent implements OnInit {
48
51
  ngOnInit(): void;
49
52
  loadEntities(): void;
50
53
  loadEntityDetails(entityName: string, type: DropdownSourceType): void;
54
+ /**
55
+ * Non-destructive linking: binds parameters to session or already-existing canvas fields.
56
+ * Never mutates or adds new components to the canvas.
57
+ */
58
+ autoLinkExistingParameters(paramsList?: ProcedureParameterMetadata[]): void;
59
+ /**
60
+ * Explicit user-initiated action: links existing fields, and creates missing filter inputs on canvas.
61
+ * Restores selection to the current dropdown component so the user stays in this property editor.
62
+ */
63
+ autoWireAllParameters(paramsList?: ProcedureParameterMetadata[]): void;
51
64
  setSourceType(type: DropdownSourceType): void;
52
65
  onEntitySelected(entityName: string): void;
53
66
  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,15 +13,19 @@ 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>;
20
+ readonly collapseRequested: import("@angular/core").OutputEmitterRef<void>;
18
21
  readonly maxColumns: import("@angular/core").Signal<number>;
19
22
  readonly allComponents: import("@angular/core").Signal<ReportComponentDefinition[]>;
20
23
  readonly propertySchema: import("@angular/core").Signal<PropertyDefinition[]>;
21
24
  setTab(tab: DesignerActiveTab): void;
22
25
  updateCompDataSource(id: string, dataSource: ComponentDataSourceDefinition): void;
23
26
  deselect(): void;
27
+ duplicateComponent(id: string): void;
28
+ deleteComponent(id: string): void;
24
29
  updateComp(field: string, value: unknown): void;
25
30
  updateProp(id: string, key: string, value: unknown): void;
26
31
  updateLayout(key: keyof ComponentLayoutDefinition, value: unknown): void;
@@ -35,12 +40,15 @@ export declare class PropertyEditorComponent {
35
40
  removeColumn(index: number): void;
36
41
  updateColumn(index: number, field: string, value: unknown): void;
37
42
  updateGridOption(field: string, value: unknown): void;
43
+ updateGridRowClickAction(action: GridRowClickAction | undefined): void;
44
+ autoDetectGridColumns(): void;
38
45
  readonly expandedSections: import("@angular/core").WritableSignal<Record<string, boolean>>;
39
46
  toggleSection(section: string): void;
40
47
  isSectionExpanded(section: string): boolean;
48
+ getActionBadge(comp: ReportComponentDefinition): string;
41
49
  getDatasourceBadge(comp: ReportComponentDefinition): string;
42
50
  getLayoutBadge(comp: ReportComponentDefinition): string;
43
51
  getValidationBadge(comp: ReportComponentDefinition): string;
44
52
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertyEditorComponent, never>;
45
- static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorComponent, "rpt-property-editor", never, {}, {}, never, never, true, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorComponent, "rpt-property-editor", never, {}, { "collapseRequested": "collapseRequested"; }, never, never, true, never>;
46
54
  }