@progress/telerik-react-report-viewer 27.25.1001 → 28.25.1111

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.
@@ -8,6 +8,804 @@ require("../dependencies/initExtDeps");
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _telerikReportViewer = require("../dependencies/telerikReportViewer.js");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Defines options for configuring report parameter editors in the React Report Viewer.
13
+ *
14
+ * @typedef {Object} ParametersOptions
15
+ * @property {Object} [editors] - Allows you to specify the editor type for single-value and multi-value report parameters.
16
+ * @property {string} [editors.singleSelect="LIST_VIEW"] - Editor type for single-value parameters.
17
+ * - "COMBO_BOX": Uses a ComboBox widget as the editor.
18
+ * - "LIST_VIEW": Uses a ListView widget as the editor.
19
+ * - Default: "LIST_VIEW"
20
+ * @property {string} [editors.multiSelect="LIST_VIEW"] - Editor type for multi-value parameters.
21
+ * - "COMBO_BOX": Uses a MultiSelect widget as the editor.
22
+ * - "LIST_VIEW": Uses a ListView widget as the editor.
23
+ * - Default: "LIST_VIEW"
24
+ *
25
+ * @example
26
+ * // React: Specify editor types for report parameters
27
+ *
28
+ * <TelerikReportViewer
29
+ * serviceUrl="api/reports/"
30
+ * reportSource={{ report: "Dashboard.trdp" }}
31
+ * parameters={{
32
+ * editors: {
33
+ * singleSelect: "COMBO_BOX",
34
+ * multiSelect: "LIST_VIEW"
35
+ * }
36
+ * }}
37
+ * />
38
+ */
39
+
40
+ /**
41
+ * Describes an interactive action triggered by the user in the report viewer.
42
+ * The shape of the `Value` property depends on the action `Type`.
43
+ *
44
+ * @typedef {Object} InteractiveAction
45
+ * @property {string} Id - The identifier of the action (a GUID).
46
+ * @property {string} Type - The type of the action. One of:
47
+ * "sorting", "toggleVisibility", "navigateToUrl", "navigateToBookmark", "navigateToReport", "customAction".
48
+ * @property {string} ReportItemName - The name of the report item associated with the action.
49
+ * @property {Object} [Value] - Additional data for the action, depending on the Type:
50
+ * - For "navigateToUrl": { Url: string, Target: "NewWindow"|"SameWindow" }
51
+ * - For "navigateToBookmark": string (the target bookmark)
52
+ * - For "navigateToReport": { report: string, parameters: Object }
53
+ * - For "customAction": { Parameters: Object }
54
+ */
55
+
56
+ /**
57
+ * Configuration for connecting to a Telerik Report Server instance.
58
+ *
59
+ * The authentication method depends on the Report Server version:
60
+ * - Report Server for .NET: Supports Token authentication (getPersonalAccessToken) or username/password authentication. The token can be from any user, including the Guest user.
61
+ * - Report Server for .NET Framework 4.6.2: Supports username/password authentication or Guest account (url only, if Guest is enabled on the server).
62
+ *
63
+ * @typedef {Object} ReportServer
64
+ * @property {string} url - The URL to the Telerik Report Server instance. (required)
65
+ * @property {function} [getPersonalAccessToken] - A callback function that returns the Token for authentication against the Telerik Report Server for .NET instance wrapped in a Promise. This is the recommended authentication method for Report Server for .NET. The token can be from any user account, including the Guest user. Only supported by Report Server for .NET. (optional)
66
+ * @property {string} [username] - A registered username in the Report Server that will be used to get access to the reports. Supported by both Report Server for .NET and Report Server for .NET Framework 4.6.2. If omitted when connecting to Report Server for .NET Framework 4.6.2 with Guest enabled, the built-in Guest account will be used. (optional)
67
+ * @property {string} [password] - The password for the provided username. Supported by both Report Server for .NET and Report Server for .NET Framework 4.6.2. Can be omitted only when connecting with the Guest account to Report Server for .NET Framework 4.6.2. (optional)
68
+ *
69
+ * @example <propertyName>getPersonalAccessToken</propertyName>
70
+ * // Example: Report Server for .NET - Token authentication (recommended)
71
+ * <TelerikReportViewer
72
+ * reportServer={{
73
+ * url: "https://my-report-server-net/",
74
+ * getPersonalAccessToken: function() {
75
+ * return Promise.resolve("<personal-access-token>");
76
+ * }
77
+ * }}
78
+ * reportSource={{ report: "Samples/Dashboard" }}
79
+ * />
80
+ *
81
+ * @example <propertyName>getPersonalAccessToken</propertyName>
82
+ * // Example: Report Server for .NET - Token authentication with a secure endpoint
83
+ * <TelerikReportViewer
84
+ * reportServer={{
85
+ * url: "https://my-report-server-net/",
86
+ * getPersonalAccessToken: function() {
87
+ * return fetch('/rs-token')
88
+ * .then(response => response.text());
89
+ * }
90
+ * }}
91
+ * reportSource={{ report: "Samples/Dashboard" }}
92
+ * />
93
+ *
94
+ * @example <propertyName>getPersonalAccessToken</propertyName>
95
+ * // Example: Report Server for .NET - Token authentication with Guest user token
96
+ * <TelerikReportViewer
97
+ * reportServer={{
98
+ * url: "https://my-report-server-net/",
99
+ * getPersonalAccessToken: function() {
100
+ * return Promise.resolve("<guest-user-token>");
101
+ * }
102
+ * }}
103
+ * reportSource={{ report: "Samples/Dashboard" }}
104
+ * />
105
+ *
106
+ * @example <propertyName>username</propertyName>
107
+ * // Example: Report Server for .NET - Username/password authentication
108
+ * <TelerikReportViewer
109
+ * reportServer={{
110
+ * url: "https://my-report-server-net/",
111
+ * username: "myUser",
112
+ * password: "myPassword"
113
+ * }}
114
+ * reportSource={{ report: "Samples/Dashboard" }}
115
+ * />
116
+ *
117
+ * @example <propertyName>username</propertyName>
118
+ * // Example: Report Server for .NET Framework 4.6.2 - Username/password authentication
119
+ * <TelerikReportViewer
120
+ * reportServer={{
121
+ * url: "https://my-report-server-framework/",
122
+ * username: "myUser",
123
+ * password: "myPassword"
124
+ * }}
125
+ * reportSource={{ report: "Samples/Dashboard" }}
126
+ * />
127
+ *
128
+ * @example <propertyName>url</propertyName>
129
+ * // Example: Report Server for .NET Framework 4.6.2 - Guest account (requires Guest enabled on server)
130
+ * <TelerikReportViewer
131
+ * reportServer={{
132
+ * url: "https://my-report-server-framework/"
133
+ * }}
134
+ * reportSource={{ report: "Samples/Dashboard" }}
135
+ * />
136
+ *
137
+ * @example <propertyName>reportServer</propertyName>
138
+ * // Example: Complete Report Viewer initialization with Report Server for .NET using Token authentication
139
+ * <TelerikReportViewer
140
+ * reportServer={{
141
+ * url: "https://my-report-server-net/",
142
+ * getPersonalAccessToken: function() {
143
+ * return Promise.resolve("<personal-access-token>");
144
+ * }
145
+ * }}
146
+ * reportSource={{
147
+ * report: "Samples/Dashboard",
148
+ * parameters: {
149
+ * ReportYear: 2004
150
+ * }
151
+ * }}
152
+ * />
153
+ */
154
+
155
+ /**
156
+ * Configuration object that identifies the report to be displayed and provides initial parameter values.
157
+ * @typedef {Object} ReportSource
158
+ * @property {string} [report] - A string that represents a report on the server. On the server side, this string will be converted to a ReportSource through an IReportResolver. This may be an assembly qualified type name that can be converted to TypeReportSource, a path to a report definition file (.trdp/.trdx) as in the UriReportSource, or even a report id that a dedicated IReportSourceResolver will use to read the report definition stored in a database. When using the viewer with Report Server, the report should be provided in the format: "{Category}/{ReportName}".
159
+ * @property {ReportParameters} [parameters] - A JSON object with properties name/value equal to the report parameters' names and values used in the report definition.
160
+ *
161
+ * @example <propertyName>report</propertyName>
162
+ * // Example: Minimal report source with only the report name
163
+ * const reportSource = {
164
+ * report: "MyReport"
165
+ * };
166
+ *
167
+ * @example <propertyName>parameters</propertyName>
168
+ * // Example: Report source with parameters
169
+ * const reportSource = {
170
+ * report: "SalesReport",
171
+ * parameters: {
172
+ * StartDate: "2024-01-01",
173
+ * EndDate: "2024-12-31",
174
+ * Region: "North America"
175
+ * }
176
+ * };
177
+ *
178
+ * @example <propertyName>report</propertyName>
179
+ * // Example: Report Server format
180
+ * const reportSource = {
181
+ * report: "Finance/MonthlyReport"
182
+ * };
183
+ *
184
+ * @example
185
+ * // Example: Using ReportSource with the React Report Viewer
186
+ * <TelerikReportViewer
187
+ * serviceUrl="api/reports/"
188
+ * reportSource={{
189
+ * report: "InventoryReport",
190
+ * parameters: {
191
+ * Category: "Electronics",
192
+ * InStock: true
193
+ * }
194
+ * }}
195
+ * />
196
+ */
197
+
198
+ /**
199
+ * @typedef {Object.<string, any>} ReportParameters
200
+ * An object where each property name corresponds to a report parameter's name,
201
+ * and the value is the value assigned to that parameter as used in the report definition.
202
+ *
203
+ * @example
204
+ * {
205
+ * "StartDate": "2024-01-01",
206
+ * "EndDate": "2024-12-31",
207
+ * "Category": "Books"
208
+ * }
209
+ */
210
+
211
+ /**
212
+ * Configuration options for the Send Email feature in the Report Viewer.
213
+ * Allows customization of the email dialog, default values, and available document formats when sending a report via email.
214
+ *
215
+ * @typedef {Object} SendEmailOptions
216
+ * @property {boolean} enabled - Indicates whether to show the Send Mail Message toolbar button. Default value: false.
217
+ * @property {string} [from] - E-mail address used for the MailMessage FROM value.
218
+ * @property {string} [to] - E-mail address used for the MailMessage TO value.
219
+ * @property {string} [cc] - E-mail address used for the MailMessage Carbon Copy value.
220
+ * @property {string} [subject] - A string used for the MailMessage Subject value.
221
+ * @property {string} [body] - Sentences used for the MailMessage Content value.
222
+ * @property {string} [format] - The preselected report document format.
223
+ *
224
+ * @example
225
+ * // Enable Send Email with default values and PDF as the default format
226
+ * <TelerikReportViewer
227
+ * serviceUrl="api/reports/"
228
+ * reportSource={{ report: "Dashboard.trdp" }}
229
+ * sendEmail={{
230
+ * enabled: true,
231
+ * from: "reports@company.com",
232
+ * to: "recipient@domain.com",
233
+ * cc: "manager@domain.com",
234
+ * subject: "Monthly Sales Report",
235
+ * body: "Please find the attached monthly sales report.",
236
+ * format: "PDF"
237
+ * }}
238
+ * />
239
+ *
240
+ * @example
241
+ * // Basic email configuration with minimal options
242
+ * <TelerikReportViewer
243
+ * serviceUrl="api/reports/"
244
+ * reportSource={{ report: "Dashboard.trdp" }}
245
+ * sendEmail={{
246
+ * enabled: true,
247
+ * from: "noreply@company.com"
248
+ * }}
249
+ * />
250
+ */
251
+
252
+ /**
253
+ * Represents the API of a parameter editor instance returned by createEditor.
254
+ * @typedef {Object} ParameterEditorInstance
255
+ * @property {function(Object):void} beginEdit - Creates the editor UI and populates it with the parameter settings.
256
+ * @property {function(Object):void} addAccessibility - Adds accessibility to the parameter editor and populates its string resources.
257
+ * @property {function(Object):void} setAccessibilityErrorState - Sets the error state of the parameter editor's accessibility functionality and its error attributes.
258
+ * @property {function(boolean):void} enable - Enables or disables the parameter editor.
259
+ * @property {function():void} [clearPendingChange] - Invoked when parameter changes (optional, not present on all editors).
260
+ * @property {function():void} [destroy] - Invoked to destroy the parameter editor (optional, not present on all editors).
261
+ */
262
+
263
+ /**
264
+ * Describes a parameter editor for the Telerik Report Viewer parameter panel.
265
+ * @typedef {Object} ParameterEditor
266
+ * @property {function(Object): boolean} match - Determines if the editor is suitable for the parameter.
267
+ * @property {function(HTMLElement, Object): ParameterEditorInstance} createEditor - Creates the editor UI.
268
+ * @example
269
+ * // Example: Custom match function for single-select parameters
270
+ * var match = function(parameter) {
271
+ * // Use parameter properties to determine if this editor should be used
272
+ * return Boolean(parameter.availableValues) && !parameter.multivalue;
273
+ * };
274
+ *
275
+ * @example
276
+ * // Example: Custom createEditor function using Kendo DateTimePicker
277
+ * function match(parameter) {
278
+ * return parameter.type === "System.DateTime";
279
+ * }
280
+ *
281
+ * function createEditor(placeholder, options) {
282
+ * var dateTimePicker = $(placeholder).html('<input type="datetime"/>'),
283
+ * parameter,
284
+ * valueChangedCallback = options.parameterChanged,
285
+ * dropDownList;
286
+ * function onChange() {
287
+ * var val = dropDownList.value();
288
+ * valueChangedCallback(parameter, val);
289
+ * }
290
+ * return {
291
+ * beginEdit: function (param) {
292
+ * parameter = param;
293
+ * $(dateTimePicker).find("input").kendoDateTimePicker({
294
+ * dataTextField: "name",
295
+ * dataValueField: "value",
296
+ * value: parameter.value,
297
+ * dataSource: parameter.availableValues,
298
+ * change: onChange
299
+ * });
300
+ * dropDownList = $(dateTimePicker).find("input").data("kendoDateTimePicker");
301
+ * }
302
+ * };
303
+ * }
304
+ *
305
+ * @example
306
+ * // Example: Registering the custom ParameterEditor
307
+ * ParameterEditors.push({
308
+ * match: match,
309
+ * createEditor: createEditor
310
+ * });
311
+ *
312
+ */
313
+
314
+ /**
315
+ * @typedef {Object} TelerikReportViewerProps
316
+ * @description Configuration props for the TelerikReportViewer React component.
317
+ * @property {string} [id] - Sets the unique identifier of the ReportViewer instance. If not specified, the id of the target HTML element will be used (if such is set). The id of the ReportViewer is used to identify the client session of the viewer when persistSession is enabled (true).
318
+ * @example <propertyName>id</propertyName>
319
+ * // Set a custom viewer ID
320
+ * <TelerikReportViewer
321
+ * serviceUrl="api/reports/"
322
+ * reportSource={{ report: "Dashboard.trdp" }}
323
+ * id="myUniqueViewer"
324
+ * />
325
+ *
326
+ * @property {string} [serviceUrl] - Sets the address of the Report REST Service. Required if reportServer is not provided.
327
+ * @example <propertyName>serviceUrl</propertyName>
328
+ * // Set the service URL for the report viewer
329
+ * <TelerikReportViewer
330
+ * serviceUrl="api/reports/"
331
+ * reportSource={{ report: "Dashboard.trdp" }}
332
+ * />
333
+ *
334
+ * @property {ReportServer} [reportServer] - Sets the configuration details for Telerik Report Server. Required if serviceUrl is not provided.
335
+ * @example <propertyName>reportServer</propertyName>
336
+ * // Use Report Server authentication with Token (recommended for RS.NET)
337
+ * <TelerikReportViewer
338
+ * reportServer={{
339
+ * url: "https://yourReportServerUrl:port",
340
+ * getPersonalAccessToken: function() {
341
+ * return Promise.resolve("<personal-access-token>");
342
+ * }
343
+ * }}
344
+ * reportSource={{ report: "Samples/Dashboard" }}
345
+ * />
346
+ *
347
+ * @example <propertyName>reportServer</propertyName>
348
+ * // Use Report Server authentication with username/password (not recommended)
349
+ * <TelerikReportViewer
350
+ * reportServer={{
351
+ * url: "https://myserver.com/",
352
+ * username: "reportuser",
353
+ * password: "password123"
354
+ * }}
355
+ * reportSource={{ report: "Finance/Dashboard" }}
356
+ * />
357
+ *
358
+ * @property {string} [templateUrl] - Sets the address of the html page that contains the viewer templates. If omitted, the default template will be downloaded from the REST service. Note: Internally mapped to trvTemplateUrl property.
359
+ * @example <propertyName>templateUrl</propertyName>
360
+ * // Use a custom template
361
+ * <TelerikReportViewer
362
+ * serviceUrl="api/reports/"
363
+ * reportSource={{ report: "Dashboard.trdp" }}
364
+ * templateUrl="/templates/customViewer.html"
365
+ * />
366
+ *
367
+ * @property {ReportSource} [reportSource] - Sets the report and initial report parameter values for the viewer to be displayed.
368
+ * @example <propertyName>reportSource</propertyName>
369
+ * // Basic report source
370
+ * <TelerikReportViewer
371
+ * serviceUrl="api/reports/"
372
+ * reportSource={{ report: "Dashboard.trdp" }}
373
+ * />
374
+ *
375
+ * @example
376
+ * <propertyName>reportSource</propertyName>
377
+ * // Report source with parameters
378
+ * <TelerikReportViewer
379
+ * serviceUrl="api/reports/"
380
+ * reportSource={{
381
+ * report: "SalesReport.trdp",
382
+ * parameters: { StartDate: "2024-01-01", EndDate: "2024-12-31" }
383
+ * }}
384
+ * />
385
+ *
386
+ * @example
387
+ * <propertyName>reportSource</propertyName>
388
+ * // Report Server format
389
+ * <TelerikReportViewer
390
+ * reportServer={{ url: "https://myserver/" }}
391
+ * reportSource={{ report: "Finance/MonthlyReport" }}
392
+ * />
393
+ *
394
+ * @property {SendEmailOptions} [sendEmail] - Configuration for the Send Mail Message feature.
395
+ * @example <propertyName>sendEmail</propertyName>
396
+ * // Enable send email with default values
397
+ * <TelerikReportViewer
398
+ * serviceUrl="api/reports/"
399
+ * reportSource={{ report: "Dashboard.trdp" }}
400
+ * sendEmail={{
401
+ * enabled: true,
402
+ * from: "reports@company.com",
403
+ * to: "recipient@domain.com",
404
+ * subject: "Monthly Report",
405
+ * format: "PDF"
406
+ * }}
407
+ * />
408
+ *
409
+ * @property {number} [scale] - Sets the scale factor for the report pages. The scale takes effect when scaleMode is set to "SPECIFIC". Default value is 1.0 (100%).
410
+ * @example <propertyName>scale</propertyName>
411
+ * // Set zoom to 150%
412
+ * <TelerikReportViewer
413
+ * serviceUrl="api/reports/"
414
+ * reportSource={{ report: "Dashboard.trdp" }}
415
+ * scale={1.5}
416
+ * scaleMode="SPECIFIC"
417
+ * />
418
+ *
419
+ * @property {string} [scaleMode] - Sets how the report pages are scaled. Available options: "FIT_PAGE_WIDTH" (pages scaled to fit entire width), "FIT_PAGE" (pages scaled to fit entire page), "SPECIFIC" (pages scaled with scale value). Default value is "FIT_PAGE".
420
+ * @example <propertyName>scaleMode</propertyName>
421
+ * // Fit page width
422
+ * <TelerikReportViewer
423
+ * serviceUrl="api/reports/"
424
+ * reportSource={{ report: "Dashboard.trdp" }}
425
+ * scaleMode="FIT_PAGE_WIDTH"
426
+ * />
427
+ *
428
+ * @property {string} [viewMode] - Sets if the report is displayed in interactive mode or in print preview. Available values: "INTERACTIVE" (enables drill-down interactivity), "PRINT_PREVIEW" (paged according to page settings). Default value is "INTERACTIVE".
429
+ * @example <propertyName>viewMode</propertyName>
430
+ * // Set view mode to print preview
431
+ * <TelerikReportViewer
432
+ * serviceUrl="api/reports/"
433
+ * reportSource={{ report: "Dashboard.trdp" }}
434
+ * viewMode="PRINT_PREVIEW"
435
+ * />
436
+ *
437
+ * @property {string} [pageMode] - Sets if the report is displayed in Single page or Continuous scroll mode. Available values: "SINGLE_PAGE" (only one page loaded), "CONTINUOUS_SCROLL" (multiple pages loaded). Default value is "CONTINUOUS_SCROLL".
438
+ * @example <propertyName>pageMode</propertyName>
439
+ * // Set page mode to single page
440
+ * <TelerikReportViewer
441
+ * serviceUrl="api/reports/"
442
+ * reportSource={{ report: "Dashboard.trdp" }}
443
+ * pageMode="SINGLE_PAGE"
444
+ * />
445
+ *
446
+ * @property {boolean} [persistSession] - Sets whether the viewer's client session is persisted between page refreshes (e.g., postback). The session is stored in the browser's sessionStorage and is available for the duration of the page session. Default value is false.
447
+ * @example <propertyName>persistSession</propertyName>
448
+ * // Enable session persistence
449
+ * <TelerikReportViewer
450
+ * serviceUrl="api/reports/"
451
+ * reportSource={{ report: "Dashboard.trdp" }}
452
+ * persistSession={true}
453
+ * id="myConstantId"
454
+ * />
455
+ *
456
+ * @property {ParametersOptions} [parameters] - Allows the user to define parameter options for the report parameters.
457
+ * @example <propertyName>parameters</propertyName>
458
+ * // Configure parameter editors
459
+ * <TelerikReportViewer
460
+ * serviceUrl="api/reports/"
461
+ * reportSource={{ report: "Dashboard.trdp" }}
462
+ * parameters={{
463
+ * editors: {
464
+ * singleSelect: "COMBO_BOX",
465
+ * multiSelect: "LIST_VIEW"
466
+ * }
467
+ * }}
468
+ * />
469
+ *
470
+ * @property {ParameterEditor} [parameterEditors] - Allows the user to define custom editors for the report parameters.
471
+ * @example <propertyName>parameterEditors</propertyName>
472
+ * // Register custom parameter editors
473
+ * const customEditors = [{
474
+ * match: function(param) { return param.name === "MyParam"; },
475
+ * createEditor: function(placeholder, options) { return {}; }
476
+ * }];
477
+ * // Use with component: parameterEditors={customEditors}
478
+ *
479
+ * @property {string} [authenticationToken] - If provided, a Bearer token will be set in the Authorization header for every request to the REST service.
480
+ * @example <propertyName>authenticationToken</propertyName>
481
+ * // Set authentication token
482
+ * const token = "YOUR_AUTH_TOKEN";
483
+ * // Use with component: authenticationToken={token}
484
+ *
485
+ * @property {string} [printMode] - Specifies how the viewer should print reports. Available values: "AUTO_SELECT" (automatically decide based on browser), "FORCE_PDF_FILE" (download as PDF file), "FORCE_PDF_PLUGIN" (use PDF plug-in). Default value is "AUTO_SELECT".
486
+ * @example <propertyName>printMode</propertyName>
487
+ * // Force PDF file for printing
488
+ * // Use with component: printMode="FORCE_PDF_FILE"
489
+ *
490
+ * @property {string} [selector] - A selector used in conjunction with the data- attributes. Whenever a command is attached to an element outside of the report viewer via the data-attributes this selector must be provided.
491
+ * @example <propertyName>selector</propertyName>
492
+ * // Set a custom selector for external commands
493
+ * // Use with component: selector="#customToolbar"
494
+ *
495
+ * @property {string} [disabledButtonClass] - A class used in conjunction with the data- attributes. Whenever a command is in the disabled state this class will be added to the respective button.
496
+ * @example <propertyName>disabledButtonClass</propertyName>
497
+ * // Custom disabled button styling
498
+ * // Use with component: disabledButtonClass="btn-disabled"
499
+ *
500
+ * @property {string} [checkedButtonClass] - A class used in conjunction with the data- attributes. Whenever a command is in the checked state this class will be added to the respective button.
501
+ * @example <propertyName>checkedButtonClass</propertyName>
502
+ * // Custom checked button styling
503
+ * // Use with component: checkedButtonClass="btn-active"
504
+ *
505
+ * @property {boolean} [enableAccessibility] - Determines whether the viewer should provide support for accessibility features. Default value is false.
506
+ * @example <propertyName>enableAccessibility</propertyName>
507
+ * // Enable accessibility features
508
+ * // Use with component: enableAccessibility={true}
509
+ * <TelerikReportViewer
510
+ * serviceUrl="api/reports/"
511
+ * reportSource={{ report: "Dashboard.trdp" }}
512
+ * enableAccessibility={true}
513
+ * />
514
+ *
515
+ * @property {boolean} [parametersAreaVisible] - Determines whether the viewer's parameters area is displayed if any parameter editor exists.
516
+ * @example <propertyName>parametersAreaVisible</propertyName>
517
+ * // Hide parameters area
518
+ * <TelerikReportViewer
519
+ * serviceUrl="api/reports/"
520
+ * reportSource={{ report: "Dashboard.trdp" }}
521
+ * parametersAreaVisible={false}
522
+ * />
523
+ *
524
+ * @property {boolean} [documentMapVisible] - Determines whether the viewer's document map is displayed if any bookmark is defined.
525
+ * @example <propertyName>documentMapVisible</propertyName>
526
+ * // Show document map
527
+ * <TelerikReportViewer
528
+ * serviceUrl="api/reports/"
529
+ * reportSource={{ report: "Dashboard.trdp" }}
530
+ * documentMapVisible={true}
531
+ * />
532
+ *
533
+ * @property {string} [parametersAreaPosition] - Specifies where the Parameters Area should be displayed. Available values: "RIGHT", "TOP", "LEFT", "BOTTOM". Default value is "RIGHT".
534
+ * @example <propertyName>parametersAreaPosition</propertyName>
535
+ * // Place parameters area on the left
536
+ * <TelerikReportViewer
537
+ * serviceUrl="api/reports/"
538
+ * reportSource={{ report: "Dashboard.trdp" }}
539
+ * parametersAreaPosition="LEFT"
540
+ * />
541
+ *
542
+ * @property {string} [documentMapAreaPosition] - Specifies where the Document Map should be displayed. Available values: "RIGHT", "LEFT". Default value is "LEFT".
543
+ * @example <propertyName>documentMapAreaPosition</propertyName>
544
+ * // Place document map on the right
545
+ * <TelerikReportViewer
546
+ * serviceUrl="api/reports/"
547
+ * reportSource={{ report: "Dashboard.trdp" }}
548
+ * documentMapAreaPosition="RIGHT"
549
+ * />
550
+ *
551
+ * @property {boolean} [searchMetadataOnDemand] - Determines whether the search metadata will be delivered on demand (true) or by default (false). Default value is false.
552
+ * @example <propertyName>searchMetadataOnDemand</propertyName>
553
+ * // Enable search metadata on demand
554
+ * <TelerikReportViewer
555
+ * serviceUrl="api/reports/"
556
+ * reportSource={{ report: "Dashboard.trdp" }}
557
+ * searchMetadataOnDemand={true}
558
+ * />
559
+ *
560
+ * @property {string} [initialPageAreaImageUrl] - The image URL for the PageArea background image. Used only when the parameter values are missing or invalid. The image should be in PNG, GIF, or JPG file format.
561
+ * @example <propertyName>initialPageAreaImageUrl</propertyName>
562
+ * // Set a background image for empty page area
563
+ * <TelerikReportViewer
564
+ * serviceUrl="api/reports/"
565
+ * reportSource={{ report: "Dashboard.trdp" }}
566
+ * initialPageAreaImageUrl="/images/reportBackground.png"
567
+ * />
568
+ *
569
+ * @property {boolean} [keepClientAlive] - Determines whether the client will be kept alive. Default value is true.
570
+ * @example <propertyName>keepClientAlive</propertyName>
571
+ * // Keep client alive
572
+ * <TelerikReportViewer
573
+ * serviceUrl="api/reports/"
574
+ * reportSource={{ report: "Dashboard.trdp" }}
575
+ * keepClientAlive={true}
576
+ * />
577
+ *
578
+ * @property {Object} [viewerContainerStyle] - CSS styles to apply to the viewer container div.
579
+ * @example <propertyName>viewerContainerStyle</propertyName>
580
+ * // Set container styles
581
+ * <TelerikReportViewer
582
+ * serviceUrl="api/reports/"
583
+ * reportSource={{ report: "Dashboard.trdp" }}
584
+ * viewerContainerStyle={{
585
+ * width: '100%',
586
+ * height: '600px',
587
+ * border: '1px solid #ccc'
588
+ * }}
589
+ * />
590
+ *
591
+ * @property {function} [ready] - A callback function that is called when the viewer content has been loaded from the template and is ready to display reports or perform any other operations.
592
+ * @example <propertyName>ready</propertyName>
593
+ * // Ready callback
594
+ * <TelerikReportViewer
595
+ * serviceUrl="api/reports/"
596
+ * reportSource={{ report: "Dashboard.trdp" }}
597
+ * ready={() => console.log("Report viewer is ready")}
598
+ * />
599
+ *
600
+ * @property {function} [exportBegin] - Called before exporting the report. Receives two parameters: `e` (the event object) and `args` (an object with properties: `format` (string), `deviceInfo` (object), and `handled` (boolean, set to true to prevent the default export)).
601
+ * @example <propertyName>exportBegin</propertyName>
602
+ * // Export begin handler
603
+ * <TelerikReportViewer
604
+ * serviceUrl="api/reports/"
605
+ * reportSource={{ report: "Dashboard.trdp" }}
606
+ * exportBegin={(e, args) => {
607
+ * console.log("Exporting report in format: " + args.format);
608
+ * }}
609
+ * />
610
+ *
611
+ * @property {function} [exportEnd] - Called after exporting the report. Receives two parameters: `e` (the event object) and `args` (an object with properties: `url` (string), `format` (string), `handled` (boolean), and `windowOpenTarget` (string)).
612
+ * @example <propertyName>exportEnd</propertyName>
613
+ * // Export end handler
614
+ * <TelerikReportViewer
615
+ * serviceUrl="api/reports/"
616
+ * reportSource={{ report: "Dashboard.trdp" }}
617
+ * exportEnd={(e, args) => {
618
+ * args.windowOpenTarget = "_blank";
619
+ * console.log("The exported report can be found at " + args.url);
620
+ * }}
621
+ * />
622
+ *
623
+ * @property {function} [printBegin] - Called before printing the report. Receives two parameters: `e` (the event object) and `args` (an object with properties: `deviceInfo` (object), and `handled` (boolean)).
624
+ * @example <propertyName>printBegin</propertyName>
625
+ * // Print begin handler
626
+ * <TelerikReportViewer
627
+ * serviceUrl="api/reports/"
628
+ * reportSource={{ report: "Dashboard.trdp" }}
629
+ * printBegin={(e, args) => {
630
+ * console.log("About to print the report.");
631
+ * }}
632
+ * />
633
+ *
634
+ * @property {function} [printEnd] - Called after printing the report. Receives two parameters: `e` (the event object) and `args` (an object with properties: `url` (string), and `handled` (boolean)).
635
+ * @example <propertyName>printEnd</propertyName>
636
+ * // Print end handler
637
+ * <TelerikReportViewer
638
+ * serviceUrl="api/reports/"
639
+ * reportSource={{ report: "Dashboard.trdp" }}
640
+ * printEnd={(e, args) => {
641
+ * console.log("The printed report can be found at " + args.url);
642
+ * }}
643
+ * />
644
+ *
645
+ * @property {function} [renderingBegin] - Called before rendering the report (preview only, not for export or print). Receives two parameters: `e` (the event object) and `args` (an object with property: `deviceInfo` (object)).
646
+ * @example <propertyName>renderingBegin</propertyName>
647
+ * // Rendering begin handler
648
+ * <TelerikReportViewer
649
+ * serviceUrl="api/reports/"
650
+ * reportSource={{ report: "Dashboard.trdp" }}
651
+ * renderingBegin={(e, args) => {
652
+ * // The deviceInfo property can be used to pass a specific culture to the REST Service so it renders the report with it.
653
+ * const culture = "yourCulture";
654
+ * args.deviceInfo["CurrentCulture"] = culture;
655
+ * args.deviceInfo["CurrentUICulture"] = culture;
656
+ * console.log("About to render the report.");
657
+ * }}
658
+ * />
659
+ *
660
+ * @property {function} [renderingEnd] - Called after rendering the report. Receives two parameters: `e` (the event object) and `args` (an object with properties: `bookmarkNodes` (array), `documentMapAvailable` (boolean), `documentMapNodes` (array), `documentReady` (boolean), and `pageCount` (number)).
661
+ * @example <propertyName>renderingEnd</propertyName>
662
+ * // Rendering end handler
663
+ * <TelerikReportViewer
664
+ * serviceUrl="api/reports/"
665
+ * reportSource={{ report: "Dashboard.trdp" }}
666
+ * renderingEnd={(e, args) => {
667
+ * console.log("The rendered report is " + (args.documentReady ? "" : "not ") + "ready.");
668
+ * console.log("The rendered report has " + args.pageCount + " pages.");
669
+ * }}
670
+ * />
671
+ *
672
+ * @property {function} [sendEmailBegin] - Called before the report is exported and the E-mail message is sent. Receives two parameters: `e` (the event object) and `args` (an object with properties: `deviceInfo` (object), `handled` (boolean), and `format` (string)).
673
+ * @example <propertyName>sendEmailBegin</propertyName>
674
+ * // Send email begin handler
675
+ * <TelerikReportViewer
676
+ * serviceUrl="api/reports/"
677
+ * reportSource={{ report: "Dashboard.trdp" }}
678
+ * sendEmailBegin={(e, args) => {
679
+ * console.log("About to export and send report in format: " + args.format);
680
+ * }}
681
+ * />
682
+ *
683
+ * @property {function} [sendEmailEnd] - Called after the report is exported and before the E-mail message is sent. Receives two parameters: `e` (the event object) and `args` (an object with properties: `handled` (boolean), `from` (string), `to` (string), `cc` (string), `format` (string), `subject` (string), `body` (string), and `url` (string)).
684
+ * @example <propertyName>sendEmailEnd</propertyName>
685
+ * // Send email end handler
686
+ * <TelerikReportViewer
687
+ * serviceUrl="api/reports/"
688
+ * reportSource={{ report: "Dashboard.trdp" }}
689
+ * sendEmailEnd={(e, args) => {
690
+ * args.format = "XLS";
691
+ * console.log("The exported report can be found at " + args.url);
692
+ * }}
693
+ * />
694
+ *
695
+ * @property {function} [updateUi] - Called when the state of the viewer changes. Receives one parameter: `e` (the event object).
696
+ * @example <propertyName>updateUi</propertyName>
697
+ * // Update UI handler
698
+ * <TelerikReportViewer
699
+ * serviceUrl="api/reports/"
700
+ * reportSource={{ report: "Dashboard.trdp" }}
701
+ * updateUi={(e) => {
702
+ * console.log("Viewer UI state changed.");
703
+ * }}
704
+ * />
705
+ *
706
+ * @property {function} [pageReady] - Called after a page of the report is ready. Receives two parameters: `e` (the event object) and `args` (an object with property: `pageContent` (string)).
707
+ * @example <propertyName>pageReady</propertyName>
708
+ * // Page ready handler
709
+ * <TelerikReportViewer
710
+ * serviceUrl="api/reports/"
711
+ * reportSource={{ report: "Dashboard.trdp" }}
712
+ * pageReady={(e, args) => {
713
+ * console.log("The content of the page is: " + args.pageContent);
714
+ * }}
715
+ * />
716
+ *
717
+ * @property {function} [error] - Called when an error occurs. Receives two parameters: `e` (the event object) and `args` (a string containing the error message).
718
+ * @example <propertyName>error</propertyName>
719
+ * // Error handler
720
+ * <TelerikReportViewer
721
+ * serviceUrl="api/reports/"
722
+ * reportSource={{ report: "Dashboard.trdp" }}
723
+ * error={(e, args) => {
724
+ * console.log("The error message is: " + args);
725
+ * }}
726
+ * />
727
+ *
728
+ * @property {function} [interactiveActionExecuting] - Called before an interactive action executes, allowing cancellation. Receives two parameters: `e` (the event object) and `args` (an object with properties: `element` (DOM element), `action` ({@link InteractiveAction}), and `cancel` (boolean, set to true to cancel the action)).
729
+ * @example <propertyName>interactiveActionExecuting</propertyName>
730
+ * // Interactive action executing handler
731
+ * <TelerikReportViewer
732
+ * serviceUrl="api/reports/"
733
+ * reportSource={{ report: "Dashboard.trdp" }}
734
+ * interactiveActionExecuting={(e, args) => {
735
+ * if (args.action.Type === "navigateToUrl") {
736
+ * const url = args.action.Value.Url;
737
+ * const target = args.action.Value.Target;
738
+ * }
739
+ * }}
740
+ * />
741
+ *
742
+ * @property {function} [interactiveActionEnter] - Called when entering an interactive action area. Receives two parameters: `e` (the event object) and `args` (an object with properties: `element` (DOM element), `action` ({@link InteractiveAction})).
743
+ * @example <propertyName>interactiveActionEnter</propertyName>
744
+ * // Interactive action enter handler
745
+ * <TelerikReportViewer
746
+ * serviceUrl="api/reports/"
747
+ * reportSource={{ report: "Dashboard.trdp" }}
748
+ * interactiveActionEnter={(e, args) => {
749
+ * if (args.action.Type === "sorting") {
750
+ * // Custom logic for sorting action
751
+ * }
752
+ * }}
753
+ * />
754
+ *
755
+ * @property {function} [interactiveActionLeave] - Called when leaving an interactive action area. Receives two parameters: `e` (the event object) and `args` (an object with properties: `element` (DOM element), `action` ({@link InteractiveAction})).
756
+ * @example <propertyName>interactiveActionLeave</propertyName>
757
+ * // Interactive action leave handler
758
+ * <TelerikReportViewer
759
+ * serviceUrl="api/reports/"
760
+ * reportSource={{ report: "Dashboard.trdp" }}
761
+ * interactiveActionLeave={(e, args) => {
762
+ * if (args.action.Type === "toggleVisibility") {
763
+ * // Custom logic for toggleVisibility action
764
+ * }
765
+ * }}
766
+ * />
767
+ *
768
+ * @property {function} [viewerToolTipOpening] - Called before a tooltip is opened, allowing cancellation. Receives two parameters: `e` (the event object) and `args` (an object with properties: `element` (DOM element), `toolTip` (object with `title` and `text`), and `cancel` (boolean, set to true to cancel the tooltip)).
769
+ * @example <propertyName>viewerToolTipOpening</propertyName>
770
+ * // Viewer tooltip opening handler
771
+ * <TelerikReportViewer
772
+ * serviceUrl="api/reports/"
773
+ * reportSource={{ report: "Dashboard.trdp" }}
774
+ * viewerToolTipOpening={(e, args) => {
775
+ * // Example: disable tooltip if title contains '2004'
776
+ * args.cancel = (/2004/i.test(args.toolTip.title));
777
+ * }}
778
+ * />
779
+ */
780
+
781
+ /**
782
+ * React wrapper component for the Telerik HTML5 Report Viewer.
783
+ * Provides a React-friendly interface to the Telerik Report Viewer functionality.
784
+ *
785
+ * @class TelerikReportViewer
786
+ * @extends {React.Component}
787
+ * @param {TelerikReportViewerProps} props - Configuration props for the component.
788
+ * @example
789
+ * // Basic usage
790
+ * <TelerikReportViewer
791
+ * serviceUrl="api/reports/"
792
+ * reportSource={{ report: "Dashboard.trdp" }}
793
+ * viewerContainerStyle={{ width: '100%', height: '600px' }}
794
+ * />
795
+ *
796
+ * @example
797
+ * // With parameters and event handlers
798
+ * <TelerikReportViewer
799
+ * serviceUrl="api/reports/"
800
+ * reportSource={{
801
+ * report: "SalesReport",
802
+ * parameters: { StartDate: "2024-01-01", EndDate: "2024-12-31" }
803
+ * }}
804
+ * ready={() => console.log("Report viewer is ready")}
805
+ * error={(e, args) => console.error("Error:", args)}
806
+ * viewerContainerStyle={{ width: '100%', height: '800px' }}
807
+ * />
808
+ */
11
809
  class TelerikReportViewer extends _react.default.Component {
12
810
  constructor() {
13
811
  super();
@@ -78,66 +876,662 @@ class TelerikReportViewer extends _react.default.Component {
78
876
  ref: el => this.el = el
79
877
  });
80
878
  }
