@progress/telerik-jquery-report-viewer 20.23.1114 → 21.24.130

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /*
2
- * TelerikReporting v17.2.23.1114 (https://www.telerik.com/products/reporting.aspx)
3
- * Copyright 2023 Progress Software EAD. All rights reserved.
2
+ * TelerikReporting v18.0.24.130 (https://www.telerik.com/products/reporting.aspx)
3
+ * Copyright 2024 Progress Software EAD. All rights reserved.
4
4
  *
5
5
  * Telerik Reporting commercial licenses may be obtained at
6
6
  * https://www.telerik.com/purchase/license-agreement/reporting.aspx
@@ -77,11 +77,15 @@ var telerikReportViewer = (() => {
77
77
  areEqualArrays: () => areEqualArrays,
78
78
  each: () => each,
79
79
  escapeHtml: () => escapeHtml,
80
+ exceptionTypeNamesMatch: () => exceptionTypeNamesMatch,
80
81
  extend: () => extend,
81
82
  filterUniqueLastOccurance: () => filterUniqueLastOccurance,
82
83
  findElement: () => findElement,
83
84
  generateGuidString: () => generateGuidString,
84
85
  getColorAlphaValue: () => getColorAlphaValue,
86
+ getExceptionInstance: () => getExceptionInstance,
87
+ isApplicationException: () => isApplicationException,
88
+ isApplicationExceptionInstance: () => isApplicationExceptionInstance,
85
89
  isArray: () => isArray,
86
90
  isExceptionOfType: () => isExceptionOfType,
87
91
  isInternalServerError: () => isInternalServerError,
@@ -89,6 +93,7 @@ var telerikReportViewer = (() => {
89
93
  isRgbColor: () => isRgbColor,
90
94
  isSpecialKey: () => isSpecialKey,
91
95
  isSvgSupported: () => isSvgSupported,
96
+ isSystemArgumentException: () => isSystemArgumentException,
92
97
  loadScript: () => loadScript,
93
98
  loadScriptWithCallback: () => loadScriptWithCallback,
94
99
  logError: () => logError,
@@ -308,20 +313,31 @@ var telerikReportViewer = (() => {
308
313
  }
309
314
  return false;
310
315
  }
316
+ function isSystemArgumentException(xhr) {
317
+ var exceptionShortName = "ArgumentException";
318
+ var exceptionInstance = getExceptionInstance(xhr);
319
+ return isExceptionInstanceOfType(exceptionInstance, exceptionShortName, "System." + exceptionShortName);
320
+ }
311
321
  function isInvalidClientException(xhr) {
312
- return isExceptionOfType(xhr, "Telerik.Reporting.Services.Engine.InvalidClientException");
322
+ var exceptionShortName = "InvalidClientException";
323
+ var exceptionInstance = getExceptionInstance(xhr);
324
+ return isExceptionInstanceOfType(exceptionInstance, exceptionShortName, "Telerik.Reporting.Services.Engine." + exceptionShortName);
325
+ }
326
+ function isApplicationException(xhr) {
327
+ return isApplicationExceptionInstance(getExceptionInstance(xhr));
328
+ }
329
+ function isApplicationExceptionInstance(exception) {
330
+ var exceptionShortName = "DrawingFactoryUnavailableException";
331
+ return isExceptionInstanceOfType(exception, exceptionShortName, "Telerik.Drawing.Contract." + exceptionShortName);
313
332
  }
314
333
  function isExceptionOfType(xhr, exceptionType) {
315
- if (!xhr)
316
- return false;
317
- if (!xhr.responseText)
318
- return false;
319
- var json = parseJSON(xhr.responseText);
320
- if (!json)
321
- return false;
322
- if (!json.exceptionType)
323
- return false;
324
- return json.exceptionType === exceptionType;
334
+ return isExceptionInstanceOfType(getExceptionInstance(xhr), exceptionType, exceptionType);
335
+ }
336
+ function isExceptionInstanceOfType(exceptionInstance, exceptionTypeShortName, exceptionTypeFullName) {
337
+ return exceptionInstance && exceptionInstance.exceptionType && exceptionTypeNamesMatch(exceptionInstance.exceptionType, exceptionTypeShortName, exceptionTypeFullName);
338
+ }
339
+ function exceptionTypeNamesMatch(instanceTypeName, exceptionTypeShortName, exceptionTypeFullName) {
340
+ return instanceTypeName && (instanceTypeName === exceptionTypeFullName || instanceTypeName.endsWith(exceptionTypeShortName));
325
341
  }
326
342
  function parseJSON(json) {
327
343
  try {
@@ -342,6 +358,12 @@ var telerikReportViewer = (() => {
342
358
  return null;
343
359
  }
344
360
  }
361
+ function getExceptionInstance(xhr) {
362
+ if (!xhr || !xhr.responseText) {
363
+ return false;
364
+ }
365
+ return parseJSON(xhr.responseText);
366
+ }
345
367
  function extend() {
346
368
  var src, copy, name, options, target, i = 0, length = arguments.length;
347
369
  target = length > 1 ? arguments[i++] || {} : {};
@@ -680,7 +702,7 @@ var telerikReportViewer = (() => {
680
702
  errorSendingDocument: "Error sending report document (Report = '{0}')."
681
703
  };
682
704
  window.telerikReportViewer ||= {};
683
- window.telerikReportViewer.sr = sr;
705
+ window.telerikReportViewer.sr ||= sr;
684
706
 
685
707
  // src/stringResources.js
686
708
  var sr2 = sr2 || {};
@@ -1661,19 +1683,25 @@ var telerikReportViewer = (() => {
1661
1683
  raiseError(formatXhrError({ "responseText": errorMessage }, null, null, null));
1662
1684
  throw errorMessage;
1663
1685
  }
1664
- if (isInvalidClientException(xhrData.xhr)) {
1686
+ var xhr = xhrData.xhr;
1687
+ if (isInvalidClientException(xhr)) {
1665
1688
  onClientExpired();
1666
1689
  }
1667
1690
  var formattedError = formatXhrError(
1668
- xhrData.xhr,
1691
+ xhr,
1669
1692
  xhrData.status,
1670
1693
  isInternalServerError(xhrData.error) ? "" : xhrData.error,
1671
1694
  localizedMessage
1672
1695
  );
1673
1696
  raiseError(formattedError);
1674
1697
  if (!suppressErrorBubbling) {
1675
- errorMessage = xhrData.xhr.responseJSON && xhrData.xhr.responseJSON.exceptionMessage ? xhrData.xhr.responseJSON.exceptionMessage : stringResources.promisesChainStopError;
1676
- throw errorMessage;
1698
+ if (isApplicationException(xhr)) {
1699
+ var exception = getExceptionInstance(xhr);
1700
+ if (exception) {
1701
+ throw exception;
1702
+ }
1703
+ }
1704
+ throw xhr.responseJSON && exception.exceptionMessage ? xhr.responseJSON.exceptionMessage : stringResources.promisesChainStopError;
1677
1705
  }
1678
1706
  }
1679
1707
  function initializeClientAsync() {
@@ -1891,19 +1919,15 @@ var telerikReportViewer = (() => {
1891
1919
  deviceInfo.enableSearch = enableSearch;
1892
1920
  return deviceInfo;
1893
1921
  }
1894
- function resolveErrorByExceptionType(exceptionType) {
1895
- switch (exceptionType) {
1896
- case "Telerik.Reporting.Services.Engine.InvalidParameterException":
1897
- return stringResources.missingOrInvalidParameter;
1898
- default:
1899
- return "";
1900
- }
1922
+ function tryResolveClientErrorByExceptionType(exceptionType) {
1923
+ var parameterExceptionShortName = "InvalidParameterException";
1924
+ return exceptionTypeNamesMatch(exceptionType, parameterExceptionShortName, "Telerik.Reporting.Services.Engine." + parameterExceptionShortName) ? stringResources.missingOrInvalidParameter : "";
1901
1925
  }
1902
1926
  function formatXhrError(xhr, status, error, localizedMessage) {
1903
1927
  var parsedXhr = parseJSON(xhr.responseText);
1904
1928
  var result = "";
1905
1929
  if (parsedXhr) {
1906
- var errorMessage = resolveErrorByExceptionType(parsedXhr.exceptionType || parsedXhr.error);
1930
+ var errorMessage = tryResolveClientErrorByExceptionType(parsedXhr.exceptionType || parsedXhr.error);
1907
1931
  if (errorMessage) {
1908
1932
  return errorMessage;
1909
1933
  }
@@ -2328,7 +2352,7 @@ var telerikReportViewer = (() => {
2328
2352
  return client.getSearchResults(clientId, reportInstanceId, reportDocumentId, args.searchToken, args.matchCase, args.matchWholeWord, args.useRegex).catch(handleSearchResultsError);
2329
2353
  }
2330
2354
  function handleSearchResultsError(xhrData) {
2331
- if (!isExceptionOfType(xhrData.xhr, "System.ArgumentException")) {
2355
+ if (!isSystemArgumentException(xhrData.xhr)) {
2332
2356
  handleRequestError(xhrData, null, true);
2333
2357
  throw null;
2334
2358
  }
@@ -4299,10 +4323,16 @@ var telerikReportViewer = (() => {
4299
4323
  var $container = $(toolTipTemplate);
4300
4324
  var $titleSpan = $container.find(".trv-pages-area-kendo-tooltip-title");
4301
4325
  var $textSpan = $container.find(".trv-pages-area-kendo-tooltip-text");
4302
- $titleSpan.text(toolTipArgs.toolTip.title);
4303
- $textSpan.text(toolTipArgs.toolTip.text);
4326
+ $titleSpan.html(replaceNewLineSymbols(toolTipArgs.toolTip.title));
4327
+ $textSpan.html(replaceNewLineSymbols(toolTipArgs.toolTip.text));
4304
4328
  return $container.clone().wrap("<p>").parent().html();
4305
4329
  }
4330
+ function replaceNewLineSymbols(tooltipText) {
4331
+ tooltipText = escapeHtml(tooltipText);
4332
+ tooltipText = tooltipText.replaceAll("\r\n", "<br>");
4333
+ tooltipText = tooltipText.replaceAll("\n", "<br>");
4334
+ return tooltipText;
4335
+ }
4306
4336
  function positionToolTip(toolTip, e) {
4307
4337
  var x = e.pageX;
4308
4338
  var y = e.pageY;
@@ -6591,6 +6621,11 @@ var telerikReportViewer = (() => {
6591
6621
  menu._oldHoverItem.toggleClass("k-focus");
6592
6622
  }
6593
6623
  }
6624
+ if (!args.renderingExtensions) {
6625
+ controller.getDocumentFormats().then(fillFormats);
6626
+ } else {
6627
+ fillFormats(args.renderingExtensions);
6628
+ }
6594
6629
  });
6595
6630
  function init2() {
6596
6631
  try {
@@ -6599,7 +6634,6 @@ var telerikReportViewer = (() => {
6599
6634
  console.error("Instantiation of Kendo Menu as Main Menu threw an exception", e);
6600
6635
  throw e;
6601
6636
  }
6602
- menu.bind("open", onSubmenuOpen);
6603
6637
  menu.bind("activate", onSubmenuActivate);
6604
6638
  menu.bind("deactivate", onSubmenuDeactivate);
6605
6639
  menu.element.off("keydown", onMenuKeyDown);
@@ -6654,16 +6688,6 @@ var telerikReportViewer = (() => {
6654
6688
  });
6655
6689
  });
6656
6690
  }
6657
- function onSubmenuOpen(e) {
6658
- var $item = $(e.item);
6659
- menu.unbind("open", onSubmenuOpen);
6660
- menu.append({ text: stringResources.loadingFormats, spriteCssClass: "k-icon k-loading" }, $item);
6661
- controller.getDocumentFormats().then(fillFormats).then(function() {
6662
- menu.open($item);
6663
- }).then(function() {
6664
- menu.bind("open", onSubmenuOpen);
6665
- });
6666
- }
6667
6691
  function fillFormats(formats) {
6668
6692
  each($(dom).find("ul[data-command-list=export-format-list]"), function() {
6669
6693
  var $list = $(this), $parent = $list.parents("li");
@@ -8303,7 +8327,7 @@ var telerikReportViewer = (() => {
8303
8327
  if (!validateOptions(options)) {
8304
8328
  return;
8305
8329
  }
8306
- var version = "17.2.23.1114";
8330
+ var version = "18.0.24.130";
8307
8331
  options = extend({}, getDefaultOptions(svcApiUrl, version), options);
8308
8332
  settings = new ReportViewerSettings(
8309
8333
  persistanceKey,
@@ -8794,8 +8818,9 @@ var telerikReportViewer = (() => {
8794
8818
  ensureKendo(version2).then(function() {
8795
8819
  }).then(function() {
8796
8820
  viewer.authenticationToken(options.authenticationToken);
8797
- controller.getServiceVersion().catch(function() {
8798
- $placeholder.text(stringFormat(stringResources.errorServiceUrl, [escapeHtml(svcApiUrl)]));
8821
+ controller.getServiceVersion().catch(function(ex) {
8822
+ var errorOutput = isApplicationExceptionInstance(ex) ? ex.exceptionMessage : stringFormat(stringResources.errorServiceUrl, [escapeHtml(svcApiUrl)]);
8823
+ $placeholder.text(errorOutput);
8799
8824
  return Promise.reject();
8800
8825
  }).then(function(data) {
8801
8826
  if (data !== version2) {
@@ -8872,4 +8897,4 @@ var telerikReportViewer = (() => {
8872
8897
  return __toCommonJS(src_exports);
8873
8898
  })();
8874
8899
 
8875
- /* DO NOT MODIFY OR DELETE THIS LINE! UPGRADE WIZARD CHECKSUM 90485bf9963b5f8fe2856225dae030cb */
8900
+ /* DO NOT MODIFY OR DELETE THIS LINE! UPGRADE WIZARD CHECKSUM c9b9b66c0976c140ee70f2158bb3b437 */