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

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.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/accessibility.js +28 -38
  3. package/dist/cjs/base-component.js +26 -0
  4. package/dist/cjs/binder.js +45 -138
  5. package/dist/cjs/controller.js +25 -25
  6. package/dist/cjs/documentMapArea.js +4 -13
  7. package/dist/cjs/event-emitter.js +124 -10
  8. package/dist/cjs/index.js +2 -0
  9. package/dist/cjs/mainMenu.js +22 -31
  10. package/dist/cjs/pagesArea.js +8 -27
  11. package/dist/cjs/parameterValidators.js +4 -7
  12. package/dist/cjs/parameters.js +13 -13
  13. package/dist/cjs/parametersArea.js +36 -49
  14. package/dist/cjs/print.js +3 -4
  15. package/dist/cjs/reportViewer.js +38 -27
  16. package/dist/cjs/scroll.js +4 -6
  17. package/dist/cjs/search.js +327 -377
  18. package/dist/cjs/sendEmail.js +52 -95
  19. package/dist/cjs/serviceClient.js +163 -257
  20. package/dist/cjs/sideMenu.js +15 -24
  21. package/dist/cjs/sr.js +4 -4
  22. package/dist/cjs/template-cache.js +6 -6
  23. package/dist/cjs/toolbar/link-button.js +42 -0
  24. package/dist/cjs/toolbar/page-count-label.js +18 -0
  25. package/dist/cjs/toolbar/page-number-input.js +64 -0
  26. package/dist/cjs/uiFreezeCoordinator.js +17 -16
  27. package/dist/cjs/utils.js +11 -14
  28. package/dist/es/accessibility.js +29 -39
  29. package/dist/es/base-component.js +22 -0
  30. package/dist/es/binder.js +45 -138
  31. package/dist/es/controller.js +26 -26
  32. package/dist/es/documentMapArea.js +4 -13
  33. package/dist/es/event-emitter.js +124 -10
  34. package/dist/es/index.js +1 -0
  35. package/dist/es/mainMenu.js +23 -32
  36. package/dist/es/pagesArea.js +9 -28
  37. package/dist/es/parameterValidators.js +5 -8
  38. package/dist/es/parameters.js +14 -14
  39. package/dist/es/parametersArea.js +37 -50
  40. package/dist/es/print.js +4 -5
  41. package/dist/es/reportViewer.js +39 -28
  42. package/dist/es/scroll.js +4 -6
  43. package/dist/es/search.js +328 -378
  44. package/dist/es/sendEmail.js +52 -95
  45. package/dist/es/serviceClient.js +164 -258
  46. package/dist/es/sideMenu.js +16 -25
  47. package/dist/es/sr.js +4 -4
  48. package/dist/es/template-cache.js +7 -7
  49. package/dist/es/toolbar/link-button.js +38 -0
  50. package/dist/es/toolbar/page-count-label.js +14 -0
  51. package/dist/es/toolbar/page-number-input.js +60 -0
  52. package/dist/es/uiFreezeCoordinator.js +17 -16
  53. package/dist/es/utils.js +11 -14
  54. package/dist/font/font-icons.css +4 -4
  55. package/dist/font/font-icons.min.css +3 -3
  56. package/dist/js/telerikReportViewer.js +1080 -1190
  57. package/dist/js/telerikReportViewer.min.js +1 -1
  58. package/dist/js/telerikReportViewer.stringResources.js +4 -4
  59. package/dist/styles/telerikReportViewer.css +3 -3
  60. package/dist/styles/telerikReportViewer.min.css +3 -3
  61. package/dist/templates/telerikReportViewerTemplate-FA.html +4 -4
  62. package/dist/templates/telerikReportViewerTemplate.html +6 -6
  63. package/package.json +3 -2
  64. /package/dist/font/{ReportingIcons-18.1.24.514.ttf → ReportingIcons-18.2.24.806.ttf} +0 -0
@@ -1,8 +1,41 @@
1
- import { each } from './utils.js';
2
1
  import { stringResources } from './stringResources.js';
3
2
  import { Binder } from './binder.js';
