stimulsoft-reports-js-angular 2025.2.1

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.
package/viewer.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ import { Stimulsoft } from "./stimulsoft.reports"
2
+ export { Stimulsoft }
3
+
4
+ import { SimpleChanges, EventEmitter } from "@angular/core";
5
+ import * as i0 from "@angular/core";
6
+
7
+ export declare class Viewer {
8
+ ngOnInit(): void;
9
+ ngOnChanges(changes: SimpleChanges): void;
10
+ ngOnDestroy(): void;
11
+ report?: Stimulsoft.Report.StiReport;
12
+ visible?: boolean;
13
+ options?: Stimulsoft.Viewer.StiViewerOptions;
14
+ id?: string;
15
+ onPrepareVariables: EventEmitter<Stimulsoft.Report.PrepareVariablesArgs>;
16
+ onBeginProcessData: EventEmitter<Stimulsoft.Report.BeginProcessDataArgs>;
17
+ onEndProcessData: EventEmitter<Stimulsoft.Report.EndProcessDataArgs>;
18
+ onPrintReport: EventEmitter<Stimulsoft.Viewer.PrintReportEventArgs>;
19
+ onBeginExportReport: EventEmitter<Stimulsoft.Viewer.BeginExportReportArgs>;
20
+ onEndExportReport: EventEmitter<Stimulsoft.Viewer.EndExportReportArgs>;
21
+ onInteraction: EventEmitter<Stimulsoft.Viewer.InteractionArgs>;
22
+ onEmailReport: EventEmitter<Stimulsoft.Viewer.EmailReportArgs>;
23
+ onDesignReport: EventEmitter<Stimulsoft.Viewer.DesignReportArgs>;
24
+ onShowReport: EventEmitter<Stimulsoft.Viewer.ShowReportArgs>;
25
+ onOpenReport: EventEmitter<Stimulsoft.Viewer.OpenReportArgs>;
26
+ onOpenedReport: EventEmitter<Stimulsoft.Viewer.OpenedReportArgs>;
27
+
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<Viewer, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<Viewer, "sti-viewer", never,
30
+ {
31
+ "report": {
32
+ "alias": "report",
33
+ "required": false
34
+ },
35
+ "visible": {
36
+ "alias": "visible",
37
+ "required": false
38
+ },
39
+ "options": {
40
+ "alias": "options",
41
+ "required": false
42
+ },
43
+ "id": {
44
+ "alias": "id",
45
+ "required": false
46
+ }
47
+ },
48
+ {
49
+ "onPrepareVariables": "onPrepareVariables",
50
+ "onBeginProcessData": "onBeginProcessData",
51
+ "onEndProcessData": "onEndProcessData",
52
+ "onPrintReport": "onPrintReport",
53
+ "onBeginExportReport": "onBeginExportReport",
54
+ "onEndExportReport": "onEndExportReport",
55
+ "onInteraction": "onInteraction",
56
+ "onEmailReport": "onEmailReport",
57
+ "onDesignReport": "onDesignReport",
58
+ "onShowReport": "onShowReport",
59
+ "onOpenReport": "onOpenReport",
60
+ "onOpenedReport": "onOpenedReport"
61
+ }, never, never, true, never>;
62
+ }
package/viewer.js ADDED
@@ -0,0 +1,137 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EventEmitter } from "@angular/core";
3
+
4
+ import { } from "./stimulsoft.reports.engine.mjs";
5
+ import { } from "./stimulsoft.reports.chart.mjs";
6
+ import { } from "./stimulsoft.reports.export.mjs";
7
+ import { } from "./stimulsoft.reports.import.xlsx.mjs";
8
+ import { } from "./stimulsoft.reports.maps.mjs";
9
+ import { Stimulsoft } from "./stimulsoft.viewer.mjs";
10
+ export { Stimulsoft };
11
+
12
+
13
+ export class Viewer {
14
+ #viewer;
15
+ #parentRef;
16
+
17
+ #createViewer() {
18
+ this.#viewer = new Stimulsoft.Viewer.StiViewer(this.options, this.id, false);
19
+ this.#viewer.renderHtml(this.#parentRef.nativeElement);
20
+ this.#bindEvents();
21
+
22
+ this.#viewer.visible = this.visible;
23
+ }
24
+
25
+ #bindEvents() {
26
+ if (this.#viewer) {
27
+ this.#viewer.onPrepareVariables = (args) => this.onPrepareVariables.emit(args);
28
+ this.#viewer.onBeginProcessData = (args) => this.onBeginProcessData.emit(args);
29
+ this.#viewer.onEndProcessData = (args) => this.onEndProcessData.emit(args);
30
+ this.#viewer.onPrintReport = (args) => this.onPrintReport.emit(args);
31
+ this.#viewer.onBeginExportReport = (args) => this.onBeginExportReport.emit(args);
32
+ this.#viewer.onEndExportReport = (args) => this.onEndExportReport.emit(args);
33
+ this.#viewer.onInteraction = (args) => this.onInteraction.emit(args);
34
+ this.#viewer.onEmailReport = (args) => this.onEmailReport.emit(args);
35
+ this.#viewer.onDesignReport = (args) => this.onDesignReport.emit(args);
36
+ this.#viewer.onShowReport = (args) => this.onShowReport.emit(args);
37
+ this.#viewer.onOpenReport = (args) => {
38
+ args.preventDefault = false;
39
+ this.onOpenReport.emit(args);
40
+ }
41
+ this.#viewer.onOpenedReport = (args) => this.onOpenedReport.emit(args);
42
+ }
43
+ }
44
+ ngAfterViewInit() {
45
+ this.#createViewer();
46
+ this.#viewer.report = this.report;
47
+ }
48
+ ngOnChanges(changes) {
49
+ for (let propName in changes) {
50
+ switch (propName) {
51
+ case "options": {
52
+ if (this.#viewer) {
53
+ this.#createViewer();
54
+ this.#viewer.report = this.report;
55
+ }
56
+ break;
57
+ }
58
+ case "report": {
59
+ if (this.#viewer)
60
+ this.#viewer.report = changes[propName].currentValue;
61
+ break;
62
+ }
63
+ case "visible": {
64
+ if (this.#viewer)
65
+ this.#viewer.visible = changes[propName].currentValue;
66
+ break;
67
+ }
68
+ case "id": {
69
+ if (this.#viewer) {
70
+ this.#createViewer();
71
+ this.#viewer.report = this.report;
72
+ }
73
+ break;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ ngOnDestroy() {
79
+ if (this.#viewer != null)
80
+ this.#viewer.dispose();
81
+ }
82
+
83
+ report = undefined;
84
+ visible = true;
85
+ options = undefined;
86
+ id = undefined;
87
+
88
+ onPrepareVariables = new EventEmitter();
89
+ onBeginProcessData = new EventEmitter();
90
+ onEndProcessData = new EventEmitter();
91
+ onPrintReport = new EventEmitter();
92
+ onBeginExportReport = new EventEmitter();
93
+ onEndExportReport = new EventEmitter();
94
+ onInteraction = new EventEmitter();
95
+ onEmailReport = new EventEmitter();
96
+ onDesignReport = new EventEmitter();
97
+ onShowReport = new EventEmitter();
98
+ onOpenReport = new EventEmitter();
99
+ onOpenedReport = new EventEmitter();
100
+
101
+ static ɵfac = i0.ɵɵngDeclareFactory({
102
+ minVersion: "12.0.0", version: "19.0.0", ngImport: i0,
103
+ type: Viewer,
104
+ deps: [],
105
+ target: i0.ɵɵFactoryTarget.Component
106
+ });
107
+ static ɵcmp = i0.ɵɵngDeclareComponent({
108
+ minVersion: "12.0.0", version: "19.0.0", ngImport: i0,
109
+ type: Viewer,
110
+ isStandalone: true,
111
+ selector: "sti-viewer",
112
+ inputs: {
113
+ report: "report",
114
+ visible: "visible",
115
+ options: "options",
116
+ id: "id"
117
+ },
118
+ outputs: {
119
+ onPrepareVariables: "onPrepareVariables",
120
+ onBeginProcessData: "onBeginProcessData",
121
+ onEndProcessData: "onEndProcessData",
122
+ onPrintReport: "onPrintReport",
123
+ onBeginExportReport: "onBeginExportReport",
124
+ onEndExportReport: "onEndExportReport",
125
+ onInteraction: "onInteraction",
126
+ onEmailReport: "onEmailReport",
127
+ onDesignReport: "onDesignReport",
128
+ onShowReport: "onShowReport",
129
+ onOpenReport: "onOpenReport",
130
+ onOpenedReport: "onOpenedReport"
131
+ },
132
+ viewQueries: [{ propertyName: "#parentRef", first: true, predicate: ["parentRef"], descendants: true }],
133
+ usesOnChanges: true,
134
+ template: `<div #parentRef></div>`,
135
+ isInline: true
136
+ });
137
+ }