@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.
- package/README.md +1 -1
- package/dist/cjs/accessibility.js +218 -0
- package/dist/cjs/binder.js +172 -0
- package/dist/cjs/command.js +32 -0
- package/dist/cjs/commandSet.js +167 -0
- package/dist/cjs/controller.js +1207 -0
- package/dist/cjs/documentMapArea.js +168 -0
- package/dist/cjs/domUtils.js +50 -0
- package/dist/cjs/enums.js +52 -0
- package/dist/cjs/event-emitter.js +17 -0
- package/dist/cjs/events.js +23 -0
- package/dist/cjs/globalSettings.js +9 -0
- package/dist/cjs/history.js +131 -0
- package/dist/cjs/index.js +58 -0
- package/dist/cjs/jqueryThrottleDebounce.js +48 -0
- package/dist/cjs/kendo-jquery.js +4 -0
- package/dist/cjs/mainMenu.js +332 -0
- package/dist/cjs/mem-storage.js +44 -0
- package/dist/cjs/pagesArea.js +641 -0
- package/dist/cjs/parameterValidators.js +167 -0
- package/dist/cjs/parameters.js +921 -0
- package/dist/cjs/parametersArea.js +502 -0
- package/dist/cjs/perspectives.js +138 -0
- package/dist/cjs/print.js +166 -0
- package/dist/cjs/report-viewer/report-viewer-settings.js +138 -0
- package/dist/cjs/reportViewer.js +654 -0
- package/dist/cjs/scroll.js +537 -0
- package/dist/cjs/search.js +634 -0
- package/dist/cjs/sendEmail.js +435 -0
- package/dist/cjs/service-client-sentinel.js +52 -0
- package/dist/cjs/serviceClient.js +405 -0
- package/dist/cjs/sideMenu.js +225 -0
- package/dist/cjs/sr.js +164 -0
- package/dist/cjs/stringResources.js +11 -0
- package/dist/cjs/telerikReportViewer.kendo.js +60196 -0
- package/dist/cjs/telerikReportViewer.kendo.min.js +19776 -0
- package/dist/cjs/template-cache.js +39 -0
- package/dist/cjs/touch.js +86 -0
- package/dist/cjs/uiController.js +142 -0
- package/dist/cjs/uiFreezeCoordinator.js +281 -0
- package/dist/cjs/utils.js +492 -0
- package/dist/es/accessibility.js +214 -0
- package/dist/es/binder.js +168 -0
- package/dist/es/command.js +28 -0
- package/dist/es/commandSet.js +163 -0
- package/dist/es/controller.js +1203 -0
- package/dist/es/documentMapArea.js +164 -0
- package/dist/es/domUtils.js +43 -0
- package/dist/es/enums.js +41 -0
- package/dist/es/event-emitter.js +13 -0
- package/dist/es/events.js +19 -0
- package/dist/es/globalSettings.js +5 -0
- package/dist/es/history.js +127 -0
- package/dist/es/index.js +24 -0
- package/dist/es/jqueryThrottleDebounce.js +46 -0
- package/dist/es/kendo-jquery.js +1 -0
- package/dist/es/mainMenu.js +328 -0
- package/dist/es/mem-storage.js +40 -0
- package/dist/es/pagesArea.js +637 -0
- package/dist/es/parameterValidators.js +163 -0
- package/dist/es/parameters.js +916 -0
- package/dist/es/parametersArea.js +498 -0
- package/dist/es/perspectives.js +134 -0
- package/dist/es/print.js +162 -0
- package/dist/es/report-viewer/report-viewer-settings.js +134 -0
- package/dist/es/reportViewer.js +650 -0
- package/dist/es/scroll.js +533 -0
- package/dist/es/search.js +630 -0
- package/dist/es/sendEmail.js +431 -0
- package/dist/es/service-client-sentinel.js +48 -0
- package/dist/es/serviceClient.js +401 -0
- package/dist/es/sideMenu.js +221 -0
- package/dist/es/sr.js +162 -0
- package/dist/es/stringResources.js +7 -0
- package/dist/es/telerikReportViewer.kendo.js +60194 -0
- package/dist/es/telerikReportViewer.kendo.min.js +19774 -0
- package/dist/es/template-cache.js +35 -0
- package/dist/es/touch.js +82 -0
- package/dist/es/uiController.js +138 -0
- package/dist/es/uiFreezeCoordinator.js +277 -0
- package/dist/es/utils.js +447 -0
- package/dist/font/font-icons.css +4 -4
- package/dist/font/font-icons.min.css +3 -3
- package/dist/js/telerikReportViewer.js +8562 -8606
- package/dist/js/telerikReportViewer.min.js +1 -17
- package/dist/js/telerikReportViewer.stringResources.js +166 -173
- package/dist/styles/telerikReportViewer.css +1 -1
- package/dist/styles/telerikReportViewer.min.css +1 -1
- package/dist/templates/telerikReportViewerTemplate-FA.html +3 -3
- package/dist/templates/telerikReportViewerTemplate.html +3 -3
- package/package.json +13 -7
- /package/dist/font/{ReportingIcons-18.0.24.305.ttf → ReportingIcons-18.1.24.514.ttf} +0 -0
@@ -0,0 +1,328 @@
|
|
1
|
+
import { each, tryParseInt, stringFormat, findElement } 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 = $.find('[data-role="telerik_ReportViewer_MainMenu"]');
|
48
|
+
each($menus, function() {
|
49
|
+
var $menuArea = $(this);
|
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
|
+
each(listItems, function() {
|
68
|
+
var $item = $(this);
|
69
|
+
$item.attr("tabindex", menuTabIndex);
|
70
|
+
$item.focus(function() {
|
71
|
+
$item.addClass("k-focus");
|
72
|
+
});
|
73
|
+
$item.blur(function() {
|
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
|
+
each($(dom).find("ul[data-command-list=export-format-list]"), function() {
|
93
|
+
var $list = $(this);
|
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
|
+
each(formats, function() {
|
101
|
+
var format = this;
|
102
|
+
var ariaLabel = enableAccessibility ? stringFormat('aria-label="{localizedName}" ', format) : " ";
|
103
|
+
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);
|
104
|
+
menu.append(li, $parent);
|
105
|
+
});
|
106
|
+
if (enableAccessibility) {
|
107
|
+
setInternalListAccessibilityKeyEvents($parent.find("li"));
|
108
|
+
}
|
109
|
+
});
|
110
|
+
}
|
111
|
+
function setInternalListAccessibilityKeyEvents(listItems) {
|
112
|
+
each(listItems, function() {
|
113
|
+
var $item = $(this);
|
114
|
+
$item.off("keydown");
|
115
|
+
$item.on("keydown", function(event) {
|
116
|
+
switch (event.which) {
|
117
|
+
case kendo.keys.ENTER:
|
118
|
+
clickOnMenuItem($item);
|
119
|
+
break;
|
120
|
+
case kendo.keys.UP:
|
121
|
+
var $prev = $item.prev();
|
122
|
+
if ($prev.length > 0) {
|
123
|
+
$prev.focus();
|
124
|
+
} else {
|
125
|
+
$item.parents("li").focus();
|
126
|
+
}
|
127
|
+
break;
|
128
|
+
case kendo.keys.DOWN:
|
129
|
+
var $next = $item.next();
|
130
|
+
if ($next.length > 0) {
|
131
|
+
$next.focus();
|
132
|
+
} else {
|
133
|
+
$item.parent().children("li").first().focus();
|
134
|
+
}
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
});
|
138
|
+
});
|
139
|
+
}
|
140
|
+
function clickOnMenuItem(item) {
|
141
|
+
if (isItemExportContainer(item)) {
|
142
|
+
clickOnExportDropdown();
|
143
|
+
} else if (item && item.length > 0) {
|
144
|
+
var anchor = item.children("a");
|
145
|
+
if (anchor.length > 0) {
|
146
|
+
anchor.click();
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
function clickOnExportDropdown() {
|
151
|
+
var dropDownItemID = "#trv-main-menu-export-command";
|
152
|
+
var mainMenu = $("[data-role='telerik_ReportViewer_MainMenu']").data("kendoMenu");
|
153
|
+
mainMenu.open(dropDownItemID);
|
154
|
+
}
|
155
|
+
function onSubmenuActivate(e) {
|
156
|
+
var $item = $(e.item);
|
157
|
+
focusOnFirstSubmenuItem($item);
|
158
|
+
}
|
159
|
+
function onSubmenuDeactivate(e) {
|
160
|
+
lastSelectedSubmenuItem = void 0;
|
161
|
+
}
|
162
|
+
function focusOnFirstSubmenuItem(parentItem) {
|
163
|
+
if (lastSelectedMenuItem && lastSelectedMenuItem.is(parentItem)) {
|
164
|
+
window.setTimeout(function() {
|
165
|
+
var li = parentItem.find("li");
|
166
|
+
if (li.length > 0) {
|
167
|
+
li[0].focus();
|
168
|
+
}
|
169
|
+
}, 100);
|
170
|
+
}
|
171
|
+
}
|
172
|
+
function onMenuKeyDown(e) {
|
173
|
+
switch (e.which) {
|
174
|
+
case kendo.keys.ENTER:
|
175
|
+
if (!enableAccessibility) {
|
176
|
+
var $item = getFocusedItem();
|
177
|
+
if ($item.length > 0) {
|
178
|
+
if (isItemExportContainer($item) && lastSelectedSubmenuItem) {
|
179
|
+
$item = lastSelectedSubmenuItem;
|
180
|
+
}
|
181
|
+
clickOnMenuItem($item);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
break;
|
185
|
+
case kendo.keys.RIGHT:
|
186
|
+
enableAccessibility ? focusNextItemAccessibilitySelection() : focusNextItemNativeMenuSelection();
|
187
|
+
break;
|
188
|
+
case kendo.keys.LEFT:
|
189
|
+
enableAccessibility ? focusPreviousItemAccessibilitySelection() : focusPreviousItemNativeMenuSelection();
|
190
|
+
break;
|
191
|
+
case kendo.keys.DOWN:
|
192
|
+
case kendo.keys.UP:
|
193
|
+
if (!enableAccessibility) {
|
194
|
+
lastSelectedSubmenuItem = getKendoFocusedNestedItem();
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
function getFocusedItem() {
|
199
|
+
var $item;
|
200
|
+
var focusedItem = document.activeElement;
|
201
|
+
if (focusedItem && focusedItem.localName == "li") {
|
202
|
+
var items = $(childrenL1).filter("li.k-item");
|
203
|
+
for (var i = 0; i < items.length; i++) {
|
204
|
+
var listItem = items[i];
|
205
|
+
if (focusedItem === listItem) {
|
206
|
+
$item = $(listItem);
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
} else if (focusedItem && focusedItem.localName == "input") {
|
211
|
+
$item = $(focusedItem).closest("li.k-item");
|
212
|
+
} else {
|
213
|
+
$item = menu.element.children("li.k-item.k-focus");
|
214
|
+
if ($item.length === 0) {
|
215
|
+
$item = menu.element.children("li.k-item").first();
|
216
|
+
}
|
217
|
+
}
|
218
|
+
return $item;
|
219
|
+
}
|
220
|
+
function focusNextItemAccessibilitySelection() {
|
221
|
+
var $item = getFocusedItem();
|
222
|
+
if (!$item || !$item.length > 0) {
|
223
|
+
return;
|
224
|
+
}
|
225
|
+
var $next = $item.next();
|
226
|
+
if ($next.css("display") == "none") {
|
227
|
+
$next = $next.next();
|
228
|
+
}
|
229
|
+
if (!$next.length > 0) {
|
230
|
+
$next = $(childrenL1).filter("li.k-item").first();
|
231
|
+
}
|
232
|
+
$next.focus();
|
233
|
+
}
|
234
|
+
var lastKendoFocusedItem;
|
235
|
+
function focusNextItemNativeMenuSelection() {
|
236
|
+
var allItems = menu.element.children("li.k-item");
|
237
|
+
var $focused = allItems.filter(".k-focus");
|
238
|
+
if (kendo.version >= "2017.3.913") {
|
239
|
+
lastKendoFocusedItem = $focused;
|
240
|
+
return;
|
241
|
+
}
|
242
|
+
if ($focused.hasClass("k-disabled")) {
|
243
|
+
if (!lastKendoFocusedItem || $focused.is(lastKendoFocusedItem)) {
|
244
|
+
var $next = $focused.next();
|
245
|
+
if (!$next.length > 0) {
|
246
|
+
$next = allItems.first();
|
247
|
+
}
|
248
|
+
$focused.toggleClass("k-focus");
|
249
|
+
$next.toggleClass("k-focus");
|
250
|
+
lastKendoFocusedItem = $next;
|
251
|
+
menu._oldHoverItem = $next;
|
252
|
+
} else {
|
253
|
+
lastKendoFocusedItem = $focused;
|
254
|
+
}
|
255
|
+
} else {
|
256
|
+
menu._oldHoverItem = $focused;
|
257
|
+
lastKendoFocusedItem = $focused;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
function focusPreviousItemAccessibilitySelection() {
|
261
|
+
var $item = getFocusedItem();
|
262
|
+
if (!$item || !$item.length > 0) {
|
263
|
+
return;
|
264
|
+
}
|
265
|
+
var $prev = $item.prev();
|
266
|
+
if ($prev.css("display") == "none") {
|
267
|
+
$prev = $prev.prev();
|
268
|
+
}
|
269
|
+
if (!$prev.length > 0) {
|
270
|
+
$prev = $(childrenL1).filter("li.k-item").last();
|
271
|
+
}
|
272
|
+
$prev.focus();
|
273
|
+
}
|
274
|
+
function focusPreviousItemNativeMenuSelection() {
|
275
|
+
var $focused = menu.element.children("li.k-item.k-focus");
|
276
|
+
lastKendoFocusedItem = $focused;
|
277
|
+
}
|
278
|
+
function getKendoFocusedNestedItem() {
|
279
|
+
var $focused = menu.element.find('li.k-item.k-focus [data-command="telerik_ReportViewer_export"]');
|
280
|
+
if ($focused.length === 1) {
|
281
|
+
return $focused.parent("li");
|
282
|
+
}
|
283
|
+
return void 0;
|
284
|
+
}
|
285
|
+
function isItemExportContainer(item) {
|
286
|
+
if (item.length === 0) {
|
287
|
+
return;
|
288
|
+
}
|
289
|
+
var id = item.attr("id");
|
290
|
+
return id == "trv-main-menu-export-command" || id == "trv-side-menu-export-command";
|
291
|
+
}
|
292
|
+
function replaceStringResources() {
|
293
|
+
var menuAreas = findMenuArea();
|
294
|
+
if (!menuAreas) {
|
295
|
+
return;
|
296
|
+
}
|
297
|
+
each(menuAreas, function() {
|
298
|
+
var $menu = $(this);
|
299
|
+
var menuItems = $menu.children("li.k-item");
|
300
|
+
$menu.attr("aria-label", stringResources[$menu.attr("aria-label")]);
|
301
|
+
each(menuItems, function() {
|
302
|
+
var $menuItem = $(this);
|
303
|
+
$menuItem.attr("aria-label", stringResources[$menuItem.attr("aria-label")]);
|
304
|
+
if (!$menuItem.hasClass("trv-report-pager")) {
|
305
|
+
var $a = $menuItem.find("a");
|
306
|
+
if ($a) {
|
307
|
+
$a.attr("title", stringResources[$a.attr("title")]);
|
308
|
+
}
|
309
|
+
} else {
|
310
|
+
$menuItem.attr("title", stringResources[$menuItem.attr("title")]);
|
311
|
+
}
|
312
|
+
});
|
313
|
+
});
|
314
|
+
}
|
315
|
+
function findMenuArea() {
|
316
|
+
return findElement("ul[data-role=telerik_ReportViewer_MainMenu]");
|
317
|
+
}
|
318
|
+
}
|
319
|
+
var pluginName = "telerik_ReportViewer_MainMenu";
|
320
|
+
$.fn[pluginName] = function(options, otherOptions) {
|
321
|
+
return each(this, function() {
|
322
|
+
if (!$.data(this, pluginName)) {
|
323
|
+
$.data(this, pluginName, new MainMenu(this, options, otherOptions));
|
324
|
+
}
|
325
|
+
});
|
326
|
+
};
|
327
|
+
|
328
|
+
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 };
|