3
+ import { Command } from './command.js';
4
4
 
5
5
  var defaultOptions = {};
6
+ function replaceStringResources($sendEmailDialog) {
7
+ if (!$sendEmailDialog) {
8
+ return;
9
+ }
10
+ var labels = $sendEmailDialog.find(".trv-replace-string");
11
+ var ariaLabel = $sendEmailDialog.find("[aria-label]");
12
+ var titles = $sendEmailDialog.find("[title]");
13
+ if (labels.length) {
14
+ Array.from(labels).forEach((element) => {
15
+ replaceText($(element));
16
+ });
17
+ }
18
+ if (ariaLabel.length) {
19
+ Array.from(ariaLabel).forEach((element) => {
20
+ replaceAttribute($(element), "aria-label");
21
+ });
22
+ }
23
+ if (titles.length) {
24
+ Array.from(titles).forEach((element) => {
25
+ replaceAttribute($(element), "title");
26
+ });
27
+ }
28
+ }
29
+ function replaceText($el) {
30
+ if ($el) {
31
+ $el.text(stringResources[$el.text()]);
32
+ }
33
+ }
34
+ function replaceAttribute($el, attribute) {
35
+ if ($el) {
36
+ $el.attr(attribute, stringResources[$el.attr(attribute)]);
37
+ }
38
+ }
6
39
  function SendEmail(placeholder, options, viewerOptions) {
7
40
  options = $.extend({}, defaultOptions, options);
8
41
  var controller = options.controller;
@@ -101,9 +134,9 @@ function SendEmail(placeholder, options, viewerOptions) {
101
134
  }, 250);
102
135
  }
103
136
  }).data("kendoWindow");
104
- } catch (e) {
105
- console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", e);
106
- throw e;
137
+ } catch (error) {
138
+ console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", error);
139
+ throw error;
107
140
  }
108
141
  kendoSendEmailDialog.wrapper.addClass("trv-send-email");
109
142
  try {
@@ -117,13 +150,13 @@ function SendEmail(placeholder, options, viewerOptions) {
117
150
  this.trigger("change");
118
151
  }
119
152
  }).data("kendoComboBox");
120
- } catch (e) {
121
- console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", e);
122
- throw e;
153
+ } catch (error) {
154
+ console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", error);
155
+ throw error;
123
156
  }
