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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) 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 +22 -25
  6. package/dist/cjs/documentMapArea.js +4 -13
  7. package/dist/cjs/event-emitter.js +124 -10
  8. package/dist/cjs/mainMenu.js +22 -31
  9. package/dist/cjs/pagesArea.js +8 -27
  10. package/dist/cjs/parameterValidators.js +4 -7
  11. package/dist/cjs/parameters.js +13 -13
  12. package/dist/cjs/parametersArea.js +31 -47
  13. package/dist/cjs/print.js +3 -4
  14. package/dist/cjs/reportViewer.js +38 -27
  15. package/dist/cjs/scroll.js +4 -6
  16. package/dist/cjs/search.js +327 -377
  17. package/dist/cjs/sendEmail.js +52 -95
  18. package/dist/cjs/serviceClient.js +163 -257
  19. package/dist/cjs/sideMenu.js +15 -24
  20. package/dist/cjs/sr.js +4 -4
  21. package/dist/cjs/template-cache.js +6 -6
  22. package/dist/cjs/toolbar/link-button.js +42 -0
  23. package/dist/cjs/toolbar/page-count-label.js +18 -0
  24. package/dist/cjs/toolbar/page-number-input.js +64 -0
  25. package/dist/cjs/uiFreezeCoordinator.js +17 -16
  26. package/dist/cjs/utils.js +11 -14
  27. package/dist/es/accessibility.js +29 -39
  28. package/dist/es/base-component.js +22 -0
  29. package/dist/es/binder.js +45 -138
  30. package/dist/es/controller.js +23 -26
  31. package/dist/es/documentMapArea.js +4 -13
  32. package/dist/es/event-emitter.js +124 -10
  33. package/dist/es/mainMenu.js +23 -32
  34. package/dist/es/pagesArea.js +9 -28
  35. package/dist/es/parameterValidators.js +5 -8
  36. package/dist/es/parameters.js +14 -14
  37. package/dist/es/parametersArea.js +32 -48
  38. package/dist/es/print.js +4 -5
  39. package/dist/es/reportViewer.js +39 -28
  40. package/dist/es/scroll.js +4 -6
  41. package/dist/es/search.js +328 -378
  42. package/dist/es/sendEmail.js +52 -95
  43. package/dist/es/serviceClient.js +164 -258
  44. package/dist/es/sideMenu.js +16 -25
  45. package/dist/es/sr.js +4 -4
  46. package/dist/es/template-cache.js +7 -7
  47. package/dist/es/toolbar/link-button.js +38 -0
  48. package/dist/es/toolbar/page-count-label.js +14 -0
  49. package/dist/es/toolbar/page-number-input.js +60 -0
  50. package/dist/es/uiFreezeCoordinator.js +17 -16
  51. package/dist/es/utils.js +11 -14
  52. package/dist/font/font-icons.css +4 -4
  53. package/dist/font/font-icons.min.css +3 -3
  54. package/dist/js/telerikReportViewer.js +1071 -1188
  55. package/dist/js/telerikReportViewer.min.js +1 -1
  56. package/dist/js/telerikReportViewer.stringResources.js +4 -4
  57. package/dist/styles/telerikReportViewer.css +3 -3
  58. package/dist/styles/telerikReportViewer.min.css +3 -3
  59. package/dist/templates/telerikReportViewerTemplate-FA.html +4 -4
  60. package/dist/templates/telerikReportViewerTemplate.html +6 -6
  61. package/package.json +3 -2
  62. /package/dist/font/{ReportingIcons-18.1.24.514.ttf → ReportingIcons-18.1.24.709.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.1.24.709 (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;
@@ -2613,13 +2615,13 @@ var telerikReportViewer = (function (exports) {
2613
2615
  var parameterValues2 = {};
2614
2616
  var invalidParameters = [];
2615
2617
  var hasError = false;
2616
- each(parameters || [], function() {
2618
+ Array.from(parameters || []).forEach((parameter) => {
2617
2619
  try {
2618
- var value = parameterValidators.validate(this, this.value);
2619
- parameterValues2[this.id] = value;
2620
+ var value = parameterValidators.validate(parameter, parameter.value);
2621
+ parameterValues2[parameter.id] = value;
2620
2622
  } catch (e) {
2621
2623
  hasError = true;
2622
- invalidParameters.push(this);
2624
+ invalidParameters.push(parameter);
2623
2625
  return;
2624
2626
  }
2625
2627
  });
@@ -2696,8 +2698,8 @@ var telerikReportViewer = (function (exports) {
2696
2698
  eventEmitter.on(eventName, handler);
2697
2699
  return controller;
2698
2700
  },
2699
- trigger: function(eventName, args) {
2700
- eventEmitter.trigger(eventName, args);
2701
+ trigger: function(eventName, ...args) {
2702
+ eventEmitter.trigger(eventName, ...args);
2701
2703
  return controller;
2702
2704
  },
2703
2705
  showNotification: function(...args) {
@@ -3389,11 +3391,11 @@ var telerikReportViewer = (function (exports) {
3389
3391
  _loadVisiblePages: function _loadVisiblePages() {
3390
3392
  var that = this;
3391
3393
  var pages = that.$placeholder.find(".trv-report-page");
3392
- $.each(pages, function(index, value) {
3394
+ Array.from(pages).forEach((value) => {
3393
3395
  var pageItem = $(value);
3394
3396
  var pageNumber = parseInt(pageItem.attr("data-page"));
3395
3397
  if (that._scrolledInToView(pageItem) && that._isSkeletonScreen(pageItem, pageNumber)) {
3396
- that.controller.getPageData(pageNumber).then(function(newPage) {
3398
+ that.controller.getPageData(pageNumber).then((newPage) => {
3397
3399
  that._render(newPage, false);
3398
3400
  });
3399
3401
  }
@@ -3564,9 +3566,8 @@ var telerikReportViewer = (function (exports) {
3564
3566
  return that._findNewCurrentPage(pages.splice(middleIndex, Number.MAX_VALUE));
3565
3567
  } else if (result > 0 && pages.length > 1) {
3566
3568
  return that._findNewCurrentPage(pages.splice(0, middleIndex));
3567
- } else {
3568
- return -1;
3569
3569
  }
3570
+ return -1;
3570
3571
  },
3571
3572
  _findPageInViewPort: function _findPageInViewPort(index, pages) {
3572
3573
  var pageItem = this.$placeholder.find(pages[index]);
@@ -3583,9 +3584,8 @@ var telerikReportViewer = (function (exports) {
3583
3584
  }
3584
3585
  if (pageBottom < additionalTopOffset) {
3585
3586
  return -1;
3586
- } else {
3587
- return 1;
3588
3587
  }
3588
+ return 1;
3589
3589
  },
3590
3590
  _scrollDown: function _scrollDown(pages, scrollPosition) {
3591
3591
  var that = this;
@@ -3644,21 +3644,21 @@ var telerikReportViewer = (function (exports) {
3644
3644
  var UIFreezeCoordinator = {
3645
3645
  $placeholder: null,
3646
3646
  $scrollableContainer: null,
3647
- itemsInitialState: {},
3648
3647
  // Holds all items initial position per container
3648
+ itemsInitialState: {},
3649
+ // Holds the bounds of the frozen areas by X per container
3649
3650
  xFrozenAreasBounds: {},
3650
- //Holds the bounds of the frozen areas by X per container
3651
+ // Holds the bounds of the frozen areas by Y per container
3651
3652
  yFrozenAreasBounds: {},
3652
- //Holds the bounds of the frozen areas by Y per container
3653
3653
  freezeMaxZIndex: {},
3654
3654
  zIndex: 1,
3655
- freezeBGColor: {},
3656
3655
  // Holds default background-color value per container
3657
- currentlyfreezedContainer: {
3656
+ freezeBGColor: {},
3657
+ // Holds whether freezing has been applied per container.
3658
+ currentlyFrozenContainer: {
3658
3659
  vertical: {},
3659
3660
  horizontal: {}
3660
3661
  },
3661
- //Holds whether freezing has been applied per container.
3662
3662
  isInitialize: false,
3663
3663
  scaleFactor: null,
3664
3664
  /**
@@ -3786,28 +3786,28 @@ var telerikReportViewer = (function (exports) {
3786
3786
  var horizontalMoveOffset = scrollableContainerScrollLeft - elementWrapperLeftPosition;
3787
3787
  if (hasFixColumn && verticalMoveOffset > 0) {
3788
3788
  if (scrollableContainerScrollTop <= $elementWrapper.outerHeight() * this.scaleFactor + elementWrapperTopPosition - this.yFrozenAreasBounds[freezeItemsContainerID].height) {
3789
- this.currentlyfreezedContainer.vertical[freezeItemsContainerID] = true;
3789
+ this.currentlyFrozenContainer.vertical[freezeItemsContainerID] = true;
3790
3790
  this._updateUIElementsPosition($colHeaders, "top", verticalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3791
3791
  }
3792
3792
  } else {
3793
- if (this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3794
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3793
+ if (this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3794
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3795
3795
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3796
3796
  }
3797
3797
  }
3798
3798
  if (hasFixRow && horizontalMoveOffset > 0) {
3799
3799
  if (scrollableContainerScrollLeft <= $elementWrapper.outerWidth() * this.scaleFactor + elementWrapperLeftPosition - this.xFrozenAreasBounds[freezeItemsContainerID].width) {
3800
- this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] = true;
3800
+ this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] = true;
3801
3801
  this._updateUIElementsPosition($rowHeaders, "left", horizontalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3802
3802
  }
3803
3803
  } else {
3804
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID]) {
3805
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3804
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID]) {
3805
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3806
3806
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3807
3807
  }
3808
3808
  }
3809
3809
  } else {
3810
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3810
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3811
3811
  this._resetToDefaultPosition(freezeItemsContainerID);
3812
3812
  }
3813
3813
  }
@@ -3822,8 +3822,8 @@ var telerikReportViewer = (function (exports) {
3822
3822
  var $colHeaders = $("[data-sticky-direction*='Vertical'][data-sticky-id='" + freezeItemsContainerID + "']");
3823
3823
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3824
3824
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3825
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3826
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3825
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3826
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3827
3827
  },
3828
3828
  /**
3829
3829
  * Update the freeze elements position
@@ -3866,6 +3866,7 @@ var telerikReportViewer = (function (exports) {
3866
3866
  $item.css(newStyleRules);
3867
3867
  }
3868
3868
  },
3869
+ // eslint-disable-next-line max-params
3869
3870
  _applyBgColorOnScroll: function($item, isItemFrozenBothDirection, hasInitialBgColor, shouldApplyBGColor, freezeItemsContainerID) {
3870
3871
  if ($item.is("img")) {
3871
3872
  return true;
@@ -3884,7 +3885,7 @@ var telerikReportViewer = (function (exports) {
3884
3885
  return getColorAlphaValue(bgColorValue) > 0;
3885
3886
  },
3886
3887
  _isFrozen: function(freezeItemsContainerID) {
3887
- return this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3888
+ return this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3888
3889
  },
3889
3890
  /**
3890
3891
  * Checks if an UI element is in the visible part of the scrollable container
@@ -3942,7 +3943,7 @@ var telerikReportViewer = (function (exports) {
3942
3943
  var reportPageIsLoaded = false;
3943
3944
  var pageAreaImageStyle = '.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}';
3944
3945
  var pageAreaImageID = "trv-initial-image-styles";
3945
- var scroll = extend({}, Scroll, {});
3946
+ var scroll = $.extend({}, Scroll);
3946
3947
  var uiFreezeCoordinator = null;
3947
3948
  init();
3948
3949
  if (scroll) {
@@ -4028,7 +4029,7 @@ var telerikReportViewer = (function (exports) {
4028
4029
  enableInteractivity();
4029
4030
  }
4030
4031
  if (args.containsFrozenContent && !uiFreezeCoordinator) {
4031
- uiFreezeCoordinator = extend({}, UIFreezeCoordinator, {});
4032
+ uiFreezeCoordinator = $.extend({}, UIFreezeCoordinator);
4032
4033
  if (controller.getViewMode() === ViewModes.INTERACTIVE) {
4033
4034
  uiFreezeCoordinator.init($placeholder);
4034
4035
  }
@@ -4168,19 +4169,13 @@ var telerikReportViewer = (function (exports) {
4168
4169
  var result;
4169
4170
  var allPages = $pageContainer.find(".trv-report-page");
4170
4171
  if (controller.getPageMode() === PageModes.SINGLE_PAGE) {
4171
- each(allPages, function(index, page) {
4172
- if (pageNo(page) === pageNumber) {
4173
- result = page;
4174
- }
4175
- return !result;
4172
+ result = Array.from(allPages).find((page) => {
4173
+ return pageNo(page) === pageNumber;
4176
4174
  });
4177
4175
  } else {
4178
- $.each(allPages, function(index, page) {
4176
+ result = Array.from(allPages).find((page) => {
4179
4177
  var dataPageNumber = parseInt($(page).attr("data-page"));
4180
- if (dataPageNumber === pageNumber) {
4181
- result = page;
4182
- return false;
4183
- }
4178
+ return dataPageNumber === pageNumber;
4184
4179
  });
4185
4180
  }
4186
4181
  return result;
@@ -4392,14 +4387,9 @@ var telerikReportViewer = (function (exports) {
4392
4387
  }
4393
4388
  function getAction(actionId) {
4394
4389
  if (actions) {
4395
- var action;
4396
- each(actions, function() {
4397
- if (this.Id === actionId) {
4398
- action = this;
4399
- }
4400
- return action === void 0;
4390
+ return Array.from(actions).find(function(action) {
4391
+ return action.Id === actionId;
4401
4392
  });
4402
- return action;
4403
4393
  }
4404
4394
  return null;
4405
4395
  }
@@ -4534,14 +4524,6 @@ var telerikReportViewer = (function (exports) {
4534
4524
  $("#" + pageAreaImageID).remove();
4535
4525
  }
4536
4526
  }
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
4527
 
4546
4528
  var parameterEditorsMatch = {
4547
4529
  // AvailableValues PROVIDED, MultiValue is TRUE and trv.parameters.editors.multiSelect is unset
@@ -4769,8 +4751,8 @@ var telerikReportViewer = (function (exports) {
4769
4751
  }
4770
4752
  function applyAriaSelected(selection) {
4771
4753
  var children = $list.find(".trv-listviewitem");
4772
- each(children, function() {
4773
- var $item = $(this);
4754
+ Array.from(children).forEach((item) => {
4755
+ var $item = $(item);
4774
4756
  var isSelected = selection.filter($item).length > 0;
4775
4757
  $item.attr("aria-selected", isSelected);
4776
4758
  });
@@ -4853,9 +4835,9 @@ var telerikReportViewer = (function (exports) {
4853
4835
  items = [items];
4854
4836
  }
4855
4837
  var children = $list.find(".trv-listviewitem");
4856
- each(parameter.availableValues, function(i, av) {
4838
+ $.each(parameter.availableValues, (i, av) => {
4857
4839
  var selected = false;
4858
- each(items, function(j, v) {
4840
+ $.each(items, (j, v) => {
4859
4841
  var availableValue = av.value;
4860
4842
  if (v instanceof Date) {
4861
4843
  availableValue = parseToLocalDate(av.value);
@@ -4894,8 +4876,8 @@ var telerikReportViewer = (function (exports) {
4894
4876
  addAccessibilityAttributes($list, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
4895
4877
  $list.attr("aria-multiselectable", "true");
4896
4878
  var items = $list.find(".trv-listviewitem");
4897
- each(items, function() {
4898
- $(this).attr("aria-label", this.innerText);
4879
+ Array.from(items).forEach((item) => {
4880
+ $(item).attr("aria-label", item.innerText);
4899
4881
  });
4900
4882
  },
4901
4883
  setAccessibilityErrorState: function(param) {
@@ -5024,8 +5006,8 @@ var telerikReportViewer = (function (exports) {
5024
5006
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5025
5007
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
5026
5008
  var items = editor.items();
5027
- each(items, function() {
5028
- $(this).attr("aria-label", this.innerText);
5009
+ Array.from(items).forEach((item) => {
5010
+ $(item).attr("aria-label", item.innerText);
5029
5011
  });
5030
5012
  },
5031
5013
  setAccessibilityErrorState: function(param) {
@@ -5087,7 +5069,7 @@ var telerikReportViewer = (function (exports) {
5087
5069
  }
5088
5070
  function setSelectedItems(value) {
5089
5071
  var items = $list.find(".trv-listviewitem");
5090
- each(parameter.availableValues, function(i, av) {
5072
+ $.each(parameter.availableValues, (i, av) => {
5091
5073
  var availableValue = av.value;
5092
5074
  if (value instanceof Date) {
5093
5075
  availableValue = parseToLocalDate(av.value);
@@ -5131,8 +5113,8 @@ var telerikReportViewer = (function (exports) {
5131
5113
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5132
5114
  addAccessibilityAttributes($list, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5133
5115
  var items = $list.find(".trv-listviewitem");
5134
- each(items, function() {
5135
- $(this).attr("aria-label", this.innerText);
5116
+ Array.from(items).forEach((item) => {
5117
+ $(item).attr("aria-label", item.innerText);
5136
5118
  });
5137
5119
  },
5138
5120
  setAccessibilityErrorState: function(param) {
@@ -5222,8 +5204,8 @@ var telerikReportViewer = (function (exports) {
5222
5204
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5223
5205
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5224
5206
  var items = editor.items();
5225
- each(items, function() {
5226
- $(this).attr("aria-label", this.innerText);
5207
+ Array.from(items).forEach((item) => {
5208
+ $(item).attr("aria-label", item.innerText);
5227
5209
  });
5228
5210
  },
5229
5211
  setAccessibilityErrorState: function(param) {
@@ -5587,39 +5569,58 @@ var telerikReportViewer = (function (exports) {
5587
5569
  };
5588
5570
  }
5589
5571
 
5572
+ var __defProp$5 = Object.defineProperty;
5573
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5574
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5575
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5576
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5577
+ var __spreadValues = (a, b) => {
5578
+ for (var prop in b || (b = {}))
5579
+ if (__hasOwnProp.call(b, prop))
5580
+ __defNormalProp$5(a, prop, b[prop]);
5581
+ if (__getOwnPropSymbols)
5582
+ for (var prop of __getOwnPropSymbols(b)) {
5583
+ if (__propIsEnum.call(b, prop))
5584
+ __defNormalProp$5(a, prop, b[prop]);
5585
+ }
5586
+ return a;
5587
+ };
5590
5588
  var JSON_CONTENT_TYPE = "application/json; charset=UTF-8";
5591
5589
  var URLENCODED_CONTENT_TYPE = "application/x-www-form-urlencoded; charset=UTF-8";
5592
5590
  var HTTP_GET = "GET";
5593
5591
  var HTTP_POST = "POST";
5594
5592
  var HTTP_DELETE = "DELETE";
5595
5593
  var defaultOptions$4 = {};
5594
+ function getHeaders(authorizationToken) {
5595
+ const headers = {
5596
+ "Accept": "application/json, text/javascript, */*; q=0.01"
5597
+ };
5598
+ if (authorizationToken) {
5599
+ headers["Authorization"] = "Bearer " + authorizationToken;
5600
+ }
5601
+ return headers;
5602
+ }
5596
5603
  function ServiceClient(options) {
5597
- options = extend({}, defaultOptions$4, options);
5604
+ options = $.extend({}, defaultOptions$4, options);
5598
5605
  var baseUrl = rTrim(options.serviceUrl || options.baseUrl, "\\/");
5599
5606
  var loginPromise;
5600
5607
  var _ajax = $ajax;
5601
5608
  function validateClientID(clientID) {
5602
- if (!clientID)
5609
+ if (!clientID) {
5603
5610
  throw "Invalid clientID";
5611
+ }
5604
5612
  }
5605
5613
  function urlFromTemplate(template, args) {
5606
- args = extend({}, { baseUrl }, args);
5614
+ args = $.extend({}, { baseUrl }, args);
5607
5615
  return stringFormat(template, args);
5608
5616
  }
5609
- function getHeaderSettings(authorizationToken) {
5610
- return authorizationToken ? {
5611
- headers: {
5612
- Authorization: "Bearer " + authorizationToken
5613
- }
5614
- } : {};
5615
- }
5616
5617
  function login() {
5617
5618
  if (!loginPromise) {
5618
5619
  var loginInfo = options.loginInfo;
5619
5620
  if (loginInfo && loginInfo.url && (loginInfo.username || loginInfo.password)) {
5620
- loginPromise = _ajax({
5621
- url: loginInfo.url,
5622
- type: HTTP_POST,
5621
+ const endPoint = loginInfo.url;
5622
+ loginPromise = _ajax(endPoint, {
5623
+ method: HTTP_POST,
5623
5624
  data: {
5624
5625
  grant_type: "password",
5625
5626
  username: loginInfo.username,
@@ -5639,22 +5640,18 @@ var telerikReportViewer = (function (exports) {
5639
5640
  return {
5640
5641
  _urlFromTemplate: urlFromTemplate,
5641
5642
  registerClient: function(settings) {
5643
+ const endPoint = `${baseUrl}/clients`;
5642
5644
  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);
5645
+ return _ajax(endPoint, __spreadValues({
5646
+ headers: getHeaders(authorizationToken),
5647
+ method: HTTP_POST,
5648
+ dataType: "json",
5649
+ // Used to avoid Chrome caching functionality for simple async requests
5650
+ // when the first request is not completed the second request is not send
5651
+ // and the same response is used for both of the request. In this case the
5652
+ // second client is not registered to the service and the same clientId is used.
5653
+ data: JSON.stringify({ timeStamp: Date.now() })
5654
+ }, settings));
5658
5655
  }).then(function(clientData) {
5659
5656
  if (clientData.Message) {
5660
5657
  throw clientData.Message;
@@ -5664,290 +5661,189 @@ var telerikReportViewer = (function (exports) {
5664
5661
  },
5665
5662
  unregisterClient: function(clientID, settings) {
5666
5663
  validateClientID(clientID);
5664
+ const endPoint = `${baseUrl}/clients/${clientID}`;
5667
5665
  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);
5666
+ return _ajax(endPoint, __spreadValues({
5667
+ headers: getHeaders(authorizationToken),
5668
+ method: HTTP_DELETE
5669
+ }, settings));
5677
5670
  });
5678
5671
  },
5679
5672
  getParameters: function(clientID, report, parameterValues, settings) {
5680
5673
  validateClientID(clientID);
5674
+ const endPoint = `${baseUrl}/clients/${clientID}/parameters`;
5681
5675
  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);
5676
+ return _ajax(endPoint, __spreadValues({
5677
+ headers: getHeaders(authorizationToken),
5678
+ method: HTTP_POST,
5679
+ contentType: JSON_CONTENT_TYPE,
5680
+ dataType: "json",
5681
+ data: JSON.stringify({ report, parameterValues })
5682
+ }, settings));
5694
5683
  });
5695
5684
  },
5696
5685
  createReportInstance: function(clientID, report, parameterValues, settings) {
5697
5686
  validateClientID(clientID);
5687
+ const endPoint = `${baseUrl}/clients/${clientID}/instances`;
5698
5688
  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);
5689
+ return _ajax(endPoint, __spreadValues({
5690
+ headers: getHeaders(authorizationToken),
5691
+ method: HTTP_POST,
5692
+ contentType: JSON_CONTENT_TYPE,
5693
+ dataType: "json",
5694
+ data: JSON.stringify({ report, parameterValues })
5695
+ }, settings));
5711
5696
  }).then(function(instanceData) {
5712
5697
  return instanceData.instanceId;
5713
5698
  });
5714
5699
  },
5715
5700
  deleteReportInstance: function(clientID, instanceID, settings) {
5716
5701
  validateClientID(clientID);
5702
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}`;
5717
5703
  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);
5704
+ return _ajax(endPoint, __spreadValues({
5705
+ headers: getHeaders(authorizationToken),
5706
+ method: HTTP_DELETE
5707
+ }, settings));
5727
5708
  });
5728
5709
  },
5710
+ // eslint-disable-next-line max-params
5729
5711
  createReportDocument: function(clientID, instanceID, format, deviceInfo, useCache, baseDocumentID, actionID, settings) {
5730
5712
  validateClientID(clientID);
5713
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents`;
5731
5714
  return login().then(function(authorizationToken) {
5732
5715
  deviceInfo = deviceInfo || {};
5733
5716
  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);
5717
+ return _ajax(endPoint, __spreadValues({
5718
+ headers: getHeaders(authorizationToken),
5719
+ method: HTTP_POST,
5720
+ contentType: JSON_CONTENT_TYPE,
5721
+ dataType: "json",
5722
+ data: JSON.stringify({
5723
+ format,
5724
+ deviceInfo,
5725
+ useCache,
5726
+ baseDocumentID,
5727
+ actionID
5728
+ })
5729
+ }, settings));
5754
5730
  }).then(function(documentData) {
5755
5731
  return documentData.documentId;
5756
5732
  });
5757
5733
  },
5734
+ // eslint-disable-next-line max-params
5758
5735
  sendDocument: function(clientID, instanceID, documentID, mailArgs, settings) {
5759
5736
  validateClientID(clientID);
5737
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/send`;
5760
5738
  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);
5739
+ return _ajax(endPoint, __spreadValues({
5740
+ headers: getHeaders(authorizationToken),
5741
+ method: HTTP_POST,
5742
+ contentType: JSON_CONTENT_TYPE,
5743
+ data: JSON.stringify({
5744
+ from: mailArgs.from,
5745
+ to: mailArgs.to,
5746
+ cc: mailArgs.cc,
5747
+ subject: mailArgs.subject,
5748
+ body: mailArgs.body
5749
+ })
5750
+ }, settings));
5783
5751
  });
5784
5752
  },
5785
5753
  deleteReportDocument: function(clientID, instanceID, documentID, settings) {
5786
5754
  validateClientID(clientID);
5755
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5787
5756
  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);
5757
+ return _ajax(endPoint, __spreadValues({
5758
+ headers: getHeaders(authorizationToken),
5759
+ method: HTTP_DELETE
5760
+ }, settings));
5800
5761
  });
5801
5762
  },
5802
5763
  getDocumentInfo: function(clientID, instanceID, documentID, settings) {
5803
5764
  validateClientID(clientID);
5765
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/info`;
5804
5766
  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);
5767
+ return _ajax(endPoint, __spreadValues({
5768
+ headers: getHeaders(authorizationToken),
5769
+ method: HTTP_GET,
5770
+ dataType: "json"
5771
+ }, settings));
5822
5772
  });
5823
5773
  },
5774
+ // eslint-disable-next-line max-params
5824
5775
  getPage: function(clientID, instanceID, documentID, pageNumber, settings) {
5825
5776
  validateClientID(clientID);
5777
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/pages/${pageNumber}`;
5826
5778
  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);
5779
+ return _ajax(endPoint, __spreadValues({
5780
+ headers: getHeaders(authorizationToken),
5781
+ method: HTTP_GET,
5782
+ dataType: "json"
5783
+ }, settings));
5845
5784
  });
5846
5785
  },
5847
5786
  get: function(url) {
5848
- var ajaxSettings = {
5849
- type: HTTP_GET,
5850
- url
5851
- };
5852
- return _ajax(ajaxSettings);
5787
+ return _ajax(url, {
5788
+ method: HTTP_GET
5789
+ });
5853
5790
  },
5854
5791
  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
- );
5792
+ var url = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5863
5793
  if (queryString) {
5864
5794
  url += "?" + queryString;
5865
5795
  }
5866
5796
  return url;
5867
5797
  },
5868
5798
  getDocumentFormats: function(settings) {
5799
+ const endPoint = `${baseUrl}/formats`;
5869
5800
  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);
5801
+ return _ajax(endPoint, __spreadValues({
5802
+ headers: getHeaders(authorizationToken),
5803
+ method: HTTP_GET,
5804
+ dataType: "json"
5805
+ }, settings));
5881
5806
  });
5882
5807
  },
5883
5808
  getServiceVersion: function(settings) {
5809
+ const endPoint = `${baseUrl}/version`;
5884
5810
  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);
5811
+ return _ajax(endPoint, __spreadValues({
5812
+ headers: getHeaders(authorizationToken),
5813
+ method: HTTP_GET,
5814
+ dataType: "json"
5815
+ }, settings));
5896
5816
  });
5897
5817
  },
5818
+ // eslint-disable-next-line max-params
5898
5819
  getResource: function(clientID, instanceID, documentID, resourceID, settings) {
5899
5820
  validateClientID(clientID);
5821
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/resources/${resourceID}`;
5900
5822
  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);
5823
+ return _ajax(endPoint, __spreadValues({
5824
+ headers: getHeaders(authorizationToken),
5825
+ method: HTTP_GET,
5826
+ dataType: (settings == null ? void 0 : settings.dataType) || "json"
5827
+ }, settings));
5919
5828
  });
5920
5829
  },
5830
+ // eslint-disable-next-line max-params
5921
5831
  getSearchResults: function(clientID, instanceID, documentID, searchToken, matchCase, matchWholeWord, useRegex, settings) {
5922
5832
  validateClientID(clientID);
5923
- var searchUrl = urlFromTemplate(
5924
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/search",
5925
- {
5926
- clientID,
5927
- instanceID,
5928
- documentID
5929
- }
5930
- );
5833
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/search`;
5931
5834
  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);
5835
+ return _ajax(endPoint, __spreadValues({
5836
+ headers: getHeaders(authorizationToken),
5837
+ method: HTTP_POST,
5838
+ contentType: JSON_CONTENT_TYPE,
5839
+ dataType: "json",
5840
+ data: JSON.stringify({
5841
+ searchToken,
5842
+ matchCase,
5843
+ matchWholeWord,
5844
+ useRegularExpressions: useRegex
5845
+ })
5846
+ }, settings));
5951
5847
  });
5952
5848
  },
5953
5849
  setAccessToken: function(accessToken) {
@@ -5955,29 +5851,21 @@ var telerikReportViewer = (function (exports) {
5955
5851
  },
5956
5852
  login,
5957
5853
  keepClientAlive: function(clientID, settings) {
5854
+ const endPoint = `${baseUrl}/clients/keepAlive/${clientID}`;
5958
5855
  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);
5856
+ return _ajax(endPoint, __spreadValues({
5857
+ headers: getHeaders(authorizationToken),
5858
+ method: HTTP_POST
5859
+ }, settings));
5968
5860
  });
5969
5861
  },
5970
5862
  getClientsSessionTimeoutSeconds: function(settings) {
5863
+ const endPoint = `${baseUrl}/clients/sessionTimeout`;
5971
5864
  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);
5865
+ return _ajax(endPoint, __spreadValues({
5866
+ headers: getHeaders(authorizationToken),
5867
+ method: HTTP_GET
5868
+ }, settings));
5981
5869
  }).then(function(sessionTimeoutData) {
5982
5870
  return sessionTimeoutData.clientSessionTimeout;
5983
5871
  });
@@ -6158,8 +6046,8 @@ var telerikReportViewer = (function (exports) {
6158
6046
  }
6159
6047
  function setNodeAccessibilityAttributes(node) {
6160
6048
  var $items = $(node).find("li");
6161
- each($items, function() {
6162
- var $li = $(this);
6049
+ Array.from($items).forEach((item) => {
6050
+ var $li = $(item);
6163
6051
  $li.attr("aria-label", $li[0].innerText);
6164
6052
  });
6165
6053
  }
@@ -6191,8 +6079,8 @@ var telerikReportViewer = (function (exports) {
6191
6079
  treeView.bind("expand", onTreeViewNodeExpand);
6192
6080
  treeView.element.attr("aria-label", stringResources.ariaLabelDocumentMap);
6193
6081
  var listItems = treeView.element.find("ul");
6194
- each(listItems, function() {
6195
- setNodeAccessibilityAttributes(this);
6082
+ Array.from(listItems).forEach((list) => {
6083
+ setNodeAccessibilityAttributes(list);
6196
6084
  });
6197
6085
  if (documentMapNecessary) {
6198
6086
  setSplitbarAccessibilityAttributes();
@@ -6269,14 +6157,6 @@ var telerikReportViewer = (function (exports) {
6269
6157
  $documentMapOverlay.attr("aria-label", stringResources[$documentMapOverlay.attr("aria-label")]);
6270
6158
  }
6271
6159
  }
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
6160
 
6281
6161
  var defaultOptions$2 = {};
6282
6162
  var Events = {
@@ -6429,12 +6309,8 @@ var telerikReportViewer = (function (exports) {
6429
6309
  }
6430
6310
  }
6431
6311
  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;
6312
+ var factory = Array.from(parameterEditors).find((editor) => {
6313
+ return editor.match(parameter, editorsType);
6438
6314
  });
6439
6315
  return factory;
6440
6316
  }
@@ -6446,23 +6322,21 @@ var telerikReportViewer = (function (exports) {
6446
6322
  (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
6447
6323
  }
6448
6324
  function allParametersAutoRefresh() {
6449
- var allAuto = true;
6450
- each(parameters, function() {
6451
- return allAuto = !this.isVisible || this.autoRefresh;
6325
+ var allAuto = Array.from(parameters).every((parameter) => {
6326
+ return !parameter.isVisible || parameter.autoRefresh;
6452
6327
  });
6453
6328
  return allAuto;
6454
6329
  }
6455
6330
  function allParametersValid() {
6456
- var allValid = true;
6457
- each(parameters, function() {
6458
- return allValid = !this.Error;
6331
+ var allValid = Array.from(parameters).every((parameter) => {
6332
+ return !parameter.Error;
6459
6333
  });
6460
6334
  return allValid;
6461
6335
  }
6462
6336
  function clearEditors() {
6463
- each(editors, function() {
6464
- if (this.hasOwnProperty("destroy")) {
6465
- this.destroy();
6337
+ Object.entries(editors).forEach(([key, editor]) => {
6338
+ if (typeof editor.destroy === "function") {
6339
+ editor.destroy();
6466
6340
  }
6467
6341
  });
6468
6342
  editors = {};
@@ -6474,26 +6348,26 @@ var telerikReportViewer = (function (exports) {
6474
6348
  clearEditors();
6475
6349
  var $parameterContainer;
6476
6350
  var $tempContainer = $("<div></div>");
6477
- each(parameters, function() {
6351
+ Array.from(parameters).forEach((parameter) => {
6478
6352
  try {
6479
- this.value = ParameterValidators.validate(this, this.value);
6353
+ parameter.value = ParameterValidators.validate(parameter, parameter.value);
6480
6354
  } catch (e) {
6481
- this.Error = this.Error || e;
6355
+ parameter.Error = parameter.Error || e;
6482
6356
  }
6483
- var hasError = Boolean(this.Error);
6357
+ var hasError = Boolean(parameter.Error);
6484
6358
  var hasValue = !hasError;
6485
6359
  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 };
6360
+ recentParameterValues[parameter.id] = parameter.value;
6361
+ if (parameter.availableValues) {
6362
+ processedParameterValues[parameter.id] = { valueMember: parameter.value, displayMember: parameter.label, availableValues: parameter.availableValues, multivalue: parameter.multivalue };
6489
6363
  } else {
6490
- processedParameterValues[this.id] = this.value;
6364
+ processedParameterValues[parameter.id] = parameter.value;
6491
6365
  }
6492
6366
  } else {
6493
- this.Error = stringResources.invalidParameter;
6367
+ parameter.Error = stringResources.invalidParameter;
6494
6368
  }
6495
- if (this.isVisible || options.showHiddenParameters) {
6496
- $parameterContainer = createParameterUI(this);
6369
+ if (parameter.isVisible || options.showHiddenParameters) {
6370
+ $parameterContainer = createParameterUI(parameter);
6497
6371
  if ($parameterContainer) {
6498
6372
  $tempContainer.append($parameterContainer);
6499
6373
  }
@@ -6502,17 +6376,17 @@ var telerikReportViewer = (function (exports) {
6502
6376
  if (initialParameterValues !== void 0) {
6503
6377
  if (null === initialParameterValues) {
6504
6378
  initialParameterValues = {};
6505
- each(parameters, function() {
6506
- if (this.isVisible) {
6507
- initialParameterValues[this.id] = this.value;
6379
+ Array.from(parameters).forEach((parameter) => {
6380
+ if (parameter.isVisible) {
6381
+ initialParameterValues[parameter.id] = parameter.value;
6508
6382
  } else {
6509
- delete recentParameterValues[this.id];
6383
+ delete recentParameterValues[parameter.id];
6510
6384
  }
6511
6385
  });
6512
6386
  } else {
6513
- each(parameters, function() {
6514
- if (!(this.id in initialParameterValues)) {
6515
- delete recentParameterValues[this.id];
6387
+ Array.from(parameters).forEach((parameter) => {
6388
+ if (!(parameter.id in initialParameterValues)) {
6389
+ delete recentParameterValues[parameter.id];
6516
6390
  }
6517
6391
  });
6518
6392
  }
@@ -6555,7 +6429,7 @@ var telerikReportViewer = (function (exports) {
6555
6429
  }
6556
6430
  function invalidateChildParameters(parameter) {
6557
6431
  if (parameter.childParameters) {
6558
- each(parameter.childParameters, function(index, parameterId) {
6432
+ Array.from(parameter.childParameters).forEach((parameterId) => {
6559
6433
  var childParameter = getParameterById(parameterId);
6560
6434
  if (childParameter) {
6561
6435
  invalidateChildParameters(childParameter);
@@ -6614,12 +6488,10 @@ var telerikReportViewer = (function (exports) {
6614
6488
  if (!params || null === params) {
6615
6489
  return false;
6616
6490
  }
6617
- var result = false;
6618
- each(params, function() {
6619
- result = this.isVisible;
6620
- return !result;
6491
+ var hasVisible = Array.from(params).some((parameter) => {
6492
+ return parameter.isVisible;
6621
6493
  });
6622
- return result;
6494
+ return hasVisible;
6623
6495
  }
6624
6496
  var loadingCount = 0;
6625
6497
  function beginLoad() {
@@ -6759,14 +6631,6 @@ var telerikReportViewer = (function (exports) {
6759
6631
  );
6760
6632
  return parametersArea;
6761
6633
  }
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
6634
 
6771
6635
  var lastSelectedMenuItem;
6772
6636
  var lastSelectedSubmenuItem;
@@ -6811,9 +6675,9 @@ var telerikReportViewer = (function (exports) {
6811
6675
  replaceStringResources();
6812
6676
  }
6813
6677
  function setTabIndexes() {
6814
- var $menus = $.find('[data-role="telerik_ReportViewer_MainMenu"]');
6815
- each($menus, function() {
6816
- var $menuArea = $(this);
6678
+ var $menus = $('[data-role="telerik_ReportViewer_MainMenu"]');
6679
+ Array.from($menus).forEach((menu2) => {
6680
+ var $menuArea = $(menu2);
6817
6681
  var listItems = $menuArea.find("li");
6818
6682
  var menuTabIndex = 0;
6819
6683
  var tabIndexAttr = $menuArea.attr("tabIndex");
@@ -6831,13 +6695,13 @@ var telerikReportViewer = (function (exports) {
6831
6695
  });
6832
6696
  }
6833
6697
  function setMenuItemsTabIndexes(listItems, menuTabIndex) {
6834
- each(listItems, function() {
6835
- var $item = $(this);
6698
+ Array.from(listItems).forEach((item) => {
6699
+ var $item = $(item);
6836
6700
  $item.attr("tabindex", menuTabIndex);
6837
- $item.focus(function() {
6701
+ $item.on("focus", (event) => {
6838
6702
  $item.addClass("k-focus");
6839
6703
  });
6840
- $item.blur(function() {
6704
+ $item.on("blur", (event) => {
6841
6705
  $item.removeClass("k-focus");
6842
6706
  });
6843
6707
  var anchor = $item.children("a");
@@ -6856,16 +6720,15 @@ var telerikReportViewer = (function (exports) {
6856
6720
  });
6857
6721
  }
6858
6722
  function fillFormats(formats) {
6859
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
6860
- var $list = $(this);
6723
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
6724
+ var $list = $(list);
6861
6725
  var $parent = $list.parents("li");
6862
6726
  var tabIndex = enableAccessibility ? $parent.attr("tabindex") : -1;
6863
6727
  if (!tabIndex) {
6864
6728
  tabIndex = 1;
6865
6729
  }
6866
6730
  $list.empty();
6867
- each(formats, function() {
6868
- var format = this;
6731
+ Array.from(formats).forEach((format) => {
6869
6732
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
6870
6733
  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
6734
  menu.append(li, $parent);
@@ -6876,10 +6739,10 @@ var telerikReportViewer = (function (exports) {
6876
6739
  });
6877
6740
  }
6878
6741
  function setInternalListAccessibilityKeyEvents(listItems) {
6879
- each(listItems, function() {
6880
- var $item = $(this);
6742
+ Array.from(listItems).forEach((item) => {
6743
+ var $item = $(item);
6881
6744
  $item.off("keydown");
6882
- $item.on("keydown", function(event) {
6745
+ $item.on("keydown", (event) => {
6883
6746
  switch (event.which) {
6884
6747
  case kendo.keys.ENTER:
6885
6748
  clickOnMenuItem($item);
@@ -6887,17 +6750,17 @@ var telerikReportViewer = (function (exports) {
6887
6750
  case kendo.keys.UP:
6888
6751
  var $prev = $item.prev();
6889
6752
  if ($prev.length > 0) {
6890
- $prev.focus();
6753
+ $prev.trigger("focus");
6891
6754
  } else {
6892
- $item.parents("li").focus();
6755
+ $item.parents("li").trigger("focus");
6893
6756
  }
6894
6757
  break;
6895
6758
  case kendo.keys.DOWN:
6896
6759
  var $next = $item.next();
6897
6760
  if ($next.length > 0) {
6898
- $next.focus();
6761
+ $next.trigger("focus");
6899
6762
  } else {
6900
- $item.parent().children("li").first().focus();
6763
+ $item.parent().children("li").first().trigger("focus");
6901
6764
  }
6902
6765
  break;
6903
6766
  }
@@ -7061,12 +6924,12 @@ var telerikReportViewer = (function (exports) {
7061
6924
  if (!menuAreas) {
7062
6925
  return;
7063
6926
  }
7064
- each(menuAreas, function() {
7065
- var $menu = $(this);
6927
+ Array.from(menuAreas).forEach((menu2) => {
6928
+ var $menu = $(menu2);
7066
6929
  var menuItems = $menu.children("li.k-item");
7067
6930
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
7068
- each(menuItems, function() {
7069
- var $menuItem = $(this);
6931
+ Array.from(menuItems).forEach((menuItem) => {
6932
+ var $menuItem = $(menuItem);
7070
6933
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
7071
6934
  if (!$menuItem.hasClass("trv-report-pager")) {
7072
6935
  var $a = $menuItem.find("a");
@@ -7080,158 +6943,196 @@ var telerikReportViewer = (function (exports) {
7080
6943
  });
7081
6944
  }
7082
6945
  function findMenuArea() {
7083
- return findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
6946
+ return $("ul[data-role=telerik_ReportViewer_MainMenu]");
7084
6947
  }
7085
6948
  }
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
6949
 
7095
6950
  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.";
6951
+ function replaceStringResources$1($search) {
6952
+ if (!$search) {
6953
+ return;
7135
6954
  }
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) {
6955
+ var $searchCaption = $search.find(".trv-search-dialog-caption-label");
6956
+ var $searchOptions = $search.find(".trv-search-dialog-search-options");
6957
+ var $searchStopButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_StopSearch']");
6958
+ var $searchMatchCaseButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchCase']");
6959
+ var $searchMatchWholeWordButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchWholeWord']");
6960
+ var $searchUseRegexButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_UseRegex']");
6961
+ var $searchNavigateUpButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateUp']");
6962
+ var $searchNavigateDownButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateDown']");
6963
+ replaceAttribute$1($search, "aria-label");
6964
+ replaceAttribute$1($searchOptions, "aria-label");
6965
+ replaceText$1($searchCaption);
6966
+ replaceTitleAndAriaLabel($searchStopButton);
6967
+ replaceTitleAndAriaLabel($searchMatchCaseButton);
6968
+ replaceTitleAndAriaLabel($searchMatchWholeWordButton);
6969
+ replaceTitleAndAriaLabel($searchUseRegexButton);
6970
+ replaceTitleAndAriaLabel($searchNavigateUpButton);
6971
+ replaceTitleAndAriaLabel($searchNavigateDownButton);
6972
+ }
6973
+ function replaceTitleAndAriaLabel($a) {
6974
+ replaceAttribute$1($a, "title");
6975
+ replaceAttribute$1($a, "aria-label");
6976
+ }
6977
+ function replaceText$1($el) {
6978
+ if ($el) {
6979
+ $el.text(stringResources[$el.text()]);
6980
+ }
6981
+ }
6982
+ function replaceAttribute$1($el, attribute) {
6983
+ if ($el) {
6984
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
6985
+ }
6986
+ }
6987
+ class Search {
6988
+ constructor(element, options, viewerOptions) {
6989
+ this.options = $.extend({}, defaultOptions$1, options);
6990
+ this.viewerOptions = viewerOptions;
6991
+ this.element = element;
6992
+ this.controller = this.options.controller;
6993
+ this.initialized = false;
6994
+ this.dialogVisible = false;
6995
+ this.$element;
6996
+ this.$inputBox;
6997
+ this.$searchOptionsPlaceholder;
6998
+ this.searchOptionsMenu;
6999
+ this.$stopSearchPlaceholder;
7000
+ this.stopSearchMenu;
7001
+ this.$navigationPlaceholder;
7002
+ this.navigationMenu;
7003
+ this.$resultsLabel;
7004
+ this.$resultsPlaceholder;
7005
+ this.kendoComboBox;
7006
+ this.kendoSearchDialog;
7007
+ this.stopSearchCommand;
7008
+ this.optionsCommandSet;
7009
+ this.navigationCommandSet;
7010
+ this.searchResults;
7011
+ this.mruList = [];
7012
+ this.inputComboRebinding;
7013
+ this.searchMetadataRequested;
7014
+ this.searchMetadataLoaded;
7015
+ this.pendingHighlightItem;
7016
+ this.windowLocation;
7017
+ this.reportViewerWrapper = $("[data-selector='" + this.viewerOptions.viewerSelector + "']").find(".trv-report-viewer");
7018
+ this.lastSearch = "";
7019
+ this.highlightManager = {
7020
+ // the results that are found, but not selected (highlighted)
7021
+ shadedClassName: "trv-search-dialog-shaded-result",
7022
+ // the result that is currently selected (highlighted)
7023
+ highlightedClassName: "trv-search-dialog-highlighted-result",
7024
+ current: null,
7025
+ elements: []
7026
+ };
7027
+ if (!this.controller) {
7028
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
7029
+ }
7030
+ this.controller.pageReady(this.onPageReady.bind(this)).scrollPageReady(this.onPageReady.bind(this)).beginLoadReport(this.closeAndClear.bind(this)).viewModeChanged(this.closeAndClear.bind(this));
7031
+ this.controller.setSendEmailDialogVisible((event, args) => {
7032
+ if (args.visible && this.dialogVisible) {
7033
+ this.toggle(!this.dialogVisible);
7034
+ }
7035
+ }).getSearchDialogState((event, args) => {
7036
+ args.visible = this.dialogVisible;
7037
+ }).setSearchDialogVisible((event, args) => {
7038
+ this.toggleSearchDialog(args.visible);
7039
+ });
7040
+ $(window).on("resize", () => {
7041
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7042
+ this.storeDialogPosition();
7043
+ this.adjustDialogPosition();
7044
+ }
7045
+ });
7046
+ }
7047
+ closeAndClear() {
7048
+ if (this.searchMetadataRequested) {
7148
7049
  return;
7149
7050
  }
7150
- toggle(false);
7151
- searchMetadataLoaded = false;
7051
+ this.toggle(false);
7052
+ this.searchMetadataLoaded = false;
7152
7053
  }
7153
- function toggleSearchDialog(show) {
7154
- dialogVisible = show;
7054
+ toggleSearchDialog(show) {
7055
+ this.dialogVisible = show;
7155
7056
  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;
7057
+ var searchMetadataOnDemand = this.viewerOptions.searchMetadataOnDemand;
7058
+ if (searchMetadataOnDemand && !this.searchMetadataLoaded) {
7059
+ this.searchMetadataRequested = true;
7060
+ this.controller.reportLoadComplete((event, args) => {
7061
+ if (this.searchMetadataRequested) {
7062
+ this.toggle(true);
7063
+ this.searchMetadataRequested = false;
7163
7064
  }
7164
7065
  });
7165
- controller.refreshReport(true);
7066
+ this.controller.refreshReport(true);
7166
7067
  return;
7167
7068
  }
7168
7069
  }
7169
- toggle(show);
7070
+ this.toggle(show);
7170
7071
  }
7171
- function toggle(show) {
7172
- dialogVisible = show;
7072
+ toggle(show) {
7073
+ this.dialogVisible = show;
7173
7074
  if (show) {
7174
- searchMetadataLoaded = true;
7175
- ensureInitialized();
7176
- kendoSearchDialog.open();
7177
- kendoComboBox.value("");
7178
- updateResultsUI(null);
7179
- toggleErrorLabel(false, null);
7075
+ this.searchMetadataLoaded = true;
7076
+ this.ensureInitialized();
7077
+ this.kendoSearchDialog.open();
7078
+ this.kendoComboBox.value("");
7079
+ this.updateResultsUI(null);
7080
+ this.toggleErrorLabel(false, null);
7180
7081
  } else {
7181
- clearColoredItems();
7182
- if (kendoSearchDialog && kendoSearchDialog.options.visible) {
7183
- kendoSearchDialog.close();
7082
+ this.clearColoredItems();
7083
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7084
+ this.kendoSearchDialog.close();
7184
7085
  }
7185
7086
  }
7186
7087
  }
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);
7088
+ ensureInitialized() {
7089
+ if (!this.initialized) {
7090
+ this.$element = $(this.element);
7091
+ this.$inputBox = this.$element.find(".trv-search-dialog-input-box");
7092
+ this.$resultsLabel = this.$element.find(".trv-search-dialog-results-label");
7093
+ this.$resultsPlaceholder = this.$element.find(".trv-search-dialog-results-area");
7094
+ this.initResultsArea();
7095
+ replaceStringResources$1(this.$element);
7195
7096
  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");
7097
+ this.$searchOptionsPlaceholder = this.$element.find(".trv-search-dialog-search-options").kendoMenu();
7098
+ this.$stopSearchPlaceholder = this.$element.find(".trv-search-dialog-stopsearch-placeholder").kendoMenu();
7099
+ this.$navigationPlaceholder = this.$element.find(".trv-search-dialog-navigational-buttons").kendoMenu();
7100
+ } catch (error) {
7101
+ console.error("Instantiation of Kendo Menu for Search Dialog threw an exception", error);
7102
+ throw error;
7103
+ }
7104
+ this.searchOptionsMenu = this.$searchOptionsPlaceholder.data("kendoMenu");
7105
+ this.stopSearchMenu = this.$stopSearchPlaceholder.data("kendoMenu");
7106
+ this.navigationMenu = this.$navigationPlaceholder.data("kendoMenu");
7107
+ this.searchOptionsMenu.element.on("keydown", this.onKeyDown);
7108
+ this.stopSearchMenu.element.on("keydown", this.onKeyDown);
7109
+ this.navigationMenu.element.on("keydown", this.onKeyDown);
7110
+ this.overrideDefaultMenuStyling(".trv-search-dialog-search-options");
7210
7111
  try {
7211
- kendoComboBox = $inputBox.kendoComboBox({
7112
+ this.kendoComboBox = this.$inputBox.kendoComboBox({
7212
7113
  dataTextField: "value",
7213
7114
  dataValueField: "value",
7214
- dataSource: mruList,
7115
+ dataSource: this.mruList,
7215
7116
  contentElement: "",
7216
- change: kendoComboBoxSelect,
7117
+ change: this.kendoComboBoxSelect.bind(this),
7217
7118
  ignoreCase: false,
7218
- filtering: onInputFiltering,
7219
- //the actual search-when-typing performs on this event.
7119
+ // the actual search-when-typing performs on this event.
7120
+ filtering: this.onInputFiltering.bind(this),
7220
7121
  filter: "startswith",
7221
7122
  delay: 1e3,
7222
- open: function(e) {
7223
- if (inputComboRebinding) {
7224
- e.preventDefault();
7123
+ open: (event) => {
7124
+ if (this.inputComboRebinding) {
7125
+ event.preventDefault();
7225
7126
  }
7226
7127
  },
7227
- select: processComboBoxEvent
7128
+ select: this.processComboBoxEvent.bind(this)
7228
7129
  }).data("kendoComboBox");
7229
- } catch (e) {
7230
- console.error("Instantiation of Kendo ComboBox as search input threw an exception", e);
7231
- throw e;
7130
+ } catch (error) {
7131
+ console.error("Instantiation of Kendo ComboBox as search input threw an exception", error);
7132
+ throw error;
7232
7133
  }
7233
7134
  try {
7234
- kendoSearchDialog = reportViewerWrapper.find(".trv-search-window").kendoWindow({
7135
+ this.kendoSearchDialog = this.reportViewerWrapper.find(".trv-search-window").kendoWindow({
7235
7136
  title: stringResources.searchDialogTitle,
7236
7137
  height: 390,
7237
7138
  width: 310,
@@ -7239,38 +7140,38 @@ var telerikReportViewer = (function (exports) {
7239
7140
  minHeight: 390,
7240
7141
  maxHeight: 700,
7241
7142
  scrollable: false,
7242
- close: function() {
7243
- storeDialogPosition();
7244
- lastSearch = "";
7143
+ close: () => {
7144
+ this.storeDialogPosition();
7145
+ this.lastSearch = "";
7245
7146
  },
7246
- open: function() {
7247
- adjustDialogPosition();
7147
+ open: () => {
7148
+ this.adjustDialogPosition();
7248
7149
  },
7249
- deactivate: function() {
7250
- controller.setSearchDialogVisible({
7150
+ deactivate: () => {
7151
+ this.controller.setSearchDialogVisible({
7251
7152
  visible: false
7252
7153
  });
7253
7154
  },
7254
- activate: function() {
7255
- kendoComboBox.input.focus();
7155
+ activate: () => {
7156
+ this.kendoComboBox.input.focus();
7256
7157
  }
7257
7158
  }).data("kendoWindow");
7258
- } catch (e) {
7259
- console.error("Instantiation of Kendo Window for Search dialog threw an exception", e);
7260
- throw e;
7159
+ } catch (error) {
7160
+ console.error("Instantiation of Kendo Window for Search dialog threw an exception", error);
7161
+ throw error;
7261
7162
  }
7262
- kendoSearchDialog.wrapper.addClass("trv-search");
7263
- initCommands();
7264
- initialized = true;
7163
+ this.kendoSearchDialog.wrapper.addClass("trv-search");
7164
+ this.initCommands();
7165
+ this.initialized = true;
7265
7166
  }
7266
7167
  }
7267
- function overrideDefaultMenuStyling(kendoMenuSelector) {
7168
+ overrideDefaultMenuStyling(kendoMenuSelector) {
7268
7169
  var menuItems = $(kendoMenuSelector).find(".k-menu-item");
7269
7170
  for (var i = 0; i < menuItems.length; i++) {
7270
7171
  $(menuItems[i]).removeClass("k-item");
7271
7172
  }
7272
7173
  }
7273
- function onKeyDown(event) {
7174
+ onKeyDown(event) {
7274
7175
  var item = $(event.target).find(".k-focus");
7275
7176
  if (event.keyCode === 13 && item && item.length > 0) {
7276
7177
  var anchor = item.children("a");
@@ -7279,44 +7180,38 @@ var telerikReportViewer = (function (exports) {
7279
7180
  }
7280
7181
  }
7281
7182
  }
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();
7183
+ storeDialogPosition() {
7184
+ var kendoWindow = this.kendoSearchDialog.element.parent(".k-window");
7185
+ this.windowLocation = kendoWindow.offset();
7291
7186
  }
7292
- function adjustDialogPosition() {
7187
+ adjustDialogPosition() {
7293
7188
  var windowWidth = $(window).innerWidth();
7294
7189
  var windowHeight = $(window).innerHeight();
7295
- var kendoWindow = kendoSearchDialog.wrapper;
7190
+ var kendoWindow = this.kendoSearchDialog.wrapper;
7296
7191
  var width = kendoWindow.outerWidth(true);
7297
7192
  var height = kendoWindow.outerHeight(true);
7298
7193
  var padding = 10;
7299
- if (!windowLocation) {
7300
- var reportViewerCoords = reportViewerWrapper[0].getBoundingClientRect();
7194
+ if (!this.windowLocation) {
7195
+ var reportViewerCoords = this.reportViewerWrapper[0].getBoundingClientRect();
7301
7196
  kendoWindow.css({
7302
7197
  top: reportViewerCoords.top + padding,
7303
7198
  left: reportViewerCoords.right - width - padding
7304
7199
  });
7305
- kendoSearchDialog.setOptions({
7200
+ this.kendoSearchDialog.setOptions({
7306
7201
  position: {
7307
7202
  top: reportViewerCoords.top + padding,
7308
7203
  left: reportViewerCoords.right - width - padding
7309
7204
  }
7310
7205
  });
7311
7206
  } else {
7312
- var left = windowLocation.left;
7313
- var top = windowLocation.top;
7207
+ var left = this.windowLocation.left;
7208
+ var top = this.windowLocation.top;
7314
7209
  var right = left + width;
7315
7210
  var bottom = top + height;
7316
7211
  if (right > windowWidth - padding) {
7317
7212
  left = Math.max(padding, windowWidth - width - padding);
7318
7213
  kendoWindow.css({ left });
7319
- kendoSearchDialog.setOptions({
7214
+ this.kendoSearchDialog.setOptions({
7320
7215
  position: {
7321
7216
  left
7322
7217
  }
@@ -7325,7 +7220,7 @@ var telerikReportViewer = (function (exports) {
7325
7220
  if (bottom > windowHeight - padding) {
7326
7221
  top = Math.max(padding, windowHeight - height - padding);
7327
7222
  kendoWindow.css({ top });
7328
- kendoSearchDialog.setOptions({
7223
+ this.kendoSearchDialog.setOptions({
7329
7224
  position: {
7330
7225
  top
7331
7226
  }
@@ -7333,272 +7228,251 @@ var telerikReportViewer = (function (exports) {
7333
7228
  }
7334
7229
  }
7335
7230
  }
7336
- function processComboBoxEvent(e) {
7231
+ processComboBoxEvent(event) {
7337
7232
  if (!(window.event || window.event.type)) {
7338
7233
  return;
7339
7234
  }
7340
7235
  var evt = window.event;
7341
7236
  if (evt.type === "keydown") {
7342
- e.preventDefault();
7237
+ event.preventDefault();
7343
7238
  if (evt.keyCode === 40) {
7344
- moveListSelection(1);
7345
- } else if (evt.keyCode === 38) {
7346
- moveListSelection(-1);
7239
+ this.moveListSelection(1);
7240
+ }
7241
+ if (evt.keyCode === 38) {
7242
+ this.moveListSelection(-1);
7347
7243
  }
7348
7244
  }
7349
7245
  }
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
- })
7246
+ initCommands() {
7247
+ this.optionsCommandSet = {
7248
+ "searchDialog_MatchCase": new Command(),
7249
+ "searchDialog_MatchWholeWord": new Command(),
7250
+ "searchDialog_UseRegex": new Command()
7362
7251
  };
7363
- Binder.bind(
7364
- $searchOptionsPlaceholder,
7365
- {
7366
- controller,
7367
- commands: optionsCommandSet
7368
- },
7369
- viewerOptions
7370
- );
7371
- stopSearchCommand = new command(function() {
7372
- stopSearch();
7252
+ Object.entries(this.optionsCommandSet).forEach(([commandName, command]) => {
7253
+ command.exec = () => {
7254
+ this.toggleCommand(command);
7255
+ };
7373
7256
  });
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);
7257
+ Binder.attachCommands(this.$searchOptionsPlaceholder, this.optionsCommandSet, this.viewerOptions);
7258
+ this.stopSearchCommand = new Command(() => {
7259
+ this.stopSearch();
7260
+ });
7261
+ Binder.attachCommands(this.$stopSearchPlaceholder, { "searchDialog_StopSearch": this.stopSearchCommand }, this.viewerOptions);
7262
+ this.navigationCommandSet = {
7263
+ "searchDialog_NavigateUp": new Command(() => {
7264
+ this.moveListSelection(-1);
7385
7265
  }),
7386
- "searchDialog_NavigateDown": new command(function() {
7387
- moveListSelection(1);
7266
+ "searchDialog_NavigateDown": new Command(() => {
7267
+ this.moveListSelection(1);
7388
7268
  })
7389
7269
  };
7390
- Binder.bind(
7391
- $navigationPlaceholder,
7392
- {
7393
- controller,
7394
- commands: navigationCommandSet
7395
- },
7396
- viewerOptions
7397
- );
7270
+ Binder.attachCommands(this.$navigationPlaceholder, this.navigationCommandSet, this.viewerOptions);
7398
7271
  }
7399
- function initResultsArea() {
7272
+ initResultsArea() {
7400
7273
  try {
7401
- $resultsPlaceholder.kendoListView({
7274
+ this.$resultsPlaceholder.kendoListView({
7402
7275
  selectable: true,
7403
7276
  navigatable: true,
7404
7277
  dataSource: {},
7405
7278
  contentElement: "",
7406
7279
  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();
7280
+ change: (event) => {
7281
+ var listView = event.sender;
7282
+ var index = listView.select().index();
7283
+ var view = listView.dataSource.view();
7410
7284
  var dataItem = view[index];
7411
- onSelectedItem(dataItem);
7412
- updateUI(index, view.length);
7285
+ this.onSelectedItem(dataItem);
7286
+ this.updateUI(index, view.length);
7413
7287
  }
7414
7288
  });
7415
- } catch (e) {
7416
- console.error("Instantiation of Kendo ListView as search result area threw an exception", e);
7417
- throw e;
7289
+ } catch (error) {
7290
+ console.error("Instantiation of Kendo ListView as search result area threw an exception", error);
7291
+ throw error;
7418
7292
  }
7419
7293
  }
7420
- function stopSearch() {
7421
- setStopButtonEnabledState(false);
7294
+ stopSearch() {
7295
+ this.setStopButtonEnabledState(false);
7422
7296
  }
7423
- function toggleCommand(cmd) {
7297
+ toggleCommand(cmd) {
7424
7298
  cmd.checked(!cmd.checked());
7425
- searchForCurrentToken();
7299
+ this.searchForCurrentToken();
7426
7300
  }
7427
- function setStopButtonEnabledState(enabledState) {
7428
- stopSearchCommand.enabled(enabledState);
7301
+ setStopButtonEnabledState(enabledState) {
7302
+ this.stopSearchCommand.enabled(enabledState);
7429
7303
  }
7430
- function onPageReady(args, page) {
7431
- if (dialogVisible) {
7432
- colorPageElements(searchResults);
7304
+ onPageReady(args, page) {
7305
+ if (this.dialogVisible) {
7306
+ this.colorPageElements(this.searchResults);
7433
7307
  }
7434
7308
  }
7435
- function onInputFiltering(e) {
7436
- e.preventDefault();
7437
- if (e.filter && e.filter.value !== lastSearch) {
7438
- lastSearch = e.filter.value;
7439
- searchForToken(lastSearch);
7309
+ onInputFiltering(event) {
7310
+ event.preventDefault();
7311
+ if (event.filter && event.filter.value !== this.lastSearch) {
7312
+ this.lastSearch = event.filter.value;
7313
+ this.searchForToken(this.lastSearch);
7440
7314
  }
7441
7315
  }
7442
- function kendoComboBoxSelect(e) {
7443
- var newValue = e.sender.value();
7444
- if (newValue && lastSearch !== newValue) {
7445
- lastSearch = newValue;
7446
- searchForToken(lastSearch);
7316
+ kendoComboBoxSelect(event) {
7317
+ var newValue = event.sender.value();
7318
+ if (newValue && this.lastSearch !== newValue) {
7319
+ this.lastSearch = newValue;
7320
+ this.searchForToken(this.lastSearch);
7447
7321
  }
7448
7322
  }
7449
- function searchForCurrentToken() {
7450
- if (kendoComboBox) {
7451
- searchForToken(kendoComboBox.value());
7323
+ searchForCurrentToken() {
7324
+ if (this.kendoComboBox) {
7325
+ this.searchForToken(this.kendoComboBox.value());
7452
7326
  }
7453
7327
  }
7454
- function searchForToken(token) {
7455
- onSearchStarted();
7456
- addToMRU(token);
7457
- controller.getSearchResults(
7328
+ searchForToken(token) {
7329
+ this.onSearchStarted();
7330
+ this.addToMRU(token);
7331
+ this.controller.getSearchResults(
7458
7332
  {
7459
7333
  searchToken: token,
7460
- matchCase: optionsCommandSet.searchDialog_MatchCase.checked(),
7461
- matchWholeWord: optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7462
- useRegex: optionsCommandSet.searchDialog_UseRegex.checked()
7334
+ matchCase: this.optionsCommandSet.searchDialog_MatchCase.checked(),
7335
+ matchWholeWord: this.optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7336
+ useRegex: this.optionsCommandSet.searchDialog_UseRegex.checked()
7463
7337
  }
7464
- ).then(function(results) {
7465
- updateResultsUI(results, null);
7466
- }).catch(function(errorMessage) {
7338
+ ).then((results) => {
7339
+ this.updateResultsUI(results, null);
7340
+ }).catch((errorMessage) => {
7467
7341
  if (errorMessage) {
7468
- updateResultsUI(null, errorMessage);
7342
+ this.updateResultsUI(null, errorMessage);
7469
7343
  }
7470
7344
  });
7471
7345
  }
7472
- function onSearchStarted() {
7473
- $resultsLabel.text(stringResources.searchDialogSearchInProgress);
7474
- clearColoredItems();
7475
- searchResults = null;
7476
- setStopButtonEnabledState(true);
7477
- toggleErrorLabel(false, null);
7346
+ onSearchStarted() {
7347
+ this.$resultsLabel.text(stringResources.searchDialogSearchInProgress);
7348
+ this.clearColoredItems();
7349
+ this.searchResults = null;
7350
+ this.setStopButtonEnabledState(true);
7351
+ this.toggleErrorLabel(false, null);
7478
7352
  }
7479
- function updateResultsUI(results, error) {
7480
- setStopButtonEnabledState(false);
7353
+ updateResultsUI(results, error) {
7354
+ this.setStopButtonEnabledState(false);
7481
7355
  if (error) {
7482
- toggleErrorLabel(true, error);
7356
+ this.toggleErrorLabel(true, error);
7483
7357
  }
7484
- displayResultsList(results);
7485
- searchResults = results;
7358
+ this.displayResultsList(results);
7359
+ this.searchResults = results;
7486
7360
  if (results && results.length > 0) {
7487
- colorPageElements(results);
7488
- selectFirstElement();
7361
+ this.colorPageElements(results);
7362
+ this.selectFirstElement();
7489
7363
  } else {
7490
- updateUI(-1, 0);
7364
+ this.updateUI(-1, 0);
7491
7365
  }
7492
7366
  }
7493
- function addToMRU(token) {
7367
+ addToMRU(token) {
7494
7368
  if (!token || token === "") {
7495
7369
  return;
7496
7370
  }
7497
- var exists = mruList.filter(function(mru) {
7371
+ var exists = this.mruList.filter((mru) => {
7498
7372
  return mru.value === token;
7499
7373
  });
7500
7374
  if (exists && exists.length > 0) {
7501
7375
  return;
7502
7376
  }
7503
- mruList.unshift({ value: token });
7504
- if (mruList.length > 10) {
7505
- mruList.pop();
7377
+ this.mruList.unshift({ value: token });
7378
+ if (this.mruList.length > 10) {
7379
+ this.mruList.pop();
7506
7380
  }
7507
- inputComboRebinding = true;
7508
- kendoComboBox.dataSource.data(mruList);
7509
- kendoComboBox.select(function(item) {
7381
+ this.inputComboRebinding = true;
7382
+ this.kendoComboBox.dataSource.data(this.mruList);
7383
+ this.kendoComboBox.select((item) => {
7510
7384
  return item.value === token;
7511
7385
  });
7512
- inputComboRebinding = false;
7386
+ this.inputComboRebinding = false;
7513
7387
  }
7514
- function displayResultsList(results) {
7515
- var $listView = $resultsPlaceholder.data("kendoListView");
7388
+ displayResultsList(results) {
7389
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7516
7390
  if (!results) {
7517
7391
  results = [];
7518
7392
  }
7519
7393
  $listView.dataSource.data(results);
7520
7394
  }
7521
- function colorPageElements(results) {
7395
+ colorPageElements(results) {
7522
7396
  if (!results || results.length === 0) {
7523
7397
  return;
7524
7398
  }
7525
- var $parent = $placeholder.parent();
7399
+ var $parent = this.$element.parent();
7526
7400
  var $pageContainer = $parent.find(".trv-page-container");
7527
7401
  var elements = $pageContainer.find("[data-search-id]");
7528
- each(results, function() {
7529
- var $searchElement = elements.filter("[data-search-id=" + this.id + "]");
7402
+ Array.from(results).forEach((result) => {
7403
+ var $searchElement = elements.filter("[data-search-id=" + result.id + "]");
7530
7404
  if ($searchElement) {
7531
- $searchElement.addClass(highlightManager.shadedClassName);
7532
- highlightManager.elements.push($searchElement);
7405
+ $searchElement.addClass(this.highlightManager.shadedClassName);
7406
+ this.highlightManager.elements.push($searchElement);
7533
7407
  }
7534
7408
  });
7535
- highlightItem(pendingHighlightItem);
7536
- pendingHighlightItem = null;
7409
+ this.highlightItem(this.pendingHighlightItem);
7410
+ this.pendingHighlightItem = null;
7537
7411
  }
7538
- function highlightItem(item) {
7412
+ highlightItem(item) {
7539
7413
  if (item) {
7540
7414
  var currentItemId = item.id;
7541
- var newHighlighted = $(highlightManager.elements.filter(function(i) {
7415
+ var newHighlighted = $(this.highlightManager.elements.filter((i) => {
7542
7416
  return i.attr("data-search-id") === currentItemId;
7543
7417
  })).first();
7544
7418
  if (newHighlighted) {
7545
- highlightManager.current = newHighlighted[0];
7546
- if (highlightManager.current) {
7419
+ this.highlightManager.current = newHighlighted[0];
7420
+ if (this.highlightManager.current) {
7547
7421
  var current = $("[data-search-id='" + currentItemId + "']");
7548
- current.removeClass(highlightManager.shadedClassName);
7549
- current.addClass(highlightManager.highlightedClassName);
7422
+ current.removeClass(this.highlightManager.shadedClassName);
7423
+ current.addClass(this.highlightManager.highlightedClassName);
7550
7424
  }
7551
7425
  }
7552
7426
  }
7553
7427
  }
7554
- function selectFirstElement() {
7555
- var $listView = $resultsPlaceholder.data("kendoListView");
7428
+ selectFirstElement() {
7429
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7556
7430
  var first = $listView.element.children().first();
7557
7431
  $listView.select(first);
7558
7432
  $listView.trigger("change");
7559
7433
  }
7560
- function onSelectedItem(item) {
7434
+ onSelectedItem(item) {
7561
7435
  if (!item) {
7562
7436
  return;
7563
7437
  }
7564
- if (highlightManager.current) {
7565
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7566
- highlightManager.current.addClass(highlightManager.shadedClassName);
7438
+ if (this.highlightManager.current) {
7439
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7440
+ this.highlightManager.current.addClass(this.highlightManager.shadedClassName);
7567
7441
  }
7568
- if (item.page === controller.getCurrentPageNumber()) {
7569
- highlightItem(item);
7442
+ if (item.page === this.controller.getCurrentPageNumber()) {
7443
+ this.highlightItem(item);
7570
7444
  } else {
7571
- if (controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7572
- clearColoredItems();
7445
+ if (this.controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7446
+ this.clearColoredItems();
7573
7447
  } else {
7574
- highlightItem(item);
7448
+ this.highlightItem(item);
7575
7449
  }
7576
7450
  }
7577
- pendingHighlightItem = item;
7578
- controller.navigateToPage(item.page, { type: "search", id: item.id });
7451
+ this.pendingHighlightItem = item;
7452
+ this.controller.navigateToPage(item.page, { type: "search", id: item.id });
7579
7453
  }
7580
- function updateUI(index, count) {
7454
+ updateUI(index, count) {
7581
7455
  var str = count === 0 ? stringResources.searchDialogNoResultsLabel : stringFormat(stringResources.searchDialogResultsFormatLabel, [index + 1, count]);
7582
- $resultsLabel.text(str);
7456
+ this.$resultsLabel.text(str);
7583
7457
  var allowMoveUp = index > 0;
7584
7458
  var allowMoveDown = index < count - 1;
7585
- navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7586
- navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7459
+ this.navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7460
+ this.navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7587
7461
  }
7588
- function clearColoredItems() {
7589
- if (highlightManager.elements && highlightManager.elements.length > 0) {
7590
- each(highlightManager.elements, function() {
7591
- this.removeClass(highlightManager.shadedClassName);
7462
+ clearColoredItems() {
7463
+ if (this.highlightManager.elements && this.highlightManager.elements.length > 0) {
7464
+ Array.from(this.highlightManager.elements).forEach(($element) => {
7465
+ $element.removeClass(this.highlightManager.shadedClassName);
7592
7466
  });
7593
7467
  }
7594
- if (highlightManager.current) {
7595
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7468
+ if (this.highlightManager.current) {
7469
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7596
7470
  }
7597
- highlightManager.elements = [];
7598
- highlightManager.current = null;
7471
+ this.highlightManager.elements = [];
7472
+ this.highlightManager.current = null;
7599
7473
  }
7600
- function moveListSelection(offset) {
7601
- var $listView = $resultsPlaceholder.data("kendoListView");
7474
+ moveListSelection(offset) {
7475
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7602
7476
  var $selected = $listView.select();
7603
7477
  if (!$selected) {
7604
7478
  $selected = $listView.element.children().first();
@@ -7614,12 +7488,12 @@ var telerikReportViewer = (function (exports) {
7614
7488
  if (element) {
7615
7489
  $listView.select(element);
7616
7490
  $listView.trigger("change");
7617
- scrollIfNeeded(element[0], $listView.element[0]);
7491
+ this.scrollIfNeeded(element[0], $listView.element[0]);
7618
7492
  }
7619
7493
  }
7620
7494
  }
7621
7495
  }
7622
- function scrollIfNeeded(element, container) {
7496
+ scrollIfNeeded(element, container) {
7623
7497
  if (element.offsetTop - element.clientHeight < container.scrollTop) {
7624
7498
  element.scrollIntoView();
7625
7499
  } else {
@@ -7630,13 +7504,13 @@ var telerikReportViewer = (function (exports) {
7630
7504
  }
7631
7505
  }
7632
7506
  }
7633
- function toggleErrorLabel(show, message) {
7634
- var $errorIcon = $searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7507
+ toggleErrorLabel(show, message) {
7508
+ var $errorIcon = this.$searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7635
7509
  if (!$errorIcon || $errorIcon.length === 0) {
7636
7510
  console.log(message);
7637
7511
  return;
7638
7512
  }
7639
- var menuItem = $searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7513
+ var menuItem = this.$searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7640
7514
  if (show) {
7641
7515
  $errorIcon[0].title = message;
7642
7516
  menuItem.show();
@@ -7644,79 +7518,42 @@ var telerikReportViewer = (function (exports) {
7644
7518
  menuItem.hide();
7645
7519
  }
7646
7520
  }
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
7521
  }
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
7522
 
7719
7523
  var defaultOptions = {};
7524
+ function replaceStringResources($sendEmailDialog) {
7525
+ if (!$sendEmailDialog) {
7526
+ return;
7527
+ }
7528
+ var labels = $sendEmailDialog.find(".trv-replace-string");
7529
+ var ariaLabel = $sendEmailDialog.find("[aria-label]");
7530
+ var titles = $sendEmailDialog.find("[title]");
7531
+ if (labels.length) {
7532
+ Array.from(labels).forEach((element) => {
7533
+ replaceText($(element));
7534
+ });
7535
+ }
7536
+ if (ariaLabel.length) {
7537
+ Array.from(ariaLabel).forEach((element) => {
7538
+ replaceAttribute($(element), "aria-label");
7539
+ });
7540
+ }
7541
+ if (titles.length) {
7542
+ Array.from(titles).forEach((element) => {
7543
+ replaceAttribute($(element), "title");
7544
+ });
7545
+ }
7546
+ }
7547
+ function replaceText($el) {
7548
+ if ($el) {
7549
+ $el.text(stringResources[$el.text()]);
7550
+ }
7551
+ }
7552
+ function replaceAttribute($el, attribute) {
7553
+ if ($el) {
7554
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
7555
+ }
7556
+ }
7720
7557
  function SendEmail(placeholder, options, viewerOptions) {
7721
7558
  options = $.extend({}, defaultOptions, options);
7722
7559
  var controller = options.controller;
@@ -7815,9 +7652,9 @@ var telerikReportViewer = (function (exports) {
7815
7652
  }, 250);
7816
7653
  }
7817
7654
  }).data("kendoWindow");
7818
- } catch (e) {
7819
- console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", e);
7820
- throw e;
7655
+ } catch (error) {
7656
+ console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", error);
7657
+ throw error;
7821
7658
  }
7822
7659
  kendoSendEmailDialog.wrapper.addClass("trv-send-email");
7823
7660
  try {
@@ -7831,13 +7668,13 @@ var telerikReportViewer = (function (exports) {
7831
7668
  this.trigger("change");
7832
7669
  }
7833
7670
  }).data("kendoComboBox");
7834
- } catch (e) {
7835
- console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", e);
7836
- throw e;
7671
+ } catch (error) {
7672
+ console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", error);
7673
+ throw error;
7837
7674
  }
7838
- $placeholder.on("keydown", '[name="format_input"]', function(e) {
7675
+ $placeholder.on("keydown", '[name="format_input"]', function(event) {
7839
7676
  var tabkey = 9;
7840
- if (e.keyCode === tabkey && bodyEditor) {
7677
+ if (event.keyCode === tabkey && bodyEditor) {
7841
7678
  setTimeout(function() {
7842
7679
  bodyEditor.focus();
7843
7680
  });
@@ -7870,9 +7707,9 @@ var telerikReportViewer = (function (exports) {
7870
7707
  "superscript"
7871
7708
  ]
7872
7709
  }).data("kendoEditor");
7873
- } catch (e) {
7874
- console.error("Instantiation of Kendo Editor for Email body editor threw an exception", e);
7875
- throw e;
7710
+ } catch (error) {
7711
+ console.error("Instantiation of Kendo Editor for Email body editor threw an exception", error);
7712
+ throw error;
7876
7713
  }
7877
7714
  setDefaultValues(viewerOptions.sendEmail);
7878
7715
  initialized = true;
@@ -7949,22 +7786,14 @@ var telerikReportViewer = (function (exports) {
7949
7786
  }
7950
7787
  function initCommands() {
7951
7788
  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() {
7789
+ "sendEmail_Cancel": new Command(function() {
7954
7790
  closeWindow();
7955
7791
  }),
7956
- "sendEmail_Send": new command(function(e) {
7792
+ "sendEmail_Send": new Command(function() {
7957
7793
  sendingEmail();
7958
7794
  })
7959
7795
  };
7960
- Binder.bind(
7961
- $placeholder.find(".trv-send-email-actions"),
7962
- {
7963
- controller,
7964
- commands: optionsCommandSet
7965
- },
7966
- viewerOptions
7967
- );
7796
+ Binder.attachCommands($placeholder.find(".trv-send-email-actions"), optionsCommandSet, viewerOptions);
7968
7797
  }
7969
7798
  function sendingEmail(cmd, args) {
7970
7799
  var sendEmailArgs = {
@@ -7982,17 +7811,17 @@ var telerikReportViewer = (function (exports) {
7982
7811
  }
7983
7812
  }
7984
7813
  function setValidation() {
7985
- inputFrom.off("blur").on("blur", function(e) {
7814
+ inputFrom.off("blur").on("blur", function(event) {
7986
7815
  if (!isEmpty($(this))) {
7987
7816
  isValidEmail($(this), false);
7988
7817
  }
7989
7818
  });
7990
- inputTo.off("blur").on("blur", function(e) {
7819
+ inputTo.off("blur").on("blur", function(event) {
7991
7820
  if (!isEmpty($(this))) {
7992
7821
  isValidEmail($(this), true);
7993
7822
  }
7994
7823
  });
7995
- inputCC.off("blur").on("blur", function(e) {
7824
+ inputCC.off("blur").on("blur", function(event) {
7996
7825
  if ($(this).val().length) {
7997
7826
  isValidEmail($(this), true);
7998
7827
  } else {
@@ -8051,9 +7880,8 @@ var telerikReportViewer = (function (exports) {
8051
7880
  }
8052
7881
  }
8053
7882
  return true;
8054
- } else {
8055
- return _validateEmail(inputValue, $el);
8056
7883
  }
7884
+ return _validateEmail(inputValue, $el);
8057
7885
  }
8058
7886
  function _validateEmail(email, $el) {
8059
7887
  var regexEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
@@ -8073,74 +7901,7 @@ var telerikReportViewer = (function (exports) {
8073
7901
  function clearValidation() {
8074
7902
  $(".k-invalid-msg").removeClass("-visible");
8075
7903
  }
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
7904
  }
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
7905
 
8145
7906
  function SideMenu(dom, rootOptions, otherOptions) {
8146
7907
  var options = $.extend({}, rootOptions, otherOptions);
@@ -8210,16 +7971,15 @@ var telerikReportViewer = (function (exports) {
8210
7971
  });
8211
7972
  }
8212
7973
  function fillFormats(formats) {
8213
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
8214
- var $list = $(this);
7974
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
7975
+ var $list = $(list);
8215
7976
  var $parent = $list.parents("li");
8216
7977
  var tabIndex = $parent.attr("tabindex");
8217
7978
  if (!tabIndex) {
8218
7979
  tabIndex = DEFAULT_TABINDEX;
8219
7980
  }
8220
7981
  $list.empty();
8221
- each(formats, function(i) {
8222
- var format = this;
7982
+ Array.from(formats).forEach((format) => {
8223
7983
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
8224
7984
  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
7985
  panelBar.append(li, $parent);
@@ -8229,10 +7989,10 @@ var telerikReportViewer = (function (exports) {
8229
7989
  });
8230
7990
  }
8231
7991
  function enableCloseOnClick(root) {
8232
- each(root.find("li"), function() {
8233
- var isLeaf = $(this).children("ul").length === 0;
7992
+ Array.from(root.find("li")).forEach((listItem) => {
7993
+ var isLeaf = $(listItem).children("ul").length === 0;
8234
7994
  if (isLeaf) {
8235
- $(this).children("a").click(function() {
7995
+ $(listItem).children("a").on("click", (event) => {
8236
7996
  controller.setSideMenuVisible({ visible: !sideMenuVisible });
8237
7997
  });
8238
7998
  }
@@ -8250,21 +8010,21 @@ var telerikReportViewer = (function (exports) {
8250
8010
  function setListItemsTabIndex(list, tabIndex) {
8251
8011
  list.attr("tabindex", tabIndex);
8252
8012
  var items = list.find("li");
8253
- each(items, function() {
8254
- var $item = $(this);
8013
+ Array.from(items).forEach((item) => {
8014
+ var $item = $(item);
8255
8015
  $item.attr("tabindex", tabIndex);
8256
8016
  var anchor = $item.children("a");
8257
8017
  if (anchor.length > 0) {
8258
8018
  var $anchor = $(anchor);
8259
8019
  $anchor.attr("tabindex", -1);
8260
8020
  }
8261
- $item.focus(function() {
8021
+ $item.on("focus", (event) => {
8262
8022
  var anchor2 = $item.children("a");
8263
8023
  if (anchor2.length > 0) {
8264
8024
  anchor2.addClass("k-focus");
8265
8025
  }
8266
8026
  });
8267
- $item.blur(function() {
8027
+ $item.on("blur", (event) => {
8268
8028
  var anchor2 = $item.children("a");
8269
8029
  if (anchor2.length > 0) {
8270
8030
  anchor2.removeClass("k-focus");
@@ -8328,12 +8088,12 @@ var telerikReportViewer = (function (exports) {
8328
8088
  if (!menuAreas) {
8329
8089
  return;
8330
8090
  }
8331
- each(menuAreas, function() {
8332
- var $menu = $(this);
8091
+ Array.from(menuAreas).forEach((menu2) => {
8092
+ var $menu = $(menu2);
8333
8093
  var menuItems = $menu.children("li.k-panelbar-header");
8334
8094
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
8335
- each(menuItems, function() {
8336
- var $menuItem = $(this);
8095
+ Array.from(menuItems).forEach((menuItem) => {
8096
+ var $menuItem = $(menuItem);
8337
8097
  var $a = $menuItem.find("a");
8338
8098
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
8339
8099
  if ($a) {
@@ -8347,22 +8107,14 @@ var telerikReportViewer = (function (exports) {
8347
8107
  });
8348
8108
  }
8349
8109
  function findMenuArea() {
8350
- return findElement("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8110
+ return $("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8351
8111
  }
8352
8112
  }
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
8113
 
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);
8114
+ var __defProp$4 = Object.defineProperty;
8115
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8116
+ var __publicField$4 = (obj, key, value) => {
8117
+ __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
8366
8118
  return value;
8367
8119
  };
8368
8120
  class MemStorage {
@@ -8370,7 +8122,7 @@ var telerikReportViewer = (function (exports) {
8370
8122
  // #region constructor
8371
8123
  constructor() {
8372
8124
  // #region fields
8373
- __publicField$1(this, "_data", {});
8125
+ __publicField$4(this, "_data", {});
8374
8126
  this._data = {};
8375
8127
  }
8376
8128
  // #endregion
@@ -8411,14 +8163,14 @@ var telerikReportViewer = (function (exports) {
8411
8163
  html = replaceAll(html, "{service}/", baseUri);
8412
8164
  html = replaceAll(html, "{service}", baseUri);
8413
8165
  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 ");
8166
+ Array.from(viewerTemplate.find("template")).forEach((element) => {
8167
+ var $element = $(element);
8168
+ templates[$element.attr("id")] = trim($element.html(), "\n ");
8417
8169
  });
8418
- each(viewerTemplate.find("link"), function(index, e) {
8419
- styleSheets.push(trim(e.outerHTML, "\n "));
8170
+ Array.from(viewerTemplate.find("link")).forEach((element) => {
8171
+ styleSheets.push(trim(element.outerHTML, "\n "));
8420
8172
  });
8421
- styleSheets = filterUniqueLastOccurance(styleSheets);
8173
+ styleSheets = filterUniqueLastOccurrence(styleSheets);
8422
8174
  return {
8423
8175
  templates,
8424
8176
  styleSheets
@@ -8430,10 +8182,10 @@ var telerikReportViewer = (function (exports) {
8430
8182
  };
8431
8183
  }();
8432
8184
 
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);
8185
+ var __defProp$3 = Object.defineProperty;
8186
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8187
+ var __publicField$3 = (obj, key, value) => {
8188
+ __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8437
8189
  return value;
8438
8190
  };
8439
8191
  class ReportViewerSettings {
@@ -8441,9 +8193,9 @@ var telerikReportViewer = (function (exports) {
8441
8193
  // #region constructor
8442
8194
  constructor(id, storage, defaultSettings) {
8443
8195
  // #region fields
8444
- __publicField(this, "_id");
8445
- __publicField(this, "_storage");
8446
- __publicField(this, "_defaults");
8196
+ __publicField$3(this, "_id");
8197
+ __publicField$3(this, "_storage");
8198
+ __publicField$3(this, "_defaults");
8447
8199
  this._id = id;
8448
8200
  this._storage = storage;
8449
8201
  this._defaults = defaultSettings || {};
@@ -8563,6 +8315,129 @@ var telerikReportViewer = (function (exports) {
8563
8315
  // #endregion
8564
8316
  }
8565
8317
 
8318
+ var __defProp$2 = Object.defineProperty;
8319
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8320
+ var __publicField$2 = (obj, key, value) => {
8321
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
8322
+ return value;
8323
+ };
8324
+ class BaseComponent {
8325
+ // #endregion
8326
+ // #region constructor
8327
+ constructor(element, options) {
8328
+ // #region fields
8329
+ __publicField$2(this, "element");
8330
+ __publicField$2(this, "$element");
8331
+ __publicField$2(this, "options");
8332
+ this.element = element;
8333
+ this.$element = $(element);
8334
+ this.options = options;
8335
+ }
8336
+ // #endregion
8337
+ }
8338
+
8339
+ var __defProp$1 = Object.defineProperty;
8340
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8341
+ var __publicField$1 = (obj, key, value) => {
8342
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8343
+ return value;
8344
+ };
8345
+ class LinkButton extends BaseComponent {
8346
+ // #endregion
8347
+ // #region constructor
8348
+ constructor(element, options) {
8349
+ super(element, options);
8350
+ // #region fields
8351
+ __publicField$1(this, "cmd");
8352
+ var dataCommand = this.$element.attr("data-command");
8353
+ if (dataCommand) {
8354
+ this.cmd = this.options.commands[dataCommand];
8355
+ }
8356
+ if (this.cmd) {
8357
+ this.$element.on("click", (event) => {
8358
+ if (this.cmd.enabled()) {
8359
+ this.cmd.exec($(this).attr("data-command-parameter"));
8360
+ } else {
8361
+ event.preventDefault();
8362
+ }
8363
+ });
8364
+ $(this.cmd).on("enabledChanged", (event) => {
8365
+ (this.cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call(this.$element, "disabled");
8366
+ }).on("checkedChanged", (event) => {
8367
+ (this.cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(this.$element, "checked");
8368
+ });
8369
+ }
8370
+ }
8371
+ // #endregion
8372
+ }
8373
+
8374
+ var __defProp = Object.defineProperty;
8375
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8376
+ var __publicField = (obj, key, value) => {
8377
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8378
+ return value;
8379
+ };
8380
+ class PageNumberInput extends BaseComponent {
8381
+ // #endregion
8382
+ // #region constructor
8383
+ constructor(element, options) {
8384
+ super(element, options);
8385
+ // #region fields
8386
+ __publicField(this, "cmd");
8387
+ __publicField(this, "_numeric");
8388
+ this.cmd = this.options.commands["goToPage"];
8389
+ this._numeric = new kendo.ui.NumericTextBox(this.element, {
8390
+ format: "0",
8391
+ decimals: 0,
8392
+ min: 0,
8393
+ spinners: false,
8394
+ change: this._onChange.bind(this),
8395
+ spin: this._onChange.bind(this)
8396
+ });
8397
+ this._numeric._text[0].dataset.role = "telerik_ReportViewer_PageNumberInput";
8398
+ this._numeric.element[0].dataset.role = "";
8399
+ this.options.controller.on("reportLoadComplete", (event, reportInfo) => {
8400
+ this._numeric.max(reportInfo.pageCount);
8401
+ this._numeric.min(Math.min(1, reportInfo.pageCount));
8402
+ this._numeric.value(Math.min(1, reportInfo.pageCount));
8403
+ }).on("loadedReportChange", (event) => {
8404
+ this._numeric.min(0);
8405
+ this._numeric.max(0);
8406
+ this._numeric.value(0);
8407
+ }).on("renderingStopped", (event) => {
8408
+ this._numeric.min(0);
8409
+ this._numeric.max(0);
8410
+ this._numeric.value(0);
8411
+ }).pageNumberChange((event, value) => {
8412
+ this._numeric.value(value);
8413
+ });
8414
+ }
8415
+ // #endregion
8416
+ // #region event handlers
8417
+ _onChange(event, data) {
8418
+ var val = this._numeric.value();
8419
+ var num = tryParseInt(val);
8420
+ if (!isNaN(num)) {
8421
+ this.cmd.exec(num);
8422
+ }
8423
+ }
8424
+ _onSpin(event, data) {
8425
+ return this._onChange(event, data);
8426
+ }
8427
+ // #endregion
8428
+ }
8429
+
8430
+ class PageCountLabel extends BaseComponent {
8431
+ // #region constructor
8432
+ constructor(element, options) {
8433
+ super(element, options);
8434
+ this.options.controller.pageCountChange((event, value) => {
8435
+ this.$element.text(value);
8436
+ });
8437
+ }
8438
+ // #endregion
8439
+ }
8440
+
8566
8441
  const Instances = GlobalSettings.viewerInstances;
8567
8442
  function getDefaultOptions(serviceUrl, version) {
8568
8443
  return {
@@ -8622,8 +8497,8 @@ var telerikReportViewer = (function (exports) {
8622
8497
  if (!validateOptions(options)) {
8623
8498
  return;
8624
8499
  }
8625
- var version = "18.1.24.514";
8626
- options = extend({}, getDefaultOptions(svcApiUrl, version), options);
8500
+ var version = "18.1.24.709";
8501
+ options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
8627
8502
  settings = new ReportViewerSettings(
8628
8503
  persistanceKey,
8629
8504
  options.persistSession ? window.sessionStorage : new MemStorage(),
@@ -9074,24 +8949,21 @@ var telerikReportViewer = (function (exports) {
9074
8949
  return e.outerHTML;
9075
8950
  }).toArray();
9076
8951
  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
- }
8952
+ Array.from(styleSheets).forEach((element) => {
8953
+ if (currentStyleLinks.indexOf(element) === -1) {
8954
+ promises.push(
8955
+ new Promise(function(resolve, reject) {
8956
+ var $link = $(element);
8957
+ $link.on("load", resolve);
8958
+ $link.on("onerror", function() {
8959
+ logError("error loading stylesheet " + element);
8960
+ resolve();
8961
+ });
8962
+ $head.append($link);
8963
+ })
8964
+ );
9093
8965
  }
9094
- );
8966
+ });
9095
8967
  return Promise.all(promises).then(controller.cssLoaded);
9096
8968
  }
9097
8969
  function browserSupportsAllFeatures() {
@@ -9100,12 +8972,11 @@ var telerikReportViewer = (function (exports) {
9100
8972
  function ensureKendo(version2) {
9101
8973
  if (window.kendo) {
9102
8974
  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
8975
  }
8976
+ var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
8977
+ return loadScript(kendoUrl).catch(function(errorData) {
8978
+ logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
8979
+ });
9109
8980
  }
9110
8981
  function main(version2) {
9111
8982
  ensureKendo(version2).then(function() {
@@ -9133,7 +9004,7 @@ var telerikReportViewer = (function (exports) {
9133
9004
  if (browserSupportsAllFeatures()) {
9134
9005
  main(version);
9135
9006
  } else {
9136
- loadScriptWithCallback("https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise", main, version);
9007
+ throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
9137
9008
  }
9138
9009
  return viewer;
9139
9010
  }
@@ -9142,7 +9013,7 @@ var telerikReportViewer = (function (exports) {
9142
9013
  if (this.selector && !options.selector) {
9143
9014
  options.selector = this.selector;
9144
9015
  }
9145
- return each(this, function() {
9016
+ return this.each(function() {
9146
9017
  if (!$.data(this, pluginName)) {
9147
9018
  $.data(this, pluginName, new ReportViewer(this, options));
9148
9019
  }
@@ -9176,11 +9047,23 @@ var telerikReportViewer = (function (exports) {
9176
9047
  {
9177
9048
  name: "telerik_ReportViewer_SideMenu",
9178
9049
  constructor: SideMenu
9050
+ },
9051
+ {
9052
+ name: "telerik_ReportViewer_LinkButton",
9053
+ constructor: LinkButton
9054
+ },
9055
+ {
9056
+ name: "telerik_ReportViewer_PageNumberInput",
9057
+ constructor: PageNumberInput
9058
+ },
9059
+ {
9060
+ name: "telerik_ReportViewer_PageCountLabel",
9061
+ constructor: PageCountLabel
9179
9062
  }
9180
9063
  ];
9181
9064
  plugins.forEach((plugin) => {
9182
9065
  $.fn[plugin.name] = function(options, otherOptions) {
9183
- return each(this, function() {
9066
+ return this.each(function() {
9184
9067
  if (!$.data(this, plugin.name)) {
9185
9068
  $.data(this, plugin.name, new plugin.constructor(this, options, otherOptions));
9186
9069
  }