@progress/telerik-jquery-report-viewer 22.24.514 → 23.24.806

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.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/accessibility.js +28 -38
  3. package/dist/cjs/base-component.js +26 -0
  4. package/dist/cjs/binder.js +45 -138
  5. package/dist/cjs/controller.js +25 -25
  6. package/dist/cjs/documentMapArea.js +4 -13
  7. package/dist/cjs/event-emitter.js +124 -10
  8. package/dist/cjs/index.js +2 -0
  9. package/dist/cjs/mainMenu.js +22 -31
  10. package/dist/cjs/pagesArea.js +8 -27
  11. package/dist/cjs/parameterValidators.js +4 -7
  12. package/dist/cjs/parameters.js +13 -13
  13. package/dist/cjs/parametersArea.js +36 -49
  14. package/dist/cjs/print.js +3 -4
  15. package/dist/cjs/reportViewer.js +38 -27
  16. package/dist/cjs/scroll.js +4 -6
  17. package/dist/cjs/search.js +327 -377
  18. package/dist/cjs/sendEmail.js +52 -95
  19. package/dist/cjs/serviceClient.js +163 -257
  20. package/dist/cjs/sideMenu.js +15 -24
  21. package/dist/cjs/sr.js +4 -4
  22. package/dist/cjs/template-cache.js +6 -6
  23. package/dist/cjs/toolbar/link-button.js +42 -0
  24. package/dist/cjs/toolbar/page-count-label.js +18 -0
  25. package/dist/cjs/toolbar/page-number-input.js +64 -0
  26. package/dist/cjs/uiFreezeCoordinator.js +17 -16
  27. package/dist/cjs/utils.js +11 -14
  28. package/dist/es/accessibility.js +29 -39
  29. package/dist/es/base-component.js +22 -0
  30. package/dist/es/binder.js +45 -138
  31. package/dist/es/controller.js +26 -26
  32. package/dist/es/documentMapArea.js +4 -13
  33. package/dist/es/event-emitter.js +124 -10
  34. package/dist/es/index.js +1 -0
  35. package/dist/es/mainMenu.js +23 -32
  36. package/dist/es/pagesArea.js +9 -28
  37. package/dist/es/parameterValidators.js +5 -8
  38. package/dist/es/parameters.js +14 -14
  39. package/dist/es/parametersArea.js +37 -50
  40. package/dist/es/print.js +4 -5
  41. package/dist/es/reportViewer.js +39 -28
  42. package/dist/es/scroll.js +4 -6
  43. package/dist/es/search.js +328 -378
  44. package/dist/es/sendEmail.js +52 -95
  45. package/dist/es/serviceClient.js +164 -258
  46. package/dist/es/sideMenu.js +16 -25
  47. package/dist/es/sr.js +4 -4
  48. package/dist/es/template-cache.js +7 -7
  49. package/dist/es/toolbar/link-button.js +38 -0
  50. package/dist/es/toolbar/page-count-label.js +14 -0
  51. package/dist/es/toolbar/page-number-input.js +60 -0
  52. package/dist/es/uiFreezeCoordinator.js +17 -16
  53. package/dist/es/utils.js +11 -14
  54. package/dist/font/font-icons.css +4 -4
  55. package/dist/font/font-icons.min.css +3 -3
  56. package/dist/js/telerikReportViewer.js +1080 -1190
  57. package/dist/js/telerikReportViewer.min.js +1 -1
  58. package/dist/js/telerikReportViewer.stringResources.js +4 -4
  59. package/dist/styles/telerikReportViewer.css +3 -3
  60. package/dist/styles/telerikReportViewer.min.css +3 -3
  61. package/dist/templates/telerikReportViewerTemplate-FA.html +4 -4
  62. package/dist/templates/telerikReportViewerTemplate.html +6 -6
  63. package/package.json +3 -2
  64. /package/dist/font/{ReportingIcons-18.1.24.514.ttf → ReportingIcons-18.2.24.806.ttf} +0 -0
@@ -1,4 +1,4 @@
1
- import { each, extend, stringFormat, tryParseInt, escapeHtml } from './utils.js';
1
+ import { stringFormat, tryParseInt, escapeHtml } from './utils.js';
2
2
  import { getMargins, getBorderWidth, getPadding, scale } from './domUtils.js';