879
+
880
+ /**
881
+ * Reloads/refreshes the current report.
882
+ * @function
883
+ * @returns {TelerikReportViewer} The current ReportViewer object.
884
+ * @example
885
+ * // Using ref to call refreshReport
886
+ * const reportViewerRef = useRef();
887
+ * <TelerikReportViewer ref={reportViewerRef} serviceUrl="api/reports/" reportSource={{ report: "Dashboard.trdp" }} />
888
+ * // ...
889
+ * reportViewerRef.current.refreshReport();
890
+ */
81
891
  refreshReport() {
82
892
  return this.viewerObject.refreshReport();
83
893
  }
894
+
895
+ /**
896
+ * Gets the current ReportSource - report and parameters.
897
+ * @function
898
+ * @returns {{report: string, parameters: Object}} An object with properties: report (string), parameters (JSON).
899
+ * @example
900
+ * // Get current report source
901
+ * const reportSource = reportViewerRef.current.getReportSource();
902
+ * console.log("Current report:", reportSource.report);
903
+ * console.log("Current parameters:", reportSource.parameters);
904
+ */
84
905
  getReportSource() {
85
906
  return this.viewerObject.reportSource();
86
907
  }
908
+
909
+ /**
910
+ * Sets the report source - report and parameters. Automatically reloads the report (if any) into the view.
911
+ * @function
912
+ * @param {{report: string, parameters: Object}} rs - The report source object to set. Object with properties: report (string) and parameters (JSON).
913
+ * @returns {TelerikReportViewer} The current ReportViewer object.
914
+ * @example
915
+ * // Set a new report source
916
+ * reportViewerRef.current.setReportSource({
917
+ * report: "SalesReport",
918
+ * parameters: { StartDate: "2024-01-01", EndDate: "2024-12-31" }
919
+ * });
920
+ */
87
921
  setReportSource(rs) {
88
922
  return this.viewerObject.reportSource(rs);
89
923
  }
