bways-report 0.2.9 → 0.2.10

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 (108) 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 +2 -1
  14. package/esm2022/lib/core/models/report-datasource.model.mjs +1 -1
  15. package/esm2022/lib/core/models/report-definition.model.mjs +1 -1
  16. package/esm2022/lib/core/models/report-formula.model.mjs +2 -0
  17. package/esm2022/lib/core/models/report-grid.model.mjs +1 -1
  18. package/esm2022/lib/core/models/report-parameter.model.mjs +1 -1
  19. package/esm2022/lib/core/models/selection-workflow.model.mjs +2 -0
  20. package/esm2022/lib/core/utilities/schema-migration.mjs +5 -5
  21. package/esm2022/lib/core/utils/report-form-values.util.mjs +54 -4
  22. package/esm2022/lib/core/utils/report-parameter.util.mjs +4 -4
  23. package/esm2022/lib/core/utils/report-values.util.mjs +137 -0
  24. package/esm2022/lib/core/utils/selection-workflow.util.mjs +187 -0
  25. package/esm2022/lib/features/designer/components/design-canvas/design-canvas.component.mjs +67 -9
  26. package/esm2022/lib/features/designer/components/dialogs/report-import-dialog.component.mjs +333 -0
  27. package/esm2022/lib/features/designer/components/property-editor/formula-editor.component.mjs +538 -0
  28. package/esm2022/lib/features/designer/components/property-editor/parameter-binding-editor.component.mjs +104 -25
  29. package/esm2022/lib/features/designer/components/property-editor/property-editor-action.component.mjs +3 -3
  30. package/esm2022/lib/features/designer/components/property-editor/property-editor-datasource.component.mjs +3 -3
  31. package/esm2022/lib/features/designer/components/property-editor/property-editor-general.component.mjs +3 -3
  32. package/esm2022/lib/features/designer/components/property-editor/property-editor-grid.component.mjs +8 -3
  33. package/esm2022/lib/features/designer/components/property-editor/property-editor-layout.component.mjs +3 -3
  34. package/esm2022/lib/features/designer/components/property-editor/property-editor-report.component.mjs +3 -3
  35. package/esm2022/lib/features/designer/components/property-editor/property-editor-validation.component.mjs +3 -3
  36. package/esm2022/lib/features/designer/components/property-editor/property-editor.component.mjs +39 -4
  37. package/esm2022/lib/features/designer/components/property-editor/selection-workflow-editor.component.mjs +637 -0
  38. package/esm2022/lib/features/designer/components/property-editor/workflow-source-editor.component.mjs +198 -0
  39. package/esm2022/lib/features/designer/components/toolbar/designer-toolbar.component.mjs +81 -5
  40. package/esm2022/lib/features/designer/designer.component.mjs +48 -6
  41. package/esm2022/lib/features/designer/services/designer-endpoints.service.mjs +2 -2
  42. package/esm2022/lib/features/designer/services/designer-fullscreen.service.mjs +91 -0
  43. package/esm2022/lib/features/designer/services/report-template.service.mjs +4 -1
  44. package/esm2022/lib/features/designer/utilities/merge-imported-report.mjs +68 -0
  45. package/esm2022/lib/features/import/crystal-export.model.mjs +10 -0
  46. package/esm2022/lib/features/import/crystal-export.parser.mjs +275 -0
  47. package/esm2022/lib/features/import/crystal-import.mjs +486 -0
  48. package/esm2022/lib/features/import/index.mjs +4 -0
  49. package/esm2022/lib/features/index.mjs +2 -1
  50. package/esm2022/lib/features/persistence/services/schema-validator.service.mjs +20 -3
  51. package/esm2022/lib/features/runtime/dynamic-renderer.component.mjs +65 -23
  52. package/esm2022/lib/features/runtime/report-execution.service.mjs +93 -12
  53. package/esm2022/lib/features/runtime/report-runtime.component.mjs +16 -2
  54. package/esm2022/lib/features/runtime/selection-workflow-panel.component.mjs +120 -0
  55. package/esm2022/lib/features/runtime/selection-workflow.service.mjs +480 -0
  56. package/esm2022/lib/primitives/components/button/rpt-button.component.mjs +3 -1
  57. package/esm2022/lib/primitives/components/icon/rpt-icon.component.mjs +10 -1
  58. package/fesm2022/bways-report.mjs +8263 -2811
  59. package/fesm2022/bways-report.mjs.map +1 -1
  60. package/lib/core/formula/format.d.ts +7 -0
  61. package/lib/core/formula/formula-columns.d.ts +16 -0
  62. package/lib/core/formula/formula-engine.d.ts +83 -0
  63. package/lib/core/formula/formula.types.d.ts +94 -0
  64. package/lib/core/formula/functions.d.ts +21 -0
  65. package/lib/core/formula/index.d.ts +6 -0
  66. package/lib/core/formula/interpreter.d.ts +28 -0
  67. package/lib/core/formula/lexer.d.ts +9 -0
  68. package/lib/core/formula/parser.d.ts +3 -0
  69. package/lib/core/formula/summary-index.d.ts +12 -0
  70. package/lib/core/formula/variable-store.d.ts +12 -0
  71. package/lib/core/index.d.ts +1 -0
  72. package/lib/core/models/index.d.ts +2 -0
  73. package/lib/core/models/report-datasource.model.d.ts +2 -0
  74. package/lib/core/models/report-definition.model.d.ts +8 -0
  75. package/lib/core/models/report-formula.model.d.ts +16 -0
  76. package/lib/core/models/report-grid.model.d.ts +11 -1
  77. package/lib/core/models/report-parameter.model.d.ts +7 -0
  78. package/lib/core/models/selection-workflow.model.d.ts +31 -0
  79. package/lib/core/utilities/schema-migration.d.ts +1 -1
  80. package/lib/core/utils/report-form-values.util.d.ts +6 -1
  81. package/lib/core/utils/report-values.util.d.ts +7 -0
  82. package/lib/core/utils/selection-workflow.util.d.ts +12 -0
  83. package/lib/features/designer/components/component-palette/component-palette.component.d.ts +1 -1
  84. package/lib/features/designer/components/design-canvas/design-canvas.component.d.ts +7 -0
  85. package/lib/features/designer/components/dialogs/report-import-dialog.component.d.ts +36 -0
  86. package/lib/features/designer/components/property-editor/formula-editor.component.d.ts +80 -0
  87. package/lib/features/designer/components/property-editor/parameter-binding-editor.component.d.ts +31 -1
  88. package/lib/features/designer/components/property-editor/property-editor-grid.component.d.ts +7 -1
  89. package/lib/features/designer/components/property-editor/property-editor.component.d.ts +15 -2
  90. package/lib/features/designer/components/property-editor/selection-workflow-editor.component.d.ts +102 -0
  91. package/lib/features/designer/components/property-editor/workflow-source-editor.component.d.ts +40 -0
  92. package/lib/features/designer/components/toolbar/designer-toolbar.component.d.ts +9 -1
  93. package/lib/features/designer/designer.component.d.ts +6 -0
  94. package/lib/features/designer/services/designer-fullscreen.service.d.ts +20 -0
  95. package/lib/features/designer/utilities/merge-imported-report.d.ts +3 -0
  96. package/lib/features/import/crystal-export.model.d.ts +139 -0
  97. package/lib/features/import/crystal-export.parser.d.ts +17 -0
  98. package/lib/features/import/crystal-import.d.ts +21 -0
  99. package/lib/features/import/index.d.ts +3 -0
  100. package/lib/features/index.d.ts +1 -0
  101. package/lib/features/runtime/dynamic-renderer.component.d.ts +8 -1
  102. package/lib/features/runtime/report-execution.service.d.ts +9 -0
  103. package/lib/features/runtime/report-grid-bridge.component.d.ts +3 -0
  104. package/lib/features/runtime/report-runtime.component.d.ts +2 -0
  105. package/lib/features/runtime/selection-workflow-panel.component.d.ts +16 -0
  106. package/lib/features/runtime/selection-workflow.service.d.ts +110 -0
  107. package/lib/primitives/components/button/rpt-button.component.d.ts +1 -1
  108. package/package.json +1 -1
