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

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.2.24.806 (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;
@@ -2583,6 +2585,9 @@ var telerikReportViewer = (function (exports) {
2583
2585
  });
2584
2586
  },
2585
2587
  getReportParameters: function() {
2588
+ if (!parameterValues) {
2589
+ return [];
2590
+ }
2586
2591
  var paramsToBeExposed = {};
2587
2592
  for (var key in processedParameterValues) {
2588
2593
  var processedParam = processedParameterValues[key];
@@ -2614,13 +2619,13 @@ var telerikReportViewer = (function (exports) {
2614
2619
  var parameterValues2 = {};
2615
2620
  var invalidParameters = [];
2616
2621
  var hasError = false;
2617
- each(parameters || [], function() {
2622
+ Array.from(parameters || []).forEach((parameter) => {
2618
2623
  try {
2619
- var value = parameterValidators.validate(this, this.value);
2620
- parameterValues2[this.id] = value;
2624
+ var value = parameterValidators.validate(parameter, parameter.value);
2625
+ parameterValues2[parameter.id] = value;
2621
2626
  } catch (e) {
2622
2627
  hasError = true;
2623
- invalidParameters.push(this);
2628
+ invalidParameters.push(parameter);
2624
2629
  return;
2625
2630
  }
2626
2631
  });
@@ -2697,8 +2702,8 @@ var telerikReportViewer = (function (exports) {
2697
2702
  eventEmitter.on(eventName, handler);
2698
2703
  return controller;
2699
2704
  },
2700
- trigger: function(eventName, args) {
2701
- eventEmitter.trigger(eventName, args);
2705
+ trigger: function(eventName, ...args) {
2706
+ eventEmitter.trigger(eventName, ...args);
2702
2707
  return controller;
2703
2708
  },
2704
2709
  showNotification: function(...args) {
@@ -3390,11 +3395,11 @@ var telerikReportViewer = (function (exports) {
3390
3395
  _loadVisiblePages: function _loadVisiblePages() {
3391
3396
  var that = this;
3392
3397
  var pages = that.$placeholder.find(".trv-report-page");
3393
- $.each(pages, function(index, value) {
3398
+ Array.from(pages).forEach((value) => {
3394
3399
  var pageItem = $(value);
3395
3400
  var pageNumber = parseInt(pageItem.attr("data-page"));
3396
3401
  if (that._scrolledInToView(pageItem) && that._isSkeletonScreen(pageItem, pageNumber)) {
3397
- that.controller.getPageData(pageNumber).then(function(newPage) {
3402
+ that.controller.getPageData(pageNumber).then((newPage) => {
3398
3403
  that._render(newPage, false);
3399
3404
  });
3400
3405
  }
@@ -3565,9 +3570,8 @@ var telerikReportViewer = (function (exports) {
3565
3570
  return that._findNewCurrentPage(pages.splice(middleIndex, Number.MAX_VALUE));
3566
3571
  } else if (result > 0 && pages.length > 1) {
3567
3572
  return that._findNewCurrentPage(pages.splice(0, middleIndex));
3568
- } else {
3569
- return -1;
3570
3573
  }
3574
+ return -1;
3571
3575
  },
3572
3576
  _findPageInViewPort: function _findPageInViewPort(index, pages) {
3573
3577
  var pageItem = this.$placeholder.find(pages[index]);
@@ -3584,9 +3588,8 @@ var telerikReportViewer = (function (exports) {
3584
3588
  }
3585
3589
  if (pageBottom < additionalTopOffset) {
3586
3590
  return -1;
3587
- } else {
3588
- return 1;
3589
3591
  }
3592
+ return 1;
3590
3593
  },
3591
3594
  _scrollDown: function _scrollDown(pages, scrollPosition) {
3592
3595
  var that = this;
@@ -3645,21 +3648,21 @@ var telerikReportViewer = (function (exports) {
3645
3648
  var UIFreezeCoordinator = {
3646
3649
  $placeholder: null,
3647
3650
  $scrollableContainer: null,
3648
- itemsInitialState: {},
3649
3651
  // Holds all items initial position per container
3652
+ itemsInitialState: {},
3653
+ // Holds the bounds of the frozen areas by X per container
3650
3654
  xFrozenAreasBounds: {},
3651
- //Holds the bounds of the frozen areas by X per container
3655
+ // Holds the bounds of the frozen areas by Y per container
3652
3656
  yFrozenAreasBounds: {},
3653
- //Holds the bounds of the frozen areas by Y per container
3654
3657
  freezeMaxZIndex: {},
3655
3658
  zIndex: 1,
3656
- freezeBGColor: {},
3657
3659
  // Holds default background-color value per container
3658
- currentlyfreezedContainer: {
3660
+ freezeBGColor: {},
3661
+ // Holds whether freezing has been applied per container.
3662
+ currentlyFrozenContainer: {
3659
3663
  vertical: {},
3660
3664
  horizontal: {}
3661
3665
  },
3662
- //Holds whether freezing has been applied per container.
3663
3666
  isInitialize: false,
3664
3667
  scaleFactor: null,
3665
3668
  /**
@@ -3787,28 +3790,28 @@ var telerikReportViewer = (function (exports) {
3787
3790
  var horizontalMoveOffset = scrollableContainerScrollLeft - elementWrapperLeftPosition;
3788
3791
  if (hasFixColumn && verticalMoveOffset > 0) {
3789
3792
  if (scrollableContainerScrollTop <= $elementWrapper.outerHeight() * this.scaleFactor + elementWrapperTopPosition - this.yFrozenAreasBounds[freezeItemsContainerID].height) {
3790
- this.currentlyfreezedContainer.vertical[freezeItemsContainerID] = true;
3793
+ this.currentlyFrozenContainer.vertical[freezeItemsContainerID] = true;
3791
3794
  this._updateUIElementsPosition($colHeaders, "top", verticalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3792
3795
  }
3793
3796
  } else {
3794
- if (this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3795
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3797
+ if (this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3798
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3796
3799
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3797
3800
  }
3798
3801
  }
3799
3802
  if (hasFixRow && horizontalMoveOffset > 0) {
3800
3803
  if (scrollableContainerScrollLeft <= $elementWrapper.outerWidth() * this.scaleFactor + elementWrapperLeftPosition - this.xFrozenAreasBounds[freezeItemsContainerID].width) {
3801
- this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] = true;
3804
+ this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] = true;
3802
3805
  this._updateUIElementsPosition($rowHeaders, "left", horizontalMoveOffset / this.scaleFactor, freezeItemsContainerID);
3803
3806
  }
3804
3807
  } else {
3805
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID]) {
3806
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3808
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID]) {
3809
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3807
3810
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3808
3811
  }
3809
3812
  }
3810
3813
  } else {
3811
- if (this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID]) {
3814
+ if (this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID]) {
3812
3815
  this._resetToDefaultPosition(freezeItemsContainerID);
3813
3816
  }
3814
3817
  }
@@ -3823,8 +3826,8 @@ var telerikReportViewer = (function (exports) {
3823
3826
  var $colHeaders = $("[data-sticky-direction*='Vertical'][data-sticky-id='" + freezeItemsContainerID + "']");
3824
3827
  this._updateUIElementsPosition($colHeaders, "top", -1, freezeItemsContainerID);
3825
3828
  this._updateUIElementsPosition($rowHeaders, "left", -1, freezeItemsContainerID);
3826
- delete this.currentlyfreezedContainer.horizontal[freezeItemsContainerID];
3827
- delete this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3829
+ delete this.currentlyFrozenContainer.horizontal[freezeItemsContainerID];
3830
+ delete this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3828
3831
  },
3829
3832
  /**
3830
3833
  * Update the freeze elements position
@@ -3867,6 +3870,7 @@ var telerikReportViewer = (function (exports) {
3867
3870
  $item.css(newStyleRules);
3868
3871
  }
3869
3872
  },
3873
+ // eslint-disable-next-line max-params
3870
3874
  _applyBgColorOnScroll: function($item, isItemFrozenBothDirection, hasInitialBgColor, shouldApplyBGColor, freezeItemsContainerID) {
3871
3875
  if ($item.is("img")) {
3872
3876
  return true;
@@ -3885,7 +3889,7 @@ var telerikReportViewer = (function (exports) {
3885
3889
  return getColorAlphaValue(bgColorValue) > 0;
3886
3890
  },
3887
3891
  _isFrozen: function(freezeItemsContainerID) {
3888
- return this.currentlyfreezedContainer.horizontal[freezeItemsContainerID] || this.currentlyfreezedContainer.vertical[freezeItemsContainerID];
3892
+ return this.currentlyFrozenContainer.horizontal[freezeItemsContainerID] || this.currentlyFrozenContainer.vertical[freezeItemsContainerID];
3889
3893
  },
3890
3894
  /**
3891
3895
  * Checks if an UI element is in the visible part of the scrollable container
@@ -3943,7 +3947,7 @@ var telerikReportViewer = (function (exports) {
3943
3947
  var reportPageIsLoaded = false;
3944
3948
  var pageAreaImageStyle = '.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}';
3945
3949
  var pageAreaImageID = "trv-initial-image-styles";
3946
- var scroll = extend({}, Scroll, {});
3950
+ var scroll = $.extend({}, Scroll);
3947
3951
  var uiFreezeCoordinator = null;
3948
3952
  init();
3949
3953
  if (scroll) {
@@ -4029,7 +4033,7 @@ var telerikReportViewer = (function (exports) {
4029
4033
  enableInteractivity();
4030
4034
  }
4031
4035
  if (args.containsFrozenContent && !uiFreezeCoordinator) {
4032
- uiFreezeCoordinator = extend({}, UIFreezeCoordinator, {});
4036
+ uiFreezeCoordinator = $.extend({}, UIFreezeCoordinator);
4033
4037
  if (controller.getViewMode() === ViewModes.INTERACTIVE) {
4034
4038
  uiFreezeCoordinator.init($placeholder);
4035
4039
  }
@@ -4169,19 +4173,13 @@ var telerikReportViewer = (function (exports) {
4169
4173
  var result;
4170
4174
  var allPages = $pageContainer.find(".trv-report-page");
4171
4175
  if (controller.getPageMode() === PageModes.SINGLE_PAGE) {
4172
- each(allPages, function(index, page) {
4173
- if (pageNo(page) === pageNumber) {
4174
- result = page;
4175
- }
4176
- return !result;
4176
+ result = Array.from(allPages).find((page) => {
4177
+ return pageNo(page) === pageNumber;
4177
4178
  });
4178
4179
  } else {
4179
- $.each(allPages, function(index, page) {
4180
+ result = Array.from(allPages).find((page) => {
4180
4181
  var dataPageNumber = parseInt($(page).attr("data-page"));
4181
- if (dataPageNumber === pageNumber) {
4182
- result = page;
4183
- return false;
4184
- }
4182
+ return dataPageNumber === pageNumber;
4185
4183
  });
4186
4184
  }
4187
4185
  return result;
@@ -4393,14 +4391,9 @@ var telerikReportViewer = (function (exports) {
4393
4391
  }
4394
4392
  function getAction(actionId) {
4395
4393
  if (actions) {
4396
- var action;
4397
- each(actions, function() {
4398
- if (this.Id === actionId) {
4399
- action = this;
4400
- }
4401
- return action === void 0;
4394
+ return Array.from(actions).find(function(action) {
4395
+ return action.Id === actionId;
4402
4396
  });
4403
- return action;
4404
4397
  }
4405
4398
  return null;
4406
4399
  }
@@ -4535,14 +4528,6 @@ var telerikReportViewer = (function (exports) {
4535
4528
  $("#" + pageAreaImageID).remove();
4536
4529
  }
4537
4530
  }
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
4531
 
4547
4532
  var parameterEditorsMatch = {
4548
4533
  // AvailableValues PROVIDED, MultiValue is TRUE and trv.parameters.editors.multiSelect is unset
@@ -4770,8 +4755,8 @@ var telerikReportViewer = (function (exports) {
4770
4755
  }
4771
4756
  function applyAriaSelected(selection) {
4772
4757
  var children = $list.find(".trv-listviewitem");
4773
- each(children, function() {
4774
- var $item = $(this);
4758
+ Array.from(children).forEach((item) => {
4759
+ var $item = $(item);
4775
4760
  var isSelected = selection.filter($item).length > 0;
4776
4761
  $item.attr("aria-selected", isSelected);
4777
4762
  });
@@ -4854,9 +4839,9 @@ var telerikReportViewer = (function (exports) {
4854
4839
  items = [items];
4855
4840
  }
4856
4841
  var children = $list.find(".trv-listviewitem");
4857
- each(parameter.availableValues, function(i, av) {
4842
+ $.each(parameter.availableValues, (i, av) => {
4858
4843
  var selected = false;
4859
- each(items, function(j, v) {
4844
+ $.each(items, (j, v) => {
4860
4845
  var availableValue = av.value;
4861
4846
  if (v instanceof Date) {
4862
4847
  availableValue = parseToLocalDate(av.value);
@@ -4895,8 +4880,8 @@ var telerikReportViewer = (function (exports) {
4895
4880
  addAccessibilityAttributes($list, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
4896
4881
  $list.attr("aria-multiselectable", "true");
4897
4882
  var items = $list.find(".trv-listviewitem");
4898
- each(items, function() {
4899
- $(this).attr("aria-label", this.innerText);
4883
+ Array.from(items).forEach((item) => {
4884
+ $(item).attr("aria-label", item.innerText);
4900
4885
  });
4901
4886
  },
4902
4887
  setAccessibilityErrorState: function(param) {
@@ -5025,8 +5010,8 @@ var telerikReportViewer = (function (exports) {
5025
5010
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5026
5011
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelMultiSelect, param.text, info, param.Error);
5027
5012
  var items = editor.items();
5028
- each(items, function() {
5029
- $(this).attr("aria-label", this.innerText);
5013
+ Array.from(items).forEach((item) => {
5014
+ $(item).attr("aria-label", item.innerText);
5030
5015
  });
5031
5016
  },
5032
5017
  setAccessibilityErrorState: function(param) {
@@ -5088,7 +5073,7 @@ var telerikReportViewer = (function (exports) {
5088
5073
  }
5089
5074
  function setSelectedItems(value) {
5090
5075
  var items = $list.find(".trv-listviewitem");
5091
- each(parameter.availableValues, function(i, av) {
5076
+ $.each(parameter.availableValues, (i, av) => {
5092
5077
  var availableValue = av.value;
5093
5078
  if (value instanceof Date) {
5094
5079
  availableValue = parseToLocalDate(av.value);
@@ -5132,8 +5117,8 @@ var telerikReportViewer = (function (exports) {
5132
5117
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5133
5118
  addAccessibilityAttributes($list, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5134
5119
  var items = $list.find(".trv-listviewitem");
5135
- each(items, function() {
5136
- $(this).attr("aria-label", this.innerText);
5120
+ Array.from(items).forEach((item) => {
5121
+ $(item).attr("aria-label", item.innerText);
5137
5122
  });
5138
5123
  },
5139
5124
  setAccessibilityErrorState: function(param) {
@@ -5223,8 +5208,8 @@ var telerikReportViewer = (function (exports) {
5223
5208
  var info = stringFormat(stringResources.ariaLabelParameterInfo, [param.availableValues.length]);
5224
5209
  addAccessibilityAttributes($accessibilityDom, stringResources.ariaLabelSingleValue, param.text, info, param.Error);
5225
5210
  var items = editor.items();
5226
- each(items, function() {
5227
- $(this).attr("aria-label", this.innerText);
5211
+ Array.from(items).forEach((item) => {
5212
+ $(item).attr("aria-label", item.innerText);
5228
5213
  });
5229
5214
  },
5230
5215
  setAccessibilityErrorState: function(param) {
@@ -5588,39 +5573,58 @@ var telerikReportViewer = (function (exports) {
5588
5573
  };
5589
5574
  }
5590
5575
 
5576
+ var __defProp$5 = Object.defineProperty;
5577
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5578
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5579
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5580
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5581
+ var __spreadValues = (a, b) => {
5582
+ for (var prop in b || (b = {}))
5583
+ if (__hasOwnProp.call(b, prop))
5584
+ __defNormalProp$5(a, prop, b[prop]);
5585
+ if (__getOwnPropSymbols)
5586
+ for (var prop of __getOwnPropSymbols(b)) {
5587
+ if (__propIsEnum.call(b, prop))
5588
+ __defNormalProp$5(a, prop, b[prop]);
5589
+ }
5590
+ return a;
5591
+ };
5591
5592
  var JSON_CONTENT_TYPE = "application/json; charset=UTF-8";
5592
5593
  var URLENCODED_CONTENT_TYPE = "application/x-www-form-urlencoded; charset=UTF-8";
5593
5594
  var HTTP_GET = "GET";
5594
5595
  var HTTP_POST = "POST";
5595
5596
  var HTTP_DELETE = "DELETE";
5596
5597
  var defaultOptions$4 = {};
5598
+ function getHeaders(authorizationToken) {
5599
+ const headers = {
5600
+ "Accept": "application/json, text/javascript, */*; q=0.01"
5601
+ };
5602
+ if (authorizationToken) {
5603
+ headers["Authorization"] = "Bearer " + authorizationToken;
5604
+ }
5605
+ return headers;
5606
+ }
5597
5607
  function ServiceClient(options) {
5598
- options = extend({}, defaultOptions$4, options);
5608
+ options = $.extend({}, defaultOptions$4, options);
5599
5609
  var baseUrl = rTrim(options.serviceUrl || options.baseUrl, "\\/");
5600
5610
  var loginPromise;
5601
5611
  var _ajax = $ajax;
5602
5612
  function validateClientID(clientID) {
5603
- if (!clientID)
5613
+ if (!clientID) {
5604
5614
  throw "Invalid clientID";
5615
+ }
5605
5616
  }
5606
5617
  function urlFromTemplate(template, args) {
5607
- args = extend({}, { baseUrl }, args);
5618
+ args = $.extend({}, { baseUrl }, args);
5608
5619
  return stringFormat(template, args);
5609
5620
  }
5610
- function getHeaderSettings(authorizationToken) {
5611
- return authorizationToken ? {
5612
- headers: {
5613
- Authorization: "Bearer " + authorizationToken
5614
- }
5615
- } : {};
5616
- }
5617
5621
  function login() {
5618
5622
  if (!loginPromise) {
5619
5623
  var loginInfo = options.loginInfo;
5620
5624
  if (loginInfo && loginInfo.url && (loginInfo.username || loginInfo.password)) {
5621
- loginPromise = _ajax({
5622
- url: loginInfo.url,
5623
- type: HTTP_POST,
5625
+ const endPoint = loginInfo.url;
5626
+ loginPromise = _ajax(endPoint, {
5627
+ method: HTTP_POST,
5624
5628
  data: {
5625
5629
  grant_type: "password",
5626
5630
  username: loginInfo.username,
@@ -5640,22 +5644,18 @@ var telerikReportViewer = (function (exports) {
5640
5644
  return {
5641
5645
  _urlFromTemplate: urlFromTemplate,
5642
5646
  registerClient: function(settings) {
5647
+ const endPoint = `${baseUrl}/clients`;
5643
5648
  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);
5649
+ return _ajax(endPoint, __spreadValues({
5650
+ headers: getHeaders(authorizationToken),
5651
+ method: HTTP_POST,
5652
+ dataType: "json",
5653
+ // Used to avoid Chrome caching functionality for simple async requests
5654
+ // when the first request is not completed the second request is not send
5655
+ // and the same response is used for both of the request. In this case the
5656
+ // second client is not registered to the service and the same clientId is used.
5657
+ data: JSON.stringify({ timeStamp: Date.now() })
5658
+ }, settings));
5659
5659
  }).then(function(clientData) {
5660
5660
  if (clientData.Message) {
5661
5661
  throw clientData.Message;
@@ -5665,290 +5665,189 @@ var telerikReportViewer = (function (exports) {
5665
5665
  },
5666
5666
  unregisterClient: function(clientID, settings) {
5667
5667
  validateClientID(clientID);
5668
+ const endPoint = `${baseUrl}/clients/${clientID}`;
5668
5669
  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);
5670
+ return _ajax(endPoint, __spreadValues({
5671
+ headers: getHeaders(authorizationToken),
5672
+ method: HTTP_DELETE
5673
+ }, settings));
5678
5674
  });
5679
5675
  },
5680
5676
  getParameters: function(clientID, report, parameterValues, settings) {
5681
5677
  validateClientID(clientID);
5678
+ const endPoint = `${baseUrl}/clients/${clientID}/parameters`;
5682
5679
  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);
5680
+ return _ajax(endPoint, __spreadValues({
5681
+ headers: getHeaders(authorizationToken),
5682
+ method: HTTP_POST,
5683
+ contentType: JSON_CONTENT_TYPE,
5684
+ dataType: "json",
5685
+ data: JSON.stringify({ report, parameterValues })
5686
+ }, settings));
5695
5687
  });
5696
5688
  },
5697
5689
  createReportInstance: function(clientID, report, parameterValues, settings) {
5698
5690
  validateClientID(clientID);
5691
+ const endPoint = `${baseUrl}/clients/${clientID}/instances`;
5699
5692
  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);
5693
+ return _ajax(endPoint, __spreadValues({
5694
+ headers: getHeaders(authorizationToken),
5695
+ method: HTTP_POST,
5696
+ contentType: JSON_CONTENT_TYPE,
5697
+ dataType: "json",
5698
+ data: JSON.stringify({ report, parameterValues })
5699
+ }, settings));
5712
5700
  }).then(function(instanceData) {
5713
5701
  return instanceData.instanceId;
5714
5702
  });
5715
5703
  },
5716
5704
  deleteReportInstance: function(clientID, instanceID, settings) {
5717
5705
  validateClientID(clientID);
5706
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}`;
5718
5707
  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);
5708
+ return _ajax(endPoint, __spreadValues({
5709
+ headers: getHeaders(authorizationToken),
5710
+ method: HTTP_DELETE
5711
+ }, settings));
5728
5712
  });
5729
5713
  },
5714
+ // eslint-disable-next-line max-params
5730
5715
  createReportDocument: function(clientID, instanceID, format, deviceInfo, useCache, baseDocumentID, actionID, settings) {
5731
5716
  validateClientID(clientID);
5717
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents`;
5732
5718
  return login().then(function(authorizationToken) {
5733
5719
  deviceInfo = deviceInfo || {};
5734
5720
  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);
5721
+ return _ajax(endPoint, __spreadValues({
5722
+ headers: getHeaders(authorizationToken),
5723
+ method: HTTP_POST,
5724
+ contentType: JSON_CONTENT_TYPE,
5725
+ dataType: "json",
5726
+ data: JSON.stringify({
5727
+ format,
5728
+ deviceInfo,
5729
+ useCache,
5730
+ baseDocumentID,
5731
+ actionID
5732
+ })
5733
+ }, settings));
5755
5734
  }).then(function(documentData) {
5756
5735
  return documentData.documentId;
5757
5736
  });
5758
5737
  },
5738
+ // eslint-disable-next-line max-params
5759
5739
  sendDocument: function(clientID, instanceID, documentID, mailArgs, settings) {
5760
5740
  validateClientID(clientID);
5741
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/send`;
5761
5742
  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);
5743
+ return _ajax(endPoint, __spreadValues({
5744
+ headers: getHeaders(authorizationToken),
5745
+ method: HTTP_POST,
5746
+ contentType: JSON_CONTENT_TYPE,
5747
+ data: JSON.stringify({
5748
+ from: mailArgs.from,
5749
+ to: mailArgs.to,
5750
+ cc: mailArgs.cc,
5751
+ subject: mailArgs.subject,
5752
+ body: mailArgs.body
5753
+ })
5754
+ }, settings));
5784
5755
  });
5785
5756
  },
5786
5757
  deleteReportDocument: function(clientID, instanceID, documentID, settings) {
5787
5758
  validateClientID(clientID);
5759
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5788
5760
  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);
5761
+ return _ajax(endPoint, __spreadValues({
5762
+ headers: getHeaders(authorizationToken),
5763
+ method: HTTP_DELETE
5764
+ }, settings));
5801
5765
  });
5802
5766
  },
5803
5767
  getDocumentInfo: function(clientID, instanceID, documentID, settings) {
5804
5768
  validateClientID(clientID);
5769
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/info`;
5805
5770
  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);
5771
+ return _ajax(endPoint, __spreadValues({
5772
+ headers: getHeaders(authorizationToken),
5773
+ method: HTTP_GET,
5774
+ dataType: "json"
5775
+ }, settings));
5823
5776
  });
5824
5777
  },
5778
+ // eslint-disable-next-line max-params
5825
5779
  getPage: function(clientID, instanceID, documentID, pageNumber, settings) {
5826
5780
  validateClientID(clientID);
5781
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/pages/${pageNumber}`;
5827
5782
  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);
5783
+ return _ajax(endPoint, __spreadValues({
5784
+ headers: getHeaders(authorizationToken),
5785
+ method: HTTP_GET,
5786
+ dataType: "json"
5787
+ }, settings));
5846
5788
  });
5847
5789
  },
5848
5790
  get: function(url) {
5849
- var ajaxSettings = {
5850
- type: HTTP_GET,
5851
- url
5852
- };
5853
- return _ajax(ajaxSettings);
5791
+ return _ajax(url, {
5792
+ method: HTTP_GET
5793
+ });
5854
5794
  },
5855
5795
  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
- );
5796
+ var url = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}`;
5864
5797
  if (queryString) {
5865
5798
  url += "?" + queryString;
5866
5799
  }
5867
5800
  return url;
5868
5801
  },
5869
5802
  getDocumentFormats: function(settings) {
5803
+ const endPoint = `${baseUrl}/formats`;
5870
5804
  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);
5805
+ return _ajax(endPoint, __spreadValues({
5806
+ headers: getHeaders(authorizationToken),
5807
+ method: HTTP_GET,
5808
+ dataType: "json"
5809
+ }, settings));
5882
5810
  });
5883
5811
  },
5884
5812
  getServiceVersion: function(settings) {
5813
+ const endPoint = `${baseUrl}/version`;
5885
5814
  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);
5815
+ return _ajax(endPoint, __spreadValues({
5816
+ headers: getHeaders(authorizationToken),
5817
+ method: HTTP_GET,
5818
+ dataType: "json"
5819
+ }, settings));
5897
5820
  });
5898
5821
  },
5822
+ // eslint-disable-next-line max-params
5899
5823
  getResource: function(clientID, instanceID, documentID, resourceID, settings) {
5900
5824
  validateClientID(clientID);
5825
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/resources/${resourceID}`;
5901
5826
  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);
5827
+ return _ajax(endPoint, __spreadValues({
5828
+ headers: getHeaders(authorizationToken),
5829
+ method: HTTP_GET,
5830
+ dataType: (settings == null ? void 0 : settings.dataType) || "json"
5831
+ }, settings));
5920
5832
  });
5921
5833
  },
5834
+ // eslint-disable-next-line max-params
5922
5835
  getSearchResults: function(clientID, instanceID, documentID, searchToken, matchCase, matchWholeWord, useRegex, settings) {
5923
5836
  validateClientID(clientID);
5924
- var searchUrl = urlFromTemplate(
5925
- "{baseUrl}/clients/{clientID}/instances/{instanceID}/documents/{documentID}/search",
5926
- {
5927
- clientID,
5928
- instanceID,
5929
- documentID
5930
- }
5931
- );
5837
+ const endPoint = `${baseUrl}/clients/${clientID}/instances/${instanceID}/documents/${documentID}/search`;
5932
5838
  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);
5839
+ return _ajax(endPoint, __spreadValues({
5840
+ headers: getHeaders(authorizationToken),
5841
+ method: HTTP_POST,
5842
+ contentType: JSON_CONTENT_TYPE,
5843
+ dataType: "json",
5844
+ data: JSON.stringify({
5845
+ searchToken,
5846
+ matchCase,
5847
+ matchWholeWord,
5848
+ useRegularExpressions: useRegex
5849
+ })
5850
+ }, settings));
5952
5851
  });
5953
5852
  },
5954
5853
  setAccessToken: function(accessToken) {
@@ -5956,29 +5855,21 @@ var telerikReportViewer = (function (exports) {
5956
5855
  },
5957
5856
  login,
5958
5857
  keepClientAlive: function(clientID, settings) {
5858
+ const endPoint = `${baseUrl}/clients/keepAlive/${clientID}`;
5959
5859
  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);
5860
+ return _ajax(endPoint, __spreadValues({
5861
+ headers: getHeaders(authorizationToken),
5862
+ method: HTTP_POST
5863
+ }, settings));
5969
5864
  });
5970
5865
  },
5971
5866
  getClientsSessionTimeoutSeconds: function(settings) {
5867
+ const endPoint = `${baseUrl}/clients/sessionTimeout`;
5972
5868
  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);
5869
+ return _ajax(endPoint, __spreadValues({
5870
+ headers: getHeaders(authorizationToken),
5871
+ method: HTTP_GET
5872
+ }, settings));
5982
5873
  }).then(function(sessionTimeoutData) {
5983
5874
  return sessionTimeoutData.clientSessionTimeout;
5984
5875
  });
@@ -6159,8 +6050,8 @@ var telerikReportViewer = (function (exports) {
6159
6050
  }
6160
6051
  function setNodeAccessibilityAttributes(node) {
6161
6052
  var $items = $(node).find("li");
6162
- each($items, function() {
6163
- var $li = $(this);
6053
+ Array.from($items).forEach((item) => {
6054
+ var $li = $(item);
6164
6055
  $li.attr("aria-label", $li[0].innerText);
6165
6056
  });
6166
6057
  }
@@ -6192,8 +6083,8 @@ var telerikReportViewer = (function (exports) {
6192
6083
  treeView.bind("expand", onTreeViewNodeExpand);
6193
6084
  treeView.element.attr("aria-label", stringResources.ariaLabelDocumentMap);
6194
6085
  var listItems = treeView.element.find("ul");
6195
- each(listItems, function() {
6196
- setNodeAccessibilityAttributes(this);
6086
+ Array.from(listItems).forEach((list) => {
6087
+ setNodeAccessibilityAttributes(list);
6197
6088
  });
6198
6089
  if (documentMapNecessary) {
6199
6090
  setSplitbarAccessibilityAttributes();
@@ -6270,14 +6161,6 @@ var telerikReportViewer = (function (exports) {
6270
6161
  $documentMapOverlay.attr("aria-label", stringResources[$documentMapOverlay.attr("aria-label")]);
6271
6162
  }
6272
6163
  }
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
6164
 
6282
6165
  var defaultOptions$2 = {};
6283
6166
  var Events = {
@@ -6430,12 +6313,8 @@ var telerikReportViewer = (function (exports) {
6430
6313
  }
6431
6314
  }
6432
6315
  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;
6316
+ var factory = Array.from(parameterEditors).find((editor) => {
6317
+ return editor.match(parameter, editorsType);
6439
6318
  });
6440
6319
  return factory;
6441
6320
  }
@@ -6447,23 +6326,21 @@ var telerikReportViewer = (function (exports) {
6447
6326
  (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
6448
6327
  }
6449
6328
  function allParametersAutoRefresh() {
6450
- var allAuto = true;
6451
- each(parameters, function() {
6452
- return allAuto = !this.isVisible || this.autoRefresh;
6329
+ var allAuto = Array.from(parameters).every((parameter) => {
6330
+ return !parameter.isVisible || parameter.autoRefresh;
6453
6331
  });
6454
6332
  return allAuto;
6455
6333
  }
6456
6334
  function allParametersValid() {
6457
- var allValid = true;
6458
- each(parameters, function() {
6459
- return allValid = !this.Error;
6335
+ var allValid = Array.from(parameters).every((parameter) => {
6336
+ return !parameter.Error;
6460
6337
  });
6461
6338
  return allValid;
6462
6339
  }
6463
6340
  function clearEditors() {
6464
- each(editors, function() {
6465
- if (this.hasOwnProperty("destroy")) {
6466
- this.destroy();
6341
+ Object.entries(editors).forEach(([key, editor]) => {
6342
+ if (typeof editor.destroy === "function") {
6343
+ editor.destroy();
6467
6344
  }
6468
6345
  });
6469
6346
  editors = {};
@@ -6475,26 +6352,26 @@ var telerikReportViewer = (function (exports) {
6475
6352
  clearEditors();
6476
6353
  var $parameterContainer;
6477
6354
  var $tempContainer = $("<div></div>");
6478
- each(parameters, function() {
6355
+ Array.from(parameters).forEach((parameter) => {
6479
6356
  try {
6480
- this.value = ParameterValidators.validate(this, this.value);
6357
+ parameter.value = ParameterValidators.validate(parameter, parameter.value);
6481
6358
  } catch (e) {
6482
- this.Error = this.Error || e;
6359
+ parameter.Error = parameter.Error || e;
6483
6360
  }
6484
- var hasError = Boolean(this.Error);
6361
+ var hasError = Boolean(parameter.Error);
6485
6362
  var hasValue = !hasError;
6486
6363
  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 };
6490
- } else {
6491
- processedParameterValues[this.id] = this.value;
6492
- }
6364
+ recentParameterValues[parameter.id] = parameter.value;
6365
+ } else {
6366
+ parameter.Error = stringResources.invalidParameter;
6367
+ }
6368
+ if (parameter.availableValues) {
6369
+ processedParameterValues[parameter.id] = { valueMember: parameter.value, displayMember: parameter.label, availableValues: parameter.availableValues, multivalue: parameter.multivalue };
6493
6370
  } else {
6494
- this.Error = stringResources.invalidParameter;
6371
+ processedParameterValues[parameter.id] = parameter.value;
6495
6372
  }
6496
- if (this.isVisible || options.showHiddenParameters) {
6497
- $parameterContainer = createParameterUI(this);
6373
+ if (parameter.isVisible || options.showHiddenParameters) {
6374
+ $parameterContainer = createParameterUI(parameter);
6498
6375
  if ($parameterContainer) {
6499
6376
  $tempContainer.append($parameterContainer);
6500
6377
  }
@@ -6503,17 +6380,17 @@ var telerikReportViewer = (function (exports) {
6503
6380
  if (initialParameterValues !== void 0) {
6504
6381
  if (null === initialParameterValues) {
6505
6382
  initialParameterValues = {};
6506
- each(parameters, function() {
6507
- if (this.isVisible) {
6508
- initialParameterValues[this.id] = this.value;
6383
+ Array.from(parameters).forEach((parameter) => {
6384
+ if (parameter.isVisible) {
6385
+ initialParameterValues[parameter.id] = parameter.value;
6509
6386
  } else {
6510
- delete recentParameterValues[this.id];
6387
+ delete recentParameterValues[parameter.id];
6511
6388
  }
6512
6389
  });
6513
6390
  } else {
6514
- each(parameters, function() {
6515
- if (!(this.id in initialParameterValues)) {
6516
- delete recentParameterValues[this.id];
6391
+ Array.from(parameters).forEach((parameter) => {
6392
+ if (!(parameter.id in initialParameterValues)) {
6393
+ delete recentParameterValues[parameter.id];
6517
6394
  }
6518
6395
  });
6519
6396
  }
@@ -6556,7 +6433,7 @@ var telerikReportViewer = (function (exports) {
6556
6433
  }
6557
6434
  function invalidateChildParameters(parameter) {
6558
6435
  if (parameter.childParameters) {
6559
- each(parameter.childParameters, function(index, parameterId) {
6436
+ Array.from(parameter.childParameters).forEach((parameterId) => {
6560
6437
  var childParameter = getParameterById(parameterId);
6561
6438
  if (childParameter) {
6562
6439
  invalidateChildParameters(childParameter);
@@ -6615,12 +6492,10 @@ var telerikReportViewer = (function (exports) {
6615
6492
  if (!params || null === params) {
6616
6493
  return false;
6617
6494
  }
6618
- var result = false;
6619
- each(params, function() {
6620
- result = this.isVisible;
6621
- return !result;
6495
+ var hasVisible = Array.from(params).some((parameter) => {
6496
+ return parameter.isVisible;
6622
6497
  });
6623
- return result;
6498
+ return hasVisible;
6624
6499
  }
6625
6500
  var loadingCount = 0;
6626
6501
  function beginLoad() {
@@ -6753,6 +6628,9 @@ var telerikReportViewer = (function (exports) {
6753
6628
  parametersReady: function() {
6754
6629
  return eventFactory(Events.PARAMETERS_READY, arguments);
6755
6630
  },
6631
+ fill: function(parameters2) {
6632
+ return fill(parameters2);
6633
+ },
6756
6634
  setParameters: function(parameterValues) {
6757
6635
  initialParameterValues = null === parameterValues ? null : $.extend({}, parameterValues);
6758
6636
  }
@@ -6760,14 +6638,6 @@ var telerikReportViewer = (function (exports) {
6760
6638
  );
6761
6639
  return parametersArea;
6762
6640
  }
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
6641
 
6772
6642
  var lastSelectedMenuItem;
6773
6643
  var lastSelectedSubmenuItem;
@@ -6812,9 +6682,9 @@ var telerikReportViewer = (function (exports) {
6812
6682
  replaceStringResources();
6813
6683
  }
6814
6684
  function setTabIndexes() {
6815
- var $menus = $.find('[data-role="telerik_ReportViewer_MainMenu"]');
6816
- each($menus, function() {
6817
- var $menuArea = $(this);
6685
+ var $menus = $('[data-role="telerik_ReportViewer_MainMenu"]');
6686
+ Array.from($menus).forEach((menu2) => {
6687
+ var $menuArea = $(menu2);
6818
6688
  var listItems = $menuArea.find("li");
6819
6689
  var menuTabIndex = 0;
6820
6690
  var tabIndexAttr = $menuArea.attr("tabIndex");
@@ -6832,13 +6702,13 @@ var telerikReportViewer = (function (exports) {
6832
6702
  });
6833
6703
  }
6834
6704
  function setMenuItemsTabIndexes(listItems, menuTabIndex) {
6835
- each(listItems, function() {
6836
- var $item = $(this);
6705
+ Array.from(listItems).forEach((item) => {
6706
+ var $item = $(item);
6837
6707
  $item.attr("tabindex", menuTabIndex);
6838
- $item.focus(function() {
6708
+ $item.on("focus", (event) => {
6839
6709
  $item.addClass("k-focus");
6840
6710
  });
6841
- $item.blur(function() {
6711
+ $item.on("blur", (event) => {
6842
6712
  $item.removeClass("k-focus");
6843
6713
  });
6844
6714
  var anchor = $item.children("a");
@@ -6857,16 +6727,15 @@ var telerikReportViewer = (function (exports) {
6857
6727
  });
6858
6728
  }
6859
6729
  function fillFormats(formats) {
6860
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
6861
- var $list = $(this);
6730
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
6731
+ var $list = $(list);
6862
6732
  var $parent = $list.parents("li");
6863
6733
  var tabIndex = enableAccessibility ? $parent.attr("tabindex") : -1;
6864
6734
  if (!tabIndex) {
6865
6735
  tabIndex = 1;
6866
6736
  }
6867
6737
  $list.empty();
6868
- each(formats, function() {
6869
- var format = this;
6738
+ Array.from(formats).forEach((format) => {
6870
6739
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
6871
6740
  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
6741
  menu.append(li, $parent);
@@ -6877,10 +6746,10 @@ var telerikReportViewer = (function (exports) {
6877
6746
  });
6878
6747
  }
6879
6748
  function setInternalListAccessibilityKeyEvents(listItems) {
6880
- each(listItems, function() {
6881
- var $item = $(this);
6749
+ Array.from(listItems).forEach((item) => {
6750
+ var $item = $(item);
6882
6751
  $item.off("keydown");
6883
- $item.on("keydown", function(event) {
6752
+ $item.on("keydown", (event) => {
6884
6753
  switch (event.which) {
6885
6754
  case kendo.keys.ENTER:
6886
6755
  clickOnMenuItem($item);
@@ -6888,17 +6757,17 @@ var telerikReportViewer = (function (exports) {
6888
6757
  case kendo.keys.UP:
6889
6758
  var $prev = $item.prev();
6890
6759
  if ($prev.length > 0) {
6891
- $prev.focus();
6760
+ $prev.trigger("focus");
6892
6761
  } else {
6893
- $item.parents("li").focus();
6762
+ $item.parents("li").trigger("focus");
6894
6763
  }
6895
6764
  break;
6896
6765
  case kendo.keys.DOWN:
6897
6766
  var $next = $item.next();
6898
6767
  if ($next.length > 0) {
6899
- $next.focus();
6768
+ $next.trigger("focus");
6900
6769
  } else {
6901
- $item.parent().children("li").first().focus();
6770
+ $item.parent().children("li").first().trigger("focus");
6902
6771
  }
6903
6772
  break;
6904
6773
  }
@@ -7062,12 +6931,12 @@ var telerikReportViewer = (function (exports) {
7062
6931
  if (!menuAreas) {
7063
6932
  return;
7064
6933
  }
7065
- each(menuAreas, function() {
7066
- var $menu = $(this);
6934
+ Array.from(menuAreas).forEach((menu2) => {
6935
+ var $menu = $(menu2);
7067
6936
  var menuItems = $menu.children("li.k-item");
7068
6937
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
7069
- each(menuItems, function() {
7070
- var $menuItem = $(this);
6938
+ Array.from(menuItems).forEach((menuItem) => {
6939
+ var $menuItem = $(menuItem);
7071
6940
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
7072
6941
  if (!$menuItem.hasClass("trv-report-pager")) {
7073
6942
  var $a = $menuItem.find("a");
@@ -7081,158 +6950,196 @@ var telerikReportViewer = (function (exports) {
7081
6950
  });
7082
6951
  }
7083
6952
  function findMenuArea() {
7084
- return findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
6953
+ return $("ul[data-role=telerik_ReportViewer_MainMenu]");
7085
6954
  }
7086
6955
  }
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
6956
 
7096
6957
  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.";
6958
+ function replaceStringResources$1($search) {
6959
+ if (!$search) {
6960
+ return;
7136
6961
  }
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) {
6962
+ var $searchCaption = $search.find(".trv-search-dialog-caption-label");
6963
+ var $searchOptions = $search.find(".trv-search-dialog-search-options");
6964
+ var $searchStopButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_StopSearch']");
6965
+ var $searchMatchCaseButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchCase']");
6966
+ var $searchMatchWholeWordButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_MatchWholeWord']");
6967
+ var $searchUseRegexButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_UseRegex']");
6968
+ var $searchNavigateUpButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateUp']");
6969
+ var $searchNavigateDownButton = $search.find("a[data-command='telerik_ReportViewer_searchDialog_NavigateDown']");
6970
+ replaceAttribute$1($search, "aria-label");
6971
+ replaceAttribute$1($searchOptions, "aria-label");
6972
+ replaceText$1($searchCaption);
6973
+ replaceTitleAndAriaLabel($searchStopButton);
6974
+ replaceTitleAndAriaLabel($searchMatchCaseButton);
6975
+ replaceTitleAndAriaLabel($searchMatchWholeWordButton);
6976
+ replaceTitleAndAriaLabel($searchUseRegexButton);
6977
+ replaceTitleAndAriaLabel($searchNavigateUpButton);
6978
+ replaceTitleAndAriaLabel($searchNavigateDownButton);
6979
+ }
6980
+ function replaceTitleAndAriaLabel($a) {
6981
+ replaceAttribute$1($a, "title");
6982
+ replaceAttribute$1($a, "aria-label");
6983
+ }
6984
+ function replaceText$1($el) {
6985
+ if ($el) {
6986
+ $el.text(stringResources[$el.text()]);
6987
+ }
6988
+ }
6989
+ function replaceAttribute$1($el, attribute) {
6990
+ if ($el) {
6991
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
6992
+ }
6993
+ }
6994
+ class Search {
6995
+ constructor(element, options, viewerOptions) {
6996
+ this.options = $.extend({}, defaultOptions$1, options);
6997
+ this.viewerOptions = viewerOptions;
6998
+ this.element = element;
6999
+ this.controller = this.options.controller;
7000
+ this.initialized = false;
7001
+ this.dialogVisible = false;
7002
+ this.$element;
7003
+ this.$inputBox;
7004
+ this.$searchOptionsPlaceholder;
7005
+ this.searchOptionsMenu;
7006
+ this.$stopSearchPlaceholder;
7007
+ this.stopSearchMenu;
7008
+ this.$navigationPlaceholder;
7009
+ this.navigationMenu;
7010
+ this.$resultsLabel;
7011
+ this.$resultsPlaceholder;
7012
+ this.kendoComboBox;
7013
+ this.kendoSearchDialog;
7014
+ this.stopSearchCommand;
7015
+ this.optionsCommandSet;
7016
+ this.navigationCommandSet;
7017
+ this.searchResults;
7018
+ this.mruList = [];
7019
+ this.inputComboRebinding;
7020
+ this.searchMetadataRequested;
7021
+ this.searchMetadataLoaded;
7022
+ this.pendingHighlightItem;
7023
+ this.windowLocation;
7024
+ this.reportViewerWrapper = $("[data-selector='" + this.viewerOptions.viewerSelector + "']").find(".trv-report-viewer");
7025
+ this.lastSearch = "";
7026
+ this.highlightManager = {
7027
+ // the results that are found, but not selected (highlighted)
7028
+ shadedClassName: "trv-search-dialog-shaded-result",
7029
+ // the result that is currently selected (highlighted)
7030
+ highlightedClassName: "trv-search-dialog-highlighted-result",
7031
+ current: null,
7032
+ elements: []
7033
+ };
7034
+ if (!this.controller) {
7035
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
7036
+ }
7037
+ this.controller.pageReady(this.onPageReady.bind(this)).scrollPageReady(this.onPageReady.bind(this)).beginLoadReport(this.closeAndClear.bind(this)).viewModeChanged(this.closeAndClear.bind(this));
7038
+ this.controller.setSendEmailDialogVisible((event, args) => {
7039
+ if (args.visible && this.dialogVisible) {
7040
+ this.toggle(!this.dialogVisible);
7041
+ }
7042
+ }).getSearchDialogState((event, args) => {
7043
+ args.visible = this.dialogVisible;
7044
+ }).setSearchDialogVisible((event, args) => {
7045
+ this.toggleSearchDialog(args.visible);
7046
+ });
7047
+ $(window).on("resize", () => {
7048
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7049
+ this.storeDialogPosition();
7050
+ this.adjustDialogPosition();
7051
+ }
7052
+ });
7053
+ }
7054
+ closeAndClear() {
7055
+ if (this.searchMetadataRequested) {
7149
7056
  return;
7150
7057
  }
7151
- toggle(false);
7152
- searchMetadataLoaded = false;
7058
+ this.toggle(false);
7059
+ this.searchMetadataLoaded = false;
7153
7060
  }
7154
- function toggleSearchDialog(show) {
7155
- dialogVisible = show;
7061
+ toggleSearchDialog(show) {
7062
+ this.dialogVisible = show;
7156
7063
  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;
7064
+ var searchMetadataOnDemand = this.viewerOptions.searchMetadataOnDemand;
7065
+ if (searchMetadataOnDemand && !this.searchMetadataLoaded) {
7066
+ this.searchMetadataRequested = true;
7067
+ this.controller.reportLoadComplete((event, args) => {
7068
+ if (this.searchMetadataRequested) {
7069
+ this.toggle(true);
7070
+ this.searchMetadataRequested = false;
7164
7071
  }
7165
7072
  });
7166
- controller.refreshReport(true);
7073
+ this.controller.refreshReport(true);
7167
7074
  return;
7168
7075
  }
7169
7076
  }
7170
- toggle(show);
7077
+ this.toggle(show);
7171
7078
  }
7172
- function toggle(show) {
7173
- dialogVisible = show;
7079
+ toggle(show) {
7080
+ this.dialogVisible = show;
7174
7081
  if (show) {
7175
- searchMetadataLoaded = true;
7176
- ensureInitialized();
7177
- kendoSearchDialog.open();
7178
- kendoComboBox.value("");
7179
- updateResultsUI(null);
7180
- toggleErrorLabel(false, null);
7082
+ this.searchMetadataLoaded = true;
7083
+ this.ensureInitialized();
7084
+ this.kendoSearchDialog.open();
7085
+ this.kendoComboBox.value("");
7086
+ this.updateResultsUI(null);
7087
+ this.toggleErrorLabel(false, null);
7181
7088
  } else {
7182
- clearColoredItems();
7183
- if (kendoSearchDialog && kendoSearchDialog.options.visible) {
7184
- kendoSearchDialog.close();
7089
+ this.clearColoredItems();
7090
+ if (this.kendoSearchDialog && this.kendoSearchDialog.options.visible) {
7091
+ this.kendoSearchDialog.close();
7185
7092
  }
7186
7093
  }
7187
7094
  }
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);
7095
+ ensureInitialized() {
7096
+ if (!this.initialized) {
7097
+ this.$element = $(this.element);
7098
+ this.$inputBox = this.$element.find(".trv-search-dialog-input-box");
7099
+ this.$resultsLabel = this.$element.find(".trv-search-dialog-results-label");
7100
+ this.$resultsPlaceholder = this.$element.find(".trv-search-dialog-results-area");
7101
+ this.initResultsArea();
7102
+ replaceStringResources$1(this.$element);
7196
7103
  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");
7104
+ this.$searchOptionsPlaceholder = this.$element.find(".trv-search-dialog-search-options").kendoMenu();
7105
+ this.$stopSearchPlaceholder = this.$element.find(".trv-search-dialog-stopsearch-placeholder").kendoMenu();
7106
+ this.$navigationPlaceholder = this.$element.find(".trv-search-dialog-navigational-buttons").kendoMenu();
7107
+ } catch (error) {
7108
+ console.error("Instantiation of Kendo Menu for Search Dialog threw an exception", error);
7109
+ throw error;
7110
+ }
7111
+ this.searchOptionsMenu = this.$searchOptionsPlaceholder.data("kendoMenu");
7112
+ this.stopSearchMenu = this.$stopSearchPlaceholder.data("kendoMenu");
7113
+ this.navigationMenu = this.$navigationPlaceholder.data("kendoMenu");
7114
+ this.searchOptionsMenu.element.on("keydown", this.onKeyDown);
7115
+ this.stopSearchMenu.element.on("keydown", this.onKeyDown);
7116
+ this.navigationMenu.element.on("keydown", this.onKeyDown);
7117
+ this.overrideDefaultMenuStyling(".trv-search-dialog-search-options");
7211
7118
  try {
7212
- kendoComboBox = $inputBox.kendoComboBox({
7119
+ this.kendoComboBox = this.$inputBox.kendoComboBox({
7213
7120
  dataTextField: "value",
7214
7121
  dataValueField: "value",
7215
- dataSource: mruList,
7122
+ dataSource: this.mruList,
7216
7123
  contentElement: "",
7217
- change: kendoComboBoxSelect,
7124
+ change: this.kendoComboBoxSelect.bind(this),
7218
7125
  ignoreCase: false,
7219
- filtering: onInputFiltering,
7220
- //the actual search-when-typing performs on this event.
7126
+ // the actual search-when-typing performs on this event.
7127
+ filtering: this.onInputFiltering.bind(this),
7221
7128
  filter: "startswith",
7222
7129
  delay: 1e3,
7223
- open: function(e) {
7224
- if (inputComboRebinding) {
7225
- e.preventDefault();
7130
+ open: (event) => {
7131
+ if (this.inputComboRebinding) {
7132
+ event.preventDefault();
7226
7133
  }
7227
7134
  },
7228
- select: processComboBoxEvent
7135
+ select: this.processComboBoxEvent.bind(this)
7229
7136
  }).data("kendoComboBox");
7230
- } catch (e) {
7231
- console.error("Instantiation of Kendo ComboBox as search input threw an exception", e);
7232
- throw e;
7137
+ } catch (error) {
7138
+ console.error("Instantiation of Kendo ComboBox as search input threw an exception", error);
7139
+ throw error;
7233
7140
  }
7234
7141
  try {
7235
- kendoSearchDialog = reportViewerWrapper.find(".trv-search-window").kendoWindow({
7142
+ this.kendoSearchDialog = this.reportViewerWrapper.find(".trv-search-window").kendoWindow({
7236
7143
  title: stringResources.searchDialogTitle,
7237
7144
  height: 390,
7238
7145
  width: 310,
@@ -7240,38 +7147,38 @@ var telerikReportViewer = (function (exports) {
7240
7147
  minHeight: 390,
7241
7148
  maxHeight: 700,
7242
7149
  scrollable: false,
7243
- close: function() {
7244
- storeDialogPosition();
7245
- lastSearch = "";
7150
+ close: () => {
7151
+ this.storeDialogPosition();
7152
+ this.lastSearch = "";
7246
7153
  },
7247
- open: function() {
7248
- adjustDialogPosition();
7154
+ open: () => {
7155
+ this.adjustDialogPosition();
7249
7156
  },
7250
- deactivate: function() {
7251
- controller.setSearchDialogVisible({
7157
+ deactivate: () => {
7158
+ this.controller.setSearchDialogVisible({
7252
7159
  visible: false
7253
7160
  });
7254
7161
  },
7255
- activate: function() {
7256
- kendoComboBox.input.focus();
7162
+ activate: () => {
7163
+ this.kendoComboBox.input.focus();
7257
7164
  }
7258
7165
  }).data("kendoWindow");
7259
- } catch (e) {
7260
- console.error("Instantiation of Kendo Window for Search dialog threw an exception", e);
7261
- throw e;
7166
+ } catch (error) {
7167
+ console.error("Instantiation of Kendo Window for Search dialog threw an exception", error);
7168
+ throw error;
7262
7169
  }
7263
- kendoSearchDialog.wrapper.addClass("trv-search");
7264
- initCommands();
7265
- initialized = true;
7170
+ this.kendoSearchDialog.wrapper.addClass("trv-search");
7171
+ this.initCommands();
7172
+ this.initialized = true;
7266
7173
  }
7267
7174
  }
7268
- function overrideDefaultMenuStyling(kendoMenuSelector) {
7175
+ overrideDefaultMenuStyling(kendoMenuSelector) {
7269
7176
  var menuItems = $(kendoMenuSelector).find(".k-menu-item");
7270
7177
  for (var i = 0; i < menuItems.length; i++) {
7271
7178
  $(menuItems[i]).removeClass("k-item");
7272
7179
  }
7273
7180
  }
7274
- function onKeyDown(event) {
7181
+ onKeyDown(event) {
7275
7182
  var item = $(event.target).find(".k-focus");
7276
7183
  if (event.keyCode === 13 && item && item.length > 0) {
7277
7184
  var anchor = item.children("a");
@@ -7280,44 +7187,38 @@ var telerikReportViewer = (function (exports) {
7280
7187
  }
7281
7188
  }
7282
7189
  }
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();
7190
+ storeDialogPosition() {
7191
+ var kendoWindow = this.kendoSearchDialog.element.parent(".k-window");
7192
+ this.windowLocation = kendoWindow.offset();
7292
7193
  }
7293
- function adjustDialogPosition() {
7194
+ adjustDialogPosition() {
7294
7195
  var windowWidth = $(window).innerWidth();
7295
7196
  var windowHeight = $(window).innerHeight();
7296
- var kendoWindow = kendoSearchDialog.wrapper;
7197
+ var kendoWindow = this.kendoSearchDialog.wrapper;
7297
7198
  var width = kendoWindow.outerWidth(true);
7298
7199
  var height = kendoWindow.outerHeight(true);
7299
7200
  var padding = 10;
7300
- if (!windowLocation) {
7301
- var reportViewerCoords = reportViewerWrapper[0].getBoundingClientRect();
7201
+ if (!this.windowLocation) {
7202
+ var reportViewerCoords = this.reportViewerWrapper[0].getBoundingClientRect();
7302
7203
  kendoWindow.css({
7303
7204
  top: reportViewerCoords.top + padding,
7304
7205
  left: reportViewerCoords.right - width - padding
7305
7206
  });
7306
- kendoSearchDialog.setOptions({
7207
+ this.kendoSearchDialog.setOptions({
7307
7208
  position: {
7308
7209
  top: reportViewerCoords.top + padding,
7309
7210
  left: reportViewerCoords.right - width - padding
7310
7211
  }
7311
7212
  });
7312
7213
  } else {
7313
- var left = windowLocation.left;
7314
- var top = windowLocation.top;
7214
+ var left = this.windowLocation.left;
7215
+ var top = this.windowLocation.top;
7315
7216
  var right = left + width;
7316
7217
  var bottom = top + height;
7317
7218
  if (right > windowWidth - padding) {
7318
7219
  left = Math.max(padding, windowWidth - width - padding);
7319
7220
  kendoWindow.css({ left });
7320
- kendoSearchDialog.setOptions({
7221
+ this.kendoSearchDialog.setOptions({
7321
7222
  position: {
7322
7223
  left
7323
7224
  }
@@ -7326,7 +7227,7 @@ var telerikReportViewer = (function (exports) {
7326
7227
  if (bottom > windowHeight - padding) {
7327
7228
  top = Math.max(padding, windowHeight - height - padding);
7328
7229
  kendoWindow.css({ top });
7329
- kendoSearchDialog.setOptions({
7230
+ this.kendoSearchDialog.setOptions({
7330
7231
  position: {
7331
7232
  top
7332
7233
  }
@@ -7334,272 +7235,251 @@ var telerikReportViewer = (function (exports) {
7334
7235
  }
7335
7236
  }
7336
7237
  }
7337
- function processComboBoxEvent(e) {
7238
+ processComboBoxEvent(event) {
7338
7239
  if (!(window.event || window.event.type)) {
7339
7240
  return;
7340
7241
  }
7341
7242
  var evt = window.event;
7342
7243
  if (evt.type === "keydown") {
7343
- e.preventDefault();
7244
+ event.preventDefault();
7344
7245
  if (evt.keyCode === 40) {
7345
- moveListSelection(1);
7346
- } else if (evt.keyCode === 38) {
7347
- moveListSelection(-1);
7246
+ this.moveListSelection(1);
7247
+ }
7248
+ if (evt.keyCode === 38) {
7249
+ this.moveListSelection(-1);
7348
7250
  }
7349
7251
  }
7350
7252
  }
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
- })
7253
+ initCommands() {
7254
+ this.optionsCommandSet = {
7255
+ "searchDialog_MatchCase": new Command(),
7256
+ "searchDialog_MatchWholeWord": new Command(),
7257
+ "searchDialog_UseRegex": new Command()
7363
7258
  };
7364
- Binder.bind(
7365
- $searchOptionsPlaceholder,
7366
- {
7367
- controller,
7368
- commands: optionsCommandSet
7369
- },
7370
- viewerOptions
7371
- );
7372
- stopSearchCommand = new command(function() {
7373
- stopSearch();
7259
+ Object.entries(this.optionsCommandSet).forEach(([commandName, command]) => {
7260
+ command.exec = () => {
7261
+ this.toggleCommand(command);
7262
+ };
7374
7263
  });
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);
7264
+ Binder.attachCommands(this.$searchOptionsPlaceholder, this.optionsCommandSet, this.viewerOptions);
7265
+ this.stopSearchCommand = new Command(() => {
7266
+ this.stopSearch();
7267
+ });
7268
+ Binder.attachCommands(this.$stopSearchPlaceholder, { "searchDialog_StopSearch": this.stopSearchCommand }, this.viewerOptions);
7269
+ this.navigationCommandSet = {
7270
+ "searchDialog_NavigateUp": new Command(() => {
7271
+ this.moveListSelection(-1);
7386
7272
  }),
7387
- "searchDialog_NavigateDown": new command(function() {
7388
- moveListSelection(1);
7273
+ "searchDialog_NavigateDown": new Command(() => {
7274
+ this.moveListSelection(1);
7389
7275
  })
7390
7276
  };
7391
- Binder.bind(
7392
- $navigationPlaceholder,
7393
- {
7394
- controller,
7395
- commands: navigationCommandSet
7396
- },
7397
- viewerOptions
7398
- );
7277
+ Binder.attachCommands(this.$navigationPlaceholder, this.navigationCommandSet, this.viewerOptions);
7399
7278
  }
7400
- function initResultsArea() {
7279
+ initResultsArea() {
7401
7280
  try {
7402
- $resultsPlaceholder.kendoListView({
7281
+ this.$resultsPlaceholder.kendoListView({
7403
7282
  selectable: true,
7404
7283
  navigatable: true,
7405
7284
  dataSource: {},
7406
7285
  contentElement: "",
7407
7286
  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();
7287
+ change: (event) => {
7288
+ var listView = event.sender;
7289
+ var index = listView.select().index();
7290
+ var view = listView.dataSource.view();
7411
7291
  var dataItem = view[index];
7412
- onSelectedItem(dataItem);
7413
- updateUI(index, view.length);
7292
+ this.onSelectedItem(dataItem);
7293
+ this.updateUI(index, view.length);
7414
7294
  }
7415
7295
  });
7416
- } catch (e) {
7417
- console.error("Instantiation of Kendo ListView as search result area threw an exception", e);
7418
- throw e;
7296
+ } catch (error) {
7297
+ console.error("Instantiation of Kendo ListView as search result area threw an exception", error);
7298
+ throw error;
7419
7299
  }
7420
7300
  }
7421
- function stopSearch() {
7422
- setStopButtonEnabledState(false);
7301
+ stopSearch() {
7302
+ this.setStopButtonEnabledState(false);
7423
7303
  }
7424
- function toggleCommand(cmd) {
7304
+ toggleCommand(cmd) {
7425
7305
  cmd.checked(!cmd.checked());
7426
- searchForCurrentToken();
7306
+ this.searchForCurrentToken();
7427
7307
  }
7428
- function setStopButtonEnabledState(enabledState) {
7429
- stopSearchCommand.enabled(enabledState);
7308
+ setStopButtonEnabledState(enabledState) {
7309
+ this.stopSearchCommand.enabled(enabledState);
7430
7310
  }
7431
- function onPageReady(args, page) {
7432
- if (dialogVisible) {
7433
- colorPageElements(searchResults);
7311
+ onPageReady(args, page) {
7312
+ if (this.dialogVisible) {
7313
+ this.colorPageElements(this.searchResults);
7434
7314
  }
7435
7315
  }
7436
- function onInputFiltering(e) {
7437
- e.preventDefault();
7438
- if (e.filter && e.filter.value !== lastSearch) {
7439
- lastSearch = e.filter.value;
7440
- searchForToken(lastSearch);
7316
+ onInputFiltering(event) {
7317
+ event.preventDefault();
7318
+ if (event.filter && event.filter.value !== this.lastSearch) {
7319
+ this.lastSearch = event.filter.value;
7320
+ this.searchForToken(this.lastSearch);
7441
7321
  }
7442
7322
  }
7443
- function kendoComboBoxSelect(e) {
7444
- var newValue = e.sender.value();
7445
- if (newValue && lastSearch !== newValue) {
7446
- lastSearch = newValue;
7447
- searchForToken(lastSearch);
7323
+ kendoComboBoxSelect(event) {
7324
+ var newValue = event.sender.value();
7325
+ if (newValue && this.lastSearch !== newValue) {
7326
+ this.lastSearch = newValue;
7327
+ this.searchForToken(this.lastSearch);
7448
7328
  }
7449
7329
  }
7450
- function searchForCurrentToken() {
7451
- if (kendoComboBox) {
7452
- searchForToken(kendoComboBox.value());
7330
+ searchForCurrentToken() {
7331
+ if (this.kendoComboBox) {
7332
+ this.searchForToken(this.kendoComboBox.value());
7453
7333
  }
7454
7334
  }
7455
- function searchForToken(token) {
7456
- onSearchStarted();
7457
- addToMRU(token);
7458
- controller.getSearchResults(
7335
+ searchForToken(token) {
7336
+ this.onSearchStarted();
7337
+ this.addToMRU(token);
7338
+ this.controller.getSearchResults(
7459
7339
  {
7460
7340
  searchToken: token,
7461
- matchCase: optionsCommandSet.searchDialog_MatchCase.checked(),
7462
- matchWholeWord: optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7463
- useRegex: optionsCommandSet.searchDialog_UseRegex.checked()
7341
+ matchCase: this.optionsCommandSet.searchDialog_MatchCase.checked(),
7342
+ matchWholeWord: this.optionsCommandSet.searchDialog_MatchWholeWord.checked(),
7343
+ useRegex: this.optionsCommandSet.searchDialog_UseRegex.checked()
7464
7344
  }
7465
- ).then(function(results) {
7466
- updateResultsUI(results, null);
7467
- }).catch(function(errorMessage) {
7345
+ ).then((results) => {
7346
+ this.updateResultsUI(results, null);
7347
+ }).catch((errorMessage) => {
7468
7348
  if (errorMessage) {
7469
- updateResultsUI(null, errorMessage);
7349
+ this.updateResultsUI(null, errorMessage);
7470
7350
  }
7471
7351
  });
7472
7352
  }
7473
- function onSearchStarted() {
7474
- $resultsLabel.text(stringResources.searchDialogSearchInProgress);
7475
- clearColoredItems();
7476
- searchResults = null;
7477
- setStopButtonEnabledState(true);
7478
- toggleErrorLabel(false, null);
7353
+ onSearchStarted() {
7354
+ this.$resultsLabel.text(stringResources.searchDialogSearchInProgress);
7355
+ this.clearColoredItems();
7356
+ this.searchResults = null;
7357
+ this.setStopButtonEnabledState(true);
7358
+ this.toggleErrorLabel(false, null);
7479
7359
  }
7480
- function updateResultsUI(results, error) {
7481
- setStopButtonEnabledState(false);
7360
+ updateResultsUI(results, error) {
7361
+ this.setStopButtonEnabledState(false);
7482
7362
  if (error) {
7483
- toggleErrorLabel(true, error);
7363
+ this.toggleErrorLabel(true, error);
7484
7364
  }
7485
- displayResultsList(results);
7486
- searchResults = results;
7365
+ this.displayResultsList(results);
7366
+ this.searchResults = results;
7487
7367
  if (results && results.length > 0) {
7488
- colorPageElements(results);
7489
- selectFirstElement();
7368
+ this.colorPageElements(results);
7369
+ this.selectFirstElement();
7490
7370
  } else {
7491
- updateUI(-1, 0);
7371
+ this.updateUI(-1, 0);
7492
7372
  }
7493
7373
  }
7494
- function addToMRU(token) {
7374
+ addToMRU(token) {
7495
7375
  if (!token || token === "") {
7496
7376
  return;
7497
7377
  }
7498
- var exists = mruList.filter(function(mru) {
7378
+ var exists = this.mruList.filter((mru) => {
7499
7379
  return mru.value === token;
7500
7380
  });
7501
7381
  if (exists && exists.length > 0) {
7502
7382
  return;
7503
7383
  }
7504
- mruList.unshift({ value: token });
7505
- if (mruList.length > 10) {
7506
- mruList.pop();
7384
+ this.mruList.unshift({ value: token });
7385
+ if (this.mruList.length > 10) {
7386
+ this.mruList.pop();
7507
7387
  }
7508
- inputComboRebinding = true;
7509
- kendoComboBox.dataSource.data(mruList);
7510
- kendoComboBox.select(function(item) {
7388
+ this.inputComboRebinding = true;
7389
+ this.kendoComboBox.dataSource.data(this.mruList);
7390
+ this.kendoComboBox.select((item) => {
7511
7391
  return item.value === token;
7512
7392
  });
7513
- inputComboRebinding = false;
7393
+ this.inputComboRebinding = false;
7514
7394
  }
7515
- function displayResultsList(results) {
7516
- var $listView = $resultsPlaceholder.data("kendoListView");
7395
+ displayResultsList(results) {
7396
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7517
7397
  if (!results) {
7518
7398
  results = [];
7519
7399
  }
7520
7400
  $listView.dataSource.data(results);
7521
7401
  }
7522
- function colorPageElements(results) {
7402
+ colorPageElements(results) {
7523
7403
  if (!results || results.length === 0) {
7524
7404
  return;
7525
7405
  }
7526
- var $parent = $placeholder.parent();
7406
+ var $parent = this.$element.parent();
7527
7407
  var $pageContainer = $parent.find(".trv-page-container");
7528
7408
  var elements = $pageContainer.find("[data-search-id]");
7529
- each(results, function() {
7530
- var $searchElement = elements.filter("[data-search-id=" + this.id + "]");
7409
+ Array.from(results).forEach((result) => {
7410
+ var $searchElement = elements.filter("[data-search-id=" + result.id + "]");
7531
7411
  if ($searchElement) {
7532
- $searchElement.addClass(highlightManager.shadedClassName);
7533
- highlightManager.elements.push($searchElement);
7412
+ $searchElement.addClass(this.highlightManager.shadedClassName);
7413
+ this.highlightManager.elements.push($searchElement);
7534
7414
  }
7535
7415
  });
7536
- highlightItem(pendingHighlightItem);
7537
- pendingHighlightItem = null;
7416
+ this.highlightItem(this.pendingHighlightItem);
7417
+ this.pendingHighlightItem = null;
7538
7418
  }
7539
- function highlightItem(item) {
7419
+ highlightItem(item) {
7540
7420
  if (item) {
7541
7421
  var currentItemId = item.id;
7542
- var newHighlighted = $(highlightManager.elements.filter(function(i) {
7422
+ var newHighlighted = $(this.highlightManager.elements.filter((i) => {
7543
7423
  return i.attr("data-search-id") === currentItemId;
7544
7424
  })).first();
7545
7425
  if (newHighlighted) {
7546
- highlightManager.current = newHighlighted[0];
7547
- if (highlightManager.current) {
7426
+ this.highlightManager.current = newHighlighted[0];
7427
+ if (this.highlightManager.current) {
7548
7428
  var current = $("[data-search-id='" + currentItemId + "']");
7549
- current.removeClass(highlightManager.shadedClassName);
7550
- current.addClass(highlightManager.highlightedClassName);
7429
+ current.removeClass(this.highlightManager.shadedClassName);
7430
+ current.addClass(this.highlightManager.highlightedClassName);
7551
7431
  }
7552
7432
  }
7553
7433
  }
7554
7434
  }
7555
- function selectFirstElement() {
7556
- var $listView = $resultsPlaceholder.data("kendoListView");
7435
+ selectFirstElement() {
7436
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7557
7437
  var first = $listView.element.children().first();
7558
7438
  $listView.select(first);
7559
7439
  $listView.trigger("change");
7560
7440
  }
7561
- function onSelectedItem(item) {
7441
+ onSelectedItem(item) {
7562
7442
  if (!item) {
7563
7443
  return;
7564
7444
  }
7565
- if (highlightManager.current) {
7566
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7567
- highlightManager.current.addClass(highlightManager.shadedClassName);
7445
+ if (this.highlightManager.current) {
7446
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7447
+ this.highlightManager.current.addClass(this.highlightManager.shadedClassName);
7568
7448
  }
7569
- if (item.page === controller.getCurrentPageNumber()) {
7570
- highlightItem(item);
7449
+ if (item.page === this.controller.getCurrentPageNumber()) {
7450
+ this.highlightItem(item);
7571
7451
  } else {
7572
- if (controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7573
- clearColoredItems();
7452
+ if (this.controller.getPageMode() !== PageModes.CONTINUOUS_SCROLL) {
7453
+ this.clearColoredItems();
7574
7454
  } else {
7575
- highlightItem(item);
7455
+ this.highlightItem(item);
7576
7456
  }
7577
7457
  }
7578
- pendingHighlightItem = item;
7579
- controller.navigateToPage(item.page, { type: "search", id: item.id });
7458
+ this.pendingHighlightItem = item;
7459
+ this.controller.navigateToPage(item.page, { type: "search", id: item.id });
7580
7460
  }
7581
- function updateUI(index, count) {
7461
+ updateUI(index, count) {
7582
7462
  var str = count === 0 ? stringResources.searchDialogNoResultsLabel : stringFormat(stringResources.searchDialogResultsFormatLabel, [index + 1, count]);
7583
- $resultsLabel.text(str);
7463
+ this.$resultsLabel.text(str);
7584
7464
  var allowMoveUp = index > 0;
7585
7465
  var allowMoveDown = index < count - 1;
7586
- navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7587
- navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7466
+ this.navigationCommandSet.searchDialog_NavigateUp.enabled(allowMoveUp);
7467
+ this.navigationCommandSet.searchDialog_NavigateDown.enabled(allowMoveDown);
7588
7468
  }
7589
- function clearColoredItems() {
7590
- if (highlightManager.elements && highlightManager.elements.length > 0) {
7591
- each(highlightManager.elements, function() {
7592
- this.removeClass(highlightManager.shadedClassName);
7469
+ clearColoredItems() {
7470
+ if (this.highlightManager.elements && this.highlightManager.elements.length > 0) {
7471
+ Array.from(this.highlightManager.elements).forEach(($element) => {
7472
+ $element.removeClass(this.highlightManager.shadedClassName);
7593
7473
  });
7594
7474
  }
7595
- if (highlightManager.current) {
7596
- highlightManager.current.removeClass(highlightManager.highlightedClassName);
7475
+ if (this.highlightManager.current) {
7476
+ this.highlightManager.current.removeClass(this.highlightManager.highlightedClassName);
7597
7477
  }
7598
- highlightManager.elements = [];
7599
- highlightManager.current = null;
7478
+ this.highlightManager.elements = [];
7479
+ this.highlightManager.current = null;
7600
7480
  }
7601
- function moveListSelection(offset) {
7602
- var $listView = $resultsPlaceholder.data("kendoListView");
7481
+ moveListSelection(offset) {
7482
+ var $listView = this.$resultsPlaceholder.data("kendoListView");
7603
7483
  var $selected = $listView.select();
7604
7484
  if (!$selected) {
7605
7485
  $selected = $listView.element.children().first();
@@ -7615,12 +7495,12 @@ var telerikReportViewer = (function (exports) {
7615
7495
  if (element) {
7616
7496
  $listView.select(element);
7617
7497
  $listView.trigger("change");
7618
- scrollIfNeeded(element[0], $listView.element[0]);
7498
+ this.scrollIfNeeded(element[0], $listView.element[0]);
7619
7499
  }
7620
7500
  }
7621
7501
  }
7622
7502
  }
7623
- function scrollIfNeeded(element, container) {
7503
+ scrollIfNeeded(element, container) {
7624
7504
  if (element.offsetTop - element.clientHeight < container.scrollTop) {
7625
7505
  element.scrollIntoView();
7626
7506
  } else {
@@ -7631,13 +7511,13 @@ var telerikReportViewer = (function (exports) {
7631
7511
  }
7632
7512
  }
7633
7513
  }
7634
- function toggleErrorLabel(show, message) {
7635
- var $errorIcon = $searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7514
+ toggleErrorLabel(show, message) {
7515
+ var $errorIcon = this.$searchOptionsPlaceholder.find("i[data-role='telerik_ReportViewer_SearchDialog_Error']");
7636
7516
  if (!$errorIcon || $errorIcon.length === 0) {
7637
7517
  console.log(message);
7638
7518
  return;
7639
7519
  }
7640
- var menuItem = $searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7520
+ var menuItem = this.$searchOptionsPlaceholder.data("kendoMenu").element.find("li").last();
7641
7521
  if (show) {
7642
7522
  $errorIcon[0].title = message;
7643
7523
  menuItem.show();
@@ -7645,79 +7525,42 @@ var telerikReportViewer = (function (exports) {
7645
7525
  menuItem.hide();
7646
7526
  }
7647
7527
  }
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
7528
  }
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
7529
 
7720
7530
  var defaultOptions = {};
7531
+ function replaceStringResources($sendEmailDialog) {
7532
+ if (!$sendEmailDialog) {
7533
+ return;
7534
+ }
7535
+ var labels = $sendEmailDialog.find(".trv-replace-string");
7536
+ var ariaLabel = $sendEmailDialog.find("[aria-label]");
7537
+ var titles = $sendEmailDialog.find("[title]");
7538
+ if (labels.length) {
7539
+ Array.from(labels).forEach((element) => {
7540
+ replaceText($(element));
7541
+ });
7542
+ }
7543
+ if (ariaLabel.length) {
7544
+ Array.from(ariaLabel).forEach((element) => {
7545
+ replaceAttribute($(element), "aria-label");
7546
+ });
7547
+ }
7548
+ if (titles.length) {
7549
+ Array.from(titles).forEach((element) => {
7550
+ replaceAttribute($(element), "title");
7551
+ });
7552
+ }
7553
+ }
7554
+ function replaceText($el) {
7555
+ if ($el) {
7556
+ $el.text(stringResources[$el.text()]);
7557
+ }
7558
+ }
7559
+ function replaceAttribute($el, attribute) {
7560
+ if ($el) {
7561
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
7562
+ }
7563
+ }
7721
7564
  function SendEmail(placeholder, options, viewerOptions) {
7722
7565
  options = $.extend({}, defaultOptions, options);
7723
7566
  var controller = options.controller;
@@ -7816,9 +7659,9 @@ var telerikReportViewer = (function (exports) {
7816
7659
  }, 250);
7817
7660
  }
7818
7661
  }).data("kendoWindow");
7819
- } catch (e) {
7820
- console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", e);
7821
- throw e;
7662
+ } catch (error) {
7663
+ console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", error);
7664
+ throw error;
7822
7665
  }
7823
7666
  kendoSendEmailDialog.wrapper.addClass("trv-send-email");
7824
7667
  try {
@@ -7832,13 +7675,13 @@ var telerikReportViewer = (function (exports) {
7832
7675
  this.trigger("change");
7833
7676
  }
7834
7677
  }).data("kendoComboBox");
7835
- } catch (e) {
7836
- console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", e);
7837
- throw e;
7678
+ } catch (error) {
7679
+ console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", error);
7680
+ throw error;
7838
7681
  }
7839
- $placeholder.on("keydown", '[name="format_input"]', function(e) {
7682
+ $placeholder.on("keydown", '[name="format_input"]', function(event) {
7840
7683
  var tabkey = 9;
7841
- if (e.keyCode === tabkey && bodyEditor) {
7684
+ if (event.keyCode === tabkey && bodyEditor) {
7842
7685
  setTimeout(function() {
7843
7686
  bodyEditor.focus();
7844
7687
  });
@@ -7871,9 +7714,9 @@ var telerikReportViewer = (function (exports) {
7871
7714
  "superscript"
7872
7715
  ]
7873
7716
  }).data("kendoEditor");
7874
- } catch (e) {
7875
- console.error("Instantiation of Kendo Editor for Email body editor threw an exception", e);
7876
- throw e;
7717
+ } catch (error) {
7718
+ console.error("Instantiation of Kendo Editor for Email body editor threw an exception", error);
7719
+ throw error;
7877
7720
  }
7878
7721
  setDefaultValues(viewerOptions.sendEmail);
7879
7722
  initialized = true;
@@ -7950,22 +7793,14 @@ var telerikReportViewer = (function (exports) {
7950
7793
  }
7951
7794
  function initCommands() {
7952
7795
  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() {
7796
+ "sendEmail_Cancel": new Command(function() {
7955
7797
  closeWindow();
7956
7798
  }),
7957
- "sendEmail_Send": new command(function(e) {
7799
+ "sendEmail_Send": new Command(function() {
7958
7800
  sendingEmail();
7959
7801
  })
7960
7802
  };
7961
- Binder.bind(
7962
- $placeholder.find(".trv-send-email-actions"),
7963
- {
7964
- controller,
7965
- commands: optionsCommandSet
7966
- },
7967
- viewerOptions
7968
- );
7803
+ Binder.attachCommands($placeholder.find(".trv-send-email-actions"), optionsCommandSet, viewerOptions);
7969
7804
  }
7970
7805
  function sendingEmail(cmd, args) {
7971
7806
  var sendEmailArgs = {
@@ -7983,17 +7818,17 @@ var telerikReportViewer = (function (exports) {
7983
7818
  }
7984
7819
  }
7985
7820
  function setValidation() {
7986
- inputFrom.off("blur").on("blur", function(e) {
7821
+ inputFrom.off("blur").on("blur", function(event) {
7987
7822
  if (!isEmpty($(this))) {
7988
7823
  isValidEmail($(this), false);
7989
7824
  }
7990
7825
  });
7991
- inputTo.off("blur").on("blur", function(e) {
7826
+ inputTo.off("blur").on("blur", function(event) {
7992
7827
  if (!isEmpty($(this))) {
7993
7828
  isValidEmail($(this), true);
7994
7829
  }
7995
7830
  });
7996
- inputCC.off("blur").on("blur", function(e) {
7831
+ inputCC.off("blur").on("blur", function(event) {
7997
7832
  if ($(this).val().length) {
7998
7833
  isValidEmail($(this), true);
7999
7834
  } else {
@@ -8052,9 +7887,8 @@ var telerikReportViewer = (function (exports) {
8052
7887
  }
8053
7888
  }
8054
7889
  return true;
8055
- } else {
8056
- return _validateEmail(inputValue, $el);
8057
7890
  }
7891
+ return _validateEmail(inputValue, $el);
8058
7892
  }
8059
7893
  function _validateEmail(email, $el) {
8060
7894
  var regexEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
@@ -8074,74 +7908,7 @@ var telerikReportViewer = (function (exports) {
8074
7908
  function clearValidation() {
8075
7909
  $(".k-invalid-msg").removeClass("-visible");
8076
7910
  }
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
7911
  }
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
7912
 
8146
7913
  function SideMenu(dom, rootOptions, otherOptions) {
8147
7914
  var options = $.extend({}, rootOptions, otherOptions);
@@ -8211,16 +7978,15 @@ var telerikReportViewer = (function (exports) {
8211
7978
  });
8212
7979
  }
8213
7980
  function fillFormats(formats) {
8214
- each($(dom).find("ul[data-command-list=export-format-list]"), function() {
8215
- var $list = $(this);
7981
+ Array.from($(dom).find("ul[data-command-list=export-format-list]")).forEach((list) => {
7982
+ var $list = $(list);
8216
7983
  var $parent = $list.parents("li");
8217
7984
  var tabIndex = $parent.attr("tabindex");
8218
7985
  if (!tabIndex) {
8219
7986
  tabIndex = DEFAULT_TABINDEX;
8220
7987
  }
8221
7988
  $list.empty();
8222
- each(formats, function(i) {
8223
- var format = this;
7989
+ Array.from(formats).forEach((format) => {
8224
7990
  var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
8225
7991
  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
7992
  panelBar.append(li, $parent);
@@ -8230,10 +7996,10 @@ var telerikReportViewer = (function (exports) {
8230
7996
  });
8231
7997
  }
8232
7998
  function enableCloseOnClick(root) {
8233
- each(root.find("li"), function() {
8234
- var isLeaf = $(this).children("ul").length === 0;
7999
+ Array.from(root.find("li")).forEach((listItem) => {
8000
+ var isLeaf = $(listItem).children("ul").length === 0;
8235
8001
  if (isLeaf) {
8236
- $(this).children("a").click(function() {
8002
+ $(listItem).children("a").on("click", (event) => {
8237
8003
  controller.setSideMenuVisible({ visible: !sideMenuVisible });
8238
8004
  });
8239
8005
  }
@@ -8251,21 +8017,21 @@ var telerikReportViewer = (function (exports) {
8251
8017
  function setListItemsTabIndex(list, tabIndex) {
8252
8018
  list.attr("tabindex", tabIndex);
8253
8019
  var items = list.find("li");
8254
- each(items, function() {
8255
- var $item = $(this);
8020
+ Array.from(items).forEach((item) => {
8021
+ var $item = $(item);
8256
8022
  $item.attr("tabindex", tabIndex);
8257
8023
  var anchor = $item.children("a");
8258
8024
  if (anchor.length > 0) {
8259
8025
  var $anchor = $(anchor);
8260
8026
  $anchor.attr("tabindex", -1);
8261
8027
  }
8262
- $item.focus(function() {
8028
+ $item.on("focus", (event) => {
8263
8029
  var anchor2 = $item.children("a");
8264
8030
  if (anchor2.length > 0) {
8265
8031
  anchor2.addClass("k-focus");
8266
8032
  }
8267
8033
  });
8268
- $item.blur(function() {
8034
+ $item.on("blur", (event) => {
8269
8035
  var anchor2 = $item.children("a");
8270
8036
  if (anchor2.length > 0) {
8271
8037
  anchor2.removeClass("k-focus");
@@ -8329,12 +8095,12 @@ var telerikReportViewer = (function (exports) {
8329
8095
  if (!menuAreas) {
8330
8096
  return;
8331
8097
  }
8332
- each(menuAreas, function() {
8333
- var $menu = $(this);
8098
+ Array.from(menuAreas).forEach((menu2) => {
8099
+ var $menu = $(menu2);
8334
8100
  var menuItems = $menu.children("li.k-panelbar-header");
8335
8101
  $menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
8336
- each(menuItems, function() {
8337
- var $menuItem = $(this);
8102
+ Array.from(menuItems).forEach((menuItem) => {
8103
+ var $menuItem = $(menuItem);
8338
8104
  var $a = $menuItem.find("a");
8339
8105
  $menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
8340
8106
  if ($a) {
@@ -8348,22 +8114,14 @@ var telerikReportViewer = (function (exports) {
8348
8114
  });
8349
8115
  }
8350
8116
  function findMenuArea() {
8351
- return findElement("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8117
+ return $("div[data-role=telerik_ReportViewer_SideMenu] > ul");
8352
8118
  }
8353
8119
  }
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
8120
 
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);
8121
+ var __defProp$4 = Object.defineProperty;
8122
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8123
+ var __publicField$4 = (obj, key, value) => {
8124
+ __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
8367
8125
  return value;
8368
8126
  };
8369
8127
  class MemStorage {
@@ -8371,7 +8129,7 @@ var telerikReportViewer = (function (exports) {
8371
8129
  // #region constructor
8372
8130
  constructor() {
8373
8131
  // #region fields
8374
- __publicField$1(this, "_data", {});
8132
+ __publicField$4(this, "_data", {});
8375
8133
  this._data = {};
8376
8134
  }
8377
8135
  // #endregion
@@ -8412,14 +8170,14 @@ var telerikReportViewer = (function (exports) {
8412
8170
  html = replaceAll(html, "{service}/", baseUri);
8413
8171
  html = replaceAll(html, "{service}", baseUri);
8414
8172
  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 ");
8173
+ Array.from(viewerTemplate.find("template")).forEach((element) => {
8174
+ var $element = $(element);
8175
+ templates[$element.attr("id")] = trim($element.html(), "\n ");
8418
8176
  });
8419
- each(viewerTemplate.find("link"), function(index, e) {
8420
- styleSheets.push(trim(e.outerHTML, "\n "));
8177
+ Array.from(viewerTemplate.find("link")).forEach((element) => {
8178
+ styleSheets.push(trim(element.outerHTML, "\n "));
8421
8179
  });
8422
- styleSheets = filterUniqueLastOccurance(styleSheets);
8180
+ styleSheets = filterUniqueLastOccurrence(styleSheets);
8423
8181
  return {
8424
8182
  templates,
8425
8183
  styleSheets
@@ -8431,10 +8189,10 @@ var telerikReportViewer = (function (exports) {
8431
8189
  };
8432
8190
  }();
8433
8191
 
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);
8192
+ var __defProp$3 = Object.defineProperty;
8193
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8194
+ var __publicField$3 = (obj, key, value) => {
8195
+ __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8438
8196
  return value;
8439
8197
  };
8440
8198
  class ReportViewerSettings {
@@ -8442,9 +8200,9 @@ var telerikReportViewer = (function (exports) {
8442
8200
  // #region constructor
8443
8201
  constructor(id, storage, defaultSettings) {
8444
8202
  // #region fields
8445
- __publicField(this, "_id");
8446
- __publicField(this, "_storage");
8447
- __publicField(this, "_defaults");
8203
+ __publicField$3(this, "_id");
8204
+ __publicField$3(this, "_storage");
8205
+ __publicField$3(this, "_defaults");
8448
8206
  this._id = id;
8449
8207
  this._storage = storage;
8450
8208
  this._defaults = defaultSettings || {};
@@ -8564,6 +8322,129 @@ var telerikReportViewer = (function (exports) {
8564
8322
  // #endregion
8565
8323
  }
8566
8324
 
8325
+ var __defProp$2 = Object.defineProperty;
8326
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8327
+ var __publicField$2 = (obj, key, value) => {
8328
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
8329
+ return value;
8330
+ };
8331
+ class BaseComponent {
8332
+ // #endregion
8333
+ // #region constructor
8334
+ constructor(element, options) {
8335
+ // #region fields
8336
+ __publicField$2(this, "element");
8337
+ __publicField$2(this, "$element");
8338
+ __publicField$2(this, "options");
8339
+ this.element = element;
8340
+ this.$element = $(element);
8341
+ this.options = options;
8342
+ }
8343
+ // #endregion
8344
+ }
8345
+
8346
+ var __defProp$1 = Object.defineProperty;
8347
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8348
+ var __publicField$1 = (obj, key, value) => {
8349
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8350
+ return value;
8351
+ };
8352
+ class LinkButton extends BaseComponent {
8353
+ // #endregion
8354
+ // #region constructor
8355
+ constructor(element, options) {
8356
+ super(element, options);
8357
+ // #region fields
8358
+ __publicField$1(this, "cmd");
8359
+ var dataCommand = this.$element.attr("data-command");
8360
+ if (dataCommand) {
8361
+ this.cmd = this.options.commands[dataCommand];
8362
+ }
8363
+ if (this.cmd) {
8364
+ this.$element.on("click", (event) => {
8365
+ if (this.cmd.enabled()) {
8366
+ this.cmd.exec($(this).attr("data-command-parameter"));
8367
+ } else {
8368
+ event.preventDefault();
8369
+ }
8370
+ });
8371
+ $(this.cmd).on("enabledChanged", (event) => {
8372
+ (this.cmd.enabled() ? $.fn.removeClass : $.fn.addClass).call(this.$element, "disabled");
8373
+ }).on("checkedChanged", (event) => {
8374
+ (this.cmd.checked() ? $.fn.addClass : $.fn.removeClass).call(this.$element, "checked");
8375
+ });
8376
+ }
8377
+ }
8378
+ // #endregion
8379
+ }
8380
+
8381
+ var __defProp = Object.defineProperty;
8382
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8383
+ var __publicField = (obj, key, value) => {
8384
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8385
+ return value;
8386
+ };
8387
+ class PageNumberInput extends BaseComponent {
8388
+ // #endregion
8389
+ // #region constructor
8390
+ constructor(element, options) {
8391
+ super(element, options);
8392
+ // #region fields
8393
+ __publicField(this, "cmd");
8394
+ __publicField(this, "_numeric");
8395
+ this.cmd = this.options.commands["goToPage"];
8396
+ this._numeric = new kendo.ui.NumericTextBox(this.element, {
8397
+ format: "0",
8398
+ decimals: 0,
8399
+ min: 0,
8400
+ spinners: false,
8401
+ change: this._onChange.bind(this),
8402
+ spin: this._onChange.bind(this)
8403
+ });
8404
+ this._numeric._text[0].dataset.role = "telerik_ReportViewer_PageNumberInput";
8405
+ this._numeric.element[0].dataset.role = "";
8406
+ this.options.controller.on("reportLoadComplete", (event, reportInfo) => {
8407
+ this._numeric.max(reportInfo.pageCount);
8408
+ this._numeric.min(Math.min(1, reportInfo.pageCount));
8409
+ this._numeric.value(Math.min(1, reportInfo.pageCount));
8410
+ }).on("loadedReportChange", (event) => {
8411
+ this._numeric.min(0);
8412
+ this._numeric.max(0);
8413
+ this._numeric.value(0);
8414
+ }).on("renderingStopped", (event) => {
8415
+ this._numeric.min(0);
8416
+ this._numeric.max(0);
8417
+ this._numeric.value(0);
8418
+ }).pageNumberChange((event, value) => {
8419
+ this._numeric.value(value);
8420
+ });
8421
+ }
8422
+ // #endregion
8423
+ // #region event handlers
8424
+ _onChange(event, data) {
8425
+ var val = this._numeric.value();
8426
+ var num = tryParseInt(val);
8427
+ if (!isNaN(num)) {
8428
+ this.cmd.exec(num);
8429
+ }
8430
+ }
8431
+ _onSpin(event, data) {
8432
+ return this._onChange(event, data);
8433
+ }
8434
+ // #endregion
8435
+ }
8436
+
8437
+ class PageCountLabel extends BaseComponent {
8438
+ // #region constructor
8439
+ constructor(element, options) {
8440
+ super(element, options);
8441
+ this.options.controller.pageCountChange((event, value) => {
8442
+ this.$element.text(value);
8443
+ });
8444
+ }
8445
+ // #endregion
8446
+ }
8447
+
8567
8448
  const Instances = GlobalSettings.viewerInstances;
8568
8449
  function getDefaultOptions(serviceUrl, version) {
8569
8450
  return {
@@ -8623,8 +8504,8 @@ var telerikReportViewer = (function (exports) {
8623
8504
  if (!validateOptions(options)) {
8624
8505
  return;
8625
8506
  }
8626
- var version = "18.1.24.514";
8627
- options = extend({}, getDefaultOptions(svcApiUrl, version), options);
8507
+ var version = "18.2.24.806";
8508
+ options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
8628
8509
  settings = new ReportViewerSettings(
8629
8510
  persistanceKey,
8630
8511
  options.persistSession ? window.sessionStorage : new MemStorage(),
@@ -9075,24 +8956,21 @@ var telerikReportViewer = (function (exports) {
9075
8956
  return e.outerHTML;
9076
8957
  }).toArray();
9077
8958
  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
- }
8959
+ Array.from(styleSheets).forEach((element) => {
8960
+ if (currentStyleLinks.indexOf(element) === -1) {
8961
+ promises.push(
8962
+ new Promise(function(resolve, reject) {
8963
+ var $link = $(element);
8964
+ $link.on("load", resolve);
8965
+ $link.on("onerror", function() {
8966
+ logError("error loading stylesheet " + element);
8967
+ resolve();
8968
+ });
8969
+ $head.append($link);
8970
+ })
8971
+ );
9094
8972
  }
9095
- );
8973
+ });
9096
8974
  return Promise.all(promises).then(controller.cssLoaded);
9097
8975
  }
9098
8976
  function browserSupportsAllFeatures() {
@@ -9101,12 +8979,11 @@ var telerikReportViewer = (function (exports) {
9101
8979
  function ensureKendo(version2) {
9102
8980
  if (window.kendo) {
9103
8981
  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
8982
  }
8983
+ var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
8984
+ return loadScript(kendoUrl).catch(function(errorData) {
8985
+ logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
8986
+ });
9110
8987
  }
9111
8988
  function main(version2) {
9112
8989
  ensureKendo(version2).then(function() {
@@ -9134,7 +9011,7 @@ var telerikReportViewer = (function (exports) {
9134
9011
  if (browserSupportsAllFeatures()) {
9135
9012
  main(version);
9136
9013
  } else {
9137
- loadScriptWithCallback("https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise", main, version);
9014
+ throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
9138
9015
  }
9139
9016
  return viewer;
9140
9017
  }
@@ -9143,7 +9020,7 @@ var telerikReportViewer = (function (exports) {
9143
9020
  if (this.selector && !options.selector) {
9144
9021
  options.selector = this.selector;
9145
9022
  }
9146
- return each(this, function() {
9023
+ return this.each(function() {
9147
9024
  if (!$.data(this, pluginName)) {
9148
9025
  $.data(this, pluginName, new ReportViewer(this, options));
9149
9026
  }
@@ -9177,11 +9054,23 @@ var telerikReportViewer = (function (exports) {
9177
9054
  {
9178
9055
  name: "telerik_ReportViewer_SideMenu",
9179
9056
  constructor: SideMenu
9057
+ },
9058
+ {
9059
+ name: "telerik_ReportViewer_LinkButton",
9060
+ constructor: LinkButton
9061
+ },
9062
+ {
9063
+ name: "telerik_ReportViewer_PageNumberInput",
9064
+ constructor: PageNumberInput
9065
+ },
9066
+ {
9067
+ name: "telerik_ReportViewer_PageCountLabel",
9068
+ constructor: PageCountLabel
9180
9069
  }
9181
9070
  ];
9182
9071
  plugins.forEach((plugin) => {
9183
9072
  $.fn[plugin.name] = function(options, otherOptions) {
9184
- return each(this, function() {
9073
+ return this.each(function() {
9185
9074
  if (!$.data(this, plugin.name)) {
9186
9075
  $.data(this, plugin.name, new plugin.constructor(this, options, otherOptions));
9187
9076
  }
@@ -9202,6 +9091,7 @@ var telerikReportViewer = (function (exports) {
9202
9091
  exports.ParameterEditors = ParameterEditors;
9203
9092
  exports.ParameterTypes = ParameterTypes;
9204
9093
  exports.ParameterValidators = ParameterValidators;
9094
+ exports.ParametersArea = ParametersArea;
9205
9095
  exports.ParametersAreaPositions = ParametersAreaPositions;
9206
9096
  exports.PerspectiveManager = PerspectiveManager;
9207
9097
  exports.PrintManager = PrintManager;