@nexterajs/report-viewer 0.0.1 → 0.1.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/NOTICE CHANGED
@@ -1,16 +1,16 @@
1
- @nexterajs/report-viewer
2
- Copyright 2026 Nextera
3
-
4
- This product includes software developed at Nextera.
5
-
6
- Licensed under the Apache License, Version 2.0 (the "License");
7
- you may not use these files except in compliance with the License.
8
- You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing, software
13
- distributed under the License is distributed on an "AS IS" BASIS,
14
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- See the License for the specific language governing permissions and
16
- limitations under the License.
1
+ @nexterajs/report-viewer
2
+ Copyright 2026 Nextera
3
+
4
+ This product includes software developed at Nextera.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use these files except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
package/README.md CHANGED
@@ -1,96 +1,98 @@
1
- # @nexterajs/report-viewer
2
-
3
- An Angular viewer for reports served by `Nextera.Reports.Angular.NetCore`. The server renders each report once and keeps
4
- it; the viewer asks for the pages it shows and places each one in its own shadow root, so a report's styles never reach
5
- the application around it.
6
-
7
- Its inputs, outputs and `api` are the ones `stimulsoft-viewer-angular` has, so a host swaps the component and keeps its
8
- bindings.
9
-
10
- ## Install
11
-
12
- ```bash
13
- npm install @nexterajs/report-viewer
14
- ```
15
-
16
- Angular 22 and RxJS 7.8 are peer dependencies. The viewer sends its requests through the application's `HttpClient`, so
17
- the application's interceptors apply — provide `HttpClient` as usual.
18
-
19
- ## Use
20
-
21
- ```ts
22
- import { NxrReportViewerComponent } from '@nexterajs/report-viewer';
23
-
24
- @Component({
25
- imports: [NxrReportViewerComponent],
26
- template: `
27
- <nxr-report-viewer
28
- requestUrl="/api/core/{action}"
29
- action="generate-report?id1=INVOICE"
30
- width="100%"
31
- height="800px"
32
- (loaded)="onLoaded()"
33
- (error)="onError($event)"
34
- />
35
- `,
36
- })
37
- export class ReportPageComponent {}
38
- ```
39
-
40
- `requestUrl` is the URL of every request, with `{action}` in place of the host action it goes to. `action` is the host
41
- action that answers the first request, and so names the report to open. On the server, that action calls
42
- `NexteraAngularViewer.ViewerDataResult`, and the two actions it names in its options answer the rest — see
43
- `docs/viewer-protocol.md` in `nexteradigital/nextera-report`.
44
-
45
- ### Inputs
46
-
47
- | Input | What it is |
48
- |---|---|
49
- | `requestUrl` | Each request's URL, with `{action}` in it |
50
- | `action` | The host action that opens the report |
51
- | `properties` | Sent to the host with every request, as JSON, when truthy |
52
- | `width` | The viewer's width; `100%` when not given |
53
- | `height` | The viewer's height; 650px when the report panel scrolls, else `100%` |
54
- | `backgroundColor` | The viewer's background; `White` when not given |
55
- | `style` | Styles for the viewer's root; width, height and background take precedence |
56
- | `postParametersFunction` | Called for every request; each key of an object it returns becomes a form field |
57
-
58
- A change to any input reloads the report, as Stimulsoft's viewer does.
59
-
60
- ### Outputs
61
-
62
- | Output | Payload |
63
- |---|---|
64
- | `loaded` | Fires after each report is loaded |
65
- | `error` | The failure the viewer put on show (`NxrViewerFailure`) |
66
-
67
- ### `api`
68
-
69
- `viewer.api.currentPage` reads and writes the 0-based page on screen; `pagesCount` and `reportType` are read-only.
70
-
71
- ## What this version does
72
-
73
- Opening a report, showing its pages, paging through it with the toolbar's first / previous / next / last buttons and the
74
- page box, and the page frame the server's options describe (`pageAlignment`, `showPageShadow`, `pageBorderColor`,
75
- `scrollbarsMode`). Failures are shown and announced, an expired report is rendered again, and an open viewer keeps its
76
- report alive on the server.
77
-
78
- Not here yet: zoom, the view modes beyond one page at a time, find, bookmarks, parameters, export, print, email, full
79
- screen, themes and translations. Each arrives with its task in `BACKLOG.md` (Stage 2) in
80
- `nexteradigital/nextera-report`.
81
-
82
- ## Development
83
-
84
- ```bash
85
- npm run build:report-viewer
86
- npm run test:report-viewer
87
- npm run protocol:check
88
- ```
89
-
90
- The specs replay conversations recorded against the real server by the report repository (`tests/protocol` in
91
- `nexteradigital/nextera-report`). The copy in `testing/protocol` is written only by the sync script, and CI checks it
92
- against the SHA-256 manifest it came with. To take a new recording:
93
-
94
- ```bash
95
- node tools/report-protocol/sync.mjs --from <path to the nextera-report checkout>
96
- ```
1
+ # @nexterajs/report-viewer
2
+
3
+ An Angular viewer for reports served by `Nextera.Reports.Angular.NetCore`. The server renders each report once and keeps
4
+ it; the viewer asks for the pages it shows and places each one in its own shadow root, so a report's styles never reach
5
+ the application around it.
6
+
7
+ Its inputs, outputs and `api` are the ones `stimulsoft-viewer-angular` has, so a host swaps the component and keeps its
8
+ bindings.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install @nexterajs/report-viewer
14
+ ```
15
+
16
+ Angular 22 and RxJS 7.8 are peer dependencies. The viewer sends its requests through the application's `HttpClient`, so
17
+ the application's interceptors apply — provide `HttpClient` as usual.
18
+
19
+ ## Use
20
+
21
+ ```ts
22
+ import { NxeReportViewerComponent } from '@nexterajs/report-viewer';
23
+
24
+ @Component({
25
+ imports: [NxeReportViewerComponent],
26
+ template: `
27
+ <nxe-report-viewer
28
+ requestUrl="/api/core/{action}"
29
+ action="generate-report?id1=INVOICE"
30
+ width="100%"
31
+ height="800px"
32
+ (loaded)="onLoaded()"
33
+ (error)="onError($event)"
34
+ />
35
+ `,
36
+ })
37
+ export class ReportPageComponent {}
38
+ ```
39
+
40
+ `requestUrl` is the URL of every request, with `{action}` in place of the host action it goes to. `action` is the host
41
+ action that answers the first request, and so names the report to open. On the server, that action calls
42
+ `NexteraAngularViewer.ViewerDataResult`, and the two actions it names in its options answer the rest — see
43
+ `docs/viewer-protocol.md` in `nexteradigital/nextera-report`.
44
+
45
+ ### Inputs
46
+
47
+ | Input | What it is |
48
+ |---|---|
49
+ | `requestUrl` | Each request's URL, with `{action}` in it |
50
+ | `action` | The host action that opens the report |
51
+ | `properties` | Sent to the host with every request, as JSON, when truthy |
52
+ | `width` | The viewer's width; `100%` when not given |
53
+ | `height` | The viewer's height; 650px when the report panel scrolls, else `100%` |
54
+ | `backgroundColor` | The viewer's background; `White` when not given |
55
+ | `style` | Styles for the viewer's root; width, height and background take precedence |
56
+ | `postParametersFunction` | Called for every request; each key of an object it returns becomes a form field |
57
+
58
+ A change to any input reloads the report, as Stimulsoft's viewer does.
59
+
60
+ ### Outputs
61
+
62
+ | Output | Payload |
63
+ |---|---|
64
+ | `loaded` | Fires after each report is loaded |
65
+ | `error` | The failure the viewer put on show (`NxeViewerFailure`) |
66
+
67
+ ### `api`
68
+
69
+ `viewer.api.currentPage` reads and writes the 0-based page on screen; `pagesCount` and `reportType` are read-only.
70
+
71
+ ## What this version does
72
+
73
+ Opening a report, showing its pages, and the toolbar Stimulsoft's viewer draws, with the same rules for what is shown
74
+ and enabled: paging with the first / previous / next / last buttons and the page box; zoom (fixed percentages, Page
75
+ Height and Page Width); the Single Page, Continuous and Multiple Pages view modes; Find, with Match Case and Match Whole
76
+ Word; and Save to PDF or HTML, for the formats the server turns on. The page frame follows the server's options
77
+ (`pageAlignment`, `showPageShadow`, `pageBorderColor`, `scrollbarsMode`). Failures are shown and announced, an expired
78
+ report is rendered again, and an open viewer keeps its report alive on the server.
79
+
80
+ Not here yet: bookmarks, parameters, print, open, email, full screen, the editor, themes and translations of the
81
+ viewer's own captions. Each arrives with its task in `BACKLOG.md` (Stage 2) in
82
+ `nexteradigital/nextera-report`.
83
+
84
+ ## Development
85
+
86
+ ```bash
87
+ npm run build:report-viewer
88
+ npm run test:report-viewer
89
+ npm run protocol:check
90
+ ```
91
+
92
+ The specs replay conversations recorded against the real server by the report repository (`tests/protocol` in
93
+ `nexteradigital/nextera-report`). The copy in `testing/protocol` is written only by the sync script, and CI checks it
94
+ against the SHA-256 manifest it came with. To take a new recording:
95
+
96
+ ```bash
97
+ node tools/report-protocol/sync.mjs --from <path to the nextera-report checkout>
98
+ ```