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