@progress/telerik-jquery-report-viewer 21.24.305 → 22.24.709

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/accessibility.js +208 -0
  3. package/dist/cjs/base-component.js +26 -0
  4. package/dist/cjs/binder.js +79 -0
  5. package/dist/cjs/command.js +32 -0
  6. package/dist/cjs/commandSet.js +167 -0
  7. package/dist/cjs/controller.js +1204 -0
  8. package/dist/cjs/documentMapArea.js +159 -0
  9. package/dist/cjs/domUtils.js +50 -0
  10. package/dist/cjs/enums.js +52 -0
  11. package/dist/cjs/event-emitter.js +131 -0
  12. package/dist/cjs/events.js +23 -0
  13. package/dist/cjs/globalSettings.js +9 -0
  14. package/dist/cjs/history.js +131 -0
  15. package/dist/cjs/index.js +58 -0
  16. package/dist/cjs/jqueryThrottleDebounce.js +48 -0
  17. package/dist/cjs/kendo-jquery.js +4 -0
  18. package/dist/cjs/mainMenu.js +323 -0
  19. package/dist/cjs/mem-storage.js +44 -0
  20. package/dist/cjs/pagesArea.js +622 -0
  21. package/dist/cjs/parameterValidators.js +164 -0
  22. package/dist/cjs/parameters.js +921 -0
  23. package/dist/cjs/parametersArea.js +486 -0
  24. package/dist/cjs/perspectives.js +138 -0
  25. package/dist/cjs/print.js +165 -0
  26. package/dist/cjs/report-viewer/report-viewer-settings.js +138 -0
  27. package/dist/cjs/reportViewer.js +665 -0
  28. package/dist/cjs/scroll.js +535 -0
  29. package/dist/cjs/search.js +584 -0
  30. package/dist/cjs/sendEmail.js +392 -0
  31. package/dist/cjs/service-client-sentinel.js +52 -0
  32. package/dist/cjs/serviceClient.js +311 -0
  33. package/dist/cjs/sideMenu.js +216 -0
  34. package/dist/cjs/sr.js +164 -0
  35. package/dist/cjs/stringResources.js +11 -0
  36. package/dist/cjs/telerikReportViewer.kendo.js +60196 -0
  37. package/dist/cjs/telerikReportViewer.kendo.min.js +19776 -0
  38. package/dist/cjs/template-cache.js +39 -0
  39. package/dist/cjs/toolbar/link-button.js +42 -0
  40. package/dist/cjs/toolbar/page-count-label.js +18 -0
  41. package/dist/cjs/toolbar/page-number-input.js +64 -0
  42. package/dist/cjs/touch.js +86 -0
  43. package/dist/cjs/uiController.js +142 -0
  44. package/dist/cjs/uiFreezeCoordinator.js +282 -0
  45. package/dist/cjs/utils.js +489 -0
  46. package/dist/es/accessibility.js +204 -0
  47. package/dist/es/base-component.js +22 -0
  48. package/dist/es/binder.js +75 -0
  49. package/dist/es/command.js +28 -0
  50. package/dist/es/commandSet.js +163 -0
  51. package/dist/es/controller.js +1200 -0
  52. package/dist/es/documentMapArea.js +155 -0
  53. package/dist/es/domUtils.js +43 -0
  54. package/dist/es/enums.js +41 -0
  55. package/dist/es/event-emitter.js +127 -0
  56. package/dist/es/events.js +19 -0
  57. package/dist/es/globalSettings.js +5 -0
  58. package/dist/es/history.js +127 -0
  59. package/dist/es/index.js +24 -0
  60. package/dist/es/jqueryThrottleDebounce.js +46 -0
  61. package/dist/es/kendo-jquery.js +1 -0
  62. package/dist/es/mainMenu.js +319 -0
  63. package/dist/es/mem-storage.js +40 -0
  64. package/dist/es/pagesArea.js +618 -0
  65. package/dist/es/parameterValidators.js +160 -0
  66. package/dist/es/parameters.js +916 -0
  67. package/dist/es/parametersArea.js +482 -0
  68. package/dist/es/perspectives.js +134 -0
  69. package/dist/es/print.js +161 -0
  70. package/dist/es/report-viewer/report-viewer-settings.js +134 -0
  71. package/dist/es/reportViewer.js +661 -0
  72. package/dist/es/scroll.js +531 -0
  73. package/dist/es/search.js +580 -0
  74. package/dist/es/sendEmail.js +388 -0
  75. package/dist/es/service-client-sentinel.js +48 -0
  76. package/dist/es/serviceClient.js +307 -0
  77. package/dist/es/sideMenu.js +212 -0
  78. package/dist/es/sr.js +162 -0
  79. package/dist/es/stringResources.js +7 -0
  80. package/dist/es/telerikReportViewer.kendo.js +60194 -0
  81. package/dist/es/telerikReportViewer.kendo.min.js +19774 -0
  82. package/dist/es/template-cache.js +35 -0
  83. package/dist/es/toolbar/link-button.js +38 -0
  84. package/dist/es/toolbar/page-count-label.js +14 -0
  85. package/dist/es/toolbar/page-number-input.js +60 -0
  86. package/dist/es/touch.js +82 -0
  87. package/dist/es/uiController.js +138 -0
  88. package/dist/es/uiFreezeCoordinator.js +278 -0
  89. package/dist/es/utils.js +444 -0
  90. package/dist/font/font-icons.css +4 -4
  91. package/dist/font/font-icons.min.css +3 -3
  92. package/dist/js/telerikReportViewer.js +8346 -8507
  93. package/dist/js/telerikReportViewer.min.js +1 -17
  94. package/dist/js/telerikReportViewer.stringResources.js +166 -173
  95. package/dist/styles/telerikReportViewer.css +3 -3
  96. package/dist/styles/telerikReportViewer.min.css +3 -3
  97. package/dist/templates/telerikReportViewerTemplate-FA.html +4 -4
  98. package/dist/templates/telerikReportViewerTemplate.html +6 -6
  99. package/package.json +14 -7
  100. /package/dist/font/{ReportingIcons-18.0.24.305.ttf → ReportingIcons-18.1.24.709.ttf} +0 -0
