bways-report 0.2.9 → 0.2.11

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 (117) hide show
  1. package/esm2022/lib/core/formula/format.mjs +65 -0
  2. package/esm2022/lib/core/formula/formula-columns.mjs +70 -0
  3. package/esm2022/lib/core/formula/formula-engine.mjs +271 -0
  4. package/esm2022/lib/core/formula/formula.types.mjs +24 -0
  5. package/esm2022/lib/core/formula/functions.mjs +122 -0
  6. package/esm2022/lib/core/formula/index.mjs +7 -0
  7. package/esm2022/lib/core/formula/interpreter.mjs +383 -0
  8. package/esm2022/lib/core/formula/lexer.mjs +92 -0
  9. package/esm2022/lib/core/formula/parser.mjs +323 -0
  10. package/esm2022/lib/core/formula/summary-index.mjs +85 -0
  11. package/esm2022/lib/core/formula/variable-store.mjs +55 -0
  12. package/esm2022/lib/core/index.mjs +2 -1
  13. package/esm2022/lib/core/models/index.mjs +3 -1
  14. package/esm2022/lib/core/models/report-component.model.mjs +1 -1
  15. package/esm2022/lib/core/models/report-datasource.model.mjs +1 -1
  16. package/esm2022/lib/core/models/report-definition.model.mjs +1 -1
  17. package/esm2022/lib/core/models/report-formula.model.mjs +2 -0
  18. package/esm2022/lib/core/models/report-grid.model.mjs +1 -1
  19. package/esm2022/lib/core/models/report-parameter.model.mjs +1 -1
  20. package/esm2022/lib/core/models/report-workflow.model.mjs +2 -0
  21. package/esm2022/lib/core/models/selection-workflow.model.mjs +2 -0
  22. package/esm2022/lib/core/services/dynamic-form-builder.service.mjs +48 -2
  23. package/esm2022/lib/core/utilities/schema-migration.mjs +6 -5
  24. package/esm2022/lib/core/utils/report-form-values.util.mjs +54 -4
  25. package/esm2022/lib/core/utils/report-parameter.util.mjs +4 -4
  26. package/esm2022/lib/core/utils/report-values.util.mjs +137 -0
  27. package/esm2022/lib/core/utils/report-workflow.util.mjs +128 -0
  28. package/esm2022/lib/core/utils/selection-workflow.util.mjs +187 -0
  29. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +96 -25
  30. package/esm2022/lib/features/designer/components/dialogs/report-import-dialog.component.mjs +333 -0
  31. package/esm2022/lib/features/designer/components/dialogs/report-workflow-dialog.component.mjs +162 -0
  32. package/esm2022/lib/features/designer/components/property-editor/formula-editor.component.mjs +538 -0
  33. package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +104 -25
  34. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +3 -3
  35. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +3 -3
  36. package/esm2022/lib/features/designer/components/property-editor/property-editor-general.component.mjs +4 -4
  37. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +8 -3
  38. package/esm2022/lib/features/designer/components/property-editor/property-editor-layout.component.mjs +3 -3
  39. package/esm2022/lib/features/designer/components/property-editor/property-editor-report.component.mjs +3 -3
  40. package/esm2022/lib/features/designer/components/property-editor/property-editor-validation.component.mjs +3 -3
  41. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +40 -4
  42. package/esm2022/lib/features/designer/components/property-editor/selection-workflow-editor.component.mjs +635 -0
  43. package/esm2022/lib/features/designer/components/property-editor/workflow-source-editor.component.mjs +199 -0
  44. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +88 -25
  45. package/esm2022/lib/features/designer/designer.component.mjs +78 -8
  46. package/esm2022/lib/features/designer/services/designer-endpoints.service.mjs +2 -2
  47. package/esm2022/lib/features/designer/services/designer-fullscreen.service.mjs +91 -0
  48. package/esm2022/lib/features/designer/services/report-template.service.mjs +4 -1
  49. package/esm2022/lib/features/designer/utilities/merge-imported-report.mjs +68 -0
  50. package/esm2022/lib/features/import/crystal-export.model.mjs +10 -0
  51. package/esm2022/lib/features/import/crystal-export.parser.mjs +275 -0
  52. package/esm2022/lib/features/import/crystal-import.mjs +486 -0
  53. package/esm2022/lib/features/import/index.mjs +4 -0
  54. package/esm2022/lib/features/index.mjs +2 -1
  55. package/esm2022/lib/features/persistence/services/schema-validator.service.mjs +22 -3
  56. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +72 -46
  57. package/esm2022/lib/features/runtime/report-execution.service.mjs +93 -12
  58. package/esm2022/lib/features/runtime/report-runtime.component.mjs +20 -4
  59. package/esm2022/lib/features/runtime/selection-workflow-panel.component.mjs +120 -0
  60. package/esm2022/lib/features/runtime/selection-workflow.service.mjs +539 -0
  61. package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +3 -1
  62. package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +10 -1
  63. package/fesm2022/bways-report.mjs +14386 -8540
  64. package/fesm2022/bways-report.mjs.map +1 -1
  65. package/lib/core/formula/format.d.ts +7 -0
  66. package/lib/core/formula/formula-columns.d.ts +16 -0
  67. package/lib/core/formula/formula-engine.d.ts +83 -0
  68. package/lib/core/formula/formula.types.d.ts +94 -0
  69. package/lib/core/formula/functions.d.ts +21 -0
  70. package/lib/core/formula/index.d.ts +6 -0
  71. package/lib/core/formula/interpreter.d.ts +28 -0
  72. package/lib/core/formula/lexer.d.ts +9 -0
  73. package/lib/core/formula/parser.d.ts +3 -0
  74. package/lib/core/formula/summary-index.d.ts +12 -0
  75. package/lib/core/formula/variable-store.d.ts +12 -0
  76. package/lib/core/index.d.ts +1 -0
  77. package/lib/core/models/index.d.ts +3 -0
  78. package/lib/core/models/report-component.model.d.ts +4 -0
  79. package/lib/core/models/report-datasource.model.d.ts +2 -0
  80. package/lib/core/models/report-definition.model.d.ts +11 -0
  81. package/lib/core/models/report-formula.model.d.ts +16 -0
  82. package/lib/core/models/report-grid.model.d.ts +11 -1
  83. package/lib/core/models/report-parameter.model.d.ts +7 -0
  84. package/lib/core/models/report-workflow.model.d.ts +16 -0
  85. package/lib/core/models/selection-workflow.model.d.ts +31 -0
  86. package/lib/core/services/dynamic-form-builder.service.d.ts +4 -0
  87. package/lib/core/utilities/schema-migration.d.ts +1 -1
  88. package/lib/core/utils/report-form-values.util.d.ts +6 -1
  89. package/lib/core/utils/report-values.util.d.ts +7 -0
  90. package/lib/core/utils/report-workflow.util.d.ts +8 -0
  91. package/lib/core/utils/selection-workflow.util.d.ts +12 -0
  92. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +11 -0
  93. package/lib/features/designer/components/dialogs/report-import-dialog.component.d.ts +36 -0
  94. package/lib/features/designer/components/dialogs/report-workflow-dialog.component.d.ts +63 -0
  95. package/lib/features/designer/components/property-editor/formula-editor.component.d.ts +80 -0
  96. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +31 -1
  97. package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +7 -1
  98. package/lib/features/designer/components/property-editor/property-editor.component.d.ts +17 -3
  99. package/lib/features/designer/components/property-editor/selection-workflow-editor.component.d.ts +102 -0
  100. package/lib/features/designer/components/property-editor/workflow-source-editor.component.d.ts +42 -0
  101. package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +10 -1
  102. package/lib/features/designer/designer.component.d.ts +10 -0
  103. package/lib/features/designer/services/designer-fullscreen.service.d.ts +20 -0
  104. package/lib/features/designer/utilities/merge-imported-report.d.ts +3 -0
  105. package/lib/features/import/crystal-export.model.d.ts +139 -0
  106. package/lib/features/import/crystal-export.parser.d.ts +17 -0
  107. package/lib/features/import/crystal-import.d.ts +21 -0
  108. package/lib/features/import/index.d.ts +3 -0
  109. package/lib/features/index.d.ts +1 -0
  110. package/lib/features/runtime/dynamic-renderer.component.d.ts +10 -1
  111. package/lib/features/runtime/report-execution.service.d.ts +9 -0
  112. package/lib/features/runtime/report-grid-bridge.component.d.ts +3 -0
  113. package/lib/features/runtime/report-runtime.component.d.ts +5 -0
  114. package/lib/features/runtime/selection-workflow-panel.component.d.ts +16 -0
  115. package/lib/features/runtime/selection-workflow.service.d.ts +113 -0
  116. package/lib/primitives/components/button/rpt-button.component.d.ts +1 -1
  117. package/package.json +1 -1
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Interchange format `bways-crystal-export` version 1.
3
+ *
4
+ * A one-time exporter reads a Crystal `.rpt` and writes this JSON; the importer turns it into a
5
+ * `ReportDefinition`. The exporter only reports facts from the report and does no interpretation.
6
+ * The matching JSON Schema is `docs/examples/crystal-export.v1.schema.json`.
7
+ */
8
+ export declare const CRYSTAL_EXPORT_FORMAT = "bways-crystal-export";
9
+ export declare const CRYSTAL_EXPORT_VERSION = 1;
10
+ export type ImportSeverity = 'error' | 'warning' | 'info';
11
+ /** One thing the author should know about an import. Nothing is dropped without one. */
12
+ export interface ImportIssue {
13
+ severity: ImportSeverity;
14
+ /** Stable machine-readable code, for example `formula-skipped`. */
15
+ code: string;
16
+ message: string;
17
+ /** Where in the report it applies, for example `formula:forHeatDate`. */
18
+ where?: string;
19
+ }
20
+ export type CrystalDataType = 'string' | 'number' | 'date' | 'datetime' | 'boolean' | 'currency';
21
+ export type CrystalScalar = string | number | boolean;
22
+ export interface CrystalExportField {
23
+ name: string;
24
+ dataType?: CrystalDataType;
25
+ }
26
+ export interface CrystalExportSpParameter {
27
+ name: string;
28
+ dataType?: CrystalDataType;
29
+ /** A fixed value the report supplies for this stored procedure parameter. */
30
+ value?: CrystalScalar;
31
+ /** Name of the report prompt parameter that feeds this stored procedure parameter. */
32
+ mappedTo?: string;
33
+ }
34
+ export interface CrystalExportDataSource {
35
+ /** Name Crystal uses in field references, for example `Sel_RptBHNRegisterGradeWise;1`. */
36
+ alias: string;
37
+ kind: 'storedProcedure' | 'table' | 'view' | 'command';
38
+ name: string;
39
+ schema?: string;
40
+ parameters: CrystalExportSpParameter[];
41
+ fields: CrystalExportField[];
42
+ }
43
+ export interface CrystalExportParameter {
44
+ name: string;
45
+ prompt?: string;
46
+ dataType: CrystalDataType;
47
+ defaultValue?: CrystalScalar;
48
+ allowMultiple: boolean;
49
+ allowRange: boolean;
50
+ required: boolean;
51
+ options: {
52
+ value: CrystalScalar;
53
+ label?: string;
54
+ }[];
55
+ }
56
+ export interface CrystalExportFormula {
57
+ name: string;
58
+ text: string;
59
+ syntax: 'crystal' | 'basic';
60
+ /** True when the ERP page, not the report, supplies this formula's text at run time. */
61
+ hostSupplied: boolean;
62
+ }
63
+ export interface CrystalExportColumn {
64
+ /** `{Alias.FIELD}`, `{@formula}` or `{?parameter}`. */
65
+ source: string;
66
+ heading?: string;
67
+ widthPx?: number;
68
+ align?: 'left' | 'center' | 'right';
69
+ format?: string;
70
+ visible: boolean;
71
+ }
72
+ export interface CrystalExportGroup {
73
+ source: string;
74
+ order: 'asc' | 'desc' | 'original';
75
+ /** Formula placed in the group header, if any (`{@name}`). */
76
+ headerFormula?: string;
77
+ }
78
+ export interface CrystalExportSort {
79
+ source: string;
80
+ order: 'asc' | 'desc';
81
+ }
82
+ export interface CrystalExportSummary {
83
+ source: string;
84
+ function: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'other';
85
+ scope: 'report' | 'group';
86
+ }
87
+ export interface CrystalExportFeatures {
88
+ subreports: number;
89
+ charts: number;
90
+ crossTabs: number;
91
+ conditionalFormats: number;
92
+ }
93
+ export interface CrystalExport {
94
+ format: typeof CRYSTAL_EXPORT_FORMAT;
95
+ version: typeof CRYSTAL_EXPORT_VERSION;
96
+ generator?: {
97
+ name: string;
98
+ version?: string;
99
+ };
100
+ report: {
101
+ name: string;
102
+ title?: string;
103
+ description?: string;
104
+ sourceFile?: string;
105
+ };
106
+ dataSources: CrystalExportDataSource[];
107
+ parameters: CrystalExportParameter[];
108
+ formulas: CrystalExportFormula[];
109
+ layout: {
110
+ columns: CrystalExportColumn[];
111
+ groups: CrystalExportGroup[];
112
+ sorts: CrystalExportSort[];
113
+ summaries: CrystalExportSummary[];
114
+ };
115
+ features: CrystalExportFeatures;
116
+ }
117
+ /** Report effort, for triage: A plain list, B formulas, C stateful or grouped, D uses unsupported objects. */
118
+ export type ImportTier = 'A' | 'B' | 'C' | 'D';
119
+ export interface SkippedFormula {
120
+ name: string;
121
+ text: string;
122
+ reasons: string[];
123
+ }
124
+ export interface CrystalImportStats {
125
+ tier: ImportTier;
126
+ formulas: number;
127
+ importedFormulas: number;
128
+ skippedFormulas: number;
129
+ columns: number;
130
+ groups: number;
131
+ summaries: number;
132
+ parameters: number;
133
+ /** Every function the formulas call (lower case). */
134
+ functionsUsed: string[];
135
+ /** Functions called that the engine does not provide. */
136
+ unknownFunctions: string[];
137
+ errors: number;
138
+ warnings: number;
139
+ }
@@ -0,0 +1,17 @@
1
+ import { CrystalExport, ImportIssue } from './crystal-export.model';
2
+ /** Limits enforced while reading untrusted input. */
3
+ export declare const IMPORT_LIMITS: {
4
+ readonly fileChars: 5000000;
5
+ readonly textChars: 100000;
6
+ readonly nameChars: 512;
7
+ readonly items: 5000;
8
+ };
9
+ export interface ParsedExport {
10
+ value?: CrystalExport;
11
+ issues: ImportIssue[];
12
+ }
13
+ /**
14
+ * Reads and validates an export. Accepts parsed JSON or JSON text. Builds the result field by field,
15
+ * so unknown or hostile keys never reach it. Problems become issues; it never throws.
16
+ */
17
+ export declare function parseCrystalExport(input: unknown): ParsedExport;
@@ -0,0 +1,21 @@
1
+ import { ReportDefinition } from '../../core/models/report-definition.model';
2
+ import { CrystalImportStats, ImportIssue, SkippedFormula } from './crystal-export.model';
3
+ export interface CrystalImportOptions {
4
+ /** Report category. Default `Imported`. */
5
+ category?: string;
6
+ /** Format for date values sent to stored procedures. Default `yyyyMMdd` (the ERP convention). */
7
+ dateFormat?: string;
8
+ /** Replace the report id derived from the report name. */
9
+ id?: string;
10
+ }
11
+ export interface CrystalImportResult {
12
+ /** Null only when the input could not be used at all; see `issues`. */
13
+ definition: ReportDefinition | null;
14
+ issues: ImportIssue[];
15
+ skippedFormulas: SkippedFormula[];
16
+ /** Formulas whose text Crystal received from the host page; imported as empty text to be replaced. */
17
+ hostSuppliedFormulas: string[];
18
+ stats: CrystalImportStats;
19
+ }
20
+ /** Maps a Crystal export (object or JSON text) to a report definition. Never throws. */
21
+ export declare function importCrystalExport(input: unknown, options?: CrystalImportOptions): CrystalImportResult;
@@ -0,0 +1,3 @@
1
+ export * from './crystal-export.model';
2
+ export { parseCrystalExport, IMPORT_LIMITS, type ParsedExport } from './crystal-export.parser';
3
+ export { importCrystalExport, type CrystalImportOptions, type CrystalImportResult } from './crystal-import';
@@ -4,3 +4,4 @@ export * from './persistence';
4
4
  export * from './routing';
