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