@@ -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';
@@ -4,8 +4,15 @@ import { ReportDefinition } from '../../core/models/report-definition.model';
4
4
  import { ReportComponentDefinition } from '../../core/models/report-component.model';
5
5
  import { ComponentActionDefinition } from '../../core/models/component-event.model';
6
6
  import { GridColumnDefinition, GridRowClickAction } from '../../core/models/report-grid.model';
7
+ import { SelectionWorkflowService, SelectionWorkflowResult } from './selection-workflow.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class DynamicRendererComponent {
10
+ readonly workflow: SelectionWorkflowService;
11
+ readonly workflowExecuted: import("@angular/core").OutputEmitterRef<SelectionWorkflowResult>;
12
+ readonly workflowInvalidated: import("@angular/core").OutputEmitterRef<void>;
13
+ readonly displayData: import("@angular/core").Signal<unknown[] | null>;
14
+ readonly displayGrid: import("@angular/core").Signal<import("../../core/models/report-grid.model").ReportGridDefinition | undefined>;
15
+ constructor();
9
16
  private readonly registry;
10
17
  private readonly formBuilder;
11
18
  private readonly router;
@@ -70,5 +77,5 @@ export declare class DynamicRendererComponent {
70
77
  }): void;
71
78
  onGridSelectionChange(rows: any[]): void;