924
+
925
+ /**
926
+ * Gets the current view mode.
927
+ * @function
928
+ * @returns {string} The current view mode.
929
+ * @example
930
+ * // Get current view mode
931
+ * const viewMode = reportViewerRef.current.getViewMode();
932
+ * console.log("Current view mode:", viewMode);
933
+ */
90
934
  getViewMode() {
91
935
  return this.viewerObject.viewMode();
92
936
  }
937
+
938
+ /**
939
+ * Sets the view mode and automatically reloads the current report (if any) into the new view.
940
+ * @function
941
+ * @param {string} vm - The view mode to set.
942
+ * @returns {TelerikReportViewer} The current ReportViewer object.
943
+ * @example
944
+ * // Set view mode to print preview
945
+ * reportViewerRef.current.setViewMode("PRINT_PREVIEW");
946
+ */
93
947
  setViewMode(vm) {
94
948
  return this.viewerObject.viewMode(vm);
95
949
  }
950
+
951
+ /**
952
+ * Gets the viewer’s scale factor and scale mode.
953
+ * @function
954
+ * @returns {{scale: number, scaleMode: string}} An object with properties: scale (number), scaleMode (string).
955
+ * @example
956
+ * // Get current scale and scale mode
957
+ * const scaleInfo = reportViewerRef.current.getScale();
958
+ * console.log("Scale:", scaleInfo.scale, "Scale mode:", scaleInfo.scaleMode);
959
+ */
96
960
  getScale() {
97
961
  return this.viewerObject.scale();
98
962
  }
