@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,5 +1,5 @@
1
1
  /*
2
- * TelerikReporting v18.1.24.514 (https://www.telerik.com/products/reporting.aspx)
2
+ * TelerikReporting v18.2.24.806 (https://www.telerik.com/products/reporting.aspx)
3
3
  * Copyright 2024 Progress Software EAD. All rights reserved.
4
4
  *
5
5
  * Telerik Reporting commercial licenses may be obtained at
@@ -179,13 +179,11 @@ var telerikReportViewer = (function (exports) {
179
179
  if (array1 === null) {
180
180
  if (array2 !== null) {
181
181
  return false;
182
- } else {
183
- return true;
184
- }
185
- } else {
186
- if (array2 === null) {
187
- return false;
188
182
  }
183
+ return true;
184
+ }
185
+ if (array2 === null) {
186
+ return false;
189
187
  }
190
188
  if (array1.length !== array2.length) {
191
189
  return false;
@@ -311,7 +309,7 @@ var telerikReportViewer = (function (exports) {
311
309
  function isArray(obj) {
312
310
  if (Array.isArray(obj))
313
311
  return true;
314
- var length = !!obj && "length" in obj && obj.length;
312
+ var length = Boolean(obj) && "length" in obj && obj.length;
315
313
  if (typeof length === "number") {
316
314
  return true;
317
315
  }
@@ -331,12 +329,11 @@ var telerikReportViewer = (function (exports) {
331
329
  function loadScript(url) {
332
330
  var ajaxOptions = {
333
331
  dataType: "script",
334
- cache: true,
335
- url
332
+ cache: true
336
333
  };
337
- return $ajax(ajaxOptions);
334
+ return $ajax(url, ajaxOptions);
338
335
  }
339
- function filterUniqueLastOccurance(array) {
336
+ function filterUniqueLastOccurrence(array) {
340
337
  function onlyLastUnique(value, index, self) {
341
338
  return self.lastIndexOf(value) === index;
342
339
  }
@@ -395,9 +392,9 @@ var telerikReportViewer = (function (exports) {
395
392
  var alpha = colorComponents.length === 4 ? parseFloat((parseFloat(colorComponents[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
396
393
  return alpha;
397
394
  }
398
- function $ajax(ajaxSettings) {
395
+ function $ajax(url, ajaxSettings) {
399
396
  return new Promise(function(resolve, reject) {
400
- $.ajax(ajaxSettings).done(function(data) {
397
+ $.ajax(url, ajaxSettings).done(function(data) {
401
398
  return resolve(data);
402
399
  }).fail(function(xhr, status, error) {
403
400
  reject(toXhrErrorData(xhr, status, error));
@@ -490,7 +487,7 @@ var telerikReportViewer = (function (exports) {
490
487
  isArray: isArray,
491
488
  loadScriptWithCallback: loadScriptWithCallback,
492
489
  loadScript: loadScript,
493
- filterUniqueLastOccurance: filterUniqueLastOccurance,
490
+ filterUniqueLastOccurrence: filterUniqueLastOccurrence,
494
491
  logError: logError,
495
492
  findElement: findElement,
496
493
  toRgbColor: toRgbColor,
@@ -551,7 +548,7 @@ var telerikReportViewer = (function (exports) {
551
548
 
552
549
  var _a;
553
550
  var sr$1 = {
554
- //warning and error string resources
551
+ // warning and error string resources
555
552
  controllerNotInitialized: "Controller is not initialized.",
556
553
  noReportInstance: "No report instance.",
557
554
  missingTemplate: "!obsolete resource!",
@@ -584,7 +581,7 @@ var telerikReportViewer = (function (exports) {
584
581
  promisesChainStopError: "Error shown. Throwing promises chain stop error.",
585
582
  renderingCanceled: "Report processing was canceled.",
586
583
  tryReportPreview: "The report may now be previewed.",
587
- //viewer template string resources
584
+ // viewer template string resources
588
585
  parameterEditorSelectNone: "clear selection",
589
586
  parameterEditorSelectAll: "select all",
590
587
  parametersAreaPreviewButton: "Preview",
@@ -628,7 +625,7 @@ var telerikReportViewer = (function (exports) {
628
625
  sendEmailFormatLabel: "Format:",
629
626
  sendEmailSendLabel: "Send",
630
627
  sendEmailCancelLabel: "Cancel",
631
- //accessibility string resources
628
+ // accessibility string resources
632
629
  ariaLabelPageNumberSelector: "Page number selector. Showing page {0} of {1}.",
633
630
  ariaLabelPageNumberEditor: "Page number editor",
634
631
  ariaLabelExpandable: "Expandable",
@@ -688,7 +685,7 @@ var telerikReportViewer = (function (exports) {
688
685
  ariaLabelSendEmailFormat: "Report format:",
689
686
  ariaLabelSendEmailSend: "Send email",
690
687
  ariaLabelSendEmailCancel: "Cancel sending email",
691
- //search dialog resources
688
+ // search dialog resources
692
689
  searchDialogTitle: "Search in report contents",
693
690
  searchDialogSearchInProgress: "searching...",
694
691
  searchDialogNoResultsLabel: "No results",
@@ -723,16 +720,15 @@ var telerikReportViewer = (function (exports) {
723
720
  var areas;
724
721
  var lastArea;
725
722
  var keyMap = {
726
- //keys for navigating on areas. Used in conjunction with CTRL+ALT to avoid duplicating default shortcuts behavior.
727
723
  CONFIRM_KEY: 13,
724
+ // C
728
725
  CONTENT_AREA_KEY: 67,
729
- //C
726
+ // D
730
727
  DOCUMENT_MAP_AREA_KEY: 68,
731
- //D
728
+ // M
732
729
  MENU_AREA_KEY: 77,
733
- //M
730
+ // P
734
731
  PARAMETERS_AREA_KEY: 80
735
- //P
736
732
  };
737
733
  options = $.extend({}, defaultOptions$7, options);
738
734
  controller = options.controller;
@@ -766,8 +762,7 @@ var telerikReportViewer = (function (exports) {
766
762
  }
767
763
  }
768
764
  function focusOnErrorMessage() {
769
- var selectorChain = ["div.trv-pages-area", "div.trv-error-message"];
770
- var $errMsg = findElement(selectorChain);
765
+ var $errMsg = $("div.trv-pages-area div.trv-error-message");
771
766
  if ($errMsg.length === 0) {
772
767
  return;
773
768
  }
@@ -783,24 +778,16 @@ var telerikReportViewer = (function (exports) {
783
778
  setContentAreaKeyDown(area);
784
779
  }
785
780
  function setPageSelector() {
786
- var $pagers = $(".trv-report-pager");
787
- if ($pagers.length > 0) {
788
- var pageNumber = controller.getCurrentPageNumber();
789
- var pageCount = controller.getPageCount();
790
- each($pagers, function() {
791
- var $pager = $(this);
792
- $pager.attr("aria-label", stringFormat(stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
793
- var $pageInputs = $pager.find("input[data-role=telerik_ReportViewer_PageNumberInput]");
794
- if ($pageInputs.length > 0) {
795
- each($pageInputs, function() {
796
- var $this = $(this);
797
- $this.attr("aria-label", stringResources.ariaLabelPageNumberEditor);
798
- $this.attr("min", "1");
799
- $this.attr("max", "" + pageCount);
800
- });
801
- }
781
+ var pagers = document.querySelectorAll(".trv-report-pager");
782
+ var pageNumber = this._controller.getCurrentPageNumber();
783
+ var pageCount = this._controller.getPageCount();
784
+ pagers.forEach((pager) => {
785
+ pager.setAttribute("aria-label", stringFormat(stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
786
+ var pageInputs = pager.querySelectorAll("input[data-role=telerik_ReportViewer_PageNumberInput]");
787
+ pageInputs.forEach((input) => {
788
+ input.setAttribute("aria-label", stringResources.ariaLabelPageNumberEditor);
802
789
  });
803
- }
790
+ });
804
791
  }
805
792
  function initAreas() {
806
793
  areas = {};
@@ -814,16 +801,16 @@ var telerikReportViewer = (function (exports) {
814
801
  }
815
802
  }
816
803
  function findContentArea() {
817
- return findElement(["div[data-role=telerik_ReportViewer_PagesArea]"]);
804
+ return $("div[data-role=telerik_ReportViewer_PagesArea]");
818
805
  }
819
806
  function findDocumentMapArea() {
820
- return findElement(["div[data-role=telerik_ReportViewer_DocumentMapArea]", "div[data-role=treeview]"]);
807
+ return $("div[data-role=telerik_ReportViewer_DocumentMapArea] div[data-role=treeview]");
821
808
  }
822
809
  function findMenuArea() {
823
- return findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
810
+ return $("ul[data-role=telerik_ReportViewer_MainMenu]");
824
811
  }
825
812
  function findParametersArea() {
826
- return findElement(["div[data-role=telerik_ReportViewer_ParametersArea]", "div.trv-parameters-area-content"]);
813
+ return $("div[data-role=telerik_ReportViewer_ParametersArea] div.trv-parameters-area-content");
827
814
  }
828
815
  function processKeyDown(event) {
829
816
  if (!areas) {
@@ -856,8 +843,8 @@ var telerikReportViewer = (function (exports) {
856
843
  if (!IsAreaContainerVisible($paramsArea)) {
857
844
  return;
858
845
  }
859
- each(parametersAreaContent.children(), function() {
860
- $(this).keydown(function(event) {
846
+ Array.from(parametersAreaContent.children()).forEach((child) => {
847
+ $(child).on("keydown", (event) => {
861
848
  if (event.which == keyMap.CONFIRM_KEY) {
862
849
  var paramsButton = $paramsArea.find("button.trv-parameters-area-preview-button");
863
850
  paramsButton.focus();
@@ -877,11 +864,11 @@ var telerikReportViewer = (function (exports) {
877
864
  if (!actions.length > 0) {
878
865
  return;
879
866
  }
880
- each(actions, function() {
881
- var $action = $(this);
882
- $action.keydown(function(event) {
867
+ Array.from(actions).forEach((action) => {
868
+ var $action = $(action);
869
+ $action.on("keydown", (event) => {
883
870
  if (event.which == keyMap.CONFIRM_KEY) {
884
- $action.click();
871
+ $action.trigger("click");
885
872
  }
886
873
  });
887
874
  });
@@ -891,11 +878,11 @@ var telerikReportViewer = (function (exports) {
891
878
  if (!menuAreas) {
892
879
  return;
893
880
  }
894
- each(menuAreas, function() {
895
- var $menu = $(this);
881
+ Array.from(menuAreas).forEach((menu) => {
882
+ var $menu = $(menu);
896
883
  var menuItems = $menu.children("li.k-item");
897
- each(menuItems, function() {
898
- var $menuItem = $(this);
884
+ Array.from(menuItems).forEach((menuItem) => {
885
+ var $menuItem = $(menuItem);
899
886
  if (!$menuItem.hasClass("trv-report-pager")) {
900
887
  var ariaLabel = $menuItem.attr("aria-label");
901
888
  var expandableSr = stringFormat(". {0}", [stringResources.ariaLabelExpandable]);
@@ -930,56 +917,55 @@ var telerikReportViewer = (function (exports) {
930
917
  viewerInstances: []
931
918
  };
932
919
 
933
- var Binder = {
934
- bind: function($element) {
935
- var args = Array.prototype.slice.call(arguments, 1);
936
- attachCommands($element, args);
937
- var result = $element.find('[data-role^="telerik_ReportViewer_"]');
938
- each(result, function() {
939
- var $this = $(this);
940
- var f = $.fn[$this.attr("data-role")];
941
- if (typeof f === "function") {
942
- f.apply($this, args);
920
+ class Binder {
921
+ static bind($element, ...args) {
922
+ const commands = args[0].commands;
923
+ const viewerOptions = args[1];
924
+ Binder.attachCommands($element, commands, viewerOptions);
925
+ var plugins = $element.find('[data-role^="telerik_ReportViewer_"]');
926
+ Array.from(plugins).forEach((element) => {
927
+ var $element2 = $(element);
928
+ var fn = $.fn[$element2.attr("data-role")];
929
+ if (typeof fn === "function") {
930
+ fn.apply($element2, args);
943
931
  }
944
932
  });
945
933
  }
946
- };
947
- function attachCommands($element, args) {
948
- var commands = args[0].commands;
949
- var viewerOptions = args[1];
950
- var elementSelector = '[data-command^="telerik_ReportViewer_"]';
951
- var customElementSelector = "[data-target-report-viewer]" + elementSelector;
952
- $element.on("click", elementSelector, commandHandler);
953
- if (!GlobalSettings.CommandHandlerAttached) {
954
- $(document.body).on("click", customElementSelector, customCommandHandler);
955
- GlobalSettings.CommandHandlerAttached = true;
956
- }
957
- each(commands, function(key, command) {
958
- attachCommand(key, command, viewerOptions, $element);
959
- });
960
- function commandHandler(e) {
961
- var prefixedDataCommand = $(this).attr("data-command");
962
- if (prefixedDataCommand) {
963
- var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
964
- var cmd = commands[dataCommand];
965
- if (cmd && cmd.enabled()) {
966
- cmd.exec($(this).attr("data-command-parameter"));
934
+ static attachCommands($element, commands, viewerOptions) {
935
+ var elementSelector = '[data-command^="telerik_ReportViewer_"]';
936
+ var customElementSelector = "[data-target-report-viewer]" + elementSelector;
937
+ $element.on("click", elementSelector, commandHandler);
938
+ if (!GlobalSettings.CommandHandlerAttached) {
939
+ $(document.body).on("click", customElementSelector, customCommandHandler);
940
+ GlobalSettings.CommandHandlerAttached = true;
941
+ }
942
+ Object.entries(commands).forEach(([key, command]) => {
943
+ attachCommand(key, command, viewerOptions, $element);
944
+ });
945
+ function commandHandler(event) {
946
+ var prefixedDataCommand = $(this).attr("data-command");
947
+ if (prefixedDataCommand) {
948
+ var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
949
+ var cmd = commands[dataCommand];
950
+ if (cmd && cmd.enabled()) {
951
+ cmd.exec($(this).attr("data-command-parameter"));
952
+ }
953
+ event.preventDefault();
967
954
  }
968
- e.preventDefault();
969
955
  }
970
- }
971
- function customCommandHandler(e) {
972
- var $this = $(this);
973
- var prefixedDataCommand = $this.attr("data-command");
974
- var reportViewerTarget = $this.attr("data-target-report-viewer");
975
- if (prefixedDataCommand && reportViewerTarget) {
976
- var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
977
- var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
978
- var cmd = reportViewer.commands[dataCommand];
979
- if (cmd.enabled()) {
980
- cmd.exec($(this).attr("data-command-parameter"));
956
+ function customCommandHandler(event) {
957
+ var $this = $(this);
958
+ var prefixedDataCommand = $this.attr("data-command");
959
+ var reportViewerTarget = $this.attr("data-target-report-viewer");
960
+ if (prefixedDataCommand && reportViewerTarget) {
961
+ var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
962
+ var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
963
+ var cmd = reportViewer.commands[dataCommand];
964
+ if (cmd.enabled()) {
965
+ cmd.exec($(this).attr("data-command-parameter"));
966
+ }
967
+ event.preventDefault();
981
968
  }
982
- e.preventDefault();
983
969
  }
984
970
  }
985
971
  }
@@ -989,10 +975,10 @@ var telerikReportViewer = (function (exports) {
989
975
  var customElementSelector = '[data-target-report-viewer="' + viewerOptions.selector + '"]' + elementSelector;
990
976
  var $defaultElement = $element.find(elementSelector);
991
977
  var $customElement = $(customElementSelector);
992
- $(cmd).on("enabledChanged", function(e) {
978
+ $(cmd).on("enabledChanged", function(event) {
993
979
  (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($defaultElement.parent("li"), "k-disabled");
994
980
  (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($customElement, viewerOptions.disabledButtonClass);
995
- }).on("checkedChanged", function(e) {
981
+ }).on("checkedChanged", function(event) {
996
982
  var defaultTarget = $defaultElement.parent("li");
997
983
  (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(defaultTarget, getSelectedClassName(defaultTarget));
998
984
  (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call($customElement, viewerOptions.checkedButtonClass);
@@ -1002,97 +988,6 @@ var telerikReportViewer = (function (exports) {
1002
988
  function getSelectedClassName($element) {
1003
989
  return $element.hasClass("trv-menu-toggleable") ? "k-selected !k-bg-primary" : "k-selected";
1004
990
  }
1005
- function LinkButton(dom, options) {
1006
- var cmd;
1007
- var $element = $(dom);
1008
- var dataCommand = $element.attr("data-command");
1009
- if (dataCommand) {
1010
- cmd = options.commands[dataCommand];
1011
- }
1012
- if (cmd) {
1013
- $element.click(function(e) {
1014
- if (cmd.enabled()) {
1015
- cmd.exec($(this).attr("data-command-parameter"));
1016
- } else {
1017
- e.preventDefault();
1018
- }
1019
- });
1020
- $(cmd).on("enabledChanged", function(e) {
1021
- (cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call($element, "disabled");
1022
- }).on("checkedChanged", function(e) {
1023
- (cmd.checked() ? $.fn.addClass : $.fn.removeClass).call($element, "checked");
1024
- });
1025
- }
1026
- }
1027
- var linkButton_pluginName = "telerik_ReportViewer_LinkButton";
1028
- $.fn[linkButton_pluginName] = function(options) {
1029
- return each(this, function() {
1030
- if (!$.data(this, linkButton_pluginName)) {
1031
- $.data(this, linkButton_pluginName, new LinkButton(this, options));
1032
- }
1033
- });
1034
- };
1035
- function PageNumberInput(dom, options) {
1036
- var $element = $(dom);
1037
- var oldValue = 0;
1038
- var cmd = options.commands["goToPage"];
1039
- function setPageNumber(value) {
1040
- if (oldValue !== value || !$element.is(":focus")) {
1041
- $element.val(value);
1042
- oldValue = value;
1043
- }
1044
- }
1045
- options.controller.pageNumberChange(function(e, value) {
1046
- setPageNumber(value);
1047
- });
1048
- $element.change(function() {
1049
- var val = $(this).val();
1050
- var num = tryParseInt(val);
1051
- if (!isNaN(num)) {
1052
- var result = cmd.exec(num);
1053
- setPageNumber(result);
1054
- }
1055
- });
1056
- $element.keydown(function(e) {
1057
- if (e.which == 13) {
1058
- $(this).change();
1059
- return e.preventDefault();
1060
- }
1061
- });
1062
- function validateValue(value) {
1063
- return /^([0-9]+)$/.test(value);
1064
- }
1065
- $element.keypress(function(event) {
1066
- if (isSpecialKey(event.keyCode)) {
1067
- return true;
1068
- }
1069
- var newValue = $element.val() + String.fromCharCode(event.charCode);
1070
- return validateValue(newValue);
1071
- }).on("paste", function(event) {
1072
- });
1073
- }
1074
- var pageNumberInput_pluginName = "telerik_ReportViewer_PageNumberInput";
1075
- $.fn[pageNumberInput_pluginName] = function(options) {
1076
- return each(this, function() {
1077
- if (!$.data(this, pageNumberInput_pluginName)) {
1078
- $.data(this, pageNumberInput_pluginName, new PageNumberInput(this, options));
1079
- }
1080
- });
1081
- };
1082
- function PageCountLabel(dom, options) {
1083
- var $element = $(dom);
1084
- options.controller.pageCountChange(function(e, value) {
1085
- $element.text(value);
1086
- });
1087
- }
1088
- var pageCountLabel_pluginName = "telerik_ReportViewer_PageCountLabel";
1089
- $.fn[pageCountLabel_pluginName] = function(options) {
1090
- return each(this, function() {
1091
- if (!$.data(this, pageCountLabel_pluginName)) {
1092
- $.data(this, pageCountLabel_pluginName, new PageCountLabel(this, options));
1093
- }
1094
- });
1095
- };
1096
991
 
1097
992
  const ViewModes = {
1098
993
  INTERACTIVE: "INTERACTIVE",
@@ -1324,7 +1219,7 @@ var telerikReportViewer = (function (exports) {
1324
1219
  function getPdfPlugin() {
1325
1220
  var classIds = ["AcroPDF.PDF.1", "PDF.PdfCtrl.6", "PDF.PdfCtrl.5"];
1326
1221
  var plugin = null;
1327
- each(classIds, function(index, classId) {
1222
+ $.each(classIds, function(index, classId) {
1328
1223
  try {
1329
1224
  plugin = new ActiveXObject(classId);
1330
1225
  if (plugin) {
@@ -1368,7 +1263,7 @@ var telerikReportViewer = (function (exports) {
1368
1263
  function hasPdfPlugin2() {
1369
1264
  var navPlugins = navigator.plugins;
1370
1265
  var found = false;
1371
- each(navPlugins, function(key, value) {
1266
+ $.each(navPlugins, function(key, value) {
1372
1267
  if (navPlugins[key].name === defaultPlugin || navPlugins[key].name === "Adobe Acrobat") {
1373
1268
  found = true;
1374
1269
  return false;
@@ -1402,8 +1297,7 @@ var telerikReportViewer = (function (exports) {
1402
1297
  return ChromiumHelper("Chrome PDF Viewer");
1403
1298
  else if (userAgent.indexOf("safari") > -1)
1404
1299
  return ChromiumHelper("WebKit built-in PDF");
1405
- else
1406
- return OtherBrowserHelper();
1300
+ return OtherBrowserHelper();
1407
1301
  }
1408
1302
  return null;
1409
1303
  }
@@ -1489,9 +1383,8 @@ var telerikReportViewer = (function (exports) {
1489
1383
  if (value == null || value.length == 0) {
1490
1384
  if (parameter.allowNull) {
1491
1385
  return value;
1492
- } else {
1493
- throw stringResources.invalidParameter;
1494
1386
  }
1387
+ throw stringResources.invalidParameter;
1495
1388
  }
1496
1389
  return values;
1497
1390
  }
@@ -1502,10 +1395,8 @@ var telerikReportViewer = (function (exports) {
1502
1395
  }
1503
1396
  function checkAvailableValues(parameter, value, compareFunc) {
1504
1397
  if (parameter.availableValues) {
1505
- var found = false;
1506
- each(parameter.availableValues, function(i, av) {
1507
- found = compareFunc(value, av.value);
1508
- return !found;
1398
+ var found = Array.from(parameter.availableValues).some(function(av) {
1399
+ return compareFunc(value, av.value);
1509
1400
  });
1510
1401
  if (!found) {
1511
1402
  if (parameter.allowNull && !value) {
@@ -1612,7 +1503,7 @@ var telerikReportViewer = (function (exports) {
1612
1503
  parameter,
1613
1504
  value,
1614
1505
  function(value2) {
1615
- if (-1 != ["true", "false"].indexOf(("" + value2).toLowerCase())) {
1506
+ if (-1 != ["true", "false"].indexOf(String(value2).toLowerCase())) {
1616
1507
  return Boolean(value2);
1617
1508
  }
1618
1509
  if (isNull(parameter, value2)) {
@@ -1682,16 +1573,130 @@ var telerikReportViewer = (function (exports) {
1682
1573
  };
1683
1574
  }
1684
1575
 
1685
- function EventEmitter() {
1686
- var _emitter = $({});
1687
- return {
1688
- on: function(eventName, handler) {
1689
- _emitter.on(eventName, handler);
1690
- },
1691
- trigger: function(eventName, ...args) {
1692
- _emitter.trigger(eventName, ...args);
1576
+ var __defProp$6 = Object.defineProperty;
1577
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1578
+ var __publicField$5 = (obj, key, value) => {
1579
+ __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
1580
+ return value;
1581
+ };
1582
+ class EventEmitter extends EventTarget {
1583
+ constructor() {
1584
+ super();
1585
+ __publicField$5(this, "_events");
1586
+ __publicField$5(this, "_eventsCount");
1587
+ this._events = {};
1588
+ this._eventsCount = 0;
1589
+ }
1590
+ /**
1591
+ * @param {string} type
1592
+ * @param {(event: CustomEvent, ...args: any[]) => void} listener
1593
+ * @returns
1594
+ */
1595
+ addListener(type, listener) {
1596
+ if (typeof listener !== "function") {
1597
+ throw new TypeError("listener must be a function");
1693
1598
  }
1694
- };
1599
+ if (!this._events[type]) {
1600
+ this._events[type] = [];
1601
+ }
1602
+ function wrappedListener(event) {
1603
+ listener.call(this, event, ...event.detail);
1604
+ }
1605
+ wrappedListener.listener = listener;
1606
+ this._events[type].push(wrappedListener);
1607
+ this._eventsCount++;
1608
+ this.addEventListener(type, wrappedListener.bind(this));
1609
+ return this;
1610
+ }
1611
+ /**
1612
+ * @alias addListener
1613
+ * @param {string} type
1614
+ * @param {(event: CustomEvent, ...args: any[]) => void} listener
1615
+ * @returns
1616
+ */
1617
+ on(type, listener) {
1618
+ return this.addListener(type, listener);
1619
+ }
1620
+ /**
1621
+ * @param {string} type
1622
+ * @param {any[]} args
1623
+ * @returns
1624
+ */
1625
+ trigger(type, ...args) {
1626
+ if (!this._events[type]) {
1627
+ return void 0;
1628
+ }
1629
+ const event = new CustomEvent(type, {
1630
+ detail: args,
1631
+ cancelable: true
1632
+ });
1633
+ return this.dispatchEvent(event);
1634
+ }
1635
+ /**
1636
+ * @alias trigger
1637
+ * @param {string} type
1638
+ * @param {any[]} args
1639
+ * @returns
1640
+ */
1641
+ emit(type, ...args) {
1642
+ return this.trigger(type, ...args);
1643
+ }
1644
+ /**
1645
+ * @param {string} type
1646
+ * @param {(event: CustomEvent, ...args: any[]) => void} listener
1647
+ * @returns
1648
+ */
1649
+ removeListener(type, listener) {
1650
+ if (!this._events[type]) {
1651
+ return this;
1652
+ }
1653
+ this._events[type] = this._events[type].filter((wrappedListener) => {
1654
+ if (wrappedListener.listener !== listener) {
1655
+ return true;
1656
+ }
1657
+ this.removeEventListener(type, wrappedListener);
1658
+ return false;
1659
+ });
1660
+ if (this._events[type].length === 0) {
1661
+ delete this._events[type];
1662
+ this._eventsCount--;
1663
+ }
1664
+ return this;
1665
+ }
1666
+ /**
1667
+ * @param {string} type
1668
+ * @returns
1669
+ */
1670
+ removeAllListeners(type) {
1671
+ if (type === void 0) {
1672
+ Object.keys(this._events).forEach((eventType) => {
1673
+ this.removeAllListeners(eventType);
1674
+ });
1675
+ return this;
1676
+ }
1677
+ if (this._events[type]) {
1678
+ this._events[type].forEach((wrappedListener) => {
1679
+ this.removeEventListener(type, wrappedListener);
1680
+ });
1681
+ delete this._events[type];
1682
+ this._eventsCount--;
1683
+ }
1684
+ return this;
1685
+ }
1686
+ /**
1687
+ * @param {string} type
1688
+ * @param {(event: CustomEvent, ...args: any[]) => void} listener
1689
+ * @returns
1690
+ */
1691
+ off(type, listener) {
1692
+ if (type === void 0) {
1693
+ return this.removeAllListeners();
1694
+ }
1695
+ if (listener === void 0) {
1696
+ return this.removeAllListeners(type);
1697
+ }
1698
+ return this.removeListener(type, listener);
1699
+ }
1695
1700
  }