5
5
  export * from './export';
6
6
  export * from './embed';
7
+ export * from './import';
@@ -1,11 +1,20 @@
1
+ import { hasReportWorkflow } from '../../core/utils/report-workflow.util';
1
2
  import { Type } from '@angular/core';
2
3
  import { FormGroup } from '@angular/forms';
3
4
  import { ReportDefinition } from '../../core/models/report-definition.model';
4
5
  import { ReportComponentDefinition } from '../../core/models/report-component.model';
5
6
  import { ComponentActionDefinition } from '../../core/models/component-event.model';
6
7
  import { GridColumnDefinition, GridRowClickAction } from '../../core/models/report-grid.model';
8
+ import { SelectionWorkflowService, SelectionWorkflowResult } from './selection-workflow.service';
7
9
  import * as i0 from "@angular/core";
8
10
  export declare class DynamicRendererComponent {
11
+ readonly hasReportWorkflow: typeof hasReportWorkflow;
12
+ readonly workflow: SelectionWorkflowService;
13
+ readonly workflowExecuted: import("@angular/core").OutputEmitterRef<SelectionWorkflowResult>;
14
+ readonly workflowInvalidated: import("@angular/core").OutputEmitterRef<void>;
15
+ readonly displayData: import("@angular/core").Signal<unknown[] | null>;
16
+ readonly displayGrid: import("@angular/core").Signal<import("../../core/models/report-grid.model").ReportGridDefinition | undefined>;
17
+ constructor();
9
18
  private readonly registry;
10
19
  private readonly formBuilder;
11
20
  private readonly router;
@@ -70,5 +79,5 @@ export declare class DynamicRendererComponent {
70
79
  }): void;