963
+
964
+ /**
965
+ * Sets the scale factor and scale mode.
966
+ * @function
967
+ * @param {{scale: number, scaleMode: string}} scale - The scale object to set.
968
+ * @returns {TelerikReportViewer} The current ReportViewer object.
969
+ * @example
970
+ * // Set scale to 150% and mode to SPECIFIC
971
+ * reportViewerRef.current.setScale({ scale: 1.5, scaleMode: "SPECIFIC" });
972
+ */
99
973
  setScale(scale) {
100
974
  return this.viewerObject.scale(scale);
101
975
  }
976
+
977
+ /**
978
+ * Gets the total page count of viewer’s currently displayed report.
979
+ * @function
980
+ * @returns {number} The total page count.
981
+ * @example
982
+ * // Get total page count
983
+ * const totalPages = reportViewerRef.current.pageCount();
984
+ * console.log("Total pages:", totalPages);
985
+ */
102
986
  pageCount() {
103
987
  return this.viewerObject.pageCount();
104
988
  }
989
+
990
+ /**
991
+ * Gets the viewer’s current page that is displayed.
992
+ * @function
993
+ * @returns {number} The current page number (1-based).
994
+ * @example
995
+ * // Get current page number
996
+ * const currentPage = reportViewerRef.current.currentPage();
997
+ * console.log("Current page:", currentPage);
998
+ */
105
999
  currentPage() {
106
1000
  return this.viewerObject.currentPage();
107
1001
  }
