@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 +16 -16
- package/README.md +98 -96
- package/fesm2022/nexterajs-report-viewer.mjs +1667 -346
- package/fesm2022/nexterajs-report-viewer.mjs.map +1 -1
- package/package.json +2 -2
- package/types/nexterajs-report-viewer.d.ts +226 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexterajs/report-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^22.0.0",
|
|
6
6
|
"@angular/core": "^22.0.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": "^22.22.3 || ^24.15.0 || >=26.0.0"
|
|
21
21
|
},
|
|
22
|
-
"description": "Angular report viewer for reports served by Nextera.
|
|
22
|
+
"description": "Angular report viewer for reports served by Nextera.Reports.Angular.NetCore: pages rendered on the server, shown in shadow roots, with a toolbar and a programmatic api.",
|
|
23
23
|
"keywords": [
|
|
24
24
|
"angular",
|
|
25
25
|
"report",
|
|
@@ -6,7 +6,7 @@ import { Subject } from 'rxjs';
|
|
|
6
6
|
* The version of the viewer protocol this package speaks: the `protocol` member of every
|
|
7
7
|
* `AngularViewerData` answer from `Nextera.Report.AspNetCore`.
|
|
8
8
|
*/
|
|
9
|
-
declare const
|
|
9
|
+
declare const NXE_VIEWER_PROTOCOL = 1;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The viewer options as `Nextera.Report.AspNetCore` sends them in the AngularViewerData answer: every
|
|
@@ -14,21 +14,21 @@ declare const NXR_VIEWER_PROTOCOL = 1;
|
|
|
14
14
|
* colours, where `null` means the theme's colour.
|
|
15
15
|
*/
|
|
16
16
|
/** How pages are laid out. */
|
|
17
|
-
type
|
|
17
|
+
type NxeViewMode = 'SinglePage' | 'Continuous' | 'MultiplePages';
|
|
18
18
|
/** Horizontal placement; `Default` is the viewer's usual placement for the element. */
|
|
19
|
-
type
|
|
19
|
+
type NxeContentAlignment = 'Left' | 'Center' | 'Right' | 'Default';
|
|
20
20
|
/** One toolbar, or page navigation and zoom in a second bar. */
|
|
21
|
-
type
|
|
21
|
+
type NxeToolbarDisplayMode = 'Simple' | 'Separated';
|
|
22
22
|
/** What opens a toolbar menu. */
|
|
23
|
-
type
|
|
23
|
+
type NxeShowMenuMode = 'Click' | 'Hover';
|
|
24
24
|
/** Which input the controls are sized for. */
|
|
25
|
-
type
|
|
25
|
+
type NxeInterfaceType = 'Auto' | 'Mouse' | 'Touch' | 'Mobile';
|
|
26
26
|
/** Where the server keeps the rendered report between requests. */
|
|
27
|
-
type
|
|
27
|
+
type NxeCacheMode = 'None' | 'ObjectCache' | 'ObjectSession' | 'StringCache' | 'StringSession';
|
|
28
28
|
/** A kept report's priority when the server's memory cache compacts. */
|
|
29
|
-
type
|
|
29
|
+
type NxeCacheItemPriority = 'Low' | 'BelowNormal' | 'Normal' | 'AboveNormal' | 'High' | 'NotRemovable';
|
|
30
30
|
/** The host's action names, each put in place of `{action}` in the component's `requestUrl`. */
|
|
31
|
-
interface
|
|
31
|
+
interface NxeViewerActions {
|
|
32
32
|
/** Answers GetReport. */
|
|
33
33
|
getReport: string;
|
|
34
34
|
/** Answers GetPages, Find and UpdateCache, unless the cache mode is `None`. */
|
|
@@ -36,28 +36,28 @@ interface NxrViewerActions {
|
|
|
36
36
|
/** Answers ExportReport; when empty, ExportReport goes where GetPages goes. */
|
|
37
37
|
exportReport: string;
|
|
38
38
|
}
|
|
39
|
-
interface
|
|
39
|
+
interface NxeAppearanceOptions {
|
|
40
40
|
allowMobileMode: boolean;
|
|
41
41
|
allowTouchZoom: boolean;
|
|
42
42
|
backgroundColor: string | null;
|
|
43
43
|
bookmarksTreeWidth: number;
|
|
44
44
|
customCss: string;
|
|
45
45
|
fullScreenMode: boolean;
|
|
46
|
-
interfaceType:
|
|
46
|
+
interfaceType: NxeInterfaceType;
|
|
47
47
|
openLinksWindow: string;
|
|
48
|
-
pageAlignment:
|
|
48
|
+
pageAlignment: NxeContentAlignment;
|
|
49
49
|
pageBorderColor: string | null;
|
|
50
50
|
rightToLeft: boolean;
|
|
51
51
|
scrollbarsMode: boolean;
|
|
52
52
|
showPageShadow: boolean;
|
|
53
53
|
showTooltips: boolean;
|
|
54
54
|
}
|
|
55
|
-
interface
|
|
56
|
-
alignment:
|
|
55
|
+
interface NxeToolbarOptions {
|
|
56
|
+
alignment: NxeContentAlignment;
|
|
57
57
|
autoHide: boolean;
|
|
58
58
|
backgroundColor: string | null;
|
|
59
59
|
borderColor: string | null;
|
|
60
|
-
displayMode:
|
|
60
|
+
displayMode: NxeToolbarDisplayMode;
|
|
61
61
|
fontColor: string | null;
|
|
62
62
|
fontFamily: string;
|
|
63
63
|
menuAnimation: boolean;
|
|
@@ -71,7 +71,7 @@ interface NxrToolbarOptions {
|
|
|
71
71
|
showFirstPageButton: boolean;
|
|
72
72
|
showFullScreenButton: boolean;
|
|
73
73
|
showLastPageButton: boolean;
|
|
74
|
-
showMenuMode:
|
|
74
|
+
showMenuMode: NxeShowMenuMode;
|
|
75
75
|
showNextPageButton: boolean;
|
|
76
76
|
showOpenButton: boolean;
|
|
77
77
|
showParametersButton: boolean;
|
|
@@ -85,78 +85,78 @@ interface NxrToolbarOptions {
|
|
|
85
85
|
showSignatureButton: boolean;
|
|
86
86
|
showViewModeButton: boolean;
|
|
87
87
|
showZoomButton: boolean;
|
|
88
|
-
viewMode:
|
|
88
|
+
viewMode: NxeViewMode;
|
|
89
89
|
visible: boolean;
|
|
90
90
|
/** The starting zoom, in percent. */
|
|
91
91
|
zoom: number;
|
|
92
92
|
}
|
|
93
|
-
interface
|
|
93
|
+
interface NxeExportOptions {
|
|
94
94
|
showExportToHtml: boolean;
|
|
95
95
|
showExportToPdf: boolean;
|
|
96
96
|
}
|
|
97
|
-
interface
|
|
97
|
+
interface NxeServerOptions {
|
|
98
98
|
allowAutoUpdateCache: boolean;
|
|
99
|
-
cacheItemPriority:
|
|
100
|
-
cacheMode:
|
|
99
|
+
cacheItemPriority: NxeCacheItemPriority;
|
|
100
|
+
cacheMode: NxeCacheMode;
|
|
101
101
|
/** Minutes a kept report survives without a request about it. */
|
|
102
102
|
cacheTimeout: number;
|
|
103
103
|
/** Seconds the viewer waits for an answer. */
|
|
104
104
|
requestTimeout: number;
|
|
105
105
|
showServerErrorPage: boolean;
|
|
106
106
|
}
|
|
107
|
-
interface
|
|
107
|
+
interface NxeViewerOptions {
|
|
108
108
|
/** A Stimulsoft viewer theme name, such as `Office2022WhiteBlue`. */
|
|
109
109
|
theme: string;
|
|
110
110
|
localization: string;
|
|
111
111
|
width: string;
|
|
112
112
|
height: string;
|
|
113
|
-
actions:
|
|
114
|
-
appearance:
|
|
115
|
-
toolbar:
|
|
116
|
-
exports:
|
|
117
|
-
server:
|
|
113
|
+
actions: NxeViewerActions;
|
|
114
|
+
appearance: NxeAppearanceOptions;
|
|
115
|
+
toolbar: NxeToolbarOptions;
|
|
116
|
+
exports: NxeExportOptions;
|
|
117
|
+
server: NxeServerOptions;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/** The value of a request's `nextera_action` field. */
|
|
121
|
-
type
|
|
122
|
-
interface
|
|
121
|
+
type NxeViewerAction = 'AngularViewerData' | 'GetReport' | 'GetPages' | 'Find' | 'ExportReport' | 'UpdateCache';
|
|
122
|
+
interface NxePageSize {
|
|
123
123
|
/** 1-based. */
|
|
124
124
|
pageNumber: number;
|
|
125
125
|
widthPoints: number;
|
|
126
126
|
heightPoints: number;
|
|
127
127
|
}
|
|
128
128
|
/** A rectangle on a page, in points from its top left corner. */
|
|
129
|
-
interface
|
|
129
|
+
interface NxeBounds {
|
|
130
130
|
x: number;
|
|
131
131
|
y: number;
|
|
132
132
|
width: number;
|
|
133
133
|
height: number;
|
|
134
134
|
}
|
|
135
|
-
interface
|
|
135
|
+
interface NxeBookmark {
|
|
136
136
|
title: string;
|
|
137
137
|
/** 0-based. */
|
|
138
138
|
pageIndex: number;
|
|
139
|
-
bounds:
|
|
139
|
+
bounds: NxeBounds;
|
|
140
140
|
}
|
|
141
141
|
/** The HTML of consecutive pages, starting at a 0-based index. */
|
|
142
|
-
interface
|
|
142
|
+
interface NxePagesAnswer {
|
|
143
143
|
startIndex: number;
|
|
144
144
|
pages: string[];
|
|
145
145
|
}
|
|
146
146
|
/** The answer to GetReport. */
|
|
147
|
-
interface
|
|
147
|
+
interface NxeReportAnswer {
|
|
148
148
|
reportName: string;
|
|
149
149
|
pageCount: number;
|
|
150
150
|
/** Every page's size, in page order. */
|
|
151
|
-
pages:
|
|
152
|
-
bookmarks:
|
|
151
|
+
pages: NxePageSize[];
|
|
152
|
+
bookmarks: NxeBookmark[];
|
|
153
153
|
/** The stylesheet every page's HTML needs. */
|
|
154
154
|
pageCss: string;
|
|
155
155
|
/** The pages GetReport was asked for, or null when it was asked for none. */
|
|
156
|
-
pagesHtml:
|
|
156
|
+
pagesHtml: NxePagesAnswer | null;
|
|
157
157
|
}
|
|
158
158
|
/** Why a request failed. */
|
|
159
|
-
interface
|
|
159
|
+
interface NxeViewerFailure {
|
|
160
160
|
/** The HTTP status of the error answer; 0 when there was none: no answer, a timeout, or an unreadable success answer. */
|
|
161
161
|
status: number;
|
|
162
162
|
/**
|
|
@@ -177,9 +177,9 @@ interface NxrViewerFailure {
|
|
|
177
177
|
* Every caption and message the viewer shows, in its built-in English. A key in PascalCase is the name
|
|
178
178
|
* Stimulsoft's viewer gives the same text, such as `PageOf`; a key in camelCase names a message only this
|
|
179
179
|
* viewer has. The English is this package's own. A later plan lets a host's translation file replace any
|
|
180
|
-
* of them, so code reads them from an `
|
|
180
|
+
* of them, so code reads them from an `NxeViewerStrings` value wherever one is at hand.
|
|
181
181
|
*/
|
|
182
|
-
declare const
|
|
182
|
+
declare const NXE_ENGLISH: {
|
|
183
183
|
/** The label before the page-number box. */
|
|
184
184
|
Page: string;
|
|
185
185
|
/** The label between the page-number box and the page count. */
|
|
@@ -188,17 +188,42 @@ declare const NXR_ENGLISH: {
|
|
|
188
188
|
PrevPage: string;
|
|
189
189
|
NextPage: string;
|
|
190
190
|
LastPage: string;
|
|
191
|
+
/** The save button's caption and tooltip, and its menu items, captioned by the format they write. */
|
|
192
|
+
Save: string;
|
|
193
|
+
SaveToolTip: string;
|
|
194
|
+
formatPdf: string;
|
|
195
|
+
formatHtml: string;
|
|
196
|
+
/** The resources button's tooltip. */
|
|
197
|
+
Resources: string;
|
|
198
|
+
/** The find button's tooltip, and the find panel's captions. */
|
|
199
|
+
FindToolTip: string;
|
|
200
|
+
FindWhat: string;
|
|
201
|
+
FindPrevious: string;
|
|
202
|
+
FindNext: string;
|
|
203
|
+
MatchCase: string;
|
|
204
|
+
MatchWholeWord: string;
|
|
205
|
+
closeFind: string;
|
|
206
|
+
/** The view-mode button's tooltip, and its menu items, whose captions are the mode names. */
|
|
207
|
+
ViewModeToolTip: string;
|
|
208
|
+
SinglePage: string;
|
|
209
|
+
Continuous: string;
|
|
210
|
+
MultiplePages: string;
|
|
211
|
+
/** The zoom button's tooltip; its caption is the current percentage, so it has no key. */
|
|
212
|
+
ZoomToolTip: string;
|
|
213
|
+
/** Fitting a whole page, which Stimulsoft's menu captions by the page's height. */
|
|
214
|
+
ZoomOnePage: string;
|
|
215
|
+
ZoomPageWidth: string;
|
|
191
216
|
errorUnreachable: string;
|
|
192
217
|
errorStatus: string;
|
|
193
218
|
errorTimeout: string;
|
|
194
219
|
errorMalformed: string;
|
|
195
220
|
errorProtocol: string;
|
|
196
221
|
};
|
|
197
|
-
type
|
|
222
|
+
type NxeViewerStrings = Readonly<Record<keyof typeof NXE_ENGLISH, string>>;
|
|
198
223
|
|
|
199
224
|
/** What the component's `postParametersFunction` is called with: the request's action and its parameters. */
|
|
200
|
-
interface
|
|
201
|
-
action:
|
|
225
|
+
interface NxePostParametersData {
|
|
226
|
+
action: NxeViewerAction;
|
|
202
227
|
[parameter: string]: unknown;
|
|
203
228
|
}
|
|
204
229
|
/**
|
|
@@ -206,24 +231,24 @@ interface NxrPostParametersData {
|
|
|
206
231
|
* Each key of an object it returns becomes a form field of the request, replacing a field of the same
|
|
207
232
|
* name; anything else it returns adds nothing.
|
|
208
233
|
*/
|
|
209
|
-
type
|
|
234
|
+
type NxePostParametersFunction = (data: NxePostParametersData) => unknown;
|
|
210
235
|
/** What every request is built from. */
|
|
211
|
-
interface
|
|
236
|
+
interface NxeRequestContext {
|
|
212
237
|
/** The component's `requestUrl`: each request's host action takes the place of `{action}`. */
|
|
213
238
|
requestUrl: string;
|
|
214
239
|
/** The component's `properties`, sent as JSON when truthy. */
|
|
215
240
|
properties: unknown;
|
|
216
241
|
/** The component's `postParametersFunction`. */
|
|
217
|
-
postParametersFunction:
|
|
242
|
+
postParametersFunction: NxePostParametersFunction | null | undefined;
|
|
218
243
|
/** The strings failures are described with. */
|
|
219
|
-
strings:
|
|
244
|
+
strings: NxeViewerStrings;
|
|
220
245
|
}
|
|
221
246
|
|
|
222
247
|
/** The page on screen. */
|
|
223
|
-
interface
|
|
248
|
+
interface NxeShownPage {
|
|
224
249
|
/** 0-based. */
|
|
225
250
|
index: number;
|
|
226
|
-
size:
|
|
251
|
+
size: NxePageSize;
|
|
227
252
|
/** The page's HTML, or null while it has not arrived: while it is on its way, or after its request failed. */
|
|
228
253
|
html: string | null;
|
|
229
254
|
}
|
|
@@ -233,7 +258,7 @@ interface NxrShownPage {
|
|
|
233
258
|
* Every signal changes only in this service's methods and in the answers they handle; nothing reacts to
|
|
234
259
|
* a signal changing. Each viewer provides its own session, so viewers on one page never share state.
|
|
235
260
|
*/
|
|
236
|
-
declare class
|
|
261
|
+
declare class NxeViewerSessionService {
|
|
237
262
|
private readonly client;
|
|
238
263
|
private readonly optionsState;
|
|
239
264
|
private readonly reportState;
|
|
@@ -242,23 +267,29 @@ declare class NxrViewerSessionService {
|
|
|
242
267
|
private readonly pendingState;
|
|
243
268
|
private readonly failureState;
|
|
244
269
|
/** The options from the last AngularViewerData answer. */
|
|
245
|
-
readonly options: _angular_core.Signal<
|
|
270
|
+
readonly options: _angular_core.Signal<NxeViewerOptions | null>;
|
|
246
271
|
/** The report from the last GetReport answer, or null before one. */
|
|
247
|
-
readonly report: _angular_core.Signal<
|
|
272
|
+
readonly report: _angular_core.Signal<NxeReportAnswer | null>;
|
|
248
273
|
/** The 0-based index of the page on screen. */
|
|
249
274
|
readonly pageIndex: _angular_core.Signal<number>;
|
|
250
275
|
/** The failure on show, until it is dismissed. */
|
|
251
|
-
readonly failure: _angular_core.Signal<
|
|
276
|
+
readonly failure: _angular_core.Signal<NxeViewerFailure | null>;
|
|
252
277
|
/** How many pages the report has; 0 before one is loaded. */
|
|
253
278
|
readonly pageCount: _angular_core.Signal<number>;
|
|
254
279
|
/** Whether a request the user waits for is on its way. Keep-alive requests do not count. */
|
|
255
280
|
readonly busy: _angular_core.Signal<boolean>;
|
|
256
281
|
/** The page on screen, or null before a report. */
|
|
257
|
-
readonly shownPage: _angular_core.Signal<
|
|
282
|
+
readonly shownPage: _angular_core.Signal<NxeShownPage | null>;
|
|
283
|
+
/**
|
|
284
|
+
* Every page of the report, in order, each with its HTML when it has arrived. The page modes that show
|
|
285
|
+
* more than one page at a time lay these out and ask for the ones that come into view; a page holds its
|
|
286
|
+
* size, and so its place, before its HTML is here.
|
|
287
|
+
*/
|
|
288
|
+
readonly allPages: _angular_core.Signal<readonly NxeShownPage[]>;
|
|
258
289
|
/** Emits after each successful GetReport answer. */
|
|
259
290
|
readonly reportLoaded: Subject<void>;
|
|
260
291
|
/** Emits each failure put on show. */
|
|
261
|
-
readonly failed: Subject<
|
|
292
|
+
readonly failed: Subject<NxeViewerFailure>;
|
|
262
293
|
private context;
|
|
263
294
|
private session;
|
|
264
295
|
/** Every request the user waits for. */
|
|
@@ -272,12 +303,24 @@ declare class NxrViewerSessionService {
|
|
|
272
303
|
private destroyed;
|
|
273
304
|
constructor();
|
|
274
305
|
/** Opens the report the host action names, in place of whatever this viewer showed. */
|
|
275
|
-
open(context:
|
|
306
|
+
open(context: NxeRequestContext, action: string): void;
|
|
276
307
|
/**
|
|
277
308
|
* Shows the page at a 0-based index; an index outside the report is ignored. Asking for the page already
|
|
278
309
|
* on screen fetches it again when its HTML is missing, as it is after its request failed.
|
|
279
310
|
*/
|
|
280
311
|
goToPage(index: number): void;
|
|
312
|
+
/**
|
|
313
|
+
* Asks for a page's HTML without moving the page on screen, for the modes that show several pages at
|
|
314
|
+
* once and fetch the ones that come into view. A page already here, or already on its way, is left alone.
|
|
315
|
+
*/
|
|
316
|
+
requestPage(index: number): void;
|
|
317
|
+
/** Moves the page on screen without asking for it, for scroll tracking, which follows what is drawn. */
|
|
318
|
+
markCurrentPage(index: number): void;
|
|
319
|
+
/**
|
|
320
|
+
* ExportReport: the report as a file, handed to the browser to save. The export never times out, so
|
|
321
|
+
* it is tracked as a request the user waits for and the toolbar stays disabled until the file is here.
|
|
322
|
+
*/
|
|
323
|
+
exportTo(format: string): void;
|
|
281
324
|
/** Takes the failure off show. */
|
|
282
325
|
dismissFailure(): void;
|
|
283
326
|
/**
|
|
@@ -303,8 +346,16 @@ declare class NxrViewerSessionService {
|
|
|
303
346
|
/** Stops every request and the keep-alive. */
|
|
304
347
|
private close;
|
|
305
348
|
private connection;
|
|
306
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
307
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
349
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeViewerSessionService, never>;
|
|
350
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NxeViewerSessionService>;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/** What the user asked the viewer to find, and which way to go from the current hit. */
|
|
354
|
+
interface NxeFindRequest {
|
|
355
|
+
readonly text: string;
|
|
356
|
+
readonly forward: boolean;
|
|
357
|
+
readonly matchCase: boolean;
|
|
358
|
+
readonly wholeWord: boolean;
|
|
308
359
|
}
|
|
309
360
|
|
|
310
361
|
/**
|
|
@@ -312,7 +363,7 @@ declare class NxrViewerSessionService {
|
|
|
312
363
|
* members for zoom, view mode, export, print, email and find arrive with the tasks that implement
|
|
313
364
|
* those; a host that only pages through a report needs these three.
|
|
314
365
|
*/
|
|
315
|
-
interface
|
|
366
|
+
interface NxeViewerApi {
|
|
316
367
|
/** The 0-based page on screen. Setting it shows a page inside the report and ignores anything else. */
|
|
317
368
|
currentPage: number;
|
|
318
369
|
/** How many pages the report has; 0 before one is loaded. */
|
|
@@ -329,7 +380,7 @@ interface NxrViewerApi {
|
|
|
329
380
|
*
|
|
330
381
|
* Each viewer provides its own session, so several on a page never share a report or a token.
|
|
331
382
|
*/
|
|
332
|
-
declare class
|
|
383
|
+
declare class NxeReportViewerComponent implements OnChanges {
|
|
333
384
|
/** Each request's URL, with `{action}` in place of the host action it goes to. */
|
|
334
385
|
readonly requestUrl: _angular_core.InputSignal<string>;
|
|
335
386
|
/** The host action that answers the first request, and so names the report to open. */
|
|
@@ -345,16 +396,48 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
345
396
|
/** Styles for the viewer's root element. Width, height and background take precedence over it. */
|
|
346
397
|
readonly style: _angular_core.InputSignal<string | null>;
|
|
347
398
|
/** Called for every request; each key of an object it returns becomes a form field. */
|
|
348
|
-
readonly postParametersFunction: _angular_core.InputSignal<
|
|
399
|
+
readonly postParametersFunction: _angular_core.InputSignal<NxePostParametersFunction | null>;
|
|
349
400
|
/** Emits after each report is loaded. */
|
|
350
401
|
readonly loaded: _angular_core.OutputEmitterRef<void>;
|
|
351
402
|
/** Emits every failure the viewer puts on show. */
|
|
352
|
-
readonly error: _angular_core.OutputEmitterRef<
|
|
353
|
-
protected readonly session:
|
|
403
|
+
readonly error: _angular_core.OutputEmitterRef<NxeViewerFailure>;
|
|
404
|
+
protected readonly session: NxeViewerSessionService;
|
|
354
405
|
/** Stimulsoft's `api` object: what a host calls to drive the viewer from outside. */
|
|
355
|
-
readonly api:
|
|
406
|
+
readonly api: NxeViewerApi;
|
|
356
407
|
private readonly appearance;
|
|
408
|
+
private readonly pagesBox;
|
|
409
|
+
private readonly rootBox;
|
|
410
|
+
/**
|
|
411
|
+
* The mode the pages are shown in, and the zoom they are drawn at. Both start from the server's
|
|
412
|
+
* options and are then the user's, until a new report's options arrive and reset them — which is
|
|
413
|
+
* what `linkedSignal` says and an effect would only imply.
|
|
414
|
+
*/
|
|
415
|
+
protected readonly viewMode: _angular_core.WritableSignal<NxeViewMode>;
|
|
416
|
+
protected readonly zoom: _angular_core.WritableSignal<number>;
|
|
417
|
+
/**
|
|
418
|
+
* The pages on screen: one in `SinglePage`, the whole report in the modes that scroll through it.
|
|
419
|
+
* A page carries its size before its HTML arrives, so the list holds its shape while the pages that
|
|
420
|
+
* come into view are fetched.
|
|
421
|
+
*/
|
|
422
|
+
protected readonly shownPages: _angular_core.Signal<readonly NxeShownPage[]>;
|
|
423
|
+
/** Set while a page-navigation scroll is running, so scroll tracking does not fight it. */
|
|
424
|
+
private scrollingToPage;
|
|
425
|
+
private scrollSettled;
|
|
357
426
|
protected readonly toolbarVisible: _angular_core.Signal<boolean>;
|
|
427
|
+
/** See `.nxe-viewer-bookmarks`: the whole of Stimulsoft's bookmarks panel at width 0. */
|
|
428
|
+
protected readonly showBookmarksStrip: _angular_core.Signal<boolean>;
|
|
429
|
+
/** Whether the find panel is open; Stimulsoft's Find button opens and closes it. */
|
|
430
|
+
protected readonly findOpen: _angular_core.WritableSignal<boolean>;
|
|
431
|
+
/** The search on show: what was looked for, the elements found, and which one is current. */
|
|
432
|
+
private findKey;
|
|
433
|
+
private hits;
|
|
434
|
+
private currentHit;
|
|
435
|
+
private lastFind;
|
|
436
|
+
/**
|
|
437
|
+
* The pages whose HTML is on screen, so a search can follow them: in SinglePage the page changes
|
|
438
|
+
* under it, and in the scrolling modes pages keep arriving as they are fetched.
|
|
439
|
+
*/
|
|
440
|
+
private readonly renderedPages;
|
|
358
441
|
protected readonly pageCss: _angular_core.Signal<string>;
|
|
359
442
|
protected readonly showPageShadow: _angular_core.Signal<boolean>;
|
|
360
443
|
protected readonly pageBorder: _angular_core.Signal<string | null>;
|
|
@@ -364,14 +447,89 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
364
447
|
protected readonly pagesOverflow: _angular_core.Signal<"auto" | "hidden">;
|
|
365
448
|
protected readonly rootWidth: _angular_core.Signal<string>;
|
|
366
449
|
protected readonly rootBackgroundColor: _angular_core.Signal<string>;
|
|
450
|
+
/**
|
|
451
|
+
* The height the viewer was measured to fill, once it is known.
|
|
452
|
+
*
|
|
453
|
+
* The report panel is what scrolls, as Stimulsoft's does — its panel measures 836 px against a
|
|
454
|
+
* 16 513 px report while the document itself does not scroll at all. That needs the viewer to have a
|
|
455
|
+
* definite height, and a host that asks for `100%` inside a container whose own height is automatic
|
|
456
|
+
* does not give it one: the viewer would then grow to the whole report, 29 pages of it, and the
|
|
457
|
+
* page would scroll instead of the panel. So when the height the host asked for cannot resolve, the
|
|
458
|
+
* viewer measures the room between its top and the bottom of the window and takes that.
|
|
459
|
+
*/
|
|
460
|
+
private readonly measuredHeight;
|
|
367
461
|
protected readonly rootHeight: _angular_core.Signal<string>;
|
|
368
462
|
constructor();
|
|
463
|
+
/** The Find button opens the panel, or closes it and takes the search's highlights away. */
|
|
464
|
+
protected toggleFind(): void;
|
|
465
|
+
protected closeFind(): void;
|
|
466
|
+
/**
|
|
467
|
+
* A search from the find panel, run as Stimulsoft runs it (angular-viewer-panels-chrome.md §1.3,
|
|
468
|
+
* §1.6): empty text clears the highlights; new text, or a changed option, finds afresh and makes the
|
|
469
|
+
* first hit current; the same search again steps to the next or previous hit, round the ends. Each
|
|
470
|
+
* current hit is scrolled into view. Stimulsoft finds only in the pages it has on screen; this viewer
|
|
471
|
+
* fetches the pages a scrolling mode has not fetched yet, and finds in them as they arrive.
|
|
472
|
+
*/
|
|
473
|
+
protected find(request: NxeFindRequest): void;
|
|
474
|
+
/** Finds again over the pages now on screen, keeping the current hit when it is still there. */
|
|
475
|
+
private refreshFind;
|
|
476
|
+
private runFind;
|
|
477
|
+
private resetFind;
|
|
478
|
+
/** Each page on screen keeps its HTML in its own shadow root. */
|
|
479
|
+
private pageRoots;
|
|
480
|
+
private requestAllPages;
|
|
481
|
+
/**
|
|
482
|
+
* Scrolls the current hit to its own height plus 50 px below the top of the report panel, over
|
|
483
|
+
* 350 ms: always after a fresh search, and after a step only when the hit is out of view. That is
|
|
484
|
+
* what Stimulsoft's viewer was seen to do; the exact place it scrolls to also carries offsets of its
|
|
485
|
+
* own page markup, which this viewer's pages do not have.
|
|
486
|
+
*/
|
|
487
|
+
private revealHit;
|
|
369
488
|
/**
|
|
370
489
|
* A change to any input reloads, as Stimulsoft's viewer does: its `ngOnChanges` never looks at
|
|
371
490
|
* which input changed, so even a width change asks the server for the options and the report
|
|
372
491
|
* again. Matching that keeps a host's reload behaviour the same across the swap.
|
|
373
492
|
*/
|
|
374
493
|
ngOnChanges(): void;
|
|
494
|
+
/**
|
|
495
|
+
* Page navigation. In a mode that scrolls through the whole report the page is reached by scrolling
|
|
496
|
+
* to it, over 350 ms, which is what Stimulsoft's navigation actions do; in `SinglePage` the page is
|
|
497
|
+
* simply the one shown.
|
|
498
|
+
*/
|
|
499
|
+
protected navigateTo(index: number): void;
|
|
500
|
+
/** The page number is kept and nothing scrolls, as Stimulsoft's view-mode actions leave it. */
|
|
501
|
+
protected setViewMode(mode: NxeViewMode): void;
|
|
502
|
+
/** Nothing preserves the scroll offset across a zoom change, so the visible region shifts. */
|
|
503
|
+
protected setZoom(zoom: number): void;
|
|
504
|
+
/**
|
|
505
|
+
* Fit a whole page, or a page's width, in the panel. Stimulsoft computes this once from what is on
|
|
506
|
+
* screen and stores the number as the zoom; no fit mode is remembered, so a later resize does not
|
|
507
|
+
* re-fit. The 40 px it subtracts is the panel's padding and the page's margins.
|
|
508
|
+
*/
|
|
509
|
+
protected fitTo(what: 'page' | 'width'): void;
|
|
510
|
+
/**
|
|
511
|
+
* Scrolling asks for the pages that have come into view, and, once it has stopped for 300 ms, moves
|
|
512
|
+
* the page the toolbar reports to the first one still on screen — Stimulsoft's scroll tracking.
|
|
513
|
+
*/
|
|
514
|
+
protected onScroll(): void;
|
|
515
|
+
/** The room on screen changed, so the viewer measures itself against it again. */
|
|
516
|
+
protected onWindowResize(): void;
|
|
517
|
+
/** Lets the new layout reach the DOM, then fits the viewer to it and asks for what is on screen. */
|
|
518
|
+
private afterPagesSettle;
|
|
519
|
+
/**
|
|
520
|
+
* Takes the room between the viewer's top and the bottom of the window when the height the host
|
|
521
|
+
* asked for did not resolve, so the panel inside scrolls rather than the page. Measured before the
|
|
522
|
+
* height is applied, and again only when the window changes, so it never chases its own answer.
|
|
523
|
+
*/
|
|
524
|
+
private fitToAvailableRoom;
|
|
525
|
+
/** Every page whose box meets the panel, plus one either side, so scrolling stays ahead of the eye. */
|
|
526
|
+
private requestVisiblePages;
|
|
527
|
+
/** The first page whose bottom is still below the panel's scroll offset. */
|
|
528
|
+
private trackCurrentPage;
|
|
529
|
+
/** Stimulsoft animates the panel to the page's top over 350 ms, in steps of about 30 ms. */
|
|
530
|
+
private scrollToPage;
|
|
531
|
+
/** Scrolls the report panel over 350 ms in steps of about 30 ms, as Stimulsoft's scrolls all run. */
|
|
532
|
+
private animateScroll;
|
|
375
533
|
/**
|
|
376
534
|
* The getters read the session's signals, so a host that asks between renders gets what is on
|
|
377
535
|
* screen now. Built from a captured session rather than `this`, because `this` inside an object
|
|
@@ -379,9 +537,9 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
379
537
|
*/
|
|
380
538
|
private buildApi;
|
|
381
539
|
private context;
|
|
382
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
383
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
540
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeReportViewerComponent, never>;
|
|
541
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NxeReportViewerComponent, "nxe-report-viewer", never, { "requestUrl": { "alias": "requestUrl"; "required": false; "isSignal": true; }; "action": { "alias": "action"; "required": false; "isSignal": true; }; "properties": { "alias": "properties"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "postParametersFunction": { "alias": "postParametersFunction"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "error": "error"; }, never, never, true, never>;
|
|
384
542
|
}
|
|
385
543
|
|
|
386
|
-
export {
|
|
387
|
-
export type {
|
|
544
|
+
export { NXE_VIEWER_PROTOCOL, NxeReportViewerComponent };
|
|
545
|
+
export type { NxePostParametersData, NxePostParametersFunction, NxeViewerApi, NxeViewerFailure };
|