stimulsoft-reports-js-react 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/designer.js ADDED
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+ import { } from "./stimulsoft.reports.engine.mjs";
3
+ import { } from "./stimulsoft.reports.chart.mjs";
4
+ import { } from "./stimulsoft.reports.export.mjs";
5
+ import { } from "./stimulsoft.reports.import.xlsx.mjs";
6
+ import { } from "./stimulsoft.reports.maps.mjs";
7
+ import { } from "./stimulsoft.viewer.mjs";
8
+ import { } from "./stimulsoft.designer.mjs";
9
+ import { Stimulsoft } from "./stimulsoft.blockly.editor.mjs";
10
+
11
+ export class Designer extends React.Component {
12
+ #designer;
13
+ #parentRef = React.createRef();
14
+
15
+ #createDesigner() {
16
+ this.#designer = new Stimulsoft.Designer.StiDesigner(this.props.options, this.props.id, false);
17
+ this.#designer.renderHtml(this.#parentRef.current);
18
+ this.#bindEvents();
19
+
20
+ this.#designer.visible = this.props.visible ?? true;
21
+ }
22
+
23
+ #bindEvents() {
24
+ if (typeof this.props.onPrepareVariables == "function") this.#designer.onPrepareVariables = this.props.onPrepareVariables?.bind(this);
25
+ if (typeof this.props.onBeginProcessData == "function") this.#designer.onBeginProcessData = this.props.onBeginProcessData?.bind(this);
26
+ if (typeof this.props.onEndProcessData == "function") this.#designer.onEndProcessData = this.props.onEndProcessData?.bind(this);
27
+ if (typeof this.props.onCreateReport == "function") this.#designer.onCreateReport = this.props.onCreateReport?.bind(this);
28
+ if (typeof this.props.onCloseReport == "function") this.#designer.onCloseReport = this.props.onCloseReport?.bind(this);
29
+ if (typeof this.props.onOpenReport == "function") this.#designer.onOpenReport = (args, callback) => {
30
+ args.preventDefault = false;
31
+ this.props.onOpenReport?.bind(this)(args, callback);
32
+ }
33
+ if (typeof this.props.onOpenedReport == "function") this.#designer.onOpenedReport = this.props.onOpenedReport.bind(this);
34
+ if (typeof this.props.onSaveReport == "function") this.#designer.onSaveReport = (args, callback) => {
35
+ args.preventDefault = false;
36
+ this.props.onSaveReport?.bind(this)(args, callback);
37
+ }
38
+ if (typeof this.props.onSaveAsReport == "function") this.#designer.onSaveAsReport = this.props.onSaveAsReport?.bind(this);
39
+ if (typeof this.props.onPreviewReport == "function") this.#designer.onPreviewReport = this.props.onPreviewReport?.bind(this);
40
+ if (typeof this.props.onExit == "function") this.#designer.onExit = this.props.onExit?.bind(this);
41
+
42
+ if (typeof this.props.onAssignedReport == "function") this.#designer.onAssignedReport = this.props.onAssignedReport?.bind(this);
43
+ }
44
+
45
+ componentDidMount() {
46
+ this.#createDesigner();
47
+ this.#designer.report = this.props.report;
48
+ }
49
+
50
+ componentWillUnmount() {
51
+ if (this.#designer != null)
52
+ this.#designer.dispose();
53
+ }
54
+
55
+ componentDidUpdate(prevProps) {
56
+ if (this.props.options !== prevProps.options) {
57
+ this.#createDesigner();
58
+ this.#designer.report = this.props.report;
59
+ }
60
+ if (this.props.report !== prevProps.report)
61
+ this.#designer.report = this.props.report;
62
+ if (this.props.visible !== prevProps.visible)
63
+ this.#designer.visible = this.props.visible;
64
+ if (this.props.id !== prevProps.id) {
65
+ this.#createDesigner();
66
+ this.#designer.report = this.props.report;
67
+ }
68
+ }
69
+
70
+ render() {
71
+ return React.createElement('div', { ref: this.#parentRef });
72
+ }
73
+ }
74
+
75
+ export { Stimulsoft };
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { Stimulsoft } from "./stimulsoft.reports"
2
+ export { Stimulsoft }
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { } from "./stimulsoft.reports.engine.mjs";
2
+ import { } from "./stimulsoft.reports.chart.mjs";
3
+ import { } from "./stimulsoft.reports.export.mjs";
4
+ import { } from "./stimulsoft.reports.import.xlsx.mjs";
5
+ import { Stimulsoft } from "./stimulsoft.reports.maps.mjs";
6
+ export { Stimulsoft };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "stimulsoft-reports-js-react",
3
+ "version": "2025.2.1",
4
+ "description": "Stimulsoft Reports.JS is a reporting tool for React",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "type": "module",
8
+ "keywords": [
9
+ "Stimulsoft",
10
+ "Reports",
11
+ "Stimulsoft.Reports.JS",
12
+ "Reporting tool",
13
+ "Report builder",
14
+ "Report generator",
15
+ "Data visualization",
16
+ "Data analytics",
17
+ "Create reports",
18
+ "Business intelligence",
19
+ "Reporting software",
20
+ "JavaScript Report Designer",
21
+ "JavaScript Report Viewer",
22
+ "React reporting tool"
23
+ ],
24
+ "files": [
25
+ "THIRD-PARTY.md",
26
+ "LICENSE.md",
27
+ "package.json",
28
+ "README.md",
29
+ "*.d.ts",
30
+ "*.mjs",
31
+ "*.js"
32
+ ],
33
+ "author": {
34
+ "name": "Stimulsoft",
35
+ "url": "http://www.stimulsoft.com"
36
+ },
37
+ "homepage": "http://www.stimulsoft.com",
38
+ "license": "Closed Source",
39
+ "dependencies": {
40
+ "react": "^19.0.0"
41
+ }
42
+ }