1002
+
1003
+ /**
1004
+ * Sets the authentication token.
1005
+ * @function
1006
+ * @param {string} token - The authentication token to set.
1007
+ * @returns {TelerikReportViewer} The current ReportViewer object.
1008
+ * @example
1009
+ * // Set authentication token
1010
+ * reportViewerRef.current.setAuthenticationToken("YOUR_AUTH_TOKEN");
1011
+ */
108
1012
  setAuthenticationToken(token) {
109
1013
  return this.viewerObject.authenticationToken(token);
110
1014
  }
1015
+
1016
+ /**
1017
+ * Gets the shortcut keys used when the report viewer is in accessible mode (enableAccessibility=true).
1018
+ * @function
1019
+ * @returns {Object} The current accessibility key map.
1020
+ * @example
1021
+ * // Get accessibility key map
1022
+ * const keyMap = reportViewerRef.current.getAccessibilityKeyMap();
1023
+ * if (keyMap) {
1024
+ * console.log("Accessibility key map:", keyMap);
1025
+ * }
1026
+ */
111
1027
  getAccessibilityKeyMap() {
112
1028
  return this.viewerObject.accessibilityKeyMap();
113
1029
  }
1030
+
1031
+ /**
1032
+ * Sets the shortcut keys used when the report viewer is in accessible mode. It is recommended to set the new key map when the report rendering is complete, because the accessibility routines require the report viewer template to be loaded.
1033
+ * @function
1034
+ * @param {Object} keyMap - The key map object with keyboard shortcuts.
1035
+ * @returns {TelerikReportViewer} The current ReportViewer object.
1036
+ * @example
1037
+ * // Set custom accessibility key map
1038
+ * reportViewerRef.current.setAccessibilityKeyMap({
1039
+ * CONFIRM_KEY: 13,
1040
+ * MENU_AREA_KEY: 77,
1041
+ * CONTENT_AREA_KEY: 67,
1042
+ * PARAMETERS_AREA_KEY: 80,
1043
+ * DOCUMENT_MAP_AREA_KEY: 68
1044
+ * });
1045
+ */
114
1046
  setAccessibilityKeyMap(keyMap) {
115
1047
  return this.viewerObject.accessibilityKeyMap(keyMap);
116
1048
  }