1696
1701
 
1697
1702
  var defaultOptions$6 = {
@@ -1722,7 +1727,7 @@ var telerikReportViewer = (function (exports) {
1722
1727
  var eventEmitter = new EventEmitter();
1723
1728
  var serviceClientSentinel;
1724
1729
  clearReportState();
1725
- options = extend({}, defaultOptions$6, options);
1730
+ options = $.extend({}, defaultOptions$6, options);
1726
1731
  var settings = options.settings;
1727
1732
  if (typeof settings.getPrintMode === "function") {
1728
1733
  printMode = settings.getPrintMode();
@@ -1861,18 +1866,16 @@ var telerikReportViewer = (function (exports) {
1861
1866
  return client.getDocumentInfo(clientId2, instanceId, documentId).catch(handleRequestError).then(function(info) {
1862
1867
  if (info && info.documentReady) {
1863
1868
  return info;
1864
- } else {
1865
- info["promise"] = new Promise(function(resolve, reject) {
1866
- window.setTimeout(resolve, options2.documentInfoPollIntervalMs);
1867
- }).then(function() {
1868
- return getDocumentInfoRecursive(clientId2, instanceId, documentId, options2);
1869
- });
1870
- return info;
1871
1869
  }
1870
+ info["promise"] = new Promise(function(resolve, reject) {
1871
+ window.setTimeout(resolve, options2.documentInfoPollIntervalMs);
1872
+ }).then(function() {
1873
+ return getDocumentInfoRecursive(clientId2, instanceId, documentId, options2);
1874
+ });
1875
+ return info;
1872
1876
  });
1873
- } else {
1874
- return Promise.reject();
1875
1877
  }
1878
+ return Promise.reject();
1876
1879
  }
1877
1880
  function ReportLoader(reportHost, useCache, baseDocumentId, actionId) {
1878
1881
  var loaderOptions = {};
@@ -2230,7 +2233,7 @@ var telerikReportViewer = (function (exports) {
2230
2233
  if (typeof args[0] === "function") {
2231
2234
  eventEmitter.on(event, args[0]);
2232
2235
  } else {
2233
- eventEmitter.trigger(event, args);
2236
+ eventEmitter.trigger(event, ...args);
2234
2237
  }
2235
2238
  return controller;
2236
2239
  }
@@ -2259,11 +2262,10 @@ var telerikReportViewer = (function (exports) {
2259
2262
  var node = nodes[i];
2260
2263
  if (node.id === id) {
2261
2264
  return node.page;
2262
- } else {
2263
- var page = getPageForBookmark(node.items, id);
2264
- if (page) {
2265
- return page;
2266
- }
2265
+ }
2266
+ var page = getPageForBookmark(node.items, id);
2267
+ if (page) {
2268
+ return page;
2267
2269
  }
2268
2270
  }
2269
2271
  }
@@ -2440,7 +2442,7 @@ var telerikReportViewer = (function (exports) {
2440
2442
  MISSING_OR_INVALID_PARAMETERS: "missingOrInvalidParameters",
2441
2443
  RENDERING_STOPPED: "renderingStopped"
2442
2444
  };
2443
- extend(
2445
+ $.extend(
2444
2446
  controller,
2445
2447
  {
2446
2448
  getPageData: function(pageNumber) {
@@ -2455,7 +2457,7 @@ var telerikReportViewer = (function (exports) {
2455
2457
  }
2456
2458
  return {
2457
2459
  report,
2458
- parameters: extend({}, parameterValues)
2460
+ parameters: $.extend({}, parameterValues)
2459
2461
  };
2460
2462
  },
2461
2463
  setReportSource: function(rs) {
@@ -2471,7 +2473,7 @@ var telerikReportViewer = (function (exports) {
2471
2473
  return this;
2472
2474
  },
2473
2475
  updateSettings: function(settings2) {
2474
- options.settings = extend({}, settings2, options.settings);
2476
+ options.settings = $.extend({}, settings2, options.settings);
2475
2477
  },
2476
2478
  clearReportSource: function() {
2477
2479
  report = parameterValues = null;
@@ -2582,6 +2584,9 @@ var telerikReportViewer = (function (exports) {
2582
2584
  });
2583
2585
  },
2584
2586
  getReportParameters: function() {
2587
+ if (!parameterValues) {
2588
+ return [];
2589
+ }
2585
2590
  var paramsToBeExposed = {};
2586
2591
  for (var key in processedParameterValues) {
2587
2592
  var processedParam = processedParameterValues[key];
@@ -2613,13 +2618,13 @@ var telerikReportViewer = (function (exports) {
2613
2618
  var parameterValues2 = {};
2614
2619
  var invalidParameters = [];
2615
2620
  var hasError = false;
2616
- each(parameters || [], function() {
2621
+ Array.from(parameters || []).forEach((parameter) => {
2617
2622
  try {
2618
- var value = parameterValidators.validate(this, this.value);
2619
- parameterValues2[this.id] = value;
2623
+ var value = parameterValidators.validate(parameter, parameter.value);
2624
+ parameterValues2[parameter.id] = value;
2620
2625
  } catch (e) {
2621
2626
  hasError = true;
2622
- invalidParameters.push(this);
2627
+ invalidParameters.push(parameter);
2623
2628
  return;
2624
2629
  }
2625
2630
  });
@@ -2696,8 +2701,8 @@ var telerikReportViewer = (function (exports) {
2696
2701
  eventEmitter.on(eventName, handler);
2697
2702
  return controller;
2698
2703
  },
2699
- trigger: function(eventName, args) {
2700
- eventEmitter.trigger(eventName, args);
2704
+ trigger: function(eventName, ...args) {
2705
+ eventEmitter.trigger(eventName, ...args);
2701
2706
  return controller;
2702
2707
  },
2703
2708
  showNotification: function(...args) {
@@ -3389,11 +3394,11 @@ var telerikReportViewer = (function (exports) {
3389
3394
  _loadVisiblePages: function _loadVisiblePages() {
3390
3395
  var that = this;
3391
3396
  var pages = that.$placeholder.find(".trv-report-page");
3392
- $.each(pages, function(index, value) {
3397
+ Array.from(pages).forEach((value) => {
3393
3398
  var pageItem = $(value);
3394
3399
  var pageNumber = parseInt(pageItem.attr("data-page"));
3395
3400
  if (that._scrolledInToView(pageItem) && that._isSkeletonScreen(pageItem, pageNumber)) {
3396
- that.controller.getPageData(pageNumber).then(function(newPage) {
3401
+ that.controller.getPageData(pageNumber).then((newPage) => {
3397
3402
  that._render(newPage, false);
3398
3403
  });
3399
3404
  }
@@ -3564,9 +3569,8 @@ var telerikReportViewer = (function (exports) {
3564
3569
  return that._findNewCurrentPage(pages.splice(middleIndex, Number.MAX_VALUE));
3565
3570
  } else if (result > 0 && pages.length > 1) {
3566
3571
  return that._findNewCurrentPage(pages.splice(0, middleIndex));
3567
- } else {
3568
- return -1;
3569
3572
  }
3573
+ return -1;
3570
3574
  },
3571
3575
  _findPageInViewPort: function _findPageInViewPort(index, pages) {
3572
3576
  var pageItem = this.$placeholder.find(pages[index]);
@@ -3583,9 +3587,8 @@ var telerikReportViewer = (function (exports) {
3583
3587
  }
3584
3588
  if (pageBottom < additionalTopOffset) {
3585
3589
  return -1;
3586
- } else {
3587
- return 1;
3588
3590
  }
3591
+ return 1;
3589
3592
  },
3590
3593
  _scrollDown: function _scrollDown(pages, scrollPosition) {
3591
3594
  var that = this;
@@ -3644,21 +3647,21 @@ var telerikReportViewer = (function (exports) {
3644
3647
  var UIFreezeCoordinator = {
3645
3648
  $placeholder: null,
3646
3649
  $scrollableContainer: null,
3647
- itemsInitialState: {},
3648
3650
  // Holds all items initial position per container
3651
+ itemsInitialState: {},
3652
+ // Holds the bounds of the frozen areas by X per container
3649
3653
  xFrozenAreasBounds: {},
3650
- //Holds the bounds of the frozen areas by X per container
3654
+ // Holds the bounds of the frozen areas by Y per container
3651
3655
  yFrozenAreasBounds: {},
3652
- //Holds the bounds of the frozen areas by Y per container
3653
3656
  freezeMaxZIndex: {},
3654
3657
  zIndex: 1,
3655
- freezeBGColor: {},
3656
3658
  // Holds default background-color value per container
3657
- currentlyfreezedContainer: {
3659
+ freezeBGColor: {},
3660
+ // Holds whether freezing has been applied per container.
3661
+ currentlyFrozenContainer: {
3658
3662
  vertical: {},
3659
3663
  horizontal: {}
3660
3664
  },
3661
- //Holds whether freezing has been applied per container.
3662
3665
  isInitialize: false,
3663
3666
  scaleFactor: null,
3664
3667
  /**
@@ -3786,28 +3789,28 @@ var telerikReportViewer = (function (exports) {
3786
3789
  var horizontalMoveOffset = scrollableContainerScrollLeft - elementWrapperLeftPosition;
3787
3790
  if (hasFixColumn && verticalMoveOffset > 0) {
3788
3791
  if (scrollableContainerScrollTop <= $elementWrapper.outerHeight() * this.scaleFactor + elementWrapperTopPosition - this.yFrozenAreasBounds[freezeItemsContainerID].height) {
3789
- this.currentlyfreezedContainer.vertical[freezeItemsContainerID] = true;
3792
+ this.currentlyFrozenContainer.vertical[freezeItemsContainerID] = true;
3790
3793
  this._updateUIElementsPosition($colHeaders, "top", verticalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3791
3794
  }
3792
3795
  } else {
3793
- if (this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3794
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3796
+ if (this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3797
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3795
3798
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3796
3799
  }
3797
3800
  }
3798
3801
  if (hasFixRow && horizontalMoveOffset > 0) {
3799
3802
  if (scrollableContainerScrollLeft <= $elementWrapper.outerWidth() * this.scaleFactor + elementWrapperLeftPosition - this.xFrozenAreasBounds[freezeItemsContainerID].width) {
3800
- this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] = true;
3803
+ this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] = true;
3801
3804
  this._updateUIElementsPosition($rowHeaders, "left", horizontalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3802
3805
  }
3803
3806
  } else {
3804
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID]) {
3805
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3807
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID]) {
3808
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3806
3809
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3807
3810
  }
3808
3811
  }
3809
3812
  } else {
3810
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3813
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3811
3814
  this._resetToDefaultPosition(freezeItemsContainerID);
3812
3815
  }
3813
3816
  }
@@ -3822,8 +3825,8 @@ var telerikReportViewer = (function (exports) {
3822
3825
  var $colHeaders = $("[data-sticky-direction*='Vertical'][data-sticky-id='" + freezeItemsContainerID + "']");
3823
3826
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3824
3827
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3825
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3826
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3828
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3829
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3827
3830
  },
3828
3831
  /**
3829
3832
  * Update the freeze elements position
@@ -3866,6 +3869,7 @@ var telerikReportViewer = (function (exports) {
3866
3869
  $item.css(newStyleRules);
3867
3870
  }
3868
3871
  },
3872
+ // eslint-disable-next-line max-params
3869
3873
  _applyBgColorOnScroll: function($item, isItemFrozenBothDirection, hasInitialBgColor, shouldApplyBGColor, freezeItemsContainerID) {
3870
3874
  if ($item.is("img")) {
3871
3875
  return true;
@@ -3884,7 +3888,7 @@ var telerikReportViewer = (function (exports) {
3884
3888
  return getColorAlphaValue(bgColorValue) > 0;
3885
3889
  },
3886
3890
  _isFrozen: function(freezeItemsContainerID) {
3887
- return this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3891
+ return this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3888
3892
  },
3889
3893
  /**
3890
3894
  * Checks if an UI element is in the visible part of the scrollable container
@@ -3942,7 +3946,7 @@ var telerikReportViewer = (function (exports) {
3942
3946
  var reportPageIsLoaded = false;
3943
3947
  var pageAreaImageStyle = '.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}';
3944
3948
  var pageAreaImageID = "trv-initial-image-styles";
3945
- var scroll = extend({}, Scroll, {});
3949
+ var scroll = $.extend({}, Scroll);
3946
3950
  var uiFreezeCoordinator = null;
3947
3951
  init();
3948
3952
  if (scroll) {
@@ -4028,7 +4032,7 @@ var telerikReportViewer = (function (exports) {
4028
4032
  enableInteractivity();
4029
4033
  }
4030
4034
  if (args.containsFrozenContent && !uiFreezeCoordinator) {
4031
- uiFreezeCoordinator = extend({}, UIFreezeCoordinator, {});
4035
+ uiFreezeCoordinator = $.extend({}, UIFreezeCoordinator);
4032
4036
  if (controller.getViewMode() === ViewModes.INTERACTIVE) {
4033
4037
  uiFreezeCoordinator.init($placeholder);
4034
4038
  }
@@ -4168,19 +4172,13 @@ var telerikReportViewer = (function (exports) {
4168
4172
  var result;
4169
4173
  var allPages = $pageContainer.find(".trv-report-page");
4170
4174
  if (controller.getPageMode() === PageModes.SINGLE_PAGE) {
4171
- each(allPages, function(index, page) {
4172
- if (pageNo(page) === pageNumber) {
4173
- result = page;
4174
- }
4175
- return !result;
4175
+ result = Array.from(allPages).find((page) => {
4176
+ return pageNo(page) === pageNumber;
4176
4177
  });
4177
4178
  } else {
4178
- $.each(allPages, function(index, page) {
4179
+ result = Array.from(allPages).find((page) => {
4179
4180
  var dataPageNumber = parseInt($(page).attr("data-page"));
4180
- if (dataPageNumber === pageNumber) {
4181
- result = page;
4182
- return false;
4183
- }
4181
+ return dataPageNumber === pageNumber;
4184
4182
  });
4185
4183
  }
4186
4184
  return result;
@@ -4392,14 +4390,9 @@ var telerikReportViewer = (function (exports) {
4392
4390
  }
4393
4391
  function getAction(actionId) {
4394
4392
  if (actions) {
4395
- var action;
4396
- each(actions, function() {
4397
- if (this.Id === actionId) {
4398
- action = this;
4399
- }
4400
- return action === void 0;
4393
+ return Array.from(actions).find(function(action) {
4394
+ return action.Id === actionId;
4401
4395
  });
4402
- return action;
4403
4396
  }
4404
4397
  return null;
4405
4398
  }
@@ -4534,14 +4527,6 @@ var telerikReportViewer = (function (exports) {
4534
4527
  $("#" + pageAreaImageID).remove();
4535
4528
  }
4536
4529
  }
4537
- var pluginName$7 = "telerik_ReportViewer_PagesArea";
4538
- $.fn[pluginName$7] = function(options, otherOptions) {
4539
- return each(this, function() {
4540
- if (!$.data(this, pluginName$7)) {
4541
- $.data(this, pluginName$7, new PagesArea(this, options, otherOptions));
4542
- }
4543
- });
4544
- };
4545
4530
 
4546
4531
  var parameterEditorsMatch = {
4547
4532
  // AvailableValues PROVIDED, MultiValue is TRUE and trv.parameters.editors.multiSelect is unset
@@ -4769,8 +4754,8 @@ var telerikReportViewer = (function (exports) {
4769
4754
  }
4770
4755
  function applyAriaSelected(selection) {
4771
4756
  var children = $list.find(".trv-listviewitem");
4772
- each(children, function() {
4773
- var $item = $(this);
4757
+ Array.from(children).forEach((item) => {
4758
+ var $item = $(item);
4774
4759
  var isSelected = selection.filter($item).length > 0;
4775
4760
  $item.attr("aria-selected", isSelected);
4776
4761
  });
@@ -4853,9 +4838,9 @@ var telerikReportViewer = (function (exports) {
4853
4838
  items = [items];
4854
4839
  }
4855
4840
  var children = $list.find(".trv-listviewitem");
4856
- each(parameter.availableValues, function(i, av) {
4841
+ $.each(parameter.availableValues, (i, av) => {
4857
4842
  var selected = false;
4858
- each(items, function(j, v) {
4843
+ $.each(items, (j, v) => {
4859
4844
  var availableValue = av.value;
4860
4845
  if (v instanceof Date) {
4861
4846
  availableValue = parseToLocalDate(av.value);
@@ -4894,8 +4879,8 @@ var telerikReportViewer = (function (exports) {
4894
4879
  addAccessibilityAttributes($list, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
4895
4880
  $list.attr("aria-multiselectable", "true");
4896
4881
  var items = $list.find(".trv-listviewitem");
4897
- each(items, function() {
4898
- $(this).attr("aria-label", this.innerText);
4882
+ Array.from(items).forEach((item) => {
4883
+ $(item).attr("aria-label", item.innerText);
4899
4884
  });
4900
4885
  },
4901
4886
  setAccessibilityErrorState: function(param) {
@@ -5024,8 +5009,8 @@ var telerikReportViewer = (function (exports) {
5024
5009
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5025
5010
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
5026
5011
  var items = editor.items();
5027
- each(items, function() {
5028
- $(this).attr("aria-label", this.innerText);
5012
+ Array.from(items).forEach((item) => {
5013
+ $(item).attr("aria-label", item.innerText);
5029
5014
  });
5030
5015
  },
5031
5016
  setAccessibilityErrorState: function(param) {
@@ -5087,7 +5072,7 @@ var telerikReportViewer = (function (exports) {
5087
5072
  }
5088
5073
  function setSelectedItems(value) {
5089
5074
  var items = $list.find(".trv-listviewitem");
5090
- each(parameter.availableValues, function(i, av) {
5075
+ $.each(parameter.availableValues, (i, av) => {
5091
5076
  var availableValue = av.value;
5092
5077
  if (value instanceof Date) {
5093
5078
  availableValue = parseToLocalDate(av.value);
@@ -5131,8 +5116,8 @@ var telerikReportViewer = (function (exports) {
5131
5116
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5132
5117
  addAccessibilityAttributes($list, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5133
5118
  var items = $list.find(".trv-listviewitem");
5134
- each(items, function() {
5135
- $(this).attr("aria-label", this.innerText);
5119
+ Array.from(items).forEach((item) => {
5120
+ $(item).attr("aria-label", item.innerText);
5136
5121
  });
5137
5122
  },
5138
5123
  setAccessibilityErrorState: function(param) {
@@ -5222,8 +5207,8 @@ var telerikReportViewer = (function (exports) {
5222
5207
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5223
5208
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5224
5209
  var items = editor.items();
5225
- each(items, function() {
5226
- $(this).attr("aria-label", this.innerText);
5210
+ Array.from(items).forEach((item) => {
5211
+ $(item).attr("aria-label", item.innerText);
5227
5212
  });
5228
5213
  },
5229
5214
  setAccessibilityErrorState: function(param) {
@@ -5587,39 +5572,58 @@ var telerikReportViewer = (function (exports) {
5587
5572
  };
5588
5573
  }
5589
5574
 
5575
+ var __defProp$5 = Object.defineProperty;
5576
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5577
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5578
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5579
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5580
+ var __spreadValues = (a, b) => {
5581
+ for (var prop in b || (b = {}))
5582
+ if (__hasOwnProp.call(b, prop))
5583
+ __defNormalProp$5(a, prop, b[prop]);
5584
+ if (__getOwnPropSymbols)
5585
+ for (var prop of __getOwnPropSymbols(b)) {
5586
+ if (__propIsEnum.call(b, prop))
5587
+ __defNormalProp$5(a, prop, b[prop]);
5588
+ }
5589
+ return a;
5590
+ };
5590
5591
  var JSON_CONTENT_TYPE = "application/json; charset=UTF-8";
5591
5592
  var URLENCODED_CONTENT_TYPE = "application/x-www-form-urlencoded; charset=UTF-8";
5592
5593
  var HTTP_GET = "GET";
5593
5594
  var HTTP_POST = "POST";
5594
5595
  var HTTP_DELETE = "DELETE";
5595
5596
  var defaultOptions$4 = {};
5597
+ function getHeaders(authorizationToken) {
5598
+ const headers = {
5599
+ "Accept": "application/json, text/javascript, */*; q=0.01"
5600
+ };
5601
+ if (authorizationToken) {
5602
+ headers["Authorization"] = "Bearer " + authorizationToken;
5603
+ }
5604
+ return headers;
5605
+ }
5596
5606
  function ServiceClient(options) {
5597
- options = extend({}, defaultOptions$4, options);
5607
+ options = $.extend({}, defaultOptions$4, options);
5598
5608
  var baseUrl = rTrim(options.serviceUrl || options.baseUrl, "\\/");
5599
5609
  var loginPromise;
5600
5610
  var _ajax = $ajax;
5601
5611
  function validateClientID(clientID) {
5602
- if (!clientID)
5612
+ if (!clientID) {
5603
5613
  throw "Invalid clientID";
5614
+ }
5604
5615
  }
5605
5616
  function urlFromTemplate(template, args) {
5606
- args = extend({}, { baseUrl }, args);
5617
+ args = $.extend({}, { baseUrl }, args);
5607
5618
  return stringFormat(template, args);
5608
5619
  }
5609
- function getHeaderSettings(authorizationToken) {
5610
- return authorizationToken ? {
5611
- headers: {
5612
- Authorization: "Bearer " + authorizationToken
5613
- }
5614
- } : {};
5615
- }
5616
5620
  function login() {
5617
5621
  if (!loginPromise) {
5618
5622
  var loginInfo = options.loginInfo;
5619
5623
  if (loginInfo && loginInfo.url && (loginInfo.username || loginInfo.password)) {
5620
- loginPromise = _ajax({
5621
- url: loginInfo.url,
5622
- type: HTTP_POST,
5624
+ const endPoint = loginInfo.url;
5625
+ loginPromise = _ajax(endPoint, {
5626
+ method: HTTP_POST,
5623
5627
  data: {
5624
5628
  grant_type: "password",
5625
5629
  username: loginInfo.username,
@@ -5639,22 +5643,18 @@ var telerikReportViewer = (function (exports) {
5639
5643
  return {
5640
5644
  _urlFromTemplate: urlFromTemplate,
5641
5645
  registerClient: function(settings) {
5646
+ const endPoint = `${baseUrl}/clients`;
5642
5647
  return login().then(function(authorizationToken) {
5643
- var ajaxSettings = extend(
5644
- getHeaderSettings(authorizationToken),
5645
- settings,
5646
- {
5647
- type: HTTP_POST,
5648
- url: urlFromTemplate("{baseUrl}/clients"),
5649
- dataType: "json",
5650
- //Used to avoid Chrome caching functionality for simple async requests
5651
- //when the first request is not completed the second request is not send
5652
- //and the same response is used for both of the request. In this case the
5653
- //second client is not registered to the service and the same clientId is used.
5654
- data: JSON.stringify({ timeStamp: Date.now() })
5655
- }
5656
- );
5657
- return _ajax(ajaxSettings);
5648
+ return _ajax(endPoint, __spreadValues({
5649
+ headers: getHeaders(authorizationToken),
5650
+ method: HTTP_POST,
5651
+ dataType: "json",
5652
+ // Used to avoid Chrome caching functionality for simple async requests
5653
+ // when the first request is not completed the second request is not send
5654
+ // and the same response is used for both of the request. In this case the
5655
+ // second client is not registered to the service and the same clientId is used.
5656
+ data: JSON.stringify({ timeStamp: Date.now() })
5657
+ }, settings));
5658
5658
  }).then(function(clientData) {
5659
5659
  if (clientData.Message) {
5660
5660
  throw clientData.Message;
@@ -5664,290 +5664,189 @@ var telerikReportViewer = (function (exports) {
5664
5664
  },
5665
5665
  unregisterClient: function(clientID, settings) {
5666
5666
  validateClientID(clientID);
5667
+ const endPoint = `${baseUrl}/clients/${clientID}`;
5667
5668
  return login().then(function(authorizationToken) {
5668
- var ajaxSettings = extend(
5669
- getHeaderSettings(authorizationToken),
5670
- settings,
5671
- {
5672
- type: HTTP_DELETE,
5673
- url: urlFromTemplate("{baseUrl}/clients/{clientID}", { clientID })
5674
- }
5675
- );
5676
- return _ajax(ajaxSettings);
5669
+ return _ajax(endPoint, __spreadValues({
5670
+ headers: getHeaders(authorizationToken),
5671
+ method: HTTP_DELETE
5672
+ }, settings));
5677
5673
  });
5678
5674
  },
5679
5675
  getParameters: function(clientID, report, parameterValues, settings) {
5680
5676
  validateClientID(clientID);
5677
+ const endPoint = `${baseUrl}/clients/${clientID}/parameters`;
5681
5678
  return login().then(function(authorizationToken) {
5682
- var ajaxSettings = extend(
5683
- getHeaderSettings(authorizationToken),
5684
- settings,
5685
- {
5686
- type: HTTP_POST,
5687
- url: urlFromTemplate("{baseUrl}/clients/{clientID}/parameters", { clientID }),
5688
- contentType: JSON_CONTENT_TYPE,
5689
- dataType: "json",
5690
- data: JSON.stringify({ report, parameterValues })
5691
- }
5692
- );
5693
- return _ajax(ajaxSettings);
5679
+ return _ajax(endPoint, __spreadValues({
5680
+ headers: getHeaders(authorizationToken),
5681
+ method: HTTP_POST,
5682
+ contentType: JSON_CONTENT_TYPE,
5683
+ dataType: "json",
5684
+ data: JSON.stringify({ report, parameterValues })
5685
+ }, settings));
5694
5686
  });
5695
5687
  },
5696
5688
  createReportInstance: function(clientID, report, parameterValues, settings) {
5697
5689
  validateClientID(clientID);
5690
+ const endPoint = `${baseUrl}/clients/${clientID}/instances`;
5698
5691
  return login().then(function(authorizationToken) {
5699
- var ajaxSettings = extend(
5700
- getHeaderSettings(authorizationToken),
5701
- settings,
5702
- {
5703
- type: HTTP_POST,
5704
- url: urlFromTemplate("{baseUrl}/clients/{clientID}/instances", { clientID }),
5705
- contentType: JSON_CONTENT_TYPE,
5706
- dataType: "json",
5707
- data: JSON.stringify({ report, parameterValues })
5708
- }
5709
- );
5710
- return _ajax(ajaxSettings);
5692
+ return _ajax(endPoint, __spreadValues({
5693
+ headers: getHeaders(authorizationToken),
5694
+ method: HTTP_POST,
5695
+ contentType: JSON_CONTENT_TYPE,
5696
+ dataType: "json",
5697
+ data: JSON.stringify({ report, parameterValues })
5698
+ }, settings));
5711
5699
  }).then(function(instanceData) {
5712
5700
  return instanceData.instanceId;
5713
5701
  });
5714
5702
  },
5715
5703
  deleteReportInstance: function(clientID, instanceID, settings) {
5716
5704
  validateClientID(clientID);
5705
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}`;
5717
5706
  return login().then(function(authorizationToken) {
5718
- var ajaxSettings = extend(
5719
- getHeaderSettings(authorizationToken),
5720
- settings,
5721
- {
5722
- type: HTTP_DELETE,
5723
- url: urlFromTemplate("{baseUrl}/clients/{clientID}/instances/{instanceID}", { clientID, instanceID })
5724
- }
5725
- );
5726
- return _ajax(ajaxSettings);
5707
+ return _ajax(endPoint, __spreadValues({
5708
+ headers: getHeaders(authorizationToken),
5709
+ method: HTTP_DELETE
5710
+ }, settings));
5727
5711
  });
5728
5712
  },
5713
+ // eslint-disable-next-line max-params
5729
5714
  createReportDocument: function(clientID, instanceID, format, deviceInfo, useCache, baseDocumentID, actionID, settings) {
5730
5715
  validateClientID(clientID);
5716
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents`;
5731
5717
  return login().then(function(authorizationToken) {
5732
5718
  deviceInfo = deviceInfo || {};
5733
5719
  deviceInfo["BasePath"] = baseUrl;
5734
- var ajaxSettings = extend(
5735
- getHeaderSettings(authorizationToken),
5736
- settings,
5737
- {
5738
- type: HTTP_POST,
5739
- url: urlFromTemplate("{baseUrl}/clients/{clientID}/instances/{instanceID}/documents", { clientID, instanceID }),
5740
- contentType: JSON_CONTENT_TYPE,
5741
- dataType: "json",
5742
- data: JSON.stringify(
5743
- {
5744
- format,
5745
- deviceInfo,
5746
- useCache,
5747
- baseDocumentID,
5748
- actionID
5749
- }
5750
- )
5751
- }
5752
- );
5753
- return _ajax(ajaxSettings);
5720
+ return _ajax(endPoint, __spreadValues({
5721
+ headers: getHeaders(authorizationToken),
5722
+ method: HTTP_POST,
5723
+ contentType: JSON_CONTENT_TYPE,
5724
+ dataType: "json",
5725
+ data: JSON.stringify({
5726
+ format,
5727
+ deviceInfo,
5728
+ useCache,
5729
+ baseDocumentID,
5730
+ actionID
5731
+ })
5732
+ }, settings));
5754
5733
  }).then(function(documentData) {
5755
5734
  return documentData.documentId;
5756
5735
  });
5757
5736
  },
5737
+ // eslint-disable-next-line max-params
5758
5738
  sendDocument: function(clientID, instanceID, documentID, mailArgs, settings) {
5759
5739
  validateClientID(clientID);
5740
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/send`;
5760
5741
  return login().then(function(authorizationToken) {
5761
- var ajaxSettings = extend(
5762
- getHeaderSettings(authorizationToken),
5763
- settings,
5764
- {
5765
- type: HTTP_POST,
5766
- url: urlFromTemplate(
5767
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/send",
5768
- { clientID, instanceID, documentID }
5769
- ),
5770
- contentType: JSON_CONTENT_TYPE,
5771
- data: JSON.stringify(
5772
- {
5773
- from: mailArgs.from,
5774
- to: mailArgs.to,
5775
- cc: mailArgs.cc,
5776
- subject: mailArgs.subject,
5777
- body: mailArgs.body
5778
- }
5779
- )
5780
- }
5781
- );
5782
- return _ajax(ajaxSettings);
5742
+ return _ajax(endPoint, __spreadValues({
5743
+ headers: getHeaders(authorizationToken),
5744
+ method: HTTP_POST,
5745
+ contentType: JSON_CONTENT_TYPE,
5746
+ data: JSON.stringify({
5747
+ from: mailArgs.from,
5748
+ to: mailArgs.to,
5749
+ cc: mailArgs.cc,
5750
+ subject: mailArgs.subject,
5751
+ body: mailArgs.body
5752
+ })
5753
+ }, settings));
5783
5754
  });
5784
5755
  },
5785
5756
  deleteReportDocument: function(clientID, instanceID, documentID, settings) {
5786
5757
  validateClientID(clientID);
5758
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5787
5759
  return login().then(function(authorizationToken) {
5788
- var ajaxSettings = extend(
5789
- getHeaderSettings(authorizationToken),
5790
- settings,
5791
- {
5792
- type: HTTP_DELETE,
5793
- url: urlFromTemplate(
5794
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}",
5795
- { clientID, instanceID, documentID }
5796
- )
5797
- }
5798
- );
5799
- return _ajax(ajaxSettings);
5760
+ return _ajax(endPoint, __spreadValues({
5761
+ headers: getHeaders(authorizationToken),
5762
+ method: HTTP_DELETE
5763
+ }, settings));
5800
5764
  });
5801
5765
  },
5802
5766
  getDocumentInfo: function(clientID, instanceID, documentID, settings) {
5803
5767
  validateClientID(clientID);
5768
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/info`;
5804
5769
  return login().then(function(authorizationToken) {
5805
- var ajaxSettings = extend(
5806
- getHeaderSettings(authorizationToken),
5807
- settings,
5808
- {
5809
- type: HTTP_GET,
5810
- url: urlFromTemplate(
5811
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/info",
5812
- {
5813
- clientID,
5814
- instanceID,
5815
- documentID
5816
- }
5817
- ),
5818
- dataType: "json"
5819
- }
5820
- );
5821
- return _ajax(ajaxSettings);
5770
+ return _ajax(endPoint, __spreadValues({
5771
+ headers: getHeaders(authorizationToken),
5772
+ method: HTTP_GET,
5773
+ dataType: "json"
5774
+ }, settings));
5822
5775
  });
5823
5776
  },
5777
+ // eslint-disable-next-line max-params
5824
5778
  getPage: function(clientID, instanceID, documentID, pageNumber, settings) {
5825
5779
  validateClientID(clientID);
5780
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/pages/${pageNumber}`;
5826
5781
  return login().then(function(authorizationToken) {
5827
- var ajaxSettings = extend(
5828
- getHeaderSettings(authorizationToken),
5829
- settings,
5830
- {
5831
- type: HTTP_GET,
5832
- url: urlFromTemplate(
5833
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/pages/{pageNumber}",
5834
- {
5835
- clientID,
5836
- instanceID,
5837
- documentID,
5838
- pageNumber
5839
- }
5840
- ),
5841
- dataType: "json"
5842
- }
5843
- );
5844
- return _ajax(ajaxSettings);
5782
+ return _ajax(endPoint, __spreadValues({
5783
+ headers: getHeaders(authorizationToken),
5784
+ method: HTTP_GET,
5785
+ dataType: "json"
5786
+ }, settings));
5845
5787
  });
5846
5788
  },
5847
5789
  get: function(url) {
5848
- var ajaxSettings = {
5849
- type: HTTP_GET,
5850
- url
5851
- };
5852
- return _ajax(ajaxSettings);
5790
+ return _ajax(url, {
5791
+ method: HTTP_GET
5792
+ });
5853
5793
  },
5854
5794
  formatDocumentUrl: function(clientID, instanceID, documentID, queryString) {
5855
- var url = urlFromTemplate(
5856
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}",
5857
- {
5858
- clientID,
5859
- instanceID,
5860
- documentID
5861
- }
5862
- );
5795
+ var url = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5863
5796
  if (queryString) {
5864
5797
  url += "?" + queryString;
5865
5798
  }
5866
5799
  return url;
5867
5800
  },
5868
5801
  getDocumentFormats: function(settings) {
5802
+ const endPoint = `${baseUrl}/formats`;
5869
5803
  return login().then(function(authorizationToken) {
5870
- var ajaxSettings = extend(
5871
- getHeaderSettings(authorizationToken),
5872
- settings,
5873
- {
5874
- type: HTTP_GET,
5875
- url: urlFromTemplate("{baseUrl}/formats"),
5876
- // anonymous
5877
- dataType: "json"
5878
- }
5879
- );
5880
- return _ajax(ajaxSettings);
5804
+ return _ajax(endPoint, __spreadValues({
5805
+ headers: getHeaders(authorizationToken),
5806
+ method: HTTP_GET,
5807
+ dataType: "json"
5808
+ }, settings));
5881
5809
  });
5882
5810
  },
5883
5811
  getServiceVersion: function(settings) {
5812
+ const endPoint = `${baseUrl}/version`;
5884
5813
  return login().then(function(authorizationToken) {
5885
- var ajaxSettings = extend(
5886
- getHeaderSettings(authorizationToken),
5887
- settings,
5888
- {
5889
- type: HTTP_GET,
5890
- url: urlFromTemplate("{baseUrl}/version"),
5891
- // anonymous
5892
- dataType: "json"
5893
- }
5894
- );
5895
- return _ajax(ajaxSettings);
5814
+ return _ajax(endPoint, __spreadValues({
5815
+ headers: getHeaders(authorizationToken),
5816
+ method: HTTP_GET,
5817
+ dataType: "json"
5818
+ }, settings));
5896
5819
  });
5897
5820
  },
5821
+ // eslint-disable-next-line max-params
5898
5822
  getResource: function(clientID, instanceID, documentID, resourceID, settings) {
5899
5823
  validateClientID(clientID);
5824
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/resources/${resourceID}`;
5900
5825
  return login().then(function(authorizationToken) {
5901
- var ajaxSettings = extend(
5902
- getHeaderSettings(authorizationToken),
5903
- settings,
5904
- {
5905
- type: HTTP_GET,
5906
- url: urlFromTemplate(
5907
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/resources/{resourceID}",
5908
- {
5909
- clientID,
5910
- instanceID,
5911
- documentID,
5912
- resourceID
5913
- }
5914
- ),
5915
- dataType: (settings == null ? void 0 : settings.dataType) || "json"
5916
- }
5917
- );
5918
- return _ajax(ajaxSettings);
5826
+ return _ajax(endPoint, __spreadValues({
5827
+ headers: getHeaders(authorizationToken),
5828
+ method: HTTP_GET,
5829
+ dataType: (settings == null ? void 0 : settings.dataType) || "json"
5830
+ }, settings));
5919
5831
  });
5920
5832
  },
5833
+ // eslint-disable-next-line max-params
5921
5834
  getSearchResults: function(clientID, instanceID, documentID, searchToken, matchCase, matchWholeWord, useRegex, settings) {
5922
5835
  validateClientID(clientID);
5923
- var searchUrl = urlFromTemplate(
5924
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/search",
5925
- {
5926
- clientID,
5927
- instanceID,
5928
- documentID
5929
- }
5930
- );
5836
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/search`;
5931
5837
  return login().then(function(authorizationToken) {
5932
- var ajaxSettings = extend(
5933
- getHeaderSettings(authorizationToken),
5934
- settings,
5935
- {
5936
- type: HTTP_POST,
5937
- url: searchUrl,
5938
- contentType: JSON_CONTENT_TYPE,
5939
- dataType: "json",
5940
- data: JSON.stringify(
5941
- {
5942
- searchToken,
5943
- matchCase,
5944
- matchWholeWord,
5945
- useRegularExpressions: useRegex
5946
- }
5947
- )
5948
- }
5949
- );
5950
- return _ajax(ajaxSettings);
5838
+ return _ajax(endPoint, __spreadValues({
5839
+ headers: getHeaders(authorizationToken),
5840
+ method: HTTP_POST,
5841
+ contentType: JSON_CONTENT_TYPE,
5842
+ dataType: "json",
5843
+ data: JSON.stringify({
5844
+ searchToken,
5845
+ matchCase,
5846
+ matchWholeWord,
5847
+ useRegularExpressions: useRegex
5848
+ })
5849
+ }, settings));
5951
5850
  });
5952
5851
  },
5953
5852
  setAccessToken: function(accessToken) {
@@ -5955,29 +5854,21 @@ var telerikReportViewer = (function (exports) {
5955
5854
  },
5956
5855
  login,
5957
5856
  keepClientAlive: function(clientID, settings) {
5857
+ const endPoint = `${baseUrl}/clients/keepAlive/${clientID}`;
5958
5858
  return login().then(function(authorizationToken) {
5959
- var ajaxSettings = extend(
5960
- getHeaderSettings(authorizationToken),
5961
- settings,
5962
- {
5963
- type: HTTP_POST,
5964
- url: urlFromTemplate("{baseUrl}/clients/keepAlive/{clientID}", { clientID })
5965
- }
5966
- );
5967
- return _ajax(ajaxSettings);
5859
+ return _ajax(endPoint, __spreadValues({
5860
+ headers: getHeaders(authorizationToken),
5861
+ method: HTTP_POST
5862
+ }, settings));
5968
5863
  });
5969
5864
  },
5970
5865
  getClientsSessionTimeoutSeconds: function(settings) {
5866
+ const endPoint = `${baseUrl}/clients/sessionTimeout`;
5971
5867
  return login().then(function(authorizationToken) {
5972
- var ajaxSettings = extend(
5973
- getHeaderSettings(authorizationToken),
5974
- settings,
5975
- {
5976
- type: HTTP_GET,
5977
- url: urlFromTemplate("{baseUrl}/clients/sessionTimeout")
5978
- }
5979
- );
5980
- return _ajax(ajaxSettings);
5868
+ return _ajax(endPoint, __spreadValues({
5869
+ headers: getHeaders(authorizationToken),
5870
+ method: HTTP_GET
5871
+ }, settings));
5981
5872
  }).then(function(sessionTimeoutData) {
5982
5873
  return sessionTimeoutData.clientSessionTimeout;
5983
5874
  });
@@ -6158,8 +6049,8 @@ var telerikReportViewer = (function (exports) {
6158
6049
  }
6159
6050
  function setNodeAccessibilityAttributes(node) {
6160
6051
  var $items = $(node).find("li");
6161
- each($items, function() {
6162
- var $li = $(this);
6052
+ Array.from($items).forEach((item) => {
6053
+ var $li = $(item);
6163
6054
  $li.attr("aria-label", $li[0].innerText);
6164
6055
  });
6165
6056
  }
@@ -6191,8 +6082,8 @@ var telerikReportViewer = (function (exports) {
6191
6082
  treeView.bind("expand", onTreeViewNodeExpand);
6192
6083
  treeView.element.attr("aria-label", stringResources.ariaLabelDocumentMap);
6193
6084
  var listItems = treeView.element.find("ul");
6194
- each(listItems, function() {
6195
- setNodeAccessibilityAttributes(this);
6085
+ Array.from(listItems).forEach((list) => {
6086
+ setNodeAccessibilityAttributes(list);
6196
6087
  });
6197
6088
  if (documentMapNecessary) {
6198
6089
  setSplitbarAccessibilityAttributes();
@@ -6269,14 +6160,6 @@ var telerikReportViewer = (function (exports) {
6269
6160
  $documentMapOverlay.attr("aria-label", stringResources[$documentMapOverlay.attr("aria-label")]);
6270
6161
  }
6271
6162
  }
6272
- var pluginName$6 = "telerik_ReportViewer_DocumentMapArea";
6273
- $.fn[pluginName$6] = function(options, otherOptions) {
6274
- return each(this, function() {
6275
- if (!$.data(this, pluginName$6)) {
6276
- $.data(this, pluginName$6, new DocumentMapArea(this, options, otherOptions));
6277
- }
6278
- });
6279
- };
6280
6163
 
6281
6164
  var defaultOptions$2 = {};
6282
6165
  var Events = {
@@ -6429,12 +6312,8 @@ var telerikReportViewer = (function (exports) {
6429
6312
  }
6430
6313
  }
6431
6314
  function selectParameterEditorFactory(parameter, editorsType) {
6432
- var factory;
6433
- each(parameterEditors, function() {
6434
- if (this && this.match(parameter, editorsType)) {
6435
- factory = this;
6436
- }
6437
- return !factory;
6315
+ var factory = Array.from(parameterEditors).find((editor) => {
6316
+ return editor.match(parameter, editorsType);
6438
6317
  });
6439
6318
  return factory;
6440
6319
  }
@@ -6446,23 +6325,21 @@ var telerikReportViewer = (function (exports) {
6446
6325
  (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
6447
6326
  }
6448
6327
  function allParametersAutoRefresh() {
6449
- var allAuto = true;
6450
- each(parameters, function() {
6451
- return allAuto = !this.isVisible || this.autoRefresh;
6328
+ var allAuto = Array.from(parameters).every((parameter) => {
6329
+ return !parameter.isVisible || parameter.autoRefresh;
6452
6330
  });
6453
6331
  return allAuto;
6454
6332
  }
6455
6333
  function allParametersValid() {
6456
- var allValid = true;
6457
- each(parameters, function() {
6458
- return allValid = !this.Error;
6334
+ var allValid = Array.from(parameters).every((parameter) => {
6335
+ return !parameter.Error;
6459
6336
  });
6460
6337
  return allValid;
6461
6338
  }
6462
6339
  function clearEditors() {
6463
- each(editors, function() {
6464
- if (this.hasOwnProperty("destroy")) {
6465
- this.destroy();
6340
+ Object.entries(editors).forEach(([key, editor]) => {
6341
+ if (typeof editor.destroy === "function") {
6342
+ editor.destroy();
6466
6343
  }
6467
6344
  });
6468
6345
  editors = {};
@@ -6474,26 +6351,26 @@ var telerikReportViewer = (function (exports) {
6474
6351
  clearEditors();
6475
6352
  var $parameterContainer;
6476
6353
  var $tempContainer = $("<div></div>");
6477
- each(parameters, function() {
6354
+ Array.from(parameters).forEach((parameter) => {
6478
6355
  try {
6479
- this.value = ParameterValidators.validate(this, this.value);
6356
+ parameter.value = ParameterValidators.validate(parameter, parameter.value);
6480
6357
  } catch (e) {
6481
- this.Error = this.Error || e;
6358
+ parameter.Error = parameter.Error || e;
6482
6359
  }
6483
- var hasError = Boolean(this.Error);
6360
+ var hasError = Boolean(parameter.Error);
6484
6361
  var hasValue = !hasError;
6485
6362
  if (hasValue) {
6486
- recentParameterValues[this.id] = this.value;
6487
- if (this.availableValues) {
6488
- processedParameterValues[this.id] = { valueMember: this.value, displayMember: this.label, availableValues: this.availableValues, multivalue: this.multivalue };
6489
- } else {
6490
- processedParameterValues[this.id] = this.value;
6491
- }
6363
+ recentParameterValues[parameter.id] = parameter.value;
6364
+ } else {
6365
+ parameter.Error = stringResources.invalidParameter;
6366
+ }
6367
+ if (parameter.availableValues) {
6368
+ processedParameterValues[parameter.id] = { valueMember: parameter.value, displayMember: parameter.label, availableValues: parameter.availableValues, multivalue: parameter.multivalue };
6492
6369
  } else {
6493
- this.Error = stringResources.invalidParameter;
6370
+ processedParameterValues[parameter.id] = parameter.value;
6494
6371
  }
6495
- if (this.isVisible || options.showHiddenParameters) {
6496
- $parameterContainer = createParameterUI(this);
6372
+ if (parameter.isVisible || options.showHiddenParameters) {
6373
+ $parameterContainer = createParameterUI(parameter);
6497
6374
  if ($parameterContainer) {
6498
6375
  $tempContainer.append($parameterContainer);
6499
6376
  }
@@ -6502,17 +6379,17 @@ var telerikReportViewer = (function (exports) {
6502
6379
  if (initialParameterValues !== void 0) {
6503
6380
  if (null === initialParameterValues) {
6504
6381
  initialParameterValues = {};
6505
- each(parameters, function() {
6506
- if (this.isVisible) {
6507
- initialParameterValues[this.id] = this.value;
6382
+ Array.from(parameters).forEach((parameter) => {
6383
+ if (parameter.isVisible) {
6384
+ initialParameterValues[parameter.id] = parameter.value;
6508
6385
  } else {
6509
- delete recentParameterValues[this.id];
6386
+ delete recentParameterValues[parameter.id];
6510
6387
  }
6511
6388
  });
6512
6389
  } else {
6513
- each(parameters, function() {
6514
- if (!(this.id in initialParameterValues)) {
6515
- delete recentParameterValues[this.id];
6390
+ Array.from(parameters).forEach((parameter) => {
6391
+ if (!(parameter.id in initialParameterValues)) {
6392
+ delete recentParameterValues[parameter.id];
6516
6393
  }
6517
6394
  });
6518
6395
  }
@@ -6555,7 +6432,7 @@ var telerikReportViewer = (function (exports) {
6555
6432
  }
6556
6433
  function invalidateChildParameters(parameter) {
6557
6434
  if (parameter.childParameters) {
6558
- each(parameter.childParameters, function(index, parameterId) {
6435
+ Array.from(parameter.childParameters).forEach((parameterId) => {
6559
6436
  var childParameter = getParameterById(parameterId);
6560
6437
  if (childParameter) {
6561
6438
  invalidateChildParameters(childParameter);
@@ -6614,12 +6491,10 @@ var telerikReportViewer = (function (exports) {
6614
6491
  if (!params || null === params) {
6615
6492
  return false;
6616
6493
  }
6617
- var result = false;
6618
- each(params, function() {
6619
- result = this.isVisible;
6620
- return !result;
6494
+ var hasVisible = Array.from(params).some((parameter) => {
6495
+ return parameter.isVisible;
6621
6496
  });
6622
- return result;
6497
+ return hasVisible;
6623
6498
  }
6624
6499
  var loadingCount = 0;
6625
6500
  function beginLoad() {
@@ -6752,6 +6627,9 @@ var telerikReportViewer = (function (exports) {
6752
6627
  parametersReady: function() {
6753
6628
  return eventFactory(Events.PARAMETERS_READY, arguments);
6754
6629
  },
6630
+ fill: function(parameters2) {
6631
+ return fill(parameters2);
6632
+ },
6755
6633
  setParameters: function(parameterValues) {
6756
6634
  initialParameterValues = null === parameterValues ? null : $.extend({}, parameterValues);
6757
6635
  }
@@ -6759,14 +6637,6 @@ var telerikReportViewer = (function (exports) {
6759
6637
  );
6760
6638
  return parametersArea;
6761
6639
  }
6762
- var pluginName$5 = "telerik_ReportViewer_ParametersArea";
6763
- $.fn[pluginName$5] = function(options, otherOptions) {
6764
- return each(this, function() {
6765
- if (!$.data(this, pluginName$5)) {
6766
- $.data(this, pluginName$5, new ParametersArea(this, options, otherOptions));
6767
- }
6768
- });
6769
- };
6770
6640
 
6771
6641
  var lastSelectedMenuItem;
6772
6642
  var lastSelectedSubmenuItem;
@@ -6811,9 +6681,9 @@ var telerikReportViewer = (function (exports) {
6811
6681
  replaceStringResources();
6812
6682
  }
6813
6683
  function setTabIndexes() {
6814
- var $menus = $.find('[data-role="telerik_ReportViewer_MainMenu"]');
6815
- each($menus, function() {
6816
- var $menuArea = $(this);
6684
+ var $menus = $('[data-role="telerik_ReportViewer_MainMenu"]');
6685
+ Array.from($menus).forEach((menu2) => {
6686
+ var $menuArea = $(menu2);
6817
6687
  var listItems = $menuArea.find("li");
6818
6688
  var menuTabIndex = 0;
6819
6689
  var tabIndexAttr = $menuArea.attr("tabIndex");
@@ -6831,13 +6701,13 @@ var telerikReportViewer = (function (exports) {
6831
6701
  });
6832
6702
  }
6833
6703
  function setMenuItemsTabIndexes(listItems, menuTabIndex) {
6834
- each(listItems, function() {
6835
- var $item = $(this);
6704
+ Array.from(listItems).forEach((item) => {
6705
+ var $item = $(item);
6836
6706
  $item.attr("tabindex", menuTabIndex);
6837
- $item.focus(function() {
6707
+ $item.on("focus", (event) => {
6838
6708
  $item.addClass("k-focus");
6839
6709
  });
6840
- $item.blur(function() {
6710
+ $item.on("blur", (event) => {
6841
6711
  $item.removeClass("k-focus");
6842
6712
  });
6843
6713
  var anchor = $item.children("a");
@@ -6856,16 +6726,15 @@ var telerikReportViewer = (function (exports) {
6856
6726
  });
6857
6727
  }
6858
6728
  function fillFormats(formats) {
6859
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
6860
- var $list = $(this);
6729
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
6730
+ var $list = $(list);
6861
6731
  var $parent = $list.parents("li");
6862
6732
  var tabIndex = enableAccessibility ? $parent.attr("tabindex") : -1;
6863
6733
  if (!tabIndex) {
6864
6734
  tabIndex = 1;
6865
6735
  }
6866
6736
  $list.empty();
6867
- each(formats, function() {
6868
- var format = this;
6737
+ Array.from(formats).forEach((format) => {
6869
6738
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
6870
6739
  var li = "<li " + ariaLabel + stringFormat('tabindex="' + tabIndex + '"><a tabindex="-1" href="#" data-command="telerik_ReportViewer_export" data-command-parameter="{name}"><span>{localizedName}</span></a></li>', format);
6871
6740
  menu.append(li, $parent);
@@ -6876,10 +6745,10 @@ var telerikReportViewer = (function (exports) {
6876
6745
  });
6877
6746
  }
6878
6747
  function setInternalListAccessibilityKeyEvents(listItems) {
6879
- each(listItems, function() {
6880
- var $item = $(this);
6748
+ Array.from(listItems).forEach((item) => {
6749
+ var $item = $(item);
6881
6750
  $item.off("keydown");
6882
- $item.on("keydown", function(event) {
6751
+ $item.on("keydown", (event) => {
6883
6752
  switch (event.which) {
6884
6753
  case kendo.keys.ENTER:
6885
6754
  clickOnMenuItem($item);
@@ -6887,17 +6756,17 @@ var telerikReportViewer = (function (exports) {
6887
6756
  case kendo.keys.UP:
6888
6757
  var $prev = $item.prev();
6889
6758
  if ($prev.length > 0) {
6890
- $prev.focus();
6759
+ $prev.trigger("focus");
6891
6760
  } else {
6892
- $item.parents("li").focus();
6761
+ $item.parents("li").trigger("focus");
6893
6762
  }
6894
6763
  break;
6895
6764
  case kendo.keys.DOWN:
6896
6765
  var $next = $item.next();
6897
6766
  if ($next.length > 0) {
6898
- $next.focus();
6767
+ $next.trigger("focus");
6899
6768
  } else {
6900
- $item.parent().children("li").first().focus();
6769
+ $item.parent().children("li").first().trigger("focus");
6901
6770
  }
6902
6771
  break;
6903
6772
  }
@@ -7061,12 +6930,12 @@ var telerikReportViewer = (function (exports) {
7061
6930
  if (!menuAreas) {
7062
6931
  return;
7063
6932
  }
7064
- each(menuAreas, function() {
7065
- var $menu = $(this);
6933
+ Array.from(menuAreas).forEach((menu2) => {
6934
+ var $menu = $(menu2);
7066
6935
  var menuItems = $menu.children("li.k-item");
7067
6936
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
7068
- each(menuItems, function() {
7069
- var $menuItem = $(this);
6937
+ Array.from(menuItems).forEach((menuItem) => {
6938
+ var $menuItem = $(menuItem);
7070
6939
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
7071
6940
  if (!$menuItem.hasClass("trv-report-pager")) {
7072
6941
  var $a = $menuItem.find("a");
@@ -7080,158 +6949,196 @@ var telerikReportViewer = (function (exports) {
7080
6949
  });
7081
6950
  }
7082
6951
  function findMenuArea() {
7083
- return findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
6952
+ return $("ul[data-role=telerik_ReportViewer_MainMenu]");
7084
6953
  }
7085
6954
  }
7086
- var pluginName$4 = "telerik_ReportViewer_MainMenu";
7087
- $.fn[pluginName$4] = function(options, otherOptions) {
7088
- return each(this, function() {
7089
- if (!$.data(this, pluginName$4)) {
7090
- $.data(this, pluginName$4, new MainMenu(this, options, otherOptions));
7091
- }
7092
- });
7093
- };
7094
6955
 
7095
6956
  var defaultOptions$1 = {};
7096
- function Search(placeholder, options, viewerOptions) {
7097
- options = $.extend({}, defaultOptions$1, options);
7098
- var controller = options.controller;
7099
- var initialized = false;
7100
- var dialogVisible = false;
7101
- var $placeholder;
7102
- var $inputBox;
7103
- var $searchOptionsPlaceholder;
7104
- var searchOptionsMenu;
7105
- var $stopSearchPlaceholder;
7106
- var stopSearchMenu;
7107
- var $navigationPlaceholder;
7108
- var navigationMenu;
7109
- var $resultsLabel;
7110
- var $resultsPlaceholder;
7111
- var kendoComboBox;
7112
- var kendoSearchDialog;
7113
- var stopSearchCommand;
7114
- var optionsCommandSet;
7115
- var navigationCommandSet;
7116
- var searchResults;
7117
- var mruList = [];
7118
- var inputComboRebinding;
7119
- var searchMetadataRequested;
7120
- var searchMetadataLoaded;
7121
- var pendingHighlightItem;
7122
- var windowLocation;
7123
- var reportViewerWrapper = $("[data-selector='" + viewerOptions.viewerSelector + "']").find(".trv-report-viewer");
7124
- var lastSearch = "";
7125
- var highlightManager = {
7126
- shadedClassName: "trv-search-dialog-shaded-result",
7127
- //the results that are found, but not selected (highlighted)
7128
- highlightedClassName: "trv-search-dialog-highlighted-result",
7129
- //the result that is currently selected (highlighted)
7130
- current: null,
7131
- elements: []
7132
- };
7133
- if (!controller) {
7134
- throw "No controller (telerikReporting.ReportViewerController) has been specified.";
6957
+ function replaceStringResources$1($search) {
6958
+ if (!$search) {
6959
+ return;
7135
6960
  }
7136
- controller.pageReady(onPageReady).scrollPageReady(onPageReady).beginLoadReport(closeAndClear).viewModeChanged(closeAndClear);
7137
- controller.setSendEmailDialogVisible(function(event, args) {
7138
- if (args.visible && dialogVisible) {
7139
- toggle(!dialogVisible);
7140
- }
7141
- }).getSearchDialogState(function(event, args) {
7142
- args.visible = dialogVisible;
7143
- }).setSearchDialogVisible(function(event, args) {
7144
- toggleSearchDialog(args.visible);
7145
- });
7146
- function closeAndClear() {
7147
- if (searchMetadataRequested) {
6961
+ var $searchCaption = $search.find(".trv-search-dialog-caption-label");
6962
+ var $searchOptions = $search.find(".trv-search-dialog-search-options");
6963
+ var $searchStopButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_StopSearch']");
6964
+ var $searchMatchCaseButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchCase']");
6965
+ var $searchMatchWholeWordButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchWholeWord']");
6966
+ var $searchUseRegexButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_UseRegex']");
6967
+ var $searchNavigateUpButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateUp']");
6968
+ var $searchNavigateDownButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateDown']");
6969
+ replaceAttribute$1($search, "aria-label");
6970
+ replaceAttribute$1($searchOptions, "aria-label");
6971
+ replaceText$1($searchCaption);
6972
+ replaceTitleAndAriaLabel($searchStopButton);
6973
+ replaceTitleAndAriaLabel($searchMatchCaseButton);
6974
+ replaceTitleAndAriaLabel($searchMatchWholeWordButton);
6975
+ replaceTitleAndAriaLabel($searchUseRegexButton);
6976
+ replaceTitleAndAriaLabel($searchNavigateUpButton);
6977
+ replaceTitleAndAriaLabel($searchNavigateDownButton);
6978
+ }
6979
+ function replaceTitleAndAriaLabel($a) {
6980
+ replaceAttribute$1($a, "title");
6981
+ replaceAttribute$1($a, "aria-label");
6982
+ }
6983
+ function replaceText$1($el) {
6984
+ if ($el) {
6985
+ $el.text(stringResources[$el.text()]);
6986
+ }
6987
+ }
6988
+ function replaceAttribute$1($el, attribute) {
6989
+ if ($el) {
6990
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
6991
+ }
6992
+ }
6993
+ class Search {
6994
+ constructor(element, options, viewerOptions) {
6995
+ this.options = $.extend({}, defaultOptions$1, options);
6996
+ this.viewerOptions = viewerOptions;
6997
+ this.element = element;
6998
+ this.controller = this.options.controller;
6999
+ this.initialized = false;
7000
+ this.dialogVisible = false;
7001
+ this.$element;
7002
+ this.$inputBox;
7003
+ this.$searchOptionsPlaceholder;
7004
+ this.searchOptionsMenu;
7005
+ this.$stopSearchPlaceholder;
7006
+ this.stopSearchMenu;
7007
+ this.$navigationPlaceholder;
7008
+ this.navigationMenu;
7009
+ this.$resultsLabel;
7010
+ this.$resultsPlaceholder;
7011
+ this.kendoComboBox;
7012
+ this.kendoSearchDialog;
7013
+ this.stopSearchCommand;
7014
+ this.optionsCommandSet;
7015
+ this.navigationCommandSet;
7016
+ this.searchResults;
7017
+ this.mruList = [];
7018
+ this.inputComboRebinding;
7019
+ this.searchMetadataRequested;
7020
+ this.searchMetadataLoaded;
7021
+ this.pendingHighlightItem;
7022
+ this.windowLocation;
7023
+ this.reportViewerWrapper = $("[data-selector='" + this.viewerOptions.viewerSelector + "']").find(".trv-report-viewer");
7024
+ this.lastSearch = "";
7025
+ this.highlightManager = {
7026
+ // the results that are found, but not selected (highlighted)
7027
+ shadedClassName: "trv-search-dialog-shaded-result",
7028
+ // the result that is currently selected (highlighted)
7029
+ highlightedClassName: "trv-search-dialog-highlighted-result",
7030
+ current: null,
7031
+ elements: []
7032
+ };
7033
+ if (!this.controller) {
7034
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
7035
+ }
7036
+ this.controller.pageReady(this.onPageReady.bind(this)).scrollPageReady(this.onPageReady.bind(this)).beginLoadReport(this.closeAndClear.bind(this)).viewModeChanged(this.closeAndClear.bind(this));
7037
+ this.controller.setSendEmailDialogVisible((event, args) => {
7038
+ if (args.visible && this.dialogVisible) {
7039
+ this.toggle(!this.dialogVisible);
7040
+ }
7041
+ }).getSearchDialogState((event, args) => {
7042
+ args.visible = this.dialogVisible;
7043
+ }).setSearchDialogVisible((event, args) => {
7044
+ this.toggleSearchDialog(args.visible);
7045
+ });
7046
+ $(window).on("resize", () => {
7047
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7048
+ this.storeDialogPosition();
7049
+ this.adjustDialogPosition();
7050
+ }
7051
+ });
7052
+ }
7053
+ closeAndClear() {
7054
+ if (this.searchMetadataRequested) {
7148
7055
  return;
7149
7056
  }
7150
- toggle(false);
7151
- searchMetadataLoaded = false;
7057
+ this.toggle(false);
7058
+ this.searchMetadataLoaded = false;
7152
7059
  }
7153
- function toggleSearchDialog(show) {
7154
- dialogVisible = show;
7060
+ toggleSearchDialog(show) {
7061
+ this.dialogVisible = show;
7155
7062
  if (show) {
7156
- var searchMetadataOnDemand = viewerOptions.searchMetadataOnDemand;
7157
- if (searchMetadataOnDemand && !searchMetadataLoaded) {
7158
- searchMetadataRequested = true;
7159
- controller.reportLoadComplete(function() {
7160
- if (searchMetadataRequested) {
7161
- toggle(true);
7162
- searchMetadataRequested = false;
7063
+ var searchMetadataOnDemand = this.viewerOptions.searchMetadataOnDemand;
7064
+ if (searchMetadataOnDemand && !this.searchMetadataLoaded) {
7065
+ this.searchMetadataRequested = true;
7066
+ this.controller.reportLoadComplete((event, args) => {
7067
+ if (this.searchMetadataRequested) {
7068
+ this.toggle(true);
7069
+ this.searchMetadataRequested = false;
7163
7070
  }
7164
7071
  });
7165
- controller.refreshReport(true);
7072
+ this.controller.refreshReport(true);
7166
7073
  return;
7167
7074
  }
7168
7075
  }
7169
- toggle(show);
7076
+ this.toggle(show);
7170
7077
  }
7171
- function toggle(show) {
7172
- dialogVisible = show;
7078
+ toggle(show) {
7079
+ this.dialogVisible = show;
7173
7080
  if (show) {
7174
- searchMetadataLoaded = true;
7175
- ensureInitialized();
7176
- kendoSearchDialog.open();
7177
- kendoComboBox.value("");
7178
- updateResultsUI(null);
7179
- toggleErrorLabel(false, null);
7081
+ this.searchMetadataLoaded = true;
7082
+ this.ensureInitialized();
7083
+ this.kendoSearchDialog.open();
7084
+ this.kendoComboBox.value("");
7085
+ this.updateResultsUI(null);
7086
+ this.toggleErrorLabel(false, null);
7180
7087
  } else {
7181
- clearColoredItems();
7182
- if (kendoSearchDialog && kendoSearchDialog.options.visible) {
7183
- kendoSearchDialog.close();
7088
+ this.clearColoredItems();
7089
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7090
+ this.kendoSearchDialog.close();
7184
7091
  }
7185
7092
  }
7186
7093
  }
7187
- function ensureInitialized() {
7188
- if (!initialized) {
7189
- $placeholder = $(placeholder);
7190
- $inputBox = $placeholder.find(".trv-search-dialog-input-box");
7191
- $resultsLabel = $placeholder.find(".trv-search-dialog-results-label");
7192
- $resultsPlaceholder = $placeholder.find(".trv-search-dialog-results-area");
7193
- initResultsArea();
7194
- replaceStringResources($placeholder);
7094
+ ensureInitialized() {
7095
+ if (!this.initialized) {
7096
+ this.$element = $(this.element);
7097
+ this.$inputBox = this.$element.find(".trv-search-dialog-input-box");
7098
+ this.$resultsLabel = this.$element.find(".trv-search-dialog-results-label");
7099
+ this.$resultsPlaceholder = this.$element.find(".trv-search-dialog-results-area");
7100
+ this.initResultsArea();
7101
+ replaceStringResources$1(this.$element);
7195
7102
  try {
7196
- $searchOptionsPlaceholder = $placeholder.find(".trv-search-dialog-search-options").kendoMenu();
7197
- $stopSearchPlaceholder = $placeholder.find(".trv-search-dialog-stopsearch-placeholder").kendoMenu();
7198
- $navigationPlaceholder = $placeholder.find(".trv-search-dialog-navigational-buttons").kendoMenu();
7199
- } catch (e) {
7200
- console.error("Instantiation of Kendo Menu for Search Dialog threw an exception", e);
7201
- throw e;
7202
- }
7203
- searchOptionsMenu = $searchOptionsPlaceholder.data("kendoMenu");
7204
- stopSearchMenu = $stopSearchPlaceholder.data("kendoMenu");
7205
- navigationMenu = $navigationPlaceholder.data("kendoMenu");
7206
- searchOptionsMenu.element.on("keydown", onKeyDown);
7207
- stopSearchMenu.element.on("keydown", onKeyDown);
7208
- navigationMenu.element.on("keydown", onKeyDown);
7209
- overrideDefaultMenuStyling(".trv-search-dialog-search-options");
7103
+ this.$searchOptionsPlaceholder = this.$element.find(".trv-search-dialog-search-options").kendoMenu();
7104
+ this.$stopSearchPlaceholder = this.$element.find(".trv-search-dialog-stopsearch-placeholder").kendoMenu();
7105
+ this.$navigationPlaceholder = this.$element.find(".trv-search-dialog-navigational-buttons").kendoMenu();
7106
+ } catch (error) {
7107
+ console.error("Instantiation of Kendo Menu for Search Dialog threw an exception", error);
7108
+ throw error;
7109
+ }
7110
+ this.searchOptionsMenu = this.$searchOptionsPlaceholder.data("kendoMenu");
7111
+ this.stopSearchMenu = this.$stopSearchPlaceholder.data("kendoMenu");
7112
+ this.navigationMenu = this.$navigationPlaceholder.data("kendoMenu");
7113
+ this.searchOptionsMenu.element.on("keydown", this.onKeyDown);
7114
+ this.stopSearchMenu.element.on("keydown", this.onKeyDown);
7115
+ this.navigationMenu.element.on("keydown", this.onKeyDown);
7116
+ this.overrideDefaultMenuStyling(".trv-search-dialog-search-options");
7210
7117
  try {
7211
- kendoComboBox = $inputBox.kendoComboBox({
7118
+ this.kendoComboBox = this.$inputBox.kendoComboBox({
7212
7119
  dataTextField: "value",
7213
7120
  dataValueField: "value",
7214
- dataSource: mruList,
7121
+ dataSource: this.mruList,
7215
7122
  contentElement: "",
7216
- change: kendoComboBoxSelect,
7123
+ change: this.kendoComboBoxSelect.bind(this),
7217
7124
  ignoreCase: false,
7218
- filtering: onInputFiltering,
7219
- //the actual search-when-typing performs on this event.
7125
+ // the actual search-when-typing performs on this event.
7126
+ filtering: this.onInputFiltering.bind(this),
7220
7127
  filter: "startswith",
7221
7128
  delay: 1e3,
7222
- open: function(e) {
7223
- if (inputComboRebinding) {
7224
- e.preventDefault();
7129
+ open: (event) => {
7130
+ if (this.inputComboRebinding) {
7131
+ event.preventDefault();
7225
7132
  }
7226
7133
  },
7227
- select: processComboBoxEvent
7134
+ select: this.processComboBoxEvent.bind(this)
7228
7135
  }).data("kendoComboBox");
7229
- } catch (e) {
7230
- console.error("Instantiation of Kendo ComboBox as search input threw an exception", e);
7231
- throw e;
7136
+ } catch (error) {
7137
+ console.error("Instantiation of Kendo ComboBox as search input threw an exception", error);
7138
+ throw error;
7232
7139
  }
7233
7140
  try {
7234
- kendoSearchDialog = reportViewerWrapper.find(".trv-search-window").kendoWindow({
7141
+ this.kendoSearchDialog = this.reportViewerWrapper.find(".trv-search-window").kendoWindow({
7235
7142
  title: stringResources.searchDialogTitle,
7236
7143
  height: 390,
7237
7144
  width: 310,
@@ -7239,38 +7146,38 @@ var telerikReportViewer = (function (exports) {
7239
7146
  minHeight: 390,
7240
7147
  maxHeight: 700,
7241
7148
  scrollable: false,
7242
- close: function() {
7243
- storeDialogPosition();
7244
- lastSearch = "";
7149
+ close: () => {
7150
+ this.storeDialogPosition();
7151
+ this.lastSearch = "";
7245
7152
  },
7246
- open: function() {
7247
- adjustDialogPosition();
7153
+ open: () => {
7154
+ this.adjustDialogPosition();
7248
7155
  },
7249
- deactivate: function() {
7250
- controller.setSearchDialogVisible({
7156
+ deactivate: () => {
7157
+ this.controller.setSearchDialogVisible({
7251
7158
  visible: false
7252
7159
  });
7253
7160
  },
7254
- activate: function() {
7255
- kendoComboBox.input.focus();
7161
+ activate: () => {
7162
+ this.kendoComboBox.input.focus();
7256
7163
  }
7257
7164
  }).data("kendoWindow");
7258
- } catch (e) {
7259
- console.error("Instantiation of Kendo Window for Search dialog threw an exception", e);
7260
- throw e;
7165
+ } catch (error) {
7166
+ console.error("Instantiation of Kendo Window for Search dialog threw an exception", error);
7167
+ throw error;
7261
7168
  }
7262
- kendoSearchDialog.wrapper.addClass("trv-search");
7263
- initCommands();
7264
- initialized = true;
7169
+ this.kendoSearchDialog.wrapper.addClass("trv-search");
7170
+ this.initCommands();
7171
+ this.initialized = true;
7265
7172
  }
7266
7173
  }
7267
- function overrideDefaultMenuStyling(kendoMenuSelector) {
7174
+ overrideDefaultMenuStyling(kendoMenuSelector) {
7268
7175
  var menuItems = $(kendoMenuSelector).find(".k-menu-item");
7269
7176
  for (var i = 0; i < menuItems.length; i++) {
7270
7177
  $(menuItems[i]).removeClass("k-item");
7271
7178
  }
7272
7179
  }
7273
- function onKeyDown(event) {
7180
+ onKeyDown(event) {
7274
7181
  var item = $(event.target).find(".k-focus");
7275
7182
  if (event.keyCode === 13 && item && item.length > 0) {
7276
7183
  var anchor = item.children("a");
@@ -7279,44 +7186,38 @@ var telerikReportViewer = (function (exports) {
7279
7186
  }
7280
7187
  }
7281
7188
  }
7282
- $(window).resize(function() {
7283
- if (kendoSearchDialog && kendoSearchDialog.options.visible) {
7284
- storeDialogPosition();
7285
- adjustDialogPosition();
7286
- }
7287
- });
7288
- function storeDialogPosition() {
7289
- var kendoWindow = kendoSearchDialog.element.parent(".k-window");
7290
- windowLocation = kendoWindow.offset();
7189
+ storeDialogPosition() {
7190
+ var kendoWindow = this.kendoSearchDialog.element.parent(".k-window");
7191
+ this.windowLocation = kendoWindow.offset();
7291
7192
  }
7292
- function adjustDialogPosition() {
7193
+ adjustDialogPosition() {
7293
7194
  var windowWidth = $(window).innerWidth();
7294
7195
  var windowHeight = $(window).innerHeight();
7295
- var kendoWindow = kendoSearchDialog.wrapper;
7196
+ var kendoWindow = this.kendoSearchDialog.wrapper;
7296
7197
  var width = kendoWindow.outerWidth(true);
7297
7198
  var height = kendoWindow.outerHeight(true);
7298
7199
  var padding = 10;
7299
- if (!windowLocation) {
7300
- var reportViewerCoords = reportViewerWrapper[0].getBoundingClientRect();
7200
+ if (!this.windowLocation) {
7201
+ var reportViewerCoords = this.reportViewerWrapper[0].getBoundingClientRect();
7301
7202
  kendoWindow.css({
7302
7203
  top: reportViewerCoords.top + padding,
7303
7204
  left: reportViewerCoords.right - width - padding
7304
7205
  });
7305
- kendoSearchDialog.setOptions({
7206
+ this.kendoSearchDialog.setOptions({
7306
7207
  position: {
7307
7208
  top: reportViewerCoords.top + padding,
7308
7209
  left: reportViewerCoords.right - width - padding
7309
7210
  }
7310
7211
  });
7311
7212
  } else {
7312
- var left = windowLocation.left;
7313
- var top = windowLocation.top;
7213
+ var left = this.windowLocation.left;
7214
+ var top = this.windowLocation.top;
7314
7215
  var right = left + width;
7315
7216
  var bottom = top + height;
7316
7217
  if (right > windowWidth - padding) {
7317
7218
  left = Math.max(padding, windowWidth - width - padding);
7318
7219
  kendoWindow.css({ left });
7319
- kendoSearchDialog.setOptions({
7220
+ this.kendoSearchDialog.setOptions({
7320
7221
  position: {
7321
7222
  left
7322
7223
  }
@@ -7325,7 +7226,7 @@ var telerikReportViewer = (function (exports) {
7325
7226
  if (bottom > windowHeight - padding) {
7326
7227
  top = Math.max(padding, windowHeight - height - padding);
7327
7228
  kendoWindow.css({ top });
7328
- kendoSearchDialog.setOptions({
7229
+ this.kendoSearchDialog.setOptions({
7329
7230
  position: {
7330
7231
  top
7331
7232
  }
@@ -7333,272 +7234,251 @@ var telerikReportViewer = (function (exports) {
7333
7234
  }
7334
7235
  }
7335
7236
  }
7336
- function processComboBoxEvent(e) {
7237
+ processComboBoxEvent(event) {
7337
7238
  if (!(window.event || window.event.type)) {
7338
7239
  return;
7339
7240
  }
7340
7241
  var evt = window.event;
7341
7242
  if (evt.type === "keydown") {
7342
- e.preventDefault();
7243
+ event.preventDefault();
7343
7244
  if (evt.keyCode === 40) {
7344
- moveListSelection(1);
7345
- } else if (evt.keyCode === 38) {
7346
- moveListSelection(-1);
7245
+ this.moveListSelection(1);
7246
+ }
7247
+ if (evt.keyCode === 38) {
7248
+ this.moveListSelection(-1);
7347
7249
  }
7348
7250
  }
7349
7251
  }
7350
- function initCommands() {
7351
- optionsCommandSet = {
7352
- //the command names MUST match the commands in the template.html with the "telerik_Reportviewer" prefix so the binder could work.
7353
- "searchDialog_MatchCase": new command(function() {
7354
- toggleCommand(this);
7355
- }),
7356
- "searchDialog_MatchWholeWord": new command(function() {
7357
- toggleCommand(this);
7358
- }),
7359
- "searchDialog_UseRegex": new command(function() {
7360
- toggleCommand(this);
7361
- })
7252
+ initCommands() {
7253
+ this.optionsCommandSet = {
7254
+ "searchDialog_MatchCase": new Command(),
7255
+ "searchDialog_MatchWholeWord": new Command(),
7256
+ "searchDialog_UseRegex": new Command()
7362
7257
  };
7363
- Binder.bind(
7364
- $searchOptionsPlaceholder,
7365
- {
7366
- controller,
7367
- commands: optionsCommandSet
7368
- },
7369
- viewerOptions
7370
- );
7371
- stopSearchCommand = new command(function() {
7372
- stopSearch();
7258
+ Object.entries(this.optionsCommandSet).forEach(([commandName, command]) => {
7259
+ command.exec = () => {
7260
+ this.toggleCommand(command);
7261
+ };
7373
7262
  });
7374
- Binder.bind(
7375
- $stopSearchPlaceholder,
7376
- {
7377
- controller,
7378
- commands: { "searchDialog_StopSearch": stopSearchCommand }
7379
- },
7380
- viewerOptions
7381
- );
7382
- navigationCommandSet = {
7383
- "searchDialog_NavigateUp": new command(function() {
7384
- moveListSelection(-1);
7263
+ Binder.attachCommands(this.$searchOptionsPlaceholder, this.optionsCommandSet, this.viewerOptions);
7264
+ this.stopSearchCommand = new Command(() => {
7265
+ this.stopSearch();
7266
+ });
7267
+ Binder.attachCommands(this.$stopSearchPlaceholder, { "searchDialog_StopSearch": this.stopSearchCommand }, this.viewerOptions);
7268
+ this.navigationCommandSet = {
7269
+ "searchDialog_NavigateUp": new Command(() => {
7270
+ this.moveListSelection(-1);
7385
7271
  }),
7386
- "searchDialog_NavigateDown": new command(function() {
7387
- moveListSelection(1);
7272
+ "searchDialog_NavigateDown": new Command(() => {
7273
+ this.moveListSelection(1);
7388
7274
  })
7389
7275
  };
7390
- Binder.bind(
7391
- $navigationPlaceholder,
7392
- {
7393
- controller,
7394
- commands: navigationCommandSet
7395
- },
7396
- viewerOptions
7397
- );
7276
+ Binder.attachCommands(this.$navigationPlaceholder, this.navigationCommandSet, this.viewerOptions);
7398
7277
  }
7399
- function initResultsArea() {
7278
+ initResultsArea() {
7400
7279
  try {
7401
- $resultsPlaceholder.kendoListView({
7280
+ this.$resultsPlaceholder.kendoListView({
7402
7281
  selectable: true,
7403
7282
  navigatable: true,
7404
7283
  dataSource: {},
7405
7284
  contentElement: "",
7406
7285
  template: "<div class='trv-search-dialog-results-row'><span>#: description #</span> <span class='trv-search-dialog-results-pageSpan'>" + stringResources.searchDialogPageText + " #:page#</span></div>",
7407
- change: function() {
7408
- var index = this.select().index();
7409
- var view = this.dataSource.view();
7286
+ change: (event) => {
7287
+ var listView = event.sender;
7288
+ var index = listView.select().index();
7289
+ var view = listView.dataSource.view();
7410
7290
  var dataItem = view[index];
7411
- onSelectedItem(dataItem);
7412
- updateUI(index, view.length);
7291
+ this.onSelectedItem(dataItem);
7292
+ this.updateUI(index, view.length);
7413
7293
  }
7414
7294
  });
7415
- } catch (e) {
7416
- console.error("Instantiation of Kendo ListView as search result area threw an exception", e);
7417
- throw e;
7295
+ } catch (error) {
7296
+ console.error("Instantiation of Kendo ListView as search result area threw an exception", error);
7297
+ throw error;
7418
7298
  }
7419
7299
  }
7420
- function stopSearch() {
7421
- setStopButtonEnabledState(false);
7300
+ stopSearch() {
7301
+ this.setStopButtonEnabledState(false);
7422
7302
  }
7423
- function toggleCommand(cmd) {
7303
+ toggleCommand(cmd) {
7424
7304
  cmd.checked(!cmd.checked());
7425
- searchForCurrentToken();
7305
+ this.searchForCurrentToken();
7426
7306
  }
7427
- function setStopButtonEnabledState(enabledState) {
7428
- stopSearchCommand.enabled(enabledState);
7307
+ setStopButtonEnabledState(enabledState) {
7308
+ this.stopSearchCommand.enabled(enabledState);
7429
7309
  }
7430
- function onPageReady(args, page) {
7431
- if (dialogVisible) {
7432
- colorPageElements(searchResults);
7310
+ onPageReady(args, page) {
7311
+ if (this.dialogVisible) {
7312
+ this.colorPageElements(this.searchResults);
7433
7313
  }
7434
7314
  }
7435
- function onInputFiltering(e) {
7436
- e.preventDefault();
7437
- if (e.filter && e.filter.value !== lastSearch) {
7438
- lastSearch = e.filter.value;
7439
- searchForToken(lastSearch);
7315
+ onInputFiltering(event) {
7316
+ event.preventDefault();
7317
+ if (event.filter && event.filter.value !== this.lastSearch) {
7318
+ this.lastSearch = event.filter.value;
7319
+ this.searchForToken(this.lastSearch);
7440
7320
  }
7441
7321
  }
7442
- function kendoComboBoxSelect(e) {
7443
- var newValue = e.sender.value();
7444
- if (newValue && lastSearch !== newValue) {
7445
- lastSearch = newValue;
7446
- searchForToken(lastSearch);
7322
+ kendoComboBoxSelect(event) {
7323
+ var newValue = event.sender.value();
7324
+ if (newValue && this.lastSearch !== newValue) {
7325
+ this.lastSearch = newValue;
7326
+ this.searchForToken(this.lastSearch);
7447
7327
  }
7448
7328
  }
7449
- function searchForCurrentToken() {
7450
- if (kendoComboBox) {
7451
- searchForToken(kendoComboBox.value());
7329
+ searchForCurrentToken() {
7330
+ if (this.kendoComboBox) {
7331
+ this.searchForToken(this.kendoComboBox.value());
7452
7332
  }
7453
7333
  }
7454
- function searchForToken(token) {
7455
- onSearchStarted();
7456
- addToMRU(token);
7457
- controller.getSearchResults(
7334
+ searchForToken(token) {
7335
+ this.onSearchStarted();
7336
+ this.addToMRU(token);
7337
+ this.controller.getSearchResults(
7458
7338
  {
7459
7339
  searchToken: token,
7460
- matchCase: optionsCommandSet.searchDialog_MatchCase.checked(),
7461
- matchWholeWord: optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7462
- useRegex: optionsCommandSet.searchDialog_UseRegex.checked()
7340
+ matchCase: this.optionsCommandSet.searchDialog_MatchCase.checked(),
7341
+ matchWholeWord: this.optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7342
+ useRegex: this.optionsCommandSet.searchDialog_UseRegex.checked()
7463
7343
  }
7464
- ).then(function(results) {
7465
- updateResultsUI(results, null);
7466
- }).catch(function(errorMessage) {
7344
+ ).then((results) => {
7345
+ this.updateResultsUI(results, null);
7346
+ }).catch((errorMessage) => {
7467
7347
  if (errorMessage) {
7468
- updateResultsUI(null, errorMessage);
7348
+ this.updateResultsUI(null, errorMessage);
7469
7349
  }
7470
7350
  });
7471
7351
  }
7472
- function onSearchStarted() {
7473
- $resultsLabel.text(stringResources.searchDialogSearchInProgress);
7474
- clearColoredItems();
7475
- searchResults = null;
7476
- setStopButtonEnabledState(true);
7477
- toggleErrorLabel(false, null);
7352
+ onSearchStarted() {
7353
+ this.$resultsLabel.text(stringResources.searchDialogSearchInProgress);
7354
+ this.clearColoredItems();
7355
+ this.searchResults = null;
7356
+ this.setStopButtonEnabledState(true);
7357
+ this.toggleErrorLabel(false, null);
7478
7358
  }
7479
- function updateResultsUI(results, error) {
7480
- setStopButtonEnabledState(false);
7359
+ updateResultsUI(results, error) {
7360
+ this.setStopButtonEnabledState(false);
7481
7361
  if (error) {
7482
- toggleErrorLabel(true, error);
7362
+ this.toggleErrorLabel(true, error);
7483
7363
  }
7484
- displayResultsList(results);
7485
- searchResults = results;
7364
+ this.displayResultsList(results);
7365
+ this.searchResults = results;
7486
7366
  if (results && results.length > 0) {
7487
- colorPageElements(results);
7488
- selectFirstElement();
7367
+ this.colorPageElements(results);
7368
+ this.selectFirstElement();
7489
7369
  } else {
7490
- updateUI(-1, 0);
7370
+ this.updateUI(-1, 0);
7491
7371
  }
7492
7372
  }
7493
- function addToMRU(token) {
7373
+ addToMRU(token) {
7494
7374
  if (!token || token === "") {
7495
7375
  return;
7496
7376
  }
7497
- var exists = mruList.filter(function(mru) {
7377
+ var exists = this.mruList.filter((mru) => {
7498
7378
  return mru.value === token;
7499
7379
  });
7500
7380
  if (exists && exists.length > 0) {
7501
7381
  return;
7502
7382
  }
7503
- mruList.unshift({ value: token });
7504
- if (mruList.length > 10) {
7505
- mruList.pop();
7383
+ this.mruList.unshift({ value: token });
7384
+ if (this.mruList.length > 10) {
7385
+ this.mruList.pop();
7506
7386
  }
7507
- inputComboRebinding = true;
7508
- kendoComboBox.dataSource.data(mruList);
7509
- kendoComboBox.select(function(item) {
7387
+ this.inputComboRebinding = true;
7388
+ this.kendoComboBox.dataSource.data(this.mruList);
7389
+ this.kendoComboBox.select((item) => {
7510
7390
  return item.value === token;
7511
7391
  });
7512
- inputComboRebinding = false;
7392
+ this.inputComboRebinding = false;
7513
7393
  }
7514
- function displayResultsList(results) {
7515
- var $listView = $resultsPlaceholder.data("kendoListView");
7394
+ displayResultsList(results) {
7395
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7516
7396
  if (!results) {
7517
7397
  results = [];
7518
7398
  }
7519
7399
  $listView.dataSource.data(results);
7520
7400
  }
7521
- function colorPageElements(results) {
7401
+ colorPageElements(results) {
7522
7402
  if (!results || results.length === 0) {
7523
7403
  return;
7524
7404
  }
7525
- var $parent = $placeholder.parent();
7405
+ var $parent = this.$element.parent();
7526
7406
  var $pageContainer = $parent.find(".trv-page-container");
7527
7407
  var elements = $pageContainer.find("[data-search-id]");
7528
- each(results, function() {
7529
- var $searchElement = elements.filter("[data-search-id=" + this.id + "]");
7408
+ Array.from(results).forEach((result) => {
7409
+ var $searchElement = elements.filter("[data-search-id=" + result.id + "]");
7530
7410
  if ($searchElement) {
7531
- $searchElement.addClass(highlightManager.shadedClassName);
7532
- highlightManager.elements.push($searchElement);
7411
+ $searchElement.addClass(this.highlightManager.shadedClassName);
7412
+ this.highlightManager.elements.push($searchElement);
7533
7413
  }
7534
7414
  });
7535
- highlightItem(pendingHighlightItem);
7536
- pendingHighlightItem = null;
7415
+ this.highlightItem(this.pendingHighlightItem);
7416
+ this.pendingHighlightItem = null;
7537
7417
  }
7538
- function highlightItem(item) {
7418
+ highlightItem(item) {
7539
7419
  if (item) {
7540
7420
  var currentItemId = item.id;
7541
- var newHighlighted = $(highlightManager.elements.filter(function(i) {
7421
+ var newHighlighted = $(this.highlightManager.elements.filter((i) => {
7542
7422
  return i.attr("data-search-id") === currentItemId;
7543
7423
  })).first();
7544
7424
  if (newHighlighted) {
7545
- highlightManager.current = newHighlighted[0];
7546
- if (highlightManager.current) {
7425
+ this.highlightManager.current = newHighlighted[0];
7426
+ if (this.highlightManager.current) {
7547
7427
  var current = $("[data-search-id='" + currentItemId + "']");
7548
- current.removeClass(highlightManager.shadedClassName);
7549
- current.addClass(highlightManager.highlightedClassName);
7428
+ current.removeClass(this.highlightManager.shadedClassName);
7429
+ current.addClass(this.highlightManager.highlightedClassName);
7550
7430
  }
7551
7431
  }
7552
7432
  }
7553
7433
  }
7554
- function selectFirstElement() {
7555
- var $listView = $resultsPlaceholder.data("kendoListView");
7434
+ selectFirstElement() {
7435
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7556
7436
  var first = $listView.element.children().first();
7557
7437
  $listView.select(first);
7558
7438
  $listView.trigger("change");
7559
7439
  }
7560
- function onSelectedItem(item) {
7440
+ onSelectedItem(item) {
7561
7441
  if (!item) {
7562
7442
  return;
7563
7443
  }
7564
- if (highlightManager.current) {
7565
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7566
- highlightManager.current.addClass(highlightManager.shadedClassName);
7444
+ if (this.highlightManager.current) {
7445
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7446
+ this.highlightManager.current.addClass(this.highlightManager.shadedClassName);
7567
7447
  }
7568
- if (item.page === controller.getCurrentPageNumber()) {
7569
- highlightItem(item);
7448
+ if (item.page === this.controller.getCurrentPageNumber()) {
7449
+ this.highlightItem(item);
7570
7450
  } else {
7571
- if (controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7572
- clearColoredItems();
7451
+ if (this.controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7452
+ this.clearColoredItems();
7573
7453
  } else {
7574
- highlightItem(item);
7454
+ this.highlightItem(item);
7575
7455
  }
7576
7456
  }
7577
- pendingHighlightItem = item;
7578
- controller.navigateToPage(item.page, { type: "search", id: item.id });
7457
+ this.pendingHighlightItem = item;
7458
+ this.controller.navigateToPage(item.page, { type: "search", id: item.id });
7579
7459
  }
7580
- function updateUI(index, count) {
7460
+ updateUI(index, count) {
7581
7461
  var str = count === 0 ? stringResources.searchDialogNoResultsLabel : stringFormat(stringResources.searchDialogResultsFormatLabel, [index + 1, count]);
7582
- $resultsLabel.text(str);
7462
+ this.$resultsLabel.text(str);
7583
7463
  var allowMoveUp = index > 0;
7584
7464
  var allowMoveDown = index < count - 1;
7585
- navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7586
- navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7465
+ this.navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7466
+ this.navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7587
7467
  }
7588
- function clearColoredItems() {
7589
- if (highlightManager.elements && highlightManager.elements.length > 0) {
7590
- each(highlightManager.elements, function() {
7591
- this.removeClass(highlightManager.shadedClassName);
7468
+ clearColoredItems() {
7469
+ if (this.highlightManager.elements && this.highlightManager.elements.length > 0) {
7470
+ Array.from(this.highlightManager.elements).forEach(($element) => {
7471
+ $element.removeClass(this.highlightManager.shadedClassName);
7592
7472
  });
7593
7473
  }
7594
- if (highlightManager.current) {
7595
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7474
+ if (this.highlightManager.current) {
7475
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7596
7476
  }
7597
- highlightManager.elements = [];
7598
- highlightManager.current = null;
7477
+ this.highlightManager.elements = [];
7478
+ this.highlightManager.current = null;
7599
7479
  }
7600
- function moveListSelection(offset) {
7601
- var $listView = $resultsPlaceholder.data("kendoListView");
7480
+ moveListSelection(offset) {
7481
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7602
7482
  var $selected = $listView.select();
7603
7483
  if (!$selected) {
7604
7484
  $selected = $listView.element.children().first();
@@ -7614,12 +7494,12 @@ var telerikReportViewer = (function (exports) {
7614
7494
  if (element) {
7615
7495
  $listView.select(element);
7616
7496
  $listView.trigger("change");
7617
- scrollIfNeeded(element[0], $listView.element[0]);
7497
+ this.scrollIfNeeded(element[0], $listView.element[0]);
7618
7498
  }
7619
7499
  }
7620
7500
  }
7621
7501
  }
7622
- function scrollIfNeeded(element, container) {
7502
+ scrollIfNeeded(element, container) {
7623
7503
  if (element.offsetTop - element.clientHeight < container.scrollTop) {
7624
7504
  element.scrollIntoView();
7625
7505
  } else {
@@ -7630,13 +7510,13 @@ var telerikReportViewer = (function (exports) {
7630
7510
  }
7631
7511
  }
7632
7512
  }
7633
- function toggleErrorLabel(show, message) {
7634
- var $errorIcon = $searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7513
+ toggleErrorLabel(show, message) {
7514
+ var $errorIcon = this.$searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7635
7515
  if (!$errorIcon || $errorIcon.length === 0) {
7636
7516
  console.log(message);
7637
7517
  return;
7638
7518
  }
7639
- var menuItem = $searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7519
+ var menuItem = this.$searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7640
7520
  if (show) {
7641
7521
  $errorIcon[0].title = message;
7642
7522
  menuItem.show();
@@ -7644,79 +7524,42 @@ var telerikReportViewer = (function (exports) {
7644
7524
  menuItem.hide();
7645
7525
  }
7646
7526
  }
7647
- function replaceStringResources($search) {
7648
- if (!$search) {
7649
- return;
7650
- }
7651
- var $searchCaption = $search.find(".trv-search-dialog-caption-label");
7652
- var $searchOptions = $search.find(".trv-search-dialog-search-options");
7653
- var $searchStopButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_StopSearch']");
7654
- var $searchMatchCaseButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchCase']");
7655
- var $searchMatchWholeWordButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchWholeWord']");
7656
- var $searchUseRegexButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_UseRegex']");
7657
- var $searchNavigateUpButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateUp']");
7658
- var $searchNavigateDownButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateDown']");
7659
- replaceAttribute($search, "aria-label");
7660
- replaceAttribute($searchOptions, "aria-label");
7661
- replaceText($searchCaption);
7662
- replaceTitleAndAriaLabel($searchStopButton);
7663
- replaceTitleAndAriaLabel($searchMatchCaseButton);
7664
- replaceTitleAndAriaLabel($searchMatchWholeWordButton);
7665
- replaceTitleAndAriaLabel($searchUseRegexButton);
7666
- replaceTitleAndAriaLabel($searchNavigateUpButton);
7667
- replaceTitleAndAriaLabel($searchNavigateDownButton);
7668
- }
7669
- function replaceTitleAndAriaLabel($a) {
7670
- replaceAttribute($a, "title");
7671
- replaceAttribute($a, "aria-label");
7672
- }
7673
- function replaceText($el) {
7674
- if ($el) {
7675
- $el.text(stringResources[$el.text()]);
7676
- }
7677
- }
7678
- function replaceAttribute($el, attribute) {
7679
- if ($el) {
7680
- $el.attr(attribute, stringResources[$el.attr(attribute)]);
7681
- }
7682
- }
7683
- function command(execCallback) {
7684
- var enabledState = true;
7685
- var checkedState = false;
7686
- var cmd = {
7687
- enabled: function(state) {
7688
- if (arguments.length === 0) {
7689
- return enabledState;
7690
- }
7691
- var newState = Boolean(state);
7692
- enabledState = newState;
7693
- $(this).trigger("enabledChanged");
7694
- return cmd;
7695
- },
7696
- checked: function(state) {
7697
- if (arguments.length === 0) {
7698
- return checkedState;
7699
- }
7700
- var newState = Boolean(state);
7701
- checkedState = newState;
7702
- $(this).trigger("checkedChanged");
7703
- return cmd;
7704
- },
7705
- exec: execCallback
7706
- };
7707
- return cmd;
7708
- }
7709
7527
  }
7710
- var pluginName$3 = "telerik_ReportViewer_SearchDialog";
7711
- $.fn[pluginName$3] = function(options, viewerOptions) {
7712
- return each(this, function() {
7713
- if (!$.data(this, pluginName$3)) {
7714
- $.data(this, pluginName$3, new Search(this, options, viewerOptions));
7715
- }
7716
- });
7717
- };
7718
7528
 
7719
7529
  var defaultOptions = {};
7530
+ function replaceStringResources($sendEmailDialog) {
7531
+ if (!$sendEmailDialog) {
7532
+ return;
7533
+ }
7534
+ var labels = $sendEmailDialog.find(".trv-replace-string");
7535
+ var ariaLabel = $sendEmailDialog.find("[aria-label]");
7536
+ var titles = $sendEmailDialog.find("[title]");
7537
+ if (labels.length) {
7538
+ Array.from(labels).forEach((element) => {
7539
+ replaceText($(element));
7540
+ });
7541
+ }
7542
+ if (ariaLabel.length) {
7543
+ Array.from(ariaLabel).forEach((element) => {
7544
+ replaceAttribute($(element), "aria-label");
7545
+ });
7546
+ }
7547
+ if (titles.length) {
7548
+ Array.from(titles).forEach((element) => {
7549
+ replaceAttribute($(element), "title");
7550
+ });
7551
+ }
7552
+ }
7553
+ function replaceText($el) {
7554
+ if ($el) {
7555
+ $el.text(stringResources[$el.text()]);
7556
+ }
7557
+ }
7558
+ function replaceAttribute($el, attribute) {
7559
+ if ($el) {
7560
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
7561
+ }
7562
+ }
7720
7563
  function SendEmail(placeholder, options, viewerOptions) {
7721
7564
  options = $.extend({}, defaultOptions, options);
7722
7565
  var controller = options.controller;
@@ -7815,9 +7658,9 @@ var telerikReportViewer = (function (exports) {
7815
7658
  }, 250);
7816
7659
  }
7817
7660
  }).data("kendoWindow");
7818
- } catch (e) {
7819
- console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", e);
7820
- throw e;
7661
+ } catch (error) {
7662
+ console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", error);
7663
+ throw error;
7821
7664
  }
7822
7665
  kendoSendEmailDialog.wrapper.addClass("trv-send-email");
7823
7666
  try {
@@ -7831,13 +7674,13 @@ var telerikReportViewer = (function (exports) {
7831
7674
  this.trigger("change");
7832
7675
  }
7833
7676
  }).data("kendoComboBox");
7834
- } catch (e) {
7835
- console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", e);
7836
- throw e;
7677
+ } catch (error) {
7678
+ console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", error);
7679
+ throw error;
7837
7680
  }
7838
- $placeholder.on("keydown", '[name="format_input"]', function(e) {
7681
+ $placeholder.on("keydown", '[name="format_input"]', function(event) {
7839
7682
  var tabkey = 9;
7840
- if (e.keyCode === tabkey && bodyEditor) {
7683
+ if (event.keyCode === tabkey && bodyEditor) {
7841
7684
  setTimeout(function() {
7842
7685
  bodyEditor.focus();
7843
7686
  });
@@ -7870,9 +7713,9 @@ var telerikReportViewer = (function (exports) {
7870
7713
  "superscript"
7871
7714
  ]
7872
7715
  }).data("kendoEditor");
7873
- } catch (e) {
7874
- console.error("Instantiation of Kendo Editor for Email body editor threw an exception", e);
7875
- throw e;
7716
+ } catch (error) {
7717
+ console.error("Instantiation of Kendo Editor for Email body editor threw an exception", error);
7718
+ throw error;
7876
7719
  }
7877
7720
  setDefaultValues(viewerOptions.sendEmail);
7878
7721
  initialized = true;
@@ -7949,22 +7792,14 @@ var telerikReportViewer = (function (exports) {
7949
7792
  }
7950
7793
  function initCommands() {
7951
7794
  optionsCommandSet = {
7952
- //the command names MUST match the commands in the template.html with the "telerik_Reportviewer" prefix so the binder could work.
7953
- "sendEmail_Cancel": new command(function() {
7795
+ "sendEmail_Cancel": new Command(function() {
7954
7796
  closeWindow();
7955
7797
  }),
7956
- "sendEmail_Send": new command(function(e) {
7798
+ "sendEmail_Send": new Command(function() {
7957
7799
  sendingEmail();
7958
7800
  })
7959
7801
  };
7960
- Binder.bind(
7961
- $placeholder.find(".trv-send-email-actions"),
7962
- {
7963
- controller,
7964
- commands: optionsCommandSet
7965
- },
7966
- viewerOptions
7967
- );
7802
+ Binder.attachCommands($placeholder.find(".trv-send-email-actions"), optionsCommandSet, viewerOptions);
7968
7803
  }
7969
7804
  function sendingEmail(cmd, args) {
7970
7805
  var sendEmailArgs = {
@@ -7982,17 +7817,17 @@ var telerikReportViewer = (function (exports) {
7982
7817
  }
7983
7818
  }
7984
7819
  function setValidation() {
7985
- inputFrom.off("blur").on("blur", function(e) {
7820
+ inputFrom.off("blur").on("blur", function(event) {
7986
7821
  if (!isEmpty($(this))) {
7987
7822
  isValidEmail($(this), false);
7988
7823
  }
7989
7824
  });
7990
- inputTo.off("blur").on("blur", function(e) {
7825
+ inputTo.off("blur").on("blur", function(event) {
7991
7826
  if (!isEmpty($(this))) {
7992
7827
  isValidEmail($(this), true);
7993
7828
  }
7994
7829
  });
7995
- inputCC.off("blur").on("blur", function(e) {
7830
+ inputCC.off("blur").on("blur", function(event) {
7996
7831
  if ($(this).val().length) {
7997
7832
  isValidEmail($(this), true);
7998
7833
  } else {
@@ -8051,9 +7886,8 @@ var telerikReportViewer = (function (exports) {
8051
7886
  }
8052
7887
  }
8053
7888
  return true;
8054
- } else {
8055
- return _validateEmail(inputValue, $el);
8056
7889
  }
7890
+ return _validateEmail(inputValue, $el);
8057
7891
  }
8058
7892
  function _validateEmail(email, $el) {
8059
7893
  var regexEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
@@ -8073,74 +7907,7 @@ var telerikReportViewer = (function (exports) {
8073
7907
  function clearValidation() {
8074
7908
  $(".k-invalid-msg").removeClass("-visible");
8075
7909
  }
8076
- function replaceStringResources($sendEmailDialog) {
8077
- if (!$sendEmailDialog) {
8078
- return;
8079
- }
8080
- var labels = $sendEmailDialog.find(".trv-replace-string");
8081
- var ariaLabel = $sendEmailDialog.find("[aria-label]");
8082
- var titles = $sendEmailDialog.find("[title]");
8083
- if (labels.length) {
8084
- $.each(labels, function(key, value) {
8085
- replaceText($(value));
8086
- });
8087
- }
8088
- if (ariaLabel.length) {
8089
- $.each(ariaLabel, function(key, value) {
8090
- replaceAttribute($(value), "aria-label");
8091
- });
8092
- }
8093
- if (titles.length) {
8094
- $.each(titles, function(key, value) {
8095
- replaceAttribute($(value), "title");
8096
- });
8097
- }
8098
- }
8099
- function replaceText($el) {
8100
- if ($el) {
8101
- $el.text(stringResources[$el.text()]);
8102
- }
8103
- }
8104
- function replaceAttribute($el, attribute) {
8105
- if ($el) {
8106
- $el.attr(attribute, stringResources[$el.attr(attribute)]);
8107
- }
8108
- }
8109
- function command(execCallback) {
8110
- var enabledState = true;
8111
- var checkedState = false;
8112
- var cmd = {
8113
- enabled: function(state) {
8114
- if (arguments.length === 0) {
8115
- return enabledState;
8116
- }
8117
- var newState = Boolean(state);
8118
- enabledState = newState;
8119
- $(this).trigger("enabledChanged");
8120
- return cmd;
8121
- },
8122
- checked: function(state) {
8123
- if (arguments.length === 0) {
8124
- return checkedState;
8125
- }
8126
- var newState = Boolean(state);
8127
- checkedState = newState;
8128
- $(this).trigger("checkedChanged");
8129
- return cmd;
8130
- },
8131
- exec: execCallback
8132
- };
8133
- return cmd;
8134
- }
8135
7910
  }
8136
- var pluginName$2 = "telerik_ReportViewer_SendEmail";
8137
- $.fn[pluginName$2] = function(options, viewerOptions) {
8138
- return each(this, function() {
8139
- if (!$.data(this, pluginName$2)) {
8140
- $.data(this, pluginName$2, new SendEmail(this, options, viewerOptions));
8141
- }
8142
- });
8143
- };
8144
7911
 
8145
7912
  function SideMenu(dom, rootOptions, otherOptions) {
8146
7913
  var options = $.extend({}, rootOptions, otherOptions);
@@ -8210,16 +7977,15 @@ var telerikReportViewer = (function (exports) {
8210
7977
  });
8211
7978
  }
8212
7979
  function fillFormats(formats) {
8213
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
8214
- var $list = $(this);
7980
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
7981
+ var $list = $(list);
8215
7982
  var $parent = $list.parents("li");
8216
7983
  var tabIndex = $parent.attr("tabindex");
8217
7984
  if (!tabIndex) {
8218
7985
  tabIndex = DEFAULT_TABINDEX;
8219
7986
  }
8220
7987
  $list.empty();
8221
- each(formats, function(i) {
8222
- var format = this;
7988
+ Array.from(formats).forEach((format) => {
8223
7989
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
8224
7990
  var li = "<li " + ariaLabel + stringFormat('tabindex="' + tabIndex + '"><a tabindex="-1" href="#" data-command="telerik_ReportViewer_export" data-command-parameter="{name}"><span>{localizedName}</span></a></li>', format);
8225
7991
  panelBar.append(li, $parent);
@@ -8229,10 +7995,10 @@ var telerikReportViewer = (function (exports) {
8229
7995
  });
8230
7996
  }
8231
7997
  function enableCloseOnClick(root) {
8232
- each(root.find("li"), function() {
8233
- var isLeaf = $(this).children("ul").length === 0;
7998
+ Array.from(root.find("li")).forEach((listItem) => {
7999
+ var isLeaf = $(listItem).children("ul").length === 0;
8234
8000
  if (isLeaf) {
8235
- $(this).children("a").click(function() {
8001
+ $(listItem).children("a").on("click", (event) => {
8236
8002
  controller.setSideMenuVisible({ visible: !sideMenuVisible });
8237
8003
  });
8238
8004
  }
@@ -8250,21 +8016,21 @@ var telerikReportViewer = (function (exports) {
8250
8016
  function setListItemsTabIndex(list, tabIndex) {
8251
8017
  list.attr("tabindex", tabIndex);
8252
8018
  var items = list.find("li");
8253
- each(items, function() {
8254
- var $item = $(this);
8019
+ Array.from(items).forEach((item) => {
8020
+ var $item = $(item);
8255
8021
  $item.attr("tabindex", tabIndex);
8256
8022
  var anchor = $item.children("a");
8257
8023
  if (anchor.length > 0) {
8258
8024
  var $anchor = $(anchor);
8259
8025
  $anchor.attr("tabindex", -1);
8260
8026
  }
8261
- $item.focus(function() {
8027
+ $item.on("focus", (event) => {
8262
8028
  var anchor2 = $item.children("a");
8263
8029
  if (anchor2.length > 0) {
8264
8030
  anchor2.addClass("k-focus");
8265
8031
  }
8266
8032
  });
8267
- $item.blur(function() {
8033
+ $item.on("blur", (event) => {
8268
8034
  var anchor2 = $item.children("a");
8269
8035
  if (anchor2.length > 0) {
8270
8036
  anchor2.removeClass("k-focus");
@@ -8328,12 +8094,12 @@ var telerikReportViewer = (function (exports) {
8328
8094
  if (!menuAreas) {
8329
8095
  return;
8330
8096
  }
8331
- each(menuAreas, function() {
8332
- var $menu = $(this);
8097
+ Array.from(menuAreas).forEach((menu2) => {
8098
+ var $menu = $(menu2);
8333
8099
  var menuItems = $menu.children("li.k-panelbar-header");
8334
8100
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
8335
- each(menuItems, function() {
8336
- var $menuItem = $(this);
8101
+ Array.from(menuItems).forEach((menuItem) => {
8102
+ var $menuItem = $(menuItem);
8337
8103
  var $a = $menuItem.find("a");
8338
8104
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
8339
8105
  if ($a) {
@@ -8347,22 +8113,14 @@ var telerikReportViewer = (function (exports) {
8347
8113
  });
8348
8114
  }
8349
8115
  function findMenuArea() {
8350
- return findElement("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8116
+ return $("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8351
8117
  }
8352
8118
  }
8353
- var pluginName$1 = "telerik_ReportViewer_SideMenu";
8354
- $.fn[pluginName$1] = function(options, otherOptions) {
8355
- return each(this, function() {
8356
- if (!$.data(this, pluginName$1)) {
8357
- $.data(this, pluginName$1, new SideMenu(this, options, otherOptions));
8358
- }
8359
- });
8360
- };
8361
8119
 
8362
- var __defProp$1 = Object.defineProperty;
8363
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8364
- var __publicField$1 = (obj, key, value) => {
8365
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8120
+ var __defProp$4 = Object.defineProperty;
8121
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8122
+ var __publicField$4 = (obj, key, value) => {
8123
+ __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
8366
8124
  return value;
8367
8125
  };
8368
8126
  class MemStorage {
@@ -8370,7 +8128,7 @@ var telerikReportViewer = (function (exports) {
8370
8128
  // #region constructor
8371
8129
  constructor() {
8372
8130
  // #region fields
8373
- __publicField$1(this, "_data", {});
8131
+ __publicField$4(this, "_data", {});
8374
8132
  this._data = {};
8375
8133
  }
8376
8134
  // #endregion
@@ -8411,14 +8169,14 @@ var telerikReportViewer = (function (exports) {
8411
8169
  html = replaceAll(html, "{service}/", baseUri);
8412
8170
  html = replaceAll(html, "{service}", baseUri);
8413
8171
  var viewerTemplate = $("<div></div>").html(html);
8414
- each(viewerTemplate.find("template"), function(index, e) {
8415
- var $e = $(e);
8416
- templates[$e.attr("id")] = trim($e.html(), "\n ");
8172
+ Array.from(viewerTemplate.find("template")).forEach((element) => {
8173
+ var $element = $(element);
8174
+ templates[$element.attr("id")] = trim($element.html(), "\n ");
8417
8175
  });
8418
- each(viewerTemplate.find("link"), function(index, e) {
8419
- styleSheets.push(trim(e.outerHTML, "\n "));
8176
+ Array.from(viewerTemplate.find("link")).forEach((element) => {
8177
+ styleSheets.push(trim(element.outerHTML, "\n "));
8420
8178
  });
8421
- styleSheets = filterUniqueLastOccurance(styleSheets);
8179
+ styleSheets = filterUniqueLastOccurrence(styleSheets);
8422
8180
  return {
8423
8181
  templates,
8424
8182
  styleSheets
@@ -8430,10 +8188,10 @@ var telerikReportViewer = (function (exports) {
8430
8188
  };
8431
8189
  }();
8432
8190
 
8433
- var __defProp = Object.defineProperty;
8434
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8435
- var __publicField = (obj, key, value) => {
8436
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8191
+ var __defProp$3 = Object.defineProperty;
8192
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8193
+ var __publicField$3 = (obj, key, value) => {
8194
+ __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8437
8195
  return value;
8438
8196
  };
8439
8197
  class ReportViewerSettings {
@@ -8441,9 +8199,9 @@ var telerikReportViewer = (function (exports) {
8441
8199
  // #region constructor
8442
8200
  constructor(id, storage, defaultSettings) {
8443
8201
  // #region fields
8444
- __publicField(this, "_id");
8445
- __publicField(this, "_storage");
8446
- __publicField(this, "_defaults");
8202
+ __publicField$3(this, "_id");
8203
+ __publicField$3(this, "_storage");
8204
+ __publicField$3(this, "_defaults");
8447
8205
  this._id = id;
8448
8206
  this._storage = storage;
8449
8207
  this._defaults = defaultSettings || {};
@@ -8563,6 +8321,129 @@ var telerikReportViewer = (function (exports) {
8563
8321
  // #endregion
8564
8322
  }
8565
8323
 
8324
+ var __defProp$2 = Object.defineProperty;
8325
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8326
+ var __publicField$2 = (obj, key, value) => {
8327
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
8328
+ return value;
8329
+ };
8330
+ class BaseComponent {
8331
+ // #endregion
8332
+ // #region constructor
8333
+ constructor(element, options) {
8334
+ // #region fields
8335
+ __publicField$2(this, "element");
8336
+ __publicField$2(this, "$element");
8337
+ __publicField$2(this, "options");
8338
+ this.element = element;
8339
+ this.$element = $(element);
8340
+ this.options = options;
8341
+ }
8342
+ // #endregion
8343
+ }
8344
+
8345
+ var __defProp$1 = Object.defineProperty;
8346
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8347
+ var __publicField$1 = (obj, key, value) => {
8348
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8349
+ return value;
8350
+ };
8351
+ class LinkButton extends BaseComponent {
8352
+ // #endregion
8353
+ // #region constructor
8354
+ constructor(element, options) {
8355
+ super(element, options);
8356
+ // #region fields
8357
+ __publicField$1(this, "cmd");
8358
+ var dataCommand = this.$element.attr("data-command");
8359
+ if (dataCommand) {
8360
+ this.cmd = this.options.commands[dataCommand];
8361
+ }
8362
+ if (this.cmd) {
8363
+ this.$element.on("click", (event) => {
8364
+ if (this.cmd.enabled()) {
8365
+ this.cmd.exec($(this).attr("data-command-parameter"));
8366
+ } else {
8367
+ event.preventDefault();
8368
+ }
8369
+ });
8370
+ $(this.cmd).on("enabledChanged", (event) => {
8371
+ (this.cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call(this.$element, "disabled");
8372
+ }).on("checkedChanged", (event) => {
8373
+ (this.cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(this.$element, "checked");
8374
+ });
8375
+ }
8376
+ }
8377
+ // #endregion
8378
+ }
8379
+
8380
+ var __defProp = Object.defineProperty;
8381
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8382
+ var __publicField = (obj, key, value) => {
8383
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8384
+ return value;
8385
+ };
8386
+ class PageNumberInput extends BaseComponent {
8387
+ // #endregion
8388
+ // #region constructor
8389
+ constructor(element, options) {
8390
+ super(element, options);
8391
+ // #region fields
8392
+ __publicField(this, "cmd");
8393
+ __publicField(this, "_numeric");
8394
+ this.cmd = this.options.commands["goToPage"];
8395
+ this._numeric = new kendo.ui.NumericTextBox(this.element, {
8396
+ format: "0",
8397
+ decimals: 0,
8398
+ min: 0,
8399
+ spinners: false,
8400
+ change: this._onChange.bind(this),
8401
+ spin: this._onChange.bind(this)
8402
+ });
8403
+ this._numeric._text[0].dataset.role = "telerik_ReportViewer_PageNumberInput";
8404
+ this._numeric.element[0].dataset.role = "";
8405
+ this.options.controller.on("reportLoadComplete", (event, reportInfo) => {
8406
+ this._numeric.max(reportInfo.pageCount);
8407
+ this._numeric.min(Math.min(1, reportInfo.pageCount));
8408
+ this._numeric.value(Math.min(1, reportInfo.pageCount));
8409
+ }).on("loadedReportChange", (event) => {
8410
+ this._numeric.min(0);
8411
+ this._numeric.max(0);
8412
+ this._numeric.value(0);
8413
+ }).on("renderingStopped", (event) => {
8414
+ this._numeric.min(0);
8415
+ this._numeric.max(0);
8416
+ this._numeric.value(0);
8417
+ }).pageNumberChange((event, value) => {
8418
+ this._numeric.value(value);
8419
+ });
8420
+ }
8421
+ // #endregion
8422
+ // #region event handlers
8423
+ _onChange(event, data) {
8424
+ var val = this._numeric.value();
8425
+ var num = tryParseInt(val);
8426
+ if (!isNaN(num)) {
8427
+ this.cmd.exec(num);
8428
+ }
8429
+ }
8430
+ _onSpin(event, data) {
8431
+ return this._onChange(event, data);
8432
+ }
8433
+ // #endregion
8434
+ }
8435
+
8436
+ class PageCountLabel extends BaseComponent {
8437
+ // #region constructor
8438
+ constructor(element, options) {
8439
+ super(element, options);
8440
+ this.options.controller.pageCountChange((event, value) => {
8441
+ this.$element.text(value);
8442
+ });
8443
+ }
8444
+ // #endregion
8445
+ }
8446
+
8566
8447
  const Instances = GlobalSettings.viewerInstances;
8567
8448
  function getDefaultOptions(serviceUrl, version) {
8568
8449
  return {
@@ -8622,8 +8503,8 @@ var telerikReportViewer = (function (exports) {
8622
8503
  if (!validateOptions(options)) {
8623
8504
  return;
8624
8505
  }
8625
- var version = "18.1.24.514";
8626
- options = extend({}, getDefaultOptions(svcApiUrl, version), options);
8506
+ var version = "18.2.24.806";
8507
+ options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
8627
8508
  settings = new ReportViewerSettings(
8628
8509
  persistanceKey,
8629
8510
  options.persistSession ? window.sessionStorage : new MemStorage(),
@@ -9074,24 +8955,21 @@ var telerikReportViewer = (function (exports) {
9074
8955
  return e.outerHTML;
9075
8956
  }).toArray();
9076
8957
  var promises = [];
9077
- each(
9078
- styleSheets,
9079
- function(i, e) {
9080
- if (-1 === currentStyleLinks.indexOf(e)) {
9081
- promises.push(
9082
- new Promise(function(resolve, reject) {
9083
- var $link = $(e);
9084
- $link.on("load", resolve);
9085
- $link.on("onerror", function() {
9086
- logError("error loading stylesheet " + e);
9087
- resolve();
9088
- });
9089
- $head.append($link);
9090
- })
9091
- );
9092
- }
8958
+ Array.from(styleSheets).forEach((element) => {
8959
+ if (currentStyleLinks.indexOf(element) === -1) {
8960
+ promises.push(
8961
+ new Promise(function(resolve, reject) {
8962
+ var $link = $(element);
8963
+ $link.on("load", resolve);
8964
+ $link.on("onerror", function() {
8965
+ logError("error loading stylesheet " + element);
8966
+ resolve();
8967
+ });
8968
+ $head.append($link);
8969
+ })
8970
+ );
9093
8971
  }
9094
- );
8972
+ });
9095
8973
  return Promise.all(promises).then(controller.cssLoaded);
9096
8974
  }
9097
8975
  function browserSupportsAllFeatures() {
@@ -9100,12 +8978,11 @@ var telerikReportViewer = (function (exports) {
9100
8978
  function ensureKendo(version2) {
9101
8979
  if (window.kendo) {
9102
8980
  return Promise.resolve();
9103
- } else {
9104
- var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
9105
- return loadScript(kendoUrl).catch(function(errorData) {
9106
- logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
9107
- });
9108
8981
  }
8982
+ var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
8983
+ return loadScript(kendoUrl).catch(function(errorData) {
8984
+ logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
8985
+ });
9109
8986
  }
9110
8987
  function main(version2) {
9111
8988
  ensureKendo(version2).then(function() {
@@ -9133,7 +9010,7 @@ var telerikReportViewer = (function (exports) {
9133
9010
  if (browserSupportsAllFeatures()) {
9134
9011
  main(version);
9135
9012
  } else {
9136
- loadScriptWithCallback("https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise", main, version);
9013
+ throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
9137
9014
  }
9138
9015
  return viewer;
9139
9016
  }
@@ -9142,7 +9019,7 @@ var telerikReportViewer = (function (exports) {
9142
9019
  if (this.selector && !options.selector) {
9143
9020
  options.selector = this.selector;
9144
9021
  }
9145
- return each(this, function() {
9022
+ return this.each(function() {
9146
9023
  if (!$.data(this, pluginName)) {
9147
9024
  $.data(this, pluginName, new ReportViewer(this, options));
9148
9025
  }
@@ -9176,11 +9053,23 @@ var telerikReportViewer = (function (exports) {
9176
9053
  {
9177
9054
  name: "telerik_ReportViewer_SideMenu",
9178
9055
  constructor: SideMenu
9056
+ },
9057
+ {
9058
+ name: "telerik_ReportViewer_LinkButton",
9059
+ constructor: LinkButton
9060
+ },
9061
+ {
9062
+ name: "telerik_ReportViewer_PageNumberInput",
9063
+ constructor: PageNumberInput
9064
+ },
9065
+ {
9066
+ name: "telerik_ReportViewer_PageCountLabel",
9067
+ constructor: PageCountLabel
9179
9068
  }
9180
9069
  ];
9181
9070
  plugins.forEach((plugin) => {
9182
9071
  $.fn[plugin.name] = function(options, otherOptions) {
9183
- return each(this, function() {
9072
+ return this.each(function() {
9184
9073
  if (!$.data(this, plugin.name)) {
9185
9074
  $.data(this, plugin.name, new plugin.constructor(this, options, otherOptions));
9186
9075
  }
@@ -9201,6 +9090,7 @@ var telerikReportViewer = (function (exports) {
9201
9090
  exports.ParameterEditors = ParameterEditors;
9202
9091
  exports.ParameterTypes = ParameterTypes;
9203
9092
  exports.ParameterValidators = ParameterValidators;
9093
+ exports.ParametersArea = ParametersArea;
9204
9094
  exports.ParametersAreaPositions = ParametersAreaPositions;
9205
9095
  exports.PerspectiveManager = PerspectiveManager;
9206
9096
  exports.PrintManager = PrintManager;