3
3
  import { stringResources } from './stringResources.js';
4
4
  import { TouchBehavior } from './touch.js';
@@ -33,7 +33,7 @@ function PagesArea(placeholder, options, otherOptions) {
33
33
  var reportPageIsLoaded = false;
34
34
  var pageAreaImageStyle = '.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}';
35
35
  var pageAreaImageID = "trv-initial-image-styles";
36
- var scroll = extend({}, Scroll, {});
36
+ var scroll = $.extend({}, Scroll);
37
37
  var uiFreezeCoordinator = null;
38
38
  init();
39
39
  if (scroll) {
@@ -119,7 +119,7 @@ function PagesArea(placeholder, options, otherOptions) {
119
119
  enableInteractivity();
120
120
  }
121
121
  if (args.containsFrozenContent && !uiFreezeCoordinator) {
122
- uiFreezeCoordinator = extend({}, UIFreezeCoordinator, {});
122
+ uiFreezeCoordinator = $.extend({}, UIFreezeCoordinator);
123
123
  if (controller.getViewMode() === ViewModes.INTERACTIVE) {
124
124
  uiFreezeCoordinator.init($placeholder);
125
125
  }
@@ -259,19 +259,13 @@ function PagesArea(placeholder, options, otherOptions) {
259
259
  var result;
260
260
  var allPages = $pageContainer.find(".trv-report-page");
261
261
  if (controller.getPageMode() === PageModes.SINGLE_PAGE) {
262
- each(allPages, function(index, page) {
263
- if (pageNo(page) === pageNumber) {
264
- result = page;
265
- }
266
- return !result;
262
+ result = Array.from(allPages).find((page) => {
263
+ return pageNo(page) === pageNumber;
267
264
  });
268
265
  } else {
269
- $.each(allPages, function(index, page) {
266
+ result = Array.from(allPages).find((page) => {
270
267
  var dataPageNumber = parseInt($(page).attr("data-page"));
271
- if (dataPageNumber === pageNumber) {
272
- result = page;
273
- return false;
274
- }
268
+ return dataPageNumber === pageNumber;
275
269
  });
276
270
  }
277
271
  return result;
@@ -483,14 +477,9 @@ function PagesArea(placeholder, options, otherOptions) {
483
477
  }
484
478
  function getAction(actionId) {
485
479
  if (actions) {
486
- var action;
487
- each(actions, function() {
488
- if (this.Id === actionId) {
489
- action = this;
490
- }
491
- return action === void 0;
480
+ return Array.from(actions).find(function(action) {
481
+ return action.Id === actionId;
492
482
  });
493
- return action;
494
483
  }
495
484
  return null;
496
485
  }
@@ -625,13 +614,5 @@ function PagesArea(placeholder, options, otherOptions) {
625
614
  $("#" + pageAreaImageID).remove();
626
615
  }
627
616
  }
628
- var pluginName = "telerik_ReportViewer_PagesArea";
629
- $.fn[pluginName] = function(options, otherOptions) {
630
- return each(this, function() {
631
- if (!$.data(this, pluginName)) {
632
- $.data(this, pluginName, new PagesArea(this, options, otherOptions));
633
- }
634
- });
635
- };
636
617
 
637
618
  export { PagesArea };
@@ -1,4 +1,4 @@
1
- import { stringFormat, each, tryParseFloat, tryParseInt, parseToLocalDate } from './utils.js';
1
+ import { stringFormat, tryParseFloat, tryParseInt, parseToLocalDate } from './utils.js';
2
2
  import { stringResources } from './stringResources.js';
3
3
  import { ParameterTypes } from './enums.js';
4
4
 
@@ -12,9 +12,8 @@ var ParameterValidators = function() {
12
12
  if (value == null || value.length == 0) {
13
13
  if (parameter.allowNull) {
14
14
  return value;
15
- } else {
16
- throw stringResources.invalidParameter;
17
15
  }
16
+ throw stringResources.invalidParameter;
18
17
  }
19
18
  return values;
20
19
  }
@@ -25,10 +24,8 @@ var ParameterValidators = function() {
25
24
  }
26
25
  function checkAvailableValues(parameter, value, compareFunc) {
27
26
  if (parameter.availableValues) {
28
- var found = false;
29
- each(parameter.availableValues, function(i, av) {
30
- found = compareFunc(value, av.value);
31
- return !found;
27
+ var found = Array.from(parameter.availableValues).some(function(av) {
28
+ return compareFunc(value, av.value);
32
29
  });
33
30
  if (!found) {
34
31
  if (parameter.allowNull && !value) {
@@ -135,7 +132,7 @@ var ParameterValidators = function() {
135
132
  parameter,
136
133
  value,
137
134
  function(value2) {
138
- if (-1 != ["true", "false"].indexOf(("" + value2).toLowerCase())) {
135
+ if (-1 != ["true", "false"].indexOf(String(value2).toLowerCase())) {
139
136
  return Boolean(value2);
140
137
  }
141
138
  if (isNull(parameter, value2)) {
@@ -1,4 +1,4 @@
1
- import { each, parseToLocalDate, areEqual, stringFormat, adjustTimezone, tryParseInt, areEqualArrays, unadjustTimezone, isSpecialKey } from './utils.js';
1
+ import { parseToLocalDate, areEqual, stringFormat, adjustTimezone, tryParseInt, areEqualArrays, unadjustTimezone, isSpecialKey } from './utils.js';
2
2
  import { stringResources } from './stringResources.js';
3
3
  import { ParameterEditorTypes, ParameterTypes } from './enums.js';
4
4
 
@@ -228,8 +228,8 @@ var ParameterEditors = [
228
228
  }
229
229
  function applyAriaSelected(selection) {
230
230
  var children = $list.find(".trv-listviewitem");
231
- each(children, function() {
232
- var $item = $(this);
231
+ Array.from(children).forEach((item) => {
232
+ var $item = $(item);
233
233
  var isSelected = selection.filter($item).length > 0;
234
234
  $item.attr("aria-selected", isSelected);
235
235
  });
@@ -312,9 +312,9 @@ var ParameterEditors = [
312
312
  items = [items];
313
313
  }
314
314
  var children = $list.find(".trv-listviewitem");
315
- each(parameter.availableValues, function(i, av) {
315
+ $.each(parameter.availableValues, (i, av) => {
316
316
  var selected = false;
317
- each(items, function(j, v) {
317
+ $.each(items, (j, v) => {
318
318
  var availableValue = av.value;
319
319
  if (v instanceof Date) {
320
320
  availableValue = parseToLocalDate(av.value);
@@ -353,8 +353,8 @@ var ParameterEditors = [
353
353
  addAccessibilityAttributes($list, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
354
354
  $list.attr("aria-multiselectable", "true");
355
355
  var items = $list.find(".trv-listviewitem");
356
- each(items, function() {
357
- $(this).attr("aria-label", this.innerText);
356
+ Array.from(items).forEach((item) => {
357
+ $(item).attr("aria-label", item.innerText);
358
358
  });
359
359
  },
360
360
  setAccessibilityErrorState: function(param) {
@@ -483,8 +483,8 @@ var ParameterEditors = [
483
483
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
484
484
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
485
485
  var items = editor.items();
486
- each(items, function() {
487
- $(this).attr("aria-label", this.innerText);
486
+ Array.from(items).forEach((item) => {
487
+ $(item).attr("aria-label", item.innerText);
488
488
  });
489
489
  },
490
490
  setAccessibilityErrorState: function(param) {
@@ -546,7 +546,7 @@ var ParameterEditors = [
546
546
  }
547
547
  function setSelectedItems(value) {
548
548
  var items = $list.find(".trv-listviewitem");
549
- each(parameter.availableValues, function(i, av) {
549
+ $.each(parameter.availableValues, (i, av) => {
550
550
  var availableValue = av.value;
551
551
  if (value instanceof Date) {
552
552
  availableValue = parseToLocalDate(av.value);
@@ -590,8 +590,8 @@ var ParameterEditors = [
590
590
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
591
591
  addAccessibilityAttributes($list, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
592
592
  var items = $list.find(".trv-listviewitem");
593
- each(items, function() {
594
- $(this).attr("aria-label", this.innerText);
593
+ Array.from(items).forEach((item) => {
594
+ $(item).attr("aria-label", item.innerText);
595
595
  });
596
596
  },
597
597
  setAccessibilityErrorState: function(param) {
@@ -681,8 +681,8 @@ var ParameterEditors = [
681
681
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
682
682
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
683
683
  var items = editor.items();
684
- each(items, function() {
685
- $(this).attr("aria-label", this.innerText);
684
+ Array.from(items).forEach((item) => {
685
+ $(item).attr("aria-label", item.innerText);
686
686
  });
687
687
  },
688
688
  setAccessibilityErrorState: function(param) {
@@ -1,4 +1,4 @@
1
- import { each, escapeHtml } from './utils.js';
1
+ import { escapeHtml } from './utils.js';
2
2
  import { stringResources } from './stringResources.js';
3
3
  import { ParameterValidators } from './parameterValidators.js';
4
4
  import { ParameterEditors } from './parameters.js';
@@ -156,12 +156,8 @@ function ParametersArea(placeholder, options, otherOptions) {
156
156
  }
157
157
  }
158
158
  function selectParameterEditorFactory(parameter, editorsType) {
159
- var factory;
160
- each(parameterEditors, function() {
161
- if (this && this.match(parameter, editorsType)) {
162
- factory = this;
163
- }
164
- return !factory;
159
+ var factory = Array.from(parameterEditors).find((editor) => {
160
+ return editor.match(parameter, editorsType);
165
161
  });
166
162
  return factory;
167
163
  }
@@ -173,23 +169,21 @@ function ParametersArea(placeholder, options, otherOptions) {
173
169
  (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
174
170
  }
175
171
  function allParametersAutoRefresh() {
176
- var allAuto = true;
177
- each(parameters, function() {
178
- return allAuto = !this.isVisible || this.autoRefresh;
172
+ var allAuto = Array.from(parameters).every((parameter) => {
173
+ return !parameter.isVisible || parameter.autoRefresh;
179
174
  });
180
175
  return allAuto;
181
176
  }
182
177
  function allParametersValid() {
183
- var allValid = true;
184
- each(parameters, function() {
185
- return allValid = !this.Error;
178
+ var allValid = Array.from(parameters).every((parameter) => {
179
+ return !parameter.Error;
186
180
  });
187
181
  return allValid;
188
182
  }
189
183
  function clearEditors() {
190
- each(editors, function() {
191
- if (this.hasOwnProperty("destroy")) {
192
- this.destroy();
184
+ Object.entries(editors).forEach(([key, editor]) => {
185
+ if (typeof editor.destroy === "function") {
186
+ editor.destroy();
193
187
  }
194
188
  });
195
189
  editors = {};
@@ -201,26 +195,26 @@ function ParametersArea(placeholder, options, otherOptions) {
201
195
  clearEditors();
202
196
  var $parameterContainer;
203
197
  var $tempContainer = $("<div></div>");
204
- each(parameters, function() {
198
+ Array.from(parameters).forEach((parameter) => {
205
199
  try {
206
- this.value = ParameterValidators.validate(this, this.value);
200
+ parameter.value = ParameterValidators.validate(parameter, parameter.value);
207
201
  } catch (e) {
208
- this.Error = this.Error || e;
202
+ parameter.Error = parameter.Error || e;
209
203
  }
210
- var hasError = Boolean(this.Error);
204
+ var hasError = Boolean(parameter.Error);
211
205
  var hasValue = !hasError;
212
206
  if (hasValue) {
213
- recentParameterValues[this.id] = this.value;
214
- if (this.availableValues) {
215
- processedParameterValues[this.id] = { valueMember: this.value, displayMember: this.label, availableValues: this.availableValues, multivalue: this.multivalue };
216
- } else {
217
- processedParameterValues[this.id] = this.value;
218
- }
207
+ recentParameterValues[parameter.id] = parameter.value;
208
+ } else {
209
+ parameter.Error = stringResources.invalidParameter;
210
+ }
211
+ if (parameter.availableValues) {
212
+ processedParameterValues[parameter.id] = { valueMember: parameter.value, displayMember: parameter.label, availableValues: parameter.availableValues, multivalue: parameter.multivalue };
219
213
  } else {
220
- this.Error = stringResources.invalidParameter;
214
+ processedParameterValues[parameter.id] = parameter.value;
221
215
  }
222
- if (this.isVisible || options.showHiddenParameters) {
223
- $parameterContainer = createParameterUI(this);
216
+ if (parameter.isVisible || options.showHiddenParameters) {
217
+ $parameterContainer = createParameterUI(parameter);
224
218
  if ($parameterContainer) {
225
219
  $tempContainer.append($parameterContainer);
226
220
  }
@@ -229,17 +223,17 @@ function ParametersArea(placeholder, options, otherOptions) {
229
223
  if (initialParameterValues !== void 0) {
230
224
  if (null === initialParameterValues) {
231
225
  initialParameterValues = {};
232
- each(parameters, function() {
233
- if (this.isVisible) {
234
- initialParameterValues[this.id] = this.value;
226
+ Array.from(parameters).forEach((parameter) => {
227
+ if (parameter.isVisible) {
228
+ initialParameterValues[parameter.id] = parameter.value;
235
229
  } else {
236
- delete recentParameterValues[this.id];
230
+ delete recentParameterValues[parameter.id];
237
231
  }
238
232
  });
239
233
  } else {
240
- each(parameters, function() {
241
- if (!(this.id in initialParameterValues)) {
242
- delete recentParameterValues[this.id];
234
+ Array.from(parameters).forEach((parameter) => {
235
+ if (!(parameter.id in initialParameterValues)) {
236
+ delete recentParameterValues[parameter.id];
243
237
  }
244
238
  });
245
239
  }
@@ -282,7 +276,7 @@ function ParametersArea(placeholder, options, otherOptions) {
282
276
  }
283
277
  function invalidateChildParameters(parameter) {
284
278
  if (parameter.childParameters) {
285
- each(parameter.childParameters, function(index, parameterId) {
279
+ Array.from(parameter.childParameters).forEach((parameterId) => {
286
280
  var childParameter = getParameterById(parameterId);
287
281
  if (childParameter) {
288
282
  invalidateChildParameters(childParameter);
@@ -341,12 +335,10 @@ function ParametersArea(placeholder, options, otherOptions) {
341
335
  if (!params || null === params) {
342
336
  return false;
343
337
  }
344
- var result = false;
345
- each(params, function() {
346
- result = this.isVisible;
347
- return !result;
338
+ var hasVisible = Array.from(params).some((parameter) => {
339
+ return parameter.isVisible;
348
340
  });
349
- return result;
341
+ return hasVisible;
350
342
  }
351
343
  var loadingCount = 0;
352
344
  function beginLoad() {
@@ -479,6 +471,9 @@ function ParametersArea(placeholder, options, otherOptions) {
479
471
  parametersReady: function() {
480
472
  return eventFactory(Events.PARAMETERS_READY, arguments);
481
473
  },
474
+ fill: function(parameters2) {
475
+ return fill(parameters2);
476
+ },
482
477
  setParameters: function(parameterValues) {
483
478
  initialParameterValues = null === parameterValues ? null : $.extend({}, parameterValues);
484
479
  }
@@ -486,13 +481,5 @@ function ParametersArea(placeholder, options, otherOptions) {
486
481
  );
487
482
  return parametersArea;
488
483
  }
489
- var pluginName = "telerik_ReportViewer_ParametersArea";
490
- $.fn[pluginName] = function(options, otherOptions) {
491
- return each(this, function() {
492
- if (!$.data(this, pluginName)) {
493
- $.data(this, pluginName, new ParametersArea(this, options, otherOptions));
494
- }
495
- });
496
- };
497
484
 
498
485
  export { ParametersArea };
package/dist/es/print.js CHANGED
@@ -1,10 +1,10 @@
1
- import { logError, each } from './utils.js';
1
+ import { logError } from './utils.js';
2
2
 
3
3
  function IEHelper() {
4
4
  function getPdfPlugin() {
5
5
  var classIds = ["AcroPDF.PDF.1", "PDF.PdfCtrl.6", "PDF.PdfCtrl.5"];
6
6
  var plugin = null;
7
- each(classIds, function(index, classId) {
7
+ $.each(classIds, function(index, classId) {
8
8
  try {
9
9
  plugin = new ActiveXObject(classId);
10
10
  if (plugin) {
@@ -48,7 +48,7 @@ function ChromiumHelper(defaultPlugin) {
48
48
  function hasPdfPlugin2() {
49
49
  var navPlugins = navigator.plugins;
50
50
  var found = false;
51
- each(navPlugins, function(key, value) {
51
+ $.each(navPlugins, function(key, value) {
52
52
  if (navPlugins[key].name === defaultPlugin || navPlugins[key].name === "Adobe Acrobat") {
53
53
  found = true;
54
54
  return false;
@@ -82,8 +82,7 @@ function selectBrowserHelper() {
82
82
  return ChromiumHelper("Chrome PDF Viewer");
83
83
  else if (userAgent.indexOf("safari") > -1)
84
84
  return ChromiumHelper("WebKit built-in PDF");
85
- else
86
- return OtherBrowserHelper();
85
+ return OtherBrowserHelper();
87
86
  }
88
87
  return null;
89
88
  }
@@ -1,4 +1,4 @@
1
- import { each, rTrim, generateGuidString, extend, loadScriptWithCallback, isApplicationExceptionInstance, stringFormat, escapeHtml, logError, loadScript } from './utils.js';
1
+ import { rTrim, generateGuidString, isApplicationExceptionInstance, stringFormat, escapeHtml, logError, loadScript } from './utils.js';
2
2
  import { stringResources } from './stringResources.js';
3
3
  import { ServiceClient } from './serviceClient.js';
4
4
  import { ReportViewerController } from './controller.js';
@@ -21,6 +21,9 @@ import { GlobalSettings } from './globalSettings.js';
21
21
  import { MemStorage } from './mem-storage.js';
22
22
  import { TemplateCache } from './template-cache.js';
23
23
  import { ReportViewerSettings } from './report-viewer/report-viewer-settings.js';
24
+ import { LinkButton } from './toolbar/link-button.js';
25
+ import { PageNumberInput } from './toolbar/page-number-input.js';
26
+ import { PageCountLabel } from './toolbar/page-count-label.js';
24
27
 
25
28
  const Instances = GlobalSettings.viewerInstances;
26
29
  function getDefaultOptions(serviceUrl, version) {
@@ -81,8 +84,8 @@ function ReportViewer(dom, options) {
81
84
  if (!validateOptions(options)) {
82
85
  return;
83
86
  }
84
- var version = "18.1.24.514";
85
- options = extend({}, getDefaultOptions(svcApiUrl, version), options);
87
+ var version = "18.2.24.806";
88
+ options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
86
89
  settings = new ReportViewerSettings(
87
90
  persistanceKey,
88
91
  options.persistSession ? window.sessionStorage : new MemStorage(),
@@ -533,24 +536,21 @@ function ReportViewer(dom, options) {
533
536
  return e.outerHTML;
534
537
  }).toArray();
535
538
  var promises = [];
536
- each(
537
- styleSheets,
538
- function(i, e) {
539
- if (-1 === currentStyleLinks.indexOf(e)) {
540
- promises.push(
541
- new Promise(function(resolve, reject) {
542
- var $link = $(e);
543
- $link.on("load", resolve);
544
- $link.on("onerror", function() {
545
- logError("error loading stylesheet " + e);
546
- resolve();
547
- });
548
- $head.append($link);
549
- })
550
- );
551
- }
539
+ Array.from(styleSheets).forEach((element) => {
540
+ if (currentStyleLinks.indexOf(element) === -1) {
541
+ promises.push(
542
+ new Promise(function(resolve, reject) {
543
+ var $link = $(element);
544
+ $link.on("load", resolve);
545
+ $link.on("onerror", function() {
546
+ logError("error loading stylesheet " + element);
547
+ resolve();
548
+ });
549
+ $head.append($link);
550
+ })
551
+ );
552
552
  }
553
- );
553
+ });
554
554
  return Promise.all(promises).then(controller.cssLoaded);
555
555
  }
556
556
  function browserSupportsAllFeatures() {
@@ -559,12 +559,11 @@ function ReportViewer(dom, options) {
559
559
  function ensureKendo(version2) {
560
560
  if (window.kendo) {
561
561
  return Promise.resolve();
562
- } else {
563
- var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
564
- return loadScript(kendoUrl).catch(function(errorData) {
565
- logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
566
- });
567
562
  }
563
+ var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
564
+ return loadScript(kendoUrl).catch(function(errorData) {
565
+ logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
566
+ });
568
567
  }
569
568
  function main(version2) {
570
569
  ensureKendo(version2).then(function() {
@@ -592,7 +591,7 @@ function ReportViewer(dom, options) {
592
591
  if (browserSupportsAllFeatures()) {
593
592
  main(version);
594
593
  } else {
595
- loadScriptWithCallback("https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise", main, version);
594
+ throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
596
595
  }
597
596
  return viewer;
598
597
  }
@@ -601,7 +600,7 @@ $.fn[pluginName] = function(options) {
601
600
  if (this.selector && !options.selector) {
602
601
  options.selector = this.selector;
603
602
  }
604
- return each(this, function() {
603
+ return this.each(function() {
605
604
  if (!$.data(this, pluginName)) {
606
605
  $.data(this, pluginName, new ReportViewer(this, options));
607
606
  }
@@ -635,11 +634,23 @@ const plugins = [
635
634
  {
636
635
  name: "telerik_ReportViewer_SideMenu",
637
636
  constructor: SideMenu
637
+ },
638
+ {
639
+ name: "telerik_ReportViewer_LinkButton",
640
+ constructor: LinkButton
641
+ },
642
+ {
643
+ name: "telerik_ReportViewer_PageNumberInput",
644
+ constructor: PageNumberInput
645
+ },
646
+ {
647
+ name: "telerik_ReportViewer_PageCountLabel",
648
+ constructor: PageCountLabel
638
649
  }
639
650
  ];
640
651
  plugins.forEach((plugin) => {
641
652
  $.fn[plugin.name] = function(options, otherOptions) {
642
- return each(this, function() {
653
+ return this.each(function() {
643
654
  if (!$.data(this, plugin.name)) {
644
655
  $.data(this, plugin.name, new plugin.constructor(this, options, otherOptions));
645
656
  }
package/dist/es/scroll.js CHANGED
@@ -278,11 +278,11 @@ var Scroll = {
278
278
  _loadVisiblePages: function _loadVisiblePages() {
279
279
  var that = this;
280
280
  var pages = that.$placeholder.find(".trv-report-page");
281
- $.each(pages, function(index, value) {
281
+ Array.from(pages).forEach((value) => {
282
282
  var pageItem = $(value);
283
283
  var pageNumber = parseInt(pageItem.attr("data-page"));
284
284
  if (that._scrolledInToView(pageItem) && that._isSkeletonScreen(pageItem, pageNumber)) {
285
- that.controller.getPageData(pageNumber).then(function(newPage) {
285
+ that.controller.getPageData(pageNumber).then((newPage) => {
286
286
  that._render(newPage, false);
287
287
  });
288
288
  }
@@ -453,9 +453,8 @@ var Scroll = {
453
453
  return that._findNewCurrentPage(pages.splice(middleIndex, Number.MAX_VALUE));
454
454
  } else if (result > 0 && pages.length > 1) {
455
455
  return that._findNewCurrentPage(pages.splice(0, middleIndex));
456
- } else {
457
- return -1;
458
456
  }
457
+ return -1;
459
458
  },
460
459
  _findPageInViewPort: function _findPageInViewPort(index, pages) {
461
460
  var pageItem = this.$placeholder.find(pages[index]);
@@ -472,9 +471,8 @@ var Scroll = {
472
471
  }
473
472
  if (pageBottom < additionalTopOffset) {
474
473
  return -1;
475
- } else {
476
- return 1;
477
474
  }
475
+ return 1;
478
476
  },
479
477
  _scrollDown: function _scrollDown(pages, scrollPosition) {
480
478
  var that = this;