1049
+
1050
+ /**
1051
+ * Binds an event handler to the specified event.
1052
+ * @function
1053
+ * @param {string} eventName - The name of the event to bind to.
1054
+ * @param {function} eventHandler - The handler function to invoke when the event occurs.
1055
+ * @example
1056
+ * // Bind to pageReady event
1057
+ * reportViewerRef.current.bind("pageReady", (e, args) => {
1058
+ * console.log("Page is ready!", args);
1059
+ * });
1060
+ *
1061
+ * @example
1062
+ * // Bind to error event
1063
+ * reportViewerRef.current.bind("error", (e, args) => {
1064
+ * console.error("Report viewer error:", args);
1065
+ * });
1066
+ */
117
1067
  bind(eventName, eventHandler) {
118
1068
  this.viewerObject.bind(eventName, eventHandler);
119
1069
  }
1070
+
1071
+ /**
1072
+ * Unbinds an event handler from the specified event.
1073
+ * @function
1074
+ * @param {string} eventName - The name of the event to unbind from.
1075
+ * @param {function} [eventHandler] - The handler function to remove. If omitted, all handlers are removed.
1076
+ * @example
1077
+ * // Unbind specific handler
1078
+ * reportViewerRef.current.unbind("error", myErrorHandler);
1079
+ *
1080
+ * @example
1081
+ * // Unbind all handlers for an event
1082
+ * reportViewerRef.current.unbind("pageReady");
1083
+ */
120
1084
  unbind(eventName, eventHandler) {
121
1085
  this.viewerObject.unbind(eventName, eventHandler);
122
1086
  }
1087
+
1088
+ /**
1089
+ * Unbinds all event handlers from the specified event.
1090
+ * @function
1091
+ * @param {string} eventName - The name of the event to unbind all handlers from.
1092
+ * @example
1093
+ * // Unbind all error handlers
1094
+ * reportViewerRef.current.unbindAll("error");
1095
+ */
123
1096
  unbindAll(eventName) {
124
1097
  this.viewerObject.unbind(eventName);
125
1098
  }
1099
+
1100
+ /**
1101
+ * Gets the current page mode of the viewer.
1102
+ * @function
1103
+ * @returns {string} The current page mode (e.g., "SINGLE_PAGE" or "CONTINUOUS_SCROLL").
1104
+ * @example
1105
+ * // Get current page mode
1106
+ * const pageMode = reportViewerRef.current.getPageMode();
1107
+ * console.log("Current page mode:", pageMode);
1108
+ */
126
1109
  getPageMode() {
127
1110
  return this.viewerObject.pageMode();
128
1111
  }
1112
+
1113
+ /**
1114
+ * Sets the page mode of the viewer.
1115
+ * @function
1116
+ * @param {string} psm - The page mode to set (use PageModes constants).
1117
+ * @returns {*} The result from the underlying report viewer's pageMode method.
1118
+ * @example
1119
+ * // Set page mode to single page
1120
+ * reportViewerRef.current.setPageMode("SINGLE_PAGE");
1121
+ */
129
1122
  setPageMode(psm) {
130
1123
  return this.viewerObject.pageMode(psm);
131
1124
  }
1125
+
1126
+ /**
1127
+ * Clears the current reportSource from the viewer internal state and from its persisted session in the browser. Called in order to force the viewer to respect the newly set reportSource on the next postback.
1128
+ * @function
1129
+ * @returns {void}
1130
+ * @example
1131
+ * // Clear report source before setting a new one
1132
+ * reportViewerRef.current.clearReportSource();
1133
+ * reportViewerRef.current.setReportSource({ report: "NewReport" });
1134
+ */
132
1135
  clearReportSource() {
133
1136
  return this.viewerObject.clearReportSource();
134
1137
  }
1138
+
1139
+ /**
1140
+ * Stops sending keep alive requests to the server, if keep client alive was enabled. Disposes the viewer instance, cleaning up resources and event handlers. Should be called when the component is unmounted or no longer needed.
1141
+ * @function
1142
+ * @returns {void}
1143
+ * @example
1144
+ * // Manually dispose the viewer
1145
+ * reportViewerRef.current.dispose();
1146
+ */
135
1147
  dispose() {
136
1148
  return this.viewerObject.dispose();
137
1149
  }
1150
+
1151
+ /**
1152
+ * Returns an immutable array of name-value objects representing the current evaluated report parameters.
1153
+ * @function
1154
+ * @returns {Array<{name: string, value: any}>} Array containing the name and the value of each report parameter.
1155
+ * @example
1156
+ * // Get current report parameters
1157
+ * const parameters = reportViewerRef.current.getReportParameters();
1158
+ * parameters.forEach(param => {
1159
+ * console.log(`Parameter ${param.name}: ${param.value}`);
1160
+ * });
1161
+ */
138
1162
  getReportParameters() {
139
1163
  return this.viewerObject.getReportParameters();
140
1164
  }
141
1165
  }
142
1166
  exports.TelerikReportViewer = TelerikReportViewer;
