@progress/telerik-jquery-report-viewer 31.26.812 → 31.26.1007

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.
@@ -14,6 +14,7 @@ var documentMapArea = require('./documentMapArea.js');
14
14
  var parametersArea = require('./parametersArea.js');
15
15
  var search = require('./search.js');
16
16
  var sendEmail = require('./sendEmail.js');
17
+ var exportDialog = require('./exportDialog.js');
17
18
  var events = require('./events.js');
18
19
  var perspectives = require('./perspectives.js');
19
20
  var enums = require('./enums.js');
@@ -126,6 +127,9 @@ function getDefaultOptions(serviceUrl, version) {
126
127
  searchMetadataOnDemand: false,
127
128
  initialPageAreaImageUrl: null,
128
129
  keepClientAlive: true,
130
+ exportDialog: {
131
+ enabled: true
132
+ },
129
133
  webDesignerPreview: false,
130
134
  serverPreview: false
131
135
  };
@@ -147,6 +151,7 @@ function ReportViewer(dom, options) {
147
151
  var persistanceKey = options.id || "#" + $placeholder.attr("id");
148
152
  var accessibility$1;
149
153
  var settings = {};
154
+ var exportSettingsStore = {};
150
155
  var notificationService$1 = {};
151
156
  var client = {};
152
157
  var controllerOptions = {};
@@ -160,8 +165,10 @@ function ReportViewer(dom, options) {
160
165
  if (!validateOptions(options)) {
161
166
  return;
162
167
  }
163
- var version = "20.2.26.812";
164
- options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
168
+ var version = "20.2.26.1007";
169
+ var defaultOptions = getDefaultOptions(svcApiUrl, version);
170
+ options = $.extend({}, defaultOptions, options);
171
+ options.exportDialog = $.extend({}, defaultOptions.exportDialog, options.exportDialog);
165
172
  settings = new reportViewerSettings.ReportViewerSettings(
166
173
  persistanceKey,
167
174
  options.persistSession ? window.sessionStorage : new memStorage.MemStorage(),
@@ -179,6 +186,7 @@ function ReportViewer(dom, options) {
179
186
  serverPreview: options.serverPreview
180
187
  }
181
188
  );
189
+ exportSettingsStore = new RCV__namespace.ExportSettingsStore();
182
190
  notificationService$1 = new notificationService.NotificationService();
183
191
  client = new RCV__namespace.ServiceClient(options);
184
192
  controllerOptions = new RCV__namespace.ReportControllerOptions(
@@ -206,7 +214,9 @@ function ReportViewer(dom, options) {
206
214
  commands = new commandSet.CommandSet({
207
215
  controller,
208
216
  notificationService: notificationService$1,
209
- history: history$1
217
+ history: history$1,
218
+ exportSettingsStore,
219
+ exportDialog: options.exportDialog
210
220
  });
211
221
  new uiController.UIController({
212
222
  controller,
@@ -635,7 +645,8 @@ function ReportViewer(dom, options) {
635
645
  controller,
636
646
  notificationService: notificationService$1,
637
647
  commands,
638
- templates
648
+ templates,
649
+ exportSettingsStore
639
650
  },
640
651
  options
641
652
  );
@@ -1112,6 +1123,10 @@ const plugins = [
1112
1123
  name: "telerik_ReportViewer_SendEmail",
1113
1124
  constructor: sendEmail.SendEmail
1114
1125
  },
1126
+ {
1127
+ name: "telerik_ReportViewer_ExportDialog",
1128
+ constructor: exportDialog.ExportDialog
1129
+ },
1115
1130
  {
1116
1131
  name: "telerik_ReportViewer_LinkButton",
1117
1132
  constructor: linkButton.LinkButton
@@ -189,6 +189,9 @@ class Search {
189
189
  },
190
190
  select: this.processComboBoxEvent.bind(this)
191
191
  });
192
+ this.kendoComboBox.element[0]?.setAttribute("aria-label", stringResources.stringResources.ariaLabelSearchDialogInput);
193
+ this.kendoComboBox.input[0]?.setAttribute("aria-label", stringResources.stringResources.ariaLabelSearchDialogInput);
194
+ this.kendoComboBox._arrow[0]?.setAttribute("aria-label", stringResources.stringResources.ariaLabelSearchDialogInputDropdown);
192
195
  }
193
196
  _initDialog() {
194
197
  this.kendoSearchDialog = new kendo.ui.Window(this.element, {
@@ -466,10 +469,8 @@ class Search {
466
469
  }
467
470
  if (show) {
468
471
  $errorIcon[0].title = message;
469
- $errorIcon.show();
470
- } else {
471
- $errorIcon.hide();
472
472
  }
473
+ $errorIcon.toggleClass("k-hidden", !show);
473
474
  }
474
475
  }
475
476
 
@@ -238,6 +238,7 @@ class SendEmail {
238
238
  }
239
239
  element.setAttribute("id", `${prefix}-${attrName}`);
240
240
  element.setAttribute("name", `${prefix}-${attrName}`);
241
+ element.setAttribute("aria-label", stringResources.stringResources.sendEmailDialogEmailBody);
241
242
  });
242
243
  Array.from(this.element.querySelectorAll(".trv-send-email-label label")).forEach((element) => {
243
244
  var attrFor = element.getAttribute("for");
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var utils = require('./utils.js');
6
+ var RCV = require('@progress/telerik-common-report-viewer');
6
7
  var stringResources = require('./stringResources.js');
7
8
 
8
9
  function SideMenu(element, options, viewerOptions) {
@@ -87,9 +88,16 @@ function SideMenu(element, options, viewerOptions) {
87
88
  $list.empty();
88
89
  Array.from(formats).forEach((format) => {
89
90
  var ariaLabel = enableAccessibility ? utils.stringFormat('aria-label="{localizedName}" ', format) : " ";
90
- var li = "<li " + ariaLabel + utils.stringFormat('tabindex="' + tabIndex + '"><a tabindex="-1" href="#" data-command="telerik_ReportViewer_export" data-command-parameter="{name}"><span>{localizedName}</span></a></li>', format);
91
+ var iconClass = utils.getRenderingExtensionIconClass(format.name);
92
+ var icon = iconClass ? '<span aria-hidden="true" class="k-sprite rendering-extension-icon ' + iconClass + '"></span>' : "";
93
+ var li = "<li " + ariaLabel + utils.stringFormat('tabindex="' + tabIndex + '"><a tabindex="-1" href="#" data-command="telerik_ReportViewer_export" data-command-parameter="{name}">' + icon + "<span>{localizedName}</span></a></li>", format);
91
94
  panelBar.append(li, $parent);
92
95
  });
96
+ if (options.exportDialog.enabled && RCV.hasExportSettings(formats)) {
97
+ var optionsIconClass = utils.getExportOptionsIconClass();
98
+ var optionsIcon = '<span aria-hidden="true" class="k-sprite rendering-extension-icon ' + optionsIconClass + '"></span>';
99
+ panelBar.append('<li class="trv-export-options-item" tabindex="' + tabIndex + '"><a tabindex="-1" href="#" data-command="telerik_ReportViewer_openExportDialog">' + optionsIcon + "<span>" + kendo.htmlEncode(stringResources.stringResources.exportOptionsLabel) + "</span></a></li>", $parent);
100
+ }
93
101
  setListItemsTabIndex($parent.find("li"), tabIndex);
94
102
  enableCloseOnClick($parent);
95
103
  });
package/dist/cjs/sr.js CHANGED
@@ -87,6 +87,18 @@ var sr = {
87
87
  sendEmailFormatLabel: "Format:",
88
88
  sendEmailSendLabel: "Send",
89
89
  sendEmailCancelLabel: "Cancel",
90
+ exportDialogSaveLabel: "Save",
91
+ exportDialogCloseLabel: "Cancel",
92
+ exportDialogFormatLabel: "Export format",
93
+ exportOptionsLabel: "Export Options",
94
+ exportDialogResetLabel: "Reset",
95
+ exportDialogSettingsSuffix: " Settings",
96
+ exportDialogDocumentationLabel: "Documentation",
97
+ exportDialogTextPlaceholder: "Enter text",
98
+ exportDialogNoSettings: "This export format has no configurable settings.",
99
+ exportDialogPagesLabel: "Pages",
100
+ exportDialogAllPagesLabel: "All Pages",
101
+ exportDialogPageRangeLabel: "Page Range",
90
102
  // Accessibility string resources
91
103
  ariaLabelPageNumberSelector: "Page number selector. Showing page {0} of {1}.",
92
104
  ariaLabelPageNumberEditor: "Page number editor",
@@ -114,6 +126,8 @@ var sr = {
114
126
  ariaLabelSearchDialogArea: "Search area",
115
127
  ariaLabelAiPromptDialogArea: "AI prompt area",
116
128
  ariaLabelSendEmailDialogArea: "Send email area",
129
+ ariaLabelSearchDialogInput: "Search input",
130
+ ariaLabelSearchDialogInputDropdown: "Previous searches",
117
131
  ariaLabelSearchDialogStop: "Stop search",
118
132
  ariaLabelSearchDialogOptions: "Search options",
119
133
  ariaLabelSearchDialogNavigateUp: "Navigate up",
@@ -149,6 +163,12 @@ var sr = {
149
163
  ariaLabelSendEmailFormat: "Report format:",
150
164
  ariaLabelSendEmailSend: "Send email",
151
165
  ariaLabelSendEmailCancel: "Cancel sending email",
166
+ // Export dialog accessibility resources
167
+ ariaLabelExportDialogArea: "Export settings dialog",
168
+ ariaLabelExportDialogFormat: "Export format",
169
+ ariaLabelExportDialogSave: "Save export options",
170
+ ariaLabelExportDialogClose: "Cancel export options",
171
+ ariaLabelExportDialogReset: "Reset export settings",
152
172
  // Search dialog resources
153
173
  searchDialogTitle: "Search in report contents",
154
174
  searchDialogSearchInProgress: "searching...",
@@ -164,11 +184,14 @@ var sr = {
164
184
  searchDialogPageText: "page",
165
185
  // Send Email dialog resources
166
186
  sendEmailDialogTitle: "Send Email",
187
+ sendEmailDialogEmailBody: "Email body textarea",
167
188
  sendEmailValidationEmailRequired: "Email field is required",
168
189
  sendEmailValidationEmailFormat: "Email format is not valid",
169
190
  sendEmailValidationSingleEmail: "The field accepts a single email address only",
170
191
  sendEmailValidationFormatRequired: "Format field is required",
171
192
  errorSendingDocument: "Error sending report document (Report = '{0}').",
193
+ // Export dialog resources
194
+ exportDialogTitle: "Export Options",
172
195
  // AI Prompt dialog resources
173
196
  aiPromptDialogConsentTitle: "Before you start with AI",
174
197
  aiPromptDialogConsentAccept: "Consent",
@@ -4,6 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var utils = require('./utils.js');
6
6
 
7
+ const notificationWarningIcon = {
8
+ name: "warning-circle",
9
+ content: '<circle cx="256" cy="256" r="208" fill="none" stroke="currentColor" stroke-width="32" /><path d="M224 128h64v160h-64zm0 256v-64h64v64z" />',
10
+ viewBox: "0 0 512 512"
11
+ };
7
12
  const TemplateCache = /* @__PURE__ */ (function() {
8
13
  var cache = {};
9
14
  return {
@@ -19,7 +24,19 @@ const TemplateCache = /* @__PURE__ */ (function() {
19
24
  var viewerTemplate = $("<div></div>").html(html);
20
25
  Array.from(viewerTemplate.find("template")).forEach((element) => {
21
26
  var $element = $(element);
22
- templates[$element.attr("id")] = utils.trim($element.html(), "\n ");
27
+ var $content = $("<div></div>").html($element.html());
28
+ $content.find("[data-svg-icon]").each((_, icon) => {
29
+ var $icon = $(icon);
30
+ var iconName = $icon.attr("data-svg-icon");
31
+ var exportName = iconName.replace(/-([a-z])/g, (_2, letter) => letter.toUpperCase()) + "Icon";
32
+ var svgIcon = iconName === "warning-circle" ? notificationWarningIcon : kendo.ui.svgIcons[exportName];
33
+ if (!svgIcon) {
34
+ throw new Error(`Kendo SVG icon not found: ${iconName}`);
35
+ }
36
+ kendo.ui.icon($icon, { icon: svgIcon, type: "svg" });
37
+ $icon.removeAttr("data-svg-icon");
38
+ });
39
+ templates[$element.attr("id")] = utils.trim($content.html(), "\n ");
23
40
  });
24
41
  Array.from(viewerTemplate.find("link")).forEach((element) => {
25
42
  styleSheets.push(utils.trim(element.outerHTML, "\n "));
@@ -25,9 +25,10 @@ class PageNumberInput extends baseComponent.BaseComponent {
25
25
  spin: this._onChange.bind(this)
26
26
  });
27
27
  this._numeric._text[0].dataset.role = "telerik_ReportViewer_PageNumberInput";
28
+ this._numeric._text[0].setAttribute("aria-label", stringResources.stringResources.ariaLabelPageNumberEditor);
28
29
  this._numeric.element[0].dataset.role = "";
30
+ this._numeric.element[0].setAttribute("aria-label", stringResources.stringResources.ariaLabelPageNumberEditor);
29
31
  this._numeric.wrapper[0].classList.add("trv-toolbar-numeric");
30
- this._numeric._text[0].setAttribute("aria-label", stringResources.stringResources.ariaLabelPageNumberEditor);
31
32
  this.options.controller.onAsync("reportLoadComplete", async (reportInfo) => {
32
33
  this._numeric.max(reportInfo.pageCount);
33
34
  this._numeric.min(Math.min(1, reportInfo.pageCount));
@@ -2,10 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var RCV = require('@progress/telerik-common-report-viewer');
5
6
  var stringResources = require('./stringResources.js');
6
7
  var pageCountLabel = require('./toolbar/page-count-label.js');
7
8
  var pageNumberInput = require('./toolbar/page-number-input.js');
8
9
  var constants = require('./constants.js');
10
+ var utils = require('./utils.js');
9
11
 
10
12
  function replaceStringResources($toolbar) {
11
13
  if (!$toolbar) {
@@ -27,6 +29,7 @@ class Toolbar {
27
29
  _options;
28
30
  /** @type {HTMLElement} */
29
31
  _element;
32
+ _exportDialogEnabled;
30
33
  $element;
31
34
  _kendoToolbar;
32
35
  _neverOverflowToolBarButtons = ["goToPrevPage", "goToNextPage"];
@@ -35,6 +38,7 @@ class Toolbar {
35
38
  constructor(element, options, viewerOptions) {
36
39
  this._element = element;
37
40
  this._options = options;
41
+ this._exportDialogEnabled = Boolean(viewerOptions.exportDialog.enabled);
38
42
  this.$element = $(this._element);
39
43
  if (this._kendoToolbar === void 0) {
40
44
  this.initKendoToolbar();
@@ -185,14 +189,31 @@ class Toolbar {
185
189
  return;
186
190
  }
187
191
  const exportDropdownItems = [];
188
- extensions.forEach((extension) => exportDropdownItems.push({
189
- id: extension.name,
190
- text: extension.localizedName,
191
- attributes: {
192
- [constants.ToolBarConstants.DataCommandAttr]: "export",
193
- [constants.ToolBarConstants.DataCommandParameterAttr]: extension.name
192
+ extensions.forEach((extension) => {
193
+ const iconClass = utils.getRenderingExtensionIconClass(extension.name);
194
+ const item = {
195
+ id: extension.name,
196
+ text: extension.localizedName,
197
+ attributes: {
198
+ [constants.ToolBarConstants.DataCommandAttr]: "export",
199
+ [constants.ToolBarConstants.DataCommandParameterAttr]: extension.name
200
+ }
201
+ };
202
+ if (iconClass) {
203
+ item.spriteCssClass = `rendering-extension-icon ${iconClass}`;
194
204
  }
195
- }));
205
+ exportDropdownItems.push(item);
206
+ });
207
+ if (this._exportDialogEnabled && RCV.hasExportSettings(extensions)) {
208
+ exportDropdownItems.push({
209
+ text: stringResources.stringResources.exportOptionsLabel,
210
+ spriteCssClass: `rendering-extension-icon ${utils.getExportOptionsIconClass()}`,
211
+ attributes: {
212
+ class: "trv-export-options-item",
213
+ [constants.ToolBarConstants.DataCommandAttr]: "openExportDialog"
214
+ }
215
+ });
216
+ }
196
217
  const options = kendoExportDropDown.options;
197
218
  options.items = exportDropdownItems;
198
219
  kendoExportDropDown.setOptions(options);
package/dist/cjs/utils.js CHANGED
@@ -5,6 +5,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var RCV = require('@progress/telerik-common-report-viewer');
6
6
 
7
7
  var stringFormatRegExp = /{(\w+?)}/g;
8
+ var renderingExtensionIconClasses = {
9
+ PDF: "rendering-extension-pdf-icon",
10
+ IMAGE: "rendering-extension-image-icon",
11
+ CSV: "rendering-extension-csv-icon",
12
+ DOCX: "rendering-extension-docx-icon",
13
+ MHTML: "rendering-extension-mhtml-icon",
14
+ PPTX: "rendering-extension-pptx-icon",
15
+ RTF: "rendering-extension-rtf-icon",
16
+ XLS: "rendering-extension-xls-icon",
17
+ XLSX: "rendering-extension-xlsx-icon",
18
+ XPS: "rendering-extension-xps-icon"
19
+ };
20
+ var exportOptionsIconClass = "rendering-extension-options-icon";
8
21
  var specialKeys = {
9
22
  DELETE: 46,
10
23
  BACKSPACE: 8,
@@ -67,6 +80,12 @@ function generateGuidString() {
67
80
  return v.toString(16);
68
81
  });
69
82
  }
83
+ function getRenderingExtensionIconClass(format) {
84
+ return typeof format === "string" ? renderingExtensionIconClasses[format.toUpperCase()] || "" : "";
85
+ }
86
+ function getExportOptionsIconClass() {
87
+ return exportOptionsIconClass;
88
+ }
70
89
  function trim(s, charlist) {
71
90
  return rTrim(lTrim(s, charlist), charlist);
72
91
  }
@@ -261,6 +280,8 @@ exports.filterUniqueLastOccurrence = filterUniqueLastOccurrence;
261
280
  exports.generateGuidString = generateGuidString;
262
281
  exports.getColorAlphaValue = getColorAlphaValue;
263
282
  exports.getExceptionInstance = getExceptionInstance;
283
+ exports.getExportOptionsIconClass = getExportOptionsIconClass;
284
+ exports.getRenderingExtensionIconClass = getRenderingExtensionIconClass;
264
285
  exports.isApplicationException = isApplicationException;
265
286
  exports.isApplicationExceptionInstance = isApplicationExceptionInstance;
266
287
  exports.isRgbColor = isRgbColor;