@progress/telerik-jquery-report-viewer 27.25.813 → 27.25.924

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * TelerikReporting v19.2.25.813 (https://www.telerik.com/products/reporting.aspx)
2
+ * TelerikReporting v19.2.25.924 (https://www.telerik.com/products/reporting.aspx)
3
3
  * Copyright 2025 Progress Software EAD. All rights reserved.
4
4
  *
5
5
  * Telerik Reporting commercial licenses may be obtained at
@@ -1914,10 +1914,10 @@ var telerikReportViewer = (function (exports) {
1914
1914
  function j(e2) {
1915
1915
  return e2.offsetParent;
1916
1916
  }
1917
- function G(e2) {
1917
+ function J(e2) {
1918
1918
  return parseInt(e2, 10) || 0;
1919
1919
  }
1920
- function J(e2, t2, i2, n2 = 0, r2 = 0) {
1920
+ function G(e2, t2, i2, n2 = 0, r2 = 0) {
1921
1921
  let s2 = `${n2 = n2 || 0} ${r2 = r2 || 0}`;
1922
1922
  !function(e3, t3) {
1923
1923
  e3.style.setProperty("transform", t3), e3.style.setProperty("-moz-transform", t3), e3.style.setProperty("-ms-transform", t3), e3.style.setProperty("-webkit-transform", t3), e3.style.setProperty("-o-transform", t3);
@@ -2710,19 +2710,26 @@ var telerikReportViewer = (function (exports) {
2710
2710
  this.disablePagesArea(true), window.setTimeout(this.controller.getReportPage.bind(this.controller, e2), 1), this.navigateToPageOnDocReady = 0;
2711
2711
  }
2712
2712
  setPageDimensions(t2, i2 = 0) {
2713
- let n2 = this.controller.getScaleMode(), r2 = this.controller.getScale(), s2 = i2 ? t2 : t2.querySelector("div.trv-report-page");
2714
- if (!s2)
2713
+ let n2 = i2 ? t2 : t2.querySelector("div.trv-report-page");
2714
+ if (!n2)
2715
2715
  return;
2716
- let o2 = s2.querySelector("div.sheet"), a2 = s2.querySelector("div.trv-skeleton-wrapper");
2717
- if (o2 = o2 || a2, !o2)
2716
+ let r2, s2 = n2.querySelector("div.sheet"), o2 = n2.querySelector("div.trv-skeleton-wrapper");
2717
+ if (s2 = s2 || o2, !s2)
2718
2718
  return;
2719
- let l2 = 0, h2 = 0, c2 = getComputedStyle(s2), d2 = getComputedStyle(t2), u2 = G(d2.marginLeft) + G(c2.borderLeftWidth) + G(c2.paddingLeft), p2 = G(d2.marginRight) + G(c2.borderRightWidth) + G(c2.paddingRight), g2 = G(d2.marginTop) + G(c2.borderTopWidth) + G(c2.paddingTop), m2 = G(d2.marginBottom) + G(c2.borderBottomWidth) + G(c2.paddingBottom);
2720
- if (l2 = o2.offsetWidth, h2 = o2.offsetHeight, 0 === l2) {
2721
- const e2 = getComputedStyle(o2);
2722
- l2 = parseInt(e2.width), h2 = parseInt(e2.height);
2719
+ if (n2.dataset.box)
2720
+ r2 = JSON.parse(n2.dataset.box);
2721
+ else {
2722
+ let e2 = getComputedStyle(n2), i3 = getComputedStyle(t2);
2723
+ r2 = { padLeft: J(i3.marginLeft) + J(e2.borderLeftWidth) + J(e2.paddingLeft), padRight: J(i3.marginRight) + J(e2.borderRightWidth) + J(e2.paddingRight), padTop: J(i3.marginTop) + J(e2.borderTopWidth) + J(e2.paddingTop), padBottom: J(i3.marginBottom) + J(e2.borderBottomWidth) + J(e2.paddingBottom) }, n2.dataset.box = JSON.stringify(r2);
2724
+ }
2725
+ let a2 = s2.offsetWidth, l2 = s2.offsetHeight;
2726
+ if (0 === a2) {
2727
+ const e2 = getComputedStyle(s2);
2728
+ a2 = parseInt(e2.width), l2 = parseInt(e2.height);
2723
2729
  }
2724
- let f2 = h2 > l2 && n2 === e.ScaleMode.FitPageWidth ? 20 : 0, v2 = (this.pageContainer.clientWidth - f2 - u2 - p2) / l2, P2 = (this.pageContainer.clientHeight - 1 - g2 - m2) / h2;
2725
- n2 === e.ScaleMode.FitPageWidth ? r2 = v2 : r2 && n2 !== e.ScaleMode.FitPage || (r2 = Math.min(v2, P2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(r2), t2.dataset.pageScale = r2.toString(), s2.dataset.pageScale = r2.toString(), a2 || J(o2, r2, r2), s2.style.height = r2 * h2 + "px", s2.style.width = r2 * l2 + "px";
2730
+ const h2 = this.controller.getScaleMode(), c2 = l2 > a2 && h2 === e.ScaleMode.FitPageWidth ? 20 : 0, d2 = (this.pageContainer.clientWidth - c2 - r2.padLeft - r2.padRight) / a2, u2 = (this.pageContainer.clientHeight - 1 - r2.padTop - r2.padBottom) / l2;
2731
+ let p2 = this.controller.getScale();
2732
+ h2 === e.ScaleMode.FitPageWidth ? p2 = d2 : p2 && h2 !== e.ScaleMode.FitPage || (p2 = Math.min(d2, u2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(p2), t2.dataset.pageScale = p2.toString(), n2.dataset.pageScale = p2.toString(), o2 || G(s2, p2, p2), n2.style.height = p2 * l2 + "px", n2.style.width = p2 * a2 + "px", this.controller.setScale(p2, true);
2726
2733
  }
2727
2734
  enableInteractivity() {
2728
2735
  this.onClickHandler = this.onClick.bind(this), this.onMouseEnterHandler = this.onMouseEnter.bind(this), this.onMouseLeaveHandler = this.onMouseLeave.bind(this), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("mouseenter", this.onMouseEnterHandler, true), this.pageContainer.addEventListener("mouseleave", this.onMouseLeaveHandler, true);
@@ -2940,8 +2947,8 @@ var telerikReportViewer = (function (exports) {
2940
2947
  getScale() {
2941
2948
  return this.options.scale;
2942
2949
  }
2943
- setScale(e2) {
2944
- e2 !== this.options.scale && (this.options.scale = e2, this.emit("scaleChanged", e2));
2950
+ setScale(e2, t2 = false) {
2951
+ e2 !== this.options.scale && (this.options.scale = e2, t2 || this.emit("scaleChanged", e2));
2945
2952
  }
2946
2953
  getScaleMode() {
2947
2954
  return this.options.scaleMode;
@@ -3516,7 +3523,7 @@ ${e3.text} (${e3.id})`;
3516
3523
  return i2.parameters && (n2 = JSON.stringify(i2.parameters)), e3 === n2;
3517
3524
  }
3518
3525
  return false;
3519
- }, e.scaleElement = J, e.stringFormat = ce, e.throttle = se, e.toPixel = G, e.toRgbColor = K, e.tryParseFloat = ge, e.tryParseInt = pe, Object.defineProperty(e, "__esModule", { value: true });
3526
+ }, e.scaleElement = G, e.stringFormat = ce, e.throttle = se, e.toPixel = J, e.toRgbColor = K, e.tryParseFloat = ge, e.tryParseInt = pe, Object.defineProperty(e, "__esModule", { value: true });
3520
3527
  });
3521
3528
  })(dist, dist.exports);
3522
3529
  var distExports = dist.exports;
@@ -4228,7 +4235,7 @@ ${e3.text} (${e3.id})`;
4228
4235
  "toggleZoomMode": new Command((e) => {
4229
4236
  var scaleMode = controller.getScaleMode();
4230
4237
  var newScaleMode = scaleTransitionMap[scaleMode];
4231
- controller.setScaleMode(scaleTransitionMap[newScaleMode]);
4238
+ controller.setScaleMode(newScaleMode);
4232
4239
  if (newScaleMode === distExports.ScaleMode.Specific) {
4233
4240
  controller.setScale(1);
4234
4241
  }
@@ -4245,8 +4252,8 @@ ${e3.text} (${e3.id})`;
4245
4252
  };
4246
4253
  function zoom(step) {
4247
4254
  var scale = getZoomScale(controller.getScale(), step);
4248
- controller.setScale(scale);
4249
4255
  controller.setScaleMode(distExports.ScaleMode.Specific);
4256
+ controller.setScale(scale);
4250
4257
  }
4251
4258
  function getZoomScale(scale, steps) {
4252
4259
  var pos = -1;
@@ -5951,7 +5958,7 @@ ${e3.text} (${e3.id})`;
5951
5958
  commands.toggleZoomMode.setEnabled(hasPage).setChecked(controller.getScaleMode() == distExports.ScaleMode.FitPage || controller.getScaleMode() == distExports.ScaleMode.FitPageWidth);
5952
5959
  commands.toggleSearchDialog.setEnabled(hasPages).setChecked(searchInitiated);
5953
5960
  commands.toggleSendEmailDialog.setEnabled(hasPages).setChecked(sendEmailDialogState.visible);
5954
- commands.toggleAiPromptDialog.setEnabled(hasPages).setChecked(aiPromptInitiated);
5961
+ commands.toggleAiPromptDialog.setEnabled(hasPages && !renderInProgress).setChecked(aiPromptInitiated);
5955
5962
  notificationService.updateUI(null);
5956
5963
  notificationService.pageNumberChange(currentPageNumber);
5957
5964
  notificationService.pageCountChange(pageCount);
@@ -7074,12 +7081,14 @@ ${e3.text} (${e3.id})`;
7074
7081
  var width = this.kendoSearchDialog.wrapper.outerWidth(true);
7075
7082
  var height = this.kendoSearchDialog.wrapper.outerHeight(true);
7076
7083
  var padding = 10;
7084
+ var scrollOverlapOffsetX = 10;
7077
7085
  if (!this.windowLocation) {
7078
7086
  var reportViewerCoords = this.pagesAreaContainer[0].getBoundingClientRect();
7079
7087
  this.kendoSearchDialog.setOptions({
7080
7088
  position: {
7081
- top: reportViewerCoords.top + padding,
7082
- left: reportViewerCoords.right - width - padding
7089
+ // scrollY ensures that the dialog appears at the correct place even when the viewer is rendered inside a scrollable page
7090
+ top: reportViewerCoords.top + padding + window.scrollY,
7091
+ left: reportViewerCoords.right - width - padding - scrollOverlapOffsetX
7083
7092
  }
7084
7093
  });
7085
7094
  } else {
@@ -8556,6 +8565,10 @@ ${e3.text} (${e3.id})`;
8556
8565
  }
8557
8566
  _initAiPrompt(promptSuggestions) {
8558
8567
  if (this.aiPromptInitialized) {
8568
+ this.kendoAiPrompt.setOptions({
8569
+ promptSuggestions
8570
+ });
8571
+ this.kendoAiPrompt.activeView(this.kendoAiPrompt.activeView());
8559
8572
  return;
8560
8573
  }
8561
8574
  const aiPromptElement = this.kendoAiPromptDialog?.element?.find("#trv-ai-prompt");
@@ -8568,13 +8581,14 @@ ${e3.text} (${e3.id})`;
8568
8581
  activeView: 0,
8569
8582
  promptRequest: function(event) {
8570
8583
  if (!event.prompt) {
8584
+ this.activeView(0);
8571
8585
  return;
8572
8586
  }
8573
8587
  that.controller.getAIResponse(event.prompt).then((response) => {
8574
8588
  this.addPromptOutput(that.createPromptOutputFromResponse(response, event));
8575
8589
  this.activeView(1);
8576
8590
  }).catch((error) => {
8577
- this.addPromptOutput(that.createPromptOutputFromResponse(error?._responseJSON, event));
8591
+ this.addPromptOutput(that.createPromptOutputFromResponse(error?._responseJSON?.exceptionMessage || error?._responseJSON?.ExceptionMessage, event));
8578
8592
  this.activeView(1);
8579
8593
  });
8580
8594
  },
@@ -8584,10 +8598,10 @@ ${e3.text} (${e3.id})`;
8584
8598
  this.close();
8585
8599
  } }
8586
8600
  ],
8601
+ promptSuggestions,
8587
8602
  views: [
8588
8603
  {
8589
8604
  type: "prompt",
8590
- promptSuggestions,
8591
8605
  messages: {
8592
8606
  promptPlaceholder: "Enter your prompt"
8593
8607
  }
@@ -8630,12 +8644,14 @@ ${e3.text} (${e3.id})`;
8630
8644
  var width = dialog.wrapper.outerWidth(true);
8631
8645
  var height = dialog.wrapper.outerHeight(true);
8632
8646
  var padding = 10;
8647
+ var scrollOverlapOffsetX = 10;
8633
8648
  if (!this.kendoAiPromtDialogLocation) {
8634
8649
  var reportViewerCoords = this.pagesAreaContainer[0].getBoundingClientRect();
8635
8650
  dialog.setOptions({
8636
8651
  position: {
8637
- top: reportViewerCoords.top + padding,
8638
- left: reportViewerCoords.right - width - padding
8652
+ // scrollY ensures that the dialog appears at the correct place even when the viewer is rendered inside a scrollable page
8653
+ top: reportViewerCoords.top + padding + window.scrollY,
8654
+ left: reportViewerCoords.right - width - padding - scrollOverlapOffsetX
8639
8655
  }
8640
8656
  });
8641
8657
  } else {
@@ -8810,7 +8826,7 @@ ${e3.text} (${e3.id})`;
8810
8826
  if (!validateOptions(options)) {
8811
8827
  return;
8812
8828
  }
8813
- var version = "19.2.25.813";
8829
+ var version = "19.2.25.924";
8814
8830
  options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
8815
8831
  settings = new ReportViewerSettings(
8816
8832
  persistanceKey,