@@ -0,0 +1,388 @@
1
+ import { stringResources } from './stringResources.js';
2
+ import { Binder } from './binder.js';
3
+ import { Command } from './command.js';
4
+
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
+ }
39
+ function SendEmail(placeholder, options, viewerOptions) {
40
+ options = $.extend({}, defaultOptions, options);
41
+ var controller = options.controller;
42
+ var initialized = false;
43
+ var dialogVisible = false;
44
+ var $placeholder;
45
+ var kendoSendEmailDialog;
46
+ var selector = viewerOptions.viewerSelector;
47
+ var inputFrom;
48
+ var inputTo;
49
+ var inputCC;
50
+ var inputSubject;
51
+ var docFormat;
52
+ var docFormatEl;
53
+ var bodyEditorEl;
54
+ var bodyEditor;
55
+ var docFormatList;
56
+ var optionsCommandSet;
57
+ var windowLocation;
58
+ var reportViewerWrapper = $("[data-selector='" + selector + "']").find(".trv-report-viewer");
59
+ if (!controller) {
60
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
61
+ }
62
+ if (!viewerOptions.sendEmail || !viewerOptions.sendEmail.enabled) {
63
+ var toolbarSendEmailItem = $("[data-selector='" + selector + "']").find("a[data-command='telerik_ReportViewer_toggleSendEmailDialog']").closest(".k-item ");
64
+ toolbarSendEmailItem.hide();
65
+ return;
66
+ }
67
+ controller.beginLoadReport(closeAndClear).viewModeChanged(closeAndClear);
68
+ controller.getSendEmailDialogState(function(event, args) {
69
+ args.visible = dialogVisible;
70
+ }).setSendEmailDialogVisible(function(event, args) {
71
+ toggle(args.visible);
72
+ }).setSearchDialogVisible(function(event, args) {
73
+ if (args.visible && dialogVisible) {
74
+ toggle(!dialogVisible);
75
+ }
76
+ });
77
+ controller.getDocumentFormats().then(function(formats) {
78
+ docFormatList = formats;
79
+ });
80
+ function closeAndClear() {
81
+ toggle(false);
82
+ }
83
+ function toggle(show) {
84
+ dialogVisible = show;
85
+ if (show) {
86
+ ensureInitialized();
87
+ setDefaultValues(viewerOptions.sendEmail);
88
+ kendoSendEmailDialog.open();
89
+ } else {
90
+ if (kendoSendEmailDialog && kendoSendEmailDialog.options.visible) {
91
+ kendoSendEmailDialog.close();
92
+ }
93
+ }
94
+ }
95
+ function getBody() {
96
+ return bodyEditor ? bodyEditor.value() : "";
97
+ }
98
+ function ensureInitialized() {
99
+ if (!initialized) {
100
+ $placeholder = $(placeholder);
101
+ inputFrom = $placeholder.find("[name='from']");
102
+ inputTo = $placeholder.find("[name='to']");
103
+ inputCC = $placeholder.find("[name='cc']");
104
+ inputSubject = $placeholder.find("[name='subject']");
105
+ docFormatEl = $placeholder.find("[name='format']");
106
+ bodyEditorEl = $placeholder.find("textarea");
107
+ setAttrs();
108
+ initCommands();
109
+ replaceStringResources($placeholder);
110
+ try {
111
+ kendoSendEmailDialog = reportViewerWrapper.find(".trv-send-email-window").kendoWindow({
112
+ title: stringResources.sendEmailDialogTitle,
113
+ minWidth: 350,
114
+ minHeight: 350,
115
+ maxHeight: 900,
116
+ modal: true,
117
+ close: function() {
118
+ storeDialogPosition();
119
+ clearValidation();
120
+ },
121
+ open: function() {
122
+ adjustDialogSize();
123
+ adjustDialogPosition();
124
+ },
125
+ deactivate: function() {
126
+ controller.setSendEmailDialogVisible({
127
+ visible: false
128
+ });
129
+ },
130
+ activate: function() {
131
+ kendoSendEmailDialog.wrapper.find(".trv-send-email-fields input[type='email']:visible").first().focus();
132
+ setTimeout(function() {
133
+ setValidation();
134
+ }, 250);
135
+ }
136
+ }).data("kendoWindow");
137
+ } catch (error) {
138
+ console.error("Instantiation of Kendo Window for Send Email dialog threw an exception", error);
139
+ throw error;
140
+ }
141
+ kendoSendEmailDialog.wrapper.addClass("trv-send-email");
142
+ try {
143
+ docFormat = docFormatEl.kendoComboBox({
144
+ dataTextField: "localizedName",
145
+ dataValueField: "name",
146
+ dataSource: docFormatList || [],
147
+ filter: "startswith",
148
+ dataBound: function() {
149
+ this.select(0);
150
+ this.trigger("change");
151
+ }
152
+ }).data("kendoComboBox");
153
+ } catch (error) {
154
+ console.error("Instantiation of Kendo ComboBox as document format selector threw an exception", error);
155
+ throw error;
156
+ }
157
+ $placeholder.on("keydown", '[name="format_input"]', function(event) {
158
+ var tabkey = 9;
159
+ if (event.keyCode === tabkey && bodyEditor) {
160
+ setTimeout(function() {
161
+ bodyEditor.focus();
162
+ });
163
+ }
164
+ });
165
+ try {
166
+ bodyEditor = bodyEditorEl.kendoEditor({
167
+ tools: [
168
+ "bold",
169
+ "italic",
170
+ "underline",
171
+ "strikethrough",
172
+ "justifyLeft",
173
+ "justifyCenter",
174
+ "justifyRight",
175
+ "justifyFull",
176
+ "insertUnorderedList",
177
+ "insertOrderedList",
178
+ "indent",
179
+ "outdent",
180
+ "createLink",
181
+ "unlink",
182
+ "cleanFormatting",
183
+ "formatting",
184
+ "fontName",
185
+ "fontSize",
186
+ "foreColor",
187
+ "backColor",
188
+ "subscript",
189
+ "superscript"
190
+ ]
191
+ }).data("kendoEditor");
192
+ } catch (error) {
193
+ console.error("Instantiation of Kendo Editor for Email body editor threw an exception", error);
194
+ throw error;
195
+ }
196
+ setDefaultValues(viewerOptions.sendEmail);
197
+ initialized = true;
198
+ }
199
+ }
200
+ $(window).resize(function() {
201
+ if (kendoSendEmailDialog && kendoSendEmailDialog.options.visible) {
202
+ storeDialogPosition();
203
+ adjustDialogSize();
204
+ adjustDialogPosition();
205
+ }
206
+ });
207
+ function setAttrs() {
208
+ $placeholder.find(".trv-send-email-field input").each(function() {
209
+ var el = $(this);
210
+ var attrName = el.attr("name");
211
+ el.attr("id", selector + "-" + attrName);
212
+ });
213
+ $placeholder.find(".trv-send-email-label label").each(function() {
214
+ var el = $(this);
215
+ var attrName = el.attr("for");
216
+ el.attr("for", selector + "-" + attrName);
217
+ });
218
+ }
219
+ function storeDialogPosition() {
220
+ var kendoWindow = kendoSendEmailDialog.element.parent(".k-window");
221
+ windowLocation = kendoWindow.offset();
222
+ }
223
+ function adjustDialogSize() {
224
+ var kendoWindow = kendoSendEmailDialog.element.parent(".k-window");
225
+ var windowWidth = $(window).width();
226
+ var kendoWindowWidth = 350;
227
+ if (windowWidth > 800) {
228
+ kendoWindowWidth = 720;
229
+ }
230
+ kendoWindow.css({ width: kendoWindowWidth });
231
+ kendoSendEmailDialog.refresh({
232
+ width: kendoWindowWidth
233
+ });
234
+ }
235
+ function adjustDialogPosition() {
236
+ if (!windowLocation) {
237
+ kendoSendEmailDialog.center();
238
+ } else {
239
+ var padding = 10;
240
+ var windowWidth = $(window).innerWidth();
241
+ var windowHeight = $(window).innerHeight();
242
+ var kendoWindow = kendoSendEmailDialog.wrapper;
243
+ var width = kendoWindow.outerWidth(true);
244
+ var height = kendoWindow.outerHeight(true);
245
+ var left = windowLocation.left;
246
+ var top = windowLocation.top;
247
+ var right = left + width;
248
+ var bottom = top + height;
249
+ if (right > windowWidth - padding) {
250
+ left = Math.max(padding, windowWidth - width - padding);
251
+ kendoWindow.css({ left });
252
+ kendoSendEmailDialog.setOptions({
253
+ position: {
254
+ left
255
+ }
256
+ });
257
+ }
258
+ if (bottom > windowHeight - padding) {
259
+ top = Math.max(padding, windowHeight - height - padding);
260
+ kendoWindow.css({ top });
261
+ kendoSendEmailDialog.setOptions({
262
+ position: {
263
+ top
264
+ }
265
+ });
266
+ }
267
+ }
268
+ }
269
+ function initCommands() {
270
+ optionsCommandSet = {
271
+ "sendEmail_Cancel": new Command(function() {
272
+ closeWindow();
273
+ }),
274
+ "sendEmail_Send": new Command(function() {
275
+ sendingEmail();
276
+ })
277
+ };
278
+ Binder.attachCommands($placeholder.find(".trv-send-email-actions"), optionsCommandSet, viewerOptions);
279
+ }
280
+ function sendingEmail(cmd, args) {
281
+ var sendEmailArgs = {
282
+ from: inputFrom.val(),
283
+ to: inputTo.val(),
284
+ cc: inputCC.val(),
285
+ subject: inputSubject.val(),
286
+ format: docFormat.value(),
287
+ body: getBody(),
288
+ deviceInfo: {}
289
+ };
290
+ if (validateFields()) {
291
+ controller.sendReport(sendEmailArgs);
292
+ closeWindow();
293
+ }
294
+ }
295
+ function setValidation() {
296
+ inputFrom.off("blur").on("blur", function(event) {
297
+ if (!isEmpty($(this))) {
298
+ isValidEmail($(this), false);
299
+ }
300
+ });
301
+ inputTo.off("blur").on("blur", function(event) {
302
+ if (!isEmpty($(this))) {
303
+ isValidEmail($(this), true);
304
+ }
305
+ });
306
+ inputCC.off("blur").on("blur", function(event) {
307
+ if ($(this).val().length) {
308
+ isValidEmail($(this), true);
309
+ } else {
310
+ hideError($(this));
311
+ }
312
+ });
313
+ }
314
+ function validateFields() {
315
+ var fromIsValid = isEmpty(inputFrom) || !isValidEmail(inputFrom, false);
316
+ var toIsValid = isEmpty(inputTo) || !isValidEmail(inputTo, true);
317
+ var ccIsValid = inputCC.val().length && !isValidEmail(inputCC, true);
318
+ var hasFormat = docFormat.value().length;
319
+ if (!hasFormat) {
320
+ showError(docFormatEl, "data-required-msg");
321
+ }
322
+ if (fromIsValid || toIsValid || ccIsValid || !hasFormat) {
323
+ return false;
324
+ }
325
+ return true;
326
+ }
327
+ function setDefaultValues(sendEmail) {
328
+ inputFrom.val(sendEmail && sendEmail.from || "");
329
+ inputTo.val(sendEmail && sendEmail.to || "");
330
+ inputCC.val(sendEmail && sendEmail.cc || "");
331
+ inputSubject.val(sendEmail && sendEmail.subject || "");
332
+ if (sendEmail && sendEmail.format) {
333
+ docFormat.value(sendEmail.format);
334
+ } else {
335
+ docFormat.select(0);
336
+ }
337
+ docFormat.trigger("change");
338
+ bodyEditor.value(sendEmail && sendEmail.body || "");
339
+ }
340
+ function isEmpty($el) {
341
+ if (!$el.val().length) {
342
+ showError($el, "data-required-msg");
343
+ return true;
344
+ }
345
+ hideError($el);
346
+ return false;
347
+ }
348
+ function showError($el, tag) {
349
+ var validationMsg = stringResources[$el.attr(tag)];
350
+ $('[data-for="' + $el.attr("name") + '"]').addClass("-visible").text(validationMsg);
351
+ }
352
+ function hideError($el) {
353
+ $('[data-for="' + $el.attr("name") + '"]').removeClass("-visible");
354
+ }
355
+ function isValidEmail($el, moreThenOneEmail) {
356
+ var inputValue = $el.val();
357
+ if (moreThenOneEmail) {
358
+ var listEmailsAddress = inputValue.split(/[\s,;]+/);
359
+ for (var i = 0; i < listEmailsAddress.length; i++) {
360
+ if (!_validateEmail(listEmailsAddress[i].trim(), $el)) {
361
+ return false;
362
+ }
363
+ }
364
+ return true;
365
+ }
366
+ return _validateEmail(inputValue, $el);
367
+ }
368
+ function _validateEmail(email, $el) {
369
+ var regexEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
370
+ if (email.indexOf(",") > -1 || email.indexOf(";") > -1) {
371
+ showError($el, "data-single-email-msg");
372
+ return false;
373
+ }
374
+ if (!regexEmail.test(email)) {
375
+ showError($el, "data-email-msg");
376
+ return false;
377
+ }
378
+ return true;
379
+ }
380
+ function closeWindow() {
381
+ kendoSendEmailDialog.close();
382
+ }
383
+ function clearValidation() {
384
+ $(".k-invalid-msg").removeClass("-visible");
385
+ }
386
+ }
387
+
388
+ export { SendEmail };
@@ -0,0 +1,48 @@
1
+ import { stringResources } from './stringResources.js';
2
+
3
+ function isNumber(value) {
4
+ return typeof value === "number" && isFinite(value);
5
+ }
6
+ function secondsToMilliseconds(seconds) {
7
+ return seconds * 1e3;
8
+ }
9
+ function ServiceClientSentinel(serviceClient, clientID, sessionTimeoutSeconds) {
10
+ if (!serviceClient) {
11
+ throw stringResources.noServiceClient;
12
+ }
13
+ if (!isNumber(sessionTimeoutSeconds)) {
14
+ throw "sessionTimeoutSeconds must a number and must be finite";
15
+ }
16
+ var interval;
17
+ var pingMilliseconds;
18
+ if (sessionTimeoutSeconds <= 120) {
19
+ pingMilliseconds = secondsToMilliseconds(sessionTimeoutSeconds) / 2;
20
+ } else {
21
+ pingMilliseconds = secondsToMilliseconds(sessionTimeoutSeconds - 60);
22
+ }
23
+ function start() {
24
+ if (pingMilliseconds <= 0) {
25
+ return;
26
+ }
27
+ interval = setInterval(function() {
28
+ serviceClient.keepClientAlive(clientID);
29
+ }, pingMilliseconds);
30
+ }
31
+ function restart() {
32
+ stop();
33
+ start();
34
+ }
35
+ function stop() {
36
+ if (interval) {
37
+ clearInterval(interval);
38
+ interval = null;
39
+ }
40
+ }
41
+ return {
42
+ start,
43
+ restart,
44
+ stop
45
+ };
46
+ }
47
+
48
+ export { ServiceClientSentinel };