@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,489 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var stringFormatRegExp = /{(\w+?)}/g;
6
+ var specialKeys = {
7
+ DELETE: 46,
8
+ BACKSPACE: 8,
9
+ TAB: 9,
10
+ ESC: 27,
11
+ LEFT: 37,
12
+ UP: 38,
13
+ RIGHT: 39,
14
+ DOWN: 40,
15
+ END: 35,
16
+ HOME: 36
17
+ };
18
+ function isSpecialKey() {
19
+ var userAgent = window.navigator.userAgent.toLowerCase();
20
+ if (userAgent.indexOf("firefox") > -1) {
21
+ var specialKeysArray = Object.keys(specialKeys);
22
+ var specialKeysLength = specialKeysArray.length;
23
+ return function(keyCode) {
24
+ for (var i = 0; i < specialKeysLength; i++) {
25
+ if (specialKeys[specialKeysArray[i]] == keyCode) {
26
+ return true;
27
+ }
28
+ }
29
+ };
30
+ }
31
+ return function(keyCode) {
32
+ return false;
33
+ };
34
+ }
35
+ function toXhrErrorData(xhr, status, error) {
36
+ return {
37
+ xhr,
38
+ status,
39
+ error
40
+ };
41
+ }
42
+ function rectangle(left, top, width, height) {
43
+ return {
44
+ left,
45
+ top,
46
+ width,
47
+ height,
48
+ right: function() {
49
+ return left + width;
50
+ },
51
+ bottom: function() {
52
+ return top + height;
53
+ },
54
+ union: function(other) {
55
+ var newLeft = Math.min(left, other.left);
56
+ var newTop = Math.min(top, other.top);
57
+ var newWidth = Math.max(this.right(), other.right()) - newLeft;
58
+ var newHeight = Math.max(this.bottom(), other.bottom()) - newTop;
59
+ return rectangle(
60
+ newLeft,
61
+ newTop,
62
+ newWidth,
63
+ newHeight
64
+ );
65
+ }
66
+ };
67
+ }
68
+ function generateGuidString() {
69
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
70
+ var r = Math.random() * 16 | 0;
71
+ var v = c == "x" ? r : r & 3 | 8;
72
+ return v.toString(16);
73
+ });
74
+ }
75
+ function trim(s, charlist) {
76
+ return rTrim(lTrim(s, charlist), charlist);
77
+ }
78
+ function replaceAll(str, find, replace) {
79
+ return str.replace(new RegExp(find, "g"), replace);
80
+ }
81
+ function lTrim(s, charlist) {
82
+ if (charlist === void 0) {
83
+ charlist = "s";
84
+ }
85
+ return s.replace(new RegExp("^[" + charlist + "]+"), "");
86
+ }
87
+ function rTrim(s, charlist) {
88
+ if (charlist === void 0) {
89
+ charlist = "s";
90
+ }
91
+ return s.replace(new RegExp("[" + charlist + "]+$"), "");
92
+ }
93
+ function stringFormat(template, data) {
94
+ var isArray2 = Array.isArray(data);
95
+ return template.replace(stringFormatRegExp, function($0, $1) {
96
+ return data[isArray2 ? parseInt($1) : $1];
97
+ });
98
+ }
99
+ function escapeHtml(str) {
100
+ return $("<div>").text(str).html();
101
+ }
102
+ function tryParseInt(value) {
103
+ if (/^(\-|\+)?([0-9]+)$/.test(value)) {
104
+ return Number(value);
105
+ }
106
+ return NaN;
107
+ }
108
+ function tryParseFloat(value) {
109
+ if (/^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(value)) {
110
+ return Number(value);
111
+ }
112
+ return NaN;
113
+ }
114
+ function parseToLocalDate(date) {
115
+ if (date instanceof Date)
116
+ return date;
117
+ var isUtc = /Z|[\+\-]\d\d:?\d\d/i.test(date);
118
+ if (!isUtc) {
119
+ date += "Z";
120
+ }
121
+ return new Date(date);
122
+ }
123
+ function adjustTimezone(date) {
124
+ return new Date(
125
+ Date.UTC(
126
+ date.getFullYear(),
127
+ date.getMonth(),
128
+ date.getDate(),
129
+ date.getHours(),
130
+ date.getMinutes(),
131
+ date.getSeconds(),
132
+ date.getMilliseconds()
133
+ )
134
+ );
135
+ }
136
+ function unadjustTimezone(date) {
137
+ return new Date(
138
+ date.getUTCFullYear(),
139
+ date.getUTCMonth(),
140
+ date.getUTCDate(),
141
+ date.getUTCHours(),
142
+ date.getUTCMinutes(),
143
+ date.getUTCSeconds(),
144
+ date.getUTCMilliseconds()
145
+ );
146
+ }
147
+ function areEqual(v1, v2) {
148
+ if (v1 instanceof Date && v2 instanceof Date) {
149
+ if (v1.getTime() !== v2.getTime()) {
150
+ return false;
151
+ }
152
+ } else if (v1 !== v2) {
153
+ return false;
154
+ }
155
+ return true;
156
+ }
157
+ function reportSourcesAreEqual(rs1, rs2) {
158
+ if (rs1 && rs2 && rs1.report === rs2.report) {
159
+ var params1String = "";
160
+ if (rs1.parameters) {
161
+ params1String = JSON.stringify(rs1.parameters);
162
+ }
163
+ var params2String = "";
164
+ if (rs2.parameters) {
165
+ params2String = JSON.stringify(rs2.parameters);
166
+ }
167
+ return params1String === params2String;
168
+ }
169
+ return false;
170
+ }
171
+ function areEqualArrays(array1, array2) {
172
+ if (array1 === null) {
173
+ if (array2 !== null) {
174
+ return false;
175
+ }
176
+ return true;
177
+ }
178
+ if (array2 === null) {
179
+ return false;
180
+ }
181
+ if (array1.length !== array2.length) {
182
+ return false;
183
+ }
184
+ for (var j = array1.length - 1; j >= 0; j--) {
185
+ if (!areEqual(array1[j], array2[j])) {
186
+ return false;
187
+ }
188
+ }
189
+ return true;
190
+ }
191
+ function isSvgSupported() {
192
+ var matches = /Version\/(\d+.\d+.\d+) Safari/.exec(navigator.userAgent);
193
+ if (matches && matches.length > 1) {
194
+ var version = parseFloat(matches[1]);
195
+ return version >= 6;
196
+ }
197
+ return true;
198
+ }
199
+ function isInternalServerError(error) {
200
+ if (error) {
201
+ return replaceAll(error, " ", "").toLowerCase() === "internalservererror";
202
+ }
203
+ return false;
204
+ }
205
+ function isSystemArgumentException(xhr) {
206
+ var exceptionShortName = "ArgumentException";
207
+ var exceptionInstance = getExceptionInstance(xhr);
208
+ return isExceptionInstanceOfType(exceptionInstance, exceptionShortName, "System." + exceptionShortName);
209
+ }
210
+ function isInvalidClientException(xhr) {
211
+ var exceptionShortName = "InvalidClientException";
212
+ var exceptionInstance = getExceptionInstance(xhr);
213
+ return isExceptionInstanceOfType(exceptionInstance, exceptionShortName, "Telerik.Reporting.Services.Engine." + exceptionShortName);
214
+ }
215
+ function isApplicationException(xhr) {
216
+ return isApplicationExceptionInstance(getExceptionInstance(xhr));
217
+ }
218
+ function isApplicationExceptionInstance(exception) {
219
+ var exceptionShortName = "DrawingFactoryUnavailableException";
220
+ return isExceptionInstanceOfType(exception, exceptionShortName, "Telerik.Drawing.Contract." + exceptionShortName);
221
+ }
222
+ function isExceptionOfType(xhr, exceptionType) {
223
+ return isExceptionInstanceOfType(getExceptionInstance(xhr), exceptionType, exceptionType);
224
+ }
225
+ function isExceptionInstanceOfType(exceptionInstance, exceptionTypeShortName, exceptionTypeFullName) {
226
+ return exceptionInstance && exceptionInstance.exceptionType && exceptionTypeNamesMatch(exceptionInstance.exceptionType, exceptionTypeShortName, exceptionTypeFullName);
227
+ }
228
+ function exceptionTypeNamesMatch(instanceTypeName, exceptionTypeShortName, exceptionTypeFullName) {
229
+ return instanceTypeName && (instanceTypeName === exceptionTypeFullName || instanceTypeName.endsWith(exceptionTypeShortName));
230
+ }
231
+ function parseJSON(json) {
232
+ try {
233
+ return JSON.parse(
234
+ json,
235
+ function(key, value) {
236
+ if (key && value) {
237
+ var firstChar = key.charAt(0);
238
+ if (firstChar === firstChar.toUpperCase()) {
239
+ var newPropertyName = firstChar.toLowerCase() + key.slice(1);
240
+ this[newPropertyName] = value;
241
+ }
242
+ }
243
+ return value;
244
+ }
245
+ );
246
+ } catch (e) {
247
+ return null;
248
+ }
249
+ }
250
+ function getExceptionInstance(xhr) {
251
+ if (!xhr || !xhr.responseText) {
252
+ return false;
253
+ }
254
+ return parseJSON(xhr.responseText);
255
+ }
256
+ function extend() {
257
+ var copy;
258
+ var name;
259
+ var options;
260
+ var target;
261
+ var i = 0;
262
+ var length = arguments.length;
263
+ target = length > 1 ? arguments[i++] || {} : {};
264
+ for (; i < length; i++) {
265
+ if ((options = arguments[i]) != null) {
266
+ for (name in options) {
267
+ target[name];
268
+ copy = options[name];
269
+ if (target === copy) {
270
+ continue;
271
+ }
272
+ if (copy !== void 0) {
273
+ target[name] = copy;
274
+ }
275
+ }
276
+ }
277
+ }
278
+ return target;
279
+ }
280
+ function each(obj, callback) {
281
+ var length;
282
+ var i = 0;
283
+ if (isArray(obj)) {
284
+ length = obj.length;
285
+ for (; i < length; i++) {
286
+ if (callback.call(obj[i], i, obj[i]) === false) {
287
+ break;
288
+ }
289
+ }
290
+ } else {
291
+ for (i in obj) {
292
+ if (callback.call(obj[i], i, obj[i]) === false) {
293
+ break;
294
+ }
295
+ }
296
+ }
297
+ return obj;
298
+ }
299
+ function selector() {
300
+ return document.querySelectorAll(arguments[0]);
301
+ }
302
+ function isArray(obj) {
303
+ if (Array.isArray(obj))
304
+ return true;
305
+ var length = Boolean(obj) && "length" in obj && obj.length;
306
+ if (typeof length === "number") {
307
+ return true;
308
+ }
309
+ return false;
310
+ }
311
+ function loadScriptWithCallback(src, done, version) {
312
+ var js = document.createElement("script");
313
+ js.src = src;
314
+ js.onload = function() {
315
+ done(version);
316
+ };
317
+ js.onerror = function() {
318
+ logError(new Error("Failed to load script " + src));
319
+ };
320
+ document.head.appendChild(js);
321
+ }
322
+ function loadScript(url) {
323
+ var ajaxOptions = {
324
+ dataType: "script",
325
+ cache: true
326
+ };
327
+ return $ajax(url, ajaxOptions);
328
+ }
329
+ function filterUniqueLastOccurrence(array) {
330
+ function onlyLastUnique(value, index, self) {
331
+ return self.lastIndexOf(value) === index;
332
+ }
333
+ return array.filter(onlyLastUnique);
334
+ }
335
+ function logError(error) {
336
+ var console = window.console;
337
+ if (console && console.error) {
338
+ console.error(error);
339
+ }
340
+ }
341
+ function findElement(selectorChain) {
342
+ if (selectorChain.constructor != Array) {
343
+ selectorChain = [selectorChain];
344
+ }
345
+ var $area = $(selectorChain[0]);
346
+ for (var i = 1; i < selectorChain.length; i++) {
347
+ $area = $area.find(selectorChain[i]);
348
+ }
349
+ return $area;
350
+ }
351
+ function toRgbColor(hexColor) {
352
+ if (hexColor && hexColor.length < 6) {
353
+ var index = 1;
354
+ var hexParts = hexColor.split("");
355
+ if (hexParts[0] !== "#") {
356
+ index = 0;
357
+ }
358
+ for (index; index < hexParts.length; index++) {
359
+ hexParts[index] = hexParts[index] + hexParts[index];
360
+ }
361
+ hexColor = hexParts.join("");
362
+ }
363
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor);
364
+ return result ? parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16) : null;
365
+ }
366
+ function isRgbColor(color) {
367
+ if (!color) {
368
+ return false;
369
+ }
370
+ return color.indexOf(",") > -1 ? true : false;
371
+ }
372
+ function getColorAlphaValue(color) {
373
+ if (color.toLowerCase() === "transparent") {
374
+ return 0;
375
+ }
376
+ if (!isRgbColor(color)) {
377
+ return 1;
378
+ }
379
+ if (color.indexOf("#") !== -1) {
380
+ color = toRgbColor(color);
381
+ }
382
+ var colorComponents = color.split(",").map(function(c) {
383
+ return c.trim();
384
+ });
385
+ var alpha = colorComponents.length === 4 ? parseFloat((parseFloat(colorComponents[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
386
+ return alpha;
387
+ }
388
+ function $ajax(url, ajaxSettings) {
389
+ return new Promise(function(resolve, reject) {
390
+ $.ajax(url, ajaxSettings).done(function(data) {
391
+ return resolve(data);
392
+ }).fail(function(xhr, status, error) {
393
+ reject(toXhrErrorData(xhr, status, error));
394
+ });
395
+ });
396
+ }
397
+ function type(obj) {
398
+ return Object.prototype.toString.call(obj).slice(8, -1);
399
+ }
400
+ function isEqual(a, b) {
401
+ if (a === b) {
402
+ return true;
403
+ }
404
+ if (a !== a && b !== b) {
405
+ return true;
406
+ }
407
+ if (a !== a && b === b || a === a && b !== b) {
408
+ return false;
409
+ }
410
+ const typeA = type(a);
411
+ const typeB = type(b);
412
+ if (typeA !== typeB) {
413
+ return false;
414
+ }
415
+ if (typeA === "Array") {
416
+ if (a.length !== b.length) {
417
+ return false;
418
+ }
419
+ const length = a.length;
420
+ for (let i = 0; i < length; i++) {
421
+ if (!isEqual(a[i], b[i])) {
422
+ return false;
423
+ }
424
+ }
425
+ return true;
426
+ }
427
+ if (typeA === "Object") {
428
+ const keysA = Object.keys(a);
429
+ const keysB = Object.keys(b);
430
+ if (keysA.length !== keysB.length) {
431
+ return false;
432
+ }
433
+ const length = keysA.length;
434
+ for (let i = 0; i < length; i++) {
435
+ const key = keysA[i];
436
+ if (!isEqual(a[key], b[key])) {
437
+ return false;
438
+ }
439
+ }
440
+ return true;
441
+ }
442
+ if (typeA === "Date") {
443
+ return a.getTime() === b.getTime();
444
+ }
445
+ return false;
446
+ }
447
+
448
+ exports.$ajax = $ajax;
449
+ exports.adjustTimezone = adjustTimezone;
450
+ exports.areEqual = areEqual;
451
+ exports.areEqualArrays = areEqualArrays;
452
+ exports.each = each;
453
+ exports.escapeHtml = escapeHtml;
454
+ exports.exceptionTypeNamesMatch = exceptionTypeNamesMatch;
455
+ exports.extend = extend;
456
+ exports.filterUniqueLastOccurrence = filterUniqueLastOccurrence;
457
+ exports.findElement = findElement;
458
+ exports.generateGuidString = generateGuidString;
459
+ exports.getColorAlphaValue = getColorAlphaValue;
460
+ exports.getExceptionInstance = getExceptionInstance;
461
+ exports.isApplicationException = isApplicationException;
462
+ exports.isApplicationExceptionInstance = isApplicationExceptionInstance;
463
+ exports.isArray = isArray;
464
+ exports.isEqual = isEqual;
465
+ exports.isExceptionOfType = isExceptionOfType;
466
+ exports.isInternalServerError = isInternalServerError;
467
+ exports.isInvalidClientException = isInvalidClientException;
468
+ exports.isRgbColor = isRgbColor;
469
+ exports.isSpecialKey = isSpecialKey;
470
+ exports.isSvgSupported = isSvgSupported;
471
+ exports.isSystemArgumentException = isSystemArgumentException;
472
+ exports.lTrim = lTrim;
473
+ exports.loadScript = loadScript;
474
+ exports.loadScriptWithCallback = loadScriptWithCallback;
475
+ exports.logError = logError;
476
+ exports.parseJSON = parseJSON;
477
+ exports.parseToLocalDate = parseToLocalDate;
478
+ exports.rTrim = rTrim;
479
+ exports.rectangle = rectangle;
480
+ exports.replaceAll = replaceAll;
481
+ exports.reportSourcesAreEqual = reportSourcesAreEqual;
482
+ exports.selector = selector;
483
+ exports.stringFormat = stringFormat;
484
+ exports.toRgbColor = toRgbColor;
485
+ exports.trim = trim;
486
+ exports.tryParseFloat = tryParseFloat;
487
+ exports.tryParseInt = tryParseInt;
488
+ exports.type = type;
489
+ exports.unadjustTimezone = unadjustTimezone;
@@ -0,0 +1,204 @@
1
+ import { stringFormat } from './utils.js';
2
+ import { stringResources } from './stringResources.js';
3
+
4
+ var defaultOptions = {};
5
+ function Accessibility(options) {
6
+ var controller;
7
+ var pageInitialized = false;
8
+ var areas;
9
+ var lastArea;
10
+ var keyMap = {
11
+ CONFIRM_KEY: 13,
12
+ // C
13
+ CONTENT_AREA_KEY: 67,
14
+ // D
15
+ DOCUMENT_MAP_AREA_KEY: 68,
16
+ // M
17
+ MENU_AREA_KEY: 77,
18
+ // P
19
+ PARAMETERS_AREA_KEY: 80
20
+ };
21
+ options = $.extend({}, defaultOptions, options);
22
+ controller = options.controller;
23
+ if (!controller) {
24
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
25
+ }
26
+ controller.reportLoadComplete(function() {
27
+ setAccessibilityUI();
28
+ var content = findContentArea();
29
+ if (content.length > 0) {
30
+ content.focus();
31
+ }
32
+ }).pageReady(function(event, page) {
33
+ initPage(page);
34
+ pageInitialized = true;
35
+ }).error(function(e, message) {
36
+ focusOnErrorMessage();
37
+ window.setTimeout(setAccessibilityUI, 500);
38
+ });
39
+ controller.updateUI(function(e) {
40
+ if (pageInitialized) {
41
+ setPageSelector();
42
+ decorateMenuItems();
43
+ }
44
+ });
45
+ function setAccessibilityUI() {
46
+ if (!areas) {
47
+ initAreas();
48
+ $(document.body).off("keydown", processKeyDown);
49
+ $(document.body).on("keydown", processKeyDown);
50
+ }
51
+ }
52
+ function focusOnErrorMessage() {
53
+ var $errMsg = $("div.trv-pages-area div.trv-error-message");
54
+ if ($errMsg.length === 0) {
55
+ return;
56
+ }
57
+ $errMsg.attr("tabIndex", 0);
58
+ $errMsg.focus();
59
+ }
60
+ function initPage(page) {
61
+ if (!page) {
62
+ return;
63
+ }
64
+ setAccessibilityUI();
65
+ var area = areas[keyMap.CONTENT_AREA_KEY];
66
+ setContentAreaKeyDown(area);
67
+ }
68
+ function setPageSelector() {
69
+ var pagers = document.querySelectorAll(".trv-report-pager");
70
+ var pageNumber = this._controller.getCurrentPageNumber();
71
+ var pageCount = this._controller.getPageCount();
72
+ pagers.forEach((pager) => {
73
+ pager.setAttribute("aria-label", stringFormat(stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
74
+ var pageInputs = pager.querySelectorAll("input[data-role=telerik_ReportViewer_PageNumberInput]");
75
+ pageInputs.forEach((input) => {
76
+ input.setAttribute("aria-label", stringResources.ariaLabelPageNumberEditor);
77
+ });
78
+ });
79
+ }
80
+ function initAreas() {
81
+ areas = {};
82
+ areas[keyMap.DOCUMENT_MAP_AREA_KEY] = findDocumentMapArea();
83
+ areas[keyMap.MENU_AREA_KEY] = findMenuArea();
84
+ areas[keyMap.CONTENT_AREA_KEY] = findContentArea();
85
+ var parametersArea = findParametersArea();
86
+ if (parametersArea) {
87
+ areas[keyMap.PARAMETERS_AREA_KEY] = parametersArea;
88
+ setParameterEditorsKeyDown(parametersArea);
89
+ }
90
+ }
91
+ function findContentArea() {
92
+ return $("div[data-role=telerik_ReportViewer_PagesArea]");
93
+ }
94
+ function findDocumentMapArea() {
95
+ return $("div[data-role=telerik_ReportViewer_DocumentMapArea] div[data-role=treeview]");
96
+ }
97
+ function findMenuArea() {
98
+ return $("ul[data-role=telerik_ReportViewer_MainMenu]");
99
+ }
100
+ function findParametersArea() {
101
+ return $("div[data-role=telerik_ReportViewer_ParametersArea] div.trv-parameters-area-content");
102
+ }
103
+ function processKeyDown(event) {
104
+ if (!areas) {
105
+ return;
106
+ }
107
+ if (!(event.altKey && event.ctrlKey)) {
108
+ return;
109
+ }
110
+ var currentArea = areas[event.which];
111
+ if (!currentArea) {
112
+ return;
113
+ }
114
+ if (!IsAreaContainerVisible(currentArea.parent())) {
115
+ return;
116
+ }
117
+ var className = "k-focus";
118
+ if (lastArea) {
119
+ lastArea.removeClass(className);
120
+ }
121
+ currentArea.addClass(className);
122
+ currentArea.focus();
123
+ lastArea = currentArea;
124
+ event.preventDefault();
125
+ }
126
+ function setParameterEditorsKeyDown(parametersAreaContent) {
127
+ if (parametersAreaContent.length === 0) {
128
+ return;
129
+ }
130
+ var $paramsArea = parametersAreaContent.parent("div[data-role=telerik_ReportViewer_ParametersArea]");
131
+ if (!IsAreaContainerVisible($paramsArea)) {
132
+ return;
133
+ }
134
+ Array.from(parametersAreaContent.children()).forEach((child) => {
135
+ $(child).on("keydown", (event) => {
136
+ if (event.which == keyMap.CONFIRM_KEY) {
137
+ var paramsButton = $paramsArea.find("button.trv-parameters-area-preview-button");
138
+ paramsButton.focus();
139
+ event.preventDefault();
140
+ }
141
+ });
142
+ });
143
+ }
144
+ function IsAreaContainerVisible(container) {
145
+ return container && !(container.hasClass("k-collapsed") || container.hasClass("trv-hidden"));
146
+ }
147
+ function setContentAreaKeyDown(contentArea) {
148
+ if (!contentArea) {
149
+ return;
150
+ }
151
+ var actions = contentArea.find("div [data-reporting-action]");
152
+ if (!actions.length > 0) {
153
+ return;
154
+ }
155
+ Array.from(actions).forEach((action) => {
156
+ var $action = $(action);
157
+ $action.on("keydown", (event) => {
158
+ if (event.which == keyMap.CONFIRM_KEY) {
159
+ $action.trigger("click");
160
+ }
161
+ });
162
+ });
163
+ }
164
+ function decorateMenuItems() {
165
+ var menuAreas = areas[keyMap.MENU_AREA_KEY];
166
+ if (!menuAreas) {
167
+ return;
168
+ }
169
+ Array.from(menuAreas).forEach((menu) => {
170
+ var $menu = $(menu);
171
+ var menuItems = $menu.children("li.k-item");
172
+ Array.from(menuItems).forEach((menuItem) => {
173
+ var $menuItem = $(menuItem);
174
+ if (!$menuItem.hasClass("trv-report-pager")) {
175
+ var ariaLabel = $menuItem.attr("aria-label");
176
+ var expandableSr = stringFormat(". {0}", [stringResources.ariaLabelExpandable]);
177
+ var expandable = $menuItem.find("ul").length > 0 && ariaLabel.indexOf(expandableSr) < 0 ? expandableSr : "";
178
+ var selectedSr = stringFormat(". {0}", [stringResources.ariaLabelSelected]);
179
+ var selected = $menuItem.hasClass("k-selected") && ariaLabel.indexOf(selectedSr) < 0 ? selectedSr : "";
180
+ var label = ariaLabel + expandable + selected;
181
+ $menuItem.attr("aria-label", label);
182
+ if ($menuItem.hasClass("k-disabled")) {
183
+ $menuItem.attr("aria-disabled", "true");
184
+ } else {
185
+ $menuItem.removeAttr("aria-disabled");
186
+ }
187
+ }
188
+ });
189
+ });
190
+ }
191
+ function setKeyMap(keyMapValues) {
192
+ keyMap = keyMapValues;
193
+ areas = void 0;
194
+ }
195
+ function getKeyMap() {
196
+ return keyMap;
197
+ }
198
+ return {
199
+ getKeyMap,
200
+ setKeyMap
201
+ };
202
+ }
203
+
204
+ export { Accessibility };
@@ -0,0 +1,22 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ class BaseComponent {
8
+ // #endregion
9
+ // #region constructor
10
+ constructor(element, options) {
11
+ // #region fields
12
+ __publicField(this, "element");
13
+ __publicField(this, "$element");
14
+ __publicField(this, "options");
15
+ this.element = element;
16
+ this.$element = $(element);
17
+ this.options = options;
18
+ }
19
+ // #endregion
20
+ }
21
+
22
+ export { BaseComponent };