bways-report 0.1.6 → 0.1.7

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 (98) hide show
  1. package/README.md +293 -464
  2. package/esm2022/lib/core/config/bways-report-config.mjs +83 -0
  3. package/esm2022/lib/core/index.mjs +2 -1
  4. package/esm2022/lib/core/models/report-definition.model.mjs +1 -1
  5. package/esm2022/lib/core/services/report-data-discovery.service.mjs +6 -3
  6. package/esm2022/lib/core/services/report-session-context.service.mjs +11 -7
  7. package/esm2022/lib/core/tokens/reporting-config.token.mjs +1 -1
  8. package/esm2022/lib/core/utils/data-normalization.util.mjs +87 -1
  9. package/esm2022/lib/core/utils/report-parameter.util.mjs +119 -3
  10. package/esm2022/lib/data-access/adapters/endpoint-datasource.adapter.mjs +69 -0
  11. package/esm2022/lib/data-access/adapters/endpoint-lookup.adapter.mjs +98 -0
  12. package/esm2022/lib/data-access/adapters/endpoint-masterdata.adapter.mjs +57 -0
  13. package/esm2022/lib/data-access/adapters/endpoint-persistence.adapter.mjs +85 -0
  14. package/esm2022/lib/data-access/adapters/endpoint-schema-discovery.adapter.mjs +163 -0
  15. package/esm2022/lib/data-access/adapters/endpoint-tokens.mjs +12 -0
  16. package/esm2022/lib/data-access/adapters/http-lookup.adapter.mjs +4 -23
  17. package/esm2022/lib/data-access/adapters/index.mjs +8 -1
  18. package/esm2022/lib/data-access/contracts/lookup.contract.mjs +1 -1
  19. package/esm2022/lib/features/designer/components/component-palette/component-palette.component.mjs +12 -2
  20. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +5 -5
  21. package/esm2022/lib/features/designer/components/dialogs/report-saved-dialog.component.mjs +407 -0
  22. package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +109 -60
  23. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +3 -3
  24. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +110 -20
  25. package/esm2022/lib/features/designer/components/property-editor/property-editor-general.component.mjs +3 -3
  26. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +60 -3
  27. package/esm2022/lib/features/designer/components/property-editor/property-editor-layout.component.mjs +11 -5
  28. package/esm2022/lib/features/designer/components/property-editor/property-editor-report.component.mjs +3 -3
  29. package/esm2022/lib/features/designer/components/property-editor/property-editor-validation.component.mjs +15 -3
  30. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +204 -10
  31. package/esm2022/lib/features/designer/designer.component.mjs +43 -2
  32. package/esm2022/lib/features/designer/services/designer-state.service.mjs +9 -2
  33. package/esm2022/lib/features/embed/bways-report-builder.component.mjs +207 -0
  34. package/esm2022/lib/features/embed/bways-report-menu.component.mjs +433 -0
  35. package/esm2022/lib/features/embed/bways-report-page.component.mjs +204 -0
  36. package/esm2022/lib/features/embed/index.mjs +5 -0
  37. package/esm2022/lib/features/embed/inject-report-menu.mjs +99 -0
  38. package/esm2022/lib/features/index.mjs +2 -1
  39. package/esm2022/lib/features/persistence/services/report-store.service.mjs +43 -5
  40. package/esm2022/lib/features/routing/components/routed-report-runtime.component.mjs +4 -4
  41. package/esm2022/lib/features/routing/index.mjs +2 -2
  42. package/esm2022/lib/features/routing/models/report-route.models.mjs +1 -1
  43. package/esm2022/lib/features/routing/report-routes.mjs +42 -1
  44. package/esm2022/lib/features/routing/resolvers/report.resolver.mjs +6 -8
  45. package/esm2022/lib/features/routing/services/report-menu.service.mjs +14 -4
  46. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +22 -3
  47. package/esm2022/lib/features/runtime/report-grid-bridge.component.mjs +16 -2
  48. package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +28 -5
  49. package/esm2022/lib/primitives/components/dropdown/rpt-dropdown.component.mjs +86 -19
  50. package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +8 -1
  51. package/esm2022/lib/primitives/components/index.mjs +2 -1
  52. package/esm2022/lib/primitives/components/number/rpt-number.component.mjs +9 -3
  53. package/esm2022/lib/primitives/components/searchable-select/rpt-searchable-select.component.mjs +386 -0
  54. package/esm2022/lib/provide-reporting.mjs +137 -7
  55. package/fesm2022/bways-report.mjs +4053 -840
  56. package/fesm2022/bways-report.mjs.map +1 -1
  57. package/lib/core/config/bways-report-config.d.ts +161 -0
  58. package/lib/core/index.d.ts +1 -0
  59. package/lib/core/models/report-definition.model.d.ts +16 -0
  60. package/lib/core/services/report-session-context.service.d.ts +1 -0
  61. package/lib/core/tokens/reporting-config.token.d.ts +16 -0
  62. package/lib/core/utils/data-normalization.util.d.ts +10 -0
  63. package/lib/core/utils/report-parameter.util.d.ts +18 -1
  64. package/lib/data-access/adapters/endpoint-datasource.adapter.d.ts +13 -0
  65. package/lib/data-access/adapters/endpoint-lookup.adapter.d.ts +14 -0
  66. package/lib/data-access/adapters/endpoint-masterdata.adapter.d.ts +11 -0
  67. package/lib/data-access/adapters/endpoint-persistence.adapter.d.ts +15 -0
  68. package/lib/data-access/adapters/endpoint-schema-discovery.adapter.d.ts +21 -0
  69. package/lib/data-access/adapters/endpoint-tokens.d.ts +21 -0
  70. package/lib/data-access/adapters/index.d.ts +7 -0
  71. package/lib/data-access/contracts/lookup.contract.d.ts +2 -2
  72. package/lib/features/designer/components/component-palette/component-palette.component.d.ts +1 -0
  73. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +1 -1
  74. package/lib/features/designer/components/dialogs/report-saved-dialog.component.d.ts +34 -0
  75. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +1 -0
  76. package/lib/features/designer/components/property-editor/property-editor-datasource.component.d.ts +12 -2
  77. package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +10 -0
  78. package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +13 -1
  79. package/lib/features/designer/designer.component.d.ts +4 -0
  80. package/lib/features/embed/bways-report-builder.component.d.ts +48 -0
  81. package/lib/features/embed/bways-report-menu.component.d.ts +40 -0
  82. package/lib/features/embed/bways-report-page.component.d.ts +61 -0
  83. package/lib/features/embed/index.d.ts +4 -0
  84. package/lib/features/embed/inject-report-menu.d.ts +44 -0
  85. package/lib/features/index.d.ts +1 -0
  86. package/lib/features/persistence/services/report-store.service.d.ts +5 -0
  87. package/lib/features/routing/index.d.ts +1 -1
  88. package/lib/features/routing/models/report-route.models.d.ts +3 -0
  89. package/lib/features/routing/report-routes.d.ts +40 -0
  90. package/lib/features/routing/resolvers/report.resolver.d.ts +1 -1
  91. package/lib/features/runtime/dynamic-renderer.component.d.ts +1 -0
  92. package/lib/features/runtime/report-grid-bridge.component.d.ts +1 -1
  93. package/lib/primitives/components/button/rpt-button.component.d.ts +3 -0
  94. package/lib/primitives/components/dropdown/rpt-dropdown.component.d.ts +16 -3
  95. package/lib/primitives/components/index.d.ts +2 -0
  96. package/lib/primitives/components/searchable-select/rpt-searchable-select.component.d.ts +89 -0
  97. package/lib/provide-reporting.d.ts +22 -6
  98. package/package.json +1 -1
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Simplified configuration for bways-report.
3
+ *
4
+ * This is the developer-facing config object that makes integration
5
+ * as simple as 3–4 endpoint URLs + optional overrides.
6
+ * The normalizer converts this into the internal `ReportingConfig`
7
+ * plus adapter wiring decisions.
8
+ */
9
+ import { Type } from '@angular/core';
10
+ import { SessionContextProvider, SessionContextSource } from '../tokens/session-context.token';
11
+ /**
12
+ * Palette component category names the developer can use
13
+ * when restricting the designer component palette.
14
+ *
15
+ * Maps to internal registry category IDs:
16
+ * - `formInputs` → `input`
17
+ * - `actionButtons` → `action`
18
+ * - `displayLabels` → `display`
19
+ * - `dataLookups` → `data`
20
+ * - `layout` → `layout`
21
+ */
22
+ export type PaletteCategory = 'formInputs' | 'actionButtons' | 'displayLabels' | 'dataLookups' | 'layout';
23
+ /**
24
+ * Mapping from friendly palette category names to internal category IDs.
25
+ */
26
+ export declare const PALETTE_CATEGORY_MAP: Record<PaletteCategory, string>;
27
+ /**
28
+ * Simplified, developer-facing configuration for bways-report.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const reportConfig: BwaysReportConfig = {
33
+ * spEndpoint: '/api/reporting/procedures',
34
+ * tablesEndpoint: '/api/reporting/tables',
35
+ * executeEndpoint: '/api/reporting/execute',
36
+ * reportsEndpoint: '/api/reporting/reports',
37
+ * components: ['formInputs', 'actionButtons', 'displayLabels'],
38
+ * autoParameter: true,
39
+ * session: () => inject(AuthService).session(),
40
+ * routeBase: 'reports',
41
+ * };
42
+ * ```
43
+ */
44
+ export interface BwaysReportConfig {
45
+ /**
46
+ * GET endpoint returning the list of stored procedures with their parameters.
47
+ * Response: `[{ name, schema, parameters: [{ name, sqlType, required, defaultValue? }] }]`
48
+ */
49
+ spEndpoint: string;
50
+ /**
51
+ * GET endpoint returning the list of tables/views with their columns.
52
+ * Response: `[{ name, schema, type: 'table'|'view', columns: [{ name, sqlType }] }]`
53
+ */
54
+ tablesEndpoint: string;
55
+ /**
56
+ * POST endpoint that runs a stored procedure or table query and returns rows.
57
+ * Body: `{ kind: 'procedure'|'table', name, schema, parameters, columns?, top? }`
58
+ * Response: `rows[]`
59
+ */
60
+ executeEndpoint: string;
61
+ /**
62
+ * Optional POST endpoint for fetching dropdown master data and lookup options.
63
+ * Defaults to replacing `/execute` with `/lookup` if omitted.
64
+ */
65
+ lookupEndpoint?: string;
66
+ /**
67
+ * Optional CRUD endpoint for saving/loading report page definitions.
68
+ * When omitted, reports are saved to browser localStorage with a console warning.
69
+ * - GET → list saved reports
70
+ * - GET /:id → load a specific report
71
+ * - POST → save a new or updated report
72
+ * - DELETE /:id → delete a report
73
+ */
74
+ reportsEndpoint?: string;
75
+ /**
76
+ * Component palette groups to show in the designer.
77
+ * Defaults to all groups when not specified.
78
+ *
79
+ * @example ['formInputs', 'actionButtons', 'displayLabels']
80
+ */
81
+ components?: PaletteCategory[];
82
+ /**
83
+ * When true, stored procedure parameters like `@BranchId`, `@CompanyId`
84
+ * are automatically bound from the session context.
85
+ * Requires `session` to be provided.
86
+ *
87
+ * @default true
88
+ */
89
+ autoParameter?: boolean;
90
+ /**
91
+ * Session context provider for auto-parameter binding.
92
+ * Can be a service class implementing `SessionContextProvider`,
93
+ * a plain object, a factory function, an Observable, or a Signal.
94
+ *
95
+ * @example
96
+ * session: PlaygroundSessionService
97
+ * session: () => inject(AuthService).session()
98
+ * session: { branchId: 1, companyId: 10 }
99
+ */
100
+ session?: Type<SessionContextProvider> | SessionContextSource | (() => Record<string, unknown>);
101
+ /**
102
+ * Optional service class implementing `SessionContextProvider`.
103
+ * Equivalent to `session: MySessionService`.
104
+ */
105
+ sessionProvider?: Type<SessionContextProvider>;
106
+ /**
107
+ * Base path for live report pages.
108
+ * Generated report pages open at `/<routeBase>/<slug>`.
109
+ *
110
+ * @default 'reports'
111
+ */
112
+ routeBase?: string;
113
+ /**
114
+ * Optional Angular component for rendering data grids.
115
+ * Pass your grid component (BWays-grid, AG Grid wrapper, etc.).
116
+ */
117
+ grid?: Type<unknown>;
118
+ /**
119
+ * Optional Angular component for rendering charts.
120
+ */
121
+ chart?: Type<unknown>;
122
+ /** Default page size for grid results. @default 25 */
123
+ defaultPageSize?: number;
124
+ /** Date format string used across the library. @default 'dd/MM/yyyy' */
125
+ dateFormat?: string;
126
+ /** Timeout in ms for lookup/execute queries. @default 300000 */
127
+ lookupTimeoutMs?: number;
128
+ }
129
+ /**
130
+ * Result of normalizing a `BwaysReportConfig` for internal use.
131
+ */
132
+ export interface NormalizedBwaysConfig {
133
+ /** Endpoint URLs */
134
+ spEndpoint: string;
135
+ tablesEndpoint: string;
136
+ executeEndpoint: string;
137
+ lookupEndpoint: string | null;
138
+ reportsEndpoint: string | null;
139
+ /** Resolved internal category IDs (e.g. ['input', 'action', 'display']) */
140
+ allowedCategories: string[] | null;
141
+ /** Whether auto-parameter binding is enabled */
142
+ autoParameter: boolean;
143
+ /** Route base path */
144
+ routeBase: string;
145
+ /** Session source */
146
+ session: Type<SessionContextProvider> | SessionContextSource | (() => Record<string, unknown>) | null;
147
+ sessionProvider: Type<SessionContextProvider> | null;
148
+ /** Grid component */
149
+ gridComponent: Type<unknown> | null;
150
+ /** Chart component */
151
+ chartComponent: Type<unknown> | null;
152
+ /** General config values */
153
+ defaultPageSize: number;
154
+ dateFormat: string;
155
+ lookupTimeoutMs: number;
156
+ }
157
+ /**
158
+ * Normalizes a `BwaysReportConfig` into the internal format.
159
+ * Validates required fields and maps friendly names to internal IDs.
160
+ */
161
+ export declare function normalizeBwaysConfig(config: BwaysReportConfig): NormalizedBwaysConfig;
@@ -1,3 +1,4 @@
1
+ export * from './config/bways-report-config';
1
2
  export * from './models';
