@nexterajs/report-viewer 0.0.1 → 0.1.0
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.
|
@@ -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,29 @@ declare const NXR_ENGLISH: {
|
|
|
188
188
|
PrevPage: string;
|
|
189
189
|
NextPage: string;
|
|
190
190
|
LastPage: string;
|
|
191
|
+
/** The save button's caption and tooltip; its menu items are captioned by the format they write. */
|
|
192
|
+
Save: string;
|
|
193
|
+
SaveToolTip: string;
|
|
194
|
+
/** The view-mode button's tooltip, and its menu items, whose captions are the mode names. */
|
|
195
|
+
ViewModeToolTip: string;
|
|
196
|
+
SinglePage: string;
|
|
197
|
+
Continuous: string;
|
|
198
|
+
MultiplePages: string;
|
|
199
|
+
/** The zoom button's tooltip; its caption is the current percentage, so it has no key. */
|
|
200
|
+
ZoomToolTip: string;
|
|
201
|
+
ZoomOnePage: string;
|
|
202
|
+
ZoomPageWidth: string;
|
|
191
203
|
errorUnreachable: string;
|
|
192
204
|
errorStatus: string;
|
|
193
205
|
errorTimeout: string;
|
|
194
206
|
errorMalformed: string;
|
|
195
207
|
errorProtocol: string;
|
|
196
208
|
};
|
|
197
|
-
type
|
|
209
|
+
type NxeViewerStrings = Readonly<Record<keyof typeof NXE_ENGLISH, string>>;
|
|
198
210
|
|
|
199
211
|
/** What the component's `postParametersFunction` is called with: the request's action and its parameters. */
|
|
200
|
-
interface
|
|
201
|
-
action:
|
|
212
|
+
interface NxePostParametersData {
|
|
213
|
+
action: NxeViewerAction;
|
|
202
214
|
[parameter: string]: unknown;
|
|
203
215
|
}
|
|
204
216
|
/**
|
|
@@ -206,24 +218,24 @@ interface NxrPostParametersData {
|
|
|
206
218
|
* Each key of an object it returns becomes a form field of the request, replacing a field of the same
|
|
207
219
|
* name; anything else it returns adds nothing.
|
|
208
220
|
*/
|
|
209
|
-
type
|
|
221
|
+
type NxePostParametersFunction = (data: NxePostParametersData) => unknown;
|
|
210
222
|
/** What every request is built from. */
|
|
211
|
-
interface
|
|
223
|
+
interface NxeRequestContext {
|
|
212
224
|
/** The component's `requestUrl`: each request's host action takes the place of `{action}`. */
|
|
213
225
|
requestUrl: string;
|
|
214
226
|
/** The component's `properties`, sent as JSON when truthy. */
|
|
215
227
|
properties: unknown;
|
|
216
228
|
/** The component's `postParametersFunction`. */
|
|
217
|
-
postParametersFunction:
|
|
229
|
+
postParametersFunction: NxePostParametersFunction | null | undefined;
|
|
218
230
|
/** The strings failures are described with. */
|
|
219
|
-
strings:
|
|
231
|
+
strings: NxeViewerStrings;
|
|
220
232
|
}
|
|
221
233
|
|
|
222
234
|
/** The page on screen. */
|
|
223
|
-
interface
|
|
235
|
+
interface NxeShownPage {
|
|
224
236
|
/** 0-based. */
|
|
225
237
|
index: number;
|
|
226
|
-
size:
|
|
238
|
+
size: NxePageSize;
|
|
227
239
|
/** The page's HTML, or null while it has not arrived: while it is on its way, or after its request failed. */
|
|
228
240
|
html: string | null;
|
|
229
241
|
}
|
|
@@ -233,7 +245,7 @@ interface NxrShownPage {
|
|
|
233
245
|
* Every signal changes only in this service's methods and in the answers they handle; nothing reacts to
|
|
234
246
|
* a signal changing. Each viewer provides its own session, so viewers on one page never share state.
|
|
235
247
|
*/
|
|
236
|
-
declare class
|
|
248
|
+
declare class NxeViewerSessionService {
|
|
237
249
|
private readonly client;
|
|
238
250
|
private readonly optionsState;
|
|
239
251
|
private readonly reportState;
|
|
@@ -242,23 +254,29 @@ declare class NxrViewerSessionService {
|
|
|
242
254
|
private readonly pendingState;
|
|
243
255
|
private readonly failureState;
|
|
244
256
|
/** The options from the last AngularViewerData answer. */
|
|
245
|
-
readonly options: _angular_core.Signal<
|
|
257
|
+
readonly options: _angular_core.Signal<NxeViewerOptions | null>;
|
|
246
258
|
/** The report from the last GetReport answer, or null before one. */
|
|
247
|
-
readonly report: _angular_core.Signal<
|
|
259
|
+
readonly report: _angular_core.Signal<NxeReportAnswer | null>;
|
|
248
260
|
/** The 0-based index of the page on screen. */
|
|
249
261
|
readonly pageIndex: _angular_core.Signal<number>;
|
|
250
262
|
/** The failure on show, until it is dismissed. */
|
|
251
|
-
readonly failure: _angular_core.Signal<
|
|
263
|
+
readonly failure: _angular_core.Signal<NxeViewerFailure | null>;
|
|
252
264
|
/** How many pages the report has; 0 before one is loaded. */
|
|
253
265
|
readonly pageCount: _angular_core.Signal<number>;
|
|
254
266
|
/** Whether a request the user waits for is on its way. Keep-alive requests do not count. */
|
|
255
267
|
readonly busy: _angular_core.Signal<boolean>;
|
|
256
268
|
/** The page on screen, or null before a report. */
|
|
257
|
-
readonly shownPage: _angular_core.Signal<
|
|
269
|
+
readonly shownPage: _angular_core.Signal<NxeShownPage | null>;
|
|
270
|
+
/**
|
|
271
|
+
* Every page of the report, in order, each with its HTML when it has arrived. The page modes that show
|
|
272
|
+
* more than one page at a time lay these out and ask for the ones that come into view; a page holds its
|
|
273
|
+
* size, and so its place, before its HTML is here.
|
|
274
|
+
*/
|
|
275
|
+
readonly allPages: _angular_core.Signal<readonly NxeShownPage[]>;
|
|
258
276
|
/** Emits after each successful GetReport answer. */
|
|
259
277
|
readonly reportLoaded: Subject<void>;
|
|
260
278
|
/** Emits each failure put on show. */
|
|
261
|
-
readonly failed: Subject<
|
|
279
|
+
readonly failed: Subject<NxeViewerFailure>;
|
|
262
280
|
private context;
|
|
263
281
|
private session;
|
|
264
282
|
/** Every request the user waits for. */
|
|
@@ -272,12 +290,24 @@ declare class NxrViewerSessionService {
|
|
|
272
290
|
private destroyed;
|
|
273
291
|
constructor();
|
|
274
292
|
/** Opens the report the host action names, in place of whatever this viewer showed. */
|
|
275
|
-
open(context:
|
|
293
|
+
open(context: NxeRequestContext, action: string): void;
|
|
276
294
|
/**
|
|
277
295
|
* Shows the page at a 0-based index; an index outside the report is ignored. Asking for the page already
|
|
278
296
|
* on screen fetches it again when its HTML is missing, as it is after its request failed.
|
|
279
297
|
*/
|
|
280
298
|
goToPage(index: number): void;
|
|
299
|
+
/**
|
|
300
|
+
* Asks for a page's HTML without moving the page on screen, for the modes that show several pages at
|
|
301
|
+
* once and fetch the ones that come into view. A page already here, or already on its way, is left alone.
|
|
302
|
+
*/
|
|
303
|
+
requestPage(index: number): void;
|
|
304
|
+
/** Moves the page on screen without asking for it, for scroll tracking, which follows what is drawn. */
|
|
305
|
+
markCurrentPage(index: number): void;
|
|
306
|
+
/**
|
|
307
|
+
* ExportReport: the report as a file, handed to the browser to save. The export never times out, so
|
|
308
|
+
* it is tracked as a request the user waits for and the toolbar stays disabled until the file is here.
|
|
309
|
+
*/
|
|
310
|
+
exportTo(format: string): void;
|
|
281
311
|
/** Takes the failure off show. */
|
|
282
312
|
dismissFailure(): void;
|
|
283
313
|
/**
|
|
@@ -303,8 +333,8 @@ declare class NxrViewerSessionService {
|
|
|
303
333
|
/** Stops every request and the keep-alive. */
|
|
304
334
|
private close;
|
|
305
335
|
private connection;
|
|
306
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
307
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
336
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeViewerSessionService, never>;
|
|
337
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NxeViewerSessionService>;
|
|
308
338
|
}
|
|
309
339
|
|
|
310
340
|
/**
|
|
@@ -312,7 +342,7 @@ declare class NxrViewerSessionService {
|
|
|
312
342
|
* members for zoom, view mode, export, print, email and find arrive with the tasks that implement
|
|
313
343
|
* those; a host that only pages through a report needs these three.
|
|
314
344
|
*/
|
|
315
|
-
interface
|
|
345
|
+
interface NxeViewerApi {
|
|
316
346
|
/** The 0-based page on screen. Setting it shows a page inside the report and ignores anything else. */
|
|
317
347
|
currentPage: number;
|
|
318
348
|
/** How many pages the report has; 0 before one is loaded. */
|
|
@@ -329,7 +359,7 @@ interface NxrViewerApi {
|
|
|
329
359
|
*
|
|
330
360
|
* Each viewer provides its own session, so several on a page never share a report or a token.
|
|
331
361
|
*/
|
|
332
|
-
declare class
|
|
362
|
+
declare class NxeReportViewerComponent implements OnChanges {
|
|
333
363
|
/** Each request's URL, with `{action}` in place of the host action it goes to. */
|
|
334
364
|
readonly requestUrl: _angular_core.InputSignal<string>;
|
|
335
365
|
/** The host action that answers the first request, and so names the report to open. */
|
|
@@ -345,15 +375,33 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
345
375
|
/** Styles for the viewer's root element. Width, height and background take precedence over it. */
|
|
346
376
|
readonly style: _angular_core.InputSignal<string | null>;
|
|
347
377
|
/** Called for every request; each key of an object it returns becomes a form field. */
|
|
348
|
-
readonly postParametersFunction: _angular_core.InputSignal<
|
|
378
|
+
readonly postParametersFunction: _angular_core.InputSignal<NxePostParametersFunction | null>;
|
|
349
379
|
/** Emits after each report is loaded. */
|
|
350
380
|
readonly loaded: _angular_core.OutputEmitterRef<void>;
|
|
351
381
|
/** Emits every failure the viewer puts on show. */
|
|
352
|
-
readonly error: _angular_core.OutputEmitterRef<
|
|
353
|
-
protected readonly session:
|
|
382
|
+
readonly error: _angular_core.OutputEmitterRef<NxeViewerFailure>;
|
|
383
|
+
protected readonly session: NxeViewerSessionService;
|
|
354
384
|
/** Stimulsoft's `api` object: what a host calls to drive the viewer from outside. */
|
|
355
|
-
readonly api:
|
|
385
|
+
readonly api: NxeViewerApi;
|
|
356
386
|
private readonly appearance;
|
|
387
|
+
private readonly pagesBox;
|
|
388
|
+
private readonly rootBox;
|
|
389
|
+
/**
|
|
390
|
+
* The mode the pages are shown in, and the zoom they are drawn at. Both start from the server's
|
|
391
|
+
* options and are then the user's, until a new report's options arrive and reset them — which is
|
|
392
|
+
* what `linkedSignal` says and an effect would only imply.
|
|
393
|
+
*/
|
|
394
|
+
protected readonly viewMode: _angular_core.WritableSignal<NxeViewMode>;
|
|
395
|
+
protected readonly zoom: _angular_core.WritableSignal<number>;
|
|
396
|
+
/**
|
|
397
|
+
* The pages on screen: one in `SinglePage`, the whole report in the modes that scroll through it.
|
|
398
|
+
* A page carries its size before its HTML arrives, so the list holds its shape while the pages that
|
|
399
|
+
* come into view are fetched.
|
|
400
|
+
*/
|
|
401
|
+
protected readonly shownPages: _angular_core.Signal<readonly NxeShownPage[]>;
|
|
402
|
+
/** Set while a page-navigation scroll is running, so scroll tracking does not fight it. */
|
|
403
|
+
private scrollingToPage;
|
|
404
|
+
private scrollSettled;
|
|
357
405
|
protected readonly toolbarVisible: _angular_core.Signal<boolean>;
|
|
358
406
|
protected readonly pageCss: _angular_core.Signal<string>;
|
|
359
407
|
protected readonly showPageShadow: _angular_core.Signal<boolean>;
|
|
@@ -364,6 +412,17 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
364
412
|
protected readonly pagesOverflow: _angular_core.Signal<"auto" | "hidden">;
|
|
365
413
|
protected readonly rootWidth: _angular_core.Signal<string>;
|
|
366
414
|
protected readonly rootBackgroundColor: _angular_core.Signal<string>;
|
|
415
|
+
/**
|
|
416
|
+
* The height the viewer was measured to fill, once it is known.
|
|
417
|
+
*
|
|
418
|
+
* The report panel is what scrolls, as Stimulsoft's does — its panel measures 836 px against a
|
|
419
|
+
* 16 513 px report while the document itself does not scroll at all. That needs the viewer to have a
|
|
420
|
+
* definite height, and a host that asks for `100%` inside a container whose own height is automatic
|
|
421
|
+
* does not give it one: the viewer would then grow to the whole report, 29 pages of it, and the
|
|
422
|
+
* page would scroll instead of the panel. So when the height the host asked for cannot resolve, the
|
|
423
|
+
* viewer measures the room between its top and the bottom of the window and takes that.
|
|
424
|
+
*/
|
|
425
|
+
private readonly measuredHeight;
|
|
367
426
|
protected readonly rootHeight: _angular_core.Signal<string>;
|
|
368
427
|
constructor();
|
|
369
428
|
/**
|
|
@@ -372,6 +431,43 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
372
431
|
* again. Matching that keeps a host's reload behaviour the same across the swap.
|
|
373
432
|
*/
|
|
374
433
|
ngOnChanges(): void;
|
|
434
|
+
/**
|
|
435
|
+
* Page navigation. In a mode that scrolls through the whole report the page is reached by scrolling
|
|
436
|
+
* to it, over 350 ms, which is what Stimulsoft's navigation actions do; in `SinglePage` the page is
|
|
437
|
+
* simply the one shown.
|
|
438
|
+
*/
|
|
439
|
+
protected navigateTo(index: number): void;
|
|
440
|
+
/** The page number is kept and nothing scrolls, as Stimulsoft's view-mode actions leave it. */
|
|
441
|
+
protected setViewMode(mode: NxeViewMode): void;
|
|
442
|
+
/** Nothing preserves the scroll offset across a zoom change, so the visible region shifts. */
|
|
443
|
+
protected setZoom(zoom: number): void;
|
|
444
|
+
/**
|
|
445
|
+
* Fit a whole page, or a page's width, in the panel. Stimulsoft computes this once from what is on
|
|
446
|
+
* screen and stores the number as the zoom; no fit mode is remembered, so a later resize does not
|
|
447
|
+
* re-fit. The 40 px it subtracts is the panel's padding and the page's margins.
|
|
448
|
+
*/
|
|
449
|
+
protected fitTo(what: 'page' | 'width'): void;
|
|
450
|
+
/**
|
|
451
|
+
* Scrolling asks for the pages that have come into view, and, once it has stopped for 300 ms, moves
|
|
452
|
+
* the page the toolbar reports to the first one still on screen — Stimulsoft's scroll tracking.
|
|
453
|
+
*/
|
|
454
|
+
protected onScroll(): void;
|
|
455
|
+
/** The room on screen changed, so the viewer measures itself against it again. */
|
|
456
|
+
protected onWindowResize(): void;
|
|
457
|
+
/** Lets the new layout reach the DOM, then fits the viewer to it and asks for what is on screen. */
|
|
458
|
+
private afterPagesSettle;
|
|
459
|
+
/**
|
|
460
|
+
* Takes the room between the viewer's top and the bottom of the window when the height the host
|
|
461
|
+
* asked for did not resolve, so the panel inside scrolls rather than the page. Measured before the
|
|
462
|
+
* height is applied, and again only when the window changes, so it never chases its own answer.
|
|
463
|
+
*/
|
|
464
|
+
private fitToAvailableRoom;
|
|
465
|
+
/** Every page whose box meets the panel, plus one either side, so scrolling stays ahead of the eye. */
|
|
466
|
+
private requestVisiblePages;
|
|
467
|
+
/** The first page whose bottom is still below the panel's scroll offset. */
|
|
468
|
+
private trackCurrentPage;
|
|
469
|
+
/** Stimulsoft animates the panel to the page's top over 350 ms, in steps of about 30 ms. */
|
|
470
|
+
private scrollToPage;
|
|
375
471
|
/**
|
|
376
472
|
* The getters read the session's signals, so a host that asks between renders gets what is on
|
|
377
473
|
* screen now. Built from a captured session rather than `this`, because `this` inside an object
|
|
@@ -379,9 +475,9 @@ declare class NxrReportViewerComponent implements OnChanges {
|
|
|
379
475
|
*/
|
|
380
476
|
private buildApi;
|
|
381
477
|
private context;
|
|
382
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
383
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
478
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeReportViewerComponent, never>;
|
|
479
|
+
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
480
|
}
|
|
385
481
|
|
|
386
|
-
export {
|
|
387
|
-
export type {
|
|
482
|
+
export { NXE_VIEWER_PROTOCOL, NxeReportViewerComponent };
|
|
483
|
+
export type { NxePostParametersData, NxePostParametersFunction, NxeViewerApi, NxeViewerFailure };
|