72
79
  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>;
80
+ 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
81
  }
@@ -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,6 +2,7 @@ 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 { SelectionWorkflowResult } from './selection-workflow.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class ReportRuntimeComponent {
7
8
  private readonly requests;
@@ -80,6 +81,7 @@ export declare class ReportRuntimeComponent {
80
81
  constructor();
81
82
  onEscape(): void;
82
83
  loadReport(id: string): void;
84
+ onWorkflowExecuted(event: SelectionWorkflowResult): void;
83
85
  onExecuteReport(event: {
84
86
  definition: ReportDefinition;
85
87
  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,110 @@
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 session;
26
+ private readonly requests;
27
+ private form?;
28
+ private definition?;
29
+ private formSubscription?;
30
+ private signature;
31
+ private lookupSignature;
32
+ private resultSignature;
33
+ private revision;
34
+ private timer?;
35
+ private selected?;
36
+ private selectionControlKey?;
37
+ private authorizedContext;
38
+ private readonly branch;
39
+ readonly activeCase: import("@angular/core").Signal<SelectionWorkflowCase | null>;
40
+ readonly lookupRows: import("@angular/core").WritableSignal<unknown[]>;
41
+ readonly resultRows: import("@angular/core").WritableSignal<unknown[] | null>;
42
+ readonly lookupState: import("@angular/core").WritableSignal<State>;
43
+ readonly resultState: import("@angular/core").WritableSignal<State>;
44
+ readonly lookupError: import("@angular/core").WritableSignal<string | null>;
45
+ lookupPrompt(): string;
46
+ readonly resultError: import("@angular/core").WritableSignal<string | null>;
47
+ readonly selectedLabel: import("@angular/core").WritableSignal<string | null>;
48
+ readonly resultGrid: import("@angular/core").WritableSignal<import("bways-report").ReportGridDefinition | undefined>;
49
+ readonly lookupGrid: import("@angular/core").Signal<{
50
+ options: {
51
+ selectable: boolean;
52
+ selectionMode: "single" | "multiple";
53
+ rowSelection: "single" | "multiple";
54
+ headerCheckboxSelection: boolean;
55
+ pageSize?: number;
56
+ pagination?: boolean;
57
+ checkboxSelection?: boolean;
58
+ showRowNumbers?: boolean;
59
+ allowColumnReorder?: boolean;
60
+ allowExport?: boolean;
61
+ exportFormats?: ("csv" | "excel" | "pdf")[];
62
+ showFooter?: boolean;
63
+ height?: string;
64
+ groupModel?: string[];
65
+ sortModel?: unknown[];
66
+ reportState?: Record<string, unknown>;
67
+ presets?: unknown[];
68
+ sideBar?: boolean | {
69
+ visible?: boolean;
70
+ panel?: ("columns" | "filters" | "highlights" | "export" | "analytics" | "chat")[];
71
+ };
72
+ globalSearch?: boolean;
73
+ statusBar?: boolean;
74
+ rowClickAction?: import("../../core/models/report-grid.model").GridRowClickAction;
75
+ };
76
+ dataSourceId: string;
77
+ columns: import("bways-report").GridColumnDefinition[];
78
+ formulaGroupFields?: string[];
79
+ rowClickAction?: import("../../core/models/report-grid.model").GridRowClickAction;
80
+ } | undefined>;
81
+ readonly canRun: import("@angular/core").Signal<boolean>;
82
+ readonly completed: Subject<SelectionWorkflowResult>;
83
+ readonly invalidated: Subject<void>;
84
+ constructor();
85
+ context(): string;
86
+ /** Called whenever report/form/authorized context changes. Layout-only edits preserve current rows. */
87
+ bind(definition: ReportDefinition, form: FormGroup, context: string): void;
88
+ private release;
89
+ private disconnect;
90
+ private values;
91
+ private sourceSignature;
92
+ private refresh;
93
+ loadLookupOnDemand(): void;
94
+ retryLookup(): void;
95
+ private loadLookup;
96
+ select(rows: unknown[]): void;
97
+ /** Untouched/direct radio options resolve selected-row bindings from the card's single lookup source. */
98
+ private allRowsCase;
99
+ private prepareAllRows;
100
+ run(): void;
101
+ /** Return to the existing lookups without discarding rows, selected values or their metadata. */
102
+ returnToSelection(): void;
103
+ reset(): void;
104
+ private clearSelection;
105
+ private clearResults;
106
+ private message;
107
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectionWorkflowService, never>;
108
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectionWorkflowService>;
109
+ }
110
+ 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.10",
4
4
  "description": "Enterprise-grade, metadata-driven reporting engine and visual page builder for Angular 18+ ERP applications.",
5
5
  "keywords": [
6
6
  "angular",