@progress/telerik-jquery-report-viewer 21.24.305 → 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 +8562 -8606
  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.305.ttf → ReportingIcons-18.1.24.514.ttf} +0 -0
@@ -0,0 +1,332 @@
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
+
8
+ var lastSelectedMenuItem;
9
+ var lastSelectedSubmenuItem;
10
+ function MainMenu(dom, rootOptions, otherOptions) {
11
+ var options = $.extend({}, rootOptions, otherOptions);
12
+ var menu = $(dom).data("kendoMenu");
13
+ var childrenL1 = dom.childNodes;
14
+ var controller = options.controller;
15
+ var enableAccessibility = options.enableAccessibility;
16
+ if (!controller) {
17
+ throw "No controller (telerikReporting.ReportViewerController) has been specified.";
18
+ }
19
+ if (!menu) {
20
+ init();
21
+ }
22
+ controller.reportLoadComplete(function(e, args) {
23
+ if (!enableAccessibility) {
24
+ if (menu && menu._oldHoverItem) {
25
+ menu._oldHoverItem.toggleClass("k-focus");
26
+ }
27
+ }
28
+ if (!args.renderingExtensions) {
29
+ controller.getDocumentFormats().then(fillFormats);
30
+ } else {
31
+ fillFormats(args.renderingExtensions);
32
+ }
33
+ });
34
+ function init() {
35
+ try {
36
+ menu = $(dom).kendoMenu().data("kendoMenu");
37
+ } catch (e) {
38
+ console.error("Instantiation of Kendo Menu as Main Menu threw an exception", e);
39
+ throw e;
40
+ }
41
+ menu.bind("activate", onSubmenuActivate);
42
+ menu.bind("deactivate", onSubmenuDeactivate);
43
+ menu.element.off("keydown", onMenuKeyDown);
44
+ menu.element.on("keydown", onMenuKeyDown);
45
+ if (options.enableAccessibility) {
46
+ setTabIndexes();
47
+ }
48
+ replaceStringResources();
49
+ }
50
+ function setTabIndexes() {
51
+ var $menus = $.find('[data-role="telerik_ReportViewer_MainMenu"]');
52
+ utils.each($menus, function() {
53
+ var $menuArea = $(this);
54
+ var listItems = $menuArea.find("li");
55
+ var menuTabIndex = 0;
56
+ var tabIndexAttr = $menuArea.attr("tabIndex");
57
+ if (tabIndexAttr) {
58
+ menuTabIndex = utils.tryParseInt(tabIndexAttr);
59
+ if (!menuTabIndex || isNaN(menuTabIndex)) {
60
+ menuTabIndex = 0;
61
+ }
62
+ }
63
+ setMenuItemsTabIndexes(listItems, menuTabIndex);
64
+ var pager = listItems.find('input[data-role="telerik_ReportViewer_PageNumberInput"]');
65
+ if (pager.length > 0) {
66
+ pager.attr("tabindex", menuTabIndex);
67
+ }
68
+ });
69
+ }
70
+ function setMenuItemsTabIndexes(listItems, menuTabIndex) {
71
+ utils.each(listItems, function() {
72
+ var $item = $(this);
73
+ $item.attr("tabindex", menuTabIndex);
74
+ $item.focus(function() {
75
+ $item.addClass("k-focus");
76
+ });
77
+ $item.blur(function() {
78
+ $item.removeClass("k-focus");
79
+ });
80
+ var anchor = $item.children("a");
81
+ if (anchor.length > 0) {
82
+ var $anchor = $(anchor);
83
+ $anchor.attr("tabindex", -1);
84
+ $item.attr("title", $anchor.attr("title"));
85
+ }
86
+ $item.off("keydown");
87
+ $item.on("keydown", function(event) {
88
+ if (event.which == kendo.keys.ENTER) {
89
+ clickOnMenuItem($item);
90
+ lastSelectedMenuItem = $item;
91
+ }
92
+ });
93
+ });
94
+ }
95
+ function fillFormats(formats) {
96
+ utils.each($(dom).find("ul[data-command-list=export-format-list]"), function() {
97
+ var $list = $(this);
98
+ var $parent = $list.parents("li");
99
+ var tabIndex = enableAccessibility ? $parent.attr("tabindex") : -1;
100
+ if (!tabIndex) {
101
+ tabIndex = 1;
102
+ }
103
+ $list.empty();
104
+ utils.each(formats, function() {
105
+ var format = this;
106
+ var ariaLabel = enableAccessibility ? utils.stringFormat('aria-label="{localizedName}" ', format) : " ";
107
+ 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);
108
+ menu.append(li, $parent);
109
+ });
110
+ if (enableAccessibility) {
111
+ setInternalListAccessibilityKeyEvents($parent.find("li"));
112
+ }
113
+ });
114
+ }
115
+ function setInternalListAccessibilityKeyEvents(listItems) {
116
+ utils.each(listItems, function() {
117
+ var $item = $(this);
118
+ $item.off("keydown");
119
+ $item.on("keydown", function(event) {
120
+ switch (event.which) {
121
+ case kendo.keys.ENTER:
122
+ clickOnMenuItem($item);
123
+ break;
124
+ case kendo.keys.UP:
125
+ var $prev = $item.prev();
126
+ if ($prev.length > 0) {
127
+ $prev.focus();
128
+ } else {
129
+ $item.parents("li").focus();
130
+ }
131
+ break;
132
+ case kendo.keys.DOWN:
133
+ var $next = $item.next();
134
+ if ($next.length > 0) {
135
+ $next.focus();
136
+ } else {
137
+ $item.parent().children("li").first().focus();
138
+ }
139
+ break;
140
+ }
141
+ });
142
+ });
143
+ }
144
+ function clickOnMenuItem(item) {
145
+ if (isItemExportContainer(item)) {
146
+ clickOnExportDropdown();
147
+ } else if (item && item.length > 0) {
148
+ var anchor = item.children("a");
149
+ if (anchor.length > 0) {
150
+ anchor.click();
151
+ }
152
+ }
153
+ }
154
+ function clickOnExportDropdown() {
155
+ var dropDownItemID = "#trv-main-menu-export-command";
156
+ var mainMenu = $("[data-role='telerik_ReportViewer_MainMenu']").data("kendoMenu");
157
+ mainMenu.open(dropDownItemID);
158
+ }
159
+ function onSubmenuActivate(e) {
160
+ var $item = $(e.item);
161
+ focusOnFirstSubmenuItem($item);
162
+ }
163
+ function onSubmenuDeactivate(e) {
164
+ lastSelectedSubmenuItem = void 0;
165
+ }
166
+ function focusOnFirstSubmenuItem(parentItem) {
167
+ if (lastSelectedMenuItem && lastSelectedMenuItem.is(parentItem)) {
168
+ window.setTimeout(function() {
169
+ var li = parentItem.find("li");
170
+ if (li.length > 0) {
171
+ li[0].focus();
172
+ }
173
+ }, 100);
174
+ }
175
+ }
176
+ function onMenuKeyDown(e) {
177
+ switch (e.which) {
178
+ case kendo.keys.ENTER:
179
+ if (!enableAccessibility) {
180
+ var $item = getFocusedItem();
181
+ if ($item.length > 0) {
182
+ if (isItemExportContainer($item) && lastSelectedSubmenuItem) {
183
+ $item = lastSelectedSubmenuItem;
184
+ }
185
+ clickOnMenuItem($item);
186
+ }
187
+ }
188
+ break;
189
+ case kendo.keys.RIGHT:
190
+ enableAccessibility ? focusNextItemAccessibilitySelection() : focusNextItemNativeMenuSelection();
191
+ break;
192
+ case kendo.keys.LEFT:
193
+ enableAccessibility ? focusPreviousItemAccessibilitySelection() : focusPreviousItemNativeMenuSelection();
194
+ break;
195
+ case kendo.keys.DOWN:
196
+ case kendo.keys.UP:
197
+ if (!enableAccessibility) {
198
+ lastSelectedSubmenuItem = getKendoFocusedNestedItem();
199
+ }
200
+ }
201
+ }
202
+ function getFocusedItem() {
203
+ var $item;
204
+ var focusedItem = document.activeElement;
205
+ if (focusedItem && focusedItem.localName == "li") {
206
+ var items = $(childrenL1).filter("li.k-item");
207
+ for (var i = 0; i < items.length; i++) {
208
+ var listItem = items[i];
209
+ if (focusedItem === listItem) {
210
+ $item = $(listItem);
211
+ break;
212
+ }
213
+ }
214
+ } else if (focusedItem && focusedItem.localName == "input") {
215
+ $item = $(focusedItem).closest("li.k-item");
216
+ } else {
217
+ $item = menu.element.children("li.k-item.k-focus");
218
+ if ($item.length === 0) {
219
+ $item = menu.element.children("li.k-item").first();
220
+ }
221
+ }
222
+ return $item;
223
+ }
224
+ function focusNextItemAccessibilitySelection() {
225
+ var $item = getFocusedItem();
226
+ if (!$item || !$item.length > 0) {
227
+ return;
228
+ }
229
+ var $next = $item.next();
230
+ if ($next.css("display") == "none") {
231
+ $next = $next.next();
232
+ }
233
+ if (!$next.length > 0) {
234
+ $next = $(childrenL1).filter("li.k-item").first();
235
+ }
236
+ $next.focus();
237
+ }
238
+ var lastKendoFocusedItem;
239
+ function focusNextItemNativeMenuSelection() {
240
+ var allItems = menu.element.children("li.k-item");
241
+ var $focused = allItems.filter(".k-focus");
242
+ if (kendo.version >= "2017.3.913") {
243
+ lastKendoFocusedItem = $focused;
244
+ return;
245
+ }
246
+ if ($focused.hasClass("k-disabled")) {
247
+ if (!lastKendoFocusedItem || $focused.is(lastKendoFocusedItem)) {
248
+ var $next = $focused.next();
249
+ if (!$next.length > 0) {
250
+ $next = allItems.first();
251
+ }
252
+ $focused.toggleClass("k-focus");
253
+ $next.toggleClass("k-focus");
254
+ lastKendoFocusedItem = $next;
255
+ menu._oldHoverItem = $next;
256
+ } else {
257
+ lastKendoFocusedItem = $focused;
258
+ }
259
+ } else {
260
+ menu._oldHoverItem = $focused;
261
+ lastKendoFocusedItem = $focused;
262
+ }
263
+ }
264
+ function focusPreviousItemAccessibilitySelection() {
265
+ var $item = getFocusedItem();
266
+ if (!$item || !$item.length > 0) {
267
+ return;
268
+ }
269
+ var $prev = $item.prev();
270
+ if ($prev.css("display") == "none") {
271
+ $prev = $prev.prev();
272
+ }
273
+ if (!$prev.length > 0) {
274
+ $prev = $(childrenL1).filter("li.k-item").last();
275
+ }
276
+ $prev.focus();
277
+ }
278
+ function focusPreviousItemNativeMenuSelection() {
279
+ var $focused = menu.element.children("li.k-item.k-focus");
280
+ lastKendoFocusedItem = $focused;
281
+ }
282
+ function getKendoFocusedNestedItem() {
283
+ var $focused = menu.element.find('li.k-item.k-focus [data-command="telerik_ReportViewer_export"]');
284
+ if ($focused.length === 1) {
285
+ return $focused.parent("li");
286
+ }
287
+ return void 0;
288
+ }
289
+ function isItemExportContainer(item) {
290
+ if (item.length === 0) {
291
+ return;
292
+ }
293
+ var id = item.attr("id");
294
+ return id == "trv-main-menu-export-command" || id == "trv-side-menu-export-command";
295
+ }
296
+ function replaceStringResources() {
297
+ var menuAreas = findMenuArea();
298
+ if (!menuAreas) {
299
+ return;
300
+ }
301
+ utils.each(menuAreas, function() {
302
+ var $menu = $(this);
303
+ var menuItems = $menu.children("li.k-item");
304
+ $menu.attr("aria-label", stringResources.stringResources[$menu.attr("aria-label")]);
305
+ utils.each(menuItems, function() {
306
+ var $menuItem = $(this);
307
+ $menuItem.attr("aria-label", stringResources.stringResources[$menuItem.attr("aria-label")]);
308
+ if (!$menuItem.hasClass("trv-report-pager")) {
309
+ var $a = $menuItem.find("a");
310
+ if ($a) {
311
+ $a.attr("title", stringResources.stringResources[$a.attr("title")]);
312
+ }
313
+ } else {
314
+ $menuItem.attr("title", stringResources.stringResources[$menuItem.attr("title")]);
315
+ }
316
+ });
317
+ });
318
+ }
319
+ function findMenuArea() {
320
+ return utils.findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
321
+ }
322
+ }
323
+ var pluginName = "telerik_ReportViewer_MainMenu";
324
+ $.fn[pluginName] = function(options, otherOptions) {
325
+ return utils.each(this, function() {
326
+ if (!$.data(this, pluginName)) {
327
+ $.data(this, pluginName, new MainMenu(this, options, otherOptions));
328
+ }
329
+ });
330
+ };
331
+
332
+ exports.MainMenu = MainMenu;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __publicField = (obj, key, value) => {
8
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
+ return value;
10
+ };
11
+ class MemStorage {
12
+ // #endregion
13
+ // #region constructor
14
+ constructor() {
15
+ // #region fields
16
+ __publicField(this, "_data", {});
17
+ this._data = {};
18
+ }
19
+ // #endregion
20
+ // #region properties
21
+ get length() {
22
+ return Object.keys(this._data).length;
23
+ }
24
+ // #endregion
25
+ // #region methods
26
+ getItem(key) {
27
+ return this._data[key] || null;
28
+ }
29
+ setItem(key, value) {
30
+ this._data[key] = value;
31
+ }
32
+ removeItem(key) {
33
+ delete this._data[key];
34
+ }
35
+ key(index) {
36
+ return Object.keys(this._data)[index] || null;
37
+ }
38
+ clear() {
39
+ this._data = {};
40
+ }
41
+ // #endregion
42
+ }
43
+
44
+ exports.MemStorage = MemStorage;