124
- $placeholder.on("keydown", '[name="format_input"]', function(e) {
157
+ $placeholder.on("keydown", '[name="format_input"]', function(event) {
125
158
  var tabkey = 9;
126
- if (e.keyCode === tabkey && bodyEditor) {
159
+ if (event.keyCode === tabkey && bodyEditor) {
127
160
  setTimeout(function() {
128
161
  bodyEditor.focus();
129
162
  });
@@ -156,9 +189,9 @@ function SendEmail(placeholder, options, viewerOptions) {
156
189
  "superscript"
157
190
  ]
158
191
  }).data("kendoEditor");
159
- } catch (e) {
160
- console.error("Instantiation of Kendo Editor for Email body editor threw an exception", e);
161
- throw e;
192
+ } catch (error) {
193
+ console.error("Instantiation of Kendo Editor for Email body editor threw an exception", error);
194
+ throw error;
162
195
  }
163
196
  setDefaultValues(viewerOptions.sendEmail);
164
197
  initialized = true;
@@ -235,22 +268,14 @@ function SendEmail(placeholder, options, viewerOptions) {
235
268
  }
236
269
  function initCommands() {
237
270
  optionsCommandSet = {
238
- //the command names MUST match the commands in the template.html with the "telerik_Reportviewer" prefix so the binder could work.
239
- "sendEmail_Cancel": new command(function() {
271
+ "sendEmail_Cancel": new Command(function() {
240
272
  closeWindow();
241
273
  }),
242
- "sendEmail_Send": new command(function(e) {
274
+ "sendEmail_Send": new Command(function() {
243
275
  sendingEmail();
244
276
  })
245
277
  };
246
- Binder.bind(
247
- $placeholder.find(".trv-send-email-actions"),
248
- {
249
- controller,
250
- commands: optionsCommandSet
251
- },
252
- viewerOptions
253
- );
278
+ Binder.attachCommands($placeholder.find(".trv-send-email-actions"), optionsCommandSet, viewerOptions);
254
279
  }
255
280
  function sendingEmail(cmd, args) {
256
281
  var sendEmailArgs = {
@@ -268,17 +293,17 @@ function SendEmail(placeholder, options, viewerOptions) {
268
293
  }
269
294
  }
270
295
  function setValidation() {
271
- inputFrom.off("blur").on("blur", function(e) {
296
+ inputFrom.off("blur").on("blur", function(event) {
272
297
  if (!isEmpty($(this))) {
273
298
  isValidEmail($(this), false);
274
299
  }
275
300
  });
276
- inputTo.off("blur").on("blur", function(e) {
301
+ inputTo.off("blur").on("blur", function(event) {
277
302
  if (!isEmpty($(this))) {
278
303
  isValidEmail($(this), true);
279
304
  }
280
305
  });
281
- inputCC.off("blur").on("blur", function(e) {
306
+ inputCC.off("blur").on("blur", function(event) {
282
307
  if ($(this).val().length) {
283
308
  isValidEmail($(this), true);
284
309
  } else {
@@ -337,9 +362,8 @@ function SendEmail(placeholder, options, viewerOptions) {
337
362
  }
338
363
  }
339
364
  return true;
340
- } else {
341
- return _validateEmail(inputValue, $el);
342
365
  }
366
+ return _validateEmail(inputValue, $el);
343
367
  }
344
368
  function _validateEmail(email, $el) {
345
369
  var regexEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
@@ -359,73 +383,6 @@ function SendEmail(placeholder, options, viewerOptions) {
359
383
  function clearValidation() {
360
384
  $(".k-invalid-msg").removeClass("-visible");
361
385
  }
362
- function replaceStringResources($sendEmailDialog) {
363
- if (!$sendEmailDialog) {
364
- return;
365
- }
366
- var labels = $sendEmailDialog.find(".trv-replace-string");
367
- var ariaLabel = $sendEmailDialog.find("[aria-label]");
368
- var titles = $sendEmailDialog.find("[title]");
369
- if (labels.length) {
370
- $.each(labels, function(key, value) {
371
- replaceText($(value));
372
- });
373
- }
374
- if (ariaLabel.length) {
375
- $.each(ariaLabel, function(key, value) {
376
- replaceAttribute($(value), "aria-label");
377
- });
378
- }
379
- if (titles.length) {
380
- $.each(titles, function(key, value) {
381
- replaceAttribute($(value), "title");
382
- });
383
- }
384
- }
385
- function replaceText($el) {
386
- if ($el) {
387
- $el.text(stringResources[$el.text()]);
388
- }
389
- }
390
- function replaceAttribute($el, attribute) {
391
- if ($el) {
392
- $el.attr(attribute, stringResources[$el.attr(attribute)]);
393
- }
394
- }
395
- function command(execCallback) {
396
- var enabledState = true;
397
- var checkedState = false;
398
- var cmd = {
399
- enabled: function(state) {
400
- if (arguments.length === 0) {
401
- return enabledState;
402
- }
403
- var newState = Boolean(state);
404
- enabledState = newState;
405
- $(this).trigger("enabledChanged");
406
- return cmd;
407
- },
408
- checked: function(state) {
409
- if (arguments.length === 0) {
410
- return checkedState;
411
- }
412
- var newState = Boolean(state);
413
- checkedState = newState;
414
- $(this).trigger("checkedChanged");
415
- return cmd;
416
- },
417
- exec: execCallback
418
- };
419
- return cmd;
420
- }
421
386
  }
422
- var pluginName = "telerik_ReportViewer_SendEmail";
423
- $.fn[pluginName] = function(options, viewerOptions) {
424
- return each(this, function() {
425
- if (!$.data(this, pluginName)) {
426
- $.data(this, pluginName, new SendEmail(this, options, viewerOptions));
427
- }
428
- });
429
- };
430
387
 
431
388
  export { SendEmail };