143
- var _default = exports.default = TelerikReportViewer;
1167
+ var _default = exports.default = TelerikReportViewer;
1168
+ /**
1169
+ * Represents a command that can be executed on the report viewer.
1170
+ * Each command is an object with the following methods:
1171
+ * - exec(): Executes the command (optionally with parameters).
1172
+ * - enabled(): Returns a boolean indicating if the command is currently enabled.
1173
+ * - checked(): Returns a boolean indicating if the command is in a checked state (for toggle commands).
1174
+ *
1175
+ * @typedef {Object} ReportViewerCommand
1176
+ * @property {Function} exec - Executes the command. Some commands accept parameters (see below).
1177
+ * @property {Function} enabled - Returns whether the command is currently enabled.
1178
+ * @property {Function} checked - Returns whether the command is in a checked state (for toggle commands).
1179
+ */
1180
+ /**
1181
+ * Collection of all available commands for the report viewer. Each property is a command name mapped to a {@link ReportViewerCommand} instance.
1182
+ *
1183
+ * @typedef {Object} ReportViewerCommands
1184
+
1185
+ * @property {ReportViewerCommand} historyBack - Goes back to the previously rendered report from history.
1186
+ * @example <propertyName>historyBack</propertyName>
1187
+ * // Execute the command
1188
+ * let viewer;
1189
+ * ReactDOM.render(
1190
+ * <>
1191
+ * <TelerikReportViewer />
1192
+ * <button onClick={() => viewer.commands.historyBack.exec()}>Back</button>
1193
+ * </>
1194
+ * );
1195
+ * @example <propertyName>historyBack</propertyName>
1196
+ * // Check if the command is enabled
1197
+ * const isEnabled = viewer.commands.historyBack.enabled();
1198
+ * @example <propertyName>historyBack</propertyName>
1199
+ * // Check if the command is checked
1200
+ * const isChecked = viewer.commands.historyBack.checked();
1201
+ * @property {ReportViewerCommand} historyForward - Goes forward to the next rendered report from history.
1202
+ * @example <propertyName>historyForward</propertyName>
1203
+ * // Execute the command
1204
+ * let viewer;
1205
+ * ReactDOM.render(
1206
+ * <>
1207
+ * <TelerikReportViewer />
1208
+ * <button onClick={() => viewer.commands.historyForward.exec()}>Forward</button>
1209
+ * </>
1210
+ * );
1211
+ * @example <propertyName>historyForward</propertyName>
1212
+ * // Check if the command is enabled
1213
+ * const isEnabled = viewer.commands.historyForward.enabled();
1214
+ * @example <propertyName>historyForward</propertyName>
1215
+ * // Check if the command is checked
1216
+ * const isChecked = viewer.commands.historyForward.checked();
1217
+ * @property {ReportViewerCommand} refresh - Refreshes the report.
1218
+ * @example <propertyName>refresh</propertyName>
1219
+ * // Execute the command
1220
+ * let viewer;
1221
+ * ReactDOM.render(
1222
+ * <>
1223
+ * <TelerikReportViewer />
1224
+ * <button onClick={() => viewer.commands.refresh.exec()}>Refresh</button>
1225
+ * </>
1226
+ * );
1227
+ * @example <propertyName>refresh</propertyName>
1228
+ * // Check if the command is enabled
1229
+ * const isEnabled = viewer.commands.refresh.enabled();
1230
+ * @example <propertyName>refresh</propertyName>
1231
+ * // Check if the command is checked
1232
+ * const isChecked = viewer.commands.refresh.checked();
1233
+ * @property {ReportViewerCommand} goToFirstPage - Goes to the first page of the report.
1234
+ * @example <propertyName>goToFirstPage</propertyName>
1235
+ * // Execute the command
1236
+ * let viewer;
1237
+ * ReactDOM.render(
1238
+ * <>
1239
+ * <TelerikReportViewer />
1240
+ * <button onClick={() => viewer.commands.goToFirstPage.exec()}>First Page</button>
1241
+ * </>
1242
+ * );
1243
+ * @example <propertyName>goToFirstPage</propertyName>
1244
+ * // Check if the command is enabled
1245
+ * const isEnabled = viewer.commands.goToFirstPage.enabled();
1246
+ * @example <propertyName>goToFirstPage</propertyName>
1247
+ * // Check if the command is checked
1248
+ * const isChecked = viewer.commands.goToFirstPage.checked();
1249
+ * @property {ReportViewerCommand} goToPrevPage - Goes to the previous page of the report.
1250
+ * @example <propertyName>goToPrevPage</propertyName>
1251
+ * // Execute the command
1252
+ * let viewer;
1253
+ * ReactDOM.render(
1254
+ * <>
1255
+ * <TelerikReportViewer />
1256
+ * <button onClick={() => viewer.commands.goToPrevPage.exec()}>Previous</button>
1257
+ * </>
1258
+ * );
1259
+ * @example <propertyName>goToPrevPage</propertyName>
1260
+ * // Check if the command is enabled
1261
+ * const isEnabled = viewer.commands.goToPrevPage.enabled();
1262
+ * @example <propertyName>goToPrevPage</propertyName>
1263
+ * // Check if the command is checked
1264
+ * const isChecked = viewer.commands.goToPrevPage.checked();
1265
+ * @property {ReportViewerCommand} goToPage - Goes to a specific page of the report. Accepts a page number as parameter: exec(pageNumber).
1266
+ * @example <propertyName>goToPage</propertyName>
1267
+ * // Execute the command
1268
+ * let viewer;
1269
+ * ReactDOM.render(
1270
+ * <>
1271
+ * <TelerikReportViewer />
1272
+ * <button onClick={() => viewer.commands.goToPage.exec(5)}>Go to Page 5</button>
1273
+ * </>
1274
+ * );
1275
+ * @example <propertyName>goToPage</propertyName>
1276
+ * // Check if the command is enabled
1277
+ * const isEnabled = viewer.commands.goToPage.enabled();
1278
+ * @example <propertyName>goToPage</propertyName>
1279
+ * // Check if the command is checked
1280
+ * const isChecked = viewer.commands.goToPage.checked();
1281
+ * @property {ReportViewerCommand} goToNextPage - Goes to the next page of the report.
1282
+ * @example <propertyName>goToNextPage</propertyName>
1283
+ * // Execute the command
1284
+ * let viewer;
1285
+ * ReactDOM.render(
1286
+ * <>
1287
+ * <TelerikReportViewer />
1288
+ * <button onClick={() => viewer.commands.goToNextPage.exec()}>Next</button>
1289
+ * </>
1290
+ * );
1291
+ * @example <propertyName>goToNextPage</propertyName>
1292
+ * // Check if the command is enabled
1293
+ * const isEnabled = viewer.commands.goToNextPage.enabled();
1294
+ * @example <propertyName>goToNextPage</propertyName>
1295
+ * // Check if the command is checked
1296
+ * const isChecked = viewer.commands.goToNextPage.checked();
1297
+ * @property {ReportViewerCommand} goToLastPage - Goes to the last page of the report.
1298
+ * @example <propertyName>goToLastPage</propertyName>
1299
+ * // Execute the command
1300
+ * let viewer;
1301
+ * ReactDOM.render(
1302
+ * <>
1303
+ * <TelerikReportViewer />
1304
+ * <button onClick={() => viewer.commands.goToLastPage.exec()}>Last Page</button>
1305
+ * </>
1306
+ * );
1307
+ * @example <propertyName>goToLastPage</propertyName>
1308
+ * // Check if the command is enabled
1309
+ * const isEnabled = viewer.commands.goToLastPage.enabled();
1310
+ * @example <propertyName>goToLastPage</propertyName>
1311
+ * // Check if the command is checked
1312
+ * const isChecked = viewer.commands.goToLastPage.checked();
1313
+ * @property {ReportViewerCommand} togglePrintPreview - Toggles between Print Preview and Interactive view modes.
1314
+ * @example <propertyName>togglePrintPreview</propertyName>
1315
+ * // Execute the command
1316
+ * let viewer;
1317
+ * ReactDOM.render(
1318
+ * <>
1319
+ * <TelerikReportViewer />
1320
+ * <button onClick={() => viewer.commands.togglePrintPreview.exec()}>Toggle Print Preview</button>
1321
+ * </>
1322
+ * );
1323
+ * @example <propertyName>togglePrintPreview</propertyName>
1324
+ * // Check if the command is enabled
1325
+ * const isEnabled = viewer.commands.togglePrintPreview.enabled();
1326
+ * @example <propertyName>togglePrintPreview</propertyName>
1327
+ * // Check if the command is checked
1328
+ * const isChecked = viewer.commands.togglePrintPreview.checked();
1329
+ * @property {ReportViewerCommand} export - Exports the report, using the respective rendering extension name. Accepts a rendering extension name as parameter: exec("PDF"), exec("XLSX"), etc.
1330
+ * @example <propertyName>export</propertyName>
1331
+ * // Execute the command
1332
+ * let viewer;
1333
+ * ReactDOM.render(
1334
+ * <>
1335
+ * <TelerikReportViewer />
1336
+ * <button onClick={() => viewer.commands.export.exec('PDF')}>Export PDF</button>
1337
+ * </>
1338
+ * );
1339
+ * @example <propertyName>export</propertyName>
1340
+ * // Check if the command is enabled
1341
+ * const isEnabled = viewer.commands.export.enabled();
1342
+ * @example <propertyName>export</propertyName>
1343
+ * // Check if the command is checked
1344
+ * const isChecked = viewer.commands.export.checked();
1345
+ * @property {ReportViewerCommand} print - Triggers the report printing.
1346
+ * @example <propertyName>print</propertyName>
1347
+ * // Execute the command
1348
+ * let viewer;
1349
+ * ReactDOM.render(
1350
+ * <>
1351
+ * <TelerikReportViewer />
1352
+ * <button onClick={() => viewer.commands.print.exec()}>Print</button>
1353
+ * </>
1354
+ * );
1355
+ * @example <propertyName>print</propertyName>
1356
+ * // Check if the command is enabled
1357
+ * const isEnabled = viewer.commands.print.enabled();
1358
+ * @example <propertyName>print</propertyName>
1359
+ * // Check if the command is checked
1360
+ * const isChecked = viewer.commands.print.checked();
1361
+ * @property {ReportViewerCommand} toggleDocumentMap - Shows or hides the document map.
1362
+ * @example <propertyName>toggleDocumentMap</propertyName>
1363
+ * // Execute the command
1364
+ * let viewer;
1365
+ * ReactDOM.render(
1366
+ * <>
1367
+ * <TelerikReportViewer />
1368
+ * <button onClick={() => viewer.commands.toggleDocumentMap.exec()}>Toggle Document Map</button>
1369
+ * </>
1370
+ * );
1371
+ * @example <propertyName>toggleDocumentMap</propertyName>
1372
+ * // Check if the command is enabled
1373
+ * const isEnabled = viewer.commands.toggleDocumentMap.enabled();
1374
+ * @example <propertyName>toggleDocumentMap</propertyName>
1375
+ * // Check if the command is checked
1376
+ * const isChecked = viewer.commands.toggleDocumentMap.checked();
1377
+ * @property {ReportViewerCommand} toggleParametersArea - Shows or hides the parameters area.
1378
+ * @example <propertyName>toggleParametersArea</propertyName>
1379
+ * // Execute the command
1380
+ * let viewer;
1381
+ * ReactDOM.render(
1382
+ * <>
1383
+ * <TelerikReportViewer />
1384
+ * <button onClick={() => viewer.commands.toggleParametersArea.exec()}>Toggle Parameters</button>
1385
+ * </>
1386
+ * );
1387
+ * @example <propertyName>toggleParametersArea</propertyName>
1388
+ * // Check if the command is enabled
1389
+ * const isEnabled = viewer.commands.toggleParametersArea.enabled();
1390
+ * @example <propertyName>toggleParametersArea</propertyName>
1391
+ * // Check if the command is checked
1392
+ * const isChecked = viewer.commands.toggleParametersArea.checked();
1393
+ * @property {ReportViewerCommand} zoomIn - Zoom-in the report.
1394
+ * @example <propertyName>zoomIn</propertyName>
1395
+ * // Execute the command
1396
+ * let viewer;
1397
+ * ReactDOM.render(
1398
+ * <>
1399
+ * <TelerikReportViewer />
1400
+ * <button onClick={() => viewer.commands.zoomIn.exec()}>Zoom In</button>
1401
+ * </>
1402
+ * );
1403
+ * @example <propertyName>zoomIn</propertyName>
1404
+ * // Check if the command is enabled
1405
+ * const isEnabled = viewer.commands.zoomIn.enabled();
1406
+ * @example <propertyName>zoomIn</propertyName>
1407
+ * // Check if the command is checked
1408
+ * const isChecked = viewer.commands.zoomIn.checked();
1409
+ * @property {ReportViewerCommand} zoomOut - Zoom-out the report.
1410
+ * @example <propertyName>zoomOut</propertyName>
1411
+ * // Execute the command
1412
+ * let viewer;
1413
+ * ReactDOM.render(
1414
+ * <>
1415
+ * <TelerikReportViewer />
1416
+ * <button onClick={() => viewer.commands.zoomOut.exec()}>Zoom Out</button>
1417
+ * </>
1418
+ * );
1419
+ * @example <propertyName>zoomOut</propertyName>
1420
+ * // Check if the command is enabled
1421
+ * const isEnabled = viewer.commands.zoomOut.enabled();
1422
+ * @example <propertyName>zoomOut</propertyName>
1423
+ * // Check if the command is checked
1424
+ * const isChecked = viewer.commands.zoomOut.checked();
1425
+ * @property {ReportViewerCommand} zoom - Zoom with a specified ratio. Accepts a zoom ratio as parameter: exec(1.5).
1426
+ * @example <propertyName>zoom</propertyName>
1427
+ * // Execute the command
1428
+ * let viewer;
1429
+ * ReactDOM.render(
1430
+ * <>
1431
+ * <TelerikReportViewer />
1432
+ * <button onClick={() => viewer.commands.zoom.exec(1.5)}>Zoom 150%</button>
1433
+ * </>
1434
+ * );
1435
+ * @example <propertyName>zoom</propertyName>
1436
+ * // Check if the command is enabled
1437
+ * const isEnabled = viewer.commands.zoom.enabled();
1438
+ * @example <propertyName>zoom</propertyName>
1439
+ * // Check if the command is checked
1440
+ * const isChecked = viewer.commands.zoom.checked();
1441
+ * @property {ReportViewerCommand} toggleZoomMode - Changes the zoom mode of the report.
1442
+ * @example <propertyName>toggleZoomMode</propertyName>
1443
+ * // Execute the command
1444
+ * let viewer;
1445
+ * ReactDOM.render(
1446
+ * <>
1447
+ * <TelerikReportViewer />
1448
+ * <button onClick={() => viewer.commands.toggleZoomMode.exec()}>Toggle Zoom Mode</button>
1449
+ * </>
1450
+ * );
1451
+ * @example <propertyName>toggleZoomMode</propertyName>
1452
+ * // Check if the command is enabled
1453
+ * const isEnabled = viewer.commands.toggleZoomMode.enabled();
1454
+ * @example <propertyName>toggleZoomMode</propertyName>
1455
+ * // Check if the command is checked
1456
+ * const isChecked = viewer.commands.toggleZoomMode.checked();
1457
+ * @property {ReportViewerCommand} toggleSideMenu - Shows or hides the side menu.
1458
+ * @example <propertyName>toggleSideMenu</propertyName>
1459
+ * // Execute the command
1460
+ * let viewer;
1461
+ * ReactDOM.render(
1462
+ * <>
1463
+ * <TelerikReportViewer />
1464
+ * <button onClick={() => viewer.commands.toggleSideMenu.exec()}>Toggle Side Menu</button>
1465
+ * </>
1466
+ * );
1467
+ * @example <propertyName>toggleSideMenu</propertyName>
1468
+ * // Check if the command is enabled
1469
+ * const isEnabled = viewer.commands.toggleSideMenu.enabled();
1470
+ * @example <propertyName>toggleSideMenu</propertyName>
1471
+ * // Check if the command is checked
1472
+ * const isChecked = viewer.commands.toggleSideMenu.checked();
1473
+ * @property {ReportViewerCommand} toggleSearchDialog - Shows or hides the search dialog.
1474
+ * @example <propertyName>toggleSearchDialog</propertyName>
1475
+ * // Execute the command
1476
+ * let viewer;
1477
+ * ReactDOM.render(
1478
+ * <>
1479
+ * <TelerikReportViewer />
1480
+ * <button onClick={() => viewer.commands.toggleSearchDialog.exec()}>Toggle Search</button>
1481
+ * </>
1482
+ * );
1483
+ * @example <propertyName>toggleSearchDialog</propertyName>
1484
+ * // Check if the command is enabled
1485
+ * const isEnabled = viewer.commands.toggleSearchDialog.enabled();
1486
+ * @example <propertyName>toggleSearchDialog</propertyName>
1487
+ * // Check if the command is checked
1488
+ * const isChecked = viewer.commands.toggleSearchDialog.checked();
1489
+ * @property {ReportViewerCommand} stopRendering - Stops the rendering of the current report.
1490
+ * @example <propertyName>stopRendering</propertyName>
1491
+ * // Execute the command
1492
+ * let viewer;
1493
+ * ReactDOM.render(
1494
+ * <>
1495
+ * <TelerikReportViewer />
1496
+ * <button onClick={() => viewer.commands.stopRendering.exec()}>Stop Rendering</button>
1497
+ * </>
1498
+ * );
1499
+ * @example <propertyName>stopRendering</propertyName>
1500
+ * // Check if the command is enabled
1501
+ * const isEnabled = viewer.commands.stopRendering.enabled();
1502
+ * @example <propertyName>stopRendering</propertyName>
1503
+ * // Check if the command is checked
1504
+ * const isChecked = viewer.commands.stopRendering.checked();
1505
+ * @property {ReportViewerCommand} toggleSendEmailDialog - Shows or hides the send email dialog.
1506
+ * @example <propertyName>toggleSendEmailDialog</propertyName>
1507
+ * // Execute the command
1508
+ * let viewer;
1509
+ * ReactDOM.render(
1510
+ * <>
1511
+ * <TelerikReportViewer />
1512
+ * <button onClick={() => viewer.commands.toggleSendEmailDialog.exec()}>Toggle Send Email</button>
1513
+ * </>
1514
+ * );
1515
+ * @example <propertyName>toggleSendEmailDialog</propertyName>
1516
+ * // Check if the command is enabled
1517
+ * const isEnabled = viewer.commands.toggleSendEmailDialog.enabled();
1518
+ * @example <propertyName>toggleSendEmailDialog</propertyName>
1519
+ * // Check if the command is checked
1520
+ * const isChecked = viewer.commands.toggleSendEmailDialog.checked();
1521
+ * @property {ReportViewerCommand} toggleAiPromptDialog - Shows or hides the AI prompt dialog.
1522
+ * @example <propertyName>toggleAiPromptDialog</propertyName>
1523
+ * // Execute the command
1524
+ * let viewer;
1525
+ * ReactDOM.render(
1526
+ * <>
1527
+ * <TelerikReportViewer />
1528
+ * <button onClick={() => viewer.commands.toggleAiPromptDialog.exec()}>Toggle AI Prompt</button>
1529
+ * </>
1530
+ * );
1531
+ * @example <propertyName>toggleAiPromptDialog</propertyName>
1532
+ * // Check if the command is enabled
1533
+ * const isEnabled = viewer.commands.toggleAiPromptDialog.enabled();
1534
+ * @example <propertyName>toggleAiPromptDialog</propertyName>
1535
+ * // Check if the command is checked
1536
+ * const isChecked = viewer.commands.toggleAiPromptDialog.checked();
1537
+ */