71
80
  onGridSelectionChange(rows: any[]): void;
72
81
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicRendererComponent, never>;
73
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicRendererComponent, "rpt-dynamic-renderer", never, { "definition": { "alias": "definition"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; "resultData": { "alias": "resultData"; "required": false; "isSignal": true; }; }, { "executeRequested": "executeRequested"; "resetRequested": "resetRequested"; "exportRequested": "exportRequested"; "printRequested": "printRequested"; "customActionTriggered": "customActionTriggered"; "gridStateChanged": "gridStateChanged"; "columnDefsChanged": "columnDefsChanged"; "selectionChange": "selectionChange"; "selectionChanged": "selectionChanged"; "rowActionTriggered": "rowActionTriggered"; }, never, never, true, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicRendererComponent, "rpt-dynamic-renderer", never, { "definition": { "alias": "definition"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; "resultData": { "alias": "resultData"; "required": false; "isSignal": true; }; }, { "workflowExecuted": "workflowExecuted"; "workflowInvalidated": "workflowInvalidated"; "executeRequested": "executeRequested"; "resetRequested": "resetRequested"; "exportRequested": "exportRequested"; "printRequested": "printRequested"; "customActionTriggered": "customActionTriggered"; "gridStateChanged": "gridStateChanged"; "columnDefsChanged": "columnDefsChanged"; "selectionChange": "selectionChange"; "selectionChanged": "selectionChanged"; "rowActionTriggered": "rowActionTriggered"; }, never, never, true, never>;
74
83
  }
@@ -15,6 +15,15 @@ export declare class ReportExecutionService {
15
15
  /** Canvas field keys the user still has to fill before the report can run. */
16
16
  getMissingFields(def: ReportDefinition, formValues: Record<string, unknown>): string[];
17
17
  execute(def: ReportDefinition, formValues: Record<string, unknown>): Observable<unknown[]>;
18
+ private executeResolved;
19
+ /**
20
+ * Adds formula column values to the rows in one ordered pass, so the grid, sorting and exports
21
+ * all read stored values. A row-level data problem leaves that cell empty and is logged once per formula.
22
+ */
23
+ private withFormulaColumns;
24
+ /** Executes exactly the declared source; never falls back to the main report query. */
25
+ executeDataSource(def: ReportDefinition, sourceId: string, formValues: Record<string, unknown>): Observable<unknown[]>;
26
+ private executeSource;
18
27
  static ɵfac: i0.ɵɵFactoryDeclaration<ReportExecutionService, never>;
19
28
  static ɵprov: i0.ɵɵInjectableDeclaration<ReportExecutionService>;
20
29
  }
@@ -65,6 +65,7 @@ export declare class ReportGridBridgeComponent {
65
65
  checkboxSelection: boolean | undefined;
66
66
  headerCheckboxSelection: boolean | undefined;
67
67
  field: string;
68
+ formula?: string;
68
69
  label: string;
69
70
  dataType?: "string" | "number" | "date" | "boolean" | "currency";
70
71
  format?: string;
@@ -119,6 +120,7 @@ export declare class ReportGridBridgeComponent {
119
120
  checkboxSelection: boolean | undefined;
120
121
  headerCheckboxSelection: boolean | undefined;
121
122
  field: string;
123
+ formula?: string;
122
124
  label: string;
123
125
  dataType?: "string" | "number" | "date" | "boolean" | "currency";
124
126
  format?: string;
@@ -141,6 +143,7 @@ export declare class ReportGridBridgeComponent {
141
143
  checkboxSelection: boolean | undefined;
142
144
  headerCheckboxSelection: boolean | undefined;
143
145
  field: string;
146
+ formula?: string;
144
147
  label: string;
145
148
  dataType?: "string" | "number" | "date" | "boolean" | "currency";
146
149
  format?: string;
@@ -2,8 +2,12 @@ import { ReportDefinition } from '../../core/models/report-definition.model';
2
2
  import { ReportComponentDefinition } from '../../core/models/report-component.model';
3
3
  import { ComponentActionDefinition } from '../../core/models/component-event.model';
4
4
  import { GridRowClickAction } from '../../core/models/report-grid.model';
5
+ import { DynamicRendererComponent } from './dynamic-renderer.component';
6
+ import { SelectionWorkflowResult } from './selection-workflow.service';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare class ReportRuntimeComponent {
9
+ /** @internal Designer query previews use the active form rather than stale canvas filters. */
10
+ readonly renderer: import("@angular/core").Signal<DynamicRendererComponent | undefined>;
7
11
  private readonly requests;
8
12
  private readonly persistenceAdapter;
9
13
  private readonly dataSourceAdapter;
@@ -80,6 +84,7 @@ export declare class ReportRuntimeComponent {
80
84
  constructor();
81
85
  onEscape(): void;
82
86
  loadReport(id: string): void;
87
+ onWorkflowExecuted(event: SelectionWorkflowResult): void;
83
88
  onExecuteReport(event: {
84
89
  definition: ReportDefinition;
85
90
  parameters: Record<string, unknown>;
@@ -0,0 +1,16 @@
1
+ import { SelectionWorkflowService } from './selection-workflow.service';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SelectionWorkflowPanelComponent {
4
+ readonly singlePane: import("@angular/core").InputSignal<boolean>;
5
+ readonly workflow: import("@angular/core").InputSignal<SelectionWorkflowService>;
6
+ readonly lookupVisible: import("@angular/core").Signal<boolean>;
7
+ readonly visibleAdditionalLookups: import("@angular/core").Signal<{
8
+ key: string;
9
+ label: string;
10
+ workflow: SelectionWorkflowService;
11
+ }[]>;
12
+ readonly hasLookupPanels: import("@angular/core").Signal<boolean>;
13
+ private needsLookupPanel;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectionWorkflowPanelComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectionWorkflowPanelComponent, "rpt-selection-workflow-panel", never, { "singlePane": { "alias": "singlePane"; "required": false; "isSignal": true; }; "workflow": { "alias": "workflow"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
16
+ }
@@ -0,0 +1,113 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { Subject } from 'rxjs';
3
+ import { ReportDefinition } from '../../core/models/report-definition.model';
4
+ import { SelectionWorkflowCase } from '../../core/models/selection-workflow.model';
5
+ import * as i0 from "@angular/core";
6
+ export interface SelectionWorkflowResult {
7
+ definition: ReportDefinition;
8
+ parameters: Record<string, unknown>;
9
+ data: unknown[];
10
+ }
11
+ type State = 'idle' | 'loading' | 'ready' | 'empty' | 'error';
12
+ /** Provided by each renderer/canvas, never globally shared between report instances. */
13
+ export declare class SelectionWorkflowService {
14
+ private readonly injector;
15
+ readonly additionalLookups: import("@angular/core").WritableSignal<{
16
+ key: string;
17
+ label: string;
18
+ workflow: SelectionWorkflowService;
19
+ }[]>;
20
+ private unregisterDestroy?;
21
+ private readonly additionalSubscriptions;
22
+ lookupLabel(): string;
23
+ private syncAdditional;
24
+ private readonly execution;
25
+ private readonly print;
26
+ private readonly standaloneRun;
27
+ private readonly session;
28
+ private readonly requests;
29
+ private form?;
30
+ private definition?;
31
+ private formSubscription?;
32
+ private signature;
33
+ private lookupSignature;
34
+ private resultSignature;
35
+ private revision;
36
+ private timer?;
37
+ private selected?;
38
+ private selectionControlKey?;
39
+ private authorizedContext;
40
+ private readonly branch;
41
+ readonly activeCase: import("@angular/core").Signal<SelectionWorkflowCase | null>;
42
+ readonly hasSelection: import("@angular/core").WritableSignal<boolean>;
43
+ readonly lookupRows: import("@angular/core").WritableSignal<unknown[]>;
44
+ readonly resultRows: import("@angular/core").WritableSignal<unknown[] | null>;
45
+ readonly lookupState: import("@angular/core").WritableSignal<State>;
46
+ readonly resultState: import("@angular/core").WritableSignal<State>;
47
+ readonly lookupError: import("@angular/core").WritableSignal<string | null>;
48
+ lookupPrompt(): string;
49
+ readonly resultError: import("@angular/core").WritableSignal<string | null>;
50
+ readonly selectedLabel: import("@angular/core").WritableSignal<string | null>;
51
+ readonly resultGrid: import("@angular/core").WritableSignal<import("bways-report").ReportGridDefinition | undefined>;
52
+ readonly lookupGrid: import("@angular/core").Signal<{
53
+ options: {
54
+ selectable: boolean;
55
+ selectionMode: "single" | "multiple";
56
+ rowSelection: "single" | "multiple";
57
+ headerCheckboxSelection: boolean;
58
+ pageSize?: number;
59
+ pagination?: boolean;
60
+ checkboxSelection?: boolean;
61
+ showRowNumbers?: boolean;
62
+ allowColumnReorder?: boolean;
63
+ allowExport?: boolean;
64
+ exportFormats?: ("csv" | "excel" | "pdf")[];
65
+ showFooter?: boolean;
66
+ height?: string;
67
+ groupModel?: string[];
68
+ sortModel?: unknown[];
69
+ reportState?: Record<string, unknown>;
70
+ presets?: unknown[];
71
+ sideBar?: boolean | {
72
+ visible?: boolean;
73
+ panel?: ("columns" | "filters" | "highlights" | "export" | "analytics" | "chat")[];
74
+ };
75
+ globalSearch?: boolean;
76
+ statusBar?: boolean;
77
+ rowClickAction?: import("../../core/models/report-grid.model").GridRowClickAction;
78
+ };
79
+ dataSourceId: string;
80
+ columns: import("bways-report").GridColumnDefinition[];
81
+ formulaGroupFields?: string[];
82
+ rowClickAction?: import("../../core/models/report-grid.model").GridRowClickAction;
83
+ } | undefined>;
84
+ readonly canRun: import("@angular/core").Signal<boolean>;
85
+ readonly completed: Subject<SelectionWorkflowResult>;
86
+ readonly invalidated: Subject<void>;
87
+ constructor();
88
+ context(): string;
89
+ /** Called whenever report/form/authorized context changes. Layout-only edits preserve current rows. */
90
+ bind(definition: ReportDefinition, form: FormGroup, context: string): void;
91
+ private release;
92
+ private disconnect;
93
+ private values;
94
+ private sourceSignature;
95
+ private refresh;
96
+ loadLookupOnDemand(): void;
97
+ retryLookup(): void;
98
+ private loadLookup;
99
+ select(rows: unknown[]): void;
100
+ /** Untouched/direct radio options resolve selected-row bindings from the card's single lookup source. */
101
+ private allRowsCase;
102
+ private prepareAllRows;
103
+ run(): void;
104
+ /** Return to the existing lookups without discarding rows, selected values or their metadata. */
105
+ returnToSelection(): void;
106
+ reset(): void;
107
+ private clearSelection;
108
+ private clearResults;
109
+ private message;
110
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectionWorkflowService, never>;
111
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectionWorkflowService>;
112
+ }
113
+ export {};
@@ -11,7 +11,7 @@ export declare class RptButtonComponent {
11
11
  readonly fieldLabel: import("@angular/core").Signal<string>;
12
12
  readonly hasLabelSpacer: import("@angular/core").Signal<boolean>;
13
13
  readonly buttonLabel: import("@angular/core").Signal<string>;
14
- readonly buttonHtmlType: import("@angular/core").Signal<"submit" | "button" | "reset">;
14
+ readonly buttonHtmlType: import("@angular/core").Signal<"button" | "submit" | "reset">;
15
15
  readonly isDisabled: import("@angular/core").Signal<boolean>;
16
16
  readonly icon: import("@angular/core").Signal<string>;
17
17
  readonly buttonClasses: import("@angular/core").Signal<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bways-report",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",