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

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