2
3
  export * from './registry';
3
4
  export * from './tokens';
@@ -37,6 +37,14 @@ export interface ReportSummary {
37
37
  description?: string;
38
38
  /** Category or group for organizing reports. */
39
39
  category?: string;
40
+ /** URL-friendly slug for routing. */
41
+ slug?: string;
42
+ /** Menu group for organizing reports in navigation. */
43
+ menuGroup?: string;
44
+ /** Sort order within the menu group. */
45
+ menuOrder?: number;
46
+ /** Optional icon name. */
47
+ icon?: string;
40
48
  /** Current version number. */
41
49
  version: number;
42
50
  /** Whether the report is published (vs. draft). */
@@ -91,6 +99,14 @@ export interface ReportDefinition {
91
99
  grid?: ReportGridDefinition;
92
100
  /** Access control settings. */
93
101
  permissions?: ReportPermissionDefinition;
102
+ /** URL-friendly slug for routing (e.g. 'sale-report'). Auto-generated from name if not set. */
103
+ slug?: string;
104
+ /** Menu group for organizing reports in the sidebar (e.g. 'Sales', 'Finance'). */
105
+ menuGroup?: string;
106
+ /** Sort order within the menu group. Lower numbers appear first. */
107
+ menuOrder?: number;
108
+ /** Optional icon name for menu display. */
109
+ icon?: string;
94
110
  /** Custom metadata for host-specific extensions. */
95
111
  metadata?: Record<string, unknown>;
96
112
  /** ISO date of creation. */
@@ -27,6 +27,7 @@ export interface DerivedParametersResult {
27
27
  export declare class ReportSessionContextService implements OnDestroy {
28
28
  private readonly rawSource;
29
29
  private readonly sessionProvider;
30
+ private readonly reportingConfig;
30
31
  /** Internal manual runtime session overrides (e.g. set via setSessionContext or setSessionParameter) */
31
32
  private readonly manualRuntimeContext;
32
33
  private readonly latestObservableValue;
@@ -23,6 +23,22 @@ export interface ReportingConfig {
23
23
  enableSchemaDiscovery?: boolean;
24
24
  /** Optional timeout in milliseconds for dropdown lookup queries (defaults to 300000ms / 5 minutes). */
25
25
  lookupTimeoutMs?: number;
26
+ /**
27
+ * Internal category IDs to show in the designer palette.
28
+ * When null/undefined, all categories are shown.
29
+ * Set by the BwaysReportConfig normalizer from friendly names.
30
+ */
31
+ allowedCategories?: string[] | null;
32
+ /**
33
+ * Whether to auto-bind SP parameters from the session context.
34
+ * @default true
35
+ */
36
+ autoParameter?: boolean;
37
+ /**
38
+ * Base route path for live report pages.
39
+ * @default 'reports'
40
+ */
41
+ routeBase?: string;
26
42
  }
27
43
  /**
28
44
  * Injection token for the grid component.
@@ -13,3 +13,13 @@ export declare function extractRowArray<T = unknown>(response: unknown): T[];
13
13
  * Searches for exact match first, then lower-cased match, then normalized (ignoring underscores/dashes).
14
14
  */
15
15
  export declare function getFieldCaseInsensitive(record: Record<string, unknown> | null | undefined, targetKey: string): unknown;
16
+ export interface NormalizedLookupOption {
17
+ value: string | number;
18
+ label: string;
19
+ raw?: Record<string, unknown>;
20
+ }
21
+ /**
22
+ * Normalizes an arbitrary database record into a standardized { value, label, raw } option item.
23
+ * Supports case-insensitive field matching and intelligent heuristics for SQL Server columns.
24
+ */
25
+ export declare function extractLookupOptionItem(row: unknown, valueField?: string, displayField?: string): NormalizedLookupOption;
@@ -8,13 +8,30 @@ export declare function resolveContextPreset(key: string): string;
8
8
  * and compound date ranges (e.g. dateRange.from, dateRange_from, dateRangeFrom).
9
9
  */
10
10
  export declare function resolveCanvasFieldValue(formValues: Record<string, unknown>, inner: string): unknown;
11
+ /**
12
+ * Sanitizes T-SQL parameter literals copied from SSMS, profilers, or SQL scripts:
13
+ * - Strips outer double quotes: "..."
14
+ * - Strips outer T-SQL quotes: N'...' or '...'
15
+ * - Unescapes doubled single quotes: '' -> '
16
+ */
17
+ export declare function sanitizeSqlParamLiteral(val: unknown): unknown;
18
+ export interface ParsedSqlExec {
19
+ procedureName?: string;
20
+ parameters: Record<string, string | number | boolean>;
21
+ }
22
+ /**
23
+ * Parses an SSMS / T-SQL EXEC statement such as:
24
+ * exec Get_HelpList @chrCOMPANYID=N'101',@chrTableName=N'MSTACCTGLSUB',@intExecFlag=1
25
+ * Extracts procedure name and unescapes parameter values.
26
+ */
27
+ export declare function parseSqlExecStatement(sql: string): ParsedSqlExec | null;
11
28
  /**
12
29
  * Resolves one raw mapping value against session + canvas form values.
13
30
  * - `{{session.branchId}}` -> session value (case-insensitive)
14
31
  * - `{{context.today}}` -> computed date
15
32
  * - `{{fromDate}}` -> value of canvas field with key `fromDate` (case-insensitive)
16
33
  * - `{{dateRange.from}}` -> value of nested from property
17
- * - anything else -> returned unchanged (fixed value)
34
+ * - anything else -> sanitized literal value (fixed value)
18
35
  */
19
36
  export declare function resolveParameterValue(raw: unknown, session: Record<string, unknown>, formValues: Record<string, unknown>): unknown;
20
37
  /** Resolves every mapping into concrete values (de-duplicating `@name` / `name`). */
@@ -0,0 +1,13 @@
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 EndpointDataSourceAdapter extends ReportDataSourceAdapter {
6
+ private readonly http;
7
+ private readonly endpoints;
8
+ private readonly sessionService;
9
+ execute(dataSource: ReportDataSourceDefinition, parameters: Record<string, unknown>): Observable<unknown[]>;
10
+ private resolveKind;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<EndpointDataSourceAdapter, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<EndpointDataSourceAdapter>;
13
+ }
@@ -0,0 +1,14 @@
1
+ import { Observable } from 'rxjs';
2
+ import { LookupOptionItem, LookupQueryRequest, ReportLookupAdapter } from '../contracts/lookup.contract';
3
+ import * as i0 from "@angular/core";
4
+ export declare class EndpointLookupAdapter extends ReportLookupAdapter {
5
+ private readonly http;
6
+ private readonly endpoints;
7
+ private readonly sessionService;
8
+ private readonly cache;
9
+ private readonly inFlight;
10
+ fetchOptions(request: LookupQueryRequest): Observable<LookupOptionItem[]>;
11
+ private generateCacheKey;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<EndpointLookupAdapter, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<EndpointLookupAdapter>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { Observable } from 'rxjs';
2
+ import { MasterDataItem, MasterDataOptions, MasterDataProvider } from '../contracts/master-data.provider';
3
+ import * as i0 from "@angular/core";
4
+ export declare class EndpointMasterDataAdapter extends MasterDataProvider {
5
+ private readonly http;
6
+ private readonly endpoints;
7
+ private readonly sessionService;
8
+ getMasterData(masterName: string, options?: MasterDataOptions): Observable<MasterDataItem[]>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<EndpointMasterDataAdapter, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<EndpointMasterDataAdapter>;
11
+ }
@@ -0,0 +1,15 @@
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
+ export declare class EndpointPersistenceAdapter extends ReportPersistenceAdapter {
6
+ private readonly http;
7
+ private readonly endpoints;
8
+ load(reportId: string): Observable<ReportDefinition>;
9
+ save(report: ReportDefinition): Observable<ReportDefinition>;
10
+ list(): Observable<ReportSummary[]>;
11
+ delete(reportId: string): Observable<void>;
12
+ publish(reportId: string, version: number): Observable<void>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<EndpointPersistenceAdapter, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<EndpointPersistenceAdapter>;
15
+ }
@@ -0,0 +1,21 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DatabaseEntityMetadata, DatabaseEntityType, EntityColumnMetadata, ProcedureParameterMetadata, ReportSchemaDiscoveryAdapter } from '../contracts/schema-discovery.contract';
3
+ import * as i0 from "@angular/core";
4
+ export declare class EndpointSchemaDiscoveryAdapter extends ReportSchemaDiscoveryAdapter {
5
+ private readonly http;
6
+ private readonly endpoints;
7
+ /** Cached list responses so we don't re-fetch on every getColumns/getParameters call */
8
+ private spCache$;
9
+ private tableCache$;
10
+ private spItems;
11
+ private tableItems;
12
+ getEntities(types?: DatabaseEntityType[]): Observable<DatabaseEntityMetadata[]>;
13
+ getColumns(entityName: string, schema?: string, type?: DatabaseEntityType): Observable<EntityColumnMetadata[]>;
14
+ getParameters(entityName: string, schema?: string): Observable<ProcedureParameterMetadata[]>;
15
+ /** Fetch and cache the SP list from the endpoint */
16
+ private fetchSps;
17
+ /** Fetch and cache the tables list from the endpoint */
18
+ private fetchTables;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<EndpointSchemaDiscoveryAdapter, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<EndpointSchemaDiscoveryAdapter>;
21
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Injection tokens for the endpoint-based adapter configuration.
3
+ *
4
+ * When the developer uses `BwaysReportConfig` (simple config), these tokens
5
+ * are populated with the endpoint URLs so adapters can inject them.
6
+ */
7
+ import { InjectionToken } from '@angular/core';
8
+ /**
9
+ * Endpoint URLs used by the endpoint-based adapters.
10
+ */
11
+ export interface BwaysReportEndpoints {
12
+ spEndpoint: string;
13
+ tablesEndpoint: string;
14
+ executeEndpoint: string;
15
+ lookupEndpoint?: string | null;
16
+ reportsEndpoint: string | null;
17
+ }
18
+ /**
19
+ * Injection token for the endpoint URLs.
20
+ */
21
+ export declare const BWAYS_REPORT_ENDPOINTS: InjectionToken<BwaysReportEndpoints>;
@@ -5,3 +5,10 @@ export { HttpReportPersistenceAdapter, HttpPersistenceAdapter, } from './http-pe
5
5
  export { HttpMasterDataAdapter, } from './http-masterdata.adapter';
6
6
  export { LocalStorageReportPersistenceAdapter, } from './local-storage-persistence.adapter';
7
7
  export { MockReportDataSourceAdapter, } from './mock-datasource.adapter';
8
+ export { EndpointSchemaDiscoveryAdapter } from './endpoint-schema-discovery.adapter';
9
+ export { EndpointDataSourceAdapter } from './endpoint-datasource.adapter';
10
+ export { EndpointLookupAdapter } from './endpoint-lookup.adapter';
11
+ export { EndpointPersistenceAdapter } from './endpoint-persistence.adapter';
12
+ export { EndpointMasterDataAdapter } from './endpoint-masterdata.adapter';
13
+ export { BWAYS_REPORT_ENDPOINTS } from './endpoint-tokens';
14
+ export type { BwaysReportEndpoints } from './endpoint-tokens';
@@ -7,8 +7,8 @@ export interface LookupQueryRequest {
7
7
  sourceType: DropdownSourceType;
8
8
  entityName?: string;
9
9
  schema?: string;
10
- valueField: string;
11
- displayField: string;
10
+ valueField?: string;
11
+ displayField?: string;
12
12
  filter?: Record<string, unknown>;
13
13
  parameters?: Record<string, unknown>;
14
14
  limit?: number;
@@ -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
+ private readonly reportingConfig;
6
7
  readonly collapseRequested: import("@angular/core").OutputEmitterRef<void>;
7
8
  readonly searchQuery: import("@angular/core").WritableSignal<string>;
8
9
  /** Layout view mode: 'grid' (2-column side-by-side grid) or 'list' (compact row list). Defaults to 'grid'. */
@@ -20,7 +20,7 @@ export declare class DesignCanvasComponent implements OnDestroy {
20
20
  readonly highlightedFieldKeys: import("@angular/core").WritableSignal<Set<string>>;
21
21
  readonly layoutJustUpdated: import("@angular/core").WritableSignal<boolean>;
22
22
  isFieldHighlighted(comp: ReportComponentDefinition): boolean;
23
- onControlInteract(comp: ReportComponentDefinition, event: Event): void;
23
+ onControlInteract(comp: ReportComponentDefinition, event?: Event): void;
24
24
  getGridSummaryText(): string;
25
25
  highlightMissingFields(fields: string[]): void;
26
26
  readonly canvasGridData: import("@angular/core").WritableSignal<unknown[]>;
@@ -0,0 +1,34 @@
1
+ import { ReportDefinition } from '../../../../core/models/report-definition.model';
2
+ import * as i0 from "@angular/core";
3
+ export interface ReportSavedDialogData {
4
+ report: ReportDefinition;
5
+ routeBase?: string;
6
+ }
7
+ export interface ReportSavedDialogResult {
8
+ action: 'back_to_designer' | 'open_live_page';
9
+ report: ReportDefinition;
10
+ }
11
+ export declare class ReportSavedDialogComponent {
12
+ private readonly dialogRef;
13
+ private readonly data;
14
+ private readonly store;
15
+ private readonly reportingConfig;
16
+ private readonly router;
17
+ readonly report: ReportDefinition;
18
+ readonly baseRoute: import("@angular/core").WritableSignal<string>;
19
+ readonly name: import("@angular/core").WritableSignal<string>;
20
+ readonly slug: import("@angular/core").WritableSignal<string>;
21
+ readonly menuGroup: import("@angular/core").WritableSignal<string>;
22
+ readonly isPublished: import("@angular/core").WritableSignal<boolean>;
23
+ readonly copied: import("@angular/core").WritableSignal<boolean>;
24
+ readonly savedStateMessage: import("@angular/core").WritableSignal<string | null>;
25
+ readonly fullRoute: import("@angular/core").Signal<string>;
26
+ readonly currentPreviewDef: import("@angular/core").Signal<ReportDefinition>;
27
+ onNameChange(newName: string): void;
28
+ copyRoute(): void;
29
+ saveUpdatedDefinition(): ReportDefinition;
30
+ close(action?: 'back_to_designer' | 'open_live_page'): void;
31
+ openLivePage(): void;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReportSavedDialogComponent, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<ReportSavedDialogComponent, "rpt-report-saved-dialog", never, {}, {}, never, never, true, never>;
34
+ }
@@ -31,6 +31,7 @@ export declare class ParameterBindingEditorComponent {
31
31
  readonly selectedControlKey: import("@angular/core").Signal<string>;
32
32
  readonly selectedContextKey: import("@angular/core").Signal<string>;
33
33
  readonly booleanFixedValue: import("@angular/core").Signal<boolean>;
34
+ readonly isLongTextInput: import("@angular/core").Signal<boolean>;
34
35
  setMode(mode: ParameterBindingMode): void;
35
36
  onControlSelected(key: string): void;
36
37
  onBooleanChanged(checked: boolean): void;
@@ -1,15 +1,19 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { ComponentDataSourceDefinition, DropdownSourceType, ReportComponentDefinition } from '../../../../core/models/report-component.model';
3
3
  import { DatabaseEntityMetadata, EntityColumnMetadata, ProcedureParameterMetadata } from '../../../../data-access/contracts/schema-discovery.contract';
4
+ import { SearchableSelectOption } from '../../../../primitives/components';
4
5
  import * as i0 from "@angular/core";
5
6
  export interface StaticOptionItem {
6
7
  key: string;
7
8
  label: string;
8
9
  }
9
- export declare class PropertyEditorDatasourceComponent implements OnInit {
10
+ export declare class PropertyEditorDatasourceComponent implements OnInit, OnDestroy {
10
11
  private readonly discoveryAdapter;
11
12
  private readonly sessionService;
12
13
  private readonly designerState;
14
+ private lastLoadedKey;
15
+ private columnsSub?;
16
+ private paramsSub?;
13
17
  readonly comp: import("@angular/core").InputSignal<ReportComponentDefinition>;
14
18
  readonly allComponents: import("@angular/core").InputSignal<ReportComponentDefinition[]>;
15
19
  readonly updateDataSource: import("@angular/core").OutputEmitterRef<ComponentDataSourceDefinition>;
@@ -47,8 +51,14 @@ export declare class PropertyEditorDatasourceComponent implements OnInit {
47
51
  }[]>;
48
52
  readonly availableParentFields: import("@angular/core").Signal<ReportComponentDefinition[]>;
49
53
  readonly staticOptions: import("@angular/core").Signal<StaticOptionItem[]>;
54
+ readonly procedureSelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
55
+ readonly tableSelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
56
+ readonly displayFieldSelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
57
+ readonly valueFieldSelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
58
+ readonly parentFieldSelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
50
59
  constructor();
51
60
  ngOnInit(): void;
61
+ ngOnDestroy(): void;
52
62
  loadEntities(): void;
53
63
  loadEntityDetails(entityName: string, type: DropdownSourceType): void;
54
64
  /**
@@ -2,6 +2,7 @@ import { GridColumnDefinition, GridRowClickAction, ReportGridDefinition } from '
2
2
  import { ReportDataSourceDefinition } from '../../../../core/models/report-datasource.model';
3
3
  import { ReportComponentDefinition } from '../../../../core/models/report-component.model';
4
4
  import { DatabaseEntityMetadata, ProcedureParameterMetadata } from '../../../../data-access/contracts/schema-discovery.contract';
5
+ import { SearchableSelectOption } from '../../../../primitives/components';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class PropertyEditorGridComponent {
7
8
  private readonly dataDiscovery;
@@ -37,12 +38,21 @@ export declare class PropertyEditorGridComponent {
37
38
  readonly internalParameters: import("@angular/core").WritableSignal<ProcedureParameterMetadata[]>;
38
39
  readonly effectiveParameters: import("@angular/core").Signal<ProcedureParameterMetadata[]>;
39
40
  readonly selectedSourceType: import("@angular/core").WritableSignal<"table" | "stored_procedure">;
41
+ readonly isExecSnippetOpen: import("@angular/core").WritableSignal<boolean>;
42
+ readonly execSnippetText: import("@angular/core").WritableSignal<string>;
43
+ readonly execParseStatus: import("@angular/core").WritableSignal<{
44
+ message: string;
45
+ kind: "success" | "error";
46
+ } | null>;
47
+ toggleExecSnippet(): void;
48
+ applyExecSnippet(): void;
40
49
  constructor();
41
50
  readonly currentSourceType: import("@angular/core").Signal<"table" | "stored_procedure">;
42
51
  readonly activeEntityName: import("@angular/core").Signal<string>;
43
52
  readonly availableTables: import("@angular/core").Signal<DatabaseEntityMetadata[]>;
44
53
  readonly availableProcedures: import("@angular/core").Signal<DatabaseEntityMetadata[]>;
45
54
  readonly activeEntityList: import("@angular/core").Signal<DatabaseEntityMetadata[]>;
55
+ readonly gridEntitySelectOptions: import("@angular/core").Signal<SearchableSelectOption<any>[]>;
46
56
  readonly columns: import("@angular/core").Signal<GridColumnDefinition[]>;
47
57
  readonly rowClickAction: import("@angular/core").Signal<GridRowClickAction | undefined>;
48
58
  readonly hasRowClickAction: import("@angular/core").Signal<boolean>;
@@ -1,21 +1,33 @@
1
1
  import { DesignerViewMode } from '../../services/designer-state.service';
2
2
  import { ReportBlueprint } from '../../services/report-template.service';
3
+ import { ReportDefinition } from '../../../../core/models/report-definition.model';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DesignerToolbarComponent {
5
6
  private readonly designerState;
6
7
  private readonly templateService;
7
- readonly definition: import("@angular/core").WritableSignal<import("bways-report").ReportDefinition>;
8
+ private readonly reportStore;
9
+ readonly definition: import("@angular/core").WritableSignal<ReportDefinition>;
8
10
  readonly viewMode: import("@angular/core").WritableSignal<DesignerViewMode>;
9
11
  readonly isDirty: import("@angular/core").WritableSignal<boolean>;
10
12
  readonly canUndo: import("@angular/core").Signal<boolean>;
11
13
  readonly canRedo: import("@angular/core").Signal<boolean>;
12
14
  readonly isTemplatesModalOpen: import("@angular/core").WritableSignal<boolean>;
13
15
  readonly availableBlueprints: ReportBlueprint[];
16
+ readonly isEditingName: import("@angular/core").WritableSignal<boolean>;
17
+ readonly nameDraft: import("@angular/core").WritableSignal<string>;
18
+ readonly reportSummaries: import("@angular/core").Signal<import("../../../../core/models/report-definition.model").ReportSummary[]>;
14
19
  readonly isLeftPanelCollapsed: import("@angular/core").InputSignal<boolean>;
15
20
  readonly isRightPanelCollapsed: import("@angular/core").InputSignal<boolean>;
16
21
  readonly toggleLeftPanel: import("@angular/core").OutputEmitterRef<void>;
17
22
  readonly toggleRightPanel: import("@angular/core").OutputEmitterRef<void>;
18
23
  readonly saveRequested: import("@angular/core").OutputEmitterRef<void>;
24
+ constructor();
25
+ startRename(): void;
26
+ saveRename(): void;
27
+ cancelRename(): void;
28
+ createNewReport(): void;
29
+ onSwitchReport(reportId: string): void;
30
+ private toSlug;
19
31
  setMode(mode: DesignerViewMode): void;
20
32
  undo(): void;
21
33
  redo(): void;
@@ -7,6 +7,9 @@ export declare class DesignerComponent implements OnInit {
7
7
  private readonly persistenceAdapter;
8
8
  private readonly dataSourceAdapter;
9
9
  private readonly sessionService;
10
+ private readonly dialog;
11
+ private readonly router;
12
+ private readonly reportingConfig;
10
13
  /** Optional reportId to load from persistence adapter */
11
14
  readonly reportId: import("@angular/core").InputSignal<string | undefined>;
12
15
  /** Optional definition to load directly */
@@ -36,6 +39,7 @@ export declare class DesignerComponent implements OnInit {
36
39
  constructor();
37
40
  ngOnInit(): void;
38
41
  onSave(): void;
42
+ private openSavedDialog;
39
43
  onPreviewExecute(event: {
40
44
  definition: ReportDefinition;
41
45
  parameters: Record<string, unknown>